Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix for Issue #43: checks for the existence of glibtool using hash rather than testing for ... #44

Merged
merged 1 commit into from

2 participants

@mdavid
Collaborator

...the hardcoded path /usr/bin/glibtool. This ensures that glibtool and glibtoolize that are not located in /usr/bin (e.g. /usr/local/bin) can be found as long as their root folder is contained in the $PATH environment variable.

Apple uses their own version of libtool which is located at /usr/bin/libtool. The Gnu version of libtool (which autogen.sh is configured to look for) uses the g prefix (i.e. glibtool,glibtoolize.) On systems that ship with the Gnu libtool version, testing for the existence of /usr/bin/glibtool will in most cases return true. However, on Mac OS X it returns false regardless of whether you have the Gnu version of libtool installed somewhere else on the system (e.g. /usr/local/bin/glibtool as would be the case if you compiled and installed from source directly or via brew or similar OS X package management tool.) Using the hash command to determine if the glibtool command exists in any location rather than testing for the hardcoded existence of /usr/bin/glibtool is therefore the better overall cross-platform solution.

@mdavid mdavid checks for the existence of glibtool using hash rather than testing f…
…or the hardcoded path /usr/bin/glibtool. This ensures that glibtool and glibtoolize that are not located in /usr/bin (e.g. /usr/local/bin) can be found as long as their root folder is contained in the $PATH environment variable.
7fa9e44
@mdavid mdavid was assigned
@skinkie skinkie was assigned
@skinkie skinkie merged commit e43de1b into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 1, 2012
  1. @mdavid

    checks for the existence of glibtool using hash rather than testing f…

    mdavid authored
    …or the hardcoded path /usr/bin/glibtool. This ensures that glibtool and glibtoolize that are not located in /usr/bin (e.g. /usr/local/bin) can be found as long as their root folder is contained in the $PATH environment variable.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  autogen.sh
View
3  autogen.sh
@@ -29,7 +29,8 @@ test -z "$AUTOMAKE" && AUTOMAKE=automake
test -z "$ACLOCAL" && ACLOCAL=aclocal
test -z "$AUTOCONF" && AUTOCONF=autoconf
test -z "$AUTOHEADER" && AUTOHEADER=autoheader
-if [ -x /usr/bin/glibtool ]; then
+
+if hash glibtool 2>&-; then
test -z "$LIBTOOL" && LIBTOOL=glibtool
test -z "$LIBTOOLIZE" && LIBTOOLIZE=glibtoolize
else
Something went wrong with that request. Please try again.