For static linking, we need 2 things: 1) lib-link.m4 should use -l and not , else it tries to link against the .so 2) lib-link.m4 should add $LIBS after the libs we test for, else newer ld's do not resolve symbols in static libs properly. Martin Schlemmer 24 Oct 2005 --- wget-1.10.2/m4/lib-link.m4 2005-10-24 16:46:43.000000000 +0200 +++ wget-1.10.2.az/m4/lib-link.m4 2005-10-24 16:48:47.000000000 +0200 @@ -66,7 +66,8 @@ AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIB[]NAME" + dnl $LIBS should be last to resolve symbols when linking static + LIBS="$LIB[]NAME $LIBS" AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) LIBS="$ac_save_LIBS" ]) @@ -250,7 +251,7 @@ dnl standard /usr/lib. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then dnl No hardcoding is needed. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. @@ -270,12 +271,12 @@ if test "$hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= @@ -307,7 +308,7 @@ dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" else dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the --- wget-1.10.2/Makefile.in 2005-10-24 16:45:53.000000000 +0200 +++ wget-1.10.2.az/Makefile.in 2005-10-24 16:46:04.000000000 +0200 @@ -57,7 +57,7 @@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ DEFS = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\" -LIBS = @LIBS@ @LIBSSL@ +LIBS = @LIBSSL@ @LIBS@ LDFLAGS = @LDFLAGS@ # --- wget-1.10.2/src/Makefile.in 2005-10-24 16:43:33.000000000 +0200 +++ wget-1.10.2.az/src/Makefile.in 2005-10-24 16:43:47.000000000 +0200 @@ -53,7 +53,7 @@ DEFS = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\" CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ @LIBSSL@ +LIBS = @LIBSSL@ @LIBS@ exeext = @exeext@ INCLUDES = -I. -I$(srcdir) --- wget-1.10.2/configure 2005-10-24 16:32:19.000000000 +0200 +++ wget-1.10.2.az/configure 2005-10-24 16:42:54.000000000 +0200 @@ -10180,7 +10180,7 @@ LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then - LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + LIBSSL="${LIBSSL}${LIBSSL:+ }-l$name" else haveit= for x in $ltrpathdirs; do @@ -10193,10 +10193,10 @@ ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$hardcode_direct" = yes; then - LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + LIBSSL="${LIBSSL}${LIBSSL:+ }-l$name" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then - LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + LIBSSL="${LIBSSL}${LIBSSL:+ }-l$name" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then @@ -10228,7 +10228,7 @@ LIBSSL="${LIBSSL}${LIBSSL:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then - LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + LIBSSL="${LIBSSL}${LIBSSL:+ }-l$name" else LIBSSL="${LIBSSL}${LIBSSL:+ }-l$name" fi @@ -10455,7 +10455,7 @@ else ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIBSSL" + LIBS="$LIBSSL $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF