annotate configure.ac @ 157:b25e9878c55a

fix for automake 1.13
author Felix Yan <felixonmars@gmail.com>
date Fri, 08 Feb 2013 19:50:27 +0800
parents 0881cd514c9c
children 41c02a0e7433
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@140 7 m4_define(libxtract_fix_version, 0)
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@128 17 AM_INIT_AUTOMAKE(1.6)
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@128 89 CFLAGS="$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@128 112 CFLAGS="$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@128 129 [ --with-java If --enable-swig - make with java bindings (default=no) ],
jamie@128 130 [with_java=true])
jamie@128 131
jamie@128 132 AM_CONDITIONAL(BUILD_JAVA, test "x${with_java}" = 'xtrue')
jamie@128 133
jamie@128 134 dnl If --enable-swig, make with java bindings
jamie@128 135 AC_ARG_WITH(python,
jamie@128 136 [ --with-python If --enable-swig - make with python bindings (default=no) ], [with_python=true])
jamie@128 137
jamie@128 138 AM_CONDITIONAL(BUILD_PYTHON, test "x${with_python}" = 'xtrue')
jamie@128 139
jamie@128 140 dnl are we building the simpletest example
jamie@128 141 if [[ "$simpletest" = "true" ]] ; then
jamie@128 142 AC_DEFINE([BUILD_SIMPLETEST], [1], [Build the simpletest example])
jamie@128 143 fi
jamie@128 144
jamie@128 145 AM_CONDITIONAL(BUILD_SIMPLETEST, test "x${simpletest}" = 'xtrue')
jamie@128 146
jamie@128 147 dnl Are we building the PD examples?
jamie@128 148 if [[ "$pd_example" = "true" ]] ; then
jamie@128 149 PD_SOURCES="xtract~.c"
jamie@128 150 AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example])
jamie@128 151 AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [
jamie@128 152 have_pd_hdr=no
jamie@128 153 echo
jamie@128 154 echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src"
jamie@128 155 echo
jamie@128 156 exit
jamie@128 157 ])
jamie@128 158 fi
jamie@128 159
jamie@128 160 AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue')
jamie@128 161
jamie@128 162
jamie@128 163 dnl Enable debugging (no)
jamie@128 164 AC_ARG_ENABLE(debug,
jamie@128 165 [ --enable-debug[[=value]] compile with debug [[default=no]]],
jamie@128 166 with_debug="yes",
jamie@128 167 with_debug="no")
jamie@128 168 if test "$with_debug" = "yes"
jamie@128 169 then
jamie@128 170 AC_DEFINE(DEBUG,1,[Define to enable debug])
jamie@128 171 CFLAGS="$CFLAGS -O0 -ggdb -g -Werror"
jamie@128 172 fi
jamie@128 173
jamie@128 174 AC_ARG_ENABLE(swig,
jamie@128 175 [ --enable-swig Generate swig bindings],
jamie@128 176 [case "${enableval}" in
jamie@128 177 yes) swig=true ;;
jamie@128 178 no) swig=false ;;
jamie@128 179 *) AC_MSG_ERROR(bad value ${enableval} for --enable-swig) ;;
jamie@128 180 esac],[swig=false])
jamie@128 181
jamie@128 182
jamie@128 183
jamie@128 184 if [[ "$with_java" = "true" ]] ; then
jamie@128 185 if test "$JAVAC" = ""
jamie@128 186 then
jamie@128 187 AC_PROG_JAVAC
jamie@128 188 fi
jamie@128 189 if test "$JAVAC" = "javac"
jamie@128 190 then
jamie@128 191 AC_JNI_INCLUDE_DIR
jamie@128 192
jamie@128 193 for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
jamie@128 194 do
jamie@128 195 CFLAGS="$CFLAGS -I$JNI_INCLUDE_DIR"
jamie@128 196 done
jamie@128 197 fi
jamie@128 198 dnl AC_PROG_JAVAH
jamie@128 199 dnl AC_PATH_PROG(JAVAH,javah)
jamie@128 200 fi
jamie@128 201
jamie@128 202 if [[ "$with_python" = "true" ]] ; then
jamie@128 203 AM_PATH_PYTHON
jamie@128 204 SWIG_PYTHON
jamie@128 205 fi
jamie@128 206
jamie@128 207
jamie@128 208 AM_CONDITIONAL(BUILD_SWIG, test "x${swig}" = 'xtrue')
jamie@128 209
jamie@128 210 dnl SWIG stuff
jamie@128 211 if [[ "$swig" = "true" ]] ; then
jamie@133 212 AX_PKG_SWIG(1.3.21, [], [ AC_MSG_ERROR([SWIG is not installed]) ])
jamie@128 213 AC_DEFINE([BUILD_SWIG], [1], [Build the swig bindings])
jamie@128 214 fi
jamie@128 215
jamie@128 216 dnl Check for architecture endian-ness
jamie@128 217 #AC_C_BIGENDIAN(bigendian=true, bigendian=false, bigendian=undefined)
jamie@128 218 #if [[ "$is_bigendian" = "false" ]] ; then
jamie@128 219 # AC_DEFINE([WORDS_BIGENDIAN], [0], [Architecture is big endian])
jamie@128 220 #else
jamie@128 221 # AC_DEFINE([WORDS_BIGENDIAN], [1], [Architecture is not big endian])
jamie@128 222 #fi
jamie@128 223
jamie@128 224
jamie@128 225 dnl ------------------------------------------
jamie@128 226 dnl ---- do some magic to gues the host opsys
jamie@128 227 dnl ---- taken from libvorbis configure.in
jamie@128 228 dnl ------------------------------------------
jamie@128 229 dnl AC_CANONICAL_HOST
jamie@128 230
jamie@128 231 dnl AC_SUBST(PD_CFLAGS,"$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1")
jamie@128 232 dnl AC_SUBST(PD_LDFLAGS,"$PD_LDFLAGS -shared")
jamie@128 233 dnl pd_ldflags="$PD_LDFLAGS -L/usr/local/lib -ldl"
jamie@128 234 if test -z "$GCC"; then
jamie@128 235 case $host in
jamie@128 236 *-*-irix*)
jamie@128 237 dnl If we're on IRIX, we wanna use cc even if gcc
jamie@128 238 dnl is there (unless the user has overriden us)...
jamie@128 239 if test -z "$CC"; then
jamie@128 240 CC=cc
jamie@128 241 fi
jamie@128 242 ;;
jamie@128 243 sparc-sun-solaris*)
jamie@128 244 PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
jamie@128 245 ;;
jamie@128 246 *)
jamie@128 247 PD_CFLAGS="-O"
jamie@128 248 ;;
jamie@128 249 esac
jamie@128 250 else
jamie@128 251
jamie@128 252 case $host in
jamie@128 253 *86-*-linux*)
jamie@128 254 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused"
jamie@128 255 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@128 256 dnl we could test for bad glibc here, but don't
jamie@128 257 PD_SUFFIX=pd_linux
jamie@128 258 ;;
jamie@128 259 powerpc-*-linux*)
jamie@128 260 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
jamie@128 261 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@128 262 PD_SUFFIX=pd_linux
jamie@128 263 ;;
jamie@128 264 *-*-linux*)
jamie@128 265 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -fPIC"
jamie@128 266 PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic"
jamie@128 267 PD_SUFFIX=pd_linux
jamie@128 268 ;;
jamie@128 269 sparc-sun-*)
jamie@128 270 echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet"
jamie@128 271 ;;
jamie@131 272 dnl *86-*-darwin*)
jamie@131 273 dnl PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
jamie@131 274 dnl PD_LDFLAGS="$PD_LDFLAGS -dynamiclib -mmacosx-version-min=10.5 -undefined dynamic_lookup -single_module"
jamie@131 275 dnl PD_SUFFIX=pd_darwin
jamie@131 276 dnl ;;
jamie@128 277 *-*-darwin*)
jamie@128 278 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
jamie@131 279 PD_LDFLAGS="$PD_LDFLAGS -bundle -undefined dynamic_lookup -flat_namespace"
jamie@128 280 PD_SUFFIX=pd_darwin
jamie@128 281 ;;
jamie@128 282
jamie@128 283 *)
jamie@128 284 dnl assume unix
jamie@128 285 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1"
jamie@128 286 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@128 287 PD_SUFFIX=pd_linux
jamie@128 288 ;;
jamie@128 289 esac
jamie@128 290 fi
jamie@128 291
jamie@128 292 PD_CFLAGS="$PD_CFLAGS -DPD"
jamie@128 293
jamie@128 294 AC_SUBST(PD_CFLAGS)
jamie@128 295 AC_SUBST(PD_LDFLAGS)
jamie@128 296 AC_SUBST(PD_SUFFIX)
jamie@128 297 AC_SUBST(PD_SOURCES)
jamie@128 298
jamie@145 299 AC_CONFIG_FILES([libxtract.pc])
jamie@128 300
jamie@128 301 dnl There must be a better way to do this...
jamie@145 302 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 303
jamie@128 304 echo
jamie@128 305 echo "**************************************************************"
jamie@128 306 echo
jamie@128 307 echo "Summary:"
jamie@128 308 echo
jamie@128 309 dnl echo you are using the ${host} architecture
jamie@128 310
jamie@145 311
jamie@145 312 if test -z "$DOXYGEN"; then
jamie@145 313 echo "doxygen documentation: no (doxygen not found)"
jamie@145 314 else
jamie@145 315 echo "doxygen documentation: yes"
jamie@145 316 fi
jamie@128 317 if test "$simpletest" = "true"; then
jamie@147 318 echo "simpletest example: yes"
jamie@128 319 else
jamie@145 320 echo "simpletest example: no"
jamie@128 321 fi
jamie@128 322 if test "$pd_example" = "true"; then
jamie@145 323 echo "PD external: yes"
jamie@145 324 echo
jamie@145 325 echo "The PD help files will be installed in:"
jamie@145 326 echo ${prefix}"/lib/doc/5.reference/xtract/"
jamie@145 327 echo "You must make sure that this is in your PD help path"
jamie@128 328 else
jamie@145 329 echo "PD external: no"
jamie@128 330 fi
jamie@128 331 if test "$swig" == "true"; then
jamie@145 332 echo "SWIG bindings: yes"
jamie@128 333 else
jamie@145 334 echo "SWIG bindings: no"
jamie@128 335 fi
jamie@128 336 if test "$with_java" == "true"; then
jamie@145 337 echo "with JAVA module: yes"
jamie@128 338 else
jamie@145 339 echo "with JAVA module: no"
jamie@128 340 fi
jamie@145 341 if test "$with_python" == "true"; then
jamie@145 342 echo "with Python module: yes"
jamie@145 343 else
jamie@145 344 echo "with Python module: no"
jamie@145 345 fi
jamie@149 346 if test "$use_ooura" == "true"; then
jamie@149 347 echo "Ooura FFT backend: yes"
jamie@149 348 else
jamie@149 349 echo "Accelerate FFT backend: yes"
jamie@149 350 fi
jamie@145 351
jamie@145 352
jamie@128 353 echo
jamie@128 354 echo "**************************************************************"
jamie@128 355 echo
jamie@128 356 echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}
jamie@128 357 echo
jamie@128 358
jamie@128 359