[2cb83d]: configure.in Maximize Restore History

Download this file

configure.in    107 lines (93 with data), 3.0 kB

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

AC_INIT(Xsynth-DSSI, 0.9.4, musound-at-jps-dot-net)

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

AC_ISC_POSIX
AC_PROG_CC

AC_ENABLE_STATIC(no)
AC_ENABLE_SHARED(yes)
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL

AC_C_BIGENDIAN

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 OS specific checks
case "${host_os}" in
darwin*)
  darwin=yes
  PKG_CHECK_MODULES(ALSA, libdssialsacompat)
  ;;
*)
  darwin=no
  PKG_CHECK_MODULES(ALSA, alsa)
  ;;
esac
AM_CONDITIONAL(DARWIN, test x$darwin = xyes)

dnl Check for LADSPA
AC_CHECK_HEADERS(ladspa.h)

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

dnl Check for newlocale() et al.
AC_MSG_CHECKING(for newlocale in xlocale.h)
AC_TRY_COMPILE([
    #include <xlocale.h>
  ], [newlocale(LC_ALL_MASK, "C", NULL)], use_xlocale=yes, use_xlocale=no)
if test "$use_xlocale" = "yes"; then
  AC_DEFINE(THREAD_LOCALE_XLOCALE_H, 1, [Define to 1 if newlocale() is defined in xlocale.h (e.g. on Mac OS X)])
  AC_MSG_RESULT(yes)
else
  AC_MSG_RESULT(no)
  AC_MSG_CHECKING(for newlocale in locale.h)
  AC_TRY_COMPILE([
      #define _XOPEN_SOURCE 700
      #include <locale.h>
    ], [newlocale(LC_ALL_MASK, "C", NULL)], use_locale=yes, use_locale=no)
  if test "$use_locale" = "yes"; then
    AC_DEFINE(THREAD_LOCALE_LOCALE_H, 1, [Define to 1 if newlocale() is defined in locale.h (e.g. in glibc)])
    AC_MSG_RESULT(yes)
  else
    AC_MSG_WARN([newlocale()/uselocale() not found, patch loading may fail in non-C locales])
    AC_MSG_RESULT(no)
  fi
fi

dnl Use lotsa flags if we have gcc.
CFLAGS="$CFLAGS $ALSA_CFLAGS $MODULE_CFLAGS"
LDFLAGS="$LDFLAGS $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
  # add '-finline-limit=...' only for GCC 3.x:
  case `$CC -dumpversion 2>/dev/null` in
  3.*) CFLAGS="$CFLAGS -finline-limit=5000" ;;
  esac
fi
changequote([,])dnl

AC_OUTPUT([
Makefile
src/Makefile
])