libtool-patches
[Top][All Lists]
Advanced

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

Warn if build tree path contains white space


From: Ralf Wildenhues
Subject: Warn if build tree path contains white space
Date: Fri, 23 Nov 2007 21:54:55 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello,

Wrt. this bug, <http://bugzilla.gnome.org/show_bug.cgi?id=498625>,
Jim Meyering asked whether Libtool could be made to print a warning
if the build tree path contained white space.

OK to apply (and add Jim to THANKS)?  Do you think this warning is noisy
enough?

I'm a bit reluctant to make it a hard error because some (simple) setups
should still work.  For example, for me, the other patch below is
sufficient to get Libtool itself built in a build tree path containing
spaces.

Cheers,
Ralf

2007-11-23  Ralf Wildenhues  <address@hidden>

        * libltdl/m4/libtool.m4 (_LT_CHECK_BUILDDIR): New macro.
        Warn about whitespace in the absolute build tree name.
        (LT_INIT): Use it.
        * THANKS: Update.
        Report by Jim Meyering.

        * libltdl/config/ltmain.m4sh (func_extract_an_archive)
        (func_extract_archives): Add some quoting.

Index: libltdl/config/ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v
retrieving revision 1.91
diff -u -r1.91 ltmain.m4sh
--- libltdl/config/ltmain.m4sh  12 Oct 2007 16:35:15 -0000      1.91
+++ libltdl/config/ltmain.m4sh  23 Nov 2007 20:54:30 -0000
@@ -1115,7 +1115,7 @@
     $opt_debug
     f_ex_an_ar_dir="$1"; shift
     f_ex_an_ar_oldlib="$1"
-    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" 'exit 
$?'
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 
'exit $?'
     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
      :
     else
@@ -1166,7 +1166,7 @@
          cd $my_xdir || exit $?
          darwin_archive=$my_xabs
          darwin_curdir=`pwd`
-         darwin_base_archive=`basename $darwin_archive`
+         darwin_base_archive=`basename "$darwin_archive"`
          darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $GREP 
Architectures 2>/dev/null || true`
          if test -n "$darwin_arches"; then
            darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
Index: libltdl/m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v
retrieving revision 1.121
diff -u -r1.121 libtool.m4
--- libltdl/m4/libtool.m4       12 Nov 2007 19:44:05 -0000      1.121
+++ libltdl/m4/libtool.m4       23 Nov 2007 20:54:33 -0000
@@ -51,12 +51,24 @@
        [$2])])
 
 
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\    *)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in \`pwd\`]) ;;
+esac
+])
+
+
 # LT_INIT([OPTIONS])
 # ------------------
 AC_DEFUN([LT_INIT],
 [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
 AC_BEFORE([$0], [LT_LANG])dnl
 AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_REQUIRE([_LT_CHECK_BUILDDIR])dnl
 
 dnl Autoconf doesn't catch unexpanded LT_ macros by default:
 m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
@@ -81,7 +93,7 @@
 
 # Only expand once:
 m4_define([LT_INIT])
-])# _LT_INIT
+])# LT_INIT
 
 # Old names:
 AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])




reply via email to

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