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