/[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 1228 by schoenebeck, Sun Jun 10 11:20:15 2007 UTC revision 2472 by persson, Sun Sep 15 17:19:45 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.
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, 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  # The following is the libtool / shared library version. This doesn't have to
# Line 18  AC_INIT(gigedit,0.0.3) Line 28  AC_INIT(gigedit,0.0.3)
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=2
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 32  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])
55    
56    # the libgig header files need this
57    AC_C_BIGENDIAN
58    
59  AC_PROG_CXX  AC_PROG_CXX
60    
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.6.1 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    PKG_PROG_PKG_CONFIG
74    have_gtk3=no
75    PKG_CHECK_EXISTS(gtkmm-3.0 >= 2.99,
76            [PKG_CHECK_MODULES(GTKMM, gtkmm-3.0, have_gtk3=yes)],
77            [PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= 2.8 gthread-2.0 cairomm-1.0)])
78    AM_CONDITIONAL(HAVE_GTK3, [test "$have_gtk3" = "yes"])
79    
80    PKG_CHECK_MODULES(SIGC, sigc++-2.0)
81    AC_SUBST(SIGC_CFLAGS)
82    AC_SUBST(SIGC_LIBS)
83    
84    PKG_CHECK_MODULES(GIG, gig >= 3.3.0)
85    AC_SUBST(GIG_CFLAGS)
86    AC_SUBST(GIG_LIBS)
87    
88  # check for presence of libsndfile  # check for presence of libsndfile
89  PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.2)  PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.11)
90  AC_SUBST(SNDFILE_CFLAGS)  AC_SUBST(SNDFILE_CFLAGS)
91  AC_SUBST(SNDFILE_LIBS)  AC_SUBST(SNDFILE_LIBS)
92    
93  # check for (optional) presence of liblinuxsampler  # check for (optional) presence of liblinuxsampler
94  liblinuxsampler_version="0.4.0.5cvs"  liblinuxsampler_version="0.5.0"
95  PKG_CHECK_MODULES(  PKG_CHECK_MODULES(
96      LINUXSAMPLER, linuxsampler >= $liblinuxsampler_version,      LINUXSAMPLER, linuxsampler >= $liblinuxsampler_version,
97      have_linuxsampler=1, have_linuxsampler=0      have_linuxsampler=1, have_linuxsampler=0
98  )  )
99    LINUXSAMPLER_PLUGIN_DIR=
100  if test "$have_linuxsampler" = "0"; then  if test "$have_linuxsampler" = "0"; then
101      echo "Required liblinuxsampler version not found!"      echo "Required liblinuxsampler version not found!"
102      echo "You need to have liblinuxsampler version ${liblinuxsampler_version}"      echo "You need to have liblinuxsampler version ${liblinuxsampler_version}"
103      echo "installed. Support for on-the-fly editing with LinuxSampler will"      echo "installed. Support for on-the-fly editing with LinuxSampler will"
104      echo "be disabled."      echo "be disabled."
105  else  else
106      echo "yes, found linuxsampler $linuxsampler_version"      echo "Found linuxsampler $liblinuxsampler_version"
107        echo -n "Retrieving LinuxSampler's plugin dir... "
108        LINUXSAMPLER_PLUGIN_DIR=`$PKG_CONFIG --variable plugindir linuxsampler`
109        if test "$LINUXSAMPLER_PLUGIN_DIR" = ""; then
110            have_linuxsampler=0
111            echo "Error"
112            echo "Could not retrieve LinuxSampler's plugin directory. Support"
113            echo "for on-the-fly editing with LinuxSampler will be disabled."
114        else
115            echo "${LINUXSAMPLER_PLUGIN_DIR} "
116            # convert absolute LS plugin dir into relative dir
117            # (see ch 27.10 of the automake manual,
118            #  "Installing to Hard-Coded Locations")
119            # this one is extended to work with digit postfixed lib directories
120            # (e.g. "/usr/lib64/linuxsampler") as well
121            LINUXSAMPLER_PLUGIN_DIR=`echo "${LINUXSAMPLER_PLUGIN_DIR}" | sed 's/^.*\/lib[[0-9]]*\//\${libdir}\//g'`
122            if echo "${LINUXSAMPLER_PLUGIN_DIR}" | grep "\${libdir}" > /dev/null; then
123                echo "Relative plugin dir: ${LINUXSAMPLER_PLUGIN_DIR}"
124            else
125                echo "*********************************************************"
126                echo "* ! WARNING ! : Could not resolve LinuxSampler's plugin"
127                echo "* directory as relative path. This is probably not an"
128                echo "* issue if you're just going to install gigedit by"
129                echo "* 'make install', but it IS a problem if you're"
130                echo "* installing to a certain destination directory and/or"
131                echo "* compile in sandbox (e.g. Debian package or Gentoo emerge)"
132                echo "*********************************************************"
133            fi
134        fi
135  fi  fi
136  AC_SUBST(LINUXSAMPLER_CFLAGS)  AC_SUBST(LINUXSAMPLER_CFLAGS)
137  AC_SUBST(LINUXSAMPLER_LIBS)  AC_SUBST(LINUXSAMPLER_LIBS)
138    AC_SUBST(LINUXSAMPLER_PLUGIN_DIR)
139  AM_CONDITIONAL(HAVE_LINUXSAMPLER, test $have_linuxsampler = "1")  AM_CONDITIONAL(HAVE_LINUXSAMPLER, test $have_linuxsampler = "1")
140  AC_DEFINE_UNQUOTED(  AC_DEFINE_UNQUOTED(
141      HAVE_LINUXSAMPLER, $have_linuxsampler,      HAVE_LINUXSAMPLER, $have_linuxsampler,
142      [Define to 1 if you have LinuxSampler installed.]      [Define to 1 if you have LinuxSampler installed.]
143  )  )
144    
145    have_ls_vmidi=0
146    if test $have_linuxsampler = "1"; then
147        AC_MSG_CHECKING([whether LinuxSampler supports virtual MIDI devices])
148        AC_LANG_PUSH([C++])
149        LIBS="$LINUXSAMPLER_LIBS $LIBS"
150        CFLAGS="$CFLAGS $LINUXSAMPLER_CFLAGS"
151        CXXFLAGS="$CXXFLAGS $CFLAGS"
152        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
153                #include <linuxsampler/drivers/midi/VirtualMidiDevice.h>
154                using namespace LinuxSampler;
155            ]], [[
156                bool (VirtualMidiDevice::*ptr1)(uint8_t, uint8_t) = 0;
157                bool (VirtualMidiDevice::*ptr2)() = 0;
158                bool (VirtualMidiDevice::*ptr3)(uint8_t) = 0;
159                uint8_t (VirtualMidiDevice::*ptr4)(uint8_t) = 0;
160                ptr1 = &VirtualMidiDevice::SendNoteOnToSampler;
161                ptr2 = &VirtualMidiDevice::NotesChanged;
162                ptr3 = &VirtualMidiDevice::NoteChanged;
163                ptr4 = &VirtualMidiDevice::NoteOffVelocity;
164            ]])],[
165                AC_MSG_RESULT(yes)
166                have_ls_vmidi=1
167            ],[
168                AC_MSG_RESULT(no)
169                echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
170                echo "! Support for the virtual MIDI keyboard in gigedit will"
171                echo "! be disabled. You'll see the keyboard in gigedit, but"
172                echo "! you won't be able to trigger notes with it nor see"
173                echo "! active notes caused by external MIDI sources of LS."
174                echo "! Update LinuxSampler and recompile gigedit if you want"
175                echo "! this feature."
176                echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
177        ])
178        AC_LANG_POP([C++])
179    fi
180    AC_DEFINE_UNQUOTED(
181        HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE, $have_ls_vmidi,
182        [Define to 1 if LinuxSampler supports virtual MIDI devices.]
183    )
184    
185    AC_CONFIG_HEADERS(config.h)
186    AM_INIT_AUTOMAKE
187    
188  AC_CONFIG_FILES([  AC_CONFIG_FILES([
189          Makefile          Makefile
190          src/Makefile          src/Makefile
191          src/gigedit/Makefile          src/gigedit/Makefile
192          src/plugin/Makefile          src/plugin/Makefile
193            gfx/Makefile
194          po/Makefile.in          po/Makefile.in
195          debian/Makefile          debian/Makefile
196            doc/Makefile
197            doc/quickstart/Makefile
198            win32/libgigedit.dev
199            win32/gigedit.dev
200            win32/gigedit.nsi
201            win32/Makefile
202            gigedit.spec
203  ])  ])
204  AC_OUTPUT  AC_OUTPUT

Legend:
Removed from v.1228  
changed lines
  Added in v.2472

  ViewVC Help
Powered by ViewVC