Bug 73278 - autogen.sh fails to find glibtoolize
Summary: autogen.sh fails to find glibtoolize
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: All Mac OS X (All)
: medium normal
Assignee: Havoc Pennington
QA Contact:
URL:
Whiteboard: review-
Keywords: patch
Depends on:
Blocks:
 
Reported: 2014-01-04 12:48 UTC by Roland
Modified: 2014-01-18 04:14 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
glibtoolize fix (397 bytes, text/plain)
2014-01-04 12:48 UTC, Roland
Details
glibtoolize fix (266 bytes, text/plain)
2014-01-04 12:53 UTC, Roland
Details

Description Roland 2014-01-04 12:48:50 UTC
Created attachment 91481 [details]
glibtoolize fix

I have libtoolize installed on my Mac OS X with binary name glibtoolize. When I run autogen.sh, I get the error:

You must have libtoolize installed to compile dbus.
Install the libtool package from ftp.gnu.org or a mirror.

It turned out that the if condition in autogen.sh line 51

if ! test -f $LIBTOOLIZE; then
        LIBTOOLIZE=`which glibtoolize`
fi

is missing the square brackets. So LIBTOOLIZE=`which glibtoolize` is not called. This is tested and confirmed on recent linux and Mac OS X bash shells.

Attached is a patch, which fixes this problem.
Comment 1 Roland 2014-01-04 12:51:00 UTC
Comment on attachment 91481 [details]
glibtoolize fix

diff --git a/autogen.sh b/autogen.sh
index bff8257..63e5d96 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -48,7 +48,7 @@ fi
 }

 LIBTOOLIZE=`which libtoolize`
-if ! test -f $LIBTOOLIZE; then
+if ! [ test -f $LIBTOOLIZE ] ; then
        LIBTOOLIZE=`which glibtoolize`
 fi
Comment 2 Roland 2014-01-04 12:53:59 UTC
Created attachment 91482 [details]
glibtoolize fix

The first patch had also some test changes. This is the exact one.
Comment 3 Simon McVittie 2014-01-06 11:24:14 UTC
> +if ! [ test -f $LIBTOOLIZE ] ; then

This is incorrect. Correct syntax for test -f is either:

    test -f EXPR

or

    [ -f EXPR ]

but not both.

I think there's a "compensating error" happening here, which happens to do the right thing on Mac OS but not elsewhere: $LIBTOOLIZE expands to no arguments, whereas "$LIBTOOLIZE" would correctly expand to a non-empty string.

Please try with this syntax:

    if ! test -f "$LIBTOOLIZE"; then
Comment 4 Simon McVittie 2014-01-06 11:25:30 UTC
(In reply to comment #3)
> $LIBTOOLIZE expands to no
> arguments, whereas "$LIBTOOLIZE" would correctly expand to a non-empty
> string.

Er, that made no sense. What I meant is: if the variable LIBTOOLIZE is empty, then $LIBTOOLIZE expands to no arguments, whereas "$LIBTOOLIZE" would correctly expand to one argument whose value is the empty string.
Comment 5 Roland 2014-01-08 19:50:49 UTC
(In reply to comment #3)
> 
> Please try with this syntax:
> 
>     if ! test -f "$LIBTOOLIZE"; then

That works fine.
Comment 6 Chengwei Yang 2014-01-18 03:52:58 UTC
Any patch uploaded? If no, I'll upload this simple patch.
Comment 7 Chengwei Yang 2014-01-18 04:14:25 UTC
I see a patch already landed in tree.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.