]> sjero.net Git - wget/blobdiff - configure.in
[svn] Commit various hash table changes:
[wget] / configure.in
index 474e5d576bc94122c946d205488d6952acf07068..ce654e61416ababa7eda18102a571b23c98d0b43 100644 (file)
@@ -45,6 +45,9 @@ AC_ARG_WITH(socks,
 [  --with-socks            use the socks library],
 [AC_DEFINE(HAVE_SOCKS)])
 
+AC_ARG_WITH(ssl,
+[  --with-ssl[=SSL_ROOT]   link with libssl [in SSL_ROOT/lib] for https: support])
+
 AC_ARG_ENABLE(opie,
 [  --disable-opie          disable support for opie or s/key FTP login],
 USE_OPIE=$enableval, USE_OPIE=yes)
@@ -80,6 +83,12 @@ dnl Find a good install
 dnl
 AC_PROG_INSTALL
 
+dnl
+dnl Configure our included libtool and make sure it's regenerated when needed
+dnl
+AM_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
+
 dnl
 dnl Find the compiler
 dnl
@@ -131,6 +140,7 @@ dnl
 dnl Checks for typedefs, structures, and compiler characteristics.
 dnl
 AC_C_CONST
+AC_C_INLINE
 AC_TYPE_SIZE_T
 AC_TYPE_PID_T
 dnl #### This generates a warning.  What do I do to shut it up?
@@ -160,6 +170,7 @@ dnl
 dnl Checks for library functions.
 dnl
 AC_FUNC_ALLOCA
+AC_FUNC_MMAP
 AC_CHECK_FUNCS(strdup strstr strcasecmp strncasecmp)
 AC_CHECK_FUNCS(gettimeofday mktime strptime)
 AC_CHECK_FUNCS(strerror snprintf vsnprintf select signal symlink access isatty)
@@ -182,12 +193,51 @@ then
   AC_CHECK_LIB(socks, Rconnect)
 fi
 
+dnl If --with-ssl was specified, make sure we can link with the OpenSSL libs.
+if test x"$with_ssl" != x -a x"$with_ssl" != x"no"; then
+  if test x"$with_ssl" = x"yes"; then
+    dnl OpenSSL's default install location:
+    with_ssl=/usr/local/ssl
+  fi
+  
+  SSL_INCLUDES=-I$with_ssl/include
+  AC_SUBST(SSL_INCLUDES)
+
+  LDFLAGS="-L$with_ssl/lib -R$with_ssl/lib $LDFLAGS"
+
+  ssl_link_failure=no
+
+  dnl Unfortunately, as of this writing (OpenSSL 0.9.6), the libcrypto shared
+  dnl library doesn't record its dependency on libdl, so we need to check for it
+  dnl ourselves so we won't fail to link due to a lack of -ldl.  Most OSes use
+  dnl dlopen(), but HP-UX uses shl_load().
+  AC_CHECK_LIB(dl,dlopen)
+  AC_CHECK_LIB(dl,shl_load)
+
+  dnl These checks need to be in this order, or you'll get a link failure if you
+  dnl use a static libcrypto.a and libssl.a rather than shared libraries.
+  AC_CHECK_LIB(crypto,RSA_new,,ssl_link_failure=yes)
+  AC_CHECK_LIB(ssl,SSL_new,,ssl_link_failure=yes)
+
+  if test x"$ssl_link_failure" = x"yes"; then
+    echo
+    echo "WARNING: Failed to link with OpenSSL libraries in $with_ssl/lib."
+    echo "         Wget will be built without support for https://... URLs."
+    echo
+  else
+    AC_DEFINE(HAVE_SSL)
+    SSL_OBJ='gen_sslfunc$o'
+    AC_SUBST(SSL_OBJ)
+  fi
+fi
+
+dnl
 dnl Set of available languages.
 dnl
-dnl #### This kind of sucks.  Shouldn't the configure process
-dnl determine this automagically by scanning `.po' files in `po/'
-dnl subdirectory?
-ALL_LINGUAS="cs de hr it no pl pt_BR ru"
+ALL_LINGUAS=`(cd ${srcdir}/po && ls *.po | sed -e 's/\.po$//')`
+
+dnl Original from autoconf, I think.
+dnl ALL_LINGUAS="cs de hr it no pl pt_BR ru"
 
 dnl internationalization macros
 WGET_WITH_NLS
@@ -205,9 +255,24 @@ case "${MAKEINFO}" in
    *) MAKEINFO="makeinfo \$(srcdir)/wget.texi"            ;;
 esac
 
+dnl
+dnl Find perl and pod2man
+dnl
+
+AC_PATH_PROGS(PERL, perl5 perl, no)
+AC_PATH_PROG(POD2MAN, pod2man, no)
+
+if test "x${POD2MAN}" = xno; then
+  COMMENT_IF_NO_POD2MAN="# "
+else
+  COMMENT_IF_NO_POD2MAN=
+fi
+AC_SUBST(COMMENT_IF_NO_POD2MAN)
+
 dnl
 dnl Create output
 dnl
-AC_OUTPUT([Makefile src/Makefile doc/Makefile util/Makefile po/Makefile.in],
+AC_OUTPUT([Makefile src/Makefile doc/Makefile util/Makefile po/Makefile.in
+           windows/Makefile],
 [WGET_PROCESS_PO
 test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])