From: <ps...@us...> - 2010-12-23 10:03:29
|
Revision: 2198 http://znc.svn.sourceforge.net/znc/?rev=2198&view=rev Author: psychon Date: 2010-12-23 10:03:21 +0000 (Thu, 23 Dec 2010) Log Message: ----------- Fix detection of tcl and python with -Wl,--as-needed The problem here was that libs where put into $LDFLAGS where they don't belong. When you also use -Wl,--as-needed, sth like this is called: gcc -Wl,--as-needed -ltcl8.4 your.o objects.o here.o Due to --as-needed, the linker will drop libtcl8.4 because by the time it sees that option, nothing depends on it. And if nothing depends on some lib, it can be dropped. The fix here is obviously to put -ltcl8.4 into $LIBS (which is appended, not prepended, to the command line). The same reasoning goes for python. Modified Paths: -------------- trunk/configure trunk/configure.in Modified: trunk/configure =================================================================== --- trunk/configure 2010-12-23 01:35:56 UTC (rev 2197) +++ trunk/configure 2010-12-23 10:03:21 UTC (rev 2198) @@ -3914,9 +3914,8 @@ if test -n "$PYTHONCFG_BINARY"; then - my_saved_LDFLAGS="$LDFLAGS" - appendLD `$PYTHONCFG_BINARY --includes` - appendLD `$PYTHONCFG_BINARY --ldflags` + my_saved_LIBS="$LIBS" + appendLib `$PYTHONCFG_BINARY --ldflags` ac_fn_cxx_check_func "$LINENO" "Py_Initialize" "ac_cv_func_Py_Initialize" if test "x$ac_cv_func_Py_Initialize" = x""yes; then : @@ -3970,7 +3969,7 @@ as_fn_error $? "To compile modpython you need to be able to execute perl scripts. Try --disable-python or install perl." "$LINENO" 5 fi fi - LDFLAGS="$my_saved_LDFLAGS" + LIBS="$my_saved_LIBS" else PYTHON="no" fi @@ -4106,8 +4105,8 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCL_FLAGS" >&5 $as_echo "$TCL_FLAGS" >&6; } fi - my_saved_LDFLAGS="$LDFLAGS" - appendLD "$TCL_FLAGS" + my_saved_LIBS="$LIBS" + appendLib "$TCL_FLAGS" ac_fn_cxx_check_func "$LINENO" "Tcl_CreateInterp" "ac_cv_func_Tcl_CreateInterp" if test "x$ac_cv_func_Tcl_CreateInterp" = x""yes; then : TCL_TEST=yes @@ -4118,7 +4117,7 @@ if test x"$TCL_TEST" = "xno"; then as_fn_error $? "tcl not found, try --disable-tcl, or install tcl properly. If tcl is installed to a non-standard path, use --enable-tcl --with-tcl=/path" "$LINENO" 5 fi - LDFLAGS="$my_saved_LDFLAGS" + LIBS="$my_saved_LIBS" fi if test x"$EXTRA" = "xyes" Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2010-12-23 01:35:56 UTC (rev 2197) +++ trunk/configure.in 2010-12-23 10:03:21 UTC (rev 2198) @@ -333,9 +333,8 @@ old_PYTHON="$PYTHON" AC_PATH_PROG([PYTHONCFG_BINARY], ["$PYTHON"]) if test -n "$PYTHONCFG_BINARY"; then - my_saved_LDFLAGS="$LDFLAGS" - appendLD `$PYTHONCFG_BINARY --includes` - appendLD `$PYTHONCFG_BINARY --ldflags` + my_saved_LIBS="$LIBS" + appendLib `$PYTHONCFG_BINARY --ldflags` AC_CHECK_FUNC([Py_Initialize], [], [PYTHON="no"]) if test "x$PYTHON" != "xno"; then # Yes, modpython depends on perl. @@ -344,7 +343,7 @@ AC_MSG_ERROR([To compile modpython you need to be able to execute perl scripts. Try --disable-python or install perl.]) fi fi - LDFLAGS="$my_saved_LDFLAGS" + LIBS="$my_saved_LIBS" else PYTHON="no" fi @@ -404,13 +403,13 @@ TCL_FLAGS="$TCL_INCLUDE_SPEC $TCL_LIB_SPEC" AC_MSG_RESULT([$TCL_FLAGS]) fi - my_saved_LDFLAGS="$LDFLAGS" - appendLD "$TCL_FLAGS" + my_saved_LIBS="$LIBS" + appendLib "$TCL_FLAGS" AC_CHECK_FUNC([Tcl_CreateInterp], [TCL_TEST=yes], [TCL_TEST=no]) if test x"$TCL_TEST" = "xno"; then AC_MSG_ERROR([tcl not found, try --disable-tcl, or install tcl properly. If tcl is installed to a non-standard path, use --enable-tcl --with-tcl=/path]) fi - LDFLAGS="$my_saved_LDFLAGS" + LIBS="$my_saved_LIBS" fi if test x"$EXTRA" = "xyes" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |