/[svn]/gigedit/trunk/configure.ac
ViewVC logotype

Diff of /gigedit/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1121 by persson, Sat Mar 24 17:41:39 2007 UTC revision 2474 by schoenebeck, Sun Sep 15 18:16:21 2013 UTC
# Line 1  Line 1 
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(gigedit,0.0.3)  
 AC_CONFIG_SRCDIR(src/main.cpp)  
2    
3  AC_CONFIG_HEADERS(config.h)  #------------------------------------------------------------------------------------
4    # The following is the current, official release version of gigedit:
5    
6  AM_INIT_AUTOMAKE  m4_define(gigedit_ver_major, 0)
7    m4_define(gigedit_ver_minor, 2)
8    m4_define(gigedit_ver_release, 0)
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
16    # do anything with the release version. It MUST conform to the following rules:
17    #
18    #  1. Start with version information of `0:0:0' for each libtool library.
19    #  2. Update the version information only immediately before a public release of
20    #     your software. More frequent updates are unnecessary, and only guarantee
21    #     that the current interface number gets larger faster.
22    #  3. If the library source code has changed at all since the last update, then
23    #     increment revision (`c:r:a' becomes `c:r+1:a').
24    #  4. If any interfaces have been added, removed, or changed since the last update,
25    #     increment current, and set revision to 0.
26    #  5. If any interfaces have been added since the last public release, then increment
27    #     age.
28    #  6. If any interfaces have been removed since the last public release, then set age
29    #     to 0.
30    
31    LIBGIGEDIT_LT_CURRENT=2
32    LIBGIGEDIT_LT_REVISION=0
33    LIBGIGEDIT_LT_AGE=0
34    
35    SHARED_VERSION_INFO="$LIBGIGEDIT_LT_CURRENT:$LIBGIGEDIT_LT_REVISION:$LIBGIGEDIT_LT_AGE"
36    AC_LANG([C++])
37    AC_PROG_OBJC
38    AC_PROG_OBJCXX
39    AC_PROG_CXX
40    AC_LIBTOOL_WIN32_DLL
41    AC_PROG_LIBTOOL
42    AC_SUBST(SHLIB_VERSION_ARG)
43    AC_SUBST(SHARED_VERSION_INFO)
44    AC_SUBST(GIGEDIT_VER_MAJOR, gigedit_ver_major)
45    AC_SUBST(GIGEDIT_VER_MINOR, gigedit_ver_minor)
46    AC_SUBST(GIGEDIT_VER_RELEASE, gigedit_ver_release)
47    
48    # configure checks for the following file's existence to make sure that
49    # the directory that it is told contains the source code in fact does.
50    # Occasionally people accidentally specify the wrong directory with
51    # `--srcdir'; this is a safety check.
52    AC_CONFIG_SRCDIR(src/gigedit/main.cpp)
53    
54  GETTEXT_PACKAGE=gigedit  GETTEXT_PACKAGE=gigedit
55  AC_SUBST([GETTEXT_PACKAGE])  AC_SUBST([GETTEXT_PACKAGE])
56  AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])  AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
57    
58    # the libgig header files need this
59    AC_C_BIGENDIAN
60    
61  AC_PROG_CXX  AC_PROG_CXX
62    
63  IT_PROG_INTLTOOL(0.35.0)  IT_PROG_INTLTOOL(0.35.0)
64  AM_GLIB_GNU_GETTEXT  AM_GLIB_GNU_GETTEXT
65    
66  PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= 2.6.1 gthread-2.0)  windows=no
67  PKG_CHECK_MODULES(GIG, gig >= 3.1.1)  mac=no
68    case $host in
69        *mingw*|*cygwin*) windows=yes ;;
70        *-*-darwin*) mac=yes ;;
71    esac
72    AM_CONDITIONAL(WINDOWS, test "$windows" = "yes")
73    AM_CONDITIONAL(MAC, test "$mac" = "yes")
74    
75    PKG_PROG_PKG_CONFIG
76    have_gtk3=no
77    PKG_CHECK_EXISTS(gtkmm-3.0 >= 2.99,
78            [PKG_CHECK_MODULES(GTKMM, gtkmm-3.0, have_gtk3=yes)],
79            [PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= 2.8 gthread-2.0 cairomm-1.0)])
80    AM_CONDITIONAL(HAVE_GTK3, [test "$have_gtk3" = "yes"])
81    
82    PKG_CHECK_MODULES(SIGC, sigc++-2.0)
83    AC_SUBST(SIGC_CFLAGS)
84    AC_SUBST(SIGC_LIBS)
85    
86    PKG_CHECK_MODULES(GIG, gig >= 3.3.0)
87    AC_SUBST(GIG_CFLAGS)
88    AC_SUBST(GIG_LIBS)
89    
90  # check for presence of libsndfile  # check for presence of libsndfile
91  PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.2)  PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.11)
92  AC_SUBST(SNDFILE_CFLAGS)  AC_SUBST(SNDFILE_CFLAGS)
93  AC_SUBST(SNDFILE_LIBS)  AC_SUBST(SNDFILE_LIBS)
94    
95    # check for (optional) presence of liblinuxsampler
96    liblinuxsampler_version="0.5.0"
97    PKG_CHECK_MODULES(
98        LINUXSAMPLER, linuxsampler >= $liblinuxsampler_version,
99        have_linuxsampler=1, have_linuxsampler=0
100    )
101    LINUXSAMPLER_PLUGIN_DIR=
102    if test "$have_linuxsampler" = "0"; then
103        echo "Required liblinuxsampler version not found!"
104        echo "You need to have liblinuxsampler version ${liblinuxsampler_version}"
105        echo "installed. Support for on-the-fly editing with LinuxSampler will"
106        echo "be disabled."
107    else
108        echo "Found linuxsampler $liblinuxsampler_version"
109        echo -n "Retrieving LinuxSampler's plugin dir... "
110        LINUXSAMPLER_PLUGIN_DIR=`$PKG_CONFIG --variable plugindir linuxsampler`
111        if test "$LINUXSAMPLER_PLUGIN_DIR" = ""; then
112            have_linuxsampler=0
113            echo "Error"
114            echo "Could not retrieve LinuxSampler's plugin directory. Support"
115            echo "for on-the-fly editing with LinuxSampler will be disabled."
116        else
117            echo "${LINUXSAMPLER_PLUGIN_DIR} "
118            # convert absolute LS plugin dir into relative dir
119            # (see ch 27.10 of the automake manual,
120            #  "Installing to Hard-Coded Locations")
121            # this one is extended to work with digit postfixed lib directories
122            # (e.g. "/usr/lib64/linuxsampler") as well
123            LINUXSAMPLER_PLUGIN_DIR=`echo "${LINUXSAMPLER_PLUGIN_DIR}" | sed 's/^.*\/lib[[0-9]]*\//\${libdir}\//g'`
124            if echo "${LINUXSAMPLER_PLUGIN_DIR}" | grep "\${libdir}" > /dev/null; then
125                echo "Relative plugin dir: ${LINUXSAMPLER_PLUGIN_DIR}"
126            else
127                echo "*********************************************************"
128                echo "* ! WARNING ! : Could not resolve LinuxSampler's plugin"
129                echo "* directory as relative path. This is probably not an"
130                echo "* issue if you're just going to install gigedit by"
131                echo "* 'make install', but it IS a problem if you're"
132                echo "* installing to a certain destination directory and/or"
133                echo "* compile in sandbox (e.g. Debian package or Gentoo emerge)"
134                echo "*********************************************************"
135            fi
136        fi
137    fi
138    AC_SUBST(LINUXSAMPLER_CFLAGS)
139    AC_SUBST(LINUXSAMPLER_LIBS)
140    AC_SUBST(LINUXSAMPLER_PLUGIN_DIR)
141    AM_CONDITIONAL(HAVE_LINUXSAMPLER, test $have_linuxsampler = "1")
142    AC_DEFINE_UNQUOTED(
143        HAVE_LINUXSAMPLER, $have_linuxsampler,
144        [Define to 1 if you have LinuxSampler installed.]
145    )
146    
147    have_ls_vmidi=0
148    if test $have_linuxsampler = "1"; then
149        AC_MSG_CHECKING([whether LinuxSampler supports virtual MIDI devices])
150        AC_LANG_PUSH([C++])
151        LIBS="$LINUXSAMPLER_LIBS $LIBS"
152        CFLAGS="$CFLAGS $LINUXSAMPLER_CFLAGS"
153        CXXFLAGS="$CXXFLAGS $CFLAGS"
154        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
155                #include <linuxsampler/drivers/midi/VirtualMidiDevice.h>
156                using namespace LinuxSampler;
157            ]], [[
158                bool (VirtualMidiDevice::*ptr1)(uint8_t, uint8_t) = 0;
159                bool (VirtualMidiDevice::*ptr2)() = 0;
160                bool (VirtualMidiDevice::*ptr3)(uint8_t) = 0;
161                uint8_t (VirtualMidiDevice::*ptr4)(uint8_t) = 0;
162                ptr1 = &VirtualMidiDevice::SendNoteOnToSampler;
163                ptr2 = &VirtualMidiDevice::NotesChanged;
164                ptr3 = &VirtualMidiDevice::NoteChanged;
165                ptr4 = &VirtualMidiDevice::NoteOffVelocity;
166            ]])],[
167                AC_MSG_RESULT(yes)
168                have_ls_vmidi=1
169            ],[
170                AC_MSG_RESULT(no)
171                echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
172                echo "! Support for the virtual MIDI keyboard in gigedit will"
173                echo "! be disabled. You'll see the keyboard in gigedit, but"
174                echo "! you won't be able to trigger notes with it nor see"
175                echo "! active notes caused by external MIDI sources of LS."
176                echo "! Update LinuxSampler and recompile gigedit if you want"
177                echo "! this feature."
178                echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
179        ])
180        AC_LANG_POP([C++])
181    fi
182    AC_DEFINE_UNQUOTED(
183        HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE, $have_ls_vmidi,
184        [Define to 1 if LinuxSampler supports virtual MIDI devices.]
185    )
186    
187    AC_CONFIG_HEADERS(config.h)
188    AM_INIT_AUTOMAKE
189    
190  AC_CONFIG_FILES([  AC_CONFIG_FILES([
191  Makefile          Makefile
192  src/Makefile          src/Makefile
193  po/Makefile.in          src/gigedit/Makefile
194            src/plugin/Makefile
195            gfx/Makefile
196            po/Makefile.in
197            debian/Makefile
198            doc/Makefile
199            doc/quickstart/Makefile
200            win32/libgigedit.dev
201            win32/gigedit.dev
202            win32/gigedit.nsi
203            win32/Makefile
204            gigedit.spec
205  ])  ])
206  AC_OUTPUT  AC_OUTPUT

Legend:
Removed from v.1121  
changed lines
  Added in v.2474

  ViewVC Help
Powered by ViewVC