File: findsound.sh

package info (click to toggle)
frotz 2.40-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 468 kB
  • ctags: 891
  • sloc: ansic: 6,774; makefile: 143; sh: 63
file content (59 lines) | stat: -rwxr-xr-x 1,398 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh

# This thing is intended primarily to find soundcard.h for use with the
# OSS soundcard driver.  It will first look in <sys/soundcard.h> then
# <soundcard.h>.  Linux systems use the former.  *BSD uses the latter.
# This script will be replaced with something more decent when support for
# more sound drivers is added.  This file will be executed during compile
# even if you aren't using sound.  

INCLUDE1="/usr/include/sys"
INCLUDE2="/usr/include"
SOUNDCARD_H="soundcard.h"
OUTFILE="soundcard.h"

echo "checking for $SOUNDCARD_H"

if [ -f $OUTFILE ] ; then
	exit 0
fi

cat << EOF > $OUTFILE
/*
 * This file automatically generated by findsound.sh which run by the
 * Makefile found in the Unix Frotz 2.40 source distribution.
 * Copying this nasty hack to find headers which may be in any of several
 * places is not reccomended.  I didn't want to use autoconf just yet 
 * for this project.
 *
 */

EOF

FILE=$INCLUDE1/$SOUNDCARD_H
if [ -f $FILE ] ; then
	echo "I see we have $FILE..."
	if [ -r $FILE ] ; then
		echo '#include <sys/soundcard.h>' >> $OUTFILE
	else
		echo "Oops...  Can't read it!"
		exit 1
	fi
	exit 0
fi

# I'm too lazy to iterate properly right now

FILE=$INCLUDE2/$SOUNDCARD_H
if [ -f $FILE ] ; then
	echo "I see we have $FILE..."
	if [ -r $FILE ] ; then
		echo '#include <soundcard.h>' >> $OUTFILE
	else
		echo "Oops...  Can't read it!"
		exit 2
	fi
	exit 0
fi