2 # Run this to generate all the initial makefiles, etc.
3 # This was lifted from the Gimp, and adapted slightly by
5 # Since then, it has been rewritten quite a lot by misc. people.
7 # Call this file with AUTOCONF_SUFFIX and AUTOMAKE_SUFFIX set
8 # if you want us to call a specific version of autoconf or automake.
9 # E.g. if you want us to call automake-1.6 instead of automake (which
10 # seems to be quite advisable if your automake is not already version
11 # 1.6) then call this file with AUTOMAKE_SUFFIX set to "-1.6".
13 # Cases which are known to work:
14 # 2002-07-14: Debian GNU/Linux unstable with:
16 # automake 1.4-p5 and 1.6 (both)
19 # 2002-07-14: Redhat Linux 7.3 with:
21 # automake 1.5 (not 1.4-p5)
27 test -z "$srcdir" && srcdir=.
28 test "$srcdir" = "." && srcdir=`pwd`
33 # syntax: do-something || fail
36 echo "Last command failed with status $status in directory $(pwd)."
41 (autoconf${AUTOCONF_SUFFIX} --version) < /dev/null > /dev/null 2>&1 || {
43 echo "You must have autoconf installed to compile $PROJECT."
44 echo "Download the appropriate package for your distribution,"
45 echo "or get the source tarball at ftp://ftp.gnu.org/gnu/autoconf/"
49 (libtool --version) < /dev/null > /dev/null 2>&1 || {
51 echo "You must have libtool installed to compile $PROJECT."
52 echo "Download the appropriate package for your distribution,"
53 echo "or get the source tarball at ftp://ftp.gnu.org/gnu/libtool/"
57 (automake${AUTOMAKE_SUFFIX} --version) < /dev/null > /dev/null 2>&1 || {
59 echo "You must have automake installed to compile $PROJECT."
60 echo "Download the appropriate package for your distribution,"
61 echo "or get the source tarball at ftp://ftp.gnu.org/gnu/automake/"
65 (gettextize --version) < /dev/null > /dev/null 2>&1 || {
67 echo "You must have gettext installed to compile $PROJECT."
68 echo "Download the appropriate package for your distribution,"
69 echo "or get the source tarball at ftp://ftp.gnu.org/gnu/gettext/"
73 if test "$DIE" -eq 1; then
77 test -f libexif/exif.c || {
78 echo "You must run this script in the top-level $PROJECT directory"
83 *xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
86 gettext_version=`gettextize --version 2>&1 | sed -n 's/^.*GNU gettext.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
87 case $gettext_version in
89 gettext_opt="$gettext_opt --intl";;
92 # do not change the sequence without understanding the implications
97 echo "Processing ${dir} aka $(pwd)"
99 # We explicitly delete files and directories which are not contained
100 # in the CVS repository and which are generated by the build tools
102 # This makes changing build tool versions much easier, and removes
103 # the need for any --force parameters to the build tools which may
104 # do something we do want or something we do not.
106 echo "Cleaning stuff generated by gettextize"
107 rm -f po/Makevars.template po/Makevars po/Makefile.in.in ABOUT-NLS
108 for file in codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 \
109 lcmessage.m4 progtest.m4
115 echo "Running gettextize --copy $gettext_opt"
116 gettextize --copy $gettext_opt || fail
117 if test -f po/Makevars.template
119 cp po/Makevars.template po/Makevars
122 case $gettext_version in
124 grep "intl/Makefile" configure.in > /dev/null ||
125 ( sed -e 's#^AC_OUTPUT(\[#AC_OUTPUT(\[ intl/Makefile po/Makefile.in#' \
126 configure.in >configure.in.new && mv configure.in.new configure.in )
129 echo "Cleaning stuff generated by libtoolize"
130 rm -f ltmain.sh config.guess config.sub
132 echo "Running libtoolize --copy"
133 libtoolize --copy || fail
135 echo "Cleaning stuff generated by aclocal"
138 echo "Running aclocal${AUTOMAKE_SUFFIX} $ACLOCAL_FLAGS"
139 aclocal${AUTOMAKE_SUFFIX} $ACLOCAL_FLAGS || fail
141 echo "Cleaning stuff generated by autoheader"
142 rm -f config.h.in libgphoto2/config.h.in
144 echo "Running autoheader${AUTOCONF_SUFFIX}"
145 autoheader${AUTOCONF_SUFFIX} || fail
147 echo "Cleaning stuff generated by automake"
148 find . -name '*.am' |
150 do # remove all .in files with a corresponding .am file
151 rm -f "$(sed s/\.am$/.in/g)"
153 rm -f depcomp install-sh missing mkinstalldirs
154 rm -f stamp-h* libgphoto2/stamp-h*
156 echo "Running automake${AUTOMAKE_SUFFIX} --add-missing --gnu $am_opt"
157 automake${AUTOMAKE_SUFFIX} --add-missing --gnu $am_opt || fail
159 echo "Cleaning stuff generated by autoconf"
161 rm -rf autom4te-*.cache/
163 echo "Running autoconf${AUTOCONF_SUFFIX}"
164 autoconf${AUTOCONF_SUFFIX} || fail
166 echo "Finished in directory $(pwd)"
171 echo "$PROJECT is now ready for configuration."