--- gigedit/trunk/configure.ac 2008/12/14 15:52:10 1809 +++ gigedit/trunk/configure.ac 2012/09/08 17:21:48 2366 @@ -1,13 +1,15 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(configure.ac) -AC_CONFIG_AUX_DIR([.]) #------------------------------------------------------------------------------------ # The following is the current, official release version of gigedit: -GIGEDIT_VER_MAJOR=0 -GIGEDIT_VER_MINOR=1 -GIGEDIT_VER_RELEASE=1 +m4_define(gigedit_ver_major, 0) +m4_define(gigedit_ver_minor, 2) +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 @@ -26,20 +28,20 @@ # 6. If any interfaces have been removed since the last public release, then set age # to 0. -LIBGIGEDIT_LT_CURRENT=1 +LIBGIGEDIT_LT_CURRENT=2 LIBGIGEDIT_LT_REVISION=0 LIBGIGEDIT_LT_AGE=0 SHARED_VERSION_INFO="$LIBGIGEDIT_LT_CURRENT:$LIBGIGEDIT_LT_REVISION:$LIBGIGEDIT_LT_AGE" -AC_LANG_CPLUSPLUS +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) -AC_SUBST(GIGEDIT_VER_MINOR) -AC_SUBST(GIGEDIT_VER_RELEASE) +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. @@ -59,8 +61,26 @@ IT_PROG_INTLTOOL(0.35.0) AM_GLIB_GNU_GETTEXT -PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= 2.4.10 gthread-2.0) -PKG_CHECK_MODULES(GIG, gig >= 3.2.0) +case $host in + *mingw*|*cygwin*) windows=yes ;; + *) windows=no ;; +esac +AM_CONDITIONAL(WINDOWS, test "$windows" = "yes") + +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 >= 3.3.0) +AC_SUBST(GIG_CFLAGS) +AC_SUBST(GIG_LIBS) # check for presence of libsndfile PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.2) @@ -92,7 +112,7 @@ else echo "Found linuxsampler $liblinuxsampler_version" echo -n "Retrieving LinuxSampler's plugin dir... " - LINUXSAMPLER_PLUGIN_DIR=`pkg-config --variable plugindir linuxsampler` + LINUXSAMPLER_PLUGIN_DIR=`$PKG_CONFIG --variable plugindir linuxsampler` if test "$LINUXSAMPLER_PLUGIN_DIR" = ""; then have_linuxsampler=0 echo "Error" @@ -132,15 +152,14 @@ have_ls_vmidi=0 if test $have_linuxsampler = "1"; then AC_MSG_CHECKING([whether LinuxSampler supports virtual MIDI devices]) - AC_LANG_SAVE - AC_LANG_CPLUSPLUS + AC_LANG_PUSH([C++]) LIBS="$LINUXSAMPLER_LIBS $LIBS" CFLAGS="$CFLAGS $LINUXSAMPLER_CFLAGS" CXXFLAGS="$CXXFLAGS $CFLAGS" - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include using namespace LinuxSampler; - ], [ + ]], [[ bool (VirtualMidiDevice::*ptr1)(uint8_t, uint8_t) = 0; bool (VirtualMidiDevice::*ptr2)() = 0; bool (VirtualMidiDevice::*ptr3)(uint8_t) = 0; @@ -149,10 +168,10 @@ 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" @@ -162,9 +181,8 @@ echo "! Update LinuxSampler and recompile gigedit if you want" echo "! this feature." echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - ] - ) - AC_LANG_RESTORE + ]) + AC_LANG_POP([C++]) fi AC_DEFINE_UNQUOTED( HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE, $have_ls_vmidi, @@ -172,7 +190,7 @@ ) AC_CONFIG_HEADERS(config.h) -AM_INIT_AUTOMAKE(gigedit, "$GIGEDIT_VER_MAJOR.$GIGEDIT_VER_MINOR.$GIGEDIT_VER_RELEASE") +AM_INIT_AUTOMAKE AC_CONFIG_FILES([ Makefile @@ -188,5 +206,6 @@ win32/gigedit.dev win32/gigedit.nsi win32/Makefile + gigedit.spec ]) AC_OUTPUT