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@4: yes) vector=true ;; jamie@4: no) vector=false ;; jamie@4: *) AC_MSG_ERROR(bad value ${enableval} for --enable-pd_external) ;; jamie@4: esac],[vector=false]) jamie@4: jamie@4: 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@1: CFLAGS="-pedantic -ansi" jamie@1: LDFLAGS="-lm" jamie@1: jamie@1: dnl Are we building with fftw? jamie@1: #if [[ "$with_vector" = "yes" ]] ; then jamie@1: if [[ "$vector" = "true" ]] ; then jamie@1: LDFLAGS="$LDFLAGS -lfftw3f" jamie@1: AC_DEFINE([BUILD_VECTOR], [1], [Build the vector functions]) jamie@1: fi jamie@1: jamie@1: AM_CONDITIONAL(BUILD_VECTOR, test "x${vector}" = 'xtrue') jamie@1: jamie@4: if [[ "$pd_example" = "true" ]] ; then jamie@4: AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example]) jamie@4: dnl At some point we need to support other platforms, and include checks jamie@4: pd_suffix=pd_linux jamie@4: fi jamie@4: jamie@4: dnl ------------------------------------------ jamie@4: dnl ---- add PureData includes dir jamie@4: dnl ---- usually /usr/local/include jamie@4: dnl ------------------------------------------ jamie@4: AC_ARG_WITH(pd_dir, jamie@4: [ --with-pd-dir=path pd header path (default=/usr/local/include) ], jamie@4: [ jamie@4: CPPFLAGS="$CPPFLAGS -I$withval" jamie@4: echo jamie@4: echo "pd dir is $withval" jamie@4: echo jamie@4: ]) jamie@4: jamie@4: dnl ------------------------------------------ jamie@4: dnl ---- check for PureData Header jamie@4: dnl ------------------------------------------ jamie@4: 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@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@4: AC_CANONICAL_HOST jamie@4: jamie@4: 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@4: PD_CPPFLAGS="$PD_CPPFLAGS -DUNIX -Wno-deprecated -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@4: pd_suffix=pd_linux jamie@4: ;; jamie@4: powerpc-*-linux*) jamie@4: PD_CPPFLAGS="$PD_CPPFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1 " jamie@4: PD_LDFLAGS="$PD_LDFLAGS -shared" jamie@4: pd_suffix=pd_linux jamie@4: ;; jamie@4: *-*-linux*) jamie@4: PD_CPPFLAGS="$PD_CPPFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1 -fPIC" jamie@4: PD_LDFLAGS="$PD_LDFLAGS -shared" jamie@4: 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@4: PD_CPPFLAGS="$PD_CPPFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 " jamie@4: PD_LDFLAGS="$PD_LDFLAGS -bundle -undefined suppress -flat_namespace" jamie@4: pd_suffix=pd_darwin jamie@4: ;; jamie@4: *) jamie@4: dnl assume unix jamie@4: PD_CPPFLAGS="$PD_CPPFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" jamie@4: PD_LDFLAGS="$PD_LDFLAGS -shared" jamie@4: pd_suffix=pd_linux jamie@4: ;; jamie@4: esac jamie@4: fi jamie@4: jamie@2: AC_CONFIG_FILES([doc/documentation.doxygen]) jamie@2: jamie@4: AC_OUTPUT(Makefile src/Makefile xtract/Makefile doc/Makefile examples/puredata/Makefile)