2000-04-27 22:03:57 +02:00
|
|
|
#!/bin/sh
|
2010-09-19 20:27:16 +02:00
|
|
|
# Configuration script for ngspice.
|
2006-02-08 10:23:32 +01:00
|
|
|
#
|
2010-09-19 20:27:16 +02:00
|
|
|
# This script performs initial configuration of ngspice source
|
2006-02-08 10:23:32 +01:00
|
|
|
# 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
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
PROJECT=ngspice
|
2000-04-27 22:03:57 +02:00
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
# Exit variable
|
2000-04-27 22:03:57 +02:00
|
|
|
DIE=0
|
|
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
|
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
|
|
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
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
|
2006-02-08 10:23:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
version()
|
|
|
|
|
{
|
2010-09-19 20:27:16 +02:00
|
|
|
echo
|
|
|
|
|
echo "$PROJECT autogen.sh 1.0"
|
|
|
|
|
echo
|
2006-02-08 10:23:32 +01:00
|
|
|
}
|
|
|
|
|
|
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
|
|
|
}
|
2006-02-08 10:23:32 +01:00
|
|
|
|
2010-08-18 20:08:11 +02:00
|
|
|
check_awk()
|
|
|
|
|
{
|
2021-04-27 14:44:49 +02:00
|
|
|
(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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2006-02-08 10:23:32 +01: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."
|
2005-09-06 22:28:26 +02:00
|
|
|
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."
|
2005-09-06 22:28:26 +02:00
|
|
|
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."
|
2005-09-06 22:28:26 +02:00
|
|
|
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
|
|
|
}
|
|
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
|
"--adms" | "-a")
|
2025-02-06 09:58:13 +01:00
|
|
|
echo "Warning: adms is no longer available, ignored!"
|
2010-09-19 20:27:16 +02:00
|
|
|
;;
|
|
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
"--help" | "-h")
|
2010-09-19 20:27:16 +02:00
|
|
|
help
|
|
|
|
|
exit 0
|
|
|
|
|
;;
|
|
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
"--version" | "-v")
|
2010-09-19 20:27:16 +02:00
|
|
|
version
|
|
|
|
|
exit 0
|
|
|
|
|
;;
|
|
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
*)
|
2010-09-19 20:27:16 +02:00
|
|
|
;;
|
|
|
|
|
esac
|
2006-02-08 10:23:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
2025-09-07 18:49:22 +02:00
|
|
|
echo "Removing files to be remade"
|
|
|
|
|
rm -f Makefile.in aclocal.m4 ar-lib config.guess config.sub
|
|
|
|
|
rm -f depcomp install-sh ltmain.sh missing ylwrap
|
|
|
|
|
rm -r -f autom4te.cache
|
2006-02-08 10:23:32 +01: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
|
|
|
|
2012-06-21 19:17:01 +02:00
|
|
|
echo "Running aclocal $ACLOCAL_FLAGS"
|
2016-03-02 19:02:53 +01:00
|
|
|
aclocal $ACLOCAL_FLAGS --force -I m4 \
|
2012-06-21 19:17:01 +02:00
|
|
|
|| error_and_exit "aclocal failed"
|
|
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
# optional feature: autoheader
|
2010-09-19 20:27:16 +02:00
|
|
|
(autoheader --version) < /dev/null > /dev/null 2>&1
|
2007-12-15 14:41:48 +01:00
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
|
echo "Running autoheader"
|
2016-03-02 19:02:53 +01:00
|
|
|
autoheader --force \
|
2010-09-19 20:27:16 +02:00
|
|
|
|| error_and_exit "autoheader failed"
|
2007-12-15 14:41:48 +01:00
|
|
|
fi
|
2006-02-08 10:23:32 +01:00
|
|
|
|
2007-12-15 14:41:48 +01:00
|
|
|
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"
|
2006-02-08 10:23:32 +01:00
|
|
|
|
|
|
|
|
|
2010-08-18 19:13:26 +02:00
|
|
|
echo "Running autoconf"
|
2016-03-02 19:02:53 +01:00
|
|
|
autoconf --force \
|
2010-09-19 20:27:16 +02:00
|
|
|
|| error_and_exit "autoconf failed"
|
2008-12-28 18:29:30 +01:00
|
|
|
|
2007-12-15 14:41:48 +01:00
|
|
|
echo "Success."
|
2010-08-01 12:28:18 +02:00
|
|
|
exit 0
|