2000-04-27 22:03:57 +02:00
|
|
|
#!/bin/sh
|
2006-02-08 10:23:32 +01:00
|
|
|
# Configuration script for ngspice.
|
|
|
|
|
#
|
|
|
|
|
# This script performs initial configuration of ngspice source
|
|
|
|
|
# package.
|
|
|
|
|
#
|
|
|
|
|
#
|
2007-12-15 14:41:48 +01:00
|
|
|
# $Id$
|
2006-02-08 10:23:32 +01:00
|
|
|
#
|
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-07-21 23:27:56 +02:00
|
|
|
TEST_TYPE=-f
|
|
|
|
|
FILE=DEVICES
|
2000-04-27 22:03:57 +02:00
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
# ADMS variables
|
|
|
|
|
|
|
|
|
|
ADMSDIR=src/spicelib/devices/adms
|
|
|
|
|
XMLPATH=src/spicelib/devices/adms/admst
|
|
|
|
|
ADMSXML=admsXml
|
|
|
|
|
ADMS=0
|
|
|
|
|
|
|
|
|
|
# Exit variable
|
2000-04-27 22:03:57 +02:00
|
|
|
DIE=0
|
|
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
|
|
|
|
|
help()
|
|
|
|
|
{
|
|
|
|
|
echo
|
|
|
|
|
echo "$PROJECT autogen.sh help"
|
|
|
|
|
echo
|
|
|
|
|
echo "--adms -a: enables adms feature"
|
|
|
|
|
echo "--help -h: print this file"
|
|
|
|
|
echo "--version -v: print version"
|
|
|
|
|
echo
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
version()
|
|
|
|
|
{
|
|
|
|
|
echo
|
|
|
|
|
echo "$PROJECT autogen.sh 1.0"
|
|
|
|
|
echo
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-01 21:02:23 +02:00
|
|
|
end_on_error()
|
|
|
|
|
{
|
|
|
|
|
if test "$ADMS" -eq 1; then
|
2010-08-18 19:13:26 +02:00
|
|
|
# cp -p temp-adms.ac configure.err
|
|
|
|
|
rm -f temp-adms.ac
|
2010-08-01 21:02:23 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
2006-02-08 10:23:32 +01:00
|
|
|
|
2010-08-18 20:08:11 +02:00
|
|
|
check_awk()
|
|
|
|
|
{
|
|
|
|
|
(awk --version) < /dev/null > /dev/null 2>&1 || {
|
|
|
|
|
echo
|
|
|
|
|
echo "You must have awk installed to compile $PROJECT with --adms."
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
check_autoconf()
|
|
|
|
|
{
|
2000-04-27 22:03:57 +02:00
|
|
|
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
|
|
|
|
|
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
|
2006-02-08 10:23:32 +01:00
|
|
|
}
|
2000-04-27 22:03:57 +02:00
|
|
|
|
2005-04-17 00:39:57 +02: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
|
2006-02-08 10:23:32 +01:00
|
|
|
}
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
|
|
|
(automake --version) < /dev/null > /dev/null 2>&1 || {
|
|
|
|
|
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
|
2006-02-08 10:23:32 +01:00
|
|
|
}
|
2000-04-27 22:03:57 +02:00
|
|
|
}
|
|
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
|
|
|
|
|
check_adms()
|
|
|
|
|
{
|
|
|
|
|
(admsXml --version) < /dev/null > /dev/null 2>&1 || {
|
|
|
|
|
echo
|
|
|
|
|
echo "You must have admsXml installed to compile adms models."
|
|
|
|
|
echo "See http://mot-adms.sourceforge.net"
|
|
|
|
|
echo "(newest stable release is recommended)"
|
|
|
|
|
DIE=1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
|
"--adms" | "-a")
|
|
|
|
|
check_adms
|
|
|
|
|
ADMS=1
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"--help" | "-h")
|
|
|
|
|
help
|
|
|
|
|
exit 0
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"--version" | "-v")
|
|
|
|
|
version
|
|
|
|
|
exit 0
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
*)
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
check_autoconf
|
|
|
|
|
|
2000-04-27 22:03:57 +02:00
|
|
|
if test "$DIE" -eq 1; then
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
test $TEST_TYPE $FILE || {
|
|
|
|
|
echo "You must run this script in the top-level $PROJECT directory"
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-18 19:13:26 +02:00
|
|
|
# only for --adms:
|
2006-02-08 10:23:32 +01:00
|
|
|
if test "$ADMS" -eq 1; then
|
|
|
|
|
|
2010-08-18 20:08:11 +02:00
|
|
|
check_awk
|
|
|
|
|
|
2010-08-15 22:17:05 +02:00
|
|
|
# sed 's/tests\/vbic\/Makefile/tests\/vbic\/Makefile\
|
|
|
|
|
# src\/spicelib\/devices\/adms\/ekv\/Makefile\
|
|
|
|
|
# src\/spicelib\/devices\/adms\/hicum0\/Makefile\
|
|
|
|
|
# src\/spicelib\/devices\/adms\/hicum2\/Makefile\
|
|
|
|
|
# src\/spicelib\/devices\/adms\/mextram\/Makefile\
|
|
|
|
|
# src\/spicelib\/devices\/adms\/psp102\/Makefile/g' configure.temp >configure.ac
|
2010-08-01 12:28:18 +02:00
|
|
|
|
2010-09-08 19:14:44 +02:00
|
|
|
# automake and autoconf need these entries in configure.ac for adms enabled
|
2010-08-15 22:17:05 +02:00
|
|
|
z=""
|
2010-08-18 19:13:26 +02:00
|
|
|
znew=""
|
2010-08-15 22:17:05 +02:00
|
|
|
# Find all lines with "#VLAMKF" and put the second token of each line into shell variable z
|
2010-08-18 19:13:26 +02:00
|
|
|
# as input to additional automake call for the adms directories
|
2010-09-08 19:14:44 +02:00
|
|
|
z=`cat configure.ac | awk -v z=${z} '$1 ~ /#VLAMKF/{ z=$2; print "./"z }' `
|
2010-08-18 19:13:26 +02:00
|
|
|
# same as above, sed requires \ at line endings, to be added to temp-adms.ac used by autoconf
|
2010-09-08 19:14:44 +02:00
|
|
|
znew=`cat configure.ac | awk -v z=${znew} '$1 ~ /#VLAMKF/{ znew=$2; print " "znew"\\\" }' `
|
2010-08-18 19:13:26 +02:00
|
|
|
|
|
|
|
|
# Find "tests/vbic/Makefile" and replace by tests/vbic/Makefile plus contents of variable z
|
2010-08-15 22:17:05 +02:00
|
|
|
sed -e "
|
|
|
|
|
s,tests\\/vbic\\/Makefile,tests\\/vbic\\/Makefile\\
|
2010-09-08 19:14:44 +02:00
|
|
|
$znew ," configure.ac >temp-adms.ac
|
2008-12-28 18:29:30 +01:00
|
|
|
|
|
|
|
|
currentdir=`pwd`
|
|
|
|
|
|
|
|
|
|
for adms_dir in `ls $ADMSDIR`
|
|
|
|
|
do
|
|
|
|
|
if [ -d "$ADMSDIR/$adms_dir" ]; then
|
|
|
|
|
|
|
|
|
|
case "$adms_dir" in
|
|
|
|
|
"CVS")
|
2010-08-18 19:13:26 +02:00
|
|
|
echo "Skipping CVS" ;;
|
2008-12-28 18:29:30 +01:00
|
|
|
|
|
|
|
|
"admst")
|
2010-08-18 19:13:26 +02:00
|
|
|
echo "Skipping scripts dir" ;;
|
2008-12-28 18:29:30 +01:00
|
|
|
|
|
|
|
|
*)
|
|
|
|
|
echo "Entering into directory: $adms_dir"
|
|
|
|
|
echo "-->"$ADMSDIR/$adms_dir
|
|
|
|
|
cd $ADMSDIR/$adms_dir
|
|
|
|
|
file=`ls admsva/*.va`
|
2010-08-14 10:34:49 +02:00
|
|
|
$ADMSXML $file -Iadmsva -xv -e ../admst/ngspiceVersion.xml \
|
2008-12-28 18:29:30 +01:00
|
|
|
-e ../admst/ngspiceMakefile.am.xml
|
|
|
|
|
|
|
|
|
|
cd $currentdir
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
fi
|
|
|
|
|
|
2007-12-15 14:41:48 +01:00
|
|
|
echo "Running aclocal $ACLOCAL_FLAGS"
|
2000-04-27 22:03:57 +02:00
|
|
|
aclocal $ACLOCAL_FLAGS
|
2010-08-01 21:02:23 +02:00
|
|
|
if [ $? -ne 0 ]; then echo "aclocal failed"; end_on_error ; fi
|
2007-12-15 14:41:48 +01:00
|
|
|
|
2010-09-17 18:26:06 +02:00
|
|
|
echo "Running libtoolize"
|
|
|
|
|
libtoolize --copy --force
|
|
|
|
|
if [ $? -ne 0 ];then echo "libtoolize failed"; end_on_error ; fi
|
|
|
|
|
|
2006-02-08 10:23:32 +01:00
|
|
|
# optional feature: autoheader
|
2007-12-15 14:41:48 +01:00
|
|
|
(autoheader --version) < /dev/null > /dev/null 2>&1
|
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
|
echo "Running autoheader"
|
|
|
|
|
autoheader
|
2010-08-01 21:02:23 +02:00
|
|
|
if [ $? -ne 0 ]; then echo "autoheader failed"; end_on_error ; fi
|
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-08-18 19:13:26 +02:00
|
|
|
automake -Wall --copy --add-missing
|
2010-08-01 21:02:23 +02:00
|
|
|
if [ $? -ne 0 ]; then echo "automake failed"; end_on_error ; fi
|
2006-02-08 10:23:32 +01:00
|
|
|
|
2010-08-18 19:13:26 +02:00
|
|
|
if test "$ADMS" -eq 1; then
|
|
|
|
|
echo "Running automake for adms"
|
|
|
|
|
automake -Wall --copy --add-missing $z
|
|
|
|
|
if [ $? -ne 0 ]; then echo "automake failed"; end_on_error ; fi
|
|
|
|
|
fi
|
2006-02-08 10:23:32 +01:00
|
|
|
|
2010-08-18 19:13:26 +02:00
|
|
|
echo "Running autoconf"
|
2010-08-01 12:28:18 +02:00
|
|
|
if test "$ADMS" -eq 1; then
|
2010-08-18 19:13:26 +02:00
|
|
|
autoconf temp-adms.ac > configure
|
|
|
|
|
rm -f temp-adms.ac
|
|
|
|
|
else
|
|
|
|
|
autoconf
|
2010-08-01 12:28:18 +02:00
|
|
|
fi
|
2010-08-18 19:13:26 +02:00
|
|
|
if [ $? -ne 0 ]; then echo "autoconf failed"; end_on_error ; fi
|
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
|