annotate configure.in @ 90:8553b27a5062

Updated README and minor buld tweaks for OS X (That will probably break the Linux build (sigh)).
author Jamie Bullock <jamie@postlude.co.uk>
date Wed, 05 Sep 2007 17:44:23 +0000
parents 525bfdf936c6
children 35a3bb5c3ffd
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@88 88 dnl If --enable-swig, make with java bindings
jamie@88 89 AC_ARG_WITH(java,
jamie@88 90 [ --with-java If --enable-swig - make with java bindings (default=no) ],
jamie@88 91 [with_java=true])
jamie@88 92
jamie@88 93 AM_CONDITIONAL(BUILD_JAVA, test "x${with_java}" = 'xtrue')
jamie@88 94
jamie@88 95 dnl If --enable-swig, make with java bindings
jamie@88 96 AC_ARG_WITH(python,
jamie@88 97 [ --with-python If --enable-swig - make with python bindings (default=no) ], [with_python=true])
jamie@88 98
jamie@88 99 AM_CONDITIONAL(BUILD_PYTHON, test "x${with_python}" = 'xtrue')
jamie@88 100
jamie@29 101
jamie@29 102 dnl are we building the simpletest example
jamie@29 103 if [[ "$simpletest" = "true" ]] ; then
jamie@29 104 AC_DEFINE([BUILD_SIMPLETEST], [1], [Build the simpletest example])
jamie@29 105 fi
jamie@29 106
jamie@29 107 AM_CONDITIONAL(BUILD_SIMPLETEST, test "x${simpletest}" = 'xtrue')
jamie@29 108
jamie@9 109
jamie@9 110 dnl Are we building the PD examples?
jamie@9 111 if [[ "$pd_example" = "true" ]] ; then
jamie@9 112 PD_SOURCES="xtract~.c"
jamie@9 113 AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example])
jamie@9 114 AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [
jamie@4 115 have_pd_hdr=no
jamie@4 116 echo
jamie@4 117 echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src"
jamie@4 118 echo
jamie@4 119 exit
jamie@4 120 ])
jamie@9 121 fi
jamie@4 122
jamie@4 123 AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue')
jamie@4 124
jamie@87 125
jamie@17 126 dnl Enable debugging (no)
jamie@17 127 AC_ARG_ENABLE(debug,
jamie@17 128 [ --enable-debug[[=value]] compile with debug [[default=no]]],
jamie@17 129 with_debug="yes",
jamie@17 130 with_debug="no")
jamie@17 131 if test "$with_debug" = "yes"
jamie@17 132 then
jamie@17 133 AC_DEFINE(DEBUG,1,[Define to enable debug])
jamie@54 134 CFLAGS="$CFLAGS -O0 -ggdb -g"
jamie@17 135 fi
jamie@17 136
jamie@87 137 AC_ARG_ENABLE(swig,
jamie@87 138 [ --enable-swig Generate swig bindings],
jamie@87 139 [case "${enableval}" in
jamie@87 140 yes) swig=true ;;
jamie@87 141 no) swig=false ;;
jamie@87 142 *) AC_MSG_ERROR(bad value ${enableval} for --enable-swig) ;;
jamie@87 143 esac],[swig=false])
jamie@87 144
jamie@87 145
jamie@87 146 dnl SWIG stuff
jamie@87 147 if [[ "$swig" = "true" ]] ; then
jamie@87 148 AC_PROG_SWIG(1.3.21)
jamie@88 149 AC_DEFINE([BUILD_SWIG], [1], [Build the swig bindings])
jamie@88 150 fi
jamie@88 151
jamie@88 152 if [[ "$with_java" = "true" ]] ; then
jamie@88 153 AC_PROG_JAVAC
jamie@90 154 if test "$JAVAC" = "javac"
jamie@90 155 then
jamie@90 156 AC_JNI_INCLUDE_DIR
jamie@90 157
jamie@88 158
jamie@90 159 for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
jamie@90 160 do
jamie@90 161 CFLAGS="$CFLAGS -I$JNI_INCLUDE_DIR"
jamie@90 162 done
jamie@90 163 fi
jamie@88 164 dnl AC_PROG_JAVAH
jamie@88 165 dnl AC_PATH_PROG(JAVAH,javah)
jamie@88 166 fi
jamie@88 167
jamie@88 168 if [[ "$with_python" = "true" ]] ; then
jamie@87 169 AM_PATH_PYTHON
jamie@87 170 SWIG_PYTHON
jamie@87 171 fi
jamie@87 172
jamie@88 173
jamie@87 174 AM_CONDITIONAL(BUILD_SWIG, test "x${swig}" = 'xtrue')
jamie@87 175
jamie@90 176 dnl Are we building with fftw?
jamie@90 177 if [[ "$fft" = "true" ]] ; then
jamie@90 178 LDFLAGS="$LDFLAGS -lfftw3f"
jamie@90 179 AC_DEFINE([BUILD_FFT], [1], [Build the fft functions])
jamie@90 180 AC_CHECK_HEADER(fftw3.h, [have_fftw3_hdr=yes ], [
jamie@90 181 have_pd_hdr=no
jamie@90 182 echo
jamie@90 183 echo "no fftw3.h header found. try with option --with-fftw3-dir=/path/to/fftw3/header"
jamie@90 184 echo
jamie@90 185 exit
jamie@90 186 ])
jamie@90 187 fi
jamie@90 188
jamie@90 189 AM_CONDITIONAL(BUILD_FFT, test "x${fft}" = 'xtrue')
jamie@90 190
jamie@90 191
jamie@4 192 dnl ------------------------------------------
jamie@4 193 dnl ---- do some magic to gues the host opsys
jamie@4 194 dnl ---- taken from libvorbis configure.in
jamie@4 195 dnl ------------------------------------------
jamie@7 196 dnl AC_CANONICAL_HOST
jamie@4 197
jamie@9 198 dnl AC_SUBST(PD_CFLAGS,"$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1")
jamie@7 199 dnl AC_SUBST(PD_LDFLAGS,"$PD_LDFLAGS -shared")
jamie@7 200 dnl pd_ldflags="$PD_LDFLAGS -L/usr/local/lib -ldl"
jamie@4 201 if test -z "$GCC"; then
jamie@4 202 case $host in
jamie@4 203 *-*-irix*)
jamie@4 204 dnl If we're on IRIX, we wanna use cc even if gcc
jamie@4 205 dnl is there (unless the user has overriden us)...
jamie@4 206 if test -z "$CC"; then
jamie@4 207 CC=cc
jamie@4 208 fi
jamie@4 209 ;;
jamie@4 210 sparc-sun-solaris*)
jamie@4 211 PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
jamie@4 212 ;;
jamie@4 213 *)
jamie@4 214 PD_CFLAGS="-O"
jamie@4 215 ;;
jamie@4 216 esac
jamie@4 217 else
jamie@4 218
jamie@4 219 case $host in
jamie@4 220 *86-*-linux*)
jamie@54 221 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused"
jamie@17 222 PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic"
jamie@4 223 dnl we could test for bad glibc here, but don't
jamie@7 224 PD_SUFFIX=pd_linux
jamie@4 225 ;;
jamie@4 226 powerpc-*-linux*)
jamie@17 227 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
jamie@4 228 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@7 229 PD_SUFFIX=pd_linux
jamie@4 230 ;;
jamie@4 231 *-*-linux*)
jamie@17 232 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -fPIC"
jamie@17 233 PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic"
jamie@7 234 PD_SUFFIX=pd_linux
jamie@4 235 ;;
jamie@4 236 sparc-sun-*)
jamie@4 237 echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet"
jamie@4 238 ;;
jamie@17 239 *86-*-darwin*)
jamie@17 240 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
jamie@31 241 PD_LDFLAGS="$PD_LDFLAGS -dynamiclib -mmacosx-version-min=10.3 -undefined dynamic_lookup -single_module"
jamie@7 242 PD_SUFFIX=pd_darwin
jamie@17 243 ;;
jamie@17 244 *-*-darwin*)
jamie@17 245 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
jamie@17 246 PD_LDFLAGS="$PD_LDFLAGS -bundle -arch ppc -undefined suppress -flat_namespace"
jamie@17 247 PD_SUFFIX=pd_darwin
jamie@17 248 ;;
jamie@17 249
jamie@4 250 *)
jamie@4 251 dnl assume unix
jamie@9 252 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1"
jamie@4 253 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@7 254 PD_SUFFIX=pd_linux
jamie@4 255 ;;
jamie@4 256 esac
jamie@4 257 fi
jamie@4 258
jamie@9 259 PD_CFLAGS="$PD_CFLAGS -DPD"
jamie@9 260
jamie@7 261 AC_SUBST(PD_CFLAGS)
jamie@7 262 AC_SUBST(PD_LDFLAGS)
jamie@7 263 AC_SUBST(PD_SUFFIX)
jamie@9 264 AC_SUBST(PD_SOURCES)
jamie@7 265
jamie@13 266 AC_CONFIG_FILES([doc/documentation.doxygen
jamie@13 267 libxtract.pc])
jamie@2 268
jamie@88 269 dnl There must be a better way to do this...
jamie@88 270 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 271
jamie@16 272 echo
jamie@16 273 echo "**************************************************************"
jamie@27 274 echo
jamie@16 275 echo "Summary:"
jamie@27 276 echo
jamie@27 277 dnl echo you are using the ${host} architecture
jamie@16 278
jamie@30 279 if test "$fft" = "true"; then
jamie@30 280 echo "fft: yes (using fftw3f)"
jamie@16 281 else
jamie@30 282 echo "fft: no (not using fftw3, no fft functions)"
jamie@29 283 fi
jamie@29 284 if test "$simpletest" = "true"; then
jamie@29 285 echo "simpletest example: yes"
jamie@29 286 else
jamie@29 287 echo "simpletest example: no"
jamie@16 288 fi
jamie@17 289 if test "$pd_example" = "true"; then
jamie@27 290 echo "PD external: yes"
jamie@27 291 echo
jamie@27 292 echo "The PD help files will be installed in:"
jamie@27 293 echo ${prefix}"/lib/doc/5.reference/xtract/"
jamie@27 294 echo "You must make sure that this is in your PD help path"
jamie@16 295 else
jamie@29 296 echo "PD external: no"
jamie@16 297 fi
jamie@87 298 if test "$swig" == "true"; then
jamie@88 299 echo "SWIG bindings: yes"
jamie@87 300 else
jamie@88 301 echo "SWIG bindings: no"
jamie@88 302 fi
jamie@88 303 if test "$with_java" == "true"; then
jamie@88 304 echo "with JAVA module: yes"
jamie@88 305 else
jamie@88 306 echo "with JAVA module: no"
jamie@87 307 fi
jamie@27 308 echo
jamie@16 309 echo "**************************************************************"
jamie@27 310 echo
jamie@16 311 echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}
jamie@27 312 echo
jamie@16 313
jamie@16 314