annotate configure.in @ 95:432d97ee02ef

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