blob: ed2bf7af5071fd545a610b40d71564cea56bf683 [file] [log] [blame]
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +05301isic: add with-libnet remove libnet test
2
Patrick Williams520786c2023-06-25 16:20:36 -05003Upstream-Status: Inappropriate [embedded specific]
4builds fine on non-oe systems. We need to exlude
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +05305cross compile libnet test. Pass in the location for libnet.a. Path
6did not support mulitlib either.
7
8Signed-off-by: Armin Kuster <akuster808@gmail.com>
9
10Index: isic-0.07/configure
11===================================================================
12--- isic-0.07.orig/configure
13+++ isic-0.07/configure
14@@ -45,6 +45,8 @@ includedir='${prefix}/include'
15 oldincludedir='/usr/include'
16 infodir='${prefix}/info'
17 mandir='${prefix}/man'
18+with_libnet_libraries
19+libnet_libraries
20
21 # Initialize some other variables.
22 subdirs=
23@@ -180,6 +182,7 @@ Features and packages:
24 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
25 --x-includes=DIR X include files are in DIR
26 --x-libraries=DIR X library files are in DIR
27+ --with-libnet-dir=DIR libnet library is in this DIR
28 EOF
29 if test -n "$ac_help"; then
30 echo "--enable and --with options recognized:$ac_help"
31@@ -828,117 +832,36 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR
32 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
33
34
35-PREFIX=/usr/local
36-
37-ac_safe=`echo "$PREFIX/lib/libnet.a" | sed 'y%./+-%__p_%'`
38-echo $ac_n "checking for $PREFIX/lib/libnet.a""... $ac_c" 1>&6
39-echo "configure:836: checking for $PREFIX/lib/libnet.a" >&5
40-if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
41- echo $ac_n "(cached) $ac_c" 1>&6
42-else
43- if test "$cross_compiling" = yes; then
44- { echo "configure: error: Cannot check for file existence when cross compiling" 1>&2; exit 1; }
45-else
46- if test -r $PREFIX/lib/libnet.a; then
47- eval "ac_cv_file_$ac_safe=yes"
48- else
49- eval "ac_cv_file_$ac_safe=no"
50- fi
51-fi
52-fi
53-if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
54- echo "$ac_t""yes" 1>&6
55- FOO=$LIBS; CFLAGS="$CFLAGS -I$PREFIX/include" LIBS="-L$PREFIX/lib $LIBS"
56-else
57- echo "$ac_t""no" 1>&6
58-
59-fi
60-
61-echo $ac_n "checking for -lnet""... $ac_c" 1>&6
62-echo "configure:884: checking for -lnet" >&5
63-if eval "test \"`echo '$''{'ac_cv_lib_net'+set}'`\" = set"; then
64- echo $ac_n "(cached) $ac_c" 1>&6
65-else
66- ac_save_LIBS="$LIBS"
67-LIBS="-lnet $LIBS"
68-cat > conftest.$ac_ext <<EOF
69-#line 891 "configure"
70-#include "confdefs.h"
71-
72-int main() {
73-main()
74-; return 0; }
75-EOF
76-if { (eval echo configure:898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
77- rm -rf conftest*
78- ac_cv_lib_net=yes
79-else
80- echo "configure: failed program was:" >&5
81- cat conftest.$ac_ext >&5
82- rm -rf conftest*
83- ac_cv_lib_net=no
84+LIBNET_GLOB='libnet.a'
85+libnet_libraries=""
86+ac_libnet_libraries=NO
87+
88+# Check whether --with-libnet-libraries was given.
89+if test "${with_libnet_libraries+set}" = set; then :
90+ withval=$with_libnet_libraries; ac_libnet_libraries="$withval"
91+fi
92+
93+if test ! "$ac_libnet_libraries" = "NO"; then
94+ libnet_libdir=$ac_libnet_libraries
95+else
96+ libnet_libdirs="/usr/lib"
97+ libnet_libdir=NONE
98+ for dir in $libnet_libdirs; do
99+ try="ls -1 $dir/${LIBNET_GLOB}"
100+ if test -n "`$try 2> /dev/null`"; then libnet_libdir=$dir; break; else echo "tried $dir" >&5; fi
101+ done
102 fi
103-rm -f conftest*
104-LIBS="$ac_save_LIBS"
105
106-fi
107-echo "$ac_t""$ac_cv_lib_net" 1>&6
108-if test "$ac_cv_lib_net" = yes; then
109- DEFINES=
110-else
111- { echo "configure: error: Cannot find libnet... please get it from
112- http://www.packetfactory.net/libnet" 1>&2; exit 1; }
113-fi
114+ac_libnet_libdir="$libnet_libdir"
115
116-echo $ac_n "checking for libnet_init in -lnet""... $ac_c" 1>&6
117-echo "configure:921: checking for libnet_init in -lnet" >&5
118-ac_lib_var=`echo net'_'libnet_init | sed 'y%./+-%__p_%'`
119-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
120- echo $ac_n "(cached) $ac_c" 1>&6
121-else
122- ac_save_LIBS="$LIBS"
123-LIBS="-lnet $LIBS"
124-cat > conftest.$ac_ext <<EOF
125-#line 929 "configure"
126-#include "confdefs.h"
127-/* Override any gcc2 internal prototype to avoid an error. */
128-/* We use char because int might match the return type of a gcc2
129- builtin and then its argument prototype would still apply. */
130-char libnet_init();
131-
132-int main() {
133-libnet_init()
134-; return 0; }
135-EOF
136-if { (eval echo configure:940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
137- rm -rf conftest*
138- eval "ac_cv_lib_$ac_lib_var=yes"
139-else
140- echo "configure: failed program was:" >&5
141- cat conftest.$ac_ext >&5
142- rm -rf conftest*
143- eval "ac_cv_lib_$ac_lib_var=no"
144+if test "$libnet_libraries"; then
145+ libnet_libraries="$ac_libnet_libdir"
146 fi
147-rm -f conftest*
148-LIBS="$ac_save_LIBS"
149-
150-fi
151-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
152- echo "$ac_t""yes" 1>&6
153- ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
154- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
155- cat >> confdefs.h <<EOF
156-#define $ac_tr_lib 1
157-EOF
158
159- LIBS="-lnet $LIBS"
160-
161-else
162- echo "$ac_t""no" 1>&6
163+if test "$libnet_libraries" != "$x_libraries" && test -n "$libnet_libraries"; then
164+ LIBS="$LIBS -lnet"
165 fi
166
167-
168-
169 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
170 echo "configure:970: checking how to run the C preprocessor" >&5
171 # On Suns, sometimes $CPP names a directory.