Skip to contentSkip to conversation

live555: use upstream install target for staging installation

PATCH New Baruch Siach 2 participants 7 messages Nov 17, 2014 – Nov 19, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 live555: use upstream install target for staging installation

Move include directories out of $(STAGING_DIR)/usr/include/live. This is upstream choice, and is consistent with e.g. Debian. Update mplayer and vlc to match.

---
 package/live555/live555.mk | 21 ++-------------------
 package/mplayer/mplayer.mk |  2 +-
 package/vlc/vlc.mk         |  9 ++++-----
 3 files changed, 7 insertions(+), 25 deletions(-)
package/live555/live555.mk +2 -19
index e933faaeae01..8c31a086559b 100644
@@ -23,6 +23,7 @@ define LIVE555_CONFIGURE_CMDS
 	echo 'CPLUSPLUS_COMPILER = $(TARGET_CXX)' >> $(@D)/config.linux
 	echo 'LINK = $(TARGET_CXX) -o' >> $(@D)/config.linux
 	echo 'LINK_OPTS = -L. $(TARGET_LDFLAGS)' >> $(@D)/config.linux
+	echo 'PREFIX = /usr' >> $(@D)/config.linux
 	(cd $(@D); ./genMakefiles linux)
 endef
 
@@ -30,31 +31,13 @@ define LIVE555_BUILD_CMDS
 	$(MAKE) -C $(@D) all
 endef
 
-LIVE555_HEADERS_TO_INSTALL = \
-	liveMedia/include \
-	groupsock/include \
-	UsageEnvironment/include \
-	BasicUsageEnvironment/include
-
-LIVE555_LIBS_TO_INSTALL = \
-	liveMedia/libliveMedia.a \
-	groupsock/libgroupsock.a \
-	UsageEnvironment/libUsageEnvironment.a \
-	BasicUsageEnvironment/libBasicUsageEnvironment.a
-
 LIVE555_FILES_TO_INSTALL-y =
 LIVE555_FILES_TO_INSTALL-$(BR2_PACKAGE_LIVE555_OPENRTSP) += testProgs/openRTSP
 LIVE555_FILES_TO_INSTALL-$(BR2_PACKAGE_LIVE555_MEDIASERVER) += mediaServer/live555MediaServer
 LIVE555_FILES_TO_INSTALL-$(BR2_PACKAGE_LIVE555_MPEG2_INDEXER) += testProgs/MPEG2TransportStreamIndexer
 
 define LIVE555_INSTALL_STAGING_CMDS
