]> git.sur5r.net Git - openldap/blobdiff - build/ltmain.sh
cleanup
[openldap] / build / ltmain.sh
index 3ca937b978c3edb4defebfef58d6a8ee3323a96e..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.3
-TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
+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."
@@ -217,13 +225,6 @@ if test -n "$prevopt"; then
   exit 1
 fi
 
-case "$show $MFLAGS -$MAKEFLAGS" in
-  :\ *) : ;;
-  *\ -*s*)
-       # Be silent inside 'make -s'
-       expr " $MFLAGS -$MAKEFLAGS" : '.* -[a-zA-Z]*s' >/dev/null && show=: ;;
-esac
-
 if test -z "$show_help"; then
 
   # Infer the operation mode.
@@ -452,7 +453,7 @@ compiler."
       fbsd_hideous_sh_bug=$base_compile
 
       # All platforms use -DPIC, to notify preprocessed assembler code.
-      command="$base_compile $pic_flag -DPIC $srcfile"
+      command="$base_compile $srcfile $pic_flag -DPIC"
       if test "$build_old_libs" = yes; then
        lo_libobj="$libobj"
        dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
@@ -538,9 +539,17 @@ compiler."
          exit $error
        fi
 
+       xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+       if test "X$xdir" = "X$obj"; then
+         xdir="."
+       else
+         xdir="$xdir"
+       fi
+       baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
+       libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
        # Now arrange that obj and lo_libobj become the same file
-       $show "$LN_S $obj $lo_libobj"
-       if $run $LN_S $obj $lo_libobj; then
+       $show "(cd $xdir && $LN_S $baseobj $libobj)"
+       if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
          exit 0
        else
          error=$?
@@ -630,8 +639,6 @@ compiler."
   # libtool link mode
   link)
     modename="$modename: link"
-    C_compiler="$CC" # save it, to compile generated C sources
-    CC="$nonopt"
     case "$host" in
     *-*-cygwin* | *-*-mingw* | *-*-os2*)
       # It is impossible to link a dll without this setting, and
@@ -819,8 +826,8 @@ compiler."
       allow_undefined=yes
       ;;
     esac
-    compile_command="$CC"
-    finalize_command="$CC"
+    compile_command="$nonopt"
+    finalize_command="$nonopt"
 
     compile_rpath=
     finalize_rpath=
@@ -1090,6 +1097,10 @@ compiler."
            # 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
@@ -1097,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"
@@ -1809,6 +1824,10 @@ compiler."
        *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos* | *-*-aix*)
          # these systems don't actually have a c library (as such)!
          ;;
+        *-*-rhapsody*)
+         # rhapsody is a little odd...
+         deplibs="$deplibs -framework System"
+         ;;
        *)
          # Add libc to deplibs on all other systems.
          deplibs="$deplibs -lc"
@@ -1871,7 +1890,7 @@ compiler."
          int main() { return 0; }
 EOF
          $rm conftest
-         $C_compiler -o conftest conftest.c $deplibs
+         $CC -o conftest conftest.c $deplibs
          if test $? -eq 0 ; then
            ldd_output=`ldd conftest`
            for i in $deplibs; do
@@ -1904,7 +1923,7 @@ EOF
             # If $name is empty we are operating on a -L argument.
              if test "$name" != "" ; then
                $rm conftest
-               $C_compiler -o conftest conftest.c $i
+               $CC -o conftest conftest.c $i
                # Did it work?
                if test $? -eq 0 ; then
                  ldd_output=`ldd conftest`
@@ -2067,12 +2086,19 @@ EOF
        done
 
        # Ensure that we have .o objects for linkers which dislike .lo
-       # (e.g. aix) incase we are running --disable-static
+       # (e.g. aix) in case we are running --disable-static
        for obj in $libobjs; do
-         oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
-         if test ! -f $oldobj; then
-           $show "${LN_S} $obj $oldobj"
-           $run ${LN_S} $obj $oldobj || exit $?
+         xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+         if test "X$xdir" = "X$obj"; then
+           xdir="."
+         else
+           xdir="$xdir"
+         fi
+         baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+         oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
+         if test ! -f $xdir/$oldobj; then
+           $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
+           $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
          fi
        done
 
@@ -2331,8 +2357,16 @@ EOF
        # Just create a symlink.
        $show $rm $libobj
        $run $rm $libobj
