@@ -35,11 +35,11 @@ enable_threads="no" enable_sockets="no" enable_files="no" ;; m68k-*-amigaos*) - AS_IF([test x"$OBJCFLAGS" = x""], [OBJCFLAGS="-O0"]) + AS_IF([test x"$OBJCFLAGS" = x""], [OBJCFLAGS="-O0 -g"]) OBJCFLAGS="$OBJCFLAGS -noixemul" OBJFW_OBJCFLAGS="$OBJFW_OBJCFLAGS -noixemul" CPPFLAGS="$CPPFLAGS -D__NO_NET_API" LDFLAGS="$LDFLAGS -noixemul" LIBS="$LIBS -ldebug" @@ -1468,20 +1468,35 @@ ]) AC_CHECK_HEADER(netinet/tcp.h, [ AC_DEFINE(OF_HAVE_NETINET_TCP_H, 1, [Whether we have netinet/tcp.h]) ]) - AC_CHECK_HEADERS([arpa/inet.h netdb.h]) - AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h net/if_types.h]) - AC_CHECK_FUNCS([if_indextoname if_nametoindex]) + AC_CHECK_HEADERS([arpa/inet.h netdb.h sys/sockio.h]) + AC_CHECK_HEADERS([net/if.h], [], [], [ + #ifdef OF_HAVE_SYS_SOCKET_H + # include + #endif + ]) + AC_CHECK_HEADERS([net/if_arp.h net/if_dl.h net/if_types.h]) + AC_CHECK_FUNCS([if_indextoname if_nametoindex if_nameindex]) AC_CHECK_TYPES([struct sockaddr_dl], [], [], [ - #ifdef HAVAE_SYS_TYPES_H + #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_NET_IF_DL_H # include #endif + ]) + AC_CHECK_TYPES([struct lifconf], [], [], [ + #ifdef HAVE_NET_IF_H + # include + #endif + ]) + AC_CHECK_MEMBERS([struct ifreq.ifr_hwaddr], [], [], [ + #ifdef HAVE_NET_IF_H + # include + #endif ]) AC_CHECK_HEADER(sys/un.h, [ AC_DEFINE(OF_HAVE_SYS_UN_H, 1, [Whether we have sys/un.h]) ]) AC_CHECK_MEMBER([struct sockaddr_in6.sin6_addr], [ @@ -1508,10 +1523,12 @@ #ifdef AF_INET6 egrep_cpp_yes #endif ], [ AC_DEFINE(OF_HAVE_IPV6, 1, [Whether we have IPv6]) + + AC_CHECK_FUNCS(inet6_getscopeid) ]) ], [ dnl Work around a bug in autoconf 2.61 that creates a broken dnl configure if this branch is empty. : @@ -1581,24 +1598,20 @@ #endif #ifdef __MINT__ # error Gives invalid argument at runtime #endif - - #ifdef __gnu_hurd__ - # error Empty sun_path in the source given by recvfrom() - #endif ]) AC_CHECK_HEADER(netipx/ipx.h, [ AC_DEFINE(OF_HAVE_NETIPX_IPX_H, 1, [Whether we have netipx/ipx.h]) ]) AC_CHECK_MEMBER(struct sockaddr_ipx.sipx_network, [], [ AC_CHECK_MEMBER(struct sockaddr_ipx.sa_netnum, [], [ - AC_CHECK_MEMBER(struct sockaddr_ipx.sipx_addr.x_port, [ - ], [], [ + AC_CHECK_MEMBER(struct sockaddr_ipx.sipx_addr.x_port, + [], [], [ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef OF_HAVE_NETIPX_IPX_H @@ -1819,13 +1832,10 @@ "OFSelectKernelEventObserver.m") ]) ;; esac - AC_CHECK_HEADERS(net/if.h) - AC_CHECK_FUNCS(if_nameindex) - AC_ARG_WITH(tls, AS_HELP_STRING([--with-tls], [ enable TLS support using the specified library (yes, openssl, gnutls, securetransport or no)])) AS_IF([test x"$with_tls" = x""], [with_tls="yes"]) @@ -1850,25 +1860,10 @@ LIBS="$old_LIBS" ]) ]) - AS_IF([test x"$with_tls" = x"gnutls" \ - -o \( x"$with_tls" = x"yes" -a x"$tls_support" = x"no" \)], [ - PKG_CHECK_MODULES(gnutls, [gnutls >= 3.5.0], [ - tls_support="GnuTLS" - TLS_CPPFLAGS="$gnutls_CFLAGS $TLS_CPPFLAGS" - TLS_LIBS="$gnutls_LIBS $TLS_LIBS" - - AC_SUBST(OF_GNUTLS_TLS_STREAM_M, "OFGnuTLSTLSStream.m") - ], [ - dnl Disable default action-if-not-found, which exits - dnl configure with an error. - : - ]) - ]) - AS_IF([test x"$with_tls" = x"openssl" \ -o \( x"$with_tls" = x"yes" -a x"$tls_support" = x"no" \)], [ case "$host_os" in morphos*) ssl="ssl_shared" @@ -1888,10 +1883,25 @@ AC_SUBST(OF_OPENSSL_TLS_STREAM_M, "OFOpenSSLTLSStream.m") ]) ], [], [-l$crypto]) ]) + + AS_IF([test x"$with_tls" = x"gnutls" \ + -o \( x"$with_tls" = x"yes" -a x"$tls_support" = x"no" \)], [ + PKG_CHECK_MODULES(gnutls, [gnutls >= 3.5.0], [ + tls_support="GnuTLS" + TLS_CPPFLAGS="$gnutls_CFLAGS $TLS_CPPFLAGS" + TLS_LIBS="$gnutls_LIBS $TLS_LIBS" + + AC_SUBST(OF_GNUTLS_TLS_STREAM_M, "OFGnuTLSTLSStream.m") + ], [ + dnl Disable default action-if-not-found, which exits + dnl configure with an error. + : + ]) + ]) AS_IF([test x"$tls_support" != x"no"], [ AC_SUBST(TLS, "tls") AC_SUBST(TLS_CPPFLAGS) AC_SUBST(TLS_LIBS) @@ -2055,12 +2065,20 @@ AC_MSG_RESULT(no) OBJCFLAGS="$old_OBJCFLAGS" ]) AS_IF([test x"$GOBJC" = x"yes"], [ - OBJCFLAGS="$OBJCFLAGS -Wwrite-strings -Wpointer-arith -Werror" + OBJCFLAGS="$OBJCFLAGS -Wwrite-strings -Wpointer-arith" + + AC_ARG_ENABLE(werror, + AS_HELP_STRING([--disable-werror], [do not build with -Werror])) + AS_IF([test x"$enable_werror" != x"no"], [ + OBJCFLAGS="$OBJCFLAGS -Werror" + ]) + old_OBJCFLAGS="$OBJCFLAGS" + OBJCFLAGS="$OBJCFLAGS -Werror" AC_MSG_CHECKING(whether we need -Wno-strict-aliasing due to GCC bugs) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #ifdef __has_attribute # if __has_attribute(objc_root_class) @@ -2080,15 +2098,18 @@ Foo *test = (Foo *)&object; (void)test; /* Get rid of unused variable warning */ ]) ], [ AC_MSG_RESULT(no) + OBJCFLAGS="$old_OBJCFLAGS" ], [ AC_MSG_RESULT(yes) - OBJCFLAGS="$OBJCFLAGS -Wno-strict-aliasing" + OBJCFLAGS="$old_OBJCFLAGS -Wno-strict-aliasing" ]) + old_OBJCFLAGS="$OBJCFLAGS" + OBJCFLAGS="$OBJCFLAGS -Werror" AC_MSG_CHECKING( whether we need -Wno-unused-property-ivar due to Clang bugs) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([ #ifdef __has_attribute @@ -2116,17 +2137,18 @@ } @end ]) ], [ AC_MSG_RESULT(no) + OBJCFLAGS="$old_OBJCFLAGS" ], [ AC_MSG_RESULT(yes) - OBJCFLAGS="$OBJCFLAGS -Wno-unused-property-ivar" + OBJCFLAGS="$old_OBJCFLAGS -Wno-unused-property-ivar" ]) old_OBJCFLAGS="$OBJCFLAGS" - OBJCFLAGS="$OBJCFLAGS -Wcast-align" + OBJCFLAGS="$OBJCFLAGS -Wcast-align -Werror" AC_MSG_CHECKING(whether -Wcast-align is buggy) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([ #ifdef __has_attribute # if __has_attribute(objc_root_class) @@ -2147,17 +2169,18 @@ } @end ]) ], [ AC_MSG_RESULT(no) + OBJCFLAGS="$old_OBJCFLAGS -Wcast-align" ], [ AC_MSG_RESULT(yes) OBJCFLAGS="$old_OBJCFLAGS" ]) old_OBJCFLAGS="$OBJCFLAGS" - OBJCFLAGS="$OBJCFLAGS -Wunreachable-code" + OBJCFLAGS="$OBJCFLAGS -Wunreachable-code -Werror" AC_MSG_CHECKING(whether -Wunreachable-code can be used) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include @@ -2223,17 +2246,18 @@ } @end ]]) ], [ AC_MSG_RESULT(yes) + OBJCFLAGS="$old_OBJCFLAGS -Wunreachable-code" ], [ AC_MSG_RESULT(no) OBJCFLAGS="$old_OBJCFLAGS" ]) old_OBJCFLAGS="$OBJCFLAGS" - OBJCFLAGS="$OBJCFLAGS -Wdocumentation" + OBJCFLAGS="$OBJCFLAGS -Wdocumentation -Werror" AC_MSG_CHECKING(whether -Wdocumentation works correctly) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([ /** * @class Test conftest.m conftest.m @@ -2251,18 +2275,19 @@ */ typedef struct {} Foo; ]) ], [ AC_MSG_RESULT(yes) + OBJCFLAGS="$old_OBJCFLAGS -Wdocumentation" ], [ AC_MSG_RESULT(no) OBJCFLAGS="$old_OBJCFLAGS" ]) AS_IF([test x"$check_pedantic" = x"yes"], [ old_OBJCFLAGS="$OBJCFLAGS" - OBJCFLAGS="$OBJCFLAGS -pedantic" + OBJCFLAGS="$OBJCFLAGS -pedantic -Werror" AC_MSG_CHECKING(whether -pedantic is buggy) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([ #include @@ -2294,31 +2319,37 @@ } @end ]) ], [ AC_MSG_RESULT(no) + OBJCFLAGS="$old_OBJCFLAGS -pedantic" ], [ AC_MSG_RESULT(yes) OBJCFLAGS="$old_OBJCFLAGS" ]) ]) + old_OBJCFLAGS="$OBJCFLAGS" + OBJCFLAGS="$OBJCFLAGS -Werror" AC_MSG_CHECKING(whether we need -Wno-strict-prototypes) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #include ], [ signal(SIGINT, SIG_DFL); ]) ], [ AC_MSG_RESULT(no) + OBJCFLAGS="$old_OBJCFLAGS" ], [ AC_MSG_RESULT(yes) - OBJCFLAGS="$OBJCFLAGS -Wno-strict-prototypes" + OBJCFLAGS="$old_OBJCFLAGS -Wno-strict-prototypes" ]) AS_IF([test x"$ac_cv_header_complex_h" = x"yes"], [ + old_OBJCFLAGS="$OBJCFLAGS" + OBJCFLAGS="$OBJCFLAGS -Werror" AC_MSG_CHECKING(whether we need -Wno-gnu-imaginary-constant) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #include ], [ @@ -2325,13 +2356,14 @@ complex float f = 0.5 + 0.5 * I; (void)f; ]) ], [ AC_MSG_RESULT(no) + OBJCFLAGS="$old_OBJCFLAGS" ], [ AC_MSG_RESULT(yes) - OBJCFLAGS="$OBJCFLAGS -Wno-gnu-imaginary-constant" + OBJCFLAGS="$old_OBJCFLAGS -Wno-gnu-imaginary-constant" ]) ]) ]) AS_IF([test x"$cross_compiling" = x"yes"], [