shithub: jbig2

Download patch

ref: 3837ea918bcb27bc70af71d5a5323187d51a309c
parent: f2af865a61273a6a073f171b7b6fad5fbb07d5ed
author: Chris Liddell <[email protected]>
date: Thu Apr 2 08:14:24 EDT 2015

Tidy jbig2dec build configuration:

1) Remove automake version specific tests/use

The script does unpleasant things which can cause us to attempt to use a
specific version of automake, which should not really be needed these days.

So we now just check that the automake version is greater than or equal to the
version we require.

The old method can still be accessed by invoking autogen.sh thus:
USE_OLD=yes ./autogen.sh

2) Add automake option to make dist "self contained"

The automake default is to symlink to a few scripts ('compile', 'missing' etc)
in the current system's automake install. That results in a configuration
reliant on automake being installed, and the same version, for a build.

Add the '--copy' automake option so the script files are copied rather than
linked, so we get a self contained configure/make/install setup.

No cluster differences.

--- a/autogen.sh
+++ b/autogen.sh
@@ -23,61 +23,84 @@
 VERSIONMKMIN="sed -e s/.*[0-9][0-9]*\.//"
 
 # do we need automake?
-if test -r Makefile.am; then
-  AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am`
-  AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP`
-  if test "x$AM_NEEDED" = "x$AM_OPTIONS"; then
-    AM_NEEDED=""
-  fi
-  if test -z "$AM_NEEDED"; then
-    echo -n "checking for automake... "
-    AUTOMAKE=automake
-    ACLOCAL=aclocal
-    if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
-      echo "yes"
-    else
-      echo "no"
-      AUTOMAKE=
+if test "x$USE_OLD" = "xyes" ; then
+  if test -r Makefile.am; then
+    AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am`
+    AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP`
+    if test "x$AM_NEEDED" = "x$AM_OPTIONS"; then
+      AM_NEEDED=""
     fi
-  else
-    echo -n "checking for automake $AM_NEEDED or later... "
-    majneeded=`echo $AM_NEEDED | $VERSIONMKMAJ`
-    minneeded=`echo $AM_NEEDED | $VERSIONMKMIN`
-    for am in automake-$AM_NEEDED automake$AM_NEEDED automake \
-	automake-1.7 automake-1.8 automake-1.9 automake-1.10; do
-      ($am --version < /dev/null > /dev/null 2>&1) || continue
-      ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP`
-      maj=`echo $ver | $VERSIONMKMAJ`
-      min=`echo $ver | $VERSIONMKMIN`
-      if test $maj -eq $majneeded -a $min -ge $minneeded; then
-        AUTOMAKE=$am
-        echo $AUTOMAKE
-        break
+    if test -z "$AM_NEEDED"; then
+      echo -n "checking for automake... "
+      AUTOMAKE=automake
+      ACLOCAL=aclocal
+      if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
+        echo "yes"
+      else
+        echo "no"
+        AUTOMAKE=
       fi
-    done
-    test -z $AUTOMAKE &&  echo "no"
-    echo -n "checking for aclocal $AM_NEEDED or later... "
-    for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED aclocal\
-	aclocal-1.7 aclocal-1.8 aclocal-1.9 aclocal-1.10; do
-      ($ac --version < /dev/null > /dev/null 2>&1) || continue
-      ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP`
-      maj=`echo $ver | $VERSIONMKMAJ`
-      min=`echo $ver | $VERSIONMKMIN`
-      if test $maj -eq $majneeded -a $min -ge $minneeded; then
-        ACLOCAL=$ac
-        echo $ACLOCAL
-        break
-      fi
-    done
-    test -z $ACLOCAL && echo "no"
+    else
+      echo -n "checking for automake $AM_NEEDED or later... "
+      majneeded=`echo $AM_NEEDED | $VERSIONMKMAJ`
+      minneeded=`echo $AM_NEEDED | $VERSIONMKMIN`
+      for am in automake-$AM_NEEDED automake$AM_NEEDED automake \
+          automake-1.7 automake-1.8 automake-1.9 automake-1.10; do
+        ($am --version < /dev/null > /dev/null 2>&1) || continue
+        ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP`
+        maj=`echo $ver | $VERSIONMKMAJ`
+        min=`echo $ver | $VERSIONMKMIN`
+        if test $maj -eq $majneeded -a $min -ge $minneeded; then
+          AUTOMAKE=$am
+          echo $AUTOMAKE
+          break
+        fi
+      done
+      test -z $AUTOMAKE &&  echo "no"
+      echo -n "checking for aclocal $AM_NEEDED or later... "
+      for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED aclocal\
+          aclocal-1.7 aclocal-1.8 aclocal-1.9 aclocal-1.10; do
+        ($ac --version < /dev/null > /dev/null 2>&1) || continue
+        ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP`
+        maj=`echo $ver | $VERSIONMKMAJ`
+        min=`echo $ver | $VERSIONMKMIN`
+        if test $maj -eq $majneeded -a $min -ge $minneeded; then
+          ACLOCAL=$ac
+          echo $ACLOCAL
+          break
+        fi
+      done
+      test -z $ACLOCAL && echo "no"
+    fi
+    test -z $AUTOMAKE || test -z $ACLOCAL && {
+          echo
+          echo "You must have automake installed to compile $package."
+          echo "Download the appropriate package for your distribution,"
+          echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+          exit 1
+    }
   fi
-  test -z $AUTOMAKE || test -z $ACLOCAL && {
-        echo
-        echo "You must have automake installed to compile $package."
-        echo "Download the appropriate package for your distribution,"
-        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
-	exit 1
-  }
+else
+  AUTOMAKE=automake
+  ACLOCAL=aclocal
+  AM_VER=`$AUTOMAKE --version | grep "automake (GNU automake)" | sed 's/[^0-9\.]*//g'`
+  AM_MAJ=`echo $AM_VER |cut -d. -f1`
+  AM_MIN=`echo $AM_VER |cut -d. -f2`
+  AM_PAT=`echo $AM_VER |cut -d. -f3`
+
+  AM_NEEDED=`fgrep AUTOMAKE_OPTIONS Makefile.am | $VERSIONGREP`
+  AM_MAJOR_REQ=`echo $AM_NEEDED |cut -d. -f1`
+  AM_MINOR_REQ=`echo $AM_NEEDED |cut -d. -f2`
+  
+  echo "checking for automake $AM_NEEDED or later..."
+
+  if [ $AM_MAJ -lt $AM_MAJOR_REQ -o $AM_MIN -lt $AM_MINOR_REQ ] ; then
+    echo
+    echo "You must have automake $AM_NEEDED or better installed to compile $package."
+    echo "Download the appropriate package for your distribution,"
+    echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+    exit 1
+  fi
 fi
 
 # do we need libtool?
@@ -106,7 +129,7 @@
 $ACLOCAL $ACLOCAL_FLAGS
 
 echo "  $LIBTOOLIZE"
-$LIBTOOLIZE
+$LIBTOOLIZE --copy
 
 echo "  autoheader"
 autoheader
@@ -135,7 +158,7 @@
 EOF
 
 echo "  $AUTOMAKE --add-missing $AUTOMAKE_FLAGS"
-$AUTOMAKE --add-missing $AUTOMAKE_FLAGS
+$AUTOMAKE --add-missing --copy $AUTOMAKE_FLAGS
 
 echo "  autoconf"
 autoconf