bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for libtool 1.4.2 to handle --program-prefix


From: Petter Reinholdtsen
Subject: Patch for libtool 1.4.2 to handle --program-prefix
Date: Tue, 4 Jun 2002 10:20:59 +0200

Here is a small patch to libtoolize to get it to find config.guss and
config.sub when libtool was configured with --program-prefix.  In this
case, the config.* files are installed with the prefix, while
libtoolize tries to find the files without the prefix.  Another option
might be to install the files without the prefix, but I assumed the
prefix was added for a reason.

diff -ur src-1.4.2/libtoolize.in src-1.4.2-local/libtoolize.in
--- src-1.4.2/libtoolize.in     Sat Mar 31 00:47:23 2001
+++ src-1.4.2-local/libtoolize.in       Tue Jun  4 10:14:59 2002
@@ -36,6 +36,7 @@
 address@hidden@
 address@hidden@
 address@hidden@
+program_transform_name="@program_transform_name@"
 
 libtool_m4="$aclocaldir/libtool.m4"
 ltdl_m4="$aclocaldir/ltdl.m4"
@@ -151,7 +152,8 @@
   echo "$progname: cannot list files in \`$pkgdatadir'" 1>&2
   exit 1
 fi
-files='config.guess config.sub ltmain.sh'
+pkgdata_SCRIPTS='config.guess config.sub'
+pkgdata_DATA='ltmain.sh'
 
 auxdir=.
 auxdirline=`egrep '^AC_CONFIG_AUX_DIR' configure.in 2>/dev/null`
@@ -267,6 +269,16 @@
   fi
 fi
 
+copy_file() {
+      if $cp $1 $2; then :
+      else
+       echo "$progname: cannot copy \`$1' to \`$2'" 1>&2
+       status=1
+       return 1
+      fi
+      return 0
+}
+
 
 if test "x$ltdl" = xyes; then
   test -d libltdl || $mkdir libltdl
@@ -283,10 +295,7 @@
 
   $rm $file
   if test -n "$ln_s" && $ln_s $pkgdatadir/$file $file; then :
-  elif $cp $pkgdatadir/$file $file; then :
-  else
-    echo "$progname: cannot copy \`$pkgdatadir/$file' to \`$file'" 1>&2
-    status=1
+  elif copy_file $pkgdatadir/$file $file; then :
   fi
 done
 
@@ -300,20 +309,16 @@
     $mkdir libltdl
     ltdlfiles=`cd $pkgdatadir && ls libltdl/*`
     for file in $ltdlfiles; do
-      if $cp $pkgdatadir/$file $file; then :
-      else
-       echo "$progname: cannot copy \`$pkgdatadir/$file' to \`$file'" 1>&2
-       status=1
-       break
-      fi
+      copy_file $pkgdatadir/$file $file || break
     done
-    for file in $files; do
-      if $cp $pkgdatadir/$file libltdl/$file; then :
-      else
-       echo "$progname: cannot copy \`$pkgdatadir/$file' to \`libltdl/$file'" 
1>&2
-       status=1
-       break
-      fi
+
+    for file in $pkgdata_SCRIPTS; do
+      origfile=`echo $file | sed $program_transform_name`
+      copy_file $pkgdatadir/$origfile libltdl/$file || break
+    done
+
+    for file in $pkgdata_DATA; do
+      copy_file $pkgdatadir/$file libltdl/$file || break
     done
     tar -cf - libltdl | gzip --best > libltdl.tar.gz
     ${rm}r libltdl
@@ -326,7 +331,20 @@
   cd $auxdir || exit 1
 fi
 
-for file in $files; do
+for file in $pkgdata_SCRIPTS; do
+  origfile=`echo $file | sed $program_transform_name`
+  if test -f "$file" && test -z "$force"; then
+    test -z "$automake" && echo "$progname: \`$file' exists: use \`--force' to 
overwrite" 1>&2
+    continue
+  fi
+
+  $rm $file
+  if test -n "$ln_s" && $ln_s $pkgdatadir/$origfile $file; then :
+  elif copy_file $pkgdatadir/$origfile $file; then :
+  fi
+done
+
+for file in $pkgdata_DATA; do
   if test -f "$file" && test -z "$force"; then
     test -z "$automake" && echo "$progname: \`$file' exists: use \`--force' to 
overwrite" 1>&2
     continue
@@ -334,10 +352,7 @@
 
   $rm $file
   if test -n "$ln_s" && $ln_s $pkgdatadir/$file $file; then :
-  elif $cp $pkgdatadir/$file $file; then :
-  else
-    echo "$progname: cannot copy \`$pkgdatadir/$file' to \`$file'" 1>&2
-    status=1
+  elif copy_file $pkgdatadir/$file $file; then :
   fi
 done
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]