jamie@1: AC_PREREQ(2.13) jamie@4: AC_INIT([libxtract], [0.11], [bugs@postlude.co.uk]) jamie@1: jamie@1: AM_INIT_AUTOMAKE($PACKAGE, $VERSION) jamie@1: AM_CONFIG_HEADER(config.h) jamie@1: AC_PROG_CC jamie@1: AC_PROG_INSTALL jamie@1: AC_ENABLE_STATIC(no) jamie@1: AC_ENABLE_SHARED(yes) jamie@1: AC_PROG_LIBTOOL jamie@1: #AC_ARG_WITH(fftw, AC_HELP_STRING([--with-vector], [build vector features]), jamie@1: # [ if test $withval = "yes"; then with_vector=yes ; jamie@1: # else with_vector=no ; fi ], with_vector=no) jamie@1: jamie@1: AC_CHECK_HEADERS([math.h]) jamie@2: AC_CHECK_PROG([DOXYGEN], [doxygen], [doc], []) jamie@2: AC_SUBST(DOXYGEN) jamie@1: jamie@1: AC_ARG_ENABLE(vector, jamie@1: [ --enable-vector Turn fft-based vector processing on], jamie@1: [case "${enableval}" in jamie@1: yes) vector=true ;; jamie@1: no) vector=false ;; jamie@1: *) AC_MSG_ERROR(bad value ${enableval} for --enable-vector) ;; jamie@1: esac],[vector=false]) jamie@1: jamie@4: AC_ARG_ENABLE(pd_example, jamie@4: [ --enable-pd_example Compile the Pure Data external example], jamie@4: [case "${enableval}" in jamie@9: yes) pd_example=true ;; jamie@9: no) pd_example=false ;; jamie@4: *) AC_MSG_ERROR(bad value ${enableval} for --enable-pd_external) ;; jamie@9: esac],[pd_example=false]) jamie@4: jamie@4: # libtool version: current:revision:age jamie@4: # jamie@4: # If the library source code has changed at all since the last update, then jamie@4: # increment revision (`c:r:a' becomes `c:r+1:a'). jamie@4: # jamie@4: # If any interfaces have been added, removed, or changed since the last update, jamie@4: # increment current, and set revision to 0. jamie@4: # jamie@4: # If any interfaces have been added since the last public release, then jamie@4: # increment age. jamie@4: # jamie@4: # If any interfaces have been removed since the last public release, then set jamie@4: # age to 0. jamie@1: XTRACT_SO_VERSION=0:0:0 jamie@4: jamie@9: CFLAGS="$CFLAGS -pedantic -ansi" jamie@9: LDFLAGS="$LDFLAGS -lm" jamie@1: jamie@4: AC_ARG_WITH(pd_dir, jamie@4: [ --with-pd-dir=path pd header path (default=/usr/local/include) ], jamie@4: [ jamie@7: CFLAGS="$CFLAGS -I$withval" jamie@4: echo jamie@4: echo "pd dir is $withval" jamie@4: echo jamie@4: ]) jamie@4: jamie@9: AC_ARG_WITH(fftw3_dir, jamie@9: [ --with-fftw3-dir=path fftw3 header path (default=/usr/local/include) ], jamie@9: [ jamie@9: CFLAGS="$CFLAGS -I$withval" jamie@9: echo jamie@9: echo "fftw3 dir is $withval" jamie@9: echo jamie@9: ]) jamie@9: jamie@9: dnl Are we building with fftw? jamie@9: #if [[ "$with_vector" = "yes" ]] ; then jamie@9: if [[ "$vector" = "true" ]] ; then jamie@9: LDFLAGS="$LDFLAGS -lfftw3f" jamie@9: AC_DEFINE([BUILD_VECTOR], [1], [Build the vector functions]) jamie@9: AC_CHECK_HEADER(fftw3.h, [have_fftw3_hdr=yes ], [ jamie@9: have_pd_hdr=no jamie@9: echo jamie@9: echo "no fftw3.h header found. try with option --with-fftw3-dir=/path/to/fftw3/header" jamie@9: echo jamie@9: exit jamie@9: ]) jamie@9: fi jamie@9: jamie@9: AM_CONDITIONAL(BUILD_VECTOR, test "x${vector}" = 'xtrue') jamie@9: jamie@9: dnl Are we building the PD examples? jamie@9: if [[ "$pd_example" = "true" ]] ; then jamie@9: PD_SOURCES="xtract~.c" jamie@9: AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example]) jamie@9: AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [ jamie@4: have_pd_hdr=no jamie@4: echo jamie@4: echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src" jamie@4: echo jamie@4: exit jamie@4: ]) jamie@9: dnl At some point we need to support other platforms, and include checks jamie@9: dnl pd_suffix=pd_linux jamie@9: fi jamie@4: jamie@4: AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue') jamie@4: jamie@4: dnl ------------------------------------------ jamie@4: dnl ---- do some magic to gues the host opsys jamie@4: dnl ---- taken from libvorbis configure.in jamie@4: dnl ------------------------------------------ jamie@7: dnl AC_CANONICAL_HOST jamie@4: jamie@9: dnl AC_SUBST(PD_CFLAGS,"$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1") jamie@7: dnl AC_SUBST(PD_LDFLAGS,"$PD_LDFLAGS -shared") jamie@7: dnl pd_ldflags="$PD_LDFLAGS -L/usr/local/lib -ldl" jamie@4: if test -z "$GCC"; then jamie@4: case $host in jamie@4: *-*-irix*) jamie@4: dnl If we're on IRIX, we wanna use cc even if gcc jamie@4: dnl is there (unless the user has overriden us)... jamie@4: if test -z "$CC"; then jamie@4: CC=cc jamie@4: fi jamie@4: ;; jamie@4: sparc-sun-solaris*) jamie@4: PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92" jamie@4: ;; jamie@4: *) jamie@4: PD_CFLAGS="-O" jamie@4: ;; jamie@4: esac jamie@4: else jamie@4: jamie@4: case $host in jamie@4: *86-*-linux*) jamie@9: PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" jamie@4: PD_LDFLAGS="$PD_LDFLAGS -shared" jamie@4: dnl we could test for bad glibc here, but don't jamie@7: PD_SUFFIX=pd_linux jamie@4: ;; jamie@4: powerpc-*-linux*) jamie@9: PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1 " jamie@4: PD_LDFLAGS="$PD_LDFLAGS -shared" jamie@7: PD_SUFFIX=pd_linux jamie@4: ;; jamie@4: *-*-linux*) jamie@9: PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1 -fPIC" jamie@4: PD_LDFLAGS="$PD_LDFLAGS -shared" jamie@7: PD_SUFFIX=pd_linux jamie@4: ;; jamie@4: sparc-sun-*) jamie@4: echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet" jamie@4: ;; jamie@4: *-*-darwin*) jamie@9: PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 " jamie@4: PD_LDFLAGS="$PD_LDFLAGS -bundle -undefined suppress -flat_namespace" jamie@7: PD_SUFFIX=pd_darwin jamie@4: ;; jamie@4: *) jamie@4: dnl assume unix jamie@9: PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" jamie@4: PD_LDFLAGS="$PD_LDFLAGS -shared" jamie@7: PD_SUFFIX=pd_linux jamie@4: ;; jamie@4: esac jamie@4: fi jamie@4: jamie@9: PD_CFLAGS="$PD_CFLAGS -DPD" jamie@9: jamie@7: AC_SUBST(PD_CFLAGS) jamie@7: AC_SUBST(PD_LDFLAGS) jamie@7: AC_SUBST(PD_SUFFIX) jamie@9: AC_SUBST(PD_SOURCES) jamie@7: jamie@13: AC_CONFIG_FILES([doc/documentation.doxygen jamie@13: libxtract.pc]) jamie@2: jamie@7: AC_OUTPUT(Makefile src/Makefile xtract/Makefile doc/Makefile examples/Makefile examples/puredata/Makefile)