Browse Source

New installation script (automake 1.9)

Stéphane Raimbault 18 năm trước cách đây
mục cha
commit
da6bdf6bba
2 tập tin đã thay đổi với 95 bổ sung94 xóa
  1. 34 31
      INSTALL
  2. 61 63
      autogen.sh

+ 34 - 31
INSTALL

@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free
-Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006 Free Software Foundation, Inc.
 
 This file is free documentation; the Free Software Foundation gives
 unlimited permission to copy, distribute and modify it.
@@ -10,7 +10,10 @@ unlimited permission to copy, distribute and modify it.
 Basic Installation
 ==================
 
-These are generic installation instructions.
+Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
 
    The `configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
@@ -23,9 +26,9 @@ debugging `configure').
 
    It can also use an optional file (typically called `config.cache'
 and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  (Caching is
+the results of its tests to speed up reconfiguring.  Caching is
 disabled by default to prevent problems with accidental use of stale
-cache files.)
+cache files.
 
    If you need to do unusual things to compile the package, please try
 to figure out how `configure' could check whether to do them, and mail
@@ -35,20 +38,17 @@ some point `config.cache' contains results you don't want to keep, you
 may remove or edit it.
 
    The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
 
 The simplest way to compile this package is:
 
   1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.  If you're
-     using `csh' on an old version of System V, you might need to type
-     `sh ./configure' instead to prevent `csh' from trying to execute
-     `configure' itself.
+     `./configure' to configure the package for your system.
 
-     Running `configure' takes awhile.  While running, it prints some
-     messages telling which features it is checking for.
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
 
   2. Type `make' to compile the package.
 
@@ -78,7 +78,7 @@ details on some of the pertinent environment variables.
 by setting variables in the command line or in the environment.  Here
 is an example:
 
-     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
 
    *Note Defining Variables::, for more details.
 
@@ -87,31 +87,29 @@ Compiling For Multiple Architectures
 
 You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
-own directory.  To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+own directory.  To do this, you can use GNU `make'.  `cd' to the
 directory where you want the object files and executables to go and run
 the `configure' script.  `configure' automatically checks for the
 source code in the directory that `configure' is in and in `..'.
 
-   If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory.  After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
 
 Installation Names
 ==================
 
-By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc.  You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PREFIX'.
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
 
    You can specify separate installation prefixes for
 architecture-specific files and architecture-independent files.  If you
-give `configure' the option `--exec-prefix=PREFIX', the package will
-use PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
 
    In addition, if you use an unusual directory layout you can give
 options like `--bindir=DIR' to specify different values for particular
@@ -159,7 +157,7 @@ where SYSTEM can have one of these forms:
 need to know the machine type.
 
    If you are _building_ compiler tools for cross-compiling, you should
-use the `--target=TYPE' option to select the type of system they will
+use the option `--target=TYPE' to select the type of system they will
 produce code for.
 
    If you want to _use_ a cross compiler, that generates code for a
@@ -189,9 +187,14 @@ them in the `configure' command line, using `VAR=value'.  For example:
 
      ./configure CC=/usr/local2/bin/gcc
 
-will cause the specified gcc to be used as the C compiler (unless it is
+causes the specified `gcc' to be used as the C compiler (unless it is
 overridden in the site shell script).
 
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
 `configure' Invocation
 ======================
 

+ 61 - 63
autogen.sh

@@ -1,71 +1,69 @@
 #!/bin/sh
-# Run this to generate all the initial makefiles, etc.
+#
+# autogen.sh glue for hplip
+#
+# HPLIP used to have five or so different autotools trees.  Upstream
+# has reduced it to two.  Still, this script is capable of cleaning
+# just about any possible mess of autoconf files.
+#
+# BE CAREFUL with trees that are not completely automake-generated,
+# this script deletes all Makefile.in files it can find.
+#
+# Requires: automake 1.9, autoconf 2.57+
+# Conflicts: autoconf 2.13
+set -e
 
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-ORIGDIR=`pwd`
-cd $srcdir
+# Refresh GNU autotools toolchain.
+echo Cleaning autotools files...
+find -type d -name autom4te.cache -print0 | xargs -0 rm -rf \;
+find -type f \( -name missing -o -name install-sh -o -name mkinstalldirs \
+	-o -name depcomp -o -name ltmain.sh -o -name configure \
+	-o -name config.sub -o -name config.guess \
+	-o -name Makefile.in \) -print0 | xargs -0 rm -f
 
-PROJECT=libmodbus
+echo Running autoreconf...
+autoreconf --force --install
 
-DIE=0
+# For the Debian package build
+test -d debian && {
+	# link these in Debian builds
+	rm -f config.sub config.guess
+	ln -s /usr/share/misc/config.sub .
+	ln -s /usr/share/misc/config.guess .
 
-have_libtool=false
-if libtoolize --version < /dev/null > /dev/null 2>&1 ; then
-	libtool_version=`libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
-	case $libtool_version in
-	    1.4*|1.5*)
-		have_libtool=true
-		;;
-	esac
-fi
-if $have_libtool ; then : ; else
-	echo
-	echo "You must have libtool 1.4 installed to compile $PROJECT."
-	echo "Install the appropriate package for your distribution,"
-	echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/"
-	DIE=1
-fi
+	# refresh list of executable scripts, to avoid possible breakage if
+	# upstream tarball does not include the file or if it is mispackaged
+	# for whatever reason.
+	[ "$1" == "updateexec" ] && {
+		echo Generating list of executable files...
+		rm -f debian/executable.files
+		find -type f -perm +111 ! -name '.*' -fprint debian/executable.files
+	}
 
-(autoconf --version) < /dev/null > /dev/null 2>&1 || {
-	echo
-	echo "You must have autoconf installed to compile $PROJECT."
-	echo "Install the appropriate package for your distribution,"
-	echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
-	DIE=1
+	# Remove any files in upstream tarball that we don't have in the Debian
+	# package (because diff cannot remove files)
+	version=`dpkg-parsechangelog | awk '/Version:/ { print $2 }' | sed -e 's/-[^-]\+$//'`
+	source=`dpkg-parsechangelog | awk '/Source:/ { print $2 }' | tr -d ' '`
+	if test -r ../${source}_${version}.orig.tar.gz ; then
+		echo Generating list of files that should be removed...
+		rm -f debian/deletable.files
+		touch debian/deletable.files
+		[ -e debian/tmp ] && rm -rf debian/tmp
+		mkdir debian/tmp
+		( cd debian/tmp ; tar -zxf ../../../${source}_${version}.orig.tar.gz )
+		find debian/tmp/ -type f ! -name '.*' -print0 | xargs -0 -ri echo '{}' | \
+		  while read -r i ; do
+			if test -e "${i}" ; then
+				filename=$(echo "${i}" | sed -e 's#.*debian/tmp/[^/]\+/##')
+				test -e "${filename}" || echo "${filename}" >>debian/deletable.files
+			fi
+		  done
+		rm -fr debian/tmp
+	else
+		echo Emptying list of files that should be deleted...
+		rm -f debian/deletable.files
+		touch debian/deletable.files
+	fi
 }
 
-if automake-1.7 --version < /dev/null > /dev/null 2>&1 ; then
-    AUTOMAKE=automake-1.7
-    ACLOCAL=aclocal-1.7
-else
-	echo
-	echo "You must have automake 1.7.x installed to compile $PROJECT."
-	echo "Install the appropriate package for your distribution,"
-	echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
-	DIE=1
-fi
-
-if test "$DIE" -eq 1; then
-	exit 1
-fi
-
-if test -z "$AUTOGEN_SUBDIR_MODE"; then
-        if test -z "$*"; then
-                echo "I am going to run ./configure with no arguments - if you wish "
-                echo "to pass any to it, please specify them on the $0 command line."
-        fi
-fi
-
-$ACLOCAL $ACLOCAL_FLAGS || exit 1
-libtoolize --force || exit 1
-$AUTOMAKE --add-missing || exit 1
-autoconf || exit 1
-cd $ORIGDIR
-
-if test -z "$AUTOGEN_SUBDIR_MODE"; then
-        $srcdir/configure --enable-maintainer-mode "$@"
-
-        echo 
-        echo "Now type 'make' to compile $PROJECT."
-fi
+exit 0