-       $show "$LN_S $obj $libobj"
-       $run $LN_S $obj $libobj || exit $?
+       xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
+       if test "X$xdir" = "X$libobj"; then
+         xdir="."
+       else
+         xdir="$xdir"
+       fi
+       baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
+       oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
+       $show "(cd $xdir && $LN_S $oldobj $baseobj)"
+       $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
       fi
 
       if test -n "$gentop"; then
@@ -2652,16 +2686,21 @@ 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*)
+         *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
            case "$compile_command " in
            *" -static "*) ;;
            *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
+           esac;;
+         *-*-hpux*)
+           case "$compile_command " in
+           *" -static "*) ;;
+           *) pic_flag_for_symtable=" $pic_flag -DPIC";;
            esac
          esac
 
          # Now compile the dynamic symbol file.
-         $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
-         $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+         $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+         $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
 
          # Clean up the generated files.
          $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
@@ -2780,7 +2819,7 @@ 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.
@@ -2837,7 +2876,7 @@ sed_quote_subst='$sed_quote_subst'
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
-if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
+if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
 
 relink_command=\"$relink_command\"
 
@@ -2926,7 +2965,7 @@ else
   fi"
        else
          echo >> $output "\
-  program='$outputname$exeext'
+  program='$outputname'
   progdir=\"\$thisdir/$objdir\"
 "
        fi
@@ -2962,13 +3001,21 @@ else
       # Run the actual program with our arguments.
 "
        case $host in
-       *-*-cygwin* | *-*-mingw* | *-*-os2*)
          # win32 systems need to use the prog path for dll
          # lookup to work
+       *-*-cygwin*)
+         $echo >> $output "\
+      exec \$progdir/\$program \${1+\"\$@\"}
+"
+         ;;
+
+       # Backslashes separate directories on plain windows
+       *-*-mingw | *-*-os2*)
          $echo >> $output "\
       exec \$progdir\\\\\$program \${1+\"\$@\"}
 "
          ;;
+
        *)
          $echo >> $output "\
       # Export the path to the program.
@@ -3056,14 +3103,21 @@ fi\
       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
        eval cmds=\"$old_archive_from_new_cmds\"
       else
-       # Ensure that we have .o objects in place incase we decided
+       # Ensure that we have .o objects in place in case we decided
        # not to build a shared library, and have fallen back to building
        # static libs even though --disable-static was passed!
        for oldobj in $oldobjs; do
          if test ! -f $oldobj; then
-           obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
-           $show "${LN_S} $obj $oldobj"
-           $run ${LN_S} $obj $oldobj || exit $?
+           xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
+           if test "X$xdir" = "X$oldobj"; then
+             xdir="."
+           else
+             xdir="$xdir"
+           fi
+           baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
+           obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
+           $show "(cd $xdir && ${LN_S} $obj $baseobj)"
+           $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
          fi
        done
 
@@ -3352,14 +3406,7 @@ libdir='$install_libdir'\
          $show "$install_prog $dir/$realname $destdir/$realname"
          $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
 
-         # Windows does not have any symlinks to DLLs, despite what
-         # library_names has been set to.
-         skip_syms=false
-         case $host in
-         *-*-cygwin* | *-*-mingw*) skip_syms=true ;;
-         esac
-
-         if test "$skip_syms" = "false" && test $# -gt 0; then
+         if test $# -gt 0; then
            # Delete the old symlinks, and create new ones.
            for linkname
            do
@@ -3389,7 +3436,7 @@ libdir='$install_libdir'\
        $run eval "$install_prog $instname $destdir/$name" || exit $?
 
        # Maybe install the static library, too.
-       test -n "$old_library" -a $build_old_libs = yes && staticlibs="$staticlibs $dir/$old_library"
+       test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
        ;;
 
       *.lo)
@@ -3740,8 +3787,10 @@ libdir='$install_libdir'\
     done
 
     if test -z "$run"; then
-      # Export the shlibpath_var.
-      eval "export $shlibpath_var"
+      if test -n "$shlibpath_var"; then
+        # Export the shlibpath_var.
+        eval "export $shlibpath_var"
+      fi
 
       # Restore saved enviroment variables
       if test "${save_LC_ALL+set}" = set; then
@@ -3758,8 +3807,10 @@ libdir='$install_libdir'\
       exit 1
     else
       # Display what would be done.
-      eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
-      $echo "export $shlibpath_var"
+      if test -n "$shlibpath_var"; then
+        eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+        $echo "export $shlibpath_var"
+      fi
       $echo "$cmd$args"
       exit 0
     fi