Nmap Development mailing list archives

configure patch for nmap 3.45


From: Petter Reinholdtsen <pere () hungry com>
Date: Wed, 17 Sep 2003 17:34:18 +0200


Here is a small patch for nmap 3.45 to fix a compile problem on HP-UX
11.22, whose test do not understand the non-standard '==' check.
Please include it in a future version of nmap.

diff -ur src-3.45/nbase/configure.ac src-3.45-local/nbase/configure.ac
--- src-3.45/nbase/configure.ac 2003-09-13 06:19:55.000000000 +0200
+++ src-3.45-local/nbase/configure.ac   2003-09-17 17:06:14.000000000 +0200
@@ -171,27 +171,27 @@


 # If they didn't specify it, we try to find it
-if test "$use_openssl" == "yes" -a "${specialssldir+set}" == "set" ; then
+if test "$use_openssl" = "yes" -a "${specialssldir+set}" = "set" ; then
   AC_CHECK_HEADER(openssl/ssl.h,,
   [ use_openssl="no"
     AC_MSG_WARN([Failed to find openssl/ssl.h so OpenSSL will not be used. If it  is installed you can try the 
--with-openssl=DIR argument]) ])

- if test "$use_openssl" == "yes"; then
+ if test "$use_openssl" = "yes"; then
    AC_CHECK_HEADER(openssl/err.h,,
     [ use_openssl="no"
     AC_MSG_WARN([Failed to find openssl/err.h so OpenSSL will not be used. If it  is installed you can try the 
--with-openssl=DIR argument]) ])
  fi

- if test "$use_openssl" == "yes"; then
+ if test "$use_openssl" = "yes"; then
    AC_CHECK_HEADER(openssl/rand.h,,
     [ use_openssl="no"
     AC_MSG_WARN([Failed to find openssl/rand.h so OpenSSL will not be used. If i t is installed you can try the 
--with-openssl=DIR argument]) ])
  fi

- if test "$use_openssl" == "yes"; then
+ if test "$use_openssl" = "yes"; then
    AC_CHECK_LIB(ssl, SSL_new,
     [],
     [ use_openssl="no"
@@ -200,7 +200,7 @@
  fi
 fi

-if test "$use_openssl" == "yes"; then
+if test "$use_openssl" = "yes"; then
   AC_DEFINE(HAVE_OPENSSL)
 fi


There is also another problem with the configure script.  I ran into
this message:

  checking for gethostent... yes
  checking for setsockopt... yes
  checking for char... yes
  checking size of char... configure: error: cannot compute sizeof (char), 77
  See `config.log' for more details.
  configure: error: /bin/sh './configure' failed for nbase

Checking the content of config.log, it seems like libssl depends on
some library which is missing from the link line:

  configure:4496: checking size of char
  configure:4771: cc-wrapper -o conftest -g  -L/local/lib conftest.c -lssl  >&5
  ld: (Warning) Unsatisfied symbol "BIO_int_ctrl" in file /local/lib/libssl.sl

  ld: (Warning) Unsatisfied symbol "EVP_EncryptInit_ex" in file
    /local/lib/libssl.sl
  ld: (Warning) Unsatisfied symbol "EVP_DigestInit_ex" in file
    /local/lib/libssl.sl
  [...]

To avoid this problem, I suggest moving the compiler feature test
before the library test (thus avoiding linking with the detected
libraries when testing for compiler features), and to add a test for
libcrypto before libssl, to make sure the link line will use -lssl
-lcrypto as it should when linking a SSL program.  Here is a patch to
do that.

diff -ur src-3.45/nbase/configure.ac src-3.45-local/nbase/configure.ac
--- src-3.45/nbase/configure.ac 2003-09-13 06:19:55.000000000 +0200
+++ src-3.45-local/nbase/configure.ac   2003-09-17 17:25:27.000000000 +0200
@@ -123,6 +123,22 @@
 esac


+dnl check endedness
+AC_C_BIGENDIAN
+
+dnl determine integer widths so nbase can export u32, u16, etc.
+AC_CHECK_SIZEOF(char, 1)
+AC_CHECK_SIZEOF(short, 2)
+AC_CHECK_SIZEOF(int, 4)
+AC_CHECK_SIZEOF(long, 4)
+
+dnl equiv to '#define inline' to 'inline', '__inline__', '__inline' or ''
+AC_C_INLINE
+if test -n "$sgi_cc"; then
+   AC_DEFINE(inline, )
+fi
+AC_C___ATTRIBUTE__
+
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS( string.h getopt.h strings.h memory.h sys/param.h sys/time.h unistd.h bstring.h errno.h sys/types.h 
sys/socket.h netinet/in.h sys/sockio.h rpc/types.h netdb.h pwd.h arpa/inet.h sys/resource.h sys/stat.h sys/wait.h 
libiberty.h fcntl.h )
@@ -192,6 +208,13 @@
  fi

  if test "$use_openssl" = "yes"; then
+   AC_CHECK_LIB(crypto, BIO_int_ctrl,
+    [],
+    [ use_openssl="no"
+    AC_MSG_WARN([Failed to find libcrypto so OpenSSL will not be used. If it is
ins
+talled you can try the --with-openssl=DIR argument]) ])
+ fi
+ if test "$use_openssl" = "yes"; then
    AC_CHECK_LIB(ssl, SSL_new,
     [],
     [ use_openssl="no"
@@ -205,30 +228,14 @@
 fi


-dnl equiv to '#define inline' to 'inline', '__inline__', '__inline' or ''
-AC_C_INLINE
-if test -n "$sgi_cc"; then
-   AC_DEFINE(inline, )
-fi
-AC_C___ATTRIBUTE__
-
 dnl AC_HEADER_TIME

 AC_SUBST(CFLAGS)

-dnl check endedness
-AC_C_BIGENDIAN
-
 dnl If any socket libraries needed
 AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))

-dnl determine integer widths so nbase can export u32, u16, etc.
-AC_CHECK_SIZEOF(char, 1)
-AC_CHECK_SIZEOF(short, 2)
-AC_CHECK_SIZEOF(int, 4)
-AC_CHECK_SIZEOF(long, 4)
-
 dnl Checks for library functions.
 dnl AC_TYPE_SIGNAL
 AC_CHECK_FUNCS( bzero snprintf vsnprintf memcpy nanosleep strerror strcasestr strcasecmp strncasecmp signal )

---------------------------------------------------------------------
For help using this (nmap-dev) mailing list, send a blank email to 
nmap-dev-help () insecure org . List run by ezmlm-idx (www.ezmlm.org).



Current thread: