libtool
[Top][All Lists]
Advanced

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

[PATCH] Don't install .la files when --no-la-files is used


From: Dan Nicholson
Subject: [PATCH] Don't install .la files when --no-la-files is used
Date: Sat, 1 Nov 2008 13:48:28 -0700

Add an option, --no-la-files, which skips installing the .la files. When
used with --mode=uninstall, libtool tries to use the .lai file from the
build directory.

Signed-off-by: Dan Nicholson <address@hidden>
---
 Does this seem reasonable? I've checked that this doesn't break
 uninstall or distcheck.

 libltdl/config/ltmain.m4sh |   35 ++++++++++++++++++++++++++++++-----
 1 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 696b6ab..4f1ab82 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -38,6 +38,7 @@ m4_divert_push([SCRIPT])# @configure_input@
 #   -n, --dry-run            display commands without modifying any files
 #       --features           display basic configuration information and exit
 #       --mode=MODE          use operation mode MODE
+#       --no-la-files        don't install libtool archives
 #       --preserve-dup-deps  don't remove duplicate dependency libraries
 #       --quiet, --silent    don't print informational messages
 #       --tag=TAG            use configuration variables from tag TAG
@@ -153,6 +154,7 @@ extracted_serial=0
 
 opt_dry_run=false
 opt_duplicate_deps=false
+opt_no_la_files=false
 opt_silent=false
 opt_debug=:
 
@@ -325,6 +327,9 @@ func_enable_tag ()
                        shift
                        ;;
 
+      --no-la-files)
+                       opt_no_la_files=:                               ;;
+
       --preserve-dup-deps)
                        opt_duplicate_deps=:                            ;;
 
@@ -1683,11 +1688,14 @@ func_mode_install ()
          func_execute_cmds "$postinstall_cmds" 'exit $?'
        fi
 
-       # Install the pseudo-library for information purposes.
-       func_basename "$file"
-       name="$func_basename_result"
-       instname="$dir/$name"i
-       func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+       # Install the pseudo-library for information purposes unless
+       # told not to.
+       if ! $opt_no_la_files; then
+         func_basename "$file"
+         name="$func_basename_result"
+         instname="$dir/$name"i
+         func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+       fi
 
        # Maybe install the static library, too.
        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
@@ -7841,6 +7849,20 @@ func_mode_uninstall ()
        esac
       fi
 
+      # When no .la files are requested, try to use the .lai build copy.
+      # Make a guess that it's in .libs/*.lai or try to find it
+      case $name in
+      *.la)
+       if $opt_no_la_files; then
+         file=.libs/"$name"i
+         test -f "$file" || file=`find . -type f -name "$name"i`
+         test -n "$file" || file=.libs/"$name"i
+         func_dirname "$file" "" "."
+         dir="$func_dirname_result"
+       fi
+       ;;
+      esac
+
       # Don't error if the file doesn't exist and rm -f was used.
       if { test -L "$file"; } >/dev/null 2>&1 ||
         { test -h "$file"; } >/dev/null 2>&1 ||
@@ -7857,6 +7879,9 @@ func_mode_uninstall ()
 
       case $name in
       *.la)
+       # Don't remove the local .lai file
+       $opt_no_la_files && rmfiles=
+
        # Possibly a libtool archive, so verify it.
        if func_lalib_p "$file"; then
          func_source $dir/$name
-- 
1.5.6.5





reply via email to

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