]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in: Accept -framework for darwin and put it in
authorPeter O'Gorman <peter@pogma.com>
Wed, 10 Sep 2003 08:40:42 +0000 (08:40 +0000)
committerGary V. Vaughan <gary@gnu.org>
Wed, 10 Sep 2003 08:40:42 +0000 (08:40 +0000)
dependency_libs. For non-installed .la's try to avoid having
./.libs/.libs/libfoo.so on the link line.

ChangeLog
ltmain.in

index 334a4ea8191469d46820a215d42b060240fcfa31..ca093ff949b42f89a529998a1aedd0da5be21835 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-09-10  Peter O'Gorman  <peter@pogma.com>
+
+       * ltmain.in: Accept -framework for darwin and put it in
+       dependency_libs. For non-installed .la's try to avoid having
+       ./.libs/.libs/libfoo.so on the link line.
+
 2003-09-10  Arne Woerner  <woerner@mediabase-gmbh.de>
 
        * libtool.m4 [openbsd]: openbsd 3.x needs versioning information.
@@ -12,7 +18,7 @@
        _LT_AC_LANG_C_CONFIG.
        (AC_PROG_EGREP): Remove, now that Libtool requires Autoconf 2.56.
        * bootstrap: Issue an upgrade warning.
-                       
+
 2003-08-27  Gary V. Vaughan  <gary@gnu.org>
 
        * libtool.m4 (_LT_AC_CHECK_DLFCN): Use the interrim new
index 5065415c3325430bb61083a81d09597182d97841..7834fef68ad65b4f95cea9ef1828b925da567d9a 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -140,7 +140,7 @@ win32_libid () {
       fi
     fi
     ;;
-  *DLL*) 
+  *DLL*)
     win32_libid_type="x86 DLL"
     ;;
   *executable*) # but shell scripts are "executable" too...
@@ -1148,6 +1148,19 @@ EOF
          finalize_command="$finalize_command $qarg"
          continue
          ;;
+       framework)
+         case $host in
+           *-*-darwin*)
+             case "$deplibs " in
+               *" $qarg.framework "*) ;;
+               *) deplibs="$deplibs $qarg.framework" # this is fixed later
+                  ;;
+              esac
+              ;;
+         esac
+         prev=
+         continue
+         ;;
        *)
          eval "$prev=\"\$arg\""
          prev=
@@ -1272,7 +1285,7 @@ EOF
            ;;
          *-*-rhapsody* | *-*-darwin1.[012])
            # Rhapsody C and math libraries are in the System framework
-           deplibs="$deplibs -framework System"
+           deplibs="$deplibs System.framework"
            continue
          esac
        elif test "X$arg" = "X-lc_r"; then
@@ -1459,6 +1472,11 @@ EOF
        continue
        ;;
 
+      -framework)
+        prev=framework
+       continue
+       ;;
+
       # Some other compiler flag.
       -* | +*)
        # Unknown arguments in both finalize_command and compile_command need
@@ -1874,6 +1892,18 @@ EOF
            fi
          fi
          ;; # -l
+       *.framework)
+         if test "$linkmode,$pass" = "prog,link"; then
+           compile_deplibs="$deplib $compile_deplibs"
+           finalize_deplibs="$deplib $finalize_deplibs"
+         else
+           deplibs="$deplib $deplibs"
+           if test "$linkmode" = lib ; then
+             newdependency_libs="$deplib $newdependency_libs"
+           fi
+         fi
+         continue
+         ;;
        -L*)
          case $linkmode in
          lib)
@@ -2002,6 +2032,13 @@ EOF
        *) . ./$lib ;;
        esac
 
+       case $host in
+       *-*-darwin*)
+         # Convert "-framework foo" to "foo.framework" in dependency_libs
+         test -n "$dependency_libs" && dependency_libs=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.framework/g'`
+         ;;
+       esac
+
        if test "$linkmode,$pass" = "lib,link" ||
           test "$linkmode,$pass" = "prog,scan" ||
           { test "$linkmode" != prog && test "$linkmode" != lib; }; then
@@ -2037,7 +2074,7 @@ EOF
          continue
        fi # $pass = conv
 
-    
+
        # Get the name of the library we link against.
        linklib=
        for l in $old_library $library_names; do
@@ -2092,10 +2129,17 @@ EOF
            absdir="$libdir"
          fi
        else
