2 # Run this to generate all the initial makefiles, etc.
4 # This file came from glade-2.0.0 with modifications for gEDA/gaf.
5 # Ales Hvezda 11/09/2003
8 test -z "$srcdir" && srcdir
=.
9 configure_script
=configure.ac.
in
11 # If "recreate_configure_only" is specified on the command line as the first
12 # argument, then enter a special mode to rebuild configure only. If we add
13 # arguments to this script, then this has to be made a bit more intelligent.
14 if test "$1" = "recreate_configure_only"; then
15 recreate_configure_only
=1
17 recreate_configure_only
=0
20 # Automake required version
25 # Possible names for libtool/libtoolize
26 libtoolize_candidates
="libtoolize glibtoolize"
30 (test -f $srcdir/$configure_script) ||
{
31 echo -n "**Error**: Directory [ $srcdir ] does not look like the"
32 echo " top-level package directory"
36 (autoconf
--version) < /dev
/null
> /dev
/null
2>&1 ||
{
38 echo "**Error**: You must have \`autoconf' installed."
39 echo "Download the appropriate package for your distribution,"
40 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
44 (grep "^AM_PROG_LIBTOOL" $srcdir/$configure_script >/dev
/null
) && {
45 LIBTOOLIZE
=`which $libtoolize_candidates 2>/dev/null | head -n1`
46 (! test -z "$LIBTOOLIZE") ||
{
48 echo "**Error**: You must have \`libtool' installed."
49 echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
54 (grep "^AM_GNU_GETTEXT" $srcdir/$configure_script >/dev
/null
) && {
55 (grep "sed.*POTFILES" $srcdir/$configure_script) > /dev
/null || \
56 (autopoint
--version) < /dev
/null
> /dev
/null
2>&1 ||
{
58 echo "**Error**: You must have \`gettext' installed."
59 echo "You can get it from: http://www.gnu.org/software/gettext"
64 (automake
--version) < /dev
/null
> /dev
/null
2>&1 ||
{
66 echo "**Error**: You must have \`automake' installed."
67 echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
72 # check automake version. Test came from gpsd version 2.34. cnieves 2007-02-10
73 if [ -z "$NO_AUTOMAKE" ]; then
74 AM_VERSION
=`automake --version | sed -n -e 's#[^0-9]* \([0-9]*\)\.\([0-9]*\)\.*\([0-9]*\).*$#\1 \2 \3#p'`
75 AM_V1
=`echo $AM_VERSION | awk '{print $1}'`
76 AM_V2
=`echo $AM_VERSION | awk '{print $2}'`
77 AM_V3
=`echo $AM_VERSION | awk '{print $3}'`
79 if [ "$AM_1" -gt "$AM_V1" ]; then
82 if [ "$AM_1" -eq "$AM_V1" ]; then
83 if [ "$AM_2" -gt "$AM_V2" ]; then
86 if [ "$AM_2" -eq "$AM_V2" ]; then
87 if [ -n "$AM_V3" -a "$AM_3" -gt "$AM_V3" ]; then
95 if [ -n "$AM_ERROR" ]; then
97 echo "**Error**: Found automake version $AM_V1.$AM_V2.$AM_V3"
98 echo "You must have \`automake' version $AM_1.$AM_2.$AM_3 or greater installed."
99 echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
106 # if no automake, don't bother testing for aclocal
107 test -n "$NO_AUTOMAKE" ||
(aclocal
--version) < /dev
/null
> /dev
/null
2>&1 ||
{
109 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
110 echo "installed doesn't appear recent enough."
111 echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
115 if test "$DIE" -eq 1; then
119 # Don't run configure automatically.
120 #if test -z "$*"; then
121 # echo "**Warning**: I am going to run \`configure' with no arguments."
122 # echo "If you wish to pass any to it, please specify them on the"
123 # echo \`$0\'" command line."
129 am_opt
=--include-deps;;
132 # Create the configure.ac from the configure.ac.in file.
133 # The below line to get the gettext version isn't the most robust construct
134 # because if gettext changes its version output format, this will break.
135 echo autogen.sh creating configure.ac
136 installed_gettext_version
=`gettext --version | grep gettext | awk '{print $4}'`
137 cat $configure_script | \
138 sed "s/%INSTALLED_GETTEXT_VERSION%/$installed_gettext_version/" > configure.ac
139 configure_script
=configure.ac
141 for coin
in $srcdir/$configure_script
144 if test -f $dr/NO-AUTO-GEN
; then
145 echo skipping
$dr -- flagged as no auto-gen
150 aclocalinclude
="$ACLOCAL_FLAGS"
152 if test "$recreate_configure_only" = "0"; then
153 # Only run these if we are NOT in the recreate_configure_only mode
154 if grep "^AM_GNU_GETTEXT" $configure_script >/dev
/null
; then
155 echo "autogen.sh running: autopoint ..."
156 echo "no" | autopoint
--force
158 if grep "^IT_PROG_INTLTOOL" $configure_script >/dev
/null
; then
159 echo "autogen.sh running: intltoolize ..."
160 echo "no" | intltoolize
--force --copy --automake
162 if grep "^AM_PROG_LIBTOOL" $configure_script >/dev
/null
; then
163 echo "autogen.sh running: libtoolize ..."
164 $LIBTOOLIZE --force --copy
168 echo "autogen.sh running: aclocal $aclocalinclude ..."
169 aclocal
$aclocalinclude
171 if test ! "$status" = 0; then
172 echo autogen.sh exiting...
176 if grep "^AM_CONFIG_HEADER" $configure_script >/dev
/null
; then
177 echo "autogen.sh running: autoheader ..."
181 if test "$recreate_configure_only" = "0"; then
182 # Only run these if we are NOT in the recreate_configure_only mode
183 echo "autogen.sh running: automake $am_opt ..."
184 automake
--copy --add-missing --gnu $am_opt
187 echo "autogen.sh running: autoconf ..."
194 # Don't run configure.
195 #conf_flags="--enable-maintainer-mode"
197 #if test x$NOCONFIGURE = x; then
198 # echo Running $srcdir/configure $conf_flags "$@" ...
199 # $srcdir/configure $conf_flags "$@" \
200 # && echo Now type \`make\' to compile. || exit 1
202 # echo Skipping configure process.