[dolt-PATCH] Fallback to libtool when its options are used

Ademar de Souza Reis Jr. ademar.reis at openbossa.org
Tue Jul 29 12:34:58 PDT 2008


libtool options (such as --silent, --debug, --dry-run, etc) can be added
via the LIBTOOL variable from automake, so we better fallback to standard
libtool whenever one is found.

With this change, we stay on the safe side and avoid a build breakage
in complex setups.

Signed-off-by: Ademar de Souza Reis Jr. <ademar at openbossa.org>
---
 dolt.m4 |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/dolt.m4 b/dolt.m4
index 8c75480..68aa7dd 100644
--- a/dolt.m4
+++ b/dolt.m4
@@ -142,10 +142,13 @@ dnl Done writing out doltcompile; substitute it for libtool compilation.
 
 dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for
 dnl a target, so write out a libtool wrapper to handle that case.
-dnl Note that doltlibtool does not handle inferred tags or option arguments
-dnl without '=', because automake does not use them.
     cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
 #!$DOLT_BASH
+
+# Note that doltlibtool does not handle inferred tags or option arguments
+# without '=', so if a libtool option is recognized, we take the safe road
+# and fallback to standard libtool.
+
 __DOLTLIBTOOL__EOF__
     cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
 top_builddir_slash="${0%%doltlibtool}"
@@ -153,14 +156,25 @@ top_builddir_slash="${0%%doltlibtool}"
 args=()
 modeok=false
 tagok=false
+optionsok=true
 for arg in "$[]@"; do
     case "$arg" in
         --mode=compile) modeok=true ;;
         --tag=CC|--tag=CXX) tagok=true ;;
+		'--tag ') optionsok=false ;;
+		'--mode ') optionsok=false ;;
+		--config) optionsok=false ;;
+		--debug) optionsok=false ;;
+		--dry-run|-n) optionsok=false ;;
+		--features) optionsok=false ;;
+		--finish) optionsok=false ;;
+		--help) optionsok=false ;;
+		--quiet|--silent) optionsok=false ;;
+		--version) optionsok=false ;;
         *) args+=("$arg")
     esac
 done
-if $modeok && $tagok ; then
+if $modeok && $tagok && $optionok; then
     . ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
 else
     exec ${top_builddir_slash}libtool "$[]@"
-- 
1.5.5.1



More information about the dolt mailing list