annotate configure.in @ 118:8c8b508dcc95

- Committing ancient change left on HD. Relates to FFTW fft type
author Jamie Bullock <jamie@postlude.co.uk>
date Fri, 12 Sep 2008 13:52:20 +0000
parents 859495925633
children efb1c1ae2ba8
rev   line source
jamie@1 1 AC_PREREQ(2.13)
jamie@26 2 # Increment for major API changes, release status changes
jamie@23 3 m4_define(libxtract_major_version, 0)
jamie@23 4 # Increment for feature additions and enhancements
jamie@115 5 m4_define(libxtract_minor_version, 6)
jamie@23 6 # Increment for fixes
jamie@116 7 m4_define(libxtract_fix_version, 1)
jamie@118 8 # Development status
jamie@118 9 m4_define(libIntegra_dev_status, [beta])
jamie@23 10
jamie@23 11 m4_define(libxtract_version, libxtract_major_version.libxtract_minor_version.libxtract_fix_version)
jamie@23 12
jamie@18 13 PACKAGE=libxtract
jamie@18 14
jamie@87 15 AC_INIT(libxtract, libxtract_version, libxtract-devel@lists.sourceforge.net)
jamie@23 16 AC_DEFINE(LIBXTRACT_VERSION, libxtract_version, [LibXtract Version])
jamie@23 17 AM_INIT_AUTOMAKE($PACKAGE, $LIBXTRACT_VERSION)
jamie@1 18 AM_CONFIG_HEADER(config.h)
jamie@1 19 AC_PROG_CC
jamie@17 20 AC_PROG_LIBTOOL
jamie@1 21 AC_PROG_INSTALL
jamie@113 22 AC_C_BIGENDIAN
jamie@17 23 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
jamie@1 24 AC_ENABLE_STATIC(no)
jamie@1 25 AC_ENABLE_SHARED(yes)
jamie@1 26 AC_PROG_LIBTOOL
jamie@17 27 AC_CHECK_HEADERS([math.h, stdlib.h, stdio.h])
jamie@2 28 AC_CHECK_PROG([DOXYGEN], [doxygen], [doc], [])
jamie@2 29 AC_SUBST(DOXYGEN)
jamie@1 30
jamie@30 31 AC_ARG_ENABLE(fft,
jamie@30 32 [ --enable-fft Turn fft-based fft processing on],
jamie@1 33 [case "${enableval}" in
jamie@30 34 yes) fft=true ;;
jamie@30 35 no) fft=false ;;
jamie@30 36 *) AC_MSG_ERROR(bad value ${enableval} for --enable-fft) ;;
jamie@30 37 esac],[fft=false])
jamie@1 38
jamie@4 39 AC_ARG_ENABLE(pd_example,
jamie@4 40 [ --enable-pd_example Compile the Pure Data external example],
jamie@4 41 [case "${enableval}" in
jamie@9 42 yes) pd_example=true ;;
jamie@9 43 no) pd_example=false ;;
jamie@4 44 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pd_external) ;;
jamie@9 45 esac],[pd_example=false])
jamie@29 46
jamie@29 47 AC_ARG_ENABLE(simpletest,
jamie@29 48 [ --enable-simpletest Compile the 'simpletest' example],
jamie@29 49 [case "${enableval}" in
jamie@29 50 yes) simpletest=true ;;
jamie@29 51 no) simpletest=false ;;
jamie@29 52 *) AC_MSG_ERROR(bad value ${enableval} for --enable-simpletest) ;;
jamie@29 53 esac],[simpletest=false])
jamie@4 54
jamie@4 55 # libtool version: current:revision:age
jamie@4 56 #
jamie@4 57 # If the library source code has changed at all since the last update, then
jamie@4 58 # increment revision (`c:r:a' becomes `c:r+1:a').
jamie@4 59 #
jamie@4 60 # If any interfaces have been added, removed, or changed since the last update,
jamie@4 61 # increment current, and set revision to 0.
jamie@4 62 #
jamie@4 63 # If any interfaces have been added since the last public release, then
jamie@4 64 # increment age.
jamie@4 65 #
jamie@4 66 # If any interfaces have been removed since the last public release, then set
jamie@4 67 # age to 0.
jamie@1 68 XTRACT_SO_VERSION=0:0:0
jamie@4 69
jamie@87 70 CFLAGS="$CFLAGS -pedantic -ansi -fno-strict-aliasing -Wall -std=c99 -I/usr/local/include"
jamie@31 71 LDFLAGS="$LDFLAGS -lm"
jamie@1 72
jamie@4 73 AC_ARG_WITH(pd_dir,
jamie@4 74 [ --with-pd-dir=path pd header path (default=/usr/local/include) ],
jamie@4 75 [
jamie@7 76 CFLAGS="$CFLAGS -I$withval"
jamie@4 77 echo
jamie@4 78 echo "pd dir is $withval"
jamie@4 79 echo
jamie@4 80 ])
jamie@4 81
jamie@9 82 AC_ARG_WITH(fftw3_dir,
jamie@9 83 [ --with-fftw3-dir=path fftw3 header path (default=/usr/local/include) ],
jamie@9 84 [
jamie@9 85 CFLAGS="$CFLAGS -I$withval"
jamie@9 86 echo
jamie@9 87 echo "fftw3 dir is $withval"
jamie@9 88 echo
jamie@9 89 ])
jamie@9 90
jamie@98 91 dnl Set FFT optimisation level
jamie@98 92 AC_ARG_WITH(fft_optimisation,
jamie@98 93 [ --with-fft_optimisation=level set fft optimistaion level (default=1)],
jamie@98 94 [
jamie@98 95 FFT_OPTIMISATION="$withval"
jamie@98 96 echo
jamie@98 97 echo "fft optimisation level is $withval"
jamie@98 98 echo
jamie@98 99 ])
jamie@98 100
jamie@92 101 dnl set a specific java compiler
jamie@92 102 AC_ARG_WITH(javac,
jamie@92 103 [ --with-javac=compiler set a specific java compiler (determined automatically if not set) ],
jamie@92 104 [JAVAC="$withval"
jamie@92 105 echo
jamie@92 106 echo "JAVAC is set to $withval"
jamie@92 107 echo
jamie@92 108 ])
jamie@92 109
jamie@88 110 dnl If --enable-swig, make with java bindings
jamie@88 111 AC_ARG_WITH(java,
jamie@88 112 [ --with-java If --enable-swig - make with java bindings (default=no) ],
jamie@88 113 [with_java=true])
jamie@88 114
jamie@88 115 AM_CONDITIONAL(BUILD_JAVA, test "x${with_java}" = 'xtrue')
jamie@88 116
jamie@88 117 dnl If --enable-swig, make with java bindings
jamie@88 118 AC_ARG_WITH(python,
jamie@88 119 [ --with-python If --enable-swig - make with python bindings (default=no) ], [with_python=true])
jamie@88 120
jamie@88 121 AM_CONDITIONAL(BUILD_PYTHON, test "x${with_python}" = 'xtrue')
jamie@88 122
jamie@29 123
jamie@29 124 dnl are we building the simpletest example
jamie@29 125 if [[ "$simpletest" = "true" ]] ; then
jamie@29 126 AC_DEFINE([BUILD_SIMPLETEST], [1], [Build the simpletest example])
jamie@29 127 fi
jamie@29 128
jamie@29 129 AM_CONDITIONAL(BUILD_SIMPLETEST, test "x${simpletest}" = 'xtrue')
jamie@29 130
jamie@9 131 dnl Are we building the PD examples?
jamie@9 132 if [[ "$pd_example" = "true" ]] ; then
jamie@9 133 PD_SOURCES="xtract~.c"
jamie@9 134 AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example])
jamie@9 135 AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [
jamie@4 136 have_pd_hdr=no
jamie@4 137 echo
jamie@4 138 echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src"
jamie@4 139 echo
jamie@4 140 exit
jamie@4 141 ])
jamie@9 142 fi
jamie@4 143
jamie@4 144 AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue')
jamie@4 145
jamie@87 146
jamie@17 147 dnl Enable debugging (no)
jamie@17 148 AC_ARG_ENABLE(debug,
jamie@17 149 [ --enable-debug[[=value]] compile with debug [[default=no]]],
jamie@17 150 with_debug="yes",
jamie@17 151 with_debug="no")
jamie@17 152 if test "$with_debug" = "yes"
jamie@17 153 then
jamie@17 154 AC_DEFINE(DEBUG,1,[Define to enable debug])
jamie@98 155 CFLAGS="$CFLAGS -O0 -ggdb -g -Werror"
jamie@17 156 fi
jamie@17 157
jamie@87 158 AC_ARG_ENABLE(swig,
jamie@87 159 [ --enable-swig Generate swig bindings],
jamie@87 160 [case "${enableval}" in
jamie@87 161 yes) swig=true ;;
jamie@87 162 no) swig=false ;;
jamie@87 163 *) AC_MSG_ERROR(bad value ${enableval} for --enable-swig) ;;
jamie@87 164 esac],[swig=false])
jamie@87 165
jamie@87 166
jamie@88 167
jamie@88 168 if [[ "$with_java" = "true" ]] ; then
jamie@92 169 if test "$JAVAC" = ""
jamie@92 170 then
jamie@92 171 AC_PROG_JAVAC
jamie@92 172 fi
jamie@90 173 if test "$JAVAC" = "javac"
jamie@90 174 then
jamie@90 175 AC_JNI_INCLUDE_DIR
jamie@90 176
jamie@90 177 for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
jamie@90 178 do
jamie@90 179 CFLAGS="$CFLAGS -I$JNI_INCLUDE_DIR"
jamie@90 180 done
jamie@90 181 fi
jamie@88 182 dnl AC_PROG_JAVAH
jamie@88 183 dnl AC_PATH_PROG(JAVAH,javah)
jamie@88 184 fi
jamie@88 185
jamie@88 186 if [[ "$with_python" = "true" ]] ; then
jamie@87 187 AM_PATH_PYTHON
jamie@87 188 SWIG_PYTHON
jamie@87 189 fi
jamie@87 190
jamie@88 191
jamie@87 192 AM_CONDITIONAL(BUILD_SWIG, test "x${swig}" = 'xtrue')
jamie@87 193
jamie@103 194 dnl SWIG stuff
jamie@103 195 if [[ "$swig" = "true" ]] ; then
jamie@103 196 AC_PROG_SWIG(1.3.21)
jamie@103 197 AC_DEFINE([BUILD_SWIG], [1], [Build the swig bindings])
jamie@103 198 fi
jamie@103 199
jamie@90 200 dnl Are we building with fftw?
jamie@90 201 if [[ "$fft" = "true" ]] ; then
jamie@90 202 LDFLAGS="$LDFLAGS -lfftw3f"
jamie@90 203 AC_DEFINE([BUILD_FFT], [1], [Build the fft functions])
jamie@98 204 if test "$FFT_OPTIMISATION" = ""
jamie@98 205 then
jamie@98 206 AC_DEFINE([XTRACT_FFT_OPTIMISATION_LEVEL], [1], [fft optimisation 1])
jamie@98 207 else
jamie@98 208 # AC_SUBST(OPTIMISATION_LEVEL, "$FFT_OPTIMISATION")
jamie@98 209 AC_DEFINE_UNQUOTED(XTRACT_FFT_OPTIMISATION_LEVEL, ${FFT_OPTIMISATION})
jamie@98 210 fi
jamie@90 211 AC_CHECK_HEADER(fftw3.h, [have_fftw3_hdr=yes ], [
jamie@90 212 have_pd_hdr=no
jamie@90 213 echo
jamie@90 214 echo "no fftw3.h header found. try with option --with-fftw3-dir=/path/to/fftw3/header"
jamie@90 215 echo
jamie@90 216 exit
jamie@90 217 ])
jamie@90 218 fi
jamie@90 219
jamie@90 220 AM_CONDITIONAL(BUILD_FFT, test "x${fft}" = 'xtrue')
jamie@90 221
jamie@113 222 dnl Check for architecture endian-ness
jamie@113 223 #AC_C_BIGENDIAN(bigendian=true, bigendian=false, bigendian=undefined)
jamie@113 224 #if [[ "$is_bigendian" = "false" ]] ; then
jamie@113 225 # AC_DEFINE([WORDS_BIGENDIAN], [0], [Architecture is big endian])
jamie@113 226 #else
jamie@113 227 # AC_DEFINE([WORDS_BIGENDIAN], [1], [Architecture is not big endian])
jamie@113 228 #fi
jamie@113 229
jamie@90 230
jamie@4 231 dnl ------------------------------------------
jamie@4 232 dnl ---- do some magic to gues the host opsys
jamie@4 233 dnl ---- taken from libvorbis configure.in
jamie@4 234 dnl ------------------------------------------
jamie@7 235 dnl AC_CANONICAL_HOST
jamie@4 236
jamie@9 237 dnl AC_SUBST(PD_CFLAGS,"$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1")
jamie@7 238 dnl AC_SUBST(PD_LDFLAGS,"$PD_LDFLAGS -shared")
jamie@7 239 dnl pd_ldflags="$PD_LDFLAGS -L/usr/local/lib -ldl"
jamie@4 240 if test -z "$GCC"; then
jamie@4 241 case $host in
jamie@4 242 *-*-irix*)
jamie@4 243 dnl If we're on IRIX, we wanna use cc even if gcc
jamie@4 244 dnl is there (unless the user has overriden us)...
jamie@4 245 if test -z "$CC"; then
jamie@4 246 CC=cc
jamie@4 247 fi
jamie@4 248 ;;
jamie@4 249 sparc-sun-solaris*)
jamie@4 250 PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
jamie@4 251 ;;
jamie@4 252 *)
jamie@4 253 PD_CFLAGS="-O"
jamie@4 254 ;;
jamie@4 255 esac
jamie@4 256 else
jamie@4 257
jamie@4 258 case $host in
jamie@4 259 *86-*-linux*)
jamie@54 260 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused"
jamie@17 261 PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic"
jamie@4 262 dnl we could test for bad glibc here, but don't
jamie@7 263 PD_SUFFIX=pd_linux
jamie@4 264 ;;
jamie@4 265 powerpc-*-linux*)
jamie@17 266 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
jamie@4 267 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@7 268 PD_SUFFIX=pd_linux
jamie@4 269 ;;
jamie@4 270 *-*-linux*)
jamie@17 271 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -fPIC"
jamie@17 272 PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic"
jamie@7 273 PD_SUFFIX=pd_linux
jamie@4 274 ;;
jamie@4 275 sparc-sun-*)
jamie@4 276 echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet"
jamie@4 277 ;;
jamie@17 278 *86-*-darwin*)
jamie@17 279 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
jamie@31 280 PD_LDFLAGS="$PD_LDFLAGS -dynamiclib -mmacosx-version-min=10.3 -undefined dynamic_lookup -single_module"
jamie@7 281 PD_SUFFIX=pd_darwin
jamie@17 282 ;;
jamie@17 283 *-*-darwin*)
jamie@17 284 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
jamie@17 285 PD_LDFLAGS="$PD_LDFLAGS -bundle -arch ppc -undefined suppress -flat_namespace"
jamie@17 286 PD_SUFFIX=pd_darwin
jamie@17 287 ;;
jamie@17 288
jamie@4 289 *)
jamie@4 290 dnl assume unix
jamie@9 291 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1"
jamie@4 292 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@7 293 PD_SUFFIX=pd_linux
jamie@4 294 ;;
jamie@4 295 esac
jamie@4 296 fi
jamie@4 297
jamie@9 298 PD_CFLAGS="$PD_CFLAGS -DPD"
jamie@9 299
jamie@7 300 AC_SUBST(PD_CFLAGS)
jamie@7 301 AC_SUBST(PD_LDFLAGS)
jamie@7 302 AC_SUBST(PD_SUFFIX)
jamie@9 303 AC_SUBST(PD_SOURCES)
jamie@7 304
jamie@13 305 AC_CONFIG_FILES([doc/documentation.doxygen
jamie@13 306 libxtract.pc])
jamie@2 307
jamie@88 308 dnl There must be a better way to do this...
jamie@88 309 AC_OUTPUT(Makefile src/Makefile xtract/Makefile doc/Makefile examples/Makefile examples/puredata/Makefile examples/simpletest/Makefile swig/Makefile swig/python/Makefile swig/java/Makefile)
jamie@16 310
jamie@16 311 echo
jamie@16 312 echo "**************************************************************"
jamie@27 313 echo
jamie@16 314 echo "Summary:"
jamie@27 315 echo
jamie@27 316 dnl echo you are using the ${host} architecture
jamie@16 317
jamie@30 318 if test "$fft" = "true"; then
jamie@30 319 echo "fft: yes (using fftw3f)"
jamie@16 320 else
jamie@30 321 echo "fft: no (not using fftw3, no fft functions)"
jamie@29 322 fi
jamie@29 323 if test "$simpletest" = "true"; then
jamie@29 324 echo "simpletest example: yes"
jamie@29 325 else
jamie@29 326 echo "simpletest example: no"
jamie@16 327 fi
jamie@17 328 if test "$pd_example" = "true"; then
jamie@27 329 echo "PD external: yes"
jamie@27 330 echo
jamie@27 331 echo "The PD help files will be installed in:"
jamie@27 332 echo ${prefix}"/lib/doc/5.reference/xtract/"
jamie@27 333 echo "You must make sure that this is in your PD help path"
jamie@16 334 else
jamie@29 335 echo "PD external: no"
jamie@16 336 fi
jamie@87 337 if test "$swig" == "true"; then
jamie@88 338 echo "SWIG bindings: yes"
jamie@87 339 else
jamie@88 340 echo "SWIG bindings: no"
jamie@88 341 fi
jamie@88 342 if test "$with_java" == "true"; then
jamie@88 343 echo "with JAVA module: yes"
jamie@88 344 else
jamie@88 345 echo "with JAVA module: no"
jamie@87 346 fi
jamie@27 347 echo
jamie@16 348 echo "**************************************************************"
jamie@27 349 echo
jamie@16 350 echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}
jamie@27 351 echo
jamie@16 352
jamie@16 353