annotate configure.in @ 88:525bfdf936c6

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