]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - autogen.sh
Imported Upstream version 6.1+svn3812
[mirror_smartmontools-debian.git] / autogen.sh
index e90692f2142498fb4c3d3ec082ca57dcda21442b..90d1e9561565cb1f845fa9e9fe1de5efdb501a8c 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: autogen.sh 2844 2009-07-18 12:59:21Z chrfranke $
+# $Id: autogen.sh 3748 2013-01-18 20:12:44Z chrfranke $
 #
 # Generate ./configure from config.in and Makefile.in from Makefile.am.
 # This also adds files like missing,depcomp,install-sh to the source
@@ -32,7 +32,8 @@ typep()
     return 1
 }
 
-test -x "$AUTOMAKE" || AUTOMAKE=`typep automake-1.11` || AUTOMAKE=`typep automake-1.10` ||
+test -x "$AUTOMAKE" || AUTOMAKE=`typep automake-1.12` ||
+    AUTOMAKE=`typep automake-1.11` || AUTOMAKE=`typep automake-1.10` ||
     AUTOMAKE=`typep automake-1.9` || AUTOMAKE=`typep automake-1.8` ||
     AUTOMAKE=`typep automake-1.7` || AUTOMAKE=`typep automake17` ||
 {
@@ -64,7 +65,7 @@ case "$AUTOMAKE" in
   *automake-1.8)
     ver=1.8 ;;
   *)
-    ver="`$AUTOMAKE --version | sed -n '1s,^.*\([12]\.[.0-9]*[-pl0-9]*\).*$,\1,p'`"
+    ver="`$AUTOMAKE --version | sed -n '1s,^.*[^.0-9]\([12]\.[0-9][-.0-9pl]*\).*$,\1,p'`"
     ver="${ver:-?.?.?}"
 esac
 
@@ -83,7 +84,7 @@ case "$ver" in
     rm -f casetest.tmp
     ;;
 
-  1.9.[1-6]|1.10|1.10.[12]|1.11)
+  1.9.[1-6]|1.10|1.10.[12]|1.11|1.11.[1-6]|1.12.[3-5])
     # OK
     ;;
 
@@ -92,9 +93,21 @@ case "$ver" in
     echo "Please report success/failure to the smartmontools-support mailing list."
 esac
 
+# Install pkg-config macros
+# (Don't use 'aclocal -I m4 --install' to keep support for automake < 1.10)
+test -d m4 || mkdir m4 || exit 1
+test -f m4/pkg.m4 || acdir=`${ACLOCAL} --print-ac-dir` &&
+  test -n "$acdir" && test -f "$acdir/pkg.m4" &&
+{
+  echo "$0: installing \`m4/pkg.m4' from \`$acdir/pkg.m4'"
+  cp "$acdir/pkg.m4" m4/pkg.m4
+}
+test -f m4/pkg.m4 ||
+  echo "Warning: cannot install m4/pkg.m4, 'make dist' and systemd detection will not work."
+
 set -e # stops on error status
 
-${ACLOCAL}
+${ACLOCAL} -I m4
 autoheader
-${AUTOMAKE} --add-missing --copy --foreign
+${AUTOMAKE} --add-missing --copy
 autoconf