annotate configure.ac @ 222:c8154ae85bef

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