diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 242 |
1 files changed, 195 insertions, 47 deletions
diff --git a/configure.in b/configure.in index e236c25fe..ec3b1f735 100644 --- a/configure.in +++ b/configure.in @@ -272,6 +272,52 @@ AC_ARG_ENABLE( # +# static linking +# +AC_ARG_ENABLE( + [static], + AC_HELP_STRING( + [--enable-static], + [ + Enables or Disables Statick Linking (STATIC is disabled by default) + ] + ), + [ + enable_static="$enableval" + case $enableval in + "no");; + "yes");; + *) AC_MSG_ERROR([[invalid argument --enable-static=$disableval... stopping]]);; + esac + ], + [enable_static="no"] +) + + +# +# adress sanitize +# +AC_ARG_ENABLE( + [sanitize], + AC_HELP_STRING( + [--enable-sanitize], + [ + Enables or Disables Sanitize Address Checking (SANITIZE is disabled by default) + ] + ), + [ + enable_sanitize="$enableval" + case $enableval in + "no");; + "yes");; + *) AC_MSG_ERROR([[invalid argument --enable-sanitize=$disableval... stopping]]);; + esac + ], + [enable_sanitize="no"] +) + + +# # Renewal # AC_ARG_ENABLE( @@ -575,6 +621,39 @@ if test "$enable_lto" != "no" ; then fi +# +# sanitize Support test +# +if test "$enable_sanitize" != "no" ; then + + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fsanitize=address" + + OLD_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -fsanitize=address" + + AC_MSG_CHECKING([whether $CC supports -fsanitize=address]) + AC_RUN_IFELSE( + [AC_LANG_SOURCE([ + int main(int argc, char **argv){ + return 0; + } + ])], + [ + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" + ], + [ + AC_MSG_RESULT([guessing no]) + ] + ) +fi + + AC_DEFUN(AC_CHECK_COMPILER_WFLAG, [ AC_MSG_CHECKING([whether $CC supports -W$1]) @@ -1039,6 +1118,52 @@ case $enable_renewal in esac # +# Host specific stuff +# +AC_MSG_CHECKING([host OS]) +host_os="`uname`" +AC_MSG_RESULT([$host_os]) +fd_setsize="" +DLLEXT=".so" +case $host_os in +Solaris* ) + LIBS="$LIBS -lsocket -lnsl -ldl" + ;; +Linux* ) + LIBS="$LIBS -ldl" + ;; +FreeBSD*) + CPPFLAGS="$CPPFLAGS -D__FREEBSD__" + ;; +NetBSD*) + CPPFLAGS="$CPPFLAGS -D__NETBSD__" + ;; +CYGWIN*) + CPPFLAGS="$CPPFLAGS -DFD_SETSIZE=4096 -DCYGWIN" + fd_setsize="done" + DLLEXT=".dll" + ;; +Darwin*) + DLLEXT=".dylib" + ;; +esac +AC_SUBST([DLLEXT]) + +AC_MSG_CHECKING([for MinGW]) +if test -n "`$CC --version 2>/dev/null | grep -i mingw`" ; then + AC_MSG_RESULT([yes]) + CPPFLAGS="$CPPFLAGS -DMINGW" + if test -z "$fd_setsize" ; then + CPPFLAGS="$CPPFLAGS -DFD_SETSIZE=4096" + fi + LIBS="$LIBS -lws2_32" +else + AC_MSG_RESULT([no]) +fi + + + +# # zlib library (required) # if test -n "${ZLIB_HOME}" ; then @@ -1131,12 +1256,12 @@ else MYSQL_VERSION="unknown" fi -MYSQL_OLD_LDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS $MYSQL_LIBS" +MYSQL_OLD_LIBS="$LIBS" ; LIBS="$LIBS $MYSQL_LIBS" MYSQL_OLD_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS" -AC_CHECK_LIB([mysqlclient], [mysql_init], [HAVE_MYSQL="yes"], []) +AC_CHECK_FUNC([mysql_init], [HAVE_MYSQL="yes"]) AC_CHECK_HEADER([mysql.h], [], [HAVE_MYSQL=""]) CPPFLAGS="$MYSQL_OLD_CPPFLAGS" -LDFLAGS="$MYSQL_OLD_LDFLAGS" +LIBS="$MYSQL_OLD_LIBS" AC_MSG_CHECKING([MySQL library (required)]) if test "$HAVE_MYSQL" = "yes" ; then @@ -1195,59 +1320,82 @@ AC_SUBST([HAVE_PCRE]) AC_SUBST([PCRE_LIBS]) AC_SUBST([PCRE_CFLAGS]) + # -# Doxygen, perl (for HPMHookGen) +# static Support test # +if test "$enable_static" != "no" ; then -AC_CHECK_PROG([HAVE_DOXYGEN],[doxygen],[yes],[no]) + STATIC="-static" + PLUGINSTATIC="-static-libgcc" -AC_CHECK_PROG([HAVE_PERL],[perl],[yes],[no]) + OLD_CFLAGS="$CFLAGS" + OLD_LDFLAGS="$LDFLAGS" + OLD_LIBS="$LIBS" -# -# Host specific stuff -# -AC_MSG_CHECKING([host OS]) -host_os="`uname`" -AC_MSG_RESULT([$host_os]) -fd_setsize="" -DLLEXT=".so" -case $host_os in -Solaris* ) - LIBS="$LIBS -lsocket -lnsl -ldl" - ;; -Linux* ) - LIBS="$LIBS -ldl" - ;; -FreeBSD*) - CPPFLAGS="$CPPFLAGS -D__FREEBSD__" - ;; -NetBSD*) - CPPFLAGS="$CPPFLAGS -D__NETBSD__" - ;; -CYGWIN*) - CPPFLAGS="$CPPFLAGS -DFD_SETSIZE=4096 -DCYGWIN" - fd_setsize="done" - DLLEXT=".dll" - ;; -Darwin*) - DLLEXT=".dylib" - ;; -esac -AC_SUBST([DLLEXT]) + CFLAGS="$OLD_CFLAGS $MYSQL_CFLAGS $PCRE_CFLAGS -static" + LDFLAGS="$OLD_LDFLAGS -static" + LIBS="$OLD_LIBS $MYSQL_LIBS $PCRE_LIBS" -AC_MSG_CHECKING([for MinGW]) -if test -n "`$CC --version 2>/dev/null | grep -i mingw`" ; then - AC_MSG_RESULT([yes]) - CPPFLAGS="$CPPFLAGS -DMINGW" - if test -z "$fd_setsize" ; then - CPPFLAGS="$CPPFLAGS -DFD_SETSIZE=4096" - fi - LIBS="$LIBS -lws2_32" -else - AC_MSG_RESULT([no]) + AC_MSG_CHECKING([whether $CC supports -static]) + AC_RUN_IFELSE( + [AC_LANG_SOURCE([ + int main(int argc, char **argv){ + return 0; + } + ])], + [ + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no]) + STATIC="" + ], + [ + AC_MSG_RESULT([guessing no]) + STATIC="" + ] + ) + CFLAGS="$OLD_CFLAGS -static-libgcc" + LDFLAGS="$OLD_LDFLAGS -static-libgcc" + + AC_MSG_CHECKING([whether $CC supports -static-libgcc]) + AC_RUN_IFELSE( + [AC_LANG_SOURCE([ + int main(int argc, char **argv){ + return 0; + } + ])], + [ + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no]) + PLUGINSTATIC="" + ], + [ + AC_MSG_RESULT([guessing no]) + PLUGINSTATIC="" + ] + ) + + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" + LIBS="$OLD_LIBS" fi +AC_SUBST(STATIC, ${STATIC}) +AC_SUBST(PLUGINSTATIC, ${PLUGINSTATIC}) + + + +# +# Doxygen, perl (for HPMHookGen) +# +AC_CHECK_PROG([HAVE_DOXYGEN],[doxygen],[yes],[no]) + +AC_CHECK_PROG([HAVE_PERL],[perl],[yes],[no]) ############################################################################### AC_OUTPUT |