ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/PDL-Audio/sndlib/configure.in
Revision: 1.1
Committed: Tue Dec 28 01:05:17 2004 UTC (19 years, 5 months ago) by root
Branch: MAIN
CVS Tags: rel-1_1, rel-1_2, HEAD
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 dnl Process this file with autoconf to produce a configure script.
2    
3     AC_INIT(io.c)
4     AC_CANONICAL_HOST
5     AC_CONFIG_HEADER(config.h)
6    
7     AC_ARG_WITH(alsa,
8     [ --with-alsa use ALSA if possible],
9     use_alsa="$withval",use_alsa=no)
10    
11     AC_PROG_CC
12    
13     AC_CHECK_LIB(m,main)
14     AC_CHECK_LIB(c,main)
15    
16     AC_HEADER_DIRENT
17     AC_HEADER_STDC
18     AC_CHECK_HEADERS(fcntl.h limits.h unistd.h string.h sys/soundcard.h soundcard.h machine/soundcard.h libc.h)
19     dnl soundcard.h is sometimes in /usr/lib/oss/include or /usr/local/lib/oss/include (gad...)
20    
21     AC_C_CONST
22     AC_TYPE_MODE_T
23     AC_TYPE_SIZE_T
24     AC_TYPE_PID_T
25     AC_STRUCT_TM
26     AC_C_BIGENDIAN
27    
28     AC_CHECK_SIZEOF(int)
29     AC_CHECK_SIZEOF(char)
30     AC_CHECK_SIZEOF(short)
31     AC_CHECK_SIZEOF(long)
32     AC_CHECK_SIZEOF(int *)
33    
34     AC_TYPE_SIGNAL
35     AC_FUNC_STRFTIME
36     AC_CHECK_FUNCS(getcwd strerror strtok)
37     AC_FUNC_CLOSEDIR_VOID
38     AC_FUNC_VPRINTF
39    
40     GUILE_LDFLAGS=""
41     GUILE_CFLAGS=""
42    
43     dnl SGI specialty
44     AUDIO_LIB=""
45     AC_CHECK_LIB(audio,main,[
46     AUDIO_LIB="-laudio"
47     ])
48     AC_SUBST(AUDIO_LIB)
49    
50     A_LD="ld"
51     A_LD_FLAGS=""
52    
53     dnl we need the sndlib.h equivalents to try to find the native sound support (see config.guess)
54     dnl this only matters for those cases where we've implemented the audio code in audio.c
55     dnl test for ALSA courtesy of Paul Barton-Davis
56     audio_system="unknown"
57     case "$host" in
58     *-*-linux*)
59     AC_DEFINE(LINUX)
60     AC_CHECK_LIB(asound,main,[
61     if test "$use_alsa" = yes ; then
62     audio_system=ALSA;
63     AC_DEFINE(HAVE_ALSA)
64     AUDIO_LIB="-lasound"
65     AC_SUBST(AUDIO_LIB)
66     else
67     echo "ALSA appears to be installed, but you asked for OSS";
68     audio_system=OSS;
69     fi
70     ],[
71     audio_system=OSS
72     ])
73     if test $audio_system != OSS ; then
74     AC_CHECK_HEADER(sys/asoundlib.h, [
75     :
76     ],[
77     if test $audio_system = ALSA ; then
78     echo "I can't find the ALSA library - falling back to OSS";
79     audio_system=OSS;
80     fi
81     ])
82     fi
83     ;;
84     *-*-sunos4*)
85     AC_DEFINE(SUN)
86     audio_system=Sun
87     ;;
88     *-*-solaris*)
89     AC_DEFINE(SOLARIS)
90     AC_DEFINE(SUN)
91     audio_system=Sun
92     ;;
93     *-*-hpux*)
94     AC_DEFINE(HPUX)
95     audio_system=Hpux
96     ;;
97     *-next*)
98     AC_DEFINE(NEXT)
99     audio_system=NeXT
100     ;;
101     *-sgi*)
102     AC_DEFINE(SGI)
103     audio_system=SGI
104     A_LD_FLAGS="-non_shared"
105     LIB_NAME="sndlib.a"
106     # to get this to work in both cases, we'd need to run all the cc cases twice with/out -shared as in libtool
107     ;;
108     alpha*)
109     AC_DEFINE(ALPHA)
110     ;;
111     *-*-openbsd*)
112     AC_DEFINE(OPENBSD)
113     audio_system=Sun
114     ;;
115     *-*-sco*)
116     AC_DEFINE(SCO5)
117     audio_system=OSS
118     ;;
119     *-*-cygwin*)
120     AC_DEFINE(WINDOZE)
121     audio_system=Windoze
122     ;;
123     *-aix*)
124     AC_DEFINE(AIX)
125     audio_system=aix
126     ;;
127    
128     esac
129     AC_MSG_CHECKING([for audio system])
130     AC_MSG_RESULT($audio_system)
131     AC_SUBST(A_LD)
132     AC_SUBST(A_LD_FLAGS)
133     AC_SUBST(LIB_NAME)
134    
135     AC_OUTPUT(Makefile
136     ../config.pl)
137