2010-08-24 08:03:44 -05:00
|
|
|
#!/bin/sh
|
|
|
|
# Run this to generate all the initial makefiles, etc.
|
|
|
|
|
|
|
|
if test "z$1" = "z--clean"; then
|
|
|
|
echo "Cleaning"
|
|
|
|
|
2010-10-04 10:05:05 -05:00
|
|
|
rm -Rf autom4te.cache
|
2010-08-24 08:03:44 -05:00
|
|
|
rm -f missing install-sh mkinstalldirs libtool ltmain.sh
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2010-11-30 22:08:49 -06:00
|
|
|
requote()
|
2010-08-24 08:03:44 -05:00
|
|
|
{
|
2010-11-28 23:07:09 -06:00
|
|
|
local q=\'
|
|
|
|
set -- "${@//\'/$q\'$q}" # quote inner instances of '
|
|
|
|
set -- "${@/#/$q}" # add ' to start of each param
|
|
|
|
set -- "${@/%/$q}" # add ' to end of each param
|
2010-12-01 12:03:56 -06:00
|
|
|
echo "$*" # ' in a comment to stop confusing vim
|
|
|
|
}
|
|
|
|
|
|
|
|
distro()
|
|
|
|
{
|
|
|
|
name=''
|
|
|
|
while test "$#" -gt 0 ; do
|
|
|
|
case "$1" in
|
|
|
|
--with-distro=*) name=${1#--with-distro=} ;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
echo $name
|
2010-08-24 08:03:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
old_args=""
|
2010-11-28 23:07:09 -06:00
|
|
|
if test $# -eq 0 && test -f autogen.lastrun; then
|
|
|
|
old_args=$(cat autogen.lastrun)
|
2010-08-24 08:03:44 -05:00
|
|
|
echo "re-using arguments from last configure: $old_args";
|
|
|
|
fi
|
|
|
|
|
|
|
|
touch ChangeLog
|
|
|
|
|
2010-11-27 09:03:38 -06:00
|
|
|
if test "z$ACLOCAL_FLAGS" = "z" -a "z`uname -s`" = "zDarwin" ; then
|
|
|
|
ACLOCAL_FLAGS="-I ./m4/mac"
|
|
|
|
fi
|
|
|
|
if test "z`uname -s`" != "zDarwin" ; then
|
|
|
|
AUTOMAKE_EXTRA_FLAGS=--warnings=no-portability
|
|
|
|
fi
|
|
|
|
|
2010-12-01 06:20:29 -06:00
|
|
|
conf_args=$(requote "$@")
|
2010-12-01 12:03:56 -06:00
|
|
|
distro_name=$(distro "$@")
|
2010-12-01 06:20:29 -06:00
|
|
|
if test "z${distro_name}" != "z" ; then
|
|
|
|
cumul=""
|
|
|
|
if test -f "./distro-configs/${distro_name}.conf" ; then
|
2010-12-01 12:03:56 -06:00
|
|
|
IFS="$(printf '\n')"
|
2010-12-01 06:20:29 -06:00
|
|
|
for opt in $(cat distro-configs/${distro_name}.conf) ; do cumul="$cumul $opt" ; done ;
|
|
|
|
unset IFS
|
|
|
|
conf_args=$(requote "$@" | sed -e "s/'--with-distro=[^']*'/$cumul/")
|
|
|
|
else
|
2010-12-01 12:03:56 -06:00
|
|
|
echo "Warning: there is no pre-set configuration for ${distro_name}, ignoring --with-distro=${distro_name}"
|
2010-12-01 06:20:29 -06:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2010-08-24 08:03:44 -05:00
|
|
|
aclocal $ACLOCAL_FLAGS || exit 1;
|
|
|
|
#automake --gnu --add-missing --copy || exit 1;
|
|
|
|
#intltoolize --copy --force --automake
|
|
|
|
autoconf || exit 1;
|
|
|
|
if test "x$NOCONFIGURE" = "x"; then
|
2010-10-04 10:05:05 -05:00
|
|
|
if test -n "$old_args" ; then
|
|
|
|
eval `echo ./configure $old_args`
|
|
|
|
else
|
2010-11-28 23:07:09 -06:00
|
|
|
echo "$(requote "$@")" > autogen.lastrun
|
2010-12-01 06:20:29 -06:00
|
|
|
echo "./configure ${conf_args}"
|
|
|
|
eval `echo ./configure ${conf_args}`
|
2010-10-04 10:05:05 -05:00
|
|
|
fi
|
2010-08-24 08:03:44 -05:00
|
|
|
else
|
|
|
|
echo "Skipping configure process."
|
|
|
|
fi
|