diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-10-25 15:05:21 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-10-25 15:05:21 +0200 |
commit | 8a4b969fd2e9fb399dfd1d9d1569e95a77d599bb (patch) | |
tree | c262d6cff5f4d795270005366417b67d08549c7c | |
parent | b64879a11e2062b78e984b8e5c22dc26ba224668 (diff) | |
download | gnunet-8a4b969fd2e9fb399dfd1d9d1569e95a77d599bb.tar.gz gnunet-8a4b969fd2e9fb399dfd1d9d1569e95a77d599bb.zip |
cleaning up configure, in particular the idn.h checks
-rw-r--r-- | configure.ac | 273 | ||||
-rw-r--r-- | src/util/dnsparser.c | 10 |
2 files changed, 105 insertions, 178 deletions
diff --git a/configure.ac b/configure.ac index f0ab98390..d2f2bddd8 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -839,34 +839,20 @@ AC_ARG_WITH(libidn, | |||
839 | [Support IDN (needs libidn)]), | 839 | [Support IDN (needs libidn)]), |
840 | [], | 840 | [], |
841 | [withval="yes"]) | 841 | [withval="yes"]) |
842 | if test x_$withval = x_yes; then | 842 | AS_IF([test x_$withval = x_yes], |
843 | for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do | 843 | [AC_CHECK_HEADERS([idna.h], |
844 | if test -f "$dir/include/idna.h"; then | 844 | AC_MSG_NOTICE([Found idna.h]), |
845 | CFLAGS="$CFLAGS -I$dir/include" | 845 | AC_CHECK_HEADERS([idn/idna.h], |
846 | LDFLAGS="$LDFLAGS -L$dir/lib" | 846 | AC_MSG_NOTICE([Found idn/idna.h]), |
847 | AC_MSG_NOTICE([Found libidn in $dir]) | 847 | my_with_libidn=0))], |
848 | break | 848 | [AS_IF([test x_$withval != x_no], |
849 | fi | 849 | [CFLAGS="$CFLAGS -I$withval/include" |
850 | if test -f "$dir/include/idn/idna.h"; then | 850 | LDFLAGS="$LDFLAGS -L$withval/lib" |
851 | CFLAGS="$CFLAGS -I$dir/include/idn" | 851 | AC_CHECK_HEADERS([idna.h], |
852 | LDFLAGS="$LDFLAGS -L$dir/lib" | 852 | AC_MSG_NOTICE([Found idna.h]), |
853 | AC_MSG_NOTICE([Found libidn in $dir]) | 853 | [AC_MSG_NOTICE([Failed to find idna.h]) |
854 | break | 854 | my_with_libidn=0])], |
855 | fi | 855 | [my_with_libidn=0])]) |
856 | done | ||
857 | if test -f "/usr/include/idn/idna.h"; then | ||
858 | CFLAGS="$CFLAGS -I/usr/include/idn" | ||
859 | #LDFLAGS="$LDFLAGS -L/usr/lib" | ||
860 | AC_MSG_NOTICE([Found libidn in /usr]) | ||
861 | fi | ||
862 | else | ||
863 | if test x_$withval != x_no; then | ||
864 | CFLAGS="$CFLAGS -I$withval/include" | ||
865 | LDFLAGS="$LDFLAGS -L$withval/lib" | ||
866 | else | ||
867 | my_with_libidn=0 | ||
868 | fi | ||
869 | fi | ||
870 | 856 | ||
871 | my_with_libidn2=1 | 857 | my_with_libidn2=1 |
872 | AC_ARG_WITH(libidn2, | 858 | AC_ARG_WITH(libidn2, |
@@ -874,34 +860,17 @@ AC_ARG_WITH(libidn2, | |||
874 | [Support IDN (needs libidn2)]), | 860 | [Support IDN (needs libidn2)]), |
875 | [], | 861 | [], |
876 | [withval="yes"]) | 862 | [withval="yes"]) |
877 | if test x_$withval = x_yes; then | 863 | AS_IF([test x_$withval = x_yes], |
878 | for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do | 864 | [AC_CHECK_HEADERS([idn2.h], |
879 | if test -f "$dir/include/idn2.h"; then | 865 | AC_MSG_NOTICE([Found idn2.h]), |
880 | CFLAGS="$CFLAGS -I$dir/include" | 866 | AC_CHECK_HEADERS([idn2/idn2.h], |
881 | LDFLAGS="$LDFLAGS -L$dir/lib" | 867 | AC_MSG_NOTICE([Found idn2/idn2.h]), |
882 | AC_MSG_NOTICE([Found libidn2 in $dir]) | 868 | [AC_MSG_NOTICE([Failed to find idn2.h]) |
883 | break | 869 | my_with_libidn2=0]))], |
884 | fi | 870 | [AS_IF([test x_$withval != x_no], |
885 | if test -f "$dir/include/idn2/idn2.h"; then | 871 | [CFLAGS="$CFLAGS -I$withval/include" |
886 | CFLAGS="$CFLAGS -I$dir/include/idn2" | 872 | LDFLAGS="$LDFLAGS -L$withval/lib"], |
887 | LDFLAGS="$LDFLAGS -L$dir/lib" | 873 | [my_with_libidn2=0])]) |
888 | AC_MSG_NOTICE([Found libidn2 in $dir]) | ||
889 | break | ||
890 | fi | ||
891 | done | ||
892 | if test -f "/usr/include/idn2/idn2.h"; then | ||
893 | CFLAGS="$CFLAGS -I/usr/include/idn2" | ||
894 | #LDFLAGS="$LDFLAGS -L/usr/lib" | ||
895 | AC_MSG_NOTICE([Found libidn2 in /usr]) | ||
896 | fi | ||
897 | else | ||
898 | if test x_$withval != x_no; then | ||
899 | CFLAGS="$CFLAGS -I$withval/include" | ||
900 | LDFLAGS="$LDFLAGS -L$withval/lib" | ||
901 | else | ||
902 | my_with_libidn2=0 | ||
903 | fi | ||
904 | fi | ||
905 | 874 | ||
906 | AC_MSG_CHECKING([if libidn can be used]) | 875 | AC_MSG_CHECKING([if libidn can be used]) |
907 | # Check for LIBIDNs | 876 | # Check for LIBIDNs |
@@ -909,53 +878,42 @@ there_can_only_be_one=1 | |||
909 | 878 | ||
910 | working_libidn1=0 | 879 | working_libidn1=0 |
911 | working_libidn2=0 | 880 | working_libidn2=0 |
912 | if test $my_with_libidn2 = 1 | 881 | AS_IF([test $my_with_libidn2 = 1], |
913 | then | 882 | [AC_MSG_NOTICE([Checking for libidn2]) |
914 | AC_MSG_NOTICE([Checking for libidn2]) | 883 | AC_CHECK_LIB([idn2], |
915 | AC_CHECK_LIB([idn2], | 884 | [idn2_to_unicode_8z8z], |
916 | [idn2_to_unicode_8z8z], | 885 | [working_libidn2=1 |
917 | [working_libidn2=1 | 886 | LIBS="-lidn2 $LIBS" |
918 | LIBS="-lidn2 $LIBS" | 887 | AC_DEFINE_UNQUOTED([HAVE_LIBIDN2], |
919 | AC_DEFINE_UNQUOTED([HAVE_LIBIDN2], | 888 | [1], |
920 | [1], | ||
921 | [Define to 1 if you have 'libidn2' (-lidn).])], | 889 | [Define to 1 if you have 'libidn2' (-lidn).])], |
922 | [MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libidn2" | 890 | [MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libidn2" |
923 | MISSING_SEP=", "]) | 891 | MISSING_SEP=", "])]) |
924 | fi | ||
925 | AM_CONDITIONAL(HAVE_LIBIDN2, test x$working_libidn2 = x1) | 892 | AM_CONDITIONAL(HAVE_LIBIDN2, test x$working_libidn2 = x1) |
926 | if test $working_libidn2 = 0 | 893 | AS_IF([test $working_libidn2 = 0], |
927 | then | 894 | [AS_IF([test $my_with_libidn = 1], |
928 | if test $my_with_libidn = 1 | 895 | [AC_MSG_NOTICE([Checking for libidn]) |
929 | then | 896 | AC_CHECK_LIB([idn], |
930 | AC_MSG_NOTICE([Checking for libidn]) | 897 | [idna_to_ascii_8z], |
931 | AC_CHECK_LIB([idn], | 898 | [working_libidn1=1 |
932 | [idna_to_ascii_8z], | 899 | LIBS="-lidn $LIBS" |
933 | [working_libidn1=1 | ||
934 | LIBS="-lidn $LIBS" | ||
935 | AC_DEFINE_UNQUOTED([HAVE_LIBIDN], | 900 | AC_DEFINE_UNQUOTED([HAVE_LIBIDN], |
936 | [1], | 901 | [1], |
937 | [Define to 1 if you have 'libidn' (-lidn).])], | 902 | [Define to 1 if you have 'libidn' (-lidn).])], |
938 | [there_can_only_be_one=0]) | 903 | [there_can_only_be_one=0])], |
939 | else | 904 | [AS_IF([test $my_with_libidn2 = 1], |
940 | if test $my_with_libidn2 = 1 | 905 | [there_can_only_be_one=0 |
941 | then | 906 | AC_MSG_FAILURE([* There can only be one libidn. |
942 | there_can_only_be_one=0 | 907 | * Provide either libidn >= 1.13 |
943 | AC_MSG_FAILURE([* There can only be one libidn. | 908 | * or |
944 | * Provide either libidn >= 1.13 | 909 | * libidn2 to the configure |
945 | * or | 910 | * script via |
946 | * libidn2 to the configure | 911 | * --with-libidn2 |
947 | * script via | 912 | * --with-libidn])])])]) |
948 | * --with-libidn2 | ||
949 | * --with-libidn]) | ||
950 | fi | ||
951 | fi | ||
952 | fi | ||
953 | AM_CONDITIONAL(HAVE_LIBIDN, test x$working_libidn1 = x1) | 913 | AM_CONDITIONAL(HAVE_LIBIDN, test x$working_libidn1 = x1) |
954 | 914 | ||
955 | if test $there_can_only_be_one = 0 | 915 | AS_IF([test $there_can_only_be_one = 0], |
956 | then | 916 | [AC_MSG_FAILURE([Missing dependencies: $MISSING_DEPS])]) |
957 | AC_MSG_FAILURE([Missing dependencies: $MISSING_DEPS]) | ||
958 | fi | ||
959 | 917 | ||
960 | # test for zlib | 918 | # test for zlib |
961 | SAVE_LDFLAGS=$LDFLAGS | 919 | SAVE_LDFLAGS=$LDFLAGS |
@@ -1950,115 +1908,80 @@ AC_OUTPUT | |||
1950 | # Finally: summary! | 1908 | # Finally: summary! |
1951 | 1909 | ||
1952 | # warn user if mysql found but not used due to version | 1910 | # warn user if mysql found but not used due to version |
1953 | if test "$mysqlfail" = "true" | 1911 | AS_IF([test "$mysqlfail" = "true"] |
1954 | then | 1912 | [AC_MSG_NOTICE([WARNING: optional MySQL not found (or too old)])]) |
1955 | AC_MSG_NOTICE([WARNING: MySQL found, but too old. MySQL support will not be compiled.]) | ||
1956 | fi | ||
1957 | 1913 | ||
1958 | # sqlite | 1914 | # sqlite |
1959 | if test "x$sqlite" = "x0" | 1915 | AS_IF([test "x$sqlite" = "x0"], |
1960 | then | 1916 | [AC_MSG_ERROR([ERROR: sqlite3 not found, but sqlite3 is required.])]) |
1961 | AC_MSG_ERROR([ERROR: sqlite3 not found, but sqlite3 is required.]) | ||
1962 | fi | ||
1963 | 1917 | ||
1964 | # libgnurl | 1918 | # libgnurl |
1965 | if test "$gnurl" = "0" | 1919 | AS_IF([test "$gnurl" = "0"], |
1966 | then | 1920 | [AS_IF([test "x$curl" = "xfalse"], |
1967 | if test "x$curl" = "xfalse" | 1921 | [AC_MSG_NOTICE([WARNING: libgnurl not found. http client support will not be compiled.]) |
1968 | then | 1922 | AC_MSG_WARN([ERROR: libgnurl not found. hostlist daemon will not be compiled, and you probably WANT the hostlist daemon])], |
1969 | AC_MSG_NOTICE([WARNING: libgnurl not found. http client support will not be compiled.]) | 1923 | [AC_MSG_NOTICE([WARNING: libgnurl not found, trying to use libcurl-gnutls instead.])])]) |
1970 | AC_MSG_WARN([ERROR: libgnurl not found. hostlist daemon will not be compiled, and you probably WANT the hostlist daemon]) | ||
1971 | else | ||
1972 | AC_MSG_NOTICE([WARNING: libgnurl not found, trying to use libcurl-gnutls instead.]) | ||
1973 | fi | ||
1974 | fi | ||
1975 | |||
1976 | 1924 | ||
1977 | # bluetooth | 1925 | # bluetooth |
1978 | if test "x$bluetooth" = "x0" | 1926 | AS_IF([test "x$bluetooth" = "x0"], |
1979 | then | 1927 | [AC_MSG_NOTICE([WARNING: optional bluetooth library not found.])]) |
1980 | AC_MSG_NOTICE([WARNING: bluetooth library not found. bluetooth support will not be compiled.]) | 1928 | |
1981 | fi | ||
1982 | 1929 | ||
1983 | # jansson | 1930 | # jansson |
1984 | if test "x$jansson" = "x0" | 1931 | AS_IF([test "x$jansson" = "x0"], |
1985 | then | 1932 | [AC_MSG_NOTICE([WARNING: optional jansson library not found.])]) |
1986 | AC_MSG_NOTICE([WARNING: jansson library not found. json support will not be compiled.]) | ||
1987 | fi | ||
1988 | 1933 | ||
1989 | # | 1934 | # |
1990 | # FIXME: `some modules' -> be more specific which exact modules. | 1935 | # FIXME: `some modules' -> be more specific which exact modules. |
1991 | # | 1936 | # |
1992 | 1937 | ||
1993 | # warn user if iptables is not found | 1938 | # warn user if iptables is not found |
1994 | if test "$VAR_IPTABLES_BINARY" = "false" | 1939 | AS_IF([test "$VAR_IPTABLES_BINARY" = "false"], |
1995 | then | 1940 | [AC_MSG_NOTICE([WARNING: optional iptables not found])]) |
1996 | AC_MSG_NOTICE([WARNING: iptables not found. some modules may not have full functionality.]) | ||
1997 | fi | ||
1998 | 1941 | ||
1999 | # warn user if ifconfig is not found | 1942 | # warn user if ifconfig is not found |
2000 | if test "$VAR_IFCONFIG_BINARY" = "false" | 1943 | AS_IF([test "$VAR_IFCONFIG_BINARY" = "false"], |
2001 | then | 1944 | [AC_MSG_NOTICE([WARNING: optional ifconfig not found])]) |
2002 | AC_MSG_NOTICE([WARNING: ifconfig not found. some modules may not have full functionality.]) | ||
2003 | fi | ||
2004 | 1945 | ||
2005 | # warn user if upnpc binary is not found | 1946 | # warn user if upnpc binary is not found |
2006 | if test "$VAR_UPNPC_BINARY" = "false" | 1947 | AS_IF([test "$VAR_UPNPC_BINARY" = "false"], |
2007 | then | 1948 | [AC_MSG_NOTICE([WARNING: optional upnpc binary not found])]) |
2008 | AC_MSG_NOTICE([WARNING: upnpc binary not found. some modules may not have full functionality.]) | ||
2009 | fi | ||
2010 | 1949 | ||
2011 | #gnutls | 1950 | #gnutls |
2012 | if test x$gnutls != xtrue | 1951 | AS_IF([test x$gnutls != xtrue], |
2013 | then | 1952 | [AC_MSG_NOTICE([WARNING: GnuTLS not found, gnunet-gns-proxy will not be built])], |
2014 | AC_MSG_NOTICE([WARNING: GnuTLS not found, gnunet-gns-proxy will not be built]) | 1953 | [AS_IF([test "x$gnutls_dane" != "x1"], |
2015 | else | 1954 | [AC_MSG_NOTICE([WARNING: GnuTLS has no DANE support, DANE validation will not be possible])])]) |
2016 | if test "x$gnutls_dane" != "x1" | ||
2017 | then | ||
2018 | AC_MSG_NOTICE([WARNING: GnuTLS has no DANE support, DANE validation will not be possible]) | ||
2019 | fi | ||
2020 | fi | ||
2021 | 1955 | ||
2022 | # java ports | 1956 | # java ports |
2023 | if test "x$enable_java_ports" = "xyes" | 1957 | AS_IF([test "x$enable_java_ports" = "xyes"], |
2024 | then | 1958 | [AC_MSG_NOTICE([NOTICE: Opening ports for gnunet-java bindings by default.])]) |
2025 | AC_MSG_NOTICE([NOTICE: Opening ports for gnunet-java bindings by default.]) | ||
2026 | fi | ||
2027 | 1959 | ||
2028 | # MHD | 1960 | # MHD |
2029 | if test "x$lmhd" != "x1" | 1961 | AS_IF([test "x$lmhd" != "x1"], |
2030 | then | 1962 | [AC_MSG_NOTICE([WARNING: optional libmicrohttpd not found])]) |
2031 | AC_MSG_NOTICE([WARNING: libmicrohttpd not found, http transport will not be installed.]) | ||
2032 | fi | ||
2033 | 1963 | ||
2034 | # conversation | 1964 | # conversation |
2035 | if test "x$conversation_backend" = "xnone" | 1965 | AS_IF([test "x$conversation_backend" = "xnone"], |
2036 | then | 1966 | [AS_IF([test "x$pulse" != "x1"], |
2037 | if test "x$pulse" != "x1" | 1967 | [AC_MSG_NOTICE([WARNING: libpulse(audio) not found, conversation will not be built.])]) |
2038 | then | 1968 | AS_IF([test "x$opus" != "x1"], |
2039 | AC_MSG_NOTICE([WARNING: libpulse(audio) not found, conversation will not be built.]) | 1969 | [AC_MSG_NOTICE([WARNING: libopus not found, conversation will not be built.])]) |
2040 | fi | 1970 | AS_IF([test "x$gst" != "x1"], |
2041 | if test "x$opus" != "x1" | 1971 | [AC_MSG_NOTICE([WARNING: GStreamer not found, conversation will not be built.])])]) |
2042 | then | 1972 | |
2043 | AC_MSG_NOTICE([WARNING: libopus not found, conversation will not be built.]) | 1973 | AS_IF([test "$extractor" != 1], |
2044 | fi | 1974 | [AC_MSG_WARN([ERROR: libextractor not found, but various file-sharing functions require it])]) |
2045 | if test "x$gst" != "x1" | 1975 | |
2046 | then | 1976 | AS_IF([test "x$working_libidn2" = x1], |
2047 | AC_MSG_NOTICE([WARNING: GStreamer not found, conversation will not be built.]) | 1977 | [AC_MSG_NOTICE([INFO: Using libidn2])]) |
2048 | fi | 1978 | AS_IF([test "x$working_libidn1" = x1], |
2049 | fi | 1979 | [AC_MSG_NOTICE([INFO: Using libidn1])]) |
2050 | |||
2051 | if test "$extractor" != 1 | ||
2052 | then | ||
2053 | AC_MSG_WARN([ERROR: libextractor not found, but various file-sharing functions require it]) | ||
2054 | fi | ||
2055 | 1980 | ||
2056 | AC_MSG_NOTICE([NOTICE: Database support is set to MySQL: $mysql, SQLite: $sqlite, Postgres: $postgres]) | 1981 | AC_MSG_NOTICE([NOTICE: Database support is set to MySQL: $mysql, SQLite: $sqlite, Postgres: $postgres]) |
2057 | 1982 | ||
2058 | if test "$enable_framework_build" = "yes" | 1983 | AS_IF([test "$enable_framework_build" = "yes"], |
2059 | then | 1984 | [AC_MSG_NOTICE([Mac OS X framework build enabled.])]) |
2060 | AC_MSG_NOTICE([Mac OS X framework build enabled.]) | ||
2061 | fi | ||
2062 | 1985 | ||
2063 | AC_MSG_NOTICE([******************************************** | 1986 | AC_MSG_NOTICE([******************************************** |
2064 | Please make sure NOW that you have created a user and group 'gnunet' | 1987 | Please make sure NOW that you have created a user and group 'gnunet' |
diff --git a/src/util/dnsparser.c b/src/util/dnsparser.c index 79d723f12..2d2354222 100644 --- a/src/util/dnsparser.c +++ b/src/util/dnsparser.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2010-2014 GNUnet e.V. | 3 | Copyright (C) 2010-2014, 2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
@@ -23,10 +23,14 @@ | |||
23 | * @author Christian Grothoff | 23 | * @author Christian Grothoff |
24 | */ | 24 | */ |
25 | #include "platform.h" | 25 | #include "platform.h" |
26 | #if defined(HAVE_LIBIDN2) | 26 | #if HAVE_IDN2_H |
27 | #include <idn2.h> | 27 | #include <idn2.h> |
28 | #elif defined(HAVE_LIBIDN) | 28 | #elif HAVE_IDN2_IDN2_H |
29 | #include <idn2/idn2.h> | ||
30 | #elif HAVE_IDNA_H | ||
29 | #include <idna.h> | 31 | #include <idna.h> |
32 | #elif HAVE_IDN_IDNA_H | ||
33 | #include <idn/idna.h> | ||
30 | #endif | 34 | #endif |
31 | #if WINDOWS | 35 | #if WINDOWS |
32 | #include <idn-free.h> | 36 | #include <idn-free.h> |