aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/libpcap/libpcap-1.0.0/0001-Fix-some-problems-that-show-up-in-autoconf-2.64-and-.patch
blob: bd5f725d36302318d9393be5b3bec9acc6b3686f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
From d1a3a92fab103210ab5f61780a731bce9a8909b5 Mon Sep 17 00:00:00 2001
From: Guy Harris <guy@alum.mit.edu>
Date: Sat, 2 Jan 2010 14:15:46 -0800
Subject: [PATCH] Fix some problems that show up in autoconf 2.64 and later.

---
 aclocal.m4   |   60 ++++++++++++++++++++++++++++++++++++---------------------
 configure    |    9 ++++---
 configure.in |    2 +
 3 files changed, 45 insertions(+), 26 deletions(-)

Index: libpcap-1.0.0/aclocal.m4
===================================================================
--- libpcap-1.0.0.orig/aclocal.m4
+++ libpcap-1.0.0/aclocal.m4
@@ -23,30 +23,21 @@ dnl LBL autoconf macros
 dnl
 
 dnl
-dnl Determine which compiler we're using (cc or gcc)
-dnl If using gcc, determine the version number
-dnl If using cc, require that it support ansi prototypes
-dnl If using gcc, use -O2 (otherwise use -O)
-dnl If using cc, explicitly specify /usr/local/include
-dnl
-dnl usage:
-dnl
-dnl	AC_LBL_C_INIT(copt, incls)
-dnl
-dnl results:
+dnl Do whatever AC_LBL_C_INIT work is necessary before using AC_PROG_CC.
 dnl
-dnl	$1 (copt set)
-dnl	$2 (incls set)
-dnl	CC
-dnl	LDFLAGS
-dnl	ac_cv_lbl_gcc_vers
-dnl	LBL_CFLAGS
+dnl It appears that newer versions of autoconf (2.64 and later) will,
+dnl if you use AC_TRY_COMPILE in a macro, stick AC_PROG_CC at the
+dnl beginning of the macro, even if the macro itself calls AC_PROG_CC.
+dnl See section 20.8 "Expanded Before Required" in the Autoconf
+dnl documentation.
+dnl
+dnl This causes a steaming heap of fail in our case, as we were, in
+dnl AC_LBL_C_INIT, doing the tests we now do in AC_LBL_C_PREPARE,
+dnl calling AC_PROG_CC, and then doing the tests we now do in
+dnl AC_LBL_C_INIT.
 dnl
-AC_DEFUN([AC_LBL_C_INIT],
-    [AC_PREREQ(2.12)
-    AC_BEFORE([$0], [AC_PROG_CC])
-    AC_BEFORE([$0], [AC_LBL_FIXINCLUDES])
-    AC_BEFORE([$0], [AC_LBL_DEVEL])
+AC_DEFUN(AC_LBL_C_INIT_BEFORE_CC,
+[
     AC_ARG_WITH(gcc, [  --without-gcc           don't use gcc])
     $1="-O"
     $2=""
@@ -72,7 +63,32 @@ AC_DEFUN([AC_LBL_C_INIT],
 	    CC=cc
 	    export CC
     fi
-    AC_PROG_CC
+])
+
+dnl
+dnl Determine which compiler we're using (cc or gcc)
+dnl If using gcc, determine the version number
+dnl If using cc, require that it support ansi prototypes
+dnl If using gcc, use -O2 (otherwise use -O)
+dnl If using cc, explicitly specify /usr/local/include
+dnl
+dnl usage:
+dnl
+dnl	AC_LBL_C_INIT(copt, incls)
+dnl
+dnl results:
+dnl
+dnl	$1 (copt set)
+dnl	$2 (incls set)
+dnl	CC
+dnl	LDFLAGS
+dnl	ac_cv_lbl_gcc_vers
+dnl	LBL_CFLAGS
+dnl
+AC_DEFUN(AC_LBL_C_INIT,
+    [AC_PREREQ(2.50)
+    AC_BEFORE([$0], [AC_LBL_FIXINCLUDES])
+    AC_BEFORE([$0], [AC_LBL_DEVEL])
     if test "$GCC" = yes ; then
 	    if test "$SHLICC2" = yes ; then
 		    ac_cv_lbl_gcc_vers=2
Index: libpcap-1.0.0/configure
===================================================================
--- libpcap-1.0.0.orig/configure
+++ libpcap-1.0.0/configure
@@ -1893,9 +1893,6 @@ test -n "$target_alias" &&
 
 
 
-
-
-
 # Check whether --with-gcc was given.
 if test "${with_gcc+set}" = set; then
   withval=$with_gcc;
@@ -1962,7 +1959,8 @@ fi
 	    CC=cc
 	    export CC
     fi
-    ac_ext=c
+
+ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -2881,6 +2879,9 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS con
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+
+
+
     if test "$GCC" = yes ; then
 	    if test "$SHLICC2" = yes ; then
 		    ac_cv_lbl_gcc_vers=2
Index: libpcap-1.0.0/configure.in
===================================================================
--- libpcap-1.0.0.orig/configure.in
+++ libpcap-1.0.0/configure.in
@@ -12,6 +12,8 @@ AC_INIT(pcap.c)
 
 AC_CANONICAL_SYSTEM
 
+AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
+AC_PROG_CC
 AC_LBL_C_INIT(V_CCOPT, V_INCLS, V_LIBS)
 AC_LBL_C_INLINE
 AC_C___ATTRIBUTE__