From b2a7dfef5a01e53e8e8467fa0f4830eff056cdce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20K=C3=B6the?= Date: Mon, 11 Dec 2000 14:29:54 +0000 Subject: [PATCH] added --with-extra-libs [SVN r8452] --- libs/python/README | 2 ++ libs/python/build/Makefile.in | 1 + libs/python/configure | 62 ++++++++++++++++++++++------------- libs/python/configure.in | 11 +++++++ libs/python/test/Makefile | 2 +- 5 files changed, 54 insertions(+), 24 deletions(-) diff --git a/libs/python/README b/libs/python/README index d216b116..25922c06 100644 --- a/libs/python/README +++ b/libs/python/README @@ -44,6 +44,8 @@ of particular interest are: --libdir: the install directory for 'libboostpython.a' --with-shared-library-extension: the file extension for shared libraries + --with-extra-libs: link modules against these extra libs + (on CYGWIN, you need to link against python15.lib) For most options, configure provides reasonable defaults, given in brackets. In particular, it is able to guess the right settings for shared library diff --git a/libs/python/build/Makefile.in b/libs/python/build/Makefile.in index 25320ced..3af4ee12 100644 --- a/libs/python/build/Makefile.in +++ b/libs/python/build/Makefile.in @@ -9,6 +9,7 @@ TARGET_LIBDIR = @libdir@ TARGET_LIBNAME = boostpython TARGET_LIBFILENAME = lib$(TARGET_LIBNAME).a MODULE_EXTENSION = @shared_library_extension@ +LIBS = @LIBS@ %.o: %.cpp $(CXX) $(SCXXFLAGS) $(CXXINCLUDES) -c $*.cpp diff --git a/libs/python/configure b/libs/python/configure index 11072ae3..97193005 100755 --- a/libs/python/configure +++ b/libs/python/configure @@ -14,6 +14,8 @@ ac_default_prefix=/usr/local ac_default_prefix=`pwd | sed 's?/libs/python$??'` ac_help="$ac_help --with-extra-includes=\"dir1 dir2 ...\" : look in these directories for include files" +ac_help="$ac_help + --with-extra-libs=\"-Ldir1 -llib1 -Ldir2 -llib2 ...\" : link against these libraries " ac_help="$ac_help --with-shared-library-extension: file extension for shared libraries (including the dot) [UNIX: .so | Win32: .dll] " @@ -603,7 +605,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:607: checking host system type" >&5 +echo "configure:609: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -624,7 +626,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:628: checking target system type" >&5 +echo "configure:630: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -642,7 +644,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:646: checking build system type" >&5 +echo "configure:648: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -666,12 +668,12 @@ test "$host_alias" != "$target_alias" && echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:670: checking for Cygwin environment" >&5 +echo "configure:672: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -699,19 +701,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:703: checking for mingw32 environment" >&5 +echo "configure:705: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -735,7 +737,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:739: checking for $ac_word" >&5 +echo "configure:741: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -767,7 +769,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:771: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:773: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -778,12 +780,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 782 "configure" +#line 784 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -809,12 +811,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:813: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:815: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:818: checking whether we are using GNU C++" >&5 +echo "configure:820: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -823,7 +825,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -842,7 +844,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:846: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:848: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -880,6 +882,10 @@ fi +######################################################### + + + ######################################################### @@ -904,6 +910,16 @@ fi done + # Check whether --with-extra-libs or --without-extra-libs was given. +if test "${with_extra_libs+set}" = set; then + withval="$with_extra_libs" + : +fi + + + LIBS="$CINCLUDES "$with_extra_libs + + @@ -946,7 +962,7 @@ fi if test "$enable_shared" != "no" ; then echo $ac_n "checking for shared library extension ""... $ac_c" 1>&6 -echo "configure:950: checking for shared library extension " >&5 +echo "configure:966: checking for shared library extension " >&5 # Check whether --with-shared-library-extension or --without-shared-library-extension was given. if test "${with_shared_library_extension+set}" = set; then withval="$with_shared_library_extension" @@ -961,7 +977,7 @@ fi echo $ac_n "checking for shared linker for C++ objects ""... $ac_c" 1>&6 -echo "configure:965: checking for shared linker for C++ objects " >&5 +echo "configure:981: checking for shared linker for C++ objects " >&5 # Check whether --with-shared-cxx-linker or --without-shared-cxx-linker was given. if test "${with_shared_cxx_linker+set}" = set; then withval="$with_shared_cxx_linker" @@ -976,7 +992,7 @@ fi echo $ac_n "checking for flag to create position independent code ""... $ac_c" 1>&6 -echo "configure:980: checking for flag to create position independent code " >&5 +echo "configure:996: checking for flag to create position independent code " >&5 # Check whether --with-position-independent-code-flag or --without-position-independent-code-flag was given. if test "${with_position_independent_code_flag+set}" = set; then withval="$with_position_independent_code_flag" @@ -999,7 +1015,7 @@ fi # Extract the first word of "python", so it can be a program name with args. set dummy python; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1003: checking for $ac_word" >&5 +echo "configure:1019: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_python_prog'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1057,7 +1073,7 @@ fi if test ${with_python:-""} != "no"; then if test ! "" = "" ; then # check for library echo $ac_n "checking for lib"" ""... $ac_c" 1>&6 -echo "configure:1061: checking for lib"" " >&5 +echo "configure:1077: checking for lib"" " >&5 dirs="" if test -f ${with_pythonlib:-""}/lib"".so; then dirs=${with_pythonlib:-""}/lib"".so @@ -1130,7 +1146,7 @@ echo "configure:1061: checking for lib"" " >&5 if test ! Python.h = "" ; then # check for header echo $ac_n "checking for Python.h ""... $ac_c" 1>&6 -echo "configure:1134: checking for Python.h " >&5 +echo "configure:1150: checking for Python.h " >&5 if test -f ${with_pythoninc:-""}/Python.h; then dirs=$with_pythoninc/Python.h elif test -d ${with_python:-""}; then diff --git a/libs/python/configure.in b/libs/python/configure.in index 33608a6c..124afaca 100644 --- a/libs/python/configure.in +++ b/libs/python/configure.in @@ -139,6 +139,16 @@ AC_DEFUN([AC_WITH_EXTRA_INCLUDES], ######################################################### +AC_DEFUN([AC_WITH_EXTRA_LIBS], +[ + AC_ARG_WITH(extra-libs, + [ --with-extra-libs=\"-Ldir1 -llib1 -Ldir2 -llib2 ...\" : link against these libraries ],,) + + LIBS="$CINCLUDES "$with_extra_libs +]) + +######################################################### + dnl AC_EXTRACT_REGEX(list, regEx) dnl variable $regExResult returns the first entry in 'list' that matches the dnl regular expression 'regEx', using the 'expr' utility @@ -273,6 +283,7 @@ AC_DEFUN([AC_FIND_PACKAGE], ######################################################### AC_WITH_EXTRA_INCLUDES +AC_WITH_EXTRA_LIBS AC_SHARED_LINKING(yes) ######################################################### diff --git a/libs/python/test/Makefile b/libs/python/test/Makefile index 4b6f97d4..dc75df39 100644 --- a/libs/python/test/Makefile +++ b/libs/python/test/Makefile @@ -12,7 +12,7 @@ test_result: testmodule$(MODULE_EXTENSION) comprehensive.py python comprehensive.py > test_result testmodule$(MODULE_EXTENSION): $(LIBBPL) comprehensive.o - $(CXX_SHARED_LINKER) -o testmodule$(MODULE_EXTENSION) comprehensive.o $(LIBBPL) + $(CXX_SHARED_LINKER) -o testmodule$(MODULE_EXTENSION) comprehensive.o $(LIBBPL) $(LIBS) clean: rm -rf *.o *$(MODULE_EXTENSION) *.a *.d *.pyc *.bak a.out test_result