]> git.meshlink.io Git - meshlink/blobdiff - configure.ac
Add missing code for the duplicate node testcase.
[meshlink] / configure.ac
index ed9dc432dae9a1335b11aa7dc6ae6dccab386cf1..e02f5c37050524fbd9485922be2a62042d926fcf 100644 (file)
@@ -5,7 +5,6 @@ AC_INIT([MeshLink], [0.1])
 AM_INIT_AUTOMAKE([std-options subdir-objects nostdinc silent-rules -Wall])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
-AC_CONFIG_SUBDIRS([catta])
 AM_SILENT_RULES([yes])
 
 # Enable GNU extensions.
@@ -23,6 +22,7 @@ AC_PROG_CPP
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_LIBTOOL
+AX_PTHREAD
 
 dnl Check and set OS
 
@@ -57,18 +57,18 @@ dnl No -fstack-protector-all because it doesn't work on all platforms or archite
 
 AC_ARG_ENABLE([hardening], AS_HELP_STRING([--disable-hardening], [disable compiler and linker hardening flags]))
 AS_IF([test "x$enable_hardening" != "xno"],
-  [AX_CHECK_COMPILE_FLAG([-DFORTIFY_SOURCE=2], [CPPFLAGS="$CPPFLAGS -DFORITFY_SOURCE=2"])
-   AX_CHECK_COMPILE_FLAG([-fno-strict-overflow], [CPPFLAGS="$CPPFLAGS -fno-strict-overflow"])
-   AX_CHECK_COMPILE_FLAG([-fwrapv], [CPPFLAGS="$CPPFLAGS -fwrapv"])
+  [CPPFLAGS="$CPPFLAGS -W -pedantic"
+   AX_CHECK_COMPILE_FLAG([-DFORTIFY_SOURCE=2], [CPPFLAGS="$CPPFLAGS -DFORITFY_SOURCE=2"])
+   AX_CHECK_COMPILE_FLAG([-fwrapv], [CPPFLAGS="$CPPFLAGS -fwrapv"],
+     [AX_CHECK_COMPILE_FLAG([-fno-strict-overflow], [CPPFLAGS="$CPPFLAGS -fno-strict-overflow"])]
+   )
    case $host_os in
      *mingw*)
        AX_CHECK_LINK_FLAG([-Wl,--dynamicbase], [LDFLAGS="$LDFLAGS -Wl,--dynamicbase"])
        AX_CHECK_LINK_FLAG([-Wl,--nxcompat], [LDFLAGS="$LDFLAGS -Wl,--nxcompat"])
        ;;
      *)
-       AX_CHECK_COMPILE_FLAG([-fPIE], [CPPFLAGS="$CPPFLAGS -fPIE"])
        AX_CHECK_COMPILE_FLAG([-fPIC], [CPPFLAGS="$CPPFLAGS -fPIC"])
-       AX_CHECK_LINK_FLAG([-pie], [LDFLAGS="$LDFLAGS -pie"])
        ;;
    esac
    AX_CHECK_LINK_FLAG([-Wl,-z,relro], [LDFLAGS="$LDFLAGS -Wl,-z,relro"])
@@ -76,6 +76,14 @@ AS_IF([test "x$enable_hardening" != "xno"],
   ]
 );
 
+dnl Allow building without Catta
+AC_ARG_ENABLE([catta], AS_HELP_STRING([--disable-catta], [disable linking with the Catta library]))
+AS_IF([test "x$enable_catta" != "xno"],
+  AC_DEFINE(HAVE_CATTA, 1, [Link with Catta])
+  AC_CONFIG_SUBDIRS([catta])
+)
+AM_CONDITIONAL(CATTA, test "x$enable_catta" != "xno")
+
 dnl UTCP debug flags
 AC_ARG_ENABLE([utcp_debug], AS_HELP_STRING([--enable-utcp-debug], [compile utcp with debug output]))
 AS_IF([test "x$enable_utcp_debug" = "xyes"],