ngspice/autogen.sh

173 lines
2.9 KiB
Bash
Raw Normal View History

2000-04-27 22:03:57 +02:00
#!/bin/sh
# Configuration script for ngspice.
#
# This script performs initial configuration of ngspice source
# package.
#
#
#
#
2000-04-27 22:03:57 +02:00
PROJECT=ngspice
TEST_TYPE=-f
FILE=DEVICES
2000-04-27 22:03:57 +02: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
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
}
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."
echo "See http://www.gnu.org/software/automake/"
echo "(newest stable release is recommended)"
2000-04-27 22:03:57 +02:00
DIE=1
}
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."
echo "See http://www.gnu.org/software/libtool/"
echo "(newest stable release is recommended)"
2000-04-27 22:03:57 +02:00
DIE=1
}
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."
echo "See http://www.gnu.org/software/automake/"
echo "(newest stable release is recommended)"
2000-04-27 22:03:57 +02:00
DIE=1
}
2000-04-27 22:03:57 +02: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
}
if test "$ADMS" -eq 1; then
# Build admsXml arguments list
# for xml in `ls $XMLPATH | grep .xml`; do
# if [ "$xml" != "ngspiceVersion.xml" ]; then
# XMLARG="$XMLARG -e ../admst/$xml"
# fi
2006-02-16 13:46:44 +01:00
# done
# Prepend ngspiceVersion.xml
# XMLARG="-e ../admst/ngspiceVersion.xml $XMLARG"
2006-02-28 19:42:21 +01:00
currentdir=`pwd`
for adms_dir in `ls $ADMSDIR`
do
if [ -d "$ADMSDIR/$adms_dir" ]; then
case "$adms_dir" in
"CVS")
echo "Skipping CVS"
;;
"admst")
echo "Skipping scripts dir"
;;
*)
echo "Entering into directory: $adms_dir"
2006-02-28 19:42:21 +01:00
echo "-->"$ADMSDIR/$adms_dir
cd $ADMSDIR/$adms_dir
file=`ls admsva/*.va`
$ADMSXML $file -Iadmsva -e ../admst/ngspiceVersion.xml \
-e ../admst/ngspiceMakefile.am.xml
2006-02-28 19:42:21 +01:00
cd $currentdir
;;
esac
fi
done
fi
2000-04-27 22:03:57 +02:00
libtoolize --copy --force
aclocal $ACLOCAL_FLAGS
# optional feature: autoheader
2000-04-27 22:03:57 +02:00
(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader
automake -c -a $am_opt
autoconf