annotate configure.ac @ 246:bde5fa8692ff

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