annotate configure.in @ 87:0df00d5c9269

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