diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-01-21 17:57:20 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-01-21 17:57:20 -0800 |
commit | 45fc519a2ac35af5805204418c370136aa0db1f7 (patch) | |
tree | 4fb15d49aabe44730e7e042ee1a658de7040faa6 /configure | |
parent | c29177f65837dfa7bc18daf7df872069811ab91e (diff) | |
download | tcpdump-45fc519a2ac35af5805204418c370136aa0db1f7.tar.gz |
Don't test for __attribute__ in the configure script.
Instead, use compiler test macros to check whether *particular*
attributes are supported, and set various #defines appropriately, in
header files.
Rename the UNALIGNED structure attribute to ND_UNALIGNED, and ask
whether we still need it.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 144 |
1 files changed, 0 insertions, 144 deletions
@@ -3628,150 +3628,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__" >&5 -$as_echo_n "checking for __attribute__... " >&6; } -if ${ac_cv___attribute__+:} false; then : - $as_echo_n "(cached) " >&6 -else - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#include <stdlib.h> - -static void foo(void) __attribute__ ((noreturn)); - -static void -foo(void) -{ - exit(1); -} - -int -main(int argc, char **argv) -{ - foo(); -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv___attribute__=yes -else - ac_cv___attribute__=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -if test "$ac_cv___attribute__" = "yes"; then - -$as_echo "#define HAVE___ATTRIBUTE__ 1" >>confdefs.h - -else - # - # We can't use __attribute__, so we can't use __attribute__((unused)), - # so we define _U_ to an empty string. - # - V_DEFS="$V_DEFS -D_U_=\"\"" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute__" >&5 -$as_echo "$ac_cv___attribute__" >&6; } - -if test "$ac_cv___attribute__" = "yes"; then - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((unused)) can be used without warnings" >&5 -$as_echo_n "checking whether __attribute__((unused)) can be used without warnings... " >&6; } -if ${ac_cv___attribute___unused+:} false; then : - $as_echo_n "(cached) " >&6 -else - -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#include <stdlib.h> -#include <stdio.h> - -int -main(int argc __attribute((unused)), char **argv __attribute((unused))) -{ - printf("Hello, world!\n"); - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv___attribute___unused=yes -else - ac_cv___attribute___unused=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -CFLAGS="$save_CFLAGS" -if test "$ac_cv___attribute___unused" = "yes"; then - V_DEFS="$V_DEFS -D_U_=\"__attribute__((unused))\"" -else - V_DEFS="$V_DEFS -D_U_=\"\"" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute___unused" >&5 -$as_echo "$ac_cv___attribute___unused" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((fallthrough)) can be used without warnings" >&5 -$as_echo_n "checking whether __attribute__((fallthrough)) can be used without warnings... " >&6; } -if ${ac_cv___attribute___fallthrough+:} false; then : - $as_echo_n "(cached) " >&6 -else - -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#include <stdio.h> - -int -main(int argc, char **argv) -{ - int x = 1; - switch (x) - { - case 1: - printf ("x == %d\n", x); - __attribute__ ((fallthrough)); - case 2: - printf ("x == %d\n", x); - break; - default: - return 0; - } - return x; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv___attribute___fallthrough=yes -else - ac_cv___attribute___fallthrough=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -CFLAGS="$save_CFLAGS" -if test "$ac_cv___attribute___fallthrough" = "yes"; then - -$as_echo "#define __ATTRIBUTE___FALLTHROUGH_OK 1" >>confdefs.h - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute___fallthrough" >&5 -$as_echo "$ac_cv___attribute___fallthrough" >&6; } - -fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' |