-
Notifications
You must be signed in to change notification settings - Fork 12
/
configure.ac
108 lines (95 loc) · 2.85 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
dnl Process this file with autoconf to produce a configure script.
AC_INIT(WhySynth, 20170701, whysynth-at-smbolton-dot-com)
AC_CONFIG_SRCDIR(src/whysynth.h)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_ENABLE_STATIC(no)
AC_ENABLE_SHARED(yes)
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_C_BIGENDIAN
dnl Require DSSI, liblo, and FFTW3
AC_CHECK_HEADERS(ladspa.h)
PKG_CHECK_MODULES(COMMON, dssi >= 0.9)
PKG_CHECK_MODULES(PLUGIN, fftw3f >= 3.0.1)
PKG_CHECK_MODULES(GUI, liblo >= 0.12)
dnl Check for GTK+
with_gtk=no
AM_PATH_GTK_2_0(2.24.0, with_gtk='yes', AC_MSG_WARN([GUI will not be built; GTK+ 2.24 or later needed]))
AM_CONDITIONAL(BUILD_GUI, test "x${with_gtk}" != 'xno')
dnl developer functions
AC_ARG_ENABLE(developer, AC_HELP_STRING([--enable-developer], [enable developer functions, default=no]),
[ if test $enableval = "yes"; then
AC_DEFINE(DEVELOPER, 1, [Define to 1 to enable developer-only functions.])
fi ])
dnl OS specific checks
case "${host_os}" in
darwin*)
darwin=yes
PKG_CHECK_MODULES(ALSA, libdssialsacompat)
;;
freebsd*)
darwin=no
PKG_CHECK_MODULES(ALSA, libdssialsacompat)
;;
*)
darwin=no
PKG_CHECK_MODULES(ALSA, alsa)
;;
esac
AM_CONDITIONAL(DARWIN, test x$darwin = xyes)
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
#define _GNU_SOURCE
#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
CFLAGS="$CFLAGS $ALSA_CFLAGS $COMMON_CFLAGS"
LDFLAGS="$LDFLAGS $COMMON_LIBS"
PLUGIN_LIBS="$PLUGIN_LIBS $ALSA_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[\ \ ]*) ;;
*) PLUGIN_CFLAGS="$PLUGIN_CFLAGS -funroll-loops -ffast-math"
if "$CC" --version | grep -q gcc ; then
PLUGIN_CFLAGS="$PLUGIN_CFLAGS -finline-functions"
fi ;;
esac
fi
changequote([,])dnl
AC_SUBST(PLUGIN_CFLAGS)
AC_SUBST(PLUGIN_LIBS)
AC_SUBST(GUI_CFLAGS)
AC_SUBST(GUI_LIBS)
AC_OUTPUT([
Makefile
src/Makefile
])