PageRenderTime 29ms CodeModel.GetById 20ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/autogen.sh

http://libgdom3.googlecode.com/
Shell | 163 lines | 143 code | 16 blank | 4 comment | 24 complexity | 5a70d1bb2e7697981924154422ae0118 MD5 | raw file
  1#!/bin/sh
  2# Run this to generate all the initial makefiles, etc.
  3
  4#NOCONFIGURE=yes 
  5USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh
  6
  7exit;
  8srcdir=`dirname $0`
  9test -z "$srcdir" && srcdir=.
 10
 11DIE=0
 12
 13if [ -n "$GNOME2_DIR" ]; then
 14	ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS"
 15	LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH"
 16	PATH="$GNOME2_DIR/bin:$PATH"
 17	export PATH
 18	export LD_LIBRARY_PATH
 19fi
 20
 21(test -f $srcdir/configure.ac) || {
 22    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
 23    echo " top-level package directory"
 24    exit 1
 25}
 26
 27(autoconf --version) < /dev/null > /dev/null 2>&1 || {
 28  echo
 29  echo "**Error**: You must have \`autoconf' installed."
 30  echo "Download the appropriate package for your distribution,"
 31  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
 32  DIE=1
 33}
 34
 35(grep "^IT_PROG_INTLTOOL" $srcdir/configure.ac >/dev/null) && {
 36  (intltoolize --version) < /dev/null > /dev/null 2>&1 || {
 37    echo 
 38    echo "**Error**: You must have \`intltool' installed."
 39    echo "You can get it from:"
 40    echo "  ftp://ftp.gnome.org/pub/GNOME/"
 41    DIE=1
 42  }
 43}
 44
 45(grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.ac >/dev/null) && {
 46  (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || {
 47    echo
 48    echo "**Error**: You must have \`xml-i18n-toolize' installed."
 49    echo "You can get it from:"
 50    echo "  ftp://ftp.gnome.org/pub/GNOME/"
 51    DIE=1
 52  }
 53}
 54
 55(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
 56  (libtool --version) < /dev/null > /dev/null 2>&1 || {
 57    echo
 58    echo "**Error**: You must have \`libtool' installed."
 59    echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
 60    DIE=1
 61  }
 62}
 63
 64(grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.ac >/dev/null) && {
 65  (grep "sed.*POTFILES" $srcdir/configure.ac) > /dev/null || \
 66  (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
 67    echo
 68    echo "**Error**: You must have \`glib' installed."
 69    echo "You can get it from: ftp://ftp.gtk.org/pub/gtk"
 70    DIE=1
 71  }
 72}
 73
 74(automake --version) < /dev/null > /dev/null 2>&1 || {
 75  echo
 76  echo "**Error**: You must have \`automake' installed."
 77  echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
 78  DIE=1
 79  NO_AUTOMAKE=yes
 80}
 81
 82
 83# if no automake, don't bother testing for aclocal
 84test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
 85  echo
 86  echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
 87  echo "installed doesn't appear recent enough."
 88  echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
 89  DIE=1
 90}
 91
 92if test "$DIE" -eq 1; then
 93  exit 1
 94fi
 95
 96if test -z "$*"; then
 97  echo "**Warning**: I am going to run \`configure' with no arguments."
 98  echo "If you wish to pass any to it, please specify them on the"
 99  echo \`$0\'" command line."
100  echo
101fi
102
103case $CC in
104xlc )
105  am_opt=--include-deps;;
106esac
107
108for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.ac -print`
109do 
110  dr=`dirname $coin`
111  if test -f $dr/NO-AUTO-GEN; then
112    echo skipping $dr -- flagged as no auto-gen
113  else
114    echo processing $dr
115    ( cd $dr
116
117      aclocalinclude="$ACLOCAL_FLAGS"
118
119      if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then
120	echo "Creating $dr/aclocal.m4 ..."
121	test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
122	echo "Running glib-gettextize...  Ignore non-fatal messages."
123	echo "no" | glib-gettextize --force --copy
124	echo "Making $dr/aclocal.m4 writable ..."
125	test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
126      fi
127      if grep "^IT_PROG_INTLTOOL" configure.ac >/dev/null; then
128        echo "Running intltoolize..."
129	intltoolize --copy --force --automake
130      fi
131      if grep "^AM_PROG_XML_I18N_TOOLS" configure.ac >/dev/null; then
132        echo "Running xml-i18n-toolize..."
133	xml-i18n-toolize --copy --force --automake
134      fi
135      if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
136	if test -z "$NO_LIBTOOLIZE" ; then 
137	  echo "Running libtoolize..."
138	  libtoolize --force --copy
139	fi
140      fi
141      echo "Running aclocal $aclocalinclude ..."
142      aclocal $aclocalinclude
143      if grep "^AM_CONFIG_HEADER" configure.ac >/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
153done
154
155conf_flags="--enable-maintainer-mode"
156
157if test x$NOCONFIGURE = x; then
158  echo Running $srcdir/configure $conf_flags "$@" ...
159  $srcdir/configure $conf_flags "$@" \
160  && echo Now type \`make\' to compile. || exit 1
161else
162  echo Skipping configure process.
163fi