summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-01-21 17:57:20 -0800
committerGuy Harris <guy@alum.mit.edu>2018-01-21 17:57:20 -0800
commit45fc519a2ac35af5805204418c370136aa0db1f7 (patch)
tree4fb15d49aabe44730e7e042ee1a658de7040faa6 /aclocal.m4
parentc29177f65837dfa7bc18daf7df872069811ab91e (diff)
downloadtcpdump-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 'aclocal.m4')
-rw-r--r--aclocal.m4113
1 files changed, 0 insertions, 113 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 6af76f10..bd72a0a7 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1045,119 +1045,6 @@ dnl LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
dnl OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
dnl SUCH DAMAGE.
-dnl
-dnl Test for __attribute__
-dnl
-
-AC_DEFUN(AC_C___ATTRIBUTE__, [
-AC_MSG_CHECKING(for __attribute__)
-AC_CACHE_VAL(ac_cv___attribute__, [
-AC_COMPILE_IFELSE([
- AC_LANG_SOURCE([[
-#include <stdlib.h>
-
-static void foo(void) __attribute__ ((noreturn));
-
-static void
-foo(void)
-{
- exit(1);
-}
-
-int
-main(int argc, char **argv)
-{
- foo();
-}
- ]])],
-ac_cv___attribute__=yes,
-ac_cv___attribute__=no)])
-if test "$ac_cv___attribute__" = "yes"; then
- AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
-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
-AC_MSG_RESULT($ac_cv___attribute__)
-])
-
-
-dnl
-dnl Test whether __attribute__((unused)) can be used without warnings
-dnl
-
-AC_DEFUN(AC_C___ATTRIBUTE___UNUSED, [
-AC_MSG_CHECKING([whether __attribute__((unused)) can be used without warnings])
-AC_CACHE_VAL(ac_cv___attribute___unused, [
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors"
-AC_COMPILE_IFELSE([
- AC_LANG_SOURCE([[
-#include <stdlib.h>
-#include <stdio.h>
-
-int
-main(int argc __attribute((unused)), char **argv __attribute((unused)))
-{
- printf("Hello, world!\n");
- return 0;
-}
- ]])],
-ac_cv___attribute___unused=yes,
-ac_cv___attribute___unused=no)])
-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
-AC_MSG_RESULT($ac_cv___attribute___unused)
-])
-
-dnl
-dnl Test whether __attribute__((fallthrough)) can be used without warnings
-dnl
-
-AC_DEFUN(AC_C___ATTRIBUTE___FALLTHROUGH, [
-AC_MSG_CHECKING([whether __attribute__((fallthrough)) can be used without warnings])
-AC_CACHE_VAL(ac_cv___attribute___fallthrough, [
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors"
-AC_COMPILE_IFELSE([
- AC_LANG_SOURCE([[
-#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;
-}
- ]])],
-ac_cv___attribute___fallthrough=yes,
-ac_cv___attribute___fallthrough=no)])
-CFLAGS="$save_CFLAGS"
-if test "$ac_cv___attribute___fallthrough" = "yes"; then
- AC_DEFINE(__ATTRIBUTE___FALLTHROUGH_OK, 1,
- [define if your compiler allows __attribute__((fallthrough)) without a warning])
-fi
-AC_MSG_RESULT($ac_cv___attribute___fallthrough)
-])
-
AC_DEFUN(AC_LBL_SSLEAY,
[
#