-         dir="$ladir/$objdir"
-         absdir="$abs_ladir/$objdir"
-         # Remove this search path later
-         notinst_path="$notinst_path $abs_ladir"
+         if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+           dir="$ladir"
+           absdir="$abs_ladir"
+           # Remove this search path later
+           notinst_path="$notinst_path $abs_ladir"
+         else
+           dir="$ladir/$objdir"
+           absdir="$abs_ladir/$objdir"
+           # Remove this search path later
+           notinst_path="$notinst_path $abs_ladir"
+         fi
        fi # $installed = yes
        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
 
@@ -2130,7 +2174,7 @@ EOF
          continue
        fi
 
-    
+
        if test "$linkmode" = prog && test "$pass" != link; then
          newlib_search_path="$newlib_search_path $ladir"
          deplibs="$lib $deplibs"
@@ -2217,7 +2261,7 @@ EOF
            need_relink=yes
          fi
          # This is a shared library
-       
+
       # Warn about portability, can't link against -module's on some systems (darwin)
       if test "$shouldnotlink" = yes && test "$pass" = link ; then
            $echo
@@ -2226,8 +2270,8 @@ EOF
            else
              $echo "*** Warning: Linking the shared library $output against the loadable module"
            fi
-           $echo "*** $linklib is not portable!"    
-      fi         
+           $echo "*** $linklib is not portable!"
+      fi
          if test "$linkmode" = lib &&
             test "$hardcode_into_libs" = yes; then
            # Hardcode the library path.
@@ -2333,7 +2377,7 @@ EOF
                        $echo "** The link will probably fail, sorry"
                      else
                        add="$dir/$old_library"
-                     fi 
+                     fi
                    fi
                esac
              elif test "$hardcode_minus_L" = no; then
@@ -2585,8 +2629,8 @@ EOF
                *)
                path="-L$path"
                ;;
-               esac 
-               
+               esac
+
                ;;
                  -l*)
                case $host in
@@ -2597,19 +2641,28 @@ EOF
                     if test -f "$tmp/lib$tmp_libs.dylib" ; then
                       eval depdepl="$tmp/lib$tmp_libs.dylib"
                       break
-                    fi  
-         done
-         path=""
-                 ;;
+                    fi
+                done
+                path=""
+                ;;
                *) continue ;;
-               esac              
+               esac
+               ;;
+
+             *.framework)
+               case $host in
+                 *-*-darwin*)
+                   depdepl="$deplib"
+                   ;;
+               esac
                ;;
+
              *) continue ;;
              esac
              case " $deplibs " in
              *" $depdepl "*) ;;
              *) deplibs="$deplibs $depdepl" ;;
-             esac            
+             esac
              case " $deplibs " in
              *" $path "*) ;;
              *) deplibs="$deplibs $path" ;;
@@ -2836,7 +2889,7 @@ EOF
        # convert absolute version numbers to libtool ages
        # this retains compatibility with .la files and attempts
        # to make the code below a bit more comprehensible
-       
+
        case $vinfo_number in
        yes)
          number_major="$2"
@@ -3117,7 +3170,7 @@ EOF
            ;;
          *-*-rhapsody* | *-*-darwin1.[012])
            # Rhapsody C library is in the System framework
-           deplibs="$deplibs -framework System"
+           deplibs="$deplibs System.framework"
            ;;
          *-*-netbsd*)
            # Don't link with libc until the a.out ld.so is fixed.
@@ -3410,7 +3463,7 @@ EOF
        case $host in
        *-*-rhapsody* | *-*-darwin1.[012])
          # On Rhapsody replace the C library is the System framework
-         newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+         newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / System.framework /'`
          ;;
        esac
 
@@ -3456,6 +3509,13 @@ EOF
            fi
          fi
        fi
+       # Time to change all our "foo.framework" stuff back to "-framework foo"
+       case $host in
+         *-*-darwin*)
+           newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
+           dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
+           ;;
+       esac
        # Done checking deplibs!
        deplibs=$newdeplibs
       fi
@@ -3590,12 +3650,12 @@ EOF
        for test_deplib in $deplibs; do
                case " $convenience " in
                *" $test_deplib "*) ;;
-               *) 
+               *)
                        tmp_deplibs="$tmp_deplibs $test_deplib"
                        ;;
                esac
        done
-       deplibs="$tmp_deplibs" 
+       deplibs="$tmp_deplibs"
 
        if test -n "$convenience"; then
          if test -n "$whole_archive_flag_spec"; then
@@ -4029,18 +4089,21 @@ EOF
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
        # On Rhapsody replace the C library is the System framework
-       compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
-       finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+       compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / System.framework /'`
+       finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.framework /'`
        ;;
       esac
 
       case $host in
