Commit da6bdf6bba887899daec59868bd5279d23db3dfa

Authored by Stéphane Raimbault
1 parent 7d77328c

New installation script (automake 1.9)

Showing 2 changed files with 95 additions and 94 deletions
1 1 Installation Instructions
2 2 *************************
3 3  
4   -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free
5   -Software Foundation, Inc.
  4 +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
  5 +2006 Free Software Foundation, Inc.
6 6  
7 7 This file is free documentation; the Free Software Foundation gives
8 8 unlimited permission to copy, distribute and modify it.
... ... @@ -10,7 +10,10 @@ unlimited permission to copy, distribute and modify it.
10 10 Basic Installation
11 11 ==================
12 12  
13   -These are generic installation instructions.
  13 +Briefly, the shell commands `./configure; make; make install' should
  14 +configure, build, and install this package. The following
  15 +more-detailed instructions are generic; see the `README' file for
  16 +instructions specific to this package.
14 17  
15 18 The `configure' shell script attempts to guess correct values for
16 19 various system-dependent variables used during compilation. It uses
... ... @@ -23,9 +26,9 @@ debugging `configure').
23 26  
24 27 It can also use an optional file (typically called `config.cache'
25 28 and enabled with `--cache-file=config.cache' or simply `-C') that saves
26   -the results of its tests to speed up reconfiguring. (Caching is
  29 +the results of its tests to speed up reconfiguring. Caching is
27 30 disabled by default to prevent problems with accidental use of stale
28   -cache files.)
  31 +cache files.
29 32  
30 33 If you need to do unusual things to compile the package, please try
31 34 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
35 38 may remove or edit it.
36 39  
37 40 The file `configure.ac' (or `configure.in') is used to create
38   -`configure' by a program called `autoconf'. You only need
39   -`configure.ac' if you want to change it or regenerate `configure' using
40   -a newer version of `autoconf'.
  41 +`configure' by a program called `autoconf'. You need `configure.ac' if
  42 +you want to change it or regenerate `configure' using a newer version
  43 +of `autoconf'.
41 44  
42 45 The simplest way to compile this package is:
43 46  
44 47 1. `cd' to the directory containing the package's source code and type
45   - `./configure' to configure the package for your system. If you're
46   - using `csh' on an old version of System V, you might need to type
47   - `sh ./configure' instead to prevent `csh' from trying to execute
48   - `configure' itself.
  48 + `./configure' to configure the package for your system.
49 49  
50   - Running `configure' takes awhile. While running, it prints some
51   - messages telling which features it is checking for.
  50 + Running `configure' might take a while. While running, it prints
  51 + some messages telling which features it is checking for.
52 52  
53 53 2. Type `make' to compile the package.
54 54  
... ... @@ -78,7 +78,7 @@ details on some of the pertinent environment variables.
78 78 by setting variables in the command line or in the environment. Here
79 79 is an example:
80 80  
81   - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
  81 + ./configure CC=c99 CFLAGS=-g LIBS=-lposix
82 82  
83 83 *Note Defining Variables::, for more details.
84 84  
... ... @@ -87,31 +87,29 @@ Compiling For Multiple Architectures
87 87  
88 88 You can compile the package for more than one kind of computer at the
89 89 same time, by placing the object files for each architecture in their
90   -own directory. To do this, you must use a version of `make' that
91   -supports the `VPATH' variable, such as GNU `make'. `cd' to the
  90 +own directory. To do this, you can use GNU `make'. `cd' to the
92 91 directory where you want the object files and executables to go and run
93 92 the `configure' script. `configure' automatically checks for the
94 93 source code in the directory that `configure' is in and in `..'.
95 94  
96   - If you have to use a `make' that does not support the `VPATH'
97   -variable, you have to compile the package for one architecture at a
98   -time in the source code directory. After you have installed the
99   -package for one architecture, use `make distclean' before reconfiguring
100   -for another architecture.
  95 + With a non-GNU `make', it is safer to compile the package for one
  96 +architecture at a time in the source code directory. After you have
  97 +installed the package for one architecture, use `make distclean' before
  98 +reconfiguring for another architecture.
101 99  
102 100 Installation Names
103 101 ==================
104 102  
105   -By default, `make install' will install the package's files in
106   -`/usr/local/bin', `/usr/local/man', etc. You can specify an
107   -installation prefix other than `/usr/local' by giving `configure' the
108   -option `--prefix=PREFIX'.
  103 +By default, `make install' installs the package's commands under
  104 +`/usr/local/bin', include files under `/usr/local/include', etc. You
  105 +can specify an installation prefix other than `/usr/local' by giving
  106 +`configure' the option `--prefix=PREFIX'.
109 107  
110 108 You can specify separate installation prefixes for
111 109 architecture-specific files and architecture-independent files. If you
112   -give `configure' the option `--exec-prefix=PREFIX', the package will
113   -use PREFIX as the prefix for installing programs and libraries.
114   -Documentation and other data files will still use the regular prefix.
  110 +pass the option `--exec-prefix=PREFIX' to `configure', the package uses
  111 +PREFIX as the prefix for installing programs and libraries.
  112 +Documentation and other data files still use the regular prefix.
115 113  
116 114 In addition, if you use an unusual directory layout you can give
117 115 options like `--bindir=DIR' to specify different values for particular
... ... @@ -159,7 +157,7 @@ where SYSTEM can have one of these forms:
159 157 need to know the machine type.
160 158  
161 159 If you are _building_ compiler tools for cross-compiling, you should
162   -use the `--target=TYPE' option to select the type of system they will
  160 +use the option `--target=TYPE' to select the type of system they will
163 161 produce code for.
164 162  
165 163 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:
189 187  
190 188 ./configure CC=/usr/local2/bin/gcc
191 189  
192   -will cause the specified gcc to be used as the C compiler (unless it is
  190 +causes the specified `gcc' to be used as the C compiler (unless it is
193 191 overridden in the site shell script).
194 192  
  193 +Unfortunately, this technique does not work for `CONFIG_SHELL' due to
  194 +an Autoconf bug. Until the bug is fixed you can use this workaround:
  195 +
  196 + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
  197 +
195 198 `configure' Invocation
196 199 ======================
197 200  
... ...
autogen.sh
1 1 #!/bin/sh
2   -# Run this to generate all the initial makefiles, etc.
  2 +#
  3 +# autogen.sh glue for hplip
  4 +#
  5 +# HPLIP used to have five or so different autotools trees. Upstream
  6 +# has reduced it to two. Still, this script is capable of cleaning
  7 +# just about any possible mess of autoconf files.
  8 +#
  9 +# BE CAREFUL with trees that are not completely automake-generated,
  10 +# this script deletes all Makefile.in files it can find.
  11 +#
  12 +# Requires: automake 1.9, autoconf 2.57+
  13 +# Conflicts: autoconf 2.13
  14 +set -e
3 15  
4   -srcdir=`dirname $0`
5   -test -z "$srcdir" && srcdir=.
6   -ORIGDIR=`pwd`
7   -cd $srcdir
  16 +# Refresh GNU autotools toolchain.
  17 +echo Cleaning autotools files...
  18 +find -type d -name autom4te.cache -print0 | xargs -0 rm -rf \;
  19 +find -type f \( -name missing -o -name install-sh -o -name mkinstalldirs \
  20 + -o -name depcomp -o -name ltmain.sh -o -name configure \
  21 + -o -name config.sub -o -name config.guess \
  22 + -o -name Makefile.in \) -print0 | xargs -0 rm -f
8 23  
9   -PROJECT=libmodbus
  24 +echo Running autoreconf...
  25 +autoreconf --force --install
10 26  
11   -DIE=0
  27 +# For the Debian package build
  28 +test -d debian && {
  29 + # link these in Debian builds
  30 + rm -f config.sub config.guess
  31 + ln -s /usr/share/misc/config.sub .
  32 + ln -s /usr/share/misc/config.guess .
12 33  
13   -have_libtool=false
14   -if libtoolize --version < /dev/null > /dev/null 2>&1 ; then
15   - libtool_version=`libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
16   - case $libtool_version in
17   - 1.4*|1.5*)
18   - have_libtool=true
19   - ;;
20   - esac
21   -fi
22   -if $have_libtool ; then : ; else
23   - echo
24   - echo "You must have libtool 1.4 installed to compile $PROJECT."
25   - echo "Install the appropriate package for your distribution,"
26   - echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/"
27   - DIE=1
28   -fi
  34 + # refresh list of executable scripts, to avoid possible breakage if
  35 + # upstream tarball does not include the file or if it is mispackaged
  36 + # for whatever reason.
  37 + [ "$1" == "updateexec" ] && {
  38 + echo Generating list of executable files...
  39 + rm -f debian/executable.files
  40 + find -type f -perm +111 ! -name '.*' -fprint debian/executable.files
  41 + }
29 42  
30   -(autoconf --version) < /dev/null > /dev/null 2>&1 || {
31   - echo
32   - echo "You must have autoconf installed to compile $PROJECT."
33   - echo "Install the appropriate package for your distribution,"
34   - echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
35   - DIE=1
  43 + # Remove any files in upstream tarball that we don't have in the Debian
  44 + # package (because diff cannot remove files)
  45 + version=`dpkg-parsechangelog | awk '/Version:/ { print $2 }' | sed -e 's/-[^-]\+$//'`
  46 + source=`dpkg-parsechangelog | awk '/Source:/ { print $2 }' | tr -d ' '`
  47 + if test -r ../${source}_${version}.orig.tar.gz ; then
  48 + echo Generating list of files that should be removed...
  49 + rm -f debian/deletable.files
  50 + touch debian/deletable.files
  51 + [ -e debian/tmp ] && rm -rf debian/tmp
  52 + mkdir debian/tmp
  53 + ( cd debian/tmp ; tar -zxf ../../../${source}_${version}.orig.tar.gz )
  54 + find debian/tmp/ -type f ! -name '.*' -print0 | xargs -0 -ri echo '{}' | \
  55 + while read -r i ; do
  56 + if test -e "${i}" ; then
  57 + filename=$(echo "${i}" | sed -e 's#.*debian/tmp/[^/]\+/##')
  58 + test -e "${filename}" || echo "${filename}" >>debian/deletable.files
  59 + fi
  60 + done
  61 + rm -fr debian/tmp
  62 + else
  63 + echo Emptying list of files that should be deleted...
  64 + rm -f debian/deletable.files
  65 + touch debian/deletable.files
  66 + fi
36 67 }
37 68  
38   -if automake-1.7 --version < /dev/null > /dev/null 2>&1 ; then
39   - AUTOMAKE=automake-1.7
40   - ACLOCAL=aclocal-1.7
41   -else
42   - echo
43   - echo "You must have automake 1.7.x installed to compile $PROJECT."
44   - echo "Install the appropriate package for your distribution,"
45   - echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
46   - DIE=1
47   -fi
48   -
49   -if test "$DIE" -eq 1; then
50   - exit 1
51   -fi
52   -
53   -if test -z "$AUTOGEN_SUBDIR_MODE"; then
54   - if test -z "$*"; then
55   - echo "I am going to run ./configure with no arguments - if you wish "
56   - echo "to pass any to it, please specify them on the $0 command line."
57   - fi
58   -fi
59   -
60   -$ACLOCAL $ACLOCAL_FLAGS || exit 1
61   -libtoolize --force || exit 1
62   -$AUTOMAKE --add-missing || exit 1
63   -autoconf || exit 1
64   -cd $ORIGDIR
65   -
66   -if test -z "$AUTOGEN_SUBDIR_MODE"; then
67   - $srcdir/configure --enable-maintainer-mode "$@"
68   -
69   - echo
70   - echo "Now type 'make' to compile $PROJECT."
71   -fi
  69 +exit 0
... ...