diff options
author | Jamie Bullock <jamie@postlude.co.uk> | 2006-10-10 09:20:33 +0000 |
---|---|---|
committer | Jamie Bullock <jamie@postlude.co.uk> | 2006-10-10 09:20:33 +0000 |
commit | 6eeb126390f05a757f4060b2bae694de1eb4f4b3 (patch) | |
tree | 2e547cd3c232e5cc006838a4da5b4ba9c6050597 | |
parent | d0779800f72f682f5b2a874e8bcde1caadbf5a5d (diff) | |
download | LibXtract-6eeb126390f05a757f4060b2bae694de1eb4f4b3.tar.gz LibXtract-6eeb126390f05a757f4060b2bae694de1eb4f4b3.tar.bz2 LibXtract-6eeb126390f05a757f4060b2bae694de1eb4f4b3.zip |
Build system tweaks
-rw-r--r-- | config.h.in | 13 | ||||
-rw-r--r-- | configure.in | 55 | ||||
-rw-r--r-- | examples/Makefile.am | 3 | ||||
-rw-r--r-- | examples/puredata/Makefile.am | 4 |
4 files changed, 51 insertions, 24 deletions
diff --git a/config.h.in b/config.h.in index 01dc576..0735bf0 100644 --- a/config.h.in +++ b/config.h.in @@ -1,15 +1,21 @@ /* config.h.in. Generated from configure.in by autoheader. */ +/* Build the pd example */ +#undef BUILD_PD_EXAMPLE + /* Build the vector functions */ #undef BUILD_VECTOR +/* Define to enable debug */ +#undef DEBUG + /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the <math.h> header file. */ +/* Define to 1 if you have the <math.h */ #undef HAVE_MATH_H /* Define to 1 if you have the <memory.h> header file. */ @@ -18,7 +24,10 @@ /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H -/* Define to 1 if you have the <stdlib.h> header file. */ +/* Define to 1 if you have the <stdio.h> header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the <stdlib.h */ #undef HAVE_STDLIB_H /* Define to 1 if you have the <strings.h> header file. */ diff --git a/configure.in b/configure.in index ec86fcb..7afc191 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,9 @@ AC_INIT([libxtract], [0.11], [bugs@postlude.co.uk]) AM_INIT_AUTOMAKE($PACKAGE, $VERSION) AM_CONFIG_HEADER(config.h) AC_PROG_CC +AC_PROG_LIBTOOL AC_PROG_INSTALL +AC_PATH_PROG(PKG_CONFIG, pkg-config, no) AC_ENABLE_STATIC(no) AC_ENABLE_SHARED(yes) AC_PROG_LIBTOOL @@ -12,7 +14,7 @@ AC_PROG_LIBTOOL # [ if test $withval = "yes"; then with_vector=yes ; # else with_vector=no ; fi ], with_vector=no) -AC_CHECK_HEADERS([math.h]) +AC_CHECK_HEADERS([math.h, stdlib.h, stdio.h]) AC_CHECK_PROG([DOXYGEN], [doxygen], [doc], []) AC_SUBST(DOXYGEN) @@ -47,7 +49,7 @@ AC_ARG_ENABLE(pd_example, # age to 0. XTRACT_SO_VERSION=0:0:0 -CFLAGS="$CFLAGS -pedantic -ansi" +CFLAGS="$CFLAGS -pedantic -ansi -O3" LDFLAGS="$LDFLAGS -lm" AC_ARG_WITH(pd_dir, @@ -82,6 +84,7 @@ if [[ "$vector" = "true" ]] ; then ]) fi + AM_CONDITIONAL(BUILD_VECTOR, test "x${vector}" = 'xtrue') dnl Are we building the PD examples? @@ -95,12 +98,21 @@ if [[ "$pd_example" = "true" ]] ; then echo exit ]) -dnl At some point we need to support other platforms, and include checks -dnl pd_suffix=pd_linux fi AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue') +dnl Enable debugging (no) +AC_ARG_ENABLE(debug, + [ --enable-debug[[=value]] compile with debug [[default=no]]], + with_debug="yes", + with_debug="no") +if test "$with_debug" = "yes" +then + AC_DEFINE(DEBUG,1,[Define to enable debug]) + CFLAGS="-O0 -ggdb -g -pedantic -ansi" +fi + dnl ------------------------------------------ dnl ---- do some magic to gues the host opsys dnl ---- taken from libvorbis configure.in @@ -130,29 +142,35 @@ else case $host in *86-*-linux*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" - PD_LDFLAGS="$PD_LDFLAGS -shared" + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" + PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic" dnl we could test for bad glibc here, but don't PD_SUFFIX=pd_linux ;; powerpc-*-linux*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1 " + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" PD_LDFLAGS="$PD_LDFLAGS -shared" PD_SUFFIX=pd_linux ;; *-*-linux*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1 -fPIC" - PD_LDFLAGS="$PD_LDFLAGS -shared" + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -fPIC" + PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic" PD_SUFFIX=pd_linux ;; sparc-sun-*) echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet" ;; - *-*-darwin*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 " - PD_LDFLAGS="$PD_LDFLAGS -bundle -undefined suppress -flat_namespace" + *86-*-darwin*) + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" + PD_LDFLAGS="$PD_LDFLAGS -bundle -arch i686 -undefined suppress -flat_namespace" + PD_SUFFIX=pd_darwin + ;; + *-*-darwin*) + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" + PD_LDFLAGS="$PD_LDFLAGS -bundle -arch ppc -undefined suppress -flat_namespace" PD_SUFFIX=pd_darwin -;; + ;; + *) dnl assume unix PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" @@ -178,17 +196,14 @@ echo echo "**************************************************************" echo "Summary:" +echo you are using the ${host} architecture -if test "${BUILD_VECTOR}" = "1"; then +if test "$vector" = "true"; then echo "Fftw3: yes (using fftw3f)" else -if test "${BUILD_VECTOR}" = "1"; then - echo "Fftw3: yes (not using fftw3f)" -else - echo "Fftw3: no (that should not happen)" -fi + echo "Fftw3: no (not using fftw3, the vector functions will not work)" fi -if test "${BUILD_PD_EXAMPLE}" = "1"; then +if test "$pd_example" = "true"; then echo "PD external: yes" else echo "PD external: no" diff --git a/examples/Makefile.am b/examples/Makefile.am index 071f774..8ca132d 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1 +1,4 @@ +if BUILD_PD_EXAMPLE SUBDIRS = puredata +endif + diff --git a/examples/puredata/Makefile.am b/examples/puredata/Makefile.am index c45fc32..97bad90 100644 --- a/examples/puredata/Makefile.am +++ b/examples/puredata/Makefile.am @@ -22,12 +22,12 @@ INCLUDES = -I$(top_srcdir)/src -I$(pdincludedir) #AM_LDFLAGS = -L$(top_builddir)/src/.libs -lxtract -export_dynamic -shared AM_CFLAGS = @PD_CFLAGS@ -AM_LDFLAGS = @PD_LDFLAGS@ -lxtract +AM_LDFLAGS = @PD_LDFLAGS@ -lxtract -L$(top_builddir)/src/ ## Install the documentation. install: - -mv xtract.@PD_SUFFIX@ $(pdinstalldir)/xtract~.@PD_SUFFIX@ + -mv $(top_builddir)/examples/puredata/.libs/xtract.@PD_SUFFIX@ $(pdinstalldir)/xtract~.@PD_SUFFIX@ #pdinstallref_DATA = \ # help/aubioonset-help.pd \ |