]> git.sur5r.net Git - openldap/blobdiff - build/ltmain.sh
minor cleanup
[openldap] / build / ltmain.sh
index 766732da8440bd83b7558219a1efd41567c6fa8d..eac9d2ced7048a25989c36d321683fbd020e1638 100755 (executable)
@@ -1,5 +1,7 @@
 # ltmain.sh - Provide generalized library-building support services.
 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
+# 
+# $OpenLDAP$
 #
 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+# Portions Copyright 1998-2001 OpenLDAP Foundation.
+# This file is distributed with OpenLDAP Software, which contains a
+# configuration script generated by autoconf and is distributable
+# under the same distributions terms as OpenLDAP inself.
+# See the OpenLDAP COPYRIGHT and LICENSE file for details.
+
 # Check that we have a working $echo.
 if test "X$1" = X--no-reexec; then
   # Discard the --no-reexec flag, and continue.
@@ -54,8 +62,8 @@ modename="$progname"
 # Constants.
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION=1.3.5
-TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)"
+VERSION=1.3.5+OpenLDAP
+TIMESTAMP=" (1.385.2.206 2000/10/02 14:18:00)"
 
 default_mode=
 help="Try \`$progname --help' for more information."
@@ -179,6 +187,16 @@ do
   --mode) prevopt="--mode" prev=mode ;;
   --mode=*) mode="$optarg" ;;
 
+  --only-shared)
+    build_libtool_libs=yes
+    build_old_libs=no
+    ;;
+
+  --only-static)
+    build_libtool_libs=no
+    build_old_libs=yes
+    ;;
+
   --quiet | --silent)
     show=:
     ;;
@@ -1075,10 +1093,14 @@ compiler."
       -l*)
        if test "$arg" = "-lc"; then
          case "$host" in
-         *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
+         *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos* | *-*-aix*)
            # These systems don't actually have c library (as such)
            continue
            ;;
+          *-*-rhapsody* | *-*-darwin*)
+            # Darwin C library is in the System framework
+            deplibs="$deplibs -framework System"
+            ;;
          esac
        elif test "$arg" = "-lm"; then
          case "$host" in
@@ -1086,6 +1108,10 @@ compiler."
            # These systems don't actually have math library (as such)
            continue
            ;;
+          *-*-rhapsody* | *-*-darwin*)
+            # Darwin math library is in the System framework
+            deplibs="$deplibs -framework System"
+            ;;
          esac
        fi
        deplibs="$deplibs $arg"
@@ -1618,6 +1644,9 @@ compiler."
        $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
       fi
       install_libdir="$2"
+      if test -n "$hardcode_default_flag"; then
+       eval linkopts=\"$linkopts$hardcode_default_flag\"
+      fi
 
       oldlibs=
       if test -z "$rpath"; then
@@ -1792,7 +1821,7 @@ compiler."
 
        dependency_libs="$deplibs"
        case "$host" in
-       *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
+       *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos* | *-*-aix*)
          # these systems don't actually have a c library (as such)!
          ;;
         *-*-rhapsody*)
@@ -2453,6 +2482,14 @@ EOF
       fi
       finalize_rpath="$rpath"
 
+      if test -z "$compile_rpath" -a -n "$hardcode_default_flag"; then
+       eval compile_rpath=\" $hardcode_default_flag\"
+      fi
+
+      if test -z "$finalize_rpath" -a -n "$hardcode_default_flag"; then
+       eval finalize_rpath=\" $hardcode_default_flag\"
+      fi
+
       output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
       if test "X$output_objdir" = "X$output"; then
        output_objdir="$objdir"
@@ -2546,6 +2583,32 @@ extern \"C\" {
            fi
          fi
 
+       # Prepare the list of exported symbols
+       if test -z "$export_symbols"; then
+         if test "$always_export_symbols" = yes -a -n "$link_export_all"; then
+           eval link_export=\"$link_export_all\"
+         elif test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+           $show "generating symbol list for \`$output'"
+           export_symbols="$output_objdir/$output.exp"
+           $run $rm $export_symbols
+           libobjs="$objs"
+           eval cmds=\"$export_symbols_cmds\"
+           IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
+           for cmd in $cmds; do
+             IFS="$save_ifs"
+             $show "$cmd"
+             $run eval "$cmd" || exit $?
+           done
+           IFS="$save_ifs"
+           if test -n "$export_symbols_regex"; then
+             $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+             $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+             $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+             $run eval '$mv "${export_symbols}T" "$export_symbols"'
+           fi
+         fi
+       fi
+
          for arg in $dlprefiles; do
            $show "extracting global C symbols from \`$arg'"
            name=`echo "$arg" | sed -e 's%^.*/%%'`
@@ -2623,7 +2686,7 @@ static const void *lt_preloaded_setup() {
          # linked before any other PIC object.  But we must not use
          # pic_flag when linking with -static.  The problem exists in
          # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-         *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)\r
+         *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
            case "$compile_command " in
            *" -static "*) ;;
            *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
@@ -2662,10 +2725,15 @@ static const void *lt_preloaded_setup() {
        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
       fi
 
+      link_export_opt=
+      if test -n "$export_symbols" -o -n "$dlsyms"; then
+       eval link_export_opt=\"$link_export\"
+      fi
+
       if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
        # Replace the output file specification.
        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
-       link_command="$compile_command$compile_rpath"
+       link_command="$compile_command$compile_rpath$link_export_opt"
 
        # We have no uninstalled library dependencies, so finalize right now.
        $show "$link_command"
@@ -2751,7 +2819,9 @@ static const void *lt_preloaded_setup() {
 
       # Replace the output file specification.
       link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-      
+
+      link_command="$link_command$link_export_opt"
+
       # Delete the old output files.
       $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname