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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(d_arithmetic.c)
AC_SUBST(alsa)
AC_SUBST(rme)
AC_SUBST(PDLIB)
AC_SUBST(DEFINES)
AC_SUBST(MORECFLAGS)
AC_SUBST(EXT)
AC_SUBST(OPT_CFLAGS)
AC_SUBST(USE_OPT_CFLAGS)
AC_SUBST(SYSSRC)
AC_SUBST(STRIPFLAG)
AC_SUBST(GUINAME)
AC_SUBST(GUIFLAGS)
AC_SUBST(OSNUMBER)
AC_SUBST(EXTERNTARGET)
dnl other defaults
dnl check for features
AC_ARG_ENABLE(alsa, [ --enable-alsa compile ALSA support],
alsa="yes")
AC_ARG_ENABLE(old-alsa,[ --enable-old-alsa ALSA 0.5x support],
alsa="old")
AC_ARG_ENABLE(rme, [ --enable-rme compile RME support],
rme="yes")
AC_ARG_ENABLE(debug, [ --enable-debug debugging support],
USE_OPT_CFLAGS="NO", USE_OPT_CFLAGS="YES")
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_CPP
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/ioctl.h sys/time.h unistd.h bstring.h)
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(gettimeofday select socket strerror)
dnl Checks for libraries.
dnl Checking for `dlopen' function in -ldl:
AC_CHECK_LIB(dl, dlopen,PDLIB="$PDLIB -ldl",
echo "dynamic link support required" || exit 1)
dnl Checking for `sin' function in -lffm:
dnl ffm is the fast math library on the alpha
AC_CHECK_LIB(ffm, sin,PDLIB="$PDLIB -lffm")
dnl Checking for `sin' function in -lm:
AC_CHECK_LIB(m, sin,PDLIB="$PDLIB -lm",
echo "math library required" || exit 1)
dnl Checking for `pthread_create' function in -pthread
AC_CHECK_LIB(pthread, pthread_create,PDLIB="$PDLIB -lpthread",
echo "pthreads required" || exit 1)
dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
if test "$alsa" = yes; then
AC_CHECK_LIB(asound,snd_pcm_info,PDLIB="$PDLIB -lasound",alsa="")
elif test "$alsa" = old; then
AC_CHECK_LIB(asound,snd_pcm_info,PDLIB="$PDLIB -lasound",alsa="")
fi
dnl Find paths to includes and libraries for X11
AC_PATH_X
dnl Checking for `XCreateWindow' function in -lX11:
AC_CHECK_LIB(X11, XCreateWindow, LIBS="$LIBS -lX11 -L$x_libraries",
echo "no X11 found" || exit 1, -L$x_libraries)
dnl look for tcl 8.x... do I really have to go through all this!?
AC_CHECK_HEADER(tcl.h,,
AC_CHECK_HEADER(tcl8.1/tcl.h,GUIFLAGS="$GUIFLAGS -I /usr/include/tcl8.1",
AC_CHECK_HEADER(tcl8.2/tcl.h,GUIFLAGS="$GUIFLAGS -I /usr/include/tcl8.2",
AC_CHECK_HEADER(tcl8.3/tcl.h,GUIFLAGS="$GUIFLAGS -I /usr/include/tcl8.3",
AC_CHECK_HEADER(tcl8.4/tcl.h,GUIFLAGS="$GUIFLAGS -I /usr/include/tcl8.4",
AC_CHECK_HEADER(tcl8.5/tcl.h,GUIFLAGS="$GUIFLAGS -I /usr/include/tcl8.5",
AC_CHECK_HEADER(tcl8.6/tcl.h,GUIFLAGS="$GUIFLAGS -I /usr/include/tcl8.5",
AC_CHECK_HEADER(tcl8.7/tcl.h,GUIFLAGS="$GUIFLAGS -I /usr/include/tcl8.5",
echo "no tcl/tk header found" || exit 1))))))))
AC_CHECK_LIB(tcl8.7, main,,
AC_CHECK_LIB(tcl8.6, main,,
AC_CHECK_LIB(tcl8.5, main,,
AC_CHECK_LIB(tcl8.4, main,,
AC_CHECK_LIB(tcl8.3, main,,
AC_CHECK_LIB(tcl8.2, main,,
AC_CHECK_LIB(tcl8.0, main)))))))
AC_CHECK_LIB(tk8.7, main,,
AC_CHECK_LIB(tk8.6, main,,
AC_CHECK_LIB(tk8.5, main,,
AC_CHECK_LIB(tk8.4, main,,
AC_CHECK_LIB(tk8.3, main,,
AC_CHECK_LIB(tk8.2, main,,
AC_CHECK_LIB(tk8.0, main)))))))
dnl Checking for tk.h or tkstep.h - not used at the moment
dnl AC_CHECK_HEADER(tk.h,DEFINES="$DEFINES -DTKINC=\\\"tk.h\\\"")
dnl AC_CHECK_HEADER(tkstep.h,DEFINES="$DEFINES -DTKINC=\\\"tkstep.h\\\"")
if test `uname -s` = FreeBSD;
then
LDFLAGS="-Wl,-export-dynamic"
EXT=pd_freebsd
MORECFLAGS=-DDL_OPEN
SYSSRC=s_freebsd.c
STRIPFLAG=-s
GUINAME="pd-gui"
OSNUMBER=0
fi
if test `uname -s` = Linux;
then
LDFLAGS="-Wl,-export-dynamic"
EXT=pd_linux
MORECFLAGS=-DDL_OPEN
SYSSRC=s_linux.c
STRIPFLAG=-s
GUINAME="pd-gui"
if test $USE_OPT_CFLAGS == "YES";
then
OPT_CFLAGS="-O6 -funroll-loops -fomit-frame-pointer"
else
OPT_CFLAGS="-g"
fi
OSNUMBER=0
fi
if test `uname -s` = IRIX64;
then
LDFLAGS="-n32 -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
-OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
-shared -rdata_shared"
EXT=pd_irix6
MORECFLAGS=-DDL_OPEN
SYSSRC=s_sgi.c
STRIPFLAG=-s
GUINAME="pd-gui"
OSNUMBER=0
fi
if test `uname -s` = IRIX32;
then
LDFLAGS="-o32 -DUNIX -DIRIX -O2 -shared -rdata_shared"
EXT=pd_irix5
MORECFLAGS=-DDL_OPEN
SYSSRC=s_sgi.c
STRIPFLAG=-s
GUINAME="pd-gui"
OSNUMBER=0
fi
if test `uname -s` = Darwin;
then
LDFLAGS="-Wl -framework Tcl -framework Tk -framework CoreAudio \
-framework AudioUnit -framework AudioToolbox \
-framework Carbon -framework CoreMIDI"
EXT=pd_darwin
MORECFLAGS="-DMACOSX -I/usr/X11R6/include -I../portaudio/pa_common \
-I../portaudio/pablio -I../portaudio/portmidi-macosx -Wno-error"
SYSSRC="s_mac.c s_portaudio.c ../portaudio/pa_common/pa_lib.c \
../portaudio/pa_common/pa_trace.c \
../portaudio/pa_common/pa_convert.c \
../portaudio/pablio/pablio_pd.c \
../portaudio/pablio/ringbuffer_pd.c \
../portaudio/pa_mac_core/pa_mac_core.c \
../portaudio/portmidi-macosx/pmdarwin.c \
../portaudio/portmidi-macosx/pmmacosx.c \
../portaudio/portmidi-macosx/pmutil.c \
../portaudio/portmidi-macosx/portmidi.c \
../portaudio/portmidi-macosx/ptdarwin.c "
STRIPFLAG=""
GUINAME="pdtcl"
GUIFLAGS="-framework Tcl -framework Tk \
-I/Library/Frameworks/Tk.framework/Versions/Current/Headers \
-I/Library/Frameworks/Tcl.framework/Versions/Current/Headers \
-I/Library/Frameworks/Tcl.framework/Versions/8.4/PrivateHeaders"
if test $USE_OPT_CFLAGS == "YES";
then
OPT_CFLAGS="-O2"
else
OPT_CFLAGS="-g"
fi
OSNUMBER=2
EXTERNTARGET=pd_darwin
fi
AC_OUTPUT(makefile)
|