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 --with-pthreads) WITH_PTHREADS
=1 ;;
19 --prefix) PREFIX
=$2 ; shift ;;
20 --prefix=*) PREFIX
=`echo $1 | sed -e 's/--prefix=//'` ;;
26 if [ "$CONFIG_HELP" = "1" ] ; then
28 echo "Available options:"
29 echo "--prefix=PREFIX Installation prefix ($PREFIX)."
30 echo "--with-pthreads Activate POSIX threads support."
33 echo "Environment variables:"
35 echo "CFLAGS Compile flags (i.e., -O3)."
45 echo "/* automatically created by config.sh - do not modify */" > config.h
46 echo "# automatically created by config.sh - do not modify" > makefile.opts
52 if [ "$CC" = "" ] ; then
54 # if CC is unset, try if gcc is available
62 echo "CC=$CC" >> makefile.opts
65 if [ "$CFLAGS" = "" ] ; then
69 echo "CFLAGS=$CFLAGS" >> makefile.opts
75 if [ "$AR" = "" ] ; then
79 echo "AR=$AR" >> makefile.opts
82 if [ "$LEX" = "" ] ; then
86 echo "LEX=$LEX" >> makefile.opts
89 if [ "$YACC" = "" ] ; then
93 echo "YACC=$YACC" >> makefile.opts
96 cat VERSION
>> config.h
98 # add installation prefix
99 echo "#define CONFOPT_PREFIX \"$PREFIX\"" >> config.h
101 #########################################################
103 # configuration directives
106 echo -n "Testing for Linux OSS... "
107 echo "#include <linux/soundcard.h>" > .tmp.c
108 echo "int main(void) {" >> .tmp.c
109 echo "int i=open(\"/dev/dsp\",0);" >> .tmp.c
110 echo "ioctl(i,SNDCTL_DSP_SETFRAGMENT,&i);" >> .tmp.c
111 echo "return 0; } " >>.tmp.c
113 $CC .tmp.c
-o .tmp.o
2> /dev
/null
115 echo "#define CONFOPT_LINUX_OSS 1" >> config.h
121 # test for IRIX audio library
122 echo -n "Testing for IRIX audio library... "
123 echo "#include <dmedia/audio.h>" > .tmp.c
124 echo "int main(void) { alNewConfig(); return 0; }" >> .tmp.c
126 $CC .tmp.c
-laudio -o .tmp.o
2> /dev
/null
128 echo "#define CONFOPT_SGI 1" >> config.h
129 echo "-laudio" >> config.ldflags
135 # test for esound library
136 echo -n "Testing for esound development libraries... "
137 echo "#include <esd.h>" > .tmp.c
138 echo "int main(void) { return 0; }" >> .tmp.c
140 $CC -I/usr
/local
/include
-L/usr
/local
/lib
-lesd .tmp.c
-o .tmp.o
2> /dev
/null
142 echo "#define CONFOPT_ESD 1" >> config.h
143 echo "-lesd" >> config.ldflags
149 # test for artsc library
150 echo -n "Testing for aRts development libraries... "
151 echo "#include <artsc.h>" > .tmp.c
152 echo "int main(void) { return 0; }" >> .tmp.c
154 TMP_CFLAGS
=`artsc-config --cflags 2>/dev/null`
155 TMP_LDFLAGS
=`artsc-config --libs 2>/dev/null`
157 $CC $TMP_CFLAGS .tmp.c
$TMP_LDFLAGS -o .tmp.o
2> /dev
/null
159 echo "#define CONFOPT_ARTS 1" >> config.h
160 echo $TMP_CFLAGS >> config.cflags
161 echo $TMP_LDFLAGS >> config.ldflags
168 if [ "$WITH_PTHREADS" = 1 ] ; then
169 echo "#define CONFOPT_PTHREADS 1" >> config.h
170 echo "-pthread" >> config.ldflags
173 #########################################################
177 echo "VERSION=$VERSION" >> makefile.opts
178 echo "PREFIX=$PREFIX" >> makefile.opts
179 echo >> makefile.opts
181 cat makefile.opts makefile.
in makefile.depend
> Makefile
183 #########################################################