shithub: openh264

Download patch

ref: 59c30f8952fbfe1ca81b43f0ae2f1d443320c8cc
parent: 575b6fb570817f83c6b9ea757f4413578785ef85
author: Martin Storsjö <martin@martin.st>
date: Mon Dec 1 09:22:56 EST 2014

Handle generating the versionless library via make rules

This makes sure both "make libopenh264.so" and "make libopenh264.so.0"
work as intended.

Use the versionless name as dependency for the install rule,
to make sure both (if possible) are created.

--- a/Makefile
+++ b/Makefile
@@ -180,7 +180,7 @@
 endif
 
 ifneq (ios, $(OS))
-libraries: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER)
+libraries: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX)
 else
 libraries: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX)
 endif
@@ -194,13 +194,14 @@
 $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER): $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
 	$(QUIET)rm -f $@
 	$(QUIET_CXX)$(CXX) $(SHARED) $(CXX_LINK_O) $+ $(LDFLAGS) $(SHLDFLAGS)
-	$(QUIET)if [ "$(SHAREDLIBSUFFIXVER)" != "$(SHAREDLIBSUFFIX)" ]; then \
-		ln -sfn $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER) \
-			$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX); \
-	fi
 
+ifneq ($(SHAREDLIBSUFFIXVER),$(SHAREDLIBSUFFIX))
+$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX): $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER)
+	$(QUIET)ln -sfn $+ $@
+endif
+
 ifeq ($(HAVE_GMP_API),Yes)
-plugin: $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIXVER)
+plugin: $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIX)
 LIBRARIES += $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIXVER)
 else
 plugin:
@@ -211,11 +212,12 @@
 $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIXVER): $(MODULE_OBJS) $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
 	$(QUIET)rm -f $@
 	$(QUIET_CXX)$(CXX) $(SHARED) $(CXX_LINK_O) $+ $(LDFLAGS) $(SHLDFLAGS) $(MODULE_LDFLAGS)
-	$(QUIET)if [ "$(SHAREDLIBSUFFIXVER)" != "$(SHAREDLIBSUFFIX)" ]; then \
-		ln -sfn $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIXVER) \
-			$(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIX); \
-	fi
 
+ifneq ($(SHAREDLIBSUFFIXVER),$(SHAREDLIBSUFFIX))
+$(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIX): $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIXVER)
+	$(QUIET)ln -sfn $+ $@
+endif
+
 $(PROJECT_NAME).pc: $(PROJECT_NAME).pc.in
 	@sed -e 's;@prefix@;$(PREFIX);' -e 's;@VERSION@;$(VERSION);' < $(PROJECT_NAME).pc.in > $(PROJECT_NAME).pc
 
@@ -227,7 +229,7 @@
 	mkdir -p $(PREFIX)/lib
 	install -m 644 $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(PREFIX)/lib
 
-install-shared: $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER) install-headers $(PROJECT_NAME).pc
+install-shared: $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX) install-headers $(PROJECT_NAME).pc
 	mkdir -p $(PREFIX)/lib
 	mkdir -p $(PREFIX)/bin
 	install -m 755 $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER) $(PREFIX)/lib