[06b8c1]: configure.ac Maximize Restore History

Download this file

configure.ac    102 lines (88 with data), 3.0 kB

dnl Process this file with autoconf to produce a configure script.

AC_INIT(FluidSynth-DSSI, 0.9.1.2, dssi-devel@lists.sourceforge.net)

AC_CONFIG_SRCDIR(src/fluidsynth-dssi.c)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AC_ENABLE_STATIC(no)
AC_ENABLE_SHARED(yes)
AC_PROG_LIBTOOL

AC_C_BIGENDIAN

dnl check for other headers we need
AC_CHECK_HEADERS(math.h stdarg.h pthread.h dirent.h ladspa.h)

dnl Check for FluidSynth
PKG_CHECK_MODULES(FLUID, fluidsynth >= 1.0.3)
AC_SUBST(FLUID_CFLAGS)
AC_SUBST(FLUID_LIBS)
dnl Check for a recent libfluidsynth
have106=no
PKG_CHECK_EXISTS(fluidsynth >= 1.0.6, have106=yes)
if test "x${have106}" = xyes ; then
  echo "using FluidSynth polyphony-setting API"
  AC_DEFINE(USE_AUGMENTED_FLUIDSYNTH_API, 1, [Define to 1 if your libfluidsynth supports polyphony setting])
  echo "using fluid_synth_nwrite_float() directly"
  AC_DEFINE(NWRITE_FLOAT_WORKS_CORRECTLY, 1, [Define to 1 if fluid_synth_nwrite_float() works correctly])
else
  echo "FluidSynth polyphony-setting API not available"
  echo "using fluid_synth_nwrite_float() workaround"
  echo "(You may wish to upgrade your FluidSynth to version 1.0.6 or later)"
fi

dnl Check for GTK+
AC_ARG_WITH(gtk2, AC_HELP_STRING([--with-gtk2], [use GTK+ 2.0 default=yes]),
            [ if test $withval = "yes"; then try_gtk2=yes ;
              else try_gtk2=no ; fi ], try_gtk2=yes)
with_gtk=no
dnl First look for GTK+ 2.x, unless '--without-gtk2' was specified.
if test "x${try_gtk2}" = 'xyes'; then
    AM_PATH_GTK_2_0(2.0.0, with_gtk='yes (version 2.0)', with_gtk=no)
fi
dnl  No GTK+ 2.x found, look for GTK+ 1.2 instead
if test "x${with_gtk}" = 'xno'; then
    AM_PATH_GTK(1.2.0, with_gtk='yes (version 1.2)', AC_MSG_WARN([GUI will not be built because no version of GTK+ was found]))
fi
AM_CONDITIONAL(BUILD_GUI, test "x${with_gtk}" != 'xno')
echo "GTK support: $with_gtk"

dnl Require ALSA or libdssialsacompat
PKG_CHECK_MODULES(ALSA, alsa, alsa=ALSA, alsa=no)
if test "x${alsa}" = xno ; then
  PKG_CHECK_MODULES(ALSA, libdssialsacompat, alsa=libdssialsacompat,
                    AC_MSG_ERROR([neither ALSA nor libdssialsacompat found]))
fi
if test "x${alsa}" = xALSA ; then
  unset ALSA_LIBS  # we only need the headers
fi

dnl Require DSSI, liblo
PKG_CHECK_MODULES(MODULE, dssi >= 0.9 liblo >= 0.12)

dnl OS specific checks
case "${host_os}" in
darwin*)
  darwin=yes
  ;;
*)
  darwin=no
  ;;
esac
AM_CONDITIONAL(DARWIN, test x$darwin = xyes)

dnl Use lotsa flags if we have gcc.
CFLAGS="$CFLAGS $ALSA_CFLAGS $MODULE_CFLAGS"
LDFLAGS="$LDFLAGS $ALSA_LIBS $MODULE_LIBS"
changequote(,)dnl
if test "x$GCC" = "xyes"; then
  case " $CFLAGS " in
    *[\ \	]-Wall[\ \	]*) ;;
    *) CFLAGS="$CFLAGS -Wall" ;;
  esac
  case " $CFLAGS " in
    *[\ \	]-O[1-9][\ \	]*) ;;
    *) CFLAGS="$CFLAGS -O2" ;;
  esac
  case " $CFLAGS " in
    *[\ \	]-ffast-math[\ \	]*) ;;
    *) CFLAGS="$CFLAGS -fomit-frame-pointer -funroll-loops -finline-functions -ffast-math -Winline" ;;
  esac
fi
changequote([,])dnl
 
AC_OUTPUT([
Makefile
src/Makefile
])