diff --git a/Makefile.am b/Makefile.am index e0c3068..14ee5c5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,19 +1,12 @@ ## Process this file with automake to produce Makefile.in # let make re-run automake upon need -ACLOCAL_AMFLAGS = -I m4 $(ACLOCAL_MACOS_FLAGS) +ACLOCAL_AMFLAGS = -I m4 -if EXTERNAL_ORTP -ORTP_DIR = -else -ORTP_DIR = oRTP -endif - -SUBDIRS = m4 pixmaps po $(ORTP_DIR) mediastreamer2\ +SUBDIRS = m4 pixmaps po @ORTP_DIR@ @MEDIASTREAMER_DIR@ \ coreapi console gtk share scripts - ACLOCAL_FLAGS=-I$(top_srcdir)/m4 OPTIONAL_SOUNDS=\ diff --git a/autogen.sh b/autogen.sh index f32cf85..8572d52 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,45 +1,23 @@ -#!/bin/sh +#! /bin/sh -#AM_VERSION="1.10" -if ! type aclocal-$AM_VERSION 1>/dev/null 2>&1; then - # automake-1.10 (recommended) is not available on Fedora 8 - AUTOMAKE=automake - ACLOCAL=aclocal -else - ACLOCAL=aclocal-${AM_VERSION} - AUTOMAKE=automake-${AM_VERSION} -fi +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. -if test -f /opt/local/bin/glibtoolize ; then - # darwin - LIBTOOLIZE=/opt/local/bin/glibtoolize -else - LIBTOOLIZE=libtoolize -fi -if test -d /opt/local/share/aclocal ; then - ACLOCAL_ARGS="-I /opt/local/share/aclocal" -fi +ORIGDIR=`pwd` -if test -f /opt/local/bin/intltoolize ; then - #darwin - INTLTOOLIZE=/opt/local/bin/intltoolize -else - #on mingw, it is important to invoke intltoolize with an absolute path to avoid a bug - INTLTOOLIZE=/usr/bin/intltoolize +if [ -x $srcdir/mediastreamer2/autogen.sh ]; then + cd $srcdir/mediastreamer2 + ./autogen.sh fi -echo "Generating build scripts in linphone..." -set -x -$LIBTOOLIZE --copy --force +if [ -x $srcdir/oRTP/autogen.sh ]; then + cd $srcdir/oRTP + ./autogen.sh +fi -$INTLTOOLIZE -c --force --automake -$ACLOCAL -I m4 $ACLOCAL_ARGS -autoheader -$AUTOMAKE --force-missing --add-missing --copy -autoconf +cd $srcdir -echo "Generating build scripts in oRTP..." -cd oRTP && ./autogen.sh && cd - +intltoolize --copy --force --automake +autoreconf -v --install || exit 1 -echo "Generating build scripts in mediastreamer2..." -cd mediastreamer2 && ./autogen.sh && cd - +cd $ORIGDIR || exit $? diff --git a/configure.in b/configure.in index fc1c4c0..a79ec69 100644 --- a/configure.in +++ b/configure.in @@ -2,6 +2,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT([linphone],[3.3.99.3],address@hidden) AC_CANONICAL_SYSTEM +AC_CONFIG_SRCDIR([coreapi/linphonecore.c]) dnl Source packaging numbers @@ -28,7 +29,8 @@ AC_SUBST(LINPHONE_VERSION) AC_MSG_NOTICE([$PACKAGE_NAME-$PACKAGE_VERSION A full featured audio/video sip phone.]) AC_MSG_NOTICE([licensed under the terms of the General Public License (GPL)]) -AM_INIT_AUTOMAKE([tar-ustar]) +AM_INIT_AUTOMAKE +AC_SUBST([LIBTOOL_DEPS]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],) AC_CONFIG_HEADER(config.h) AC_CONFIG_MACRO_DIR([m4]) @@ -67,7 +69,8 @@ AC_SUBST(CONSOLE_FLAGS) AC_SUBST(GUI_FLAGS) dnl localization tools -ifdef([IT_PROG_INTLTOOL],[IT_PROG_INTLTOOL],[AC_PROG_INTLTOOL]) +IT_PROG_INTLTOOL([0.40], [no-xml]) + dnl Initialize libtool AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL @@ -374,15 +377,39 @@ fi AC_SUBST(STRICT_OPTIONS) -AC_CONFIG_SUBDIRS( mediastreamer2 ) +AC_ARG_ENABLE([external-mediastreamer], + [AS_HELP_STRING([--enable-external-mediastreamer],[Use external mediastreamer library])],, + [enable_external_mediastreamer=no]) + +AS_CASE($enable_external_mediastreamer, + [yes],[ + PKG_CHECK_MODULES([MEDIASTREAMER], [mediastreamer]) + MS2_VERSION=`$PKG_CONFIG --modversion mediastreamer` + AM_CONDITIONAL(EXTERNAL_MEDIASTREAMER, [true])], + [no],[ + AC_CONFIG_SUBDIRS( mediastreamer2 ) + MEDIASTREAMER_DIR=mediastreamer2 + MEDIASTREAMER_CFLAGS="-I\$(top_srcdir)/mediastreamer2/include" + MEDIASTREAMER_LIBS="\$(top_builddir)/mediastreamer2/src/libmediastreamer.la" +dnl need to temporary change quotes to allow square brackets + changequote(<<, >>) + MS2_VERSION=`grep -e '^.C_INIT(' $MEDIASTREAMER_DIR/configure.ac | sed -e 's:\([^(]\+\)(\[mediastreamer\],\[\(.*\)\]):\2:g'` + changequote([, ]) + AM_CONDITIONAL(EXTERNAL_MEDIASTREAMER, [false])], + [AC_MSG_ERROR([bad value '${enable_external_mediastreamer}' for --enable-external-mediastreamer])]) + +AC_SUBST(MEDIASTREAMER_CFLAGS) +AC_SUBST(MEDIASTREAMER_LIBS) +AC_SUBST(MEDIASTREAMER_DIR) +AC_SUBST([MS2_VERSION]) dnl check for db2html (docbook) to generate html user manual AC_CHECK_PROG(have_sgmltools,sgmltools, yes, no) AM_CONDITIONAL(ENABLE_MANUAL, test x$have_sgmltools$build_manual = xyesyes ) dnl for external use of linphone libs -LINPHONE_CFLAGS="-I${includedir} -I${includedir}/linphone " -LINPHONE_LIBS="-L${libdir} -llinphone" +LINPHONE_CFLAGS="-I${includedir} -I${includedir}/linphone" +LINPHONE_LIBS="-L${libdir} -llinphone" if test x$mingw_found = xyes ; then LINPHONE_LIBS="$LINPHONE_LIBS $OSIP_LIBS" @@ -390,7 +417,6 @@ fi AC_SUBST(LINPHONE_CFLAGS) AC_SUBST(LINPHONE_LIBS) - AC_DEFINE_UNQUOTED(LINPHONE_VERSION,"$PACKAGE_VERSION",[Linphone's version number]) AC_DEFINE_UNQUOTED(LINPHONE_PLUGINS_DIR, "${package_prefix}/lib/liblinphone/plugins" ,[path of liblinphone plugins, not mediastreamer2 plugins]) @@ -406,7 +432,8 @@ AC_ARG_ENABLE(external-ortp, esac],[external_ortp=false]) if test "$external_ortp" = 'true'; then - LP_CHECK_ORTP + PKG_CHECK_MODULES([ORTP], [ortp]) + ORTP_VERSION=`$PKG_CONFIG --modversion ortp` else AC_CONFIG_SUBDIRS( oRTP ) ORTP_CFLAGS="-I\$(top_srcdir)/oRTP/include" @@ -414,22 +441,15 @@ else if test x$ac_cv_c_bigendian = xyes ; then ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_BIGENDIAN" fi + ORTP_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/oRTP/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'` fi AC_SUBST(ORTP_CFLAGS) AC_SUBST(ORTP_LIBS) +AC_SUBST(ORTP_DIR) +AC_SUBST([ORTP_VERSION]) AM_CONDITIONAL(EXTERNAL_ORTP, [test "$external_ortp" = 'true']) -dnl Packaging: Pick oRTP version from ${top_srcdir}/oRTP/configure.ac -dnl Feel free to propose an alternative & cleaner version... -top_srcdir=`dirname $0` -changequote(, )dnl -ORTP_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/oRTP/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'` -MS2_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/mediastreamer2/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'` -changequote([, ])dnl -AC_SUBST([ORTP_VERSION]) -AC_SUBST([MS2_VERSION]) - dnl ################################################## dnl # Check for doxygen dnl ################################################## @@ -441,7 +461,7 @@ AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) AC_OUTPUT([ Makefile m4/Makefile -po/Makefile.in +po/Makefile.in pixmaps/Makefile coreapi/Makefile coreapi/help/Makefile diff --git a/console/Makefile.am b/console/Makefile.am index 70c2625..bef1e90 100644 --- a/console/Makefile.am +++ b/console/Makefile.am @@ -9,9 +9,7 @@ INCLUDES = \ -I$(top_srcdir)/coreapi\ $(ORTP_CFLAGS) \ -I$(top_srcdir)/exosip \ - -I$(top_srcdir)/mediastreamer2/include - - + $(MEDIASTREAMER_CFLAGS) bin_PROGRAMS = linphonec linphonecsh @@ -22,7 +20,7 @@ endif linphonec_SOURCES = linphonec.c linphonec.h commands.c linphonec_CFLAGS=$(COMMON_CFLAGS) $(CONSOLE_FLAGS) linphonec_LDADD = $(top_builddir)/coreapi/liblinphone.la $(READLINE_LIBS) \ - $(top_builddir)/mediastreamer2/src/libmediastreamer.la \ + $(MEDIASTREAMER_LIBS) \ $(ORTP_LIBS) \ $(SPEEX_LIBS) \ $(OSIP_LIBS) @@ -41,7 +39,7 @@ sipomatic_CFLAGS= $(COMMON_CFLAGS) $(CONSOLE_FLAGS) sipomatic_LDADD= $(INTLLIBS) \ $(top_builddir)/coreapi/liblinphone.la \ - $(top_builddir)/mediastreamer2/src/libmediastreamer.la \ + $(MEDIASTREAMER_LIBS) \ $(ORTP_LIBS) \ $(SPEEX_LIBS) \ $(OSIP_LIBS) diff --git a/coreapi/Makefile.am b/coreapi/Makefile.am index b3cf6df..fa4b385 100644 --- a/coreapi/Makefile.am +++ b/coreapi/Makefile.am @@ -10,7 +10,7 @@ linphone_include_HEADERS=linphonecore.h linphonecore_utils.h ../config.h lpconfi INCLUDES = \ -I$(top_srcdir)\ - -I$(top_srcdir)/mediastreamer2/include + $(MEDIASTREAMER_CFLAGS) lib_LTLIBRARIES=liblinphone.la @@ -42,7 +42,7 @@ liblinphone_la_LDFLAGS= -version-info $(LIBLINPHONE_SO_VERSION) -no-undefined liblinphone_la_LIBADD= \ $(EXOSIP_LIBS) \ - $(top_builddir)/mediastreamer2/src/libmediastreamer.la \ + $(MEDIASTREAMER_LIBS) \ $(ORTP_LIBS) if BUILD_WIN32 @@ -58,6 +58,7 @@ test_lsd_LDADD=liblinphone.la AM_CFLAGS=$(STRICT_OPTIONS) -DIN_LINPHONE \ $(ORTP_CFLAGS) \ $(OSIP_CFLAGS) \ + $(MEDIASTREAMER_CFLAGS) \ $(EXOSIP_CFLAGS) \ -DENABLE_TRACE \ -DLOG_DOMAIN=\"LinphoneCore\" \ diff --git a/coreapi/help/Makefile.am b/coreapi/help/Makefile.am index ebe407f..d4cebff 100644 --- a/coreapi/help/Makefile.am +++ b/coreapi/help/Makefile.am @@ -39,11 +39,12 @@ helloworld_SOURCES=helloworld.c helloworld_LDADD=$(top_builddir)/coreapi/liblinphone.la INCLUDES=-I$(top_srcdir)/coreapi \ - -I$(top_srcdir)/mediastreamer2/include + $(MEDIASTREAMER_CFLAGS) AM_CFLAGS=$(STRICT_OPTIONS) -DIN_LINPHONE \ $(ORTP_CFLAGS) \ $(OSIP_CFLAGS) \ + $(MEDIASTREAMER_CFLAGS) \ $(EXOSIP_CFLAGS) \ -DENABLE_TRACE \ -DLOG_DOMAIN=\"LinphoneCore\" \ diff --git a/gtk/Makefile.am b/gtk/Makefile.am index 546e9f4..a2c38b3 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -45,8 +45,8 @@ linphone_3_SOURCES= \ loginframe.c \ linphone.h -linphone_3_LDADD=$(top_builddir)/oRTP/src/libortp.la \ - $(top_builddir)/mediastreamer2/src/libmediastreamer.la \ +linphone_3_LDADD=$(ORTP_LIBS) \ + $(MEDIASTREAMER_LIBS) \ $(top_builddir)/coreapi/liblinphone.la \ $(LIBGTK_LIBS) $(INTLLIBS) @@ -69,13 +69,13 @@ endif AM_CFLAGS= -DIN_LINPHONE -I$(top_srcdir)/coreapi/ \ - -I$(top_srcdir)/mediastreamer2/include/ \ + $(MEDIASTREAMER_CFLAGS) \ $(ORTP_CFLAGS) \ $(STRICT_OPTIONS) $(LIBGTK_CFLAGS) $(IPV6_CFLAGS) \ $(OSIP_CFLAGS) -version_date.h: $(top_srcdir)/configure.in +version_date.h: $(top_srcdir)/configure.ac echo "#define LINPHONE_VERSION_DATE \"$(VERSION)-`date +%y%m%d`\"" > $@ newdate: