diff options
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 118 |
1 files changed, 39 insertions, 79 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 31a18e10fc47..83f5761f0b13 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -102,6 +102,13 @@ AC_DEFUN(AC_LBL_C_INIT, # -Werror forces warnings to be errors. # ac_lbl_cc_force_warning_errors=-Werror + + # + # Try to have the compiler default to hiding symbols, + # so that only symbols explicitly exported with + # PCAP_API will be visible outside (shared) libraries. + # + AC_LBL_CHECK_COMPILER_OPT($1, -fvisibility=hidden) else $2="$$2 -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" @@ -114,6 +121,13 @@ AC_DEFUN(AC_LBL_C_INIT, # of which use -Werror to force warnings to be errors. # ac_lbl_cc_force_warning_errors=-Werror + + # + # Try to have the compiler default to hiding symbols, + # so that only symbols explicitly exported with + # PCAP_API will be visible outside (shared) libraries. + # + AC_LBL_CHECK_COMPILER_OPT($1, -fvisibility=hidden) ;; hpux*) @@ -188,6 +202,13 @@ AC_DEFUN(AC_LBL_C_INIT, # warnings to be treated as errors. # ac_lbl_cc_force_warning_errors=-errwarn + + # + # Try to have the compiler default to hiding symbols, + # so that only symbols explicitly exported with + # PCAP_API will be visible outside (shared) libraries. + # + AC_LBL_CHECK_COMPILER_OPT($1, -xldscope=hidden) ;; ultrix*) @@ -231,7 +252,7 @@ AC_DEFUN(AC_LBL_CHECK_UNKNOWN_WARNING_OPTION_ERROR, # We're assuming this is clang, where # -Werror=unknown-warning-option is the appropriate # option to force the compiler to fail. - # + # ac_lbl_unknown_warning_option_error="-Werror=unknown-warning-option" ], [ @@ -249,7 +270,18 @@ AC_DEFUN(AC_LBL_CHECK_COMPILER_OPT, [ AC_MSG_CHECKING([whether the compiler supports the $2 option]) save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error $2" + if expr "x$2" : "x-W.*" >/dev/null + then + CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error $2" + elif expr "x$2" : "x-f.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror $2" + elif expr "x$2" : "x-m.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror $2" + else + CFLAGS="$CFLAGS $2" + fi AC_TRY_COMPILE( [], [return 0], @@ -630,82 +662,6 @@ AC_DEFUN(AC_LBL_FIXINCLUDES, fi]) dnl -dnl Check for flex, default to lex -dnl Require flex 2.4 or higher -dnl Check for bison, default to yacc -dnl Default to lex/yacc if both flex and bison are not available -dnl -dnl If we're using flex and bison, pass -P to flex and -p to bison -dnl to define a prefix string for the lexer and parser -dnl -dnl If we're not using flex and bison, don't pass those options -dnl (as they might not work - although if "lex" is a wrapper for -dnl Flex and "yacc" is a wrapper for Bison, they will work), and -dnl define NEED_YYPARSE_WRAPPER (we *CANNOT* use YYBISON to check -dnl whether the wrapper is needed, as some people apparently, for -dnl some unknown reason, choose to use --without-flex and -dnl --without-bison on systems that have Flex and Bison, which -dnl means that the "yacc" they end up using is a wrapper that -dnl runs "bison -y", and at least some versions of Bison define -dnl YYBISON even if run with "-y", so we end up not compiling -dnl the yyparse wrapper and end up with a libpcap that doesn't -dnl define pcap_parse()) -dnl -dnl usage: -dnl -dnl AC_LBL_LEX_AND_YACC(lex, yacc, yyprefix) -dnl -dnl results: -dnl -dnl $1 (lex set) -dnl $2 (yacc appended) -dnl $3 (optional flex and bison -P prefix) -dnl -AC_DEFUN(AC_LBL_LEX_AND_YACC, - [AC_ARG_WITH(flex, [ --without-flex don't use flex]) - AC_ARG_WITH(bison, [ --without-bison don't use bison]) - if test "$with_flex" = no ; then - $1=lex - else - AC_CHECK_PROGS($1, flex, lex) - fi - if test "$$1" = flex ; then - # The -V flag was added in 2.4 - AC_MSG_CHECKING(for flex 2.4 or higher) - AC_CACHE_VAL(ac_cv_lbl_flex_v24, - if flex -V >/dev/null 2>&1; then - ac_cv_lbl_flex_v24=yes - else - ac_cv_lbl_flex_v24=no - fi) - AC_MSG_RESULT($ac_cv_lbl_flex_v24) - if test $ac_cv_lbl_flex_v24 = no ; then - s="2.4 or higher required" - AC_MSG_WARN(ignoring obsolete flex executable ($s)) - $1=lex - fi - fi - if test "$with_bison" = no ; then - $2=yacc - else - AC_CHECK_PROGS($2, bison, yacc) - fi - if test "$$2" = bison ; then - $2="$$2 -y" - fi - if test "$$1" != lex -a "$$2" = yacc -o "$$1" = lex -a "$$2" != yacc ; then - AC_MSG_WARN(don't have both flex and bison; reverting to lex/yacc) - $1=lex - $2=yacc - fi - if test "$$1" = flex -a -n "$3" ; then - $1="$$1 -P$3" - $2="$$2 -p $3" - else - AC_DEFINE(NEED_YYPARSE_WRAPPER,1,[if we need a pcap_parse wrapper around yyparse]) - fi]) - -dnl dnl Checks to see if union wait is used with WEXITSTATUS() dnl dnl usage: @@ -970,8 +926,12 @@ AC_DEFUN(AC_LBL_DEVEL, if test "$ac_lbl_cc_dont_try_gcc_dashW" != yes; then AC_LBL_CHECK_UNKNOWN_WARNING_OPTION_ERROR() AC_LBL_CHECK_COMPILER_OPT($1, -Wall) + AC_LBL_CHECK_COMPILER_OPT($1, -Wsign-compare) AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-prototypes) AC_LBL_CHECK_COMPILER_OPT($1, -Wstrict-prototypes) + AC_LBL_CHECK_COMPILER_OPT($1, -Wshadow) + AC_LBL_CHECK_COMPILER_OPT($1, -Wdeclaration-after-statement) + AC_LBL_CHECK_COMPILER_OPT($1, -Wused-but-marked-unused) fi AC_LBL_CHECK_DEPENDENCY_GENERATION_OPT() # @@ -1274,7 +1234,7 @@ dnl dnl AC_LBL_DL_PASSIVE_REQ_T dnl dnl results: -dnl +dnl dnl HAVE_DLPI_PASSIVE (defined) dnl AC_DEFUN(AC_LBL_DL_PASSIVE_REQ_T, |