diff configure.in @ 17:3194fd1b6205

Build system tweaks
author Jamie Bullock <jamie@postlude.co.uk>
date Tue, 10 Oct 2006 09:20:33 +0000
parents 57c865715619
children c4cc9094932a
line wrap: on
line diff
--- a/configure.in	Tue Oct 10 08:04:36 2006 +0000
+++ b/configure.in	Tue Oct 10 09:20:33 2006 +0000
@@ -4,7 +4,9 @@
 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 @@
 #            [ 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 @@
 # 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 @@
     ])
 fi
 
+
 AM_CONDITIONAL(BUILD_VECTOR, test "x${vector}" = 'xtrue')
 
 dnl Are we building the PD examples?
@@ -95,12 +98,21 @@
     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 @@
 
         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 "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)"
+  echo "Fftw3:                   no (not using fftw3, the vector functions will not work)"
 fi
-fi
-if test "${BUILD_PD_EXAMPLE}" = "1"; then
+if test "$pd_example" = "true"; then
   echo "PD external:              yes"
 else
   echo "PD external:              no"