]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - autogen.sh
Imported Upstream version 6.1+svn3812
[mirror_smartmontools-debian.git] / autogen.sh
index 5cc810fad5c447cf88ba5b28d19552c7d49c46f1..90d1e9561565cb1f845fa9e9fe1de5efdb501a8c 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: autogen.sh,v 1.14 2007/01/29 21:24:18 chrfranke Exp $
+# $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
 # Cygwin?
 test -x /usr/bin/uname && /usr/bin/uname | grep -i CYGWIN >/dev/null &&
 {
-    # Enable strict case checking
-    # (to avoid e.g. "DIST_COMMON = ... ChangeLog ..." in Makefile.in)
-    export CYGWIN="${CYGWIN}${CYGWIN:+ }check_case:strict"
-
     # Check for Unix text file type
     echo > dostest.tmp
     test "`wc -c < dostest.tmp`" -eq 1 ||
@@ -36,17 +32,19 @@ typep()
     return 1
 }
 
-test -x "$AUTOMAKE" || AUTOMAKE=`typep automake-1.10` || AUTOMAKE=`typep automake-1.9` ||
-    AUTOMAKE=`typep automake-1.8` || AUTOMAKE=`typep automake-1.7` || AUTOMAKE=`typep automake17` ||
+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` ||
 {
 echo
-echo "You must have at least GNU Automake 1.7 (up to 1.9.x) installed"
-echo "in order to bootstrap smartmontools from CVS. Download the"
+echo "You must have at least GNU Automake 1.7 (up to 1.11) installed"
+echo "in order to bootstrap smartmontools from SVN. Download the"
 echo "appropriate package for your distribution, or the source tarball"
 echo "from ftp://ftp.gnu.org/gnu/automake/ ."
 echo
 echo "Also note that support for new Automake series (anything newer"
-echo "than 1.9.x) is only added after extensive tests. If you live in"
+echo "than 1.11) is only added after extensive tests. If you live in"
 echo "the bleeding edge, you should know what you're doing, mainly how"
 echo "to test it before the developers. Be patient."
 exit 1;
@@ -55,35 +53,61 @@ exit 1;
 test -x "$ACLOCAL" || ACLOCAL="aclocal`echo "$AUTOMAKE" | sed 's/.*automake//'`" && ACLOCAL=`typep "$ACLOCAL"` ||
 {
 echo
-echo "autogen.sh found automake-1.7, automake-1.8, or automake-1.9 in"
-echo "your PATH, but not the respective aclocal-1.7, aclocal-1.8, or"
-echo "aclocal-1.9. Your installation of GNU Automake is broken or"
-echo "incomplete."
+echo "autogen.sh found automake-1.X, but not the respective aclocal-1.X."
+echo "Your installation of GNU Automake is broken or incomplete."
 exit 2;
 }
 
-# Warn if Automake version is unknown
-ver=
+# Detect Automake version
 case "$AUTOMAKE" in
-  *automake-1.[78]|*automake17)
-    ;;
+  *automake-1.7|*automake17)
+    ver=1.7 ;;
+  *automake-1.8)
+    ver=1.8 ;;
   *)
-    ver="`$AUTOMAKE --version | head -1 | sed -n 's,^.*\([12]\.[.0-9]*[-pl0-9]*\).*$,\1,p'`"
+    ver="`$AUTOMAKE --version | sed -n '1s,^.*[^.0-9]\([12]\.[0-9][-.0-9pl]*\).*$,\1,p'`"
     ver="${ver:-?.?.?}"
-    case "$ver" in
-      1.[78]*|1.9.[1-6]|1.10) ver= ;;
-    esac ;;
 esac
 
-test -z "$ver" ||
+# Warn if Automake version was not tested or does not support filesystem
+case "$ver" in
+  1.[78]|1.[78].*)
+    # Check for case sensitive filesystem
+    # (to avoid e.g. "DIST_COMMON = ... ChangeLog ..." in Makefile.in on Cygwin)
+    rm -f CASETEST.TMP
+    echo > casetest.tmp
+    test -f CASETEST.TMP &&
+    {
+      echo "Warning: GNU Automake version ${ver} does not properly handle case"
+      echo "insensitive filesystems. Some make targets may not work."
+    }
+    rm -f casetest.tmp
+    ;;
+
+  1.9.[1-6]|1.10|1.10.[12]|1.11|1.11.[1-6]|1.12.[3-5])
+    # OK
+    ;;
+
+  *)
+    echo "Note: GNU Automake version ${ver} was not tested by the developers."
+    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 "Note: GNU Automake version ${ver} was not tested by the developers."
-echo "Please report success/failure to the smartmontools-support mailing list."
+  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