-	for i in $(LIVE555_HEADERS_TO_INSTALL); do \
-		mkdir -p $(STAGING_DIR)/usr/include/live/`dirname $$i`; \
-		cp -a $(@D)/$$i/* $(STAGING_DIR)/usr/include/live/`dirname $$i`; \
-	done; \
-	for i in $(LIVE555_LIBS_TO_INSTALL); do \
-		$(INSTALL) -D -m 0755 $(@D)/$$i $(STAGING_DIR)/usr/lib/`basename $$i`; \
-	done
+	$(MAKE) DESTDIR=$(STAGING_DIR) -C $(@D) install
 endef
 
 define LIVE555_INSTALL_TARGET_CMDS
package/mplayer/mplayer.mk +1 -1
index dbde97767b35..b2530e4a1300 100644
@@ -92,7 +92,7 @@ MPLAYER_DEPENDENCIES += live555
 MPLAYER_CONF_OPTS += --enable-live
 MPLAYER_LIVE555 = liveMedia groupsock UsageEnvironment BasicUsageEnvironment
 MPLAYER_CFLAGS += \
-	$(addprefix -I$(STAGING_DIR)/usr/include/live/,$(MPLAYER_LIVE555))
+	$(addprefix -I$(STAGING_DIR)/usr/include/,$(MPLAYER_LIVE555))
 MPLAYER_LDFLAGS += $(addprefix -l,$(MPLAYER_LIVE555)) -lstdc++
 else
 MPLAYER_CONF_OPTS += --disable-live
package/vlc/vlc.mk +4 -5
index 7e81d590e507..e2c81d6e8959 100644
@@ -231,11 +231,10 @@ VLC_CONF_OPTS += --enable-live555
 VLC_DEPENDENCIES += live555
 VLC_CONF_ENV += \
 	LIVE555_CFLAGS="\
-		-I$(STAGING_DIR)/usr/include/live \
-		-I$(STAGING_DIR)/usr/include/live/BasicUsageEnvironment \
-		-I$(STAGING_DIR)/usr/include/live/groupsock \
-		-I$(STAGING_DIR)/usr/include/live/liveMedia \
-		-I$(STAGING_DIR)/usr/include/live/UsageEnvironment \
+		-I$(STAGING_DIR)/usr/include/BasicUsageEnvironment \
+		-I$(STAGING_DIR)/usr/include/groupsock \
+		-I$(STAGING_DIR)/usr/include/liveMedia \
+		-I$(STAGING_DIR)/usr/include/UsageEnvironment \
 		" \
 	LIVE555_LIBS="-L$(STAGING_DIR)/usr/lib -lliveMedia"
 else
Signature · 1 line
2.1.3
#1 lore raw

PATCH 2/3 live555: add support for building dynamic libraries

---
 package/live555/live555.mk | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)
package/live555/live555.mk +19 -7
index 8c31a086559b..b923388de0fd 100644
@@ -13,18 +13,30 @@ LIVE555_INSTALL_STAGING = YES
 
 LIVE555_CFLAGS = $(TARGET_CFLAGS)
 
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+LIVE555_CONFIG_TARGET = linux
+LIVE555_LIBRARY_LINK = $(TARGET_AR) cr
+else
+LIVE555_CONFIG_TARGET = linux-with-shared-libraries
+LIVE555_LIBRARY_LINK = $(TARGET_CC) -o
+endif
+
 ifndef ($(BR2_ENABLE_LOCALE),y)
 LIVE555_CFLAGS += -DLOCALE_NOT_USED
 endif
 
 define LIVE555_CONFIGURE_CMDS
-	echo 'COMPILE_OPTS = $$(INCLUDES) -I. -DSOCKLEN_T=socklen_t $(LIVE555_CFLAGS)' >> $(@D)/config.linux
-	echo 'C_COMPILER = $(TARGET_CC)' >> $(@D)/config.linux
-	echo 'CPLUSPLUS_COMPILER = $(TARGET_CXX)' >> $(@D)/config.linux
-	echo 'LINK = $(TARGET_CXX) -o' >> $(@D)/config.linux
-	echo 'LINK_OPTS = -L. $(TARGET_LDFLAGS)' >> $(@D)/config.linux
-	echo 'PREFIX = /usr' >> $(@D)/config.linux
-	(cd $(@D); ./genMakefiles linux)
+	echo 'COMPILE_OPTS = $$(INCLUDES) -I. -DSOCKLEN_T=socklen_t $(LIVE555_CFLAGS)' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	echo 'C_COMPILER = $(TARGET_CC)' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	echo 'CPLUSPLUS_COMPILER = $(TARGET_CXX)' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+
+	echo 'LINK = $(TARGET_CXX) -o' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	echo 'LINK_OPTS = -L. $(TARGET_LDFLAGS)' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	echo 'PREFIX = /usr' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	# Must have a whitespace at the end of LIBRARY_LINK, otherwise static link
+	# fails
+	echo 'LIBRARY_LINK = $(LIVE555_LIBRARY_LINK) ' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	(cd $(@D); ./genMakefiles $(LIVE555_CONFIG_TARGET))
 endef
 
 define LIVE555_BUILD_CMDS
Signature · 1 line
2.1.3
#2 lore raw

PATCH 2/3 live555: add support for building dynamic libraries

Dear Baruch Siach,

Quoted 21 lines · Baruch Siach
package/live555/live555.mk +9 -7
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+LIVE555_CONFIG_TARGET = linux
+LIVE555_LIBRARY_LINK = $(TARGET_AR) cr
+else
+LIVE555_CONFIG_TARGET = linux-with-shared-libraries
+LIVE555_LIBRARY_LINK = $(TARGET_CC) -o
+endif
+
 ifndef ($(BR2_ENABLE_LOCALE),y)
 LIVE555_CFLAGS += -DLOCALE_NOT_USED
 endif
 
 define LIVE555_CONFIGURE_CMDS
-	echo 'COMPILE_OPTS = $$(INCLUDES) -I. -DSOCKLEN_T=socklen_t $(LIVE555_CFLAGS)' >> $(@D)/config.linux
-	echo 'C_COMPILER = $(TARGET_CC)' >> $(@D)/config.linux
-	echo 'CPLUSPLUS_COMPILER = $(TARGET_CXX)' >> $(@D)/config.linux
-	echo 'LINK = $(TARGET_CXX) -o' >> $(@D)/config.linux
-	echo 'LINK_OPTS = -L. $(TARGET_LDFLAGS)' >> $(@D)/config.linux
-	echo 'PREFIX = /usr' >> $(@D)/config.linux
-	(cd $(@D); ./genMakefiles linux)
+	echo 'COMPILE_OPTS = $$(INCLUDES) -I. -DSOCKLEN_T=socklen_t $(LIVE555_CFLAGS)' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)

package/live555/live555.mk LIVE555_INSTALL_STAGING = YES · line 39

Quoted 10 lines
package/live555/live555.mk +10 -0
+	echo 'C_COMPILER = $(TARGET_CC)' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	echo 'CPLUSPLUS_COMPILER = $(TARGET_CXX)' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+
+	echo 'LINK = $(TARGET_CXX) -o' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	echo 'LINK_OPTS = -L. $(TARGET_LDFLAGS)' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	echo 'PREFIX = /usr' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	# Must have a whitespace at the end of LIBRARY_LINK, otherwise static link
+	# fails
+	echo 'LIBRARY_LINK = $(LIVE555_LIBRARY_LINK) ' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	(cd $(@D); ./genMakefiles $(LIVE555_CONFIG_TARGET))

I don't understand why you need a separate config.linux and config.linux-with-shared-libraries. Since in Buildroot we will either be building with BR2_PREFER_STATIC_LIB=y, or BR2_PREFER_STATIC_LIB disabled, why not simply call the file config.linux, as it was called before this patch?

Of course, the LIVE555_LIBRARY_LINK think is needed, but I don't see why the other changes are needed.

Can you expand on this?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 2/3 live555: add support for building dynamic libraries

Hi Thomas,

Quoted 39 lines · Thomas Petazzoni
Quoted 21 lines · Baruch Siach
package/live555/live555.mk +9 -7
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+LIVE555_CONFIG_TARGET = linux
+LIVE555_LIBRARY_LINK = $(TARGET_AR) cr
+else
+LIVE555_CONFIG_TARGET = linux-with-shared-libraries
+LIVE555_LIBRARY_LINK = $(TARGET_CC) -o
+endif
+
 ifndef ($(BR2_ENABLE_LOCALE),y)
 LIVE555_CFLAGS += -DLOCALE_NOT_USED
 endif
 
 define LIVE555_CONFIGURE_CMDS
-	echo 'COMPILE_OPTS = $$(INCLUDES) -I. -DSOCKLEN_T=socklen_t $(LIVE555_CFLAGS)' >> $(@D)/config.linux
-	echo 'C_COMPILER = $(TARGET_CC)' >> $(@D)/config.linux
-	echo 'CPLUSPLUS_COMPILER = $(TARGET_CXX)' >> $(@D)/config.linux
-	echo 'LINK = $(TARGET_CXX) -o' >> $(@D)/config.linux
-	echo 'LINK_OPTS = -L. $(TARGET_LDFLAGS)' >> $(@D)/config.linux
-	echo 'PREFIX = /usr' >> $(@D)/config.linux
-	(cd $(@D); ./genMakefiles linux)
+	echo 'COMPILE_OPTS = $$(INCLUDES) -I. -DSOCKLEN_T=socklen_t $(LIVE555_CFLAGS)' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)

package/live555/live555.mk LIVE555_INSTALL_STAGING = YES · line 39

Quoted 10 lines
package/live555/live555.mk +10 -0
+	echo 'C_COMPILER = $(TARGET_CC)' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	echo 'CPLUSPLUS_COMPILER = $(TARGET_CXX)' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+
+	echo 'LINK = $(TARGET_CXX) -o' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	echo 'LINK_OPTS = -L. $(TARGET_LDFLAGS)' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	echo 'PREFIX = /usr' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	# Must have a whitespace at the end of LIBRARY_LINK, otherwise static link
+	# fails
+	echo 'LIBRARY_LINK = $(LIVE555_LIBRARY_LINK) ' >> $(@D)/config.$(LIVE555_CONFIG_TARGET)
+	(cd $(@D); ./genMakefiles $(LIVE555_CONFIG_TARGET))

I don't understand why you need a separate config.linux and config.linux-with-shared-libraries. Since in Buildroot we will either be building with BR2_PREFER_STATIC_LIB=y, or BR2_PREFER_STATIC_LIB disabled, why not simply call the file config.linux, as it was called before this patch?

Quoted 4 lines

Of course, the LIVE555_LIBRARY_LINK think is needed, but I don't see why the other changes are needed.

Can you expand on this?

Both config.linux and config.linux-with-shared-libraries already exist in upstream code. We are only appending to these files to override some variables. The linux-with-shared-libraries variant defines a few additional variables needed for dynamic linking (library version, installation target). Aligning to upstream build procedure should be more future proof, IMO.

Thanks for reviewing.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#4 lore raw

PATCH 2/3 live555: add support for building dynamic libraries

Dear Baruch Siach,

Quoted 9 lines · Baruch Siach
Quoted 9 lines

I don't understand why you need a separate config.linux and config.linux-with-shared-libraries. Since in Buildroot we will either be building with BR2_PREFER_STATIC_LIB=y, or BR2_PREFER_STATIC_LIB disabled, why not simply call the file config.linux, as it was called before this patch?

Of course, the LIVE555_LIBRARY_LINK think is needed, but I don't see why the other changes are needed.

Quoted 7 lines
Quoted 1 line

Can you expand on this?

Both config.linux and config.linux-with-shared-libraries already exist in upstream code. We are only appending to these files to override some variables. The linux-with-shared-libraries variant defines a few additional variables needed for dynamic linking (library version, installation target). Aligning to upstream build procedure should be more future proof, IMO.

Thanks for the explanation, definitely makes sense. I've added part of this paragraph of explanation to the commit log, and then applied both this patch, as well as the patch that allows VLC to link dynamically against live555 to the next branch.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 3/3 vlc: allow dynamically linking live555

In reply to Baruch Siach
---
 package/vlc/vlc.mk | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
package/vlc/vlc.mk +1 -3
index e2c81d6e8959..19f1058dfa47 100644
@@ -224,9 +224,7 @@ else
 VLC_CONF_OPTS += --disable-libxml2
 endif
 
-# live555 installs a static library only, and vlc tries to link it into a
-# shared library - which doesn't work. So only enable live555 if static.
-ifeq ($(BR2_PACKAGE_LIVE555)$(BR2_PREFER_STATIC_LIB),yy)
+ifeq ($(BR2_PACKAGE_LIVE555),y)
 VLC_CONF_OPTS += --enable-live555
 VLC_DEPENDENCIES += live555
 VLC_CONF_ENV += \
Signature · 1 line
2.1.3
#6 lore raw

PATCH 1/3 live555: use upstream install target for staging installation

In reply to Baruch Siach

Dear Baruch Siach,

Quoted 10 lines · Baruch Siach

Move include directories out of $(STAGING_DIR)/usr/include/live. This is upstream choice, and is consistent with e.g. Debian. Update mplayer and vlc to match.

---
 package/live555/live555.mk | 21 ++-------------------
 package/mplayer/mplayer.mk |  2 +-
 package/vlc/vlc.mk         |  9 ++++-----
 3 files changed, 7 insertions(+), 25 deletions(-)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com