Merge pull request #956 from ermshiperete/bug-xamarin-14987
[mono.git] / autogen.sh
index 06ad5c886641c46c4230aec946122282c7b983f2..a576ed6672afab5a9697e610ce8b6a9e0265b208 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
 # Run this to generate all the initial makefiles, etc.
 # Ripped off from GNOME macros version
 
@@ -107,15 +107,19 @@ fi
 # Plug in the extension module
 #
 has_ext_mod=false
+ext_mod_args=''
 for PARAM; do
-    if test $PARAM = "--enable-extension-module" ; then
-               has_ext_mod=true
-       fi
+    if [[ $PARAM =~ "--enable-extension-module" ]] ; then
+        has_ext_mod=true
+        if [[ $PARAM =~ "=" ]] ; then
+            ext_mod_args=`echo $PARAM | cut -d= -f2`
+        fi
+    fi
 done
 
 if test x$has_ext_mod = xtrue; then
        pushd ../mono-extensions/scripts
-       sh ./prepare-repo.sh || exit 1
+       sh ./prepare-repo.sh $ext_mod_args || exit 1
        popd
 else
        cat mono/mini/Makefile.am.in > mono/mini/Makefile.am
@@ -134,7 +138,7 @@ aclocal -Wnone -I m4 -I . $ACLOCAL_FLAGS || {
   exit 1
 }
 
-if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
+if grep "^AC_CONFIG_HEADERS" configure.in >/dev/null; then
   echo "Running autoheader..."
   autoheader || { echo "**Error**: autoheader failed."; exit 1; }
 fi