src/types.h: add some documentation, use HAVE_AUBIO_DOUBLE, not AUBIO_SINGLE_PRECISION
[aubio.git] / configure.ac
index b1567f1..c8c00af 100644 (file)
@@ -28,6 +28,7 @@ AM_PROG_CC_C_O dnl compiling with per-target flag
 if test "$ac_cv_prog_cc" = "no" ; then
    AC_MSG_ERROR([*** No C compiler found !])
 fi
+AC_PROG_CXX
 AC_PROG_INSTALL
 
 AUBIO_CFLAGS=
@@ -81,6 +82,8 @@ AC_ARG_ENABLE(lcov,
 dnl Check for libtool
 AC_LIBTOOL_DLOPEN
 dnl AC_DISABLE_STATIC
+dnl allow cross compiling
+AC_LIBTOOL_WIN32_DLL
 AC_PROG_LIBTOOL
 
 AC_CONFIG_HEADERS(src/config.h)
@@ -88,7 +91,7 @@ AC_CONFIG_FILES(aubio.pc)
 
 AM_CONDITIONAL(MINGW, false)
 AM_CONDITIONAL(DARWIN, false)
-case "${build_os}" in
+case "${host}" in
 *mingw* | *cygwin*)
   mingw32_support="yes"
   AC_CHECK_HEADER(windows.h)
@@ -96,12 +99,6 @@ case "${build_os}" in
   LDFLAGS="$LDFLAGS -no-undefined"
   ;;
 *darwin* | *rhapsody* | *macosx*)
-  dnl on macosx, cosf went to -lmx
-  LDFLAGS="$LDFLAGS -lmx"
-  dnl as long double doesn't sit well with -Wall -Werror
-  AUBIO_CFLAGS="$AUBIO_CFLAGS -Wno-long-double"
-  dnl Workaround darwin autoconf bug
-  CPPFLAGS="$CPPFLAGS -I${prefix}/include"
   AC_ISC_POSIX
   AM_CONDITIONAL(DARWIN, true)
   ;;
@@ -114,7 +111,6 @@ dnl Check for required libraries
 AC_CHECK_LIB(pthread, pthread_create)
 
 dnl Check for header files
-AC_HEADER_STDC
 AC_CHECK_HEADERS([string.h stdlib.h stdio.h math.h errno.h stdarg.h unistd.h signal.h],,)
 AC_CHECK_HEADERS(fftw3.h,,AC_MSG_ERROR([Ouch! missing fftw3.h header]))
 AC_ARG_ENABLE(complex,
@@ -146,11 +142,11 @@ fi
 dnl Check for pkg-config
 AC_PATH_PROG(PKG_CONFIG,pkg-config,no)
 
-PKG_CHECK_MODULES(SNDLIB,     sndfile >= 1.0.4,       SNDLIB_SUPPORT=1)
-PKG_CHECK_MODULES(SAMPLERATE, samplerate  >= 0.0.15,  SAMPLERATE_SUPPORT=1)
+PKG_CHECK_MODULES(SNDLIB,     sndfile >= 1.0.4,       HAVE_SNDLIB=1)
+PKG_CHECK_MODULES(SAMPLERATE, samplerate  >= 0.0.15,  HAVE_SAMPLERATE=1)
 
-if test "${SNDLIB_SUPPORT}" = "1"; then
-  AC_DEFINE(SNDLIB_SUPPORT,1,[Define to enable libsndfile support])
+if test "${HAVE_SNDLIB}" = "1"; then
+  AC_DEFINE(HAVE_SNDLIB,1,[Define to enable libsndfile support])
 fi
 
 dnl Check for fftw3 (required)
@@ -159,18 +155,18 @@ AC_ARG_ENABLE(fftw3f,
   [with_fftw3f=$enableval],
   with_fftw3f="yes")
 if test "$with_fftw3f" = "yes"; then
-  PKG_CHECK_MODULES(FFTWLIB,    fftw3f >= 3.0.0,     FFTW3F_SUPPORT=1, FFTW3F_SUPPORT=0)
+  PKG_CHECK_MODULES(FFTWLIB,    fftw3f >= 3.0.0,     HAVE_FFTW3F=1, HAVE_FFTW3F=0)
 else
-  PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,     FFTW3_SUPPORT=1)
+  PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,     HAVE_FFTW3=1)
 fi
-if test "${FFTW3F_SUPPORT}" = "0"; then
-  PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,     FFTW3_SUPPORT=1)
+if test "${HAVE_FFTW3F}" = "0"; then
+  PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,     HAVE_FFTW3=1)
 fi
-if test "${FFTW3_SUPPORT}" = "1"; then
-  AC_DEFINE(FFTW3_SUPPORT,1,[Define to enable fftw3 support])
+if test "${HAVE_FFTW3}" = "1"; then
+  AC_DEFINE(HAVE_FFTW3,1,[Define to enable fftw3 support])
 fi
-if test "${FFTW3F_SUPPORT}" = "1"; then
-  AC_DEFINE(FFTW3F_SUPPORT,1,[Define to enable fftw3f support])
+if test "${HAVE_FFTW3F}" = "1"; then
+  AC_DEFINE(HAVE_FFTW3F,1,[Define to enable fftw3f support])
 fi
 
 dnl Enable jack support (auto)
