Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not valgrind dict_crash, it's ways too big (and it's clean when dict_usage is)
[simgrid.git] / bootstrap.old
1 #!/bin/sh -e
2 # Run this to generate all the initial makefiles, etc.
3
4 ######
5 ###### Some defs
6 ######
7
8 PKG_NAME="GRAS"
9 # a list of all dirs containing possibly some macros
10 acmacrodirs="${HOME}/share/aclocal ${PWD}/acmacro /usr/share/aclocal/gnome2-macros"
11
12 amver=1.8
13
14 ######
15 ###### End of conf part
16 ######
17 for dir in $acmacrodirs ; do
18    if test -d $dir ; then
19        aclocalinclude="$aclocalinclude -I $dir";
20    fi
21 done
22
23 srcdir=`dirname $0`
24 test -z "$srcdir" && srcdir=.
25
26 echo "Autoregenerate package \`$PKG_NAME' in directory \`$srcdir'";
27
28 (test -f $srcdir/configure.ac \
29   && test -f $srcdir/src/include/gras.h) || {
30     echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
31     echo " top-level $PKG_NAME directory"
32     exit 1
33 }
34
35 ######
36 ###### Some tests (borrowed from macros/autogen.sh from achtung)
37 ######
38 # Changlog : 
39 # 27/5/00: Changed "to compile gnome" to "to compile $PKG_NAME"
40 # 27/5/00: removed gettext
41
42 DIE=0
43
44 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
45   echo
46   echo "**Error**: You must have \`autoconf' installed to compile $PKG_NAME."
47   echo "Download the appropriate package for your distribution,"
48   echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
49   DIE=1
50 }
51
52 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
53   (libtool --version) < /dev/null > /dev/null 2>&1 || {
54     echo
55     echo "**Error**: You must have \`libtool' installed to compile $PKG_NAME."
56     echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.4.tar.gz"
57     echo "(or a newer version if it is available)"
58     DIE=1
59   }
60 }
61
62 (automake-$amver --version) < /dev/null > /dev/null 2>&1 || {
63   echo
64   echo "**Error**: You must have \`automake' $amver installed to compile $PKG_NAME."
65   echo "Get ftp://ftp.gnu.org/pub/gnu/automake-amver.tar.gz"
66   echo "(or a newer version if it is available)"
67   DIE=1
68   NO_AUTOMAKE=yes
69 }
70
71 # if no automake, don't bother testing for aclocal
72 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
73   echo
74   echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
75   echo "installed doesn't appear recent enough."
76   echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
77   echo "(or a newer version if it is available)"
78   DIE=1
79 }
80
81 if test "$DIE" -eq 1; then
82   exit 1
83 fi
84
85 ###### END of test part
86
87
88 ######
89 ###### Action part
90 ######
91
92
93 if test -z "$*"; then
94   if test -e aci.conf ; then
95     source aci.conf
96     echo "**Warning**: I am going to run \`configure' with arguments resulting from aci_configurator execution."
97     echo "ie, $configure_args."
98     echo "If you wish to pass other ones, please specify them on the"
99     echo \`$0\'" command line, or rerun aci_configurator and save the new ones."
100     echo
101   else
102     configure_args="--enable-maintainer-mode --enable-gtk-doc"
103     echo "**Warning**: I am going to run \`configure' with no arguments."
104     echo "If you wish to pass any to it, please specify them on the"
105     echo \`$0\'" command line."
106     echo
107   fi
108 else
109   configure_args="$@"
110 fi
111
112 case $CC in
113 xlc )
114   am_opt=--include-deps;;
115 esac
116
117 #for coin in  `find $srcdir -name configure.ac -print `\
118 #             `find $srcdir -name configure.in -print`
119 for coin in  `ls $srcdir/configure.ac $srcdir/configure.in 2>/dev/null`
120 do 
121   dr=`dirname $coin`
122   if test -f $dr/NO-AUTO-GEN; then
123     echo skipping $dr -- flagged as no auto-gen
124   else
125     echo "************"
126     echo "* Processing directory $dr"
127     echo "************"
128
129     if [ -e $dr/configure.in ] ; then
130        configfile="configure.in"
131     else 
132        configfile="configure.ac"
133     fi
134     macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
135     here=`pwd`
136     cd $dr
137     if grep "^AM_PROG_LIBTOOL" $configfile >/dev/null; then
138       if test -z "$NO_LIBTOOLIZE" ; then 
139         echo "Running libtoolize --force --copy in "`pwd`"..."
140         libtoolize --force --copy || exit 1
141       fi
142     fi
143     echo "Running aclocal-$amver $aclocalinclude..."
144     aclocal-$amver $aclocalinclude 
145     if grep "^AM_CONFIG_HEADER" $configfile >/dev/null; then
146       echo "Running autoheader in "`pwd`"..."
147       autoheader || exit 1
148     else if grep "^AC_CONFIG_HEADERS" $configfile >/dev/null; then
149       echo "Running autoheader in "`pwd`"..."
150       autoheader || exit 1
151     fi fi
152     if grep "^AM_INIT_AUTOMAKE" $configfile >/dev/null; then
153       echo "Running automake-$amver --gnu --add-missing $am_opt ..."
154       automake-$amver --gnu --add-missing $am_opt || exit 1
155     fi
156     echo "Running autoconf..."
157     autoconf || exit 1
158     cd $here
159   fi
160 done
161
162 #conf_flags="--enable-compile-warnings"
163 #  \
164 #--enable-compile-warnings=minimum"
165 #--enable-iso-c
166
167 #echo "rebuilding the api documentation... "
168 #cd docs && ./refresh-api "  "&& echo "Done with the rebuilding of the api documentation." && cd .. || exit 1
169
170
171 if test x$NOCONFIGURE = x; then
172   echo "************"
173   echo "* Running ./configure $configure_args..."
174   echo "************"
175   
176   ./configure $configure_args || exit 1
177
178 else
179   echo Skipping configure process.
180 fi
181
182 echo Now type \`make\' to compile $PKG_NAME
183
184