-      *darwin*)
+      *-*-darwin*)
         # Don't allow lazy linking, it breaks C++ global constructors
         if test "$tagname" = CXX ; then
         compile_command="$compile_command ${wl}-bind_at_load"
         finalize_command="$finalize_command ${wl}-bind_at_load"
         fi
+       # Time to change all our "foo.framework" stuff back to "-framework foo"
+       compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
+       finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
         ;;
       esac
 
@@ -4503,7 +4566,7 @@ static const void *lt_preloaded_setup() {
 
    The $output program cannot be directly executed until all the libtool
    libraries that it depends on are installed.
-   
+
    This wrapper executable should never be moved out of the build directory.
    If it is, it will not operate correctly.
 
@@ -4535,7 +4598,7 @@ EOF
 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
   defined (__OS2__)
 #define HAVE_DOS_BASED_FILE_SYSTEM
-#ifndef DIR_SEPARATOR_2 
+#ifndef DIR_SEPARATOR_2
 #define DIR_SEPARATOR_2 '\\'
 #endif
 #endif
@@ -4566,7 +4629,7 @@ main (int argc, char *argv[])
 {
   char **newargz;
   int i;
-  
+
   program_name = (char *) xstrdup ((char *) basename (argv[0]));
   newargz = XMALLOC(char *, argc+2);
 EOF
@@ -4579,7 +4642,7 @@ EOF
   newargz[1] = fnqualify(argv[0]);
   /* we know the script has the same name, without the .exe */
   /* so make sure newargz[1] doesn't end in .exe */
-  strendzap(newargz[1],".exe"); 
+  strendzap(newargz[1],".exe");
   for (i = 1; i < argc; i++)
     newargz[i+1] = xstrdup(argv[i]);
   newargz[argc+1] = NULL;
@@ -4602,7 +4665,7 @@ xmalloc (size_t num)
   return p;
 }
 
-char * 
+char *
 xstrdup (const char *string)
 {
   return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
@@ -4616,7 +4679,7 @@ basename (const char *name)
 
 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
   /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha (name[0]) && name[1] == ':') 
+  if (isalpha (name[0]) && name[1] == ':')
     name += 2;
 #endif
 
@@ -4626,7 +4689,7 @@ basename (const char *name)
   return (char *) base;
 }
 
-char * 
+char *
 fnqualify(const char *path)
 {
   size_t size;
@@ -4654,7 +4717,7 @@ fnqualify(const char *path)
 }
 
 char *
-strendzap(char *str, const char *pat) 
+strendzap(char *str, const char *pat)
 {
   size_t len, patlen;
 
@@ -4674,7 +4737,7 @@ strendzap(char *str, const char *pat)
 }
 
 static void
-lt_error_core (int exit_status, const char * mode, 
+lt_error_core (int exit_status, const char * mode,
           const char * message, va_list ap)
 {
   fprintf (stderr, "%s: %s: ", program_name, mode);
@@ -4997,7 +5060,7 @@ fi\
          for obj in $save_oldobjs
          do
            last_oldobj=$obj
-         done  
+         done
          for obj in $save_oldobjs
          do
            oldobjs="$objlist $obj"
@@ -5011,7 +5074,7 @@ fi\
              oldobjs=$objlist
              if test "$obj" = "$last_oldobj" ; then
                RANLIB=$save_RANLIB
-             fi  
+             fi
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
              eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
              objlist=
@@ -5063,7 +5126,7 @@ fi\
       relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
       if test "$hardcode_automatic" = yes ; then
         relink_command=
-      fi  
+      fi
       # Only create the output if not a dry run.
       if test -z "$run"; then
        for installed in no yes; do
@@ -5114,7 +5177,7 @@ fi\
          else
            newdlfiles=
            for lib in $dlfiles; do
-             case $lib in 
+             case $lib in
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
                *) abs=`pwd`"/$lib" ;;
              esac
@@ -5123,7 +5186,7 @@ fi\
            dlfiles="$newdlfiles"
            newdlprefiles=
            for lib in $dlprefiles; do
-             case $lib in 
+             case $lib in
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
                *) abs=`pwd`"/$lib" ;;
              esac
@@ -6039,7 +6102,7 @@ relink_command=\"$relink_command\""
        if test "$mode" = clean ; then
          noexename=$name
          case $file in
-         *.exe) 
+         *.exe)
            file=`$echo $file|${SED} 's,.exe$,,'`
            noexename=`$echo $name|${SED} 's,.exe$,,'`
            # $file with .exe has already been added to rmfiles,