/[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 1356 by persson, Sat Sep 22 07:40:13 2007 UTC revision 3712 by schoenebeck, Fri Jan 10 15:22:34 2020 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.
2  AC_INIT(gigedit,0.0.3)  
3    #------------------------------------------------------------------------------------
4    # The following is the current, official release version of gigedit:
5    
6    m4_define(gigedit_ver_major, 1)
7    m4_define(gigedit_ver_minor, 1)
8    m4_define(gigedit_ver_release, 1.svn12)
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([.])  AC_CONFIG_AUX_DIR([.])
13    
14  #------------------------------------------------------------------------------------  #------------------------------------------------------------------------------------
# Line 19  AC_CONFIG_AUX_DIR([.]) Line 28  AC_CONFIG_AUX_DIR([.])
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([C++])
37    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, gigedit_ver_major)
43    AC_SUBST(GIGEDIT_VER_MINOR, gigedit_ver_minor)
44    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.
# Line 33  AC_SUBST(SHARED_VERSION_INFO) Line 49  AC_SUBST(SHARED_VERSION_INFO)
49  # `--srcdir'; this is a safety check.  # `--srcdir'; this is a safety check.
50  AC_CONFIG_SRCDIR(src/gigedit/main.cpp)  AC_CONFIG_SRCDIR(src/gigedit/main.cpp)
51    
 AC_CONFIG_HEADERS(config.h)  
 AM_INIT_AUTOMAKE  
   
52  GETTEXT_PACKAGE=gigedit  GETTEXT_PACKAGE=gigedit
53  AC_SUBST([GETTEXT_PACKAGE])  AC_SUBST([GETTEXT_PACKAGE])
54  AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])  AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
# Line 48  AC_PROG_CXX Line 61  AC_PROG_CXX
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.1.1)  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    # make sure C++11 is supported by compiler
74    # (add CXXFLAGS if required [e.g. -std=c++11])
75    m4_ifdef([m4_include(m4/ax_cxx_compile_stdcxx.m4)],,
76                 [sinclude([m4/ax_cxx_compile_stdcxx.m4])])
77    AX_CXX_COMPILE_STDCXX(11, [], mandatory)
78    
79    # Note: even though Objective-C sources are just compiled for Mac, the
80    # following AC macros though must not be embedded into a shell check
81    # (if test "$mac" = "yes" ...), because those AC macros themselves are
82    # expanded before any shell code is executed, the generated configure
83    # code though would then not be executed and would lead to interesting
84    # libtool errors on non-Mac systems due to this.
85    AC_PROG_OBJC
86    # The OBJCXX macro didn't exist before autoconf 2.65, so ifdef it to
87    # avoid warnings on old systems.
88    m4_ifdef([AC_PROG_OBJCXX], [AC_PROG_OBJCXX])
89    
90    m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
91    
92    PKG_CHECK_EXISTS(gtk+-3.0 >= 2.99,
93            [PKG_CHECK_MODULES([GTK], [gtk+-3.0])],
94            [PKG_CHECK_MODULES([GTK], [gtk+-2.0])])
95    
96    PKG_PROG_PKG_CONFIG
97    have_gtk3=no
98    PKG_CHECK_EXISTS(gtkmm-3.0 >= 2.99,
99            [PKG_CHECK_MODULES(GTKMM, gtkmm-3.0, have_gtk3=yes)],
100            [PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= 2.8 gthread-2.0 cairomm-1.0)])
101    AM_CONDITIONAL(HAVE_GTK3, [test "$have_gtk3" = "yes"])
102    
103    # Check for cairommconfig.h, as it was moved in cairomm 1.8.4. We only
104    # need it for newer versions.
105    gigedit_save_CPPFLAGS=$CPPFLAGS
106    CPPFLAGS="$GTKMM_CFLAGS $CPPFLAGS"
107    AC_CHECK_HEADERS([cairommconfig.h])
108    CPPFLAGS=$gigedit_save_CPPFLAGS
109    
110    PKG_CHECK_MODULES(SIGC, sigc++-2.0)
111    AC_SUBST(SIGC_CFLAGS)
112    AC_SUBST(SIGC_LIBS)
113    
114    PKG_CHECK_MODULES(GIG, gig >= 4.2.0)
115    AC_SUBST(GIG_CFLAGS)
116    AC_SUBST(GIG_LIBS)
117    
118  # check for presence of libsndfile  # check for presence of libsndfile
119  PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.2)  PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.11)
120  AC_SUBST(SNDFILE_CFLAGS)  AC_SUBST(SNDFILE_CFLAGS)
121  AC_SUBST(SNDFILE_LIBS)  AC_SUBST(SNDFILE_LIBS)
122    
 # 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  
   
