From: Bruno Haible <br...@clisp.org>
Subject: Re: bootstrap fails on Darwin for `libtool'
Date: Sat, 19 Nov 2016 17:01:31 +0100

> The background appears to be that on macOS:
>   * /usr/bin/libtool is an Apple program, that does not support the GNU
>     interface. It comes with Xcode; Xcode is the usual way to install a
>     C compiler on this platform.
>   * To avoid a conflict, people often configure GNU libtool with
>     --program-prefix=g.
>   * Thus their libtoolize script will be found as 'glibtoolize'.
> 
> But AFAICS there is no 'libtoolize' from Apple.
> 
>> +      case `uname` in
>> +      Darwin*) app=glibtoolize ;;
> 
> I would still check to see whether 'libtoolize' exists, before
> trying 'glibtoolize'. Rationale: 'libtoolize' is the default name,
> 'glibtoolize' is just a convention used by many people.
> 

Bertrand prepared the attached patch.


    Werner
diff --git a/bootstrap b/bootstrap
index 932ff85e..d1884123 100755
--- a/bootstrap
+++ b/bootstrap
@@ -450,7 +450,20 @@ check_versions() {
   while read app req_ver; do
     # We only need libtoolize from the libtool package.
     if test "$app" = libtool; then
-      app=libtoolize
+      case `uname` in
+      Darwin*)
+        # on MacOS X systems. GNU libtool conflicts with the Xcode
+        # libtool, and 'libtoolize' is often installed as
+        # 'glibtoolize'.
+        if check_exists libtoolize; then
+          app=libtoolize
+        elif check_exists glibtoolize; then
+          app=glibtoolize
+        else
+          die 'cannot find libtoolize or glibtoolize'
+        fi;;
+      *) app=libtoolize;;
+      esac
     fi
     # Exempt git if --no-git is in effect.
     if test "$app" = git; then

Reply via email to