diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 150 |
1 files changed, 53 insertions, 97 deletions
diff --git a/configure.in b/configure.in index bfcc27322..fd60e58c6 100644 --- a/configure.in +++ b/configure.in @@ -443,54 +443,6 @@ AC_ARG_WITH( ) -# -# Enable/disable PCRE and optionally specify the path (optional library) -# -AC_ARG_WITH( - [pcre], - AC_HELP_STRING( - [--with-pcre@<:@=ARG@:>@], - [use PCRE library, optionally specify the full path of pcre installation directory (by default pcre is used if found)] - ), - [ - if test "$withval" = "no" ; then - want_pcre="no" - else - want_pcre="yes" - require_pcre="yes" - if test "$withval" != "yes" ; then - if test ! -d "$withval" ; then - AC_MSG_ERROR([$withval is not a directoy]) - fi - PCRE_HOME="$withval" - fi - fi - ], - [want_pcre="yes" require_pcre="no"] -) - - -# -# Specify the path of the zlib library (required library) -# -AC_ARG_WITH( - [zlib], - AC_HELP_STRING( - [--with-zlib=DIR], - [root directory path of zlib installation (defaults to /usr/local or /usr if not found in /usr/local). - Assumes that the header files are in DIR/include and the library files are in DIR/lib] - ), - [ - test -n "$withval" && ZLIB_HOME="$withval" - ], - [ - ZLIB_HOME=/usr/local - test ! -f "${ZLIB_HOME}/include/zlib.h" && ZLIB_HOME=/usr - ] -) - - - ############################################################################### # Check for programs and types. # @@ -504,10 +456,40 @@ AC_PATH_PROG(AR, ar) AC_LANG([C]) -CFLAGS="$CFLAGS -pipe -ffast-math -fvisibility=hidden -Wall -Wextra -Wno-sign-compare" +# -Wcast-qual use for check wrong casts. It cant be added by default, because some casts must be wrong. +# -Wconversion warning: conversion to 'long unsigned int' from 'int' may change the sign of the result +# -Wfloat-equal comparing floating point with == or != is unsafe +# -Wunsuffixed-float-constants float issues +# -Wpedantic different pedantic checks. Not all can be fixed in nice way. +# -Wtraditional-conversion some conversion issues +# -Wunsafe-loop-optimizations possible optimisation issues +# -Wunused-parameter -Wunused-but-set-parameter unused parameters +# -Wunused-macros unused macro warnings, but it also enable unused parameters +# -Wstrict-prototypes show warning in grammar.y +# attributes suggestion +# -Wsuggest-attribute=const -Wsuggest-attribute=format -Wsuggest-attribute=pure + +# flags what can be used but now return no warnings: +# -Wchkp -Wdisabled-optimization +# -Werror-implicit-function-declaration -Wtrampolines +# -Wjump-misses-init + +CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wextra -Wno-sign-compare -std=c99" CPPFLAGS="$CPPFLAGS -I../common" LDFLAGS="$LDFLAGS" +# Add /usr/local to the library and header search path, where appropriate +case `uname` in + Darwin*|*BSD*) + if test -d /usr/local/include ; then + CPPFLAGS="$CPPFLAGS -I/usr/local/include" + fi + if test -d /usr/local/lib ; then + LDFLAGS="$LDFLAGS -L/usr/local/lib" + fi + ;; +esac + AC_C_BIGENDIAN( [AC_MSG_ERROR([[bigendian is not supported... stopping]])], , @@ -830,11 +812,26 @@ AC_CHECK_COMPILER_WNOFLAG(clobbered) AC_CHECK_COMPILER_WFLAG(empty-body) AC_CHECK_COMPILER_WFLAG(newline-eof) AC_CHECK_COMPILER_WFLAG(int-conversion) +AC_CHECK_COMPILER_WFLAG(init-self) +AC_CHECK_COMPILER_WFLAG(pointer-arith) +AC_CHECK_COMPILER_WFLAG(switch-bool) AC_CHECK_COMPILER_WFLAG(enum-conversion) AC_CHECK_COMPILER_WFLAG(shorten-64-to-32) AC_CHECK_COMPILER_WFLAG(constant-conversion) AC_CHECK_COMPILER_WFLAG(bool-conversion) AC_CHECK_COMPILER_WFLAG(format-security) +AC_CHECK_COMPILER_WFLAG(format) +AC_CHECK_COMPILER_WFLAG(format-signedness) +AC_CHECK_COMPILER_WFLAG(format-y2k) +AC_CHECK_COMPILER_WFLAG(missing-include-dirs) +AC_CHECK_COMPILER_WFLAG(suggest-attribute=noreturn) +AC_CHECK_COMPILER_WFLAG(undef) +#AC_CHECK_COMPILER_WFLAG(cast-align) +AC_CHECK_COMPILER_WFLAG(logical-op) +AC_CHECK_COMPILER_WFLAG(nested-externs) +AC_CHECK_COMPILER_WFLAG(old-style-definition) +AC_CHECK_COMPILER_WFLAG(overlength-strings) +AC_CHECK_COMPILER_WFLAG(redundant-decls) AC_CHECK_COMPILER_WNOFLAG(format-nonliteral) AC_CHECK_COMPILER_WNOFLAG(switch) AC_CHECK_COMPILER_WNOFLAG(missing-field-initializers) @@ -1188,12 +1185,8 @@ fi # # zlib library (required) # -if test -n "${ZLIB_HOME}" ; then - LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib" - CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include" -fi -AC_SEARCH_LIBS([inflateEnd], [z], [],[AC_MSG_ERROR([zlib library not found or incompatible, please specify the correct path with --with-zlib=DIR... stopping])]) -AC_CHECK_HEADER([zlib.h], [], [AC_MSG_ERROR([zlib header not found, please specify the correct path with --with-zlib=DIR... stopping])]) +AC_SEARCH_LIBS([inflateEnd], [z], [],[AC_MSG_ERROR([zlib library not found or incompatible... stopping])]) +AC_CHECK_HEADER([zlib.h], [], [AC_MSG_ERROR([zlib header not found, please specify the correct path with... stopping])]) # @@ -1317,47 +1310,10 @@ AC_SUBST([MYSQL_LIBS]) # # PCRE library (optional) # -##TODO PCRE version -PCRE_LIBS="" -PCRE_CFLAGS="" - -if test "$want_pcre" = "no" ; then - AC_MSG_NOTICE([ignoring PCRE (optional)]) -else - if test -z "$PCRE_HOME" ; then - AC_CHECK_LIB([pcre], [pcre_study], [HAVE_PCRE="yes"], []) - if test "$HAVE_PCRE" = "yes" ; then - PCRE_LIBS="-lpcre" - PCRE_CFLAGS="-DPCRE_SUPPORT" - fi - else - PCRE_OLD_LDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$PCRE_HOME/lib" - PCRE_OLD_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS -I$PCRE_HOME/include" - AC_CHECK_LIB(pcre, pcre_compile, [HAVE_PCRE="yes"], []) - CPPFLAGS="$PCRE_OLD_CPPFLAGS" - LDFLAGS="$PCRE_OLD_LDFLAGS" - if test "$HAVE_PCRE" = "yes" ; then - PCRE_LIBS="-L$PCRE_HOME/lib -lpcre" - test -d "$PCRE_HOME/include" && PCRE_CFLAGS="-I$PCRE_HOME/include -DPCRE_SUPPORT" - fi - fi - AC_MSG_CHECKING([PCRE library (optional)]) - if test "$HAVE_PCRE" = "yes" ; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - if test "$require_pcre" = "yes" ; then - AC_MSG_ERROR([PCRE not found or incompatible (requested)]) - else - AC_MSG_NOTICE([disabling PCRE (optional)]) - fi - fi -fi - -AC_SUBST([HAVE_PCRE]) -AC_SUBST([PCRE_LIBS]) -AC_SUBST([PCRE_CFLAGS]) +AC_MSG_CHECKING([PCRE library]) +AC_CHECK_HEADER([pcre.h], [], [AC_MSG_ERROR([PCRE header not found])]) +AC_SEARCH_LIBS([pcre_study], [pcre], [], AC_MSG_ERROR([PCRE not found or incompatible])) # # static Support test @@ -1371,9 +1327,9 @@ if test "$enable_static" != "no" ; then OLD_LDFLAGS="$LDFLAGS" OLD_LIBS="$LIBS" - CFLAGS="$OLD_CFLAGS $MYSQL_CFLAGS $PCRE_CFLAGS -static" + CFLAGS="$OLD_CFLAGS $MYSQL_CFLAGS -static" LDFLAGS="$OLD_LDFLAGS -static" - LIBS="$OLD_LIBS $MYSQL_LIBS $PCRE_LIBS" + LIBS="$OLD_LIBS $MYSQL_LIBS" AC_MSG_CHECKING([whether $CC supports -static]) AC_RUN_IFELSE( |