glibtool support in autogen (was Re: seeking for help on MNG creation)

Ralph Giles <giles-zeIfkxP3e/[email protected]> Thu, 1 Apr 2004 13:59:13 -0800
Newsgroups gmane.comp.graphics.mng.general
Message-ID <[email protected]>
On Thu, Apr 01, 2004 at 11:25:09AM +0200, Gerard Juyn wrote:

> > It would be good if the next version could also be sensitive to the fact
> > that autogen.sh uses "libtool" by default, which is named "glibtool" on
> > Mac OS X/Darwin. It's an easy fix for a porting system, but maybe this
> > could be included as well.

A patch is attached. It looks for glibtoolize if libtoolize isn't in the 
path. The name conflict is with 'libtool' so the libtool package is 
shipped by Apple with a name prefix of 'g'. Thus, searching in this 
order is safe.

We've been doing something very similar for a while in libogg, so it's 
had some portability testing. Tested on linux and MacOS 10.3. Of course, 
we still don't build out of the box because Apple doesn't ship an 
accessible libjpeg, but should do once one is installed.

> It would be even better if we could have a volunteer for that bit of the library 
> specifically. I don't have the inclination to find out why something that used to 
> work on my linux-box suddenly doesn't after some (seemingly) trivial changes 
> proposed by someone else. If someone could make the amendments needed, 
> I'll be happy to include the updated files in the next release!

I still have cvs access, so I can commit this if you like.

 -r
glibtool.diff (text/plain, 893 B)
Index: autogen.sh
===================================================================
RCS file: /cvsroot/libmng/libmng-devel/autogen.sh,v
retrieving revision 1.3
diff -u -r1.3 autogen.sh
--- autogen.sh	15 Jun 2003 12:25:29 -0000	1.3
+++ autogen.sh	1 Apr 2004 21:40:30 -0000
@@ -23,8 +23,20 @@
 echo "running aclocal"
 aclocal
 
-echo "running libtoolize"
-libtoolize --automake
+# libtool is named glibtool on MacOS X
+for LIBTOOLIZE in libtoolize glibtoolize nope; do
+  ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break
+done
+if test x$LIBTOOLIZE = xnope; then
+  echo "error: Could not find libtoolize in the path!"
+  echo "  You'll need to install a copy of libtool before continuing"
+  echo "  with the generation of the build system."
+  echo
+  exit 1
+fi
+
+echo "running $LIBTOOLIZE"
+$LIBTOOLIZE --automake
 
 echo "running automake"
 automake --foreign --add-missing