-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
208 lines (187 loc) · 7.54 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
dnl Process this file with autoconf to produce a configure script.
#------------------------------------------------------------------------------------
# The following is the current, official release version of gigedit:
m4_define(gigedit_ver_major, 1)
m4_define(gigedit_ver_minor, 0)
m4_define(gigedit_ver_release, 0)
AC_INIT([gigedit], [gigedit_ver_major.gigedit_ver_minor.gigedit_ver_release])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_AUX_DIR([.])
#------------------------------------------------------------------------------------
# The following is the libtool / shared library version. This doesn't have to
# do anything with the release version. It MUST conform to the following rules:
#
# 1. Start with version information of `0:0:0' for each libtool library.
# 2. Update the version information only immediately before a public release of
# your software. More frequent updates are unnecessary, and only guarantee
# that the current interface number gets larger faster.
# 3. If the library source code has changed at all since the last update, then
# increment revision (`c:r:a' becomes `c:r+1:a').
# 4. If any interfaces have been added, removed, or changed since the last update,
# increment current, and set revision to 0.
# 5. If any interfaces have been added since the last public release, then increment
# age.
# 6. If any interfaces have been removed since the last public release, then set age
# to 0.
LIBGIGEDIT_LT_CURRENT=3
LIBGIGEDIT_LT_REVISION=0
LIBGIGEDIT_LT_AGE=0
SHARED_VERSION_INFO="$LIBGIGEDIT_LT_CURRENT:$LIBGIGEDIT_LT_REVISION:$LIBGIGEDIT_LT_AGE"
AC_LANG([C++])
AC_PROG_CXX
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_SUBST(SHLIB_VERSION_ARG)
AC_SUBST(SHARED_VERSION_INFO)
AC_SUBST(GIGEDIT_VER_MAJOR, gigedit_ver_major)
AC_SUBST(GIGEDIT_VER_MINOR, gigedit_ver_minor)
AC_SUBST(GIGEDIT_VER_RELEASE, gigedit_ver_release)
# configure checks for the following file's existence to make sure that
# the directory that it is told contains the source code in fact does.
# Occasionally people accidentally specify the wrong directory with
# `--srcdir'; this is a safety check.
AC_CONFIG_SRCDIR(src/gigedit/main.cpp)
GETTEXT_PACKAGE=gigedit
AC_SUBST([GETTEXT_PACKAGE])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
# the libgig header files need this
AC_C_BIGENDIAN
AC_PROG_CXX
IT_PROG_INTLTOOL(0.35.0)
AM_GLIB_GNU_GETTEXT
windows=no
mac=no
case $host in
*mingw*|*cygwin*) windows=yes ;;
*-*-darwin*) mac=yes ;;
esac
AM_CONDITIONAL(WINDOWS, test "$windows" = "yes")
AM_CONDITIONAL(MAC, test "$mac" = "yes")
if test "$mac" = "yes"; then
AC_PROG_OBJC
fi
PKG_PROG_PKG_CONFIG
have_gtk3=no
PKG_CHECK_EXISTS(gtkmm-3.0 >= 2.99,
[PKG_CHECK_MODULES(GTKMM, gtkmm-3.0, have_gtk3=yes)],
[PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= 2.8 gthread-2.0 cairomm-1.0)])
AM_CONDITIONAL(HAVE_GTK3, [test "$have_gtk3" = "yes"])
PKG_CHECK_MODULES(SIGC, sigc++-2.0)
AC_SUBST(SIGC_CFLAGS)
AC_SUBST(SIGC_LIBS)
PKG_CHECK_MODULES(GIG, gig >= 4.0.0)
AC_SUBST(GIG_CFLAGS)
AC_SUBST(GIG_LIBS)
# check for presence of libsndfile
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.11)
AC_SUBST(SNDFILE_CFLAGS)
AC_SUBST(SNDFILE_LIBS)
# check for (optional) presence of liblinuxsampler
liblinuxsampler_version="2.0.0"
PKG_CHECK_MODULES(
LINUXSAMPLER, linuxsampler >= $liblinuxsampler_version,
have_linuxsampler=1, have_linuxsampler=0
)
LINUXSAMPLER_PLUGIN_DIR=
if test "$have_linuxsampler" = "0"; then
echo "Required liblinuxsampler version not found!"
echo "You need to have liblinuxsampler version ${liblinuxsampler_version}"
echo "installed. Support for on-the-fly editing with LinuxSampler will"
echo "be disabled."
else
echo "Found linuxsampler $liblinuxsampler_version"
echo -n "Retrieving LinuxSampler's plugin dir... "
LINUXSAMPLER_PLUGIN_DIR=`$PKG_CONFIG --variable plugindir linuxsampler`
if test "$LINUXSAMPLER_PLUGIN_DIR" = ""; then
have_linuxsampler=0
echo "Error"
echo "Could not retrieve LinuxSampler's plugin directory. Support"
echo "for on-the-fly editing with LinuxSampler will be disabled."
else
echo "${LINUXSAMPLER_PLUGIN_DIR} "
# convert absolute LS plugin dir into relative dir
# (see ch 27.10 of the automake manual,
# "Installing to Hard-Coded Locations")
# this one is extended to work with digit postfixed lib directories
# (e.g. "/usr/lib64/linuxsampler") as well
LINUXSAMPLER_PLUGIN_DIR=`echo "${LINUXSAMPLER_PLUGIN_DIR}" | sed 's/^.*\/lib[[0-9]]*\//\${libdir}\//g'`
if echo "${LINUXSAMPLER_PLUGIN_DIR}" | grep "\${libdir}" > /dev/null; then
echo "Relative plugin dir: ${LINUXSAMPLER_PLUGIN_DIR}"
else
echo "*********************************************************"
echo "* ! WARNING ! : Could not resolve LinuxSampler's plugin"
echo "* directory as relative path. This is probably not an"
echo "* issue if you're just going to install gigedit by"
echo "* 'make install', but it IS a problem if you're"
echo "* installing to a certain destination directory and/or"
echo "* compile in sandbox (e.g. Debian package or Gentoo emerge)"
echo "*********************************************************"
fi
fi
fi
AC_SUBST(LINUXSAMPLER_CFLAGS)
AC_SUBST(LINUXSAMPLER_LIBS)
AC_SUBST(LINUXSAMPLER_PLUGIN_DIR)
AM_CONDITIONAL(HAVE_LINUXSAMPLER, test $have_linuxsampler = "1")
AC_DEFINE_UNQUOTED(
HAVE_LINUXSAMPLER, $have_linuxsampler,
[Define to 1 if you have LinuxSampler installed.]
)
have_ls_vmidi=0
if test $have_linuxsampler = "1"; then
AC_MSG_CHECKING([whether LinuxSampler supports virtual MIDI devices])
AC_LANG_PUSH([C++])
LIBS="$LINUXSAMPLER_LIBS $LIBS"
CFLAGS="$CFLAGS $LINUXSAMPLER_CFLAGS"
CXXFLAGS="$CXXFLAGS $CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <linuxsampler/drivers/midi/VirtualMidiDevice.h>
using namespace LinuxSampler;
]], [[
bool (VirtualMidiDevice::*ptr1)(uint8_t, uint8_t) = 0;
bool (VirtualMidiDevice::*ptr2)() = 0;
bool (VirtualMidiDevice::*ptr3)(uint8_t) = 0;
uint8_t (VirtualMidiDevice::*ptr4)(uint8_t) = 0;
ptr1 = &VirtualMidiDevice::SendNoteOnToSampler;
ptr2 = &VirtualMidiDevice::NotesChanged;
ptr3 = &VirtualMidiDevice::NoteChanged;
ptr4 = &VirtualMidiDevice::NoteOffVelocity;
]])],[
AC_MSG_RESULT(yes)
have_ls_vmidi=1
],[
AC_MSG_RESULT(no)
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Support for the virtual MIDI keyboard in gigedit will"
echo "! be disabled. You'll see the keyboard in gigedit, but"
echo "! you won't be able to trigger notes with it nor see"
echo "! active notes caused by external MIDI sources of LS."
echo "! Update LinuxSampler and recompile gigedit if you want"
echo "! this feature."
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
])
AC_LANG_POP([C++])
fi
AC_DEFINE_UNQUOTED(
HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE, $have_ls_vmidi,
[Define to 1 if LinuxSampler supports virtual MIDI devices.]
)
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE
AC_CONFIG_FILES([
Makefile
src/Makefile
src/gigedit/Makefile
src/plugin/Makefile
gfx/Makefile
po/Makefile.in
debian/Makefile
doc/Makefile
doc/quickstart/Makefile
win32/libgigedit.dev
win32/gigedit.dev
win32/gigedit.nsi
win32/Makefile
gigedit.spec
])
AC_OUTPUT