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