ngspice/autogen.sh

146 lines
2.7 KiB
Bash
Raw Normal View History

2000-04-27 22:03:57 +02:00
#!/bin/sh
2010-09-19 20:27:16 +02:00
# Configuration script for ngspice.
#
2010-09-19 20:27:16 +02:00
# This script performs initial configuration of ngspice source
# package.
#
#
2010-09-08 19:14:44 +02:00
# temp-adms.ac: modified configure.ac if --adms is selected
2010-08-18 19:13:26 +02:00
# for temporary use by autoconf, will be deleted automatically
2010-09-08 19:14:44 +02:00
# configure.ac stays untouched
2000-04-27 22:03:57 +02:00
PROJECT=ngspice
2000-04-27 22:03:57 +02:00
# Exit variable
2000-04-27 22:03:57 +02:00
DIE=0
2012-10-29 23:47:02 +01:00
# Check for Mac OS X
uname -a | grep -q "Darwin"
if [ $? -eq 0 ]; then
LIBTOOLIZE=glibtoolize
else
LIBTOOLIZE=libtoolize
fi
help()
{
2010-09-19 20:27:16 +02:00
echo
echo "$PROJECT autogen.sh help"
echo
echo "--help -h: print this file"
echo "--version -v: print version"
echo
}
version()
{
2010-09-19 20:27:16 +02:00
echo
echo "$PROJECT autogen.sh 1.0"
echo
}
2010-09-19 20:27:16 +02:00
error_and_exit()
2010-08-01 21:02:23 +02:00
{
2010-09-19 20:27:16 +02:00
echo "Error: $1"
exit 1
2010-08-01 21:02:23 +02:00
}
2010-08-18 20:08:11 +02:00
check_awk()
{
(awk --version) < /dev/null > /dev/null 2>&1 ||
(awk -W version) < /dev/null > /dev/null 2>&1 || {
2010-08-18 20:08:11 +02:00
echo
echo "You must have awk installed to compile $PROJECT with --adms."
exit 1
2010-09-19 20:27:16 +02:00
}
}
check_autoconf()
{
2010-09-19 20:27:16 +02:00
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
2000-04-27 22:03:57 +02:00
echo
echo "You must have autoconf installed to compile $PROJECT."
echo "See http://www.gnu.org/software/automake/"
echo "(newest stable release is recommended)"
2000-04-27 22:03:57 +02:00
DIE=1
2010-09-19 20:27:16 +02:00
}
2000-04-27 22:03:57 +02:00
2012-10-29 23:47:02 +01:00
($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
2000-04-27 22:03:57 +02:00
echo
echo "You must have libtool installed to compile $PROJECT."
echo "See http://www.gnu.org/software/libtool/"
echo "(newest stable release is recommended)"
2000-04-27 22:03:57 +02:00
DIE=1
2010-09-19 20:27:16 +02:00
}
2000-04-27 22:03:57 +02:00
2010-09-19 20:27:16 +02:00
(automake --version) < /dev/null > /dev/null 2>&1 || {
2000-04-27 22:03:57 +02:00
echo
echo "You must have automake installed to compile $PROJECT."
echo "See http://www.gnu.org/software/automake/"
echo "(newest stable release is recommended)"
2000-04-27 22:03:57 +02:00
DIE=1
2010-09-19 20:27:16 +02:00
}
2000-04-27 22:03:57 +02:00
}
case "$1" in
"--adms" | "-a")
echo "Warning: adms is no longer available, ignored!"
2010-09-19 20:27:16 +02:00
;;
"--help" | "-h")
2010-09-19 20:27:16 +02:00
help
exit 0
;;
"--version" | "-v")
2010-09-19 20:27:16 +02:00
version
exit 0
;;
*)
2010-09-19 20:27:16 +02:00
;;
esac
check_autoconf
2010-09-19 20:27:16 +02:00
if [ "$DIE" -eq 1 ]; then
exit 1
2000-04-27 22:03:57 +02:00
fi
2010-09-19 20:27:16 +02:00
[ -f "DEVICES" ] || {
echo "You must run this script in the top-level $PROJECT directory"
exit 1
2000-04-27 22:03:57 +02:00
}
2012-10-29 23:47:02 +01:00
echo "Running $LIBTOOLIZE"
$LIBTOOLIZE --copy --force \
|| error_and_exit "$LIBTOOLIZE failed"
2010-09-17 18:26:06 +02:00
echo "Running aclocal $ACLOCAL_FLAGS"
aclocal $ACLOCAL_FLAGS --force -I m4 \
|| error_and_exit "aclocal failed"
# optional feature: autoheader
2010-09-19 20:27:16 +02:00
(autoheader --version) < /dev/null > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Running autoheader"
autoheader --force \
2010-09-19 20:27:16 +02:00
|| error_and_exit "autoheader failed"
fi
echo "Running automake -Wall --copy --add-missing"
2010-09-19 20:27:16 +02:00
automake -Wall --copy --add-missing \
|| error_and_exit "automake failed"
2010-08-18 19:13:26 +02:00
echo "Running autoconf"
autoconf --force \
2010-09-19 20:27:16 +02:00
|| error_and_exit "autoconf failed"
echo "Success."
2010-08-01 12:28:18 +02:00
exit 0