[MPlayer-dev-eng] [PATCH] Separated LIVE.COM library and include directories
Mikael Magnusson
mikaelmagnusson at tjohoo.se
Wed Jun 30 18:25:41 CEST 2004
With this patch the configuration script can automatically use LIVE.COM
which include files and libraries are installed into different
directories. For example /usr/include and /usr/lib, as in the
liblivemedia-dev package in Debian.
Instead of linking directly with the static libraries, they are added
with -llibrary. This reduces the size of the mplayer binary slightly.
I have also tested the patch with an "uninstalled" LIVE.COM directory
and I didn't experience any problems.
Regards,
Mikael Magnusson
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.881
diff -u -u -r1.881 configure
--- configure 27 Jun 2004 17:54:30 -0000 1.881
+++ configure 30 Jun 2004 00:11:32 -0000
@@ -321,6 +321,7 @@
--with-xvidlibdir=DIR libxvidcore (XviD) in DIR
--with-xvidincdir=DIR XviD header in DIR
--with-livelibdir=DIR path to LIVE.COM Streaming Media libraries
+ --with-liveincdir=DIR path to LIVE.COM Streaming Media includes
--with-xmmsplugindir=DIR path to XMMS plugins
--with-xmmslibdir=DIR path to libxmms.so.1
--with-bio2jack=DIR path to libbio2jack.a (e.g. /home/user/bio2jack)
@@ -1552,6 +1553,10 @@
_livelibdir=`echo $ac_option | cut -d '=' -f 2`
_live=yes
;;
+ --with-liveincdir=*)
+ _liveincdir=`echo $ac_option | cut -d '=' -f 2`
+ _live=yes
+ ;;
--with-mlibdir=*)
_mlibdir=`echo $ac_option | cut -d '=' -f 2`
_mlib=yes
@@ -5174,11 +5179,20 @@
if test -z "$_livelibdir" ; then
- for I in $_libdir/live /usr/lib/live /usr/local/live /usr/local/lib/live; do
- if test -d "$I" ; then
- _livelibdir="$I"
- break;
- fi;
+ for I in $_libdir/live /usr/lib/live /usr/local/live /usr/local/lib/live $_libdir /usr/lib /usr/local/lib; do
+ if test -d "$I" && ( test -f "$I/liveMedia/libliveMedia.a" || test -f "$I/libliveMedia.a" ) ; then
+ _livelibdir="$I"
+ break
+ fi
+ done
+fi
+
+if test -z "$_liveincdir" ; then
+ for I in $_libdir/live /usr/lib/live /usr/local/live /usr/local/lib/live /usr/include /usr/include/live /usr/local/include /usr/local/include/live ; do
+ if test -d "$I" && ( test -f "$I/liveMedia/include/liveMedia_version.hh" || test -f "$I/liveMedia/liveMedia_version.hh" ) ; then
+ _liveincdir="$I"
+ break
+ fi
done
fi
@@ -5186,19 +5200,47 @@
if test "$_live" = auto && test "$_network" = yes ; then
_live=yes
test "$_livelibdir" || _live=no
+ test "$_liveincdir" || _live=no
# TODO: deeper, more reliable test of libs, and version!
# (users may have empty live/ dir or something different there, for
# example 'live config files', or they may have old, incompatibel version)
fi
if test "$_live" = yes && test "$_network" = yes ; then
- echores "yes (using $_livelibdir)"
+ echores "yes (using $_livelibdir $_liveincdir)"
_def_live='#define STREAMING_LIVE_DOT_COM 1'
+
+ if test -f "$_liveincdir/liveMedia/include/liveMedia_version.hh" ; then
+ _liveincdirpostfix="/include"
+ else
+ _liveincdirpostfix=""
+ fi
+
+ if test -f "$_livelibdir/liveMedia/libliveMedia.a" ; then
+ _livelibsubdir=yes
+ else
+ _livelibsubdir=no
+ fi
+
+ if test "$_livelibsubdir" = yes ; then
+ _live_libs_dir_def="\
+LIVE_LIBS = -L\$(LIVE_LIB_DIR)/liveMedia
+LIVE_LIBS += -L\$(LIVE_LIB_DIR)/groupsock
+LIVE_LIBS += -L\$(LIVE_LIB_DIR)/BasicUsageEnvironment
+LIVE_LIBS += -L\$(LIVE_LIB_DIR)/UsageEnvironment"
+ else
+ _live_libs_dir_def="\
+LIVE_LIBS = -L\$(LIVE_LIB_DIR)"
+ fi
+
_live_libs_def="# LIVE.COM Streaming Media libraries:
LIVE_LIB_DIR = $_livelibdir
-LIVE_LIBS = \$(LIVE_LIB_DIR)/liveMedia/libliveMedia.a
-LIVE_LIBS += \$(LIVE_LIB_DIR)/groupsock/libgroupsock.a
-LIVE_LIBS += \$(LIVE_LIB_DIR)/UsageEnvironment/libUsageEnvironment.a
-LIVE_LIBS += \$(LIVE_LIB_DIR)/BasicUsageEnvironment/libBasicUsageEnvironment.a
+LIVE_INC_DIR = $_liveincdir
+LIVE_INC_DIR_POSTFIX = $_liveincdirpostfix
+$_live_libs_dir_def
+LIVE_LIBS += -lliveMedia
+LIVE_LIBS += -lgroupsock
+LIVE_LIBS += -lBasicUsageEnvironment
+LIVE_LIBS += -lUsageEnvironment
LIVE_LIBS += -lstdc++"
_ld_live='$(LIVE_LIBS)'
_inputmodules="live.com $_inputmodules"
Index: libmpdemux/Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/Makefile,v
retrieving revision 1.79
diff -u -u -r1.79 Makefile
--- libmpdemux/Makefile 24 Jun 2004 12:52:16 -0000 1.79
+++ libmpdemux/Makefile 30 Jun 2004 00:11:32 -0000
@@ -12,10 +12,10 @@
SRCS += realrtsp/asmrp.c realrtsp/real.c realrtsp/rmff.c realrtsp/rtsp.c realrtsp/rtsp_session.c realrtsp/sdpplin.c realrtsp/xbuffer.c
ifeq ($(STREAMING_LIVE_DOT_COM),yes)
CPLUSPLUSSRCS = demux_rtp.cpp demux_rtp_codec.cpp
-CPLUSPLUSINCLUDE = -I$(LIVE_LIB_DIR)/liveMedia/include
-CPLUSPLUSINCLUDE += -I$(LIVE_LIB_DIR)/UsageEnvironment/include
-CPLUSPLUSINCLUDE += -I$(LIVE_LIB_DIR)/BasicUsageEnvironment/include
-CPLUSPLUSINCLUDE += -I$(LIVE_LIB_DIR)/groupsock/include
+CPLUSPLUSINCLUDE = -I$(LIVE_INC_DIR)/liveMedia$(LIVE_INC_DIR_POSTFIX)
+CPLUSPLUSINCLUDE += -I$(LIVE_INC_DIR)/UsageEnvironment$(LIVE_INC_DIR_POSTFIX)
+CPLUSPLUSINCLUDE += -I$(LIVE_INC_DIR)/BasicUsageEnvironment$(LIVE_INC_DIR_POSTFIX)
+CPLUSPLUSINCLUDE += -I$(LIVE_INC_DIR)/groupsock$(LIVE_INC_DIR_POSTFIX)
else
SRCS += rtp.c
endif
@@ -42,7 +42,7 @@
INCLUDE = -I../loader $(CSS_INC) $(EXTRA_INC) $(LIBAV_INC)
CFLAGS = $(OPTFLAGS) $(INCLUDE) $(XMMS_CFLAGS) $(CDPARANOIA_INC) $(DVB_INC)
CPLUSPLUSFLAGS = $(CFLAGS) $(CPLUSPLUSINCLUDE)
-CPLUSPLUS = $(CC)
+CPLUSPLUS = $(CXX)
.SUFFIXES: .c .cpp .o
More information about the MPlayer-dev-eng
mailing list