jamie@1
|
1 AC_PREREQ(2.13)
|
jamie@4
|
2 AC_INIT([libxtract], [0.11], [bugs@postlude.co.uk])
|
jamie@1
|
3
|
jamie@1
|
4 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
|
jamie@1
|
5 AM_CONFIG_HEADER(config.h)
|
jamie@1
|
6 AC_PROG_CC
|
jamie@17
|
7 AC_PROG_LIBTOOL
|
jamie@1
|
8 AC_PROG_INSTALL
|
jamie@17
|
9 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
jamie@1
|
10 AC_ENABLE_STATIC(no)
|
jamie@1
|
11 AC_ENABLE_SHARED(yes)
|
jamie@1
|
12 AC_PROG_LIBTOOL
|
jamie@1
|
13 #AC_ARG_WITH(fftw, AC_HELP_STRING([--with-vector], [build vector features]),
|
jamie@1
|
14 # [ if test $withval = "yes"; then with_vector=yes ;
|
jamie@1
|
15 # else with_vector=no ; fi ], with_vector=no)
|
jamie@1
|
16
|
jamie@17
|
17 AC_CHECK_HEADERS([math.h, stdlib.h, stdio.h])
|
jamie@2
|
18 AC_CHECK_PROG([DOXYGEN], [doxygen], [doc], [])
|
jamie@2
|
19 AC_SUBST(DOXYGEN)
|
jamie@1
|
20
|
jamie@1
|
21 AC_ARG_ENABLE(vector,
|
jamie@1
|
22 [ --enable-vector Turn fft-based vector processing on],
|
jamie@1
|
23 [case "${enableval}" in
|
jamie@1
|
24 yes) vector=true ;;
|
jamie@1
|
25 no) vector=false ;;
|
jamie@1
|
26 *) AC_MSG_ERROR(bad value ${enableval} for --enable-vector) ;;
|
jamie@1
|
27 esac],[vector=false])
|
jamie@1
|
28
|
jamie@4
|
29 AC_ARG_ENABLE(pd_example,
|
jamie@4
|
30 [ --enable-pd_example Compile the Pure Data external example],
|
jamie@4
|
31 [case "${enableval}" in
|
jamie@9
|
32 yes) pd_example=true ;;
|
jamie@9
|
33 no) pd_example=false ;;
|
jamie@4
|
34 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pd_external) ;;
|
jamie@9
|
35 esac],[pd_example=false])
|
jamie@4
|
36
|
jamie@4
|
37 # libtool version: current:revision:age
|
jamie@4
|
38 #
|
jamie@4
|
39 # If the library source code has changed at all since the last update, then
|
jamie@4
|
40 # increment revision (`c:r:a' becomes `c:r+1:a').
|
jamie@4
|
41 #
|
jamie@4
|
42 # If any interfaces have been added, removed, or changed since the last update,
|
jamie@4
|
43 # increment current, and set revision to 0.
|
jamie@4
|
44 #
|
jamie@4
|
45 # If any interfaces have been added since the last public release, then
|
jamie@4
|
46 # increment age.
|
jamie@4
|
47 #
|
jamie@4
|
48 # If any interfaces have been removed since the last public release, then set
|
jamie@4
|
49 # age to 0.
|
jamie@1
|
50 XTRACT_SO_VERSION=0:0:0
|
jamie@4
|
51
|
jamie@17
|
52 CFLAGS="$CFLAGS -pedantic -ansi -O3"
|
jamie@9
|
53 LDFLAGS="$LDFLAGS -lm"
|
jamie@1
|
54
|
jamie@4
|
55 AC_ARG_WITH(pd_dir,
|
jamie@4
|
56 [ --with-pd-dir=path pd header path (default=/usr/local/include) ],
|
jamie@4
|
57 [
|
jamie@7
|
58 CFLAGS="$CFLAGS -I$withval"
|
jamie@4
|
59 echo
|
jamie@4
|
60 echo "pd dir is $withval"
|
jamie@4
|
61 echo
|
jamie@4
|
62 ])
|
jamie@4
|
63
|
jamie@9
|
64 AC_ARG_WITH(fftw3_dir,
|
jamie@9
|
65 [ --with-fftw3-dir=path fftw3 header path (default=/usr/local/include) ],
|
jamie@9
|
66 [
|
jamie@9
|
67 CFLAGS="$CFLAGS -I$withval"
|
jamie@9
|
68 echo
|
jamie@9
|
69 echo "fftw3 dir is $withval"
|
jamie@9
|
70 echo
|
jamie@9
|
71 ])
|
jamie@9
|
72
|
jamie@9
|
73 dnl Are we building with fftw?
|
jamie@9
|
74 #if [[ "$with_vector" = "yes" ]] ; then
|
jamie@9
|
75 if [[ "$vector" = "true" ]] ; then
|
jamie@9
|
76 LDFLAGS="$LDFLAGS -lfftw3f"
|
jamie@9
|
77 AC_DEFINE([BUILD_VECTOR], [1], [Build the vector functions])
|
jamie@9
|
78 AC_CHECK_HEADER(fftw3.h, [have_fftw3_hdr=yes ], [
|
jamie@9
|
79 have_pd_hdr=no
|
jamie@9
|
80 echo
|
jamie@9
|
81 echo "no fftw3.h header found. try with option --with-fftw3-dir=/path/to/fftw3/header"
|
jamie@9
|
82 echo
|
jamie@9
|
83 exit
|
jamie@9
|
84 ])
|
jamie@9
|
85 fi
|
jamie@9
|
86
|
jamie@17
|
87
|
jamie@9
|
88 AM_CONDITIONAL(BUILD_VECTOR, test "x${vector}" = 'xtrue')
|
jamie@9
|
89
|
jamie@9
|
90 dnl Are we building the PD examples?
|
jamie@9
|
91 if [[ "$pd_example" = "true" ]] ; then
|
jamie@9
|
92 PD_SOURCES="xtract~.c"
|
jamie@9
|
93 AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example])
|
jamie@9
|
94 AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [
|
jamie@4
|
95 have_pd_hdr=no
|
jamie@4
|
96 echo
|
jamie@4
|
97 echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src"
|
jamie@4
|
98 echo
|
jamie@4
|
99 exit
|
jamie@4
|
100 ])
|
jamie@9
|
101 fi
|
jamie@4
|
102
|
jamie@4
|
103 AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue')
|
jamie@4
|
104
|
jamie@17
|
105 dnl Enable debugging (no)
|
jamie@17
|
106 AC_ARG_ENABLE(debug,
|
jamie@17
|
107 [ --enable-debug[[=value]] compile with debug [[default=no]]],
|
jamie@17
|
108 with_debug="yes",
|
jamie@17
|
109 with_debug="no")
|
jamie@17
|
110 if test "$with_debug" = "yes"
|
jamie@17
|
111 then
|
jamie@17
|
112 AC_DEFINE(DEBUG,1,[Define to enable debug])
|
jamie@17
|
113 CFLAGS="-O0 -ggdb -g -pedantic -ansi"
|
jamie@17
|
114 fi
|
jamie@17
|
115
|
jamie@4
|
116 dnl ------------------------------------------
|
jamie@4
|
117 dnl ---- do some magic to gues the host opsys
|
jamie@4
|
118 dnl ---- taken from libvorbis configure.in
|
jamie@4
|
119 dnl ------------------------------------------
|
jamie@7
|
120 dnl AC_CANONICAL_HOST
|
jamie@4
|
121
|
jamie@9
|
122 dnl AC_SUBST(PD_CFLAGS,"$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1")
|
jamie@7
|
123 dnl AC_SUBST(PD_LDFLAGS,"$PD_LDFLAGS -shared")
|
jamie@7
|
124 dnl pd_ldflags="$PD_LDFLAGS -L/usr/local/lib -ldl"
|
jamie@4
|
125 if test -z "$GCC"; then
|
jamie@4
|
126 case $host in
|
jamie@4
|
127 *-*-irix*)
|
jamie@4
|
128 dnl If we're on IRIX, we wanna use cc even if gcc
|
jamie@4
|
129 dnl is there (unless the user has overriden us)...
|
jamie@4
|
130 if test -z "$CC"; then
|
jamie@4
|
131 CC=cc
|
jamie@4
|
132 fi
|
jamie@4
|
133 ;;
|
jamie@4
|
134 sparc-sun-solaris*)
|
jamie@4
|
135 PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
|
jamie@4
|
136 ;;
|
jamie@4
|
137 *)
|
jamie@4
|
138 PD_CFLAGS="-O"
|
jamie@4
|
139 ;;
|
jamie@4
|
140 esac
|
jamie@4
|
141 else
|
jamie@4
|
142
|
jamie@4
|
143 case $host in
|
jamie@4
|
144 *86-*-linux*)
|
jamie@17
|
145 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
|
jamie@17
|
146 PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic"
|
jamie@4
|
147 dnl we could test for bad glibc here, but don't
|
jamie@7
|
148 PD_SUFFIX=pd_linux
|
jamie@4
|
149 ;;
|
jamie@4
|
150 powerpc-*-linux*)
|
jamie@17
|
151 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
|
jamie@4
|
152 PD_LDFLAGS="$PD_LDFLAGS -shared"
|
jamie@7
|
153 PD_SUFFIX=pd_linux
|
jamie@4
|
154 ;;
|
jamie@4
|
155 *-*-linux*)
|
jamie@17
|
156 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -fPIC"
|
jamie@17
|
157 PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic"
|
jamie@7
|
158 PD_SUFFIX=pd_linux
|
jamie@4
|
159 ;;
|
jamie@4
|
160 sparc-sun-*)
|
jamie@4
|
161 echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet"
|
jamie@4
|
162 ;;
|
jamie@17
|
163 *86-*-darwin*)
|
jamie@17
|
164 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
|
jamie@17
|
165 PD_LDFLAGS="$PD_LDFLAGS -bundle -arch i686 -undefined suppress -flat_namespace"
|
jamie@7
|
166 PD_SUFFIX=pd_darwin
|
jamie@17
|
167 ;;
|
jamie@17
|
168 *-*-darwin*)
|
jamie@17
|
169 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
|
jamie@17
|
170 PD_LDFLAGS="$PD_LDFLAGS -bundle -arch ppc -undefined suppress -flat_namespace"
|
jamie@17
|
171 PD_SUFFIX=pd_darwin
|
jamie@17
|
172 ;;
|
jamie@17
|
173
|
jamie@4
|
174 *)
|
jamie@4
|
175 dnl assume unix
|
jamie@9
|
176 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1"
|
jamie@4
|
177 PD_LDFLAGS="$PD_LDFLAGS -shared"
|
jamie@7
|
178 PD_SUFFIX=pd_linux
|
jamie@4
|
179 ;;
|
jamie@4
|
180 esac
|
jamie@4
|
181 fi
|
jamie@4
|
182
|
jamie@9
|
183 PD_CFLAGS="$PD_CFLAGS -DPD"
|
jamie@9
|
184
|
jamie@7
|
185 AC_SUBST(PD_CFLAGS)
|
jamie@7
|
186 AC_SUBST(PD_LDFLAGS)
|
jamie@7
|
187 AC_SUBST(PD_SUFFIX)
|
jamie@9
|
188 AC_SUBST(PD_SOURCES)
|
jamie@7
|
189
|
jamie@13
|
190 AC_CONFIG_FILES([doc/documentation.doxygen
|
jamie@13
|
191 libxtract.pc])
|
jamie@2
|
192
|
jamie@7
|
193 AC_OUTPUT(Makefile src/Makefile xtract/Makefile doc/Makefile examples/Makefile examples/puredata/Makefile)
|
jamie@16
|
194
|
jamie@16
|
195 echo
|
jamie@16
|
196 echo "**************************************************************"
|
jamie@16
|
197 echo "Summary:"
|
jamie@16
|
198
|
jamie@17
|
199 echo you are using the ${host} architecture
|
jamie@16
|
200
|
jamie@17
|
201 if test "$vector" = "true"; then
|
jamie@16
|
202 echo "Fftw3: yes (using fftw3f)"
|
jamie@16
|
203 else
|
jamie@17
|
204 echo "Fftw3: no (not using fftw3, the vector functions will not work)"
|
jamie@16
|
205 fi
|
jamie@17
|
206 if test "$pd_example" = "true"; then
|
jamie@16
|
207 echo "PD external: yes"
|
jamie@16
|
208 else
|
jamie@16
|
209 echo "PD external: no"
|
jamie@16
|
210 fi
|
jamie@16
|
211 echo "**************************************************************"
|
jamie@16
|
212 echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}
|
jamie@16
|
213
|
jamie@16
|
214
|