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