Add the files.
[profile/ivi/pixman.git] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4 srcdir=`pwd`
5 DIE=0
6
7 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
8   echo
9   echo "**Error**: You must have \`autoconf' installed to compile GtkEditor."
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
13 }
14
15 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
16   (libtool --version) < /dev/null > /dev/null 2>&1 || {
17     echo
18     echo "**Error**: You must have \`libtool' installed to compile GtkEditor."
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
22   }
23 }
24
25 grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null && {
26   grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \
27   (gettext --version) < /dev/null > /dev/null 2>&1 || {
28     echo
29     echo "**Error**: You must have \`gettext' installed to compile GtkEditor."
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
33   }
34 }
35
36 (automake --version) < /dev/null > /dev/null 2>&1 || {
37   echo
38   echo "**Error**: You must have \`automake' installed to compile GtkEditor."
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
43 }
44
45
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
54 }
55
56 if test "$DIE" -eq 1; then
57   exit 1
58 fi
59
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
65 fi
66
67 case $CC in
68 xlc )
69   am_opt=--include-deps;;
70 esac
71
72 for coin in `find $srcdir -name configure.ac -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."
87         fi
88       done
89       if grep "^AM_GNU_GETTEXT" configure.ac >/dev/null; then
90         if grep "sed.*POTFILES" configure.ac >/dev/null; then
91           : do nothing -- we still have an old unmodified configure.ac
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
99         fi
100       fi
101       if grep "^AM_GNOME_GETTEXT" configure.ac >/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
108       fi
109       if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
110         echo "Running libtoolize..."
111         libtoolize --force --copy
112       fi
113       echo "Running aclocal $aclocalinclude ..."
114       aclocal $aclocalinclude
115       if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
116         echo "Running autoheader..."
117         autoheader
118       fi
119       echo "Running automake --gnu $am_opt ..."
120       automake --add-missing --gnu $am_opt
121       echo "Running autoconf ..."
122       autoconf
123     )
124   fi
125 done
126
127 conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
128
129 if test x$NOCONFIGURE = x; then
130   echo Running $srcdir/configure $conf_flags "$@" ...
131   $srcdir/configure $conf_flags "$@" \
132   && echo Now type \`make\' to compile $PKG_NAME
133 else
134   echo Skipping configure process.
135 fi