@@ -180,27 +176,9 @@ AC_ARG_ENABLE(jack,
   with_jack="yes")
 if test "$with_jack" = "yes"
 then
-  PKG_CHECK_MODULES(JACK,       jack  >= 0.15.0,     JACK_SUPPORT=1, JACK_SUPPORT=0)
-  if test "${JACK_SUPPORT}" = "1"; then
-    AC_DEFINE(JACK_SUPPORT,1,[Define to enable jack support])
-  fi
-fi
-
-dnl Enable alsa support (auto)
-AC_ARG_ENABLE(alsa,
-  AC_HELP_STRING([--enable-alsa],[compile with alsa [[default=auto]]]),
-  [with_alsa=$enableval],
-  with_alsa="yes")
-if test "$with_alsa" = "yes"
-then
-  if test "$with_jack" = "yes"
-  then
-    PKG_CHECK_MODULES(ALSA,      alsa >= 0.0.9,      ALSA_SUPPORT=1, ALSA_SUPPORT=0)
-    if test "${ALSA_SUPPORT}" = "1"; then
-      AC_DEFINE(ALSA_SUPPORT,1,[Define to enable alsa support])
-    fi
-  else
-    AC_MSG_WARN([Disabling alsa as jack was not found])
+  PKG_CHECK_MODULES(JACK,       jack  >= 0.15.0,     HAVE_JACK=1, HAVE_JACK=0)
+  if test "${HAVE_JACK}" = "1"; then
+    AC_DEFINE(HAVE_JACK,1,[Define to enable jack support])
   fi
 fi
 
@@ -211,9 +189,9 @@ AC_ARG_ENABLE(lash,
   with_lash="yes")
 if test "$with_lash" = "yes"
 then
-  PKG_CHECK_MODULES(LASH,   lash-1.0 >= 0.5.0,   LASH_SUPPORT=1, LASH_SUPPORT=0)
-  if test "${LASH_SUPPORT}" = "1"; then
-    LASH_CFLAGS+="-DLASH_SUPPORT"
+  PKG_CHECK_MODULES(LASH,   lash-1.0 >= 0.5.0,   HAVE_LASH=1, HAVE_LASH=0)
+  if test "${HAVE_LASH}" = "1"; then
+    LASH_CFLAGS+="-DHAVE_LASH"
   fi
 fi
   
@@ -241,18 +219,26 @@ dnl Check for Puredata
 AC_CHECK_HEADER(m_pd.h,PUREDATA=y,AC_MSG_WARN([Puredata header not found.]))
 AM_CONDITIONAL(PUREDATAFOUND, test "${PUREDATA}" = "y")
 
+dnl Check for Java
+AC_CHECK_HEADER(jni.h,JAVAHEADERS=y,AC_MSG_WARN([Java header jni.h not found.]))
+AM_CONDITIONAL(JAVAFOUND, test "${JAVAHEADERS}" = "y")
+
 dnl Create Makefiles
 AC_OUTPUT([
     Makefile
     src/Makefile
     ext/Makefile
+    cpp/Makefile
     examples/Makefile
     tests/Makefile
     tests/src/Makefile
+    tests/cpp/Makefile
     sounds/Makefile
     swig/Makefile
     python/Makefile
     python/aubio/Makefile
+    java/Makefile
+    java/aubio/Makefile
     plugins/Makefile
     plugins/audacity/Makefile
     plugins/audacity/plug-ins/Makefile
@@ -265,36 +251,31 @@ dnl Print summary
 echo
 echo "**************************************************************"
 echo "Summary:"
-if test "${FFTW3F_SUPPORT}" = "1"; then
+if test "${HAVE_FFTW3F}" = "1"; then
   echo "Fftw3:                   yes (using fftw3f)"
 else
-if test "${FFTW3_SUPPORT}" = "1"; then
+if test "${HAVE_FFTW3}" = "1"; then
   echo "Fftw3:                   yes (not using fftw3f)"
 else
   echo "Fftw3:                   no (that should not happen)"
 fi
 fi
-if test "${SNDLIB_SUPPORT}" = "1"; then
+if test "${HAVE_SNDLIB}" = "1"; then
   echo "Libsndfile:              yes"
 else
   echo "Libsndfile:              no"
 fi
-if test "${SAMPLERATE_SUPPORT}" = "1"; then
+if test "${HAVE_SAMPLERATE}" = "1"; then
   echo "Libsamplerate:           yes"
 else
   echo "Libsamplerate:           no"
 fi
-if test "${JACK_SUPPORT}" = "1"; then
+if test "${HAVE_JACK}" = "1"; then
   echo "JACK:                    yes"
 else
   echo "JACK:                    no"
 fi
-if test "${ALSA_SUPPORT}" = "1"; then
-  echo "ALSA midi:               yes"
-else
-  echo "ALSA midi:               no"
-fi
-if test "${LASH_SUPPORT}" = "1"; then
+if test "${HAVE_LASH}" = "1"; then
   echo "Lash:                    yes"
 else
   echo "Lash:                    no"