--- configure.in.old 2009-04-23 18:32:59.000000000 -0400 +++ configure.in 2009-04-23 18:49:01.000000000 -0400 @@ -258,7 +258,26 @@ AC_SUBST(STRICT_OPTIONS) -AC_CONFIG_SUBDIRS( mediastreamer2 ) +AC_ARG_ENABLE(external-mediastreamer, + [ --enable-external-mediastreamer Use external mediastreamer library], + [case "${enableval}" in + yes) external_mediastreamer=true ;; + no) external_mediastreamer=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-external-mediastreamer) ;; + esac],[external_mediastreamer=false]) + +if test "$external_mediastreamer" = 'true'; then + LP_CHECK_MSTREAMER +else + AC_CONFIG_SUBDIRS( mediastreamer2 ) + MSTREAMER_CFLAGS="-I\$(top_srcdir)/mediastreamer2/include" + MSTREAMER_LIBS="\$(top_builddir)/mediastreamer2/src/libmediastreamer.la" +fi + +AC_SUBST(MSTREAMER_CFLAGS) +AC_SUBST(MSTREAMER_LIBS) + +AM_CONDITIONAL(EXTERNAL_MSTREAMER, [test "$external_mediastreamer" = 'true']) dnl check for db2html (docbook) to generate html user manual AC_CHECK_PROG(have_sgmltools,sgmltools, yes, no) --- console/Makefile.am.old 2009-04-23 18:38:26.000000000 -0400 +++ console/Makefile.am 2009-04-23 18:38:56.000000000 -0400 @@ -7,7 +7,7 @@ -I$(top_srcdir)/coreapi\ $(ORTP_CFLAGS) \ -I$(top_srcdir)/exosip \ - -I$(top_srcdir)/mediastreamer2/include + $(MSTREAMER_CFLAGS) @@ -16,7 +16,7 @@ linphonec_SOURCES = linphonec.c linphonec.h commands.c linphonec_LDADD = $(top_builddir)/coreapi/liblinphone.la $(READLINE_LIBS) \ - $(top_builddir)/mediastreamer2/src/libmediastreamer.la \ + $(MSTREAMER_LIBS) \ $(ORTP_LIBS) \ $(SPEEX_LIBS) \ $(OSIP_LIBS) @@ -26,7 +26,7 @@ sipomatic_LDADD= $(INTLLIBS) \ $(top_builddir)/coreapi/liblinphone.la \ - $(top_builddir)/mediastreamer2/src/libmediastreamer.la \ + $(MSTREAMER_LIBS) \ $(ORTP_LIBS) \ $(SPEEX_LIBS) \ $(OSIP_LIBS) --- coreapi/Makefile.am.old 2009-04-23 18:41:10.000000000 -0400 +++ coreapi/Makefile.am 2009-04-23 18:41:32.000000000 -0400 @@ -7,7 +7,7 @@ INCLUDES = \ -I$(top_srcdir)\ - -I$(top_srcdir)/mediastreamer2/include + $(MSTREAMER_CFLAGS) lib_LTLIBRARIES=liblinphone.la @@ -32,7 +32,7 @@ liblinphone_la_LIBADD= \ $(EXOSIP_LIBS) \ - $(top_builddir)/mediastreamer2/src/libmediastreamer.la + $(MSTREAMER_LIBS) AM_CFLAGS=$(STRICT_OPTIONS) -DIN_LINPHONE \ --- gtk-glade/Makefile.am.old 2009-04-23 18:39:42.000000000 -0400 +++ gtk-glade/Makefile.am 2009-04-23 20:19:38.000000000 -0400 @@ -34,8 +34,8 @@ buddylookup.c \ linphone.h -linphone_3_LDADD=$(top_builddir)/oRTP/src/libortp.la \ - $(top_builddir)/mediastreamer2/src/libmediastreamer.la \ +linphone_3_LDADD=$(ORTP_LIBS) \ + $(MSTREAMER_LIBS) \ $(top_builddir)/coreapi/liblinphone.la \ $(LIBGTK_LIBS) $(INTLLIBS) \ $(LIBGLADE_LIBS) @@ -54,7 +54,7 @@ AM_CFLAGS= -DIN_LINPHONE -I$(top_srcdir)/coreapi/ \ - -I$(top_srcdir)/mediastreamer2/include/ \ + $(MSTREAMER_CFLAGS) \ $(LIBGLADE_CFLAGS) $(STRICT_OPTIONS) $(LIBGTK_CFLAGS) $(IPV6_CFLAGS) \ $(ORTP_CFLAGS) $(OSIP_CFLAGS) --- m4/mstreamer.m4.old 1969-12-31 19:00:00.000000000 -0500 +++ m4/mstreamer.m4 2009-04-23 19:36:12.000000000 -0400 @@ -0,0 +1,11 @@ +AC_DEFUN([LP_CHECK_MSTREAMER],[ + +PKG_CHECK_MODULES([MSTREAMER], [mediastreamer >= 2.2.3], , [ms_failed=true]) + +if test "$ms_failed" = "true"; then + AC_MSG_ERROR("External mediastreamer library not found") +fi + +AC_SUBST([MSTREAMER_LIBS]) +AC_SUBST([MSTREAMER_CFLAGS]) +])