1 |
dnl Process this file with autoconf to produce a configure script. |
dnl Process this file with autoconf to produce a configure script. |
|
AC_INIT(configure.ac) |
|
|
AC_CONFIG_AUX_DIR([.]) |
|
2 |
|
|
3 |
#------------------------------------------------------------------------------------ |
#------------------------------------------------------------------------------------ |
4 |
# The following is the current, official release version of gigedit: |
# The following is the current, official release version of gigedit: |
5 |
|
|
6 |
GIGEDIT_VER_MAJOR=0 |
m4_define(gigedit_ver_major, 1) |
7 |
GIGEDIT_VER_MINOR=1 |
m4_define(gigedit_ver_minor, 1) |
8 |
GIGEDIT_VER_RELEASE=0 |
m4_define(gigedit_ver_release, 1.svn1) |
9 |
|
|
10 |
|
AC_INIT([gigedit], [gigedit_ver_major.gigedit_ver_minor.gigedit_ver_release]) |
11 |
|
AC_CONFIG_SRCDIR([configure.ac]) |
12 |
|
AC_CONFIG_AUX_DIR([.]) |
13 |
|
|
14 |
#------------------------------------------------------------------------------------ |
#------------------------------------------------------------------------------------ |
15 |
# The following is the libtool / shared library version. This doesn't have to |
# The following is the libtool / shared library version. This doesn't have to |
28 |
# 6. If any interfaces have been removed since the last public release, then set age |
# 6. If any interfaces have been removed since the last public release, then set age |
29 |
# to 0. |
# to 0. |
30 |
|
|
31 |
LIBGIGEDIT_LT_CURRENT=0 |
LIBGIGEDIT_LT_CURRENT=4 |
32 |
LIBGIGEDIT_LT_REVISION=0 |
LIBGIGEDIT_LT_REVISION=0 |
33 |
LIBGIGEDIT_LT_AGE=0 |
LIBGIGEDIT_LT_AGE=0 |
34 |
|
|
35 |
SHARED_VERSION_INFO="$LIBGIGEDIT_LT_CURRENT:$LIBGIGEDIT_LT_REVISION:$LIBGIGEDIT_LT_AGE" |
SHARED_VERSION_INFO="$LIBGIGEDIT_LT_CURRENT:$LIBGIGEDIT_LT_REVISION:$LIBGIGEDIT_LT_AGE" |
36 |
AC_LANG_CPLUSPLUS |
AC_LANG([C++]) |
37 |
AC_PROG_CXX |
AC_PROG_CXX |
38 |
|
AC_LIBTOOL_WIN32_DLL |
39 |
AC_PROG_LIBTOOL |
AC_PROG_LIBTOOL |
40 |
AC_SUBST(SHLIB_VERSION_ARG) |
AC_SUBST(SHLIB_VERSION_ARG) |
41 |
AC_SUBST(SHARED_VERSION_INFO) |
AC_SUBST(SHARED_VERSION_INFO) |
42 |
AC_SUBST(GIGEDIT_VER_MAJOR) |
AC_SUBST(GIGEDIT_VER_MAJOR, gigedit_ver_major) |
43 |
AC_SUBST(GIGEDIT_VER_MINOR) |
AC_SUBST(GIGEDIT_VER_MINOR, gigedit_ver_minor) |
44 |
AC_SUBST(GIGEDIT_VER_RELEASE) |
AC_SUBST(GIGEDIT_VER_RELEASE, gigedit_ver_release) |
45 |
|
|
46 |
# configure checks for the following file's existence to make sure that |
# configure checks for the following file's existence to make sure that |
47 |
# the directory that it is told contains the source code in fact does. |
# the directory that it is told contains the source code in fact does. |
61 |
IT_PROG_INTLTOOL(0.35.0) |
IT_PROG_INTLTOOL(0.35.0) |
62 |
AM_GLIB_GNU_GETTEXT |
AM_GLIB_GNU_GETTEXT |
63 |
|
|
64 |
PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= 2.4.10 gthread-2.0) |
windows=no |
65 |
PKG_CHECK_MODULES(GIG, gig >= 3.2.0) |
mac=no |
66 |
|
case $host in |
67 |
|
*mingw*|*cygwin*) windows=yes ;; |
68 |
|
*-*-darwin*) mac=yes ;; |
69 |
|
esac |
70 |
|
AM_CONDITIONAL(WINDOWS, test "$windows" = "yes") |
71 |
|
AM_CONDITIONAL(MAC, test "$mac" = "yes") |
72 |
|
|
73 |
|
# Note: even though Objective-C sources are just compiled for Mac, the |
74 |
|
# following AC macros though must not be embedded into a shell check |
75 |
|
# (if test "$mac" = "yes" ...), because those AC macros themselves are |
76 |
|
# expanded before any shell code is executed, the generated configure |
77 |
|
# code though would then not be executed and would lead to interesting |
78 |
|
# libtool errors on non-Mac systems due to this. |
79 |
|
AC_PROG_OBJC |
80 |
|
# The OBJCXX macro didn't exist before autoconf 2.65, so ifdef it to |
81 |
|
# avoid warnings on old systems. |
82 |
|
m4_ifdef([AC_PROG_OBJCXX], [AC_PROG_OBJCXX]) |
83 |
|
|
84 |
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
85 |
|
|
86 |
|
PKG_CHECK_EXISTS(gtk+-3.0 >= 2.99, |
87 |
|
[PKG_CHECK_MODULES([GTK], [gtk+-3.0])], |
88 |
|
[PKG_CHECK_MODULES([GTK], [gtk+-2.0])]) |
89 |
|
|
90 |
|
PKG_PROG_PKG_CONFIG |
91 |
|
have_gtk3=no |
92 |
|
PKG_CHECK_EXISTS(gtkmm-3.0 >= 2.99, |
93 |
|
[PKG_CHECK_MODULES(GTKMM, gtkmm-3.0, have_gtk3=yes)], |
94 |
|
[PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= 2.8 gthread-2.0 cairomm-1.0)]) |
95 |
|
AM_CONDITIONAL(HAVE_GTK3, [test "$have_gtk3" = "yes"]) |
96 |
|
|
97 |
|
# Check for cairommconfig.h, as it was moved in cairomm 1.8.4. We only |
98 |
|
# need it for newer versions. |
99 |
|
gigedit_save_CPPFLAGS=$CPPFLAGS |
100 |
|
CPPFLAGS="$GTKMM_CFLAGS $CPPFLAGS" |
101 |
|
AC_CHECK_HEADERS([cairommconfig.h]) |
102 |
|
CPPFLAGS=$gigedit_save_CPPFLAGS |
103 |
|
|
104 |
|
PKG_CHECK_MODULES(SIGC, sigc++-2.0) |
105 |
|
AC_SUBST(SIGC_CFLAGS) |
106 |
|
AC_SUBST(SIGC_LIBS) |
107 |
|
|
108 |
|
PKG_CHECK_MODULES(GIG, gig >= 4.2.0) |
109 |
|
AC_SUBST(GIG_CFLAGS) |
110 |
|
AC_SUBST(GIG_LIBS) |
111 |
|
|
112 |
# check for presence of libsndfile |
# check for presence of libsndfile |
113 |
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.2) |
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.11) |
114 |
AC_SUBST(SNDFILE_CFLAGS) |
AC_SUBST(SNDFILE_CFLAGS) |
115 |
AC_SUBST(SNDFILE_LIBS) |
AC_SUBST(SNDFILE_LIBS) |
116 |
|
|
|
# check for loop functionality in libsndfile |
|
|
gigedit_save_CFLAGS=$CFLAGS |
|
|
CFLAGS="$SNDFILE_CFLAGS $CFLAGS" |
|
|
AC_CHECK_MEMBERS([SF_INSTRUMENT.loops],, |
|
|
[AC_MSG_WARN([Your version of libsndfile does not support |
|
|
reading of loop information. Gigedit will not be able to |
|
|
extract loop information from sample files.])], |
|
|
[#include <sndfile.h>]) |
|
|
CFLAGS=$gigedit_save_CFLAGS |
|
|
|
|
117 |
# check for (optional) presence of liblinuxsampler |
# check for (optional) presence of liblinuxsampler |
118 |
liblinuxsampler_version="0.5.0" |
liblinuxsampler_version="2.1.1" |
119 |
PKG_CHECK_MODULES( |
PKG_CHECK_MODULES( |
120 |
LINUXSAMPLER, linuxsampler >= $liblinuxsampler_version, |
LINUXSAMPLER, linuxsampler >= $liblinuxsampler_version, |
121 |
have_linuxsampler=1, have_linuxsampler=0 |
have_linuxsampler=1, have_linuxsampler=0 |
129 |
else |
else |
130 |
echo "Found linuxsampler $liblinuxsampler_version" |
echo "Found linuxsampler $liblinuxsampler_version" |
131 |
echo -n "Retrieving LinuxSampler's plugin dir... " |
echo -n "Retrieving LinuxSampler's plugin dir... " |
132 |
LINUXSAMPLER_PLUGIN_DIR=`pkg-config --variable plugindir linuxsampler` |
LINUXSAMPLER_PLUGIN_DIR=`$PKG_CONFIG --variable plugindir linuxsampler` |
133 |
if test "$LINUXSAMPLER_PLUGIN_DIR" = ""; then |
if test "$LINUXSAMPLER_PLUGIN_DIR" = ""; then |
134 |
have_linuxsampler=0 |
have_linuxsampler=0 |
135 |
echo "Error" |
echo "Error" |
140 |
# convert absolute LS plugin dir into relative dir |
# convert absolute LS plugin dir into relative dir |
141 |
# (see ch 27.10 of the automake manual, |
# (see ch 27.10 of the automake manual, |
142 |
# "Installing to Hard-Coded Locations") |
# "Installing to Hard-Coded Locations") |
143 |
LINUXSAMPLER_PLUGIN_DIR=`echo "${LINUXSAMPLER_PLUGIN_DIR}" | sed 's/^.*\/lib\//\${libdir}\//g'` |
# this one is extended to work with digit postfixed lib directories |
144 |
echo "Relative plugin dir: ${LINUXSAMPLER_PLUGIN_DIR}" |
# (e.g. "/usr/lib64/linuxsampler") as well |
145 |
|
LINUXSAMPLER_PLUGIN_DIR=`echo "${LINUXSAMPLER_PLUGIN_DIR}" | sed 's/^.*\/lib[[0-9]]*\//\${libdir}\//g'` |
146 |
|
if echo "${LINUXSAMPLER_PLUGIN_DIR}" | grep "\${libdir}" > /dev/null; then |
147 |
|
echo "Relative plugin dir: ${LINUXSAMPLER_PLUGIN_DIR}" |
148 |
|
else |
149 |
|
echo "*********************************************************" |
150 |
|
echo "* ! WARNING ! : Could not resolve LinuxSampler's plugin" |
151 |
|
echo "* directory as relative path. This is probably not an" |
152 |
|
echo "* issue if you're just going to install gigedit by" |
153 |
|
echo "* 'make install', but it IS a problem if you're" |
154 |
|
echo "* installing to a certain destination directory and/or" |
155 |
|
echo "* compile in sandbox (e.g. Debian package or Gentoo emerge)" |
156 |
|
echo "*********************************************************" |
157 |
|
fi |
158 |
fi |
fi |
159 |
fi |
fi |
160 |
AC_SUBST(LINUXSAMPLER_CFLAGS) |
AC_SUBST(LINUXSAMPLER_CFLAGS) |
166 |
[Define to 1 if you have LinuxSampler installed.] |
[Define to 1 if you have LinuxSampler installed.] |
167 |
) |
) |
168 |
|
|
169 |
|
have_ls_vmidi=0 |
170 |
|
if test $have_linuxsampler = "1"; then |
171 |
|
AC_MSG_CHECKING([whether LinuxSampler supports virtual MIDI devices]) |
172 |
|
AC_LANG_PUSH([C++]) |
173 |
|
LIBS="$LINUXSAMPLER_LIBS $LIBS" |
174 |
|
CFLAGS="$CFLAGS $LINUXSAMPLER_CFLAGS" |
175 |
|
CXXFLAGS="$CXXFLAGS $CFLAGS" |
176 |
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
177 |
|
#include <linuxsampler/drivers/midi/VirtualMidiDevice.h> |
178 |
|
using namespace LinuxSampler; |
179 |
|
]], [[ |
180 |
|
bool (VirtualMidiDevice::*ptr1)(uint8_t, uint8_t) = 0; |
181 |
|
bool (VirtualMidiDevice::*ptr2)() = 0; |
182 |
|
bool (VirtualMidiDevice::*ptr3)(uint8_t) = 0; |
183 |
|
uint8_t (VirtualMidiDevice::*ptr4)(uint8_t) = 0; |
184 |
|
ptr1 = &VirtualMidiDevice::SendNoteOnToSampler; |
185 |
|
ptr2 = &VirtualMidiDevice::NotesChanged; |
186 |
|
ptr3 = &VirtualMidiDevice::NoteChanged; |
187 |
|
ptr4 = &VirtualMidiDevice::NoteOffVelocity; |
188 |
|
]])],[ |
189 |
|
AC_MSG_RESULT(yes) |
190 |
|
have_ls_vmidi=1 |
191 |
|
],[ |
192 |
|
AC_MSG_RESULT(no) |
193 |
|
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
194 |
|
echo "! Support for the virtual MIDI keyboard in gigedit will" |
195 |
|
echo "! be disabled. You'll see the keyboard in gigedit, but" |
196 |
|
echo "! you won't be able to trigger notes with it nor see" |
197 |
|
echo "! active notes caused by external MIDI sources of LS." |
198 |
|
echo "! Update LinuxSampler and recompile gigedit if you want" |
199 |
|
echo "! this feature." |
200 |
|
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
201 |
|
]) |
202 |
|
AC_LANG_POP([C++]) |
203 |
|
fi |
204 |
|
AC_DEFINE_UNQUOTED( |
205 |
|
HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE, $have_ls_vmidi, |
206 |
|
[Define to 1 if LinuxSampler supports virtual MIDI devices.] |
207 |
|
) |
208 |
|
|
209 |
AC_CONFIG_HEADERS(config.h) |
AC_CONFIG_HEADERS(config.h) |
210 |
AM_INIT_AUTOMAKE(gigedit, "$GIGEDIT_VER_MAJOR.$GIGEDIT_VER_MINOR.$GIGEDIT_VER_RELEASE") |
AM_INIT_AUTOMAKE |
211 |
|
|
212 |
AC_CONFIG_FILES([ |
AC_CONFIG_FILES([ |
213 |
Makefile |
Makefile |
214 |
src/Makefile |
src/Makefile |
215 |
src/gigedit/Makefile |
src/gigedit/Makefile |
216 |
|
src/gigedit/gfx/Makefile |
217 |
src/plugin/Makefile |
src/plugin/Makefile |
218 |
gfx/Makefile |
gfx/Makefile |
219 |
po/Makefile.in |
po/Makefile.in |
224 |
win32/gigedit.dev |
win32/gigedit.dev |
225 |
win32/gigedit.nsi |
win32/gigedit.nsi |
226 |
win32/Makefile |
win32/Makefile |
227 |
|
gigedit.spec |
228 |
]) |
]) |
229 |
AC_OUTPUT |
AC_OUTPUT |