3 # Configuration shell script
6 VERSION
=`cut -f2 -d\" VERSION`
8 # default installation prefix
12 while [ $# -gt 0 ] ; do
15 # --without-option) WITHOUT_OPTION=1 ;;
16 --help) CONFIG_HELP
=1 ;;
18 --prefix) PREFIX
=$2 ; shift ;;
19 --prefix=*) PREFIX
=`echo $1 | sed -e 's/--prefix=//'` ;;
25 if [ "$CONFIG_HELP" = "1" ] ; then
27 echo "Available options:"
28 echo "--prefix=PREFIX Installation prefix ($PREFIX)."
29 # echo "--without-option Disable option."
32 echo "Environment variables:"
34 echo "CFLAGS Compile flags (i.e., -O3)."
44 echo "/* automatically created by config.sh - do not modify */" > config.h
45 echo "# automatically created by config.sh - do not modify" > makefile.opts
51 if [ "$CC" = "" ] ; then
53 # if CC is unset, try if gcc is available
61 echo "CC=$CC" >> makefile.opts
64 if [ "$CFLAGS" = "" ] ; then
68 echo "CFLAGS=$CFLAGS" >> makefile.opts
74 if [ "$AR" = "" ] ; then
78 echo "AR=$AR" >> makefile.opts
81 if [ "$LEX" = "" ] ; then
85 echo "LEX=$LEX" >> makefile.opts
88 if [ "$YACC" = "" ] ; then
92 echo "YACC=$YACC" >> makefile.opts
95 cat VERSION
>> config.h
97 # add installation prefix
98 echo "#define CONFOPT_PREFIX \"$PREFIX\"" >> config.h
100 #########################################################
102 # configuration directives
105 echo -n "Testing for Linux OSS... "
106 echo "#include <linux/soundcard.h>" > .tmp.c
107 echo "int main(void) {" >> .tmp.c
108 echo "int i=open(\"/dev/dsp\",0);" >> .tmp.c
109 echo "ioctl(i,SNDCTL_DSP_SETFRAGMENT,&i);" >> .tmp.c
110 echo "return 0; } " >>.tmp.c
112 $CC .tmp.c
-o .tmp.o
2> /dev
/null
114 echo "#define CONFOPT_LINUX_OSS 1" >> config.h
120 # test for IRIX audio library
121 echo -n "Testing for IRIX audio library... "
122 echo "#include <dmedia/audio.h>" > .tmp.c
123 echo "int main(void) { alNewConfig(); return 0; }" >> .tmp.c
125 $CC .tmp.c
-laudio -o .tmp.o
2> /dev
/null
127 echo "#define CONFOPT_SGI 1" >> config.h
128 echo "-laudio" >> config.ldflags
134 # test for esound library
135 echo -n "Testing for esound development libraries... "
136 echo "#include <esd.h>" > .tmp.c
137 echo "int main(void) { return 0; }" >> .tmp.c
139 $CC -I/usr
/local
/include
-L/usr
/local
/lib
-lesd .tmp.c
-o .tmp.o
2> /dev
/null
141 echo "#define CONFOPT_ESD 1" >> config.h
142 echo "-lesd" >> config.ldflags
148 # test for artsc library
149 echo -n "Testing for aRts development libraries... "
150 echo "#include <artsc.h>" > .tmp.c
151 echo "int main(void) { return 0; }" >> .tmp.c
153 TMP_CFLAGS
=`artsc-config --cflags 2>/dev/null`
154 TMP_LDFLAGS
=`artsc-config --libs 2>/dev/null`
156 $CC $TMP_CFLAGS .tmp.c
$TMP_LDFLAGS -o .tmp.o
2> /dev
/null
158 echo "#define CONFOPT_ARTS 1" >> config.h
159 echo $TMP_CFLAGS >> config.cflags
160 echo $TMP_LDFLAGS >> config.ldflags
166 #########################################################
168 echo "#ifdef CONFOPT_WIN32" >> config.h
169 echo "#define SWPRINTF _snwprintf" >> config.h
170 echo "#else" >> config.h
171 echo "#define SWPRINTF swprintf" >> config.h
172 echo "#endif" >> config.h
174 #########################################################
178 echo "VERSION=$VERSION" >> makefile.opts
179 echo "PREFIX=$PREFIX" >> makefile.opts
180 echo >> makefile.opts
182 cat makefile.opts makefile.
in makefile.depend
> Makefile
184 #########################################################