aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-security/isic/files/configure_fix.patch
blob: ed2bf7af5071fd545a610b40d71564cea56bf683 (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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
isic: add with-libnet remove libnet test

Upstream-Status: Inappropriate [embedded specific]
builds fine on non-oe systems. We need to exlude
cross compile libnet test. Pass in the location for libnet.a. Path
did not support mulitlib either.

Signed-off-by: Armin Kuster <akuster808@gmail.com>

Index: isic-0.07/configure
===================================================================
--- isic-0.07.orig/configure
+++ isic-0.07/configure
@@ -45,6 +45,8 @@ includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
 mandir='${prefix}/man'
+with_libnet_libraries
+libnet_libraries
 
 # Initialize some other variables.
 subdirs=
@@ -180,6 +182,7 @@ Features and packages:
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --x-includes=DIR        X include files are in DIR
   --x-libraries=DIR       X library files are in DIR
+  --with-libnet-dir=DIR   libnet library is in this DIR
 EOF
     if test -n "$ac_help"; then
       echo "--enable and --with options recognized:$ac_help"
@@ -828,117 +832,36 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
-PREFIX=/usr/local
-
-ac_safe=`echo "$PREFIX/lib/libnet.a" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $PREFIX/lib/libnet.a""... $ac_c" 1>&6
-echo "configure:836: checking for $PREFIX/lib/libnet.a" >&5
-if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test "$cross_compiling" = yes; then
-    { echo "configure: error: Cannot check for file existence when cross compiling" 1>&2; exit 1; }
-else
-  if test -r $PREFIX/lib/libnet.a; then
-    eval "ac_cv_file_$ac_safe=yes"
-  else
-    eval "ac_cv_file_$ac_safe=no"
-  fi
-fi
-fi
-if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  FOO=$LIBS; CFLAGS="$CFLAGS -I$PREFIX/include" LIBS="-L$PREFIX/lib $LIBS"
-else
-  echo "$ac_t""no" 1>&6
-
-fi
-
-echo $ac_n "checking for -lnet""... $ac_c" 1>&6
-echo "configure:884: checking for -lnet" >&5
-if eval "test \"`echo '$''{'ac_cv_lib_net'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lnet  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 891 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_cv_lib_net=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_net=no
+LIBNET_GLOB='libnet.a'
+libnet_libraries=""
+ac_libnet_libraries=NO
+
+# Check whether --with-libnet-libraries was given.
+if test "${with_libnet_libraries+set}" = set; then :
+  withval=$with_libnet_libraries;   ac_libnet_libraries="$withval"
+fi
+
+if test ! "$ac_libnet_libraries" = "NO"; then
+  libnet_libdir=$ac_libnet_libraries
+else
+  libnet_libdirs="/usr/lib"
+  libnet_libdir=NONE
+  for dir in $libnet_libdirs; do
+    try="ls -1 $dir/${LIBNET_GLOB}"
+    if test -n "`$try 2> /dev/null`"; then libnet_libdir=$dir; break; else echo "tried $dir" >&5; fi
+  done
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-echo "$ac_t""$ac_cv_lib_net" 1>&6
-if test "$ac_cv_lib_net" = yes; then
-  DEFINES=  
-else
-  { echo "configure: error: Cannot find libnet...  please get it from
-	http://www.packetfactory.net/libnet" 1>&2; exit 1; }
-fi
+ac_libnet_libdir="$libnet_libdir"
 
-echo $ac_n "checking for libnet_init in -lnet""... $ac_c" 1>&6
-echo "configure:921: checking for libnet_init in -lnet" >&5
-ac_lib_var=`echo net'_'libnet_init | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lnet  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 929 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char libnet_init();
-
-int main() {
-libnet_init()
-; return 0; }
-EOF
-if { (eval echo configure:940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+if test "$libnet_libraries"; then
+  libnet_libraries="$ac_libnet_libdir"
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
 
-  LIBS="-lnet $LIBS"
-
-else
-  echo "$ac_t""no" 1>&6
+if test "$libnet_libraries" != "$x_libraries" && test -n "$libnet_libraries"; then
+  LIBS="$LIBS -lnet"
 fi
 
-
-
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
 echo "configure:970: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.