Added SILC Thread Queue API
[crypto.git] / apps / silcer / macros / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4 DIE=0
5
6 if [ -n "$GNOME2_PATH" ]; then
7         ACLOCAL_FLAGS="-I $GNOME2_PATH/share/aclocal $ACLOCAL_FLAGS"
8         PATH="$GNOME2_PATH/bin:$PATH"
9         export PATH
10 fi
11
12 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
13   echo
14   echo "**Error**: You must have \`autoconf' installed to compile Gnome."
15   echo "Download the appropriate package for your distribution,"
16   echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
17   DIE=1
18 }
19
20 (grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.in >/dev/null) && {
21   (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || {
22     echo 
23     echo "**Error**: You must have \`xml-i18n-toolize' installed to compile Gnome."
24     echo "Get ftp://ftp.gnome.org/pub/GNOME/stable/sources/xml-i18n-tools/xml-i18n-tools-0.6.tar.gz"
25     echo "(or a newer version if it is available)"
26     DIE=1
27   }
28 }
29
30 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
31   (libtool --version) < /dev/null > /dev/null 2>&1 || {
32     echo
33     echo "**Error**: You must have \`libtool' installed to compile Gnome."
34     echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
35     echo "(or a newer version if it is available)"
36     DIE=1
37   }
38 }
39
40 #grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
41 #  grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
42 #  (gettext --version) < /dev/null > /dev/null 2>&1 || {
43 #    echo
44 #    echo "**Error**: You must have \`gettext' installed to compile Gnome."
45 #    echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
46 #    echo "(or a newer version if it is available)"
47 #    DIE=1
48 #  }
49 #}
50
51 #grep "^AM_GNOME_GETTEXT" $srcdir/configure.in >/dev/null && {
52 #  grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
53 #  (gettext --version) < /dev/null > /dev/null 2>&1 || {
54 #    echo
55 #    echo "**Error**: You must have \`gettext' installed to compile Gnome."
56 #    echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
57 #    echo "(or a newer version if it is available)"
58 #    DIE=1
59 #  }
60 #}
61
62 (automake --version) < /dev/null > /dev/null 2>&1 || {
63   echo
64   echo "**Error**: You must have \`automake' installed to compile Gnome."
65   echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
66   echo "(or a newer version if it is available)"
67   DIE=1
68   NO_AUTOMAKE=yes
69 }
70
71
72 # if no automake, don't bother testing for aclocal
73 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
74   echo
75   echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
76   echo "installed doesn't appear recent enough."
77   echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
78   echo "(or a newer version if it is available)"
79   DIE=1
80 }
81
82 if test "$DIE" -eq 1; then
83   exit 1
84 fi
85
86 if test -z "$*"; then
87   echo "**Warning**: I am going to run \`configure' with no arguments."
88   echo "If you wish to pass any to it, please specify them on the"
89   echo \`$0\'" command line."
90   echo
91 fi
92
93 case $CC in
94 xlc )
95   am_opt=--include-deps;;
96 esac
97
98 for coin in `find $srcdir -name configure.in -print`
99 do 
100   dr=`dirname $coin`
101   if test -f $dr/NO-AUTO-GEN; then
102     echo skipping $dr -- flagged as no auto-gen
103   else
104     echo processing $dr
105     macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
106     ( cd $dr
107       macrosdir=`find . -name macros -print`
108       for i in $macrodirs; do
109         if test -f $i/gnome-gettext.m4; then
110           DELETEFILES="$DELETEFILES $i/gnome-gettext.m4"
111         fi
112       done
113
114       echo "deletefiles is $DELETEFILES"
115       aclocalinclude="$ACLOCAL_FLAGS"
116       for k in $aclocalinclude; do
117         if test -d $k; then
118           if [ -f $k/gnome.m4 -a "$GNOME_INTERFACE_VERSION" = "1" ]; then
119             rm -f $DELETEFILES
120           fi
121         fi
122       done
123       for k in $macrodirs; do
124         if test -d $k; then
125           aclocalinclude="$aclocalinclude -I $k"
126           if [ -f $k/gnome.m4 -a "$GNOME_INTERFACE_VERSION" = "1" ]; then
127             rm -f $DELETEFILES
128           fi
129         fi
130       done
131       if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
132         if grep "sed.*POTFILES" configure.in >/dev/null; then
133           : do nothing -- we still have an old unmodified configure.in
134         else
135           echo "Creating $dr/aclocal.m4 ..."
136           test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
137           echo "Running gettextize...  Ignore non-fatal messages."
138           echo "no" | gettextize --force --copy
139           echo "Making $dr/aclocal.m4 writable ..."
140           test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
141         fi
142       fi
143       if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
144         echo "Creating $dr/aclocal.m4 ..."
145         test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
146         echo "Running gettextize...  Ignore non-fatal messages."
147         echo "no" | gettextize --force --copy
148         echo "Making $dr/aclocal.m4 writable ..."
149         test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
150       fi
151       if grep "^AM_PROG_XML_I18N_TOOLS" configure.in >/dev/null; then
152         echo "Running xml-i18n-toolize... Ignore non-fatal messages."
153         xml-i18n-toolize --copy --force --automake
154       fi
155       if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
156         if test -z "$NO_LIBTOOLIZE" ; then 
157           echo "Running libtoolize..."
158           libtoolize --force --copy
159         fi
160       fi
161       echo "Running aclocal $aclocalinclude ..."
162       aclocal $aclocalinclude || {
163         echo
164         echo "**Error**: aclocal failed. This may mean that you have not"
165         echo "installed all of the packages you need, or you may need to"
166         echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
167         echo "for the prefix where you installed the packages whose"
168         echo "macros were not found"
169         exit 1
170       }
171
172       if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
173         echo "Running autoheader..."
174         autoheader || { echo "**Error**: autoheader failed."; exit 1; }
175       fi
176       echo "Running automake --gnu $am_opt ..."
177       automake --add-missing --gnu $am_opt ||
178         { echo "**Error**: automake failed."; exit 1; }
179       echo "Running autoconf ..."
180       autoconf || { echo "**Error**: autoconf failed."; exit 1; }
181     ) || exit 1
182   fi
183 done
184
185 conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
186
187 if test x$NOCONFIGURE = x; then
188   echo Running $srcdir/configure $conf_flags "$@" ...
189   $srcdir/configure $conf_flags "$@" \
190   && echo Now type \`make\' to compile $PKG_NAME || exit 1
191 else
192   echo Skipping configure process.
193 fi