src/main.c: Make it possible to pass options to the app under test
[memprof.git] / autogen.sh
blob4d4afe759519fd3268e603a223c3287f77cc7479
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
4 srcdir=`pwd`
5 DIE=0
7 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
8 echo
9 echo "**Error**: You must have \`autoconf' installed to compile memprof."
10 echo "Download the appropriate package for your distribution,"
11 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
12 DIE=1
15 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
16 (libtool --version) < /dev/null > /dev/null 2>&1 || {
17 echo
18 echo "**Error**: You must have \`libtool' installed to compile memprof."
19 echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2.tar.gz"
20 echo "(or a newer version if it is available)"
21 DIE=1
25 grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
26 grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
27 (gettext --version) < /dev/null > /dev/null 2>&1 || {
28 echo
29 echo "**Error**: You must have \`gettext' installed to compile memprof."
30 echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
31 echo "(or a newer version if it is available)"
32 DIE=1
36 (automake --version) < /dev/null > /dev/null 2>&1 || {
37 echo
38 echo "**Error**: You must have \`automake' installed to compile memprof."
39 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
40 echo "(or a newer version if it is available)"
41 DIE=1
42 NO_AUTOMAKE=yes
46 # if no automake, don't bother testing for aclocal
47 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
48 echo
49 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
50 echo "installed doesn't appear recent enough."
51 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
52 echo "(or a newer version if it is available)"
53 DIE=1
56 if test "$DIE" -eq 1; then
57 exit 1
60 if test -z "$*"; then
61 echo "**Warning**: I am going to run \`configure' with no arguments."
62 echo "If you wish to pass any to it, please specify them on the"
63 echo \`$0\'" command line."
64 echo
67 case $CC in
68 xlc )
69 am_opt=--include-deps;;
70 esac
72 for coin in `find $srcdir -name configure.in -print`
73 do
74 dr=`dirname $coin`
75 if test -f $dr/NO-AUTO-GEN; then
76 echo skipping $dr -- flagged as no auto-gen
77 else
78 echo processing $dr
79 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
80 ( cd $dr
81 aclocalinclude="$ACLOCAL_FLAGS"
82 for k in $macrodirs; do
83 if test -d $k; then
84 aclocalinclude="$aclocalinclude -I $k"
85 ##else
86 ## echo "**Warning**: No such directory \`$k'. Ignored."
88 done
89 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
90 if grep "sed.*POTFILES" configure.in >/dev/null; then
91 : do nothing -- we still have an old unmodified configure.in
92 else
93 echo "Creating $dr/aclocal.m4 ..."
94 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
95 echo "Running gettextize... Ignore non-fatal messages."
96 echo "no" | gettextize --force --copy
97 echo "Making $dr/aclocal.m4 writable ..."
98 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
101 if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
102 echo "Creating $dr/aclocal.m4 ..."
103 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
104 echo "Running gettextize... Ignore non-fatal messages."
105 echo "no" | gettextize --force --copy
106 echo "Making $dr/aclocal.m4 writable ..."
107 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
109 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
110 echo "Running libtoolize..."
111 libtoolize --force --copy
113 if grep "^AC_PROG_INTLTOOL" configure.in > /dev/null; then
114 echo "running intltoolize..."
115 intltoolize
117 echo "Running aclocal $aclocalinclude ..."
118 aclocal $aclocalinclude
119 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
120 echo "Running autoheader..."
121 autoheader
123 echo "Running automake --gnu $am_opt ..."
124 automake --add-missing --gnu $am_opt
125 echo "Running autoconf ..."
126 autoconf
129 done
131 conf_flags="--enable-maintainer-mode" # --enable-compile-warnings --enable-iso-c"
133 if test x$NOCONFIGURE = x; then
134 echo Running $srcdir/configure $conf_flags "$@" ...
135 $srcdir/configure $conf_flags "$@" \
136 && echo Now type \`make\' to compile $PKG_NAME
137 else
138 echo Skipping configure process.