3 # Configuration shell script
6 VERSION
=`cut -f2 -d\" VERSION`
8 # default installation prefix
12 while [ $# -gt 0 ] ; do
15 --help) CONFIG_HELP
=1 ;;
17 --prefix) PREFIX
=$2 ; shift ;;
18 --prefix=*) PREFIX
=`echo $1 | sed -e 's/--prefix=//'` ;;
24 if [ "$CONFIG_HELP" = "1" ] ; then
26 echo "Available options:"
27 echo "--prefix=PREFIX Installation prefix ($PREFIX)."
30 echo "Environment variables:"
32 echo "CFLAGS Compile flags (i.e., -O3)."
42 echo "/* automatically created by config.sh - do not modify */" > config.h
43 echo "# automatically created by config.sh - do not modify" > makefile.opts
49 if [ "$CC" = "" ] ; then
51 # if CC is unset, try if gcc is available
59 echo "CC=$CC" >> makefile.opts
62 if [ "$CFLAGS" = "" ] ; then
66 echo "CFLAGS=$CFLAGS" >> makefile.opts
72 if [ "$AR" = "" ] ; then
76 echo "AR=$AR" >> makefile.opts
79 if [ "$LEX" = "" ] ; then
83 echo "LEX=$LEX" >> makefile.opts
86 if [ "$YACC" = "" ] ; then
90 echo "YACC=$YACC" >> makefile.opts
93 cat VERSION
>> config.h
95 # add installation prefix
96 echo "#define CONFOPT_PREFIX \"$PREFIX\"" >> config.h
98 #########################################################
100 # configuration directives
103 echo -n "Testing for Linux OSS... "
104 echo "#include <linux/soundcard.h>" > .tmp.c
105 echo "int main(void) {" >> .tmp.c
106 echo "int i=open(\"/dev/dsp\",0);" >> .tmp.c
107 echo "ioctl(i,SNDCTL_DSP_SETFRAGMENT,&i);" >> .tmp.c
108 echo "return 0; } " >>.tmp.c
110 $CC .tmp.c
-o .tmp.o
2> /dev
/null
112 echo "#define CONFOPT_LINUX_OSS 1" >> config.h
118 # test for IRIX audio library
119 echo -n "Testing for IRIX audio library... "
120 echo "#include <dmedia/audio.h>" > .tmp.c
121 echo "int main(void) { alNewConfig(); return 0; }" >> .tmp.c
123 $CC .tmp.c
-laudio -o .tmp.o
2> /dev
/null
125 echo "#define CONFOPT_SGI 1" >> config.h
126 echo "-laudio" >> config.ldflags
132 # test for esound library
133 echo -n "Testing for esound development libraries... "
134 echo "#include <esd.h>" > .tmp.c
135 echo "int main(void) { return 0; }" >> .tmp.c
137 $CC -I/usr
/local
/include
-L/usr
/local
/lib
-lesd .tmp.c
-o .tmp.o
2> /dev
/null
139 echo "#define CONFOPT_ESD 1" >> config.h
140 echo "-lesd" >> config.ldflags
146 # test for artsc library
147 echo -n "Testing for aRts development libraries... "
148 echo "#include <artsc.h>" > .tmp.c
149 echo "int main(void) { return 0; }" >> .tmp.c
151 TMP_CFLAGS
=`artsc-config --cflags 2>/dev/null`
152 TMP_LDFLAGS
=`artsc-config --libs 2>/dev/null`
154 $CC $TMP_CFLAGS .tmp.c
$TMP_LDFLAGS -o .tmp.o
2> /dev
/null
156 echo "#define CONFOPT_ARTS 1" >> config.h
157 echo $TMP_CFLAGS >> config.cflags
158 echo $TMP_LDFLAGS >> config.ldflags
164 #########################################################
168 echo "VERSION=$VERSION" >> makefile.opts
169 echo "PREFIX=$PREFIX" >> makefile.opts
170 echo >> makefile.opts
172 cat makefile.opts makefile.
in makefile.depend
> Makefile
174 #########################################################