diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 239 |
1 files changed, 181 insertions, 58 deletions
diff --git a/configure.ac b/configure.ac index 7af7e83df..4cc74e4fe 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -228,8 +228,10 @@ AM_CONDITIONAL(HAVE_SSH_KEY, ssh -D 12345 -o "BatchMode yes" -o "UserKnownHosts | |||
228 | rm -f /tmp/gnunet_test_cosks_ssh_garbage | 228 | rm -f /tmp/gnunet_test_cosks_ssh_garbage |
229 | 229 | ||
230 | # autotools' m4 for python has no maximum version! | 230 | # autotools' m4 for python has no maximum version! |
231 | # python3.4 - python3.7 for tests | 231 | # python3.4 - python3.8 for tests (3.8 unchecked) |
232 | m4_define_default([_AM_PYTHON_INTERPRETER_LIST],[python3 python3.4 python3.5 python3.6 python3.7 python]) | 232 | # TODO: document how to override the lowest version |
233 | # TODO: found by this. | ||
234 | m4_define_default([_AM_PYTHON_INTERPRETER_LIST],[python3 python3.4 python3.5 python3.6 python3.7 python3.8 python]) | ||
233 | AM_PATH_PYTHON([3.4],, [:]) | 235 | AM_PATH_PYTHON([3.4],, [:]) |
234 | AC_SUBST([PYTHON]) | 236 | AC_SUBST([PYTHON]) |
235 | AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) | 237 | AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) |
@@ -313,6 +315,18 @@ AS_IF([test x"$VAR_UPNPC_BINARY" != x"false"], | |||
313 | [AC_DEFINE_UNQUOTED([UPNPC], "$VAR_UPNPC_BINARY", [Path to upnpc binary])], | 315 | [AC_DEFINE_UNQUOTED([UPNPC], "$VAR_UPNPC_BINARY", [Path to upnpc binary])], |
314 | [AC_MSG_WARN([warning: 'upnpc' binary not found.])]) | 316 | [AC_MSG_WARN([warning: 'upnpc' binary not found.])]) |
315 | 317 | ||
318 | |||
319 | # uncrustify | ||
320 | # TODO: maybe add flag to pass location | ||
321 | AC_CHECK_PROG(UNCRUSTIFY_BINARY, uncrustify, true) | ||
322 | AM_CONDITIONAL(HAVE_UNCRUSTIFY_BINARY, $UNCRUSTIFY_BINARY) | ||
323 | |||
324 | # yapf | ||
325 | # TODO: less repetition, add flag to pass name | ||
326 | AC_CHECK_PROGS(YAPF_BINARY, [yapf yapf3.0 yapf3.1 yapf3.2 yapf3.3 yapf3.4 yapf3.5 yapf3.6 yapf3.7 yapf3.8 yapf3.9 yapf4.0], false) | ||
327 | AM_CONDITIONAL(HAVE_YAPF_BINARY, test x$YAPF_BINARY != xfalse) | ||
328 | |||
329 | |||
316 | AC_CHECK_MEMBER(struct tm.tm_gmtoff, | 330 | AC_CHECK_MEMBER(struct tm.tm_gmtoff, |
317 | [AC_DEFINE(HAVE_TM_GMTOFF, 1, | 331 | [AC_DEFINE(HAVE_TM_GMTOFF, 1, |
318 | [Define if struct tm has the tm_gmtoff member.])], | 332 | [Define if struct tm has the tm_gmtoff member.])], |
@@ -347,10 +361,10 @@ AS_IF([test $gcrypt = 0], | |||
347 | AC_MSG_ERROR([[ | 361 | AC_MSG_ERROR([[ |
348 | *** | 362 | *** |
349 | *** You need libgcrypt to build this program. | 363 | *** You need libgcrypt to build this program. |
350 | ** This library is for example available at | 364 | *** This library is for example available at |
351 | *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/ | 365 | *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/. |
352 | *** (at least version $NEED_LIBGCRYPT_VERSION (API $NEED_LIBGCRYPT_API) | 366 | *** At least version $NEED_LIBGCRYPT_VERSION (API $NEED_LIBGCRYPT_API) |
353 | *** is required.) | 367 | *** is required. |
354 | ***]]) | 368 | ***]]) |
355 | ]) | 369 | ]) |
356 | AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], "$NEED_LIBGCRYPT_VERSION", [required libgcrypt version]) | 370 | AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], "$NEED_LIBGCRYPT_VERSION", [required libgcrypt version]) |
@@ -399,8 +413,9 @@ AC_MSG_RESULT($texi2mdoc_generation) | |||
399 | AS_IF([test "x$texi2mdoc_generation" = "xyes"], | 413 | AS_IF([test "x$texi2mdoc_generation" = "xyes"], |
400 | [AS_IF([test "$texi2mdoc" = 0], | 414 | [AS_IF([test "$texi2mdoc" = 0], |
401 | [AC_MSG_WARN([ERROR: transpiled mdoc output requires texi2mdoc.]) | 415 | [AC_MSG_WARN([ERROR: transpiled mdoc output requires texi2mdoc.]) |
402 | AC_MSG_WARN([ERROR: texi2mdoc can be obtained via your Operating System]) | 416 | AC_MSG_WARN([ERROR: texi2mdoc can be obtained via your]) |
403 | AC_MSG_WARN([ERROR: package manager or from https://mandoc.bsd.lv/texi2mdoc/])], | 417 | AC_MSG_WARN([ERROR: Operating System package manager or from]) |
418 | AC_MSG_WARN([ERROR: https://mandoc.bsd.lv/texi2mdoc/])], | ||
404 | [AM_CONDITIONAL([TEXI2MDOC_GENERATION],true) | 419 | [AM_CONDITIONAL([TEXI2MDOC_GENERATION],true) |
405 | AC_DEFINE([TEXI2MDOC_GENERATION], | 420 | AC_DEFINE([TEXI2MDOC_GENERATION], |
406 | [1], | 421 | [1], |
@@ -414,7 +429,8 @@ AS_IF([test "x$texi2mdoc_generation" = "xyes"], | |||
414 | # should the build process be building only the documentation? | 429 | # should the build process be building only the documentation? |
415 | AC_MSG_CHECKING(whether to build only documentation) | 430 | AC_MSG_CHECKING(whether to build only documentation) |
416 | AC_ARG_ENABLE([documentation-only], | 431 | AC_ARG_ENABLE([documentation-only], |
417 | [AS_HELP_STRING([--enable-documentation-only], [build only the documentation])], | 432 | [AS_HELP_STRING([--enable-documentation-only], |
433 | [build only the documentation])], | ||
418 | [documentation_only=${enableval}], | 434 | [documentation_only=${enableval}], |
419 | [documentation_only=no]) | 435 | [documentation_only=no]) |
420 | AC_MSG_RESULT($documentation_only) | 436 | AC_MSG_RESULT($documentation_only) |
@@ -424,15 +440,14 @@ AS_IF([test "x$documentation_only" = "xyes"], | |||
424 | AC_DEFINE([DOCUMENTATION_ONLY],[1],[Building only the documentation]) | 440 | AC_DEFINE([DOCUMENTATION_ONLY],[1],[Building only the documentation]) |
425 | ],[ | 441 | ],[ |
426 | AM_CONDITIONAL([DOCUMENTATION_ONLY],false) | 442 | AM_CONDITIONAL([DOCUMENTATION_ONLY],false) |
427 | # TODO: Double negation might be a bit hard to parse for some | 443 | AC_DEFINE([DOCUMENTATION_ONLY],[0],[Doing a normal build, more than only documentation]) |
428 | # TODO: people reading the output. | ||
429 | AC_DEFINE([DOCUMENTATION_ONLY],[0],[Not building only the documentation]) | ||
430 | ]) | 444 | ]) |
431 | 445 | ||
432 | # should the build process be including the manpages? (default: yes) | 446 | # should the build process be including the manpages? (default: yes) |
433 | AC_MSG_CHECKING(whether to include man pages) | 447 | AC_MSG_CHECKING(whether to include man pages) |
434 | AC_ARG_ENABLE([include-manpages], | 448 | AC_ARG_ENABLE([include-manpages], |
435 | [AS_HELP_STRING([--disable-include-manpages], [Do not include the man pages in build and installation])], | 449 | [AS_HELP_STRING([--disable-include-manpages], |
450 | [Do not include the man pages in build and installation])], | ||
436 | [include_manpages=${enableval}], | 451 | [include_manpages=${enableval}], |
437 | [include_manpages=yes]) | 452 | [include_manpages=yes]) |
438 | AC_MSG_RESULT($include_manpages) | 453 | AC_MSG_RESULT($include_manpages) |
@@ -590,11 +605,38 @@ AC_LANG_POP(C) | |||
590 | 605 | ||
591 | # check for bluetooth library | 606 | # check for bluetooth library |
592 | bluetooth=0 | 607 | bluetooth=0 |
593 | CHECK_LIBHEADER(BLUETOOTH, bluetooth, ba2str, bluetooth/bluetooth.h,bluetooth=1,) | 608 | AC_MSG_CHECKING(for libbluetooth) |
609 | AC_ARG_WITH(libbluetooth, | ||
610 | [ --with-libbluetooth=PREFIX (base of libbluetooth installation)], | ||
611 | [AC_MSG_RESULT([$with_libbluetooth]) | ||
612 | AS_CASE([$with_libbluetooth], | ||
613 | [no],[], | ||
614 | [yes],[ | ||
615 | CHECK_LIBHEADER(BLUETOOTH, | ||
616 | bluetooth, | ||
617 | ba2str, | ||
618 | bluetooth/bluetooth.h, | ||
619 | bluetooth=1,) | ||
620 | ],[ | ||
621 | LDFLAGS="-L$with_libbluetooth/lib $LDFLAGS" | ||
622 | CPPFLAGS="-I$with_libbluetooth/include $CPPFLAGS" | ||
623 | AC_CHECK_HEADERS(bluetooth/bluetooth.h, | ||
624 | AC_CHECK_LIB([bluetooth], | ||
625 | [ba2str], | ||
626 | EXT_LIB_PATH="-L$with_libbluetooth/lib $EXT_LIB_PATH" | ||
627 | bluetooth=1)) | ||
628 | ]) | ||
629 | ], | ||
630 | [AC_MSG_RESULT([--with-libbluetooth not specified]) | ||
631 | CHECK_LIBHEADER(BLUETOOTH, | ||
632 | bluetooth, | ||
633 | ba2str, | ||
634 | bluetooth/bluetooth.h, | ||
635 | bluetooth=1,)]) | ||
594 | AM_CONDITIONAL(HAVE_LIBBLUETOOTH, [test "$bluetooth" = 1]) | 636 | AM_CONDITIONAL(HAVE_LIBBLUETOOTH, [test "$bluetooth" = 1]) |
595 | AS_IF([test "$bluetooth" = 1], | 637 | AS_IF([test "$bluetooth" = 1], |
596 | [AC_DEFINE([HAVE_LIBBLUETOOTH],[1],[Have bluetooth library])], | 638 | [AC_DEFINE([HAVE_LIBBLUETOOTH],[1],[Have bluetooth library])], |
597 | [AC_DEFINE([HAVE_LIBBLUETOOTH],[0],[Lacking bluetooth library])]) | 639 | [AC_DEFINE([HAVE_LIBBLUETOOTH],[0],[Lacking bluetooth library])]) |
598 | 640 | ||
599 | # check for zbar library | 641 | # check for zbar library |
600 | zbar=0 | 642 | zbar=0 |
@@ -652,34 +694,124 @@ AS_IF([test "x$jansson" = x1], | |||
652 | # check for libpulse(audio) library | 694 | # check for libpulse(audio) library |
653 | pulse=0 | 695 | pulse=0 |
654 | libpulse_msg="no" | 696 | libpulse_msg="no" |
655 | CHECK_LIBHEADER(LIBPULSE, pulse, pa_stream_peek, pulse/simple.h,pulse=1,) | 697 | AC_MSG_CHECKING(for libpulse) |
656 | AS_IF([test "$pulse" = 1], | 698 | # TODO: --with-libpulse or --with-pulseaudio? What is more established |
699 | # TODO: in this context? | ||
700 | AC_ARG_WITH(libpulse, | ||
701 | [ --with-libpulse=PREFIX (base of libpulse installation)], | ||
702 | [AC_MSG_RESULT([$with_libpulse]) | ||
703 | AS_CASE([$with_libpulse], | ||
704 | [no],[], | ||
705 | [yes],[ | ||
706 | CHECK_LIBHEADER(LIBPULSE, | ||
707 | pulse, | ||
708 | pa_stream_peek, | ||
709 | pulse/simple.h, | ||
710 | pulse=1,) | ||
711 | ],[ | ||
712 | LDFLAGS="-L$with_libpulse/lib $LDFLAGS" | ||
713 | CPPFLAGS="-I$with_libpulse/include $CPPFLAGS" | ||
714 | AC_CHECK_HEADERS(pulse/simple.h, | ||
715 | AC_CHECK_LIB([pulse], | ||
716 | [pa_stream_peek], | ||
717 | EXT_LIB_PATH="-L$with_libpulse/lib $EXT_LIB_PATH" | ||
718 | pulse=1)) | ||
719 | ]) | ||
720 | ], | ||
721 | [AC_MSG_RESULT([--with-libpulse not specified]) | ||
722 | CHECK_LIBHEADER(LIBPULSE, | ||
723 | pulse, | ||
724 | pa_stream_peek, | ||
725 | pulse/simple.h, | ||
726 | pulse=1,)]) | ||
727 | AM_CONDITIONAL(HAVE_PULSE, [test "$pulse" = 1]) | ||
728 | AS_IF([test x"$pulse" = x1], | ||
657 | [AC_DEFINE([HAVE_PULSE],[1],[Have libpulse(audio) library]) | 729 | [AC_DEFINE([HAVE_PULSE],[1],[Have libpulse(audio) library]) |
658 | libpulse_msg="yes"]) | 730 | libpulse_msg="yes"], |
731 | [AC_DEFINE([HAVE_PULSE],[0],[Lacking libpulse(audio) library]) | ||
732 | libpulse_msg="no"]) | ||
659 | 733 | ||
660 | # check for libopus(audio) library | 734 | # check for libopus(audio) library |
661 | opus=0 | 735 | opus=0 |
662 | libopus_msg="no" | 736 | libopus_msg="no" |
663 | CHECK_LIBHEADER(LIBOPUS, | 737 | AC_MSG_CHECKING(for libopus) |
664 | opus, | 738 | AC_ARG_WITH(libopus, |
665 | opus_decode_float, | 739 | [ --with-libopus=PREFIX (base of libopus installation)], |
666 | opus/opus.h, | 740 | [AC_MSG_RESULT([$with_libopus]) |
667 | AC_CHECK_DECL([OPUS_SET_GAIN],[opus=1],[],[[#include <opus/opus.h>]])) | 741 | AS_CASE([$with_libopus], |
742 | [no],[], | ||
743 | [yes],[ | ||
744 | CHECK_LIBHEADER(LIBOPUS, | ||
745 | opus, | ||
746 | opus_decode_float, | ||
747 | opus/opus.h, | ||
748 | AC_CHECK_DECL([OPUS_SET_GAIN], | ||
749 | [opus=1], | ||
750 | [], | ||
751 | [[ | ||
752 | #include <opus/opus.h> | ||
753 | ]])) | ||
754 | ],[ | ||
755 | LDFLAGS="-L$with_libopus/lib $LDFLAGS" | ||
756 | CPPFLAGS="-I$with_libopus/include $CPPFLAGS" | ||
757 | AC_CHECK_HEADERS(opus/opus.h, | ||
758 | AC_CHECK_LIB([opus], | ||
759 | [OPUS_SET_GAIN], | ||
760 | EXT_LIB_PATH="-L$with_libopus/lib $EXT_LIB_PATH" | ||
761 | opus=1)) | ||
762 | ]) | ||
763 | ], | ||
764 | [AC_MSG_RESULT([--with-libopus not specified]) | ||
765 | CHECK_LIBHEADER(LIBOPUS, | ||
766 | opus, | ||
767 | opus_decode_float, | ||
768 | opus/opus.h, | ||
769 | AC_CHECK_DECL([OPUS_SET_GAIN], | ||
770 | [opus=1], | ||
771 | [], | ||
772 | [[ | ||
773 | #include <opus/opus.h> | ||
774 | ]]))]) | ||
775 | AM_CONDITIONAL(HAVE_OPUS, [test "$opus" = 1]) | ||
668 | AS_IF([test "x$opus" = x1], | 776 | AS_IF([test "x$opus" = x1], |
669 | [AC_DEFINE([HAVE_OPUS],[1],[Have libopus library]) | 777 | [AC_DEFINE([HAVE_OPUS],[1],[Have libopus library]) |
670 | libopus_msg="yes"]) | 778 | libopus_msg="yes"], |
779 | [AC_DEFINE([HAVE_OPUS],[0],[Lacking libopus library]) | ||
780 | libopus_msg="no"]) | ||
671 | 781 | ||
672 | # libogg | 782 | # libogg |
673 | AC_CHECK_LIB(ogg, ogg_stream_flush_fill, | 783 | AC_MSG_CHECKING(for libogg) |
674 | [AC_CHECK_HEADERS([ogg/ogg.h], | 784 | AC_ARG_WITH(libogg, |
675 | AM_CONDITIONAL(HAVE_OGG, true) | 785 | [ --with-libogg=PREFIX (base of libogg installation)], |
676 | ogg=1 | 786 | [AC_MSG_RESULT([$with_libogg]) |
677 | AC_DEFINE(HAVE_OGG,1,[Have ogg]), | 787 | AS_CASE([$with_libogg], |
678 | AM_CONDITIONAL(HAVE_OGG, false) | 788 | [no],[], |
679 | ogg=0 | 789 | [yes],[ |
680 | AC_DEFINE(HAVE_OGG,0,[lacking ogg]))], | 790 | CHECK_LIBHEADER(LIBOGG, |
681 | AM_CONDITIONAL(HAVE_OGG, false) | 791 | ogg, |
682 | ogg=0) | 792 | ogg_stream_flush_fill, |
793 | ogg/ogg.h, | ||
794 | ogg=1,) | ||
795 | ],[ | ||
796 | LDFLAGS="-L$with_libogg/lib $LDFLAGS" | ||
797 | CPPFLAGS="-I$with_libogg/include $CPPFLAGS" | ||
798 | AC_CHECK_HEADERS(ogg/ogg.h, | ||
799 | AC_CHECK_LIB([ogg], | ||
800 | [ogg_stream_flush_fill], | ||
801 | EXT_LIB_PATH="-L$with_libogg/lib $EXT_LIB_PATH" | ||
802 | ogg=1)) | ||
803 | ]) | ||
804 | ], | ||
805 | [AC_MSG_RESULT([--with-libogg not specified]) | ||
806 | CHECK_LIBHEADER(LIBOGG, | ||
807 | ogg, | ||
808 | ogg_stream_flush_fill, | ||
809 | ogg/ogg.h, | ||
810 | ogg=1,)]) | ||
811 | AM_CONDITIONAL(HAVE_OGG, [test "$ogg" = 1]) | ||
812 | AS_IF([test x"$ogg" = x1], | ||
813 | [AC_DEFINE([HAVE_OGG],[1],[Have ogg])] | ||
814 | [AC_DEFINE([HAVE_OGG],[0],[Lacking ogg])]) | ||
683 | 815 | ||
684 | 816 | ||
685 | PKG_CHECK_MODULES([GLIB], | 817 | PKG_CHECK_MODULES([GLIB], |
@@ -776,20 +908,6 @@ AM_CONDITIONAL(HAVE_LIBATOMIC, [test "$have_libatomic" = 1]) | |||
776 | LIBS=$SAVE_LIBS | 908 | LIBS=$SAVE_LIBS |
777 | CPPFLAGS=$SAVE_CPPFLAGS | 909 | CPPFLAGS=$SAVE_CPPFLAGS |
778 | 910 | ||
779 | AC_CHECK_HEADERS([glpk.h],[glpk=true],[glpk=false]) | ||
780 | # GLPK must support glpk_init_env, version >= 4.43 | ||
781 | AC_CHECK_LIB([glpk],[glp_init_env],,[glpk=false]) | ||
782 | # GLPK must support atm MLP presolving, version >= 4.32 | ||
783 | AC_CHECK_MEMBERS(glp_iocp.presolve,,[glpk=false],[[#include <glpk.h>]]) | ||
784 | AS_IF([test "x$glpk" = xfalse], | ||
785 | [ | ||
786 | AM_CONDITIONAL(HAVE_LIBGLPK, false) | ||
787 | AC_MSG_WARN([ERROR: GNUnet requires GLPK >= 4.32]) | ||
788 | ],[ | ||
789 | AM_CONDITIONAL(HAVE_LIBGLPK, true) | ||
790 | AC_DEFINE([HAVE_LIBGLPK],[1],[Have GLPK]) | ||
791 | ]) | ||
792 | |||
793 | 911 | ||
794 | AC_CHECK_HEADERS([nss.h],[nss=true],[nss=false]) | 912 | AC_CHECK_HEADERS([nss.h],[nss=true],[nss=false]) |
795 | AS_IF([test x$nss = xfalse], | 913 | AS_IF([test x$nss = xfalse], |
@@ -1345,20 +1463,25 @@ DATAROOTDIR=$datarootdir | |||
1345 | AC_SUBST(DATAROOTDIR) | 1463 | AC_SUBST(DATAROOTDIR) |
1346 | 1464 | ||
1347 | # test for sudo | 1465 | # test for sudo |
1348 | # TODO: do we need to change anything for "doas" on openbsd? | ||
1349 | AC_MSG_CHECKING(for sudo) | 1466 | AC_MSG_CHECKING(for sudo) |
1467 | #AC_CHECK_PROGS(SUDO_BINARY, [sudo], false) | ||
1468 | #AM_CONDITIONAL(HAVE_SUDO, test x$SUDO_BINARY != xfalse) | ||
1350 | AC_ARG_WITH(sudo, | 1469 | AC_ARG_WITH(sudo, |
1351 | [ --with-sudo=PATH path to sudo binary (or just yes)], | 1470 | [ --with-sudo=PATH path to sudo binary (or just yes)], |
1352 | [AC_MSG_RESULT("$with_sudo") | 1471 | [AC_MSG_RESULT("$with_sudo") |
1353 | AS_CASE([$with_sudo], | 1472 | AS_CASE([$with_sudo], |
1354 | [no],[SUDO_BINARY=], | 1473 | [no],[SUDO_BINARY=], |
1355 | [yes],[SUDO_BINARY=sudo], | 1474 | [yes],[SUDO_BINARY=sudo], |
1356 | [SUDO_BINARY=$with_sudo])], | 1475 | [SUDO_BINARY=$with_sudo])], |
1357 | [AC_MSG_RESULT([no])]) | 1476 | [AC_MSG_RESULT([no])]) |
1358 | AC_SUBST(SUDO_BINARY) | 1477 | AC_SUBST(SUDO_BINARY) |
1359 | AM_CONDITIONAL([HAVE_SUDO], | 1478 | AM_CONDITIONAL([HAVE_SUDO], |
1360 | [test "x$SUDO_BINARY" != "x" -o -w /]) | 1479 | [test "x$SUDO_BINARY" != "x" -o -w /]) |
1361 | 1480 | ||
1481 | # test for doas | ||
1482 | AC_MSG_CHECKING(for doas) | ||
1483 | AC_CHECK_PROGS(DOAS_BINARY, [doas], false) | ||
1484 | AM_CONDITIONAL(HAVE_DOAS_BINARY, test x$DOAS_BINARY != xfalse) | ||
1362 | 1485 | ||
1363 | # test for gnunetdns group name | 1486 | # test for gnunetdns group name |
1364 | GNUNETDNS_GROUP=gnunetdns | 1487 | GNUNETDNS_GROUP=gnunetdns |