Update script and doc from web's tools dir
[claws.git] / autogen.sh
index 093adb39a5c28c25f95843de2f64cd5ebb9b99d5..694ef7cc4fdbd2ce4cf5ed21911d380758c5bac8 100755 (executable)
@@ -12,9 +12,9 @@ if [ "$bisonver" = "" ]; then
 fi
 
 if [ "$LEX" != "" ]; then
-       flexver=`$LEX --version|sed "s/.* //"`
+       flexver=`$LEX --version|awk '{print $2}'`
 else
-       flexver=`flex --version|sed "s/.* //"`
+       flexver=`flex --version|awk '{print $2}'`
 fi
 
 if [ "$flexver" = "" ]; then
@@ -36,11 +36,24 @@ else
        fi
 fi
 
-aclocal -I m4 \
-  && libtoolize --force --copy \
+case `uname` in
+       Darwin*)
+               if [ "`glibtoolize --version`" = "" ]; then
+                       echo MacOS requires glibtool from either Macport or brew
+                       exit 1
+               fi
+               LIBTOOL="glibtoolize --force --copy"
+               ;;
+       *)
+               LIBTOOL="libtoolize --force --copy"
+               ;;
+esac
+
+${LIBTOOL} \
+  && aclocal -I m4 \
+  && autoconf \
   && autoheader \
-  && automake --add-missing --foreign --copy \
-  && autoconf 
+  && automake --add-missing --foreign --copy
 if test -z "$NOCONFIGURE"; then
-exec ./configure --enable-maintainer-mode $@
+exec ./configure --enable-maintainer-mode "$@"
 fi