jamie@128: AC_PREREQ(2.13) jamie@128: # Increment for major API changes, release status changes jamie@128: m4_define(libxtract_major_version, 0) jamie@128: # Increment for feature additions and enhancements jamie@140: m4_define(libxtract_minor_version, 7) jamie@128: # Increment for fixes jamie@140: m4_define(libxtract_fix_version, 0) jamie@128: # Development status jamie@128: m4_define(libIntegra_dev_status, [beta]) jamie@128: jamie@128: m4_define(libxtract_version, libxtract_major_version.libxtract_minor_version.libxtract_fix_version) jamie@128: jamie@128: PACKAGE=libxtract jamie@128: jamie@128: AC_INIT([libxtract], [libxtract_version], [libxtract-devel@lists.sourceforge.net]) jamie@128: AC_DEFINE(LIBXTRACT_VERSION, libxtract_version, [LibXtract Version]) jamie@128: AM_INIT_AUTOMAKE(1.6) jamie@128: AM_CONFIG_HEADER(config.h) jamie@128: AC_CONFIG_MACRO_DIR([m4]) jamie@128: AC_PROG_CC jamie@128: AC_PROG_LIBTOOL jamie@128: AC_PROG_INSTALL jamie@128: AC_C_BIGENDIAN jamie@128: AC_PATH_PROG(PKG_CONFIG, pkg-config, no) jamie@128: AC_ENABLE_STATIC(no) jamie@128: AC_ENABLE_SHARED(yes) jamie@128: AC_PROG_LIBTOOL jamie@128: AC_CHECK_HEADERS([math.h, stdlib.h, stdio.h]) jamie@145: jamie@145: dnl DOXYGEN support jamie@145: jamie@145: AC_CHECK_PROGS([DOXYGEN], [doxygen]) jamie@145: jamie@145: if test -z "$DOXYGEN"; jamie@145: then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support]) jamie@145: else jamie@145: AC_MSG_NOTICE([Doxygen found - continuing with Doxygen support]) jamie@145: fi jamie@145: jamie@145: AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) jamie@145: AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/documentation.doxygen])]) jamie@145: jamie@145: AC_SUBST(HAVE_DOXYGEN) jamie@145: dnl --enable flags jamie@128: jamie@128: AC_ARG_ENABLE(pd_example, jamie@128: [ --enable-pd_example Compile the Pure Data external example], jamie@128: [case "${enableval}" in jamie@128: yes) pd_example=true ;; jamie@128: no) pd_example=false ;; jamie@128: *) AC_MSG_ERROR(bad value ${enableval} for --enable-pd_external) ;; jamie@128: esac],[pd_example=false]) jamie@128: jamie@128: AC_ARG_ENABLE(simpletest, jamie@128: [ --enable-simpletest Compile the 'simpletest' example], jamie@128: [case "${enableval}" in jamie@128: yes) simpletest=true ;; jamie@128: no) simpletest=false ;; jamie@128: *) AC_MSG_ERROR(bad value ${enableval} for --enable-simpletest) ;; jamie@128: esac],[simpletest=false]) jamie@128: jamie@128: # libtool version: current:revision:age jamie@128: # jamie@128: # If the library source code has changed at all since the last update, then jamie@128: # increment revision (`c:r:a' becomes `c:r+1:a'). jamie@128: # jamie@128: # If any interfaces have been added, removed, or changed since the last update, jamie@128: # increment current, and set revision to 0. jamie@128: # jamie@128: # If any interfaces have been added since the last public release, then jamie@128: # increment age. jamie@128: # jamie@128: # If any interfaces have been removed since the last public release, then set jamie@128: # age to 0. jamie@128: XTRACT_SO_VERSION=0:0:0 jamie@128: jamie@128: CFLAGS="$CFLAGS -pedantic -ansi -fno-strict-aliasing -Wall -std=c99 -I/usr/local/include" jamie@128: LDFLAGS="$LDFLAGS -lm" jamie@128: jamie@128: AC_ARG_WITH(pd_dir, jamie@128: [ --with-pd-dir=path pd header path (default=/usr/local/include) ], jamie@128: [ jamie@128: CFLAGS="$CFLAGS -I$withval" jamie@128: echo jamie@128: echo "pd dir is $withval" jamie@128: echo jamie@128: ]) jamie@128: jamie@128: dnl set a specific java compiler jamie@128: AC_ARG_WITH(javac, jamie@128: [ --with-javac=compiler set a specific java compiler (determined automatically if not set) ], jamie@128: [JAVAC="$withval" jamie@128: echo jamie@128: echo "JAVAC is set to $withval" jamie@128: echo jamie@128: ]) jamie@128: jamie@128: dnl If --enable-swig, make with java bindings jamie@128: AC_ARG_WITH(java, jamie@128: [ --with-java If --enable-swig - make with java bindings (default=no) ], jamie@128: [with_java=true]) jamie@128: jamie@128: AM_CONDITIONAL(BUILD_JAVA, test "x${with_java}" = 'xtrue') jamie@128: jamie@128: dnl If --enable-swig, make with java bindings jamie@128: AC_ARG_WITH(python, jamie@128: [ --with-python If --enable-swig - make with python bindings (default=no) ], [with_python=true]) jamie@128: jamie@128: AM_CONDITIONAL(BUILD_PYTHON, test "x${with_python}" = 'xtrue') jamie@128: jamie@128: jamie@128: dnl are we building the simpletest example jamie@128: if [[ "$simpletest" = "true" ]] ; then jamie@128: AC_DEFINE([BUILD_SIMPLETEST], [1], [Build the simpletest example]) jamie@128: fi jamie@128: jamie@128: AM_CONDITIONAL(BUILD_SIMPLETEST, test "x${simpletest}" = 'xtrue') jamie@128: jamie@128: dnl Are we building the PD examples? jamie@128: if [[ "$pd_example" = "true" ]] ; then jamie@128: PD_SOURCES="xtract~.c" jamie@128: AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example]) jamie@128: AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [ jamie@128: have_pd_hdr=no jamie@128: echo jamie@128: echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src" jamie@128: echo jamie@128: exit jamie@128: ]) jamie@128: fi jamie@128: jamie@128: AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue') jamie@128: jamie@128: jamie@128: dnl Enable debugging (no) jamie@128: AC_ARG_ENABLE(debug, jamie@128: [ --enable-debug[[=value]] compile with debug [[default=no]]], jamie@128: with_debug="yes", jamie@128: with_debug="no") jamie@128: if test "$with_debug" = "yes" jamie@128: then jamie@128: AC_DEFINE(DEBUG,1,[Define to enable debug]) jamie@128: CFLAGS="$CFLAGS -O0 -ggdb -g -Werror" jamie@128: fi jamie@128: jamie@128: AC_ARG_ENABLE(swig, jamie@128: [ --enable-swig Generate swig bindings], jamie@128: [case "${enableval}" in jamie@128: yes) swig=true ;; jamie@128: no) swig=false ;; jamie@128: *) AC_MSG_ERROR(bad value ${enableval} for --enable-swig) ;; jamie@128: esac],[swig=false]) jamie@128: jamie@128: jamie@128: jamie@128: if [[ "$with_java" = "true" ]] ; then jamie@128: if test "$JAVAC" = "" jamie@128: then jamie@128: AC_PROG_JAVAC jamie@128: fi jamie@128: if test "$JAVAC" = "javac" jamie@128: then jamie@128: AC_JNI_INCLUDE_DIR jamie@128: jamie@128: for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS jamie@128: do jamie@128: CFLAGS="$CFLAGS -I$JNI_INCLUDE_DIR" jamie@128: done jamie@128: fi jamie@128: dnl AC_PROG_JAVAH jamie@128: dnl AC_PATH_PROG(JAVAH,javah) jamie@128: fi jamie@128: jamie@128: if [[ "$with_python" = "true" ]] ; then jamie@128: AM_PATH_PYTHON jamie@128: SWIG_PYTHON jamie@128: fi jamie@128: jamie@128: jamie@128: AM_CONDITIONAL(BUILD_SWIG, test "x${swig}" = 'xtrue') jamie@128: jamie@128: dnl SWIG stuff jamie@128: if [[ "$swig" = "true" ]] ; then jamie@133: AX_PKG_SWIG(1.3.21, [], [ AC_MSG_ERROR([SWIG is not installed]) ]) jamie@128: AC_DEFINE([BUILD_SWIG], [1], [Build the swig bindings]) jamie@128: fi jamie@128: jamie@128: dnl Check for architecture endian-ness jamie@128: #AC_C_BIGENDIAN(bigendian=true, bigendian=false, bigendian=undefined) jamie@128: #if [[ "$is_bigendian" = "false" ]] ; then jamie@128: # AC_DEFINE([WORDS_BIGENDIAN], [0], [Architecture is big endian]) jamie@128: #else jamie@128: # AC_DEFINE([WORDS_BIGENDIAN], [1], [Architecture is not big endian]) jamie@128: #fi jamie@128: jamie@128: jamie@128: dnl ------------------------------------------ jamie@128: dnl ---- do some magic to gues the host opsys jamie@128: dnl ---- taken from libvorbis configure.in jamie@128: dnl ------------------------------------------ jamie@128: dnl AC_CANONICAL_HOST jamie@128: jamie@128: dnl AC_SUBST(PD_CFLAGS,"$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1") jamie@128: dnl AC_SUBST(PD_LDFLAGS,"$PD_LDFLAGS -shared") jamie@128: dnl pd_ldflags="$PD_LDFLAGS -L/usr/local/lib -ldl" jamie@128: if test -z "$GCC"; then jamie@128: case $host in jamie@128: *-*-irix*) jamie@128: dnl If we're on IRIX, we wanna use cc even if gcc jamie@128: dnl is there (unless the user has overriden us)... jamie@128: if test -z "$CC"; then jamie@128: CC=cc jamie@128: fi jamie@128: ;; jamie@128: sparc-sun-solaris*) jamie@128: PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92" jamie@128: ;; jamie@128: *) jamie@128: PD_CFLAGS="-O" jamie@128: ;; jamie@128: esac jamie@128: else jamie@128: jamie@128: case $host in jamie@128: *86-*-linux*) jamie@128: PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused" jamie@128: PD_LDFLAGS="$PD_LDFLAGS -shared" jamie@128: dnl we could test for bad glibc here, but don't jamie@128: PD_SUFFIX=pd_linux jamie@128: ;; jamie@128: powerpc-*-linux*) jamie@128: PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" jamie@128: PD_LDFLAGS="$PD_LDFLAGS -shared" jamie@128: PD_SUFFIX=pd_linux jamie@128: ;; jamie@128: *-*-linux*) jamie@128: PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -fPIC" jamie@128: PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic" jamie@128: PD_SUFFIX=pd_linux jamie@128: ;; jamie@128: sparc-sun-*) jamie@128: echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet" jamie@128: ;; jamie@131: dnl *86-*-darwin*) jamie@131: dnl PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" jamie@131: dnl PD_LDFLAGS="$PD_LDFLAGS -dynamiclib -mmacosx-version-min=10.5 -undefined dynamic_lookup -single_module" jamie@131: dnl PD_SUFFIX=pd_darwin jamie@131: dnl ;; jamie@128: *-*-darwin*) jamie@128: PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" jamie@131: PD_LDFLAGS="$PD_LDFLAGS -bundle -undefined dynamic_lookup -flat_namespace" jamie@128: PD_SUFFIX=pd_darwin jamie@128: ;; jamie@128: jamie@128: *) jamie@128: dnl assume unix jamie@128: PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" jamie@128: PD_LDFLAGS="$PD_LDFLAGS -shared" jamie@128: PD_SUFFIX=pd_linux jamie@128: ;; jamie@128: esac jamie@128: fi jamie@128: jamie@128: PD_CFLAGS="$PD_CFLAGS -DPD" jamie@128: jamie@128: AC_SUBST(PD_CFLAGS) jamie@128: AC_SUBST(PD_LDFLAGS) jamie@128: AC_SUBST(PD_SUFFIX) jamie@128: AC_SUBST(PD_SOURCES) jamie@128: jamie@145: AC_CONFIG_FILES([libxtract.pc]) jamie@128: jamie@128: dnl There must be a better way to do this... jamie@145: 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: jamie@128: echo jamie@128: echo "**************************************************************" jamie@128: echo jamie@128: echo "Summary:" jamie@128: echo jamie@128: dnl echo you are using the ${host} architecture jamie@128: jamie@145: jamie@145: if test -z "$DOXYGEN"; then jamie@145: echo "doxygen documentation: no (doxygen not found)" jamie@145: else jamie@145: echo "doxygen documentation: yes" jamie@145: fi jamie@128: if test "$simpletest" = "true"; then jamie@145: echo "simpletest example: yes" jamie@128: else jamie@145: echo "simpletest example: no" jamie@128: fi jamie@128: if test "$pd_example" = "true"; then jamie@145: echo "PD external: yes" jamie@145: echo jamie@145: echo "The PD help files will be installed in:" jamie@145: echo ${prefix}"/lib/doc/5.reference/xtract/" jamie@145: echo "You must make sure that this is in your PD help path" jamie@128: else jamie@145: echo "PD external: no" jamie@128: fi jamie@128: if test "$swig" == "true"; then jamie@145: echo "SWIG bindings: yes" jamie@128: else jamie@145: echo "SWIG bindings: no" jamie@128: fi jamie@128: if test "$with_java" == "true"; then jamie@145: echo "with JAVA module: yes" jamie@128: else jamie@145: echo "with JAVA module: no" jamie@128: fi jamie@145: if test "$with_python" == "true"; then jamie@145: echo "with Python module: yes" jamie@145: else jamie@145: echo "with Python module: no" jamie@145: fi jamie@145: jamie@145: jamie@128: echo jamie@128: echo "**************************************************************" jamie@128: echo jamie@128: echo Configuration completed successfully. Type \'make\' to build ${PACKAGE} jamie@128: echo jamie@128: jamie@128: