X-Git-Url: https://ruderich.org/simon/gitweb/?p=tlsproxy%2Ftlsproxy.git;a=blobdiff_plain;f=configure.ac;h=2e7e6387183291968815b3bc20b89ac1ed7d32be;hp=bab248a30e72e621db1f35da20a7a3955906a450;hb=fcd91ac82fbdebf0470a93b4677fe68dc1cc5e54;hpb=c51f4531e09a0fcf27aa9f3b5150fbadcf4f1a79 diff --git a/configure.ac b/configure.ac index bab248a..2e7e638 100644 --- a/configure.ac +++ b/configure.ac @@ -26,18 +26,23 @@ AM_INIT_AUTOMAKE([foreign -Wall -Werror]) AC_PROG_CC +# Do this before setting additional flags as the code from AX_PTHREAD fails to +# build with -Werror. +AX_PTHREAD([],[AC_MSG_ERROR([pthread is required])]) +LIBS="$PTHREAD_LIBS $LIBS" +CFLAGS="$PTHREAD_CFLAGS $CFLAGS" +CC="$PTHREAD_CC" + if test "x$GCC" = xyes; then - CFLAGS="-std=c89 -pedantic -Wall -Wextra -Werror $CFLAGS" + CFLAGS="-std=c89 -pedantic -Wall -Wextra $CFLAGS" CFLAGS="-Wno-error=int-to-pointer-cast $CFLAGS" - CPPFLAGS="-D_XOPEN_SOURCE=500 $CPPFLAGS" + CPPFLAGS="-D_XOPEN_SOURCE=600 $CPPFLAGS" # Additional hardening flags. CFLAGS="-fPIE -fstack-protector-all -Wformat -Werror=format-security $CFLAGS" CPPFLAGS="-D_FORTIFY_SOURCE=2 $CPPFLAGS" LDFLAGS="-fPIE -pie -Wl,-z,relro -Wl,-z,now $LDFLAGS" fi -AC_CHECK_LIB([pthread], [pthread_create], - [], [AC_MSG_ERROR([pthread is required])]) AC_CHECK_LIB([gnutls], [gnutls_certificate_verify_peers2], [], [AC_MSG_ERROR([GnuTLS is required])]) dnl Check for additional GnuTLS functions.