Skip to content

Commit

Permalink
Attempt to add the rest of the makefile for portmidi
Browse files Browse the repository at this point in the history
Also, fix a broken(?) include in px_linux_alsa.c.  I don't know if it was actually broken, but it seems like that was wrong.
  • Loading branch information
Pokechu22 authored and Paul-Licameli committed Jul 4, 2017
1 parent 1610da4 commit 0c00435
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 2 deletions.
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ dnl Optional library support. Lots of things we could use, but
dnl can do without if they aren't available.
dnl-------------------------------------------------------------
dnl GSTREAMER removed for 2.0.6 release
LIBRARIES="EXPAT FFMPEG LAME LIBFLAC LIBID3TAG LIBMAD LIBNYQUIST LIBSBSMS LIBSNDFILE LIBSOUNDTOUCH LIBSOXR LIBTWOLAME LIBVAMP LIBVORBIS LV2 PORTAUDIO PORTSMF WIDGETEXTRA"
LIBRARIES="EXPAT FFMPEG LAME LIBFLAC LIBID3TAG LIBMAD LIBNYQUIST LIBSBSMS LIBSNDFILE LIBSOUNDTOUCH LIBSOXR LIBTWOLAME LIBVAMP LIBVORBIS LV2 PORTAUDIO PORTSMF PORTMIDI WIDGETEXTRA"

AC_MSG_NOTICE([Determining what libraries are available in this tree and on the system])

Expand All @@ -372,6 +372,7 @@ AUDACITY_CHECKLIB_LIBVORBIS
AUDACITY_CHECKLIB_LV2
AUDACITY_CHECKLIB_PORTAUDIO
AUDACITY_CHECKLIB_PORTSMF
AUDACITY_CHECKLIB_PORTMIDI
AUDACITY_CHECKLIB_WIDGETEXTRA

dnl Decide what libraries to build with, and whether to use system or local libraries
Expand Down Expand Up @@ -500,6 +501,7 @@ AUDACITY_CONFIG_LIBVORBIS
AUDACITY_CONFIG_LV2
AUDACITY_CONFIG_PORTAUDIO
AUDACITY_CONFIG_PORTSMF
AUDACITY_CONFIG_PORTMIDI
AUDACITY_CONFIG_WIDGETEXTRA

dnl--------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions lib-src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ if USE_LOCAL_PORTSMF
SUBDIRS += portsmf
endif

if USE_LOCAL_PORTMIDI
SUBDIRS += portmidi
endif

if USE_LOCAL_SBSMS
SUBDIRS += sbsms
endif
Expand Down
2 changes: 1 addition & 1 deletion lib-src/portmixer/src/px_linux_alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <alsa/asoundlib.h>

#include "portaudio.h"
#include "pa_unix_oss.h"
#include "pa_linux_alsa.h"

#include "portmixer.h"
#include "px_mixer.h"
Expand Down
52 changes: 52 additions & 0 deletions m4/audacity_checklib_portmidi.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
dnl I frankly don't know what's supposed to go there
# audacity_checklib_portsmf.m4 serial 1

AC_DEFUN([AUDACITY_CHECKLIB_PORTMIDI], [
AC_ARG_WITH(portmidi,
[AS_HELP_STRING([--with-portmidi],
[use PortMIDI for MIDI playback support])],
PORTMIDI_ARGUMENT=$withval,
PORTMIDI_ARGUMENT="unspecified")
dnl see if libportsmf is installed on the system
PKG_CHECK_MODULES(PORTMIDI, portmidi,
PORTMIDI_SYSTEM_AVAILABLE="yes",
PORTMIDI_SYSTEM_AVAILABLE="no")
if test "$PORTMIDI_SYSTEM_AVAILABLE" = "yes"; then
AC_MSG_NOTICE([portmidi library is available as system library])
else
AC_MSG_NOTICE([portmidi library is NOT available as system library])
fi
AC_CHECK_FILE(${srcdir}/lib-src/portmidi/pm_common/portmidi.h,
PORTMIDI_LOCAL_AVAILABLE="yes",
PORTMIDI_LOCAL_AVAILABLE="no")
if test "$PORTMIDI_LOCAL_AVAILABLE" = "yes"; then
AC_MSG_NOTICE([portmidi library is available in the local tree])
else
AC_MSG_NOTICE([portmidi library is NOT available in the local tree])
fi
])

AC_DEFUN([AUDACITY_CONFIG_PORTMIDI], [
if test "$PORTMIDI_USE_LOCAL" = yes; then
PORTMIDI_CFLAGS='-I$(top_srcdir)/lib-src/portmidi'
PORTMIDI_LIBS='$(top_builddir)/lib-src/portmidi/libportmidi_s.a'
AC_CONFIG_SUBDIRS([lib-src/portmidi])
fi
AC_SUBST([PORTMIDI_CFLAGS])
AC_SUBST([PORTMIDI_LIBS])
AM_CONDITIONAL([USE_PORTMIDI], [test "$PORTMIDI_USE_LOCAL" = yes -o "$PORTMIDI_USE_SYSTEM" = yes])
AM_CONDITIONAL([USE_LOCAL_PORTMIDI], [test "$PORTMIDI_USE_LOCAL" = yes])
if test "$PORTMIDI_USE_LOCAL" = yes -o "$PORTMIDI_USE_SYSTEM" = yes; then
AC_DEFINE(USE_PORTMIDI, 1,
[Define if midi support should be enabled])
fi
])
5 changes: 5 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,11 @@ audacity_SOURCES += \
$(NULL)
endif

if USE_PORTMIDI
audacity_CPPFLAGS += $(PORTMIDI_CFLAGS)
audacity_LDADD += $(PORTMIDI_LIBS)
endif

if USE_QUICKTIME
audacity_CPPFLAGS += $(QUICKTIME_CFLAGS)
audacity_LDADD += $(QUICKTIME_LIBS)
Expand Down

0 comments on commit 0c00435

Please sign in to comment.