Initialize Tizen 2.3
[framework/base/gconf-dbus.git] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4 srcdir=`dirname $0`
5 test -z "$srcdir" && srcdir=.
6
7 ORIGDIR=`pwd`
8 cd $srcdir
9 PROJECT="GConf D-Bus"
10 TEST_TYPE=-f
11 FILE=gconf/gconf.h
12
13 DIE=0
14
15 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
16         echo
17         echo "You must have autoconf installed to compile $PROJECT."
18         echo "Download the appropriate package for your distribution,"
19         echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
20         DIE=1
21 }
22
23 AUTOMAKE=automake-1.7
24 ACLOCAL=aclocal-1.7
25
26 ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
27         AUTOMAKE=automake
28         ACLOCAL=aclocal
29 }
30
31 ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
32         echo
33         echo "You must have $AUTOMAKE installed to compile $PROJECT."
34         echo "Download the appropriate package for your distribution,"
35         echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
36         DIE=1
37 }
38
39 (grep "^AM_PROG_LIBTOOL" configure.in >/dev/null) && {
40   (libtool --version) < /dev/null > /dev/null 2>&1 || {
41     echo
42     echo "**Error**: You must have \`libtool' installed to compile $PROJECT."
43     echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
44     echo "(or a newer version if it is available)"
45     DIE=1
46   }
47 }
48
49 grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null && {
50   grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
51   (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
52     echo
53     echo "**Error**: You must have \`glib' installed to compile $PROJECT."
54     DIE=1
55   }
56 }
57
58 (grep "^GTK_DOC_CHECK" configure.in >/dev/null) && {
59   (gtkdocize --version) < /dev/null > /dev/null 2>&1 || {
60     echo
61     echo "**Error**: You must have \`gtk-doc' installed to compile $PROJECT."
62     DIE=1
63   }
64 }
65
66 if test "$DIE" -eq 1; then
67         exit 1
68 fi
69
70 test $TEST_TYPE $FILE || {
71         echo "You must run this script in the top-level $PROJECT directory"
72         exit 1
73 }
74
75 if test -z "$*"; then
76         echo "I am going to run ./configure with no arguments - if you wish "
77         echo "to pass any to it, please specify them on the $0 command line."
78 fi
79
80 case $CC in
81 *xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
82 esac
83
84 for coin in ./configure.in
85 do 
86   dr=`dirname $coin`
87   if test -f $dr/NO-AUTO-GEN; then
88     echo skipping $dr -- flagged as no auto-gen
89   else
90     echo processing $dr
91     macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
92     ( cd $dr
93       aclocalinclude="$ACLOCAL_FLAGS"
94       for k in $macrodirs; do
95         if test -d $k; then
96           aclocalinclude="$aclocalinclude -I $k"
97         ##else 
98         ##  echo "**Warning**: No such directory \`$k'.  Ignored."
99         fi
100       done
101       if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
102         if grep "sed.*POTFILES" configure.in >/dev/null; then
103           : do nothing -- we still have an old unmodified configure.in
104         else
105           echo "Creating $dr/aclocal.m4 ..."
106           test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
107           echo "Running gettextize...  Ignore non-fatal messages."
108           echo "no" | gettextize --force --copy
109           echo "Making $dr/aclocal.m4 writable ..."
110           test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
111         fi
112       fi
113       if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
114         echo "Creating $dr/aclocal.m4 ..."
115         test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
116         echo "Running gettextize...  Ignore non-fatal messages."
117         echo "no" | gettextize --force --copy
118         echo "Making $dr/aclocal.m4 writable ..."
119         test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
120       fi
121       if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then
122         echo "Creating $dr/aclocal.m4 ..."
123         test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
124         echo "Running gettextize...  Ignore non-fatal messages."
125         echo "no" | glib-gettextize --force --copy
126         echo "Making $dr/aclocal.m4 writable ..."
127         test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
128       fi
129       if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
130         echo "Running libtoolize..."
131         libtoolize --force --copy
132       fi
133       if grep "^GTK_DOC_CHECK" configure.in >/dev/null; then
134         echo "Running gtkdocize..."
135         gtkdocize
136       fi
137       if grep "^IT_PROG_INTLTOOL" configure.in >/dev/null; then
138         echo "Running intltoolize..."
139         intltoolize --force --copy
140       fi
141       echo "Running $ACLOCAL $aclocalinclude ..."
142       $ACLOCAL $aclocalinclude
143       if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
144         echo "Running autoheader..."
145         autoheader
146       fi
147       echo "Running $AUTOMAKE --gnu $am_opt ..."
148       $AUTOMAKE --add-missing --gnu $am_opt
149       echo "Running autoconf ..."
150       autoconf
151     )
152   fi
153 done
154
155 conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
156
157 cd "$ORIGDIR"
158
159 if test x$NOCONFIGURE = x; then
160   echo Running $srcdir/configure $conf_flags "$@" ...
161   $srcdir/configure $conf_flags "$@" \
162   && echo Now type \`make\' to compile $PROJECT  || exit 1
163 else
164   echo Skipping configure process.
165 fi