123  # check for (optional) presence of liblinuxsampler  # check for (optional) presence of liblinuxsampler
124  liblinuxsampler_version="0.4.0.5cvs"  liblinuxsampler_version="2.1.1"
125  PKG_CHECK_MODULES(  PKG_CHECK_MODULES(
126      LINUXSAMPLER, linuxsampler >= $liblinuxsampler_version,      LINUXSAMPLER, linuxsampler >= $liblinuxsampler_version,
127      have_linuxsampler=1, have_linuxsampler=0      have_linuxsampler=1, have_linuxsampler=0
# Line 81  if test "$have_linuxsampler" = "0"; then Line 135  if test "$have_linuxsampler" = "0"; then
135  else  else
136      echo "Found linuxsampler $liblinuxsampler_version"      echo "Found linuxsampler $liblinuxsampler_version"
137      echo -n "Retrieving LinuxSampler's plugin dir... "      echo -n "Retrieving LinuxSampler's plugin dir... "
138      LINUXSAMPLER_PLUGIN_DIR=`pkg-config --variable plugindir linuxsampler`      LINUXSAMPLER_PLUGIN_DIR=`$PKG_CONFIG --variable plugindir linuxsampler`
139      if test "$LINUXSAMPLER_PLUGIN_DIR" = ""; then      if test "$LINUXSAMPLER_PLUGIN_DIR" = ""; then
140          have_linuxsampler=0          have_linuxsampler=0
141          echo "Error"          echo "Error"
# Line 92  else Line 146  else
146          # convert absolute LS plugin dir into relative dir          # convert absolute LS plugin dir into relative dir
147          # (see ch 27.10 of the automake manual,          # (see ch 27.10 of the automake manual,
148          #  "Installing to Hard-Coded Locations")          #  "Installing to Hard-Coded Locations")
149          LINUXSAMPLER_PLUGIN_DIR=`echo "${LINUXSAMPLER_PLUGIN_DIR}" | sed 's/^.*\/lib\//\${libdir}\//g'`          # this one is extended to work with digit postfixed lib directories
150          echo "Relative plugin dir: ${LINUXSAMPLER_PLUGIN_DIR}"          # (e.g. "/usr/lib64/linuxsampler") as well
151            LINUXSAMPLER_PLUGIN_DIR=`echo "${LINUXSAMPLER_PLUGIN_DIR}" | sed 's/^.*\/lib[[0-9]]*\//\${libdir}\//g'`
152            if echo "${LINUXSAMPLER_PLUGIN_DIR}" | grep "\${libdir}" > /dev/null; then
153                echo "Relative plugin dir: ${LINUXSAMPLER_PLUGIN_DIR}"
154            else
155                echo "*********************************************************"
156                echo "* ! WARNING ! : Could not resolve LinuxSampler's plugin"
157                echo "* directory as relative path. This is probably not an"
158                echo "* issue if you're just going to install gigedit by"
159                echo "* 'make install', but it IS a problem if you're"
160                echo "* installing to a certain destination directory and/or"
161                echo "* compile in sandbox (e.g. Debian package or Gentoo emerge)"
162                echo "*********************************************************"
163            fi
164      fi      fi
165  fi  fi
166  AC_SUBST(LINUXSAMPLER_CFLAGS)  AC_SUBST(LINUXSAMPLER_CFLAGS)
# Line 105  AC_DEFINE_UNQUOTED( Line 172  AC_DEFINE_UNQUOTED(
172      [Define to 1 if you have LinuxSampler installed.]      [Define to 1 if you have LinuxSampler installed.]
173  )  )
174    
175    have_ls_vmidi=0
176    if test $have_linuxsampler = "1"; then
177        AC_MSG_CHECKING([whether LinuxSampler supports virtual MIDI devices])
178        AC_LANG_PUSH([C++])
179        LIBS="$LINUXSAMPLER_LIBS $LIBS"
180        CFLAGS="$CFLAGS $LINUXSAMPLER_CFLAGS"
181        CXXFLAGS="$CXXFLAGS $CFLAGS"
182        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
183                #include <linuxsampler/drivers/midi/VirtualMidiDevice.h>
184                using namespace LinuxSampler;
185            ]], [[
186                bool (VirtualMidiDevice::*ptr1)(uint8_t, uint8_t) = 0;
187                bool (VirtualMidiDevice::*ptr2)() = 0;
188                bool (VirtualMidiDevice::*ptr3)(uint8_t) = 0;
189                uint8_t (VirtualMidiDevice::*ptr4)(uint8_t) = 0;
190                ptr1 = &VirtualMidiDevice::SendNoteOnToSampler;
191                ptr2 = &VirtualMidiDevice::NotesChanged;
192                ptr3 = &VirtualMidiDevice::NoteChanged;
193                ptr4 = &VirtualMidiDevice::NoteOffVelocity;
194            ]])],[
195                AC_MSG_RESULT(yes)
196                have_ls_vmidi=1
197            ],[
198                AC_MSG_RESULT(no)
199                echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
200                echo "! Support for the virtual MIDI keyboard in gigedit will"
201                echo "! be disabled. You'll see the keyboard in gigedit, but"
202                echo "! you won't be able to trigger notes with it nor see"
203                echo "! active notes caused by external MIDI sources of LS."
204                echo "! Update LinuxSampler and recompile gigedit if you want"
205                echo "! this feature."
206                echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
207        ])
208        AC_LANG_POP([C++])
209    fi
210    AC_DEFINE_UNQUOTED(
211        HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE, $have_ls_vmidi,
212        [Define to 1 if LinuxSampler supports virtual MIDI devices.]
213    )
214    
215    AC_CONFIG_HEADERS(config.h)
216    AM_INIT_AUTOMAKE
217    
218  AC_CONFIG_FILES([  AC_CONFIG_FILES([
219          Makefile          Makefile
220          src/Makefile          src/Makefile
221          src/gigedit/Makefile          src/gigedit/Makefile
222        src/gigedit/gfx/Makefile
223          src/plugin/Makefile          src/plugin/Makefile
224            gfx/Makefile
225          po/Makefile.in          po/Makefile.in
226          debian/Makefile          debian/Makefile
227          doc/Makefile          doc/Makefile
228          doc/quickstart/Makefile          doc/quickstart/Makefile
229            win32/libgigedit.dev
230            win32/gigedit.dev
231            win32/gigedit.nsi
232            win32/Makefile
233            gigedit.spec
234  ])  ])
235  AC_OUTPUT  AC_OUTPUT

Legend:
Removed from v.1356  
changed lines
  Added in v.3712

  ViewVC Help
Powered by ViewVC