]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - autogen.sh
Stop passing arguments to dh_installinit
[mirror_smartmontools-debian.git] / autogen.sh
CommitLineData
832b75ed 1#!/bin/sh
6b80b4d2 2# $Id: autogen.sh 4115 2015-07-15 20:52:26Z chrfranke $
832b75ed 3#
6b80b4d2 4# Generate ./configure from configure.ac and Makefile.in from Makefile.am.
832b75ed 5# This also adds files like missing,depcomp,install-sh to the source
a37e7145 6# directory. To update these files at a later date use:
832b75ed
GG
7# autoreconf -f -i -v
8
d2e702cf
GI
9force=; warnings=
10while [ $# -gt 0 ]; do case $1 in
11 --force) force=$1; shift ;;
12 --warnings=?*) warnings="${warnings} $1"; shift ;;
13 *) echo "Usage: $0 [--force] [--warnings=CATEGORY ...]"; exit 1 ;;
14esac; done
832b75ed
GG
15
16# Cygwin?
17test -x /usr/bin/uname && /usr/bin/uname | grep -i CYGWIN >/dev/null &&
18{
832b75ed
GG
19 # Check for Unix text file type
20 echo > dostest.tmp
21 test "`wc -c < dostest.tmp`" -eq 1 ||
22 echo "Warning: DOS text file type set, 'make dist' and related targets will not work."
23 rm -f dostest.tmp
24}
25
6b80b4d2
JD
26# Find automake
27if [ -n "$AUTOMAKE" ]; then
28 ver=$("$AUTOMAKE" --version) || exit 1
29else
30 maxver=
31 for v in 1.15 1.14 1.13 1.12 1.11 1.10; do
32 minver=$v; test -n "$maxver" || maxver=$v
33 ver=$(automake-$v --version 2>/dev/null) || continue
34 AUTOMAKE="automake-$v"
35 break
36 done
37 if [ -z "$AUTOMAKE" ]; then
38 echo "GNU Automake $minver (up to $maxver) is required to bootstrap smartmontools from SVN."
39 exit 1;
40 fi
41fi
832b75ed 42
6b80b4d2
JD
43ver=$(echo "$ver" | sed -n '1s,^.*[^.0-9]\([12]\.[0-9][-.0-9pl]*\).*$,\1,p')
44if [ -z "$ver" ]; then
45 echo "$AUTOMAKE: Unable to determine automake version."
46 exit 1
47fi
832b75ed 48
6b80b4d2
JD
49# Check aclocal
50if [ -z "$ACLOCAL" ]; then
51 ACLOCAL="aclocal$(echo "$AUTOMAKE" | sed -n 's,^.*automake\(-[.0-9]*\),\1,p')"
52fi
832b75ed 53
6b80b4d2 54"$ACLOCAL" --version >/dev/null || exit 1
832b75ed 55
6b80b4d2 56# Warn if Automake version was not tested
d2e702cf 57amwarnings=$warnings
2127e193 58case "$ver" in
6b80b4d2 59 1.10|1.10.[123]|1.11|1.11.[1-6]|1.12.[2-6]|1.13.[34])
2127e193
GI
60 # OK
61 ;;
62
293b5ab8 63 1.14|1.14.1|1.15)
d2e702cf
GI
64 # TODO: Enable 'subdir-objects' in configure.ac
65 # For now, suppress 'subdir-objects' forward-incompatibility warning
66 test -n "$warnings" || amwarnings="--warnings=no-unsupported"
67 ;;
68
2127e193
GI
69 *)
70 echo "Note: GNU Automake version ${ver} was not tested by the developers."
71 echo "Please report success/failure to the smartmontools-support mailing list."
72esac
832b75ed 73
6b80b4d2 74# required for aclocal-1.10 --install
d008864d 75test -d m4 || mkdir m4 || exit 1
d008864d 76
832b75ed
GG
77set -e # stops on error status
78
d2e702cf
GI
79test -z "$warnings" || set -x
80
6b80b4d2 81${ACLOCAL} -I m4 --install $force $warnings
d2e702cf
GI
82autoheader $force $warnings
83${AUTOMAKE} --add-missing --copy ${force:+--force-missing} $amwarnings
84autoconf $force $warnings