[x264-devel] commit: improve generation of Darwin libraries (Guillaume Poirier )

git version control git at videolan.org
Fri Aug 22 21:04:55 CEST 2008


x264 | branch: master | Guillaume Poirier <gpoirier at macbook-pro-de-guillaume-poirier.local> | Fri Aug 22 21:05:37 2008 +0200| [9d4d168bb484c2a27e9f4b8f5eb360a00a1cf426] | committer: Guillaume Poirier 

improve generation of Darwin libraries
Patch by vmrsss %vmrsss A gmail P com%

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=9d4d168bb484c2a27e9f4b8f5eb360a00a1cf426
---

 Makefile     |    4 ++--
 configure    |   14 ++++++++++++--
 gtk/Makefile |   10 +++++-----
 3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index e80120e..4e0d1c8 100644
--- a/Makefile
+++ b/Makefile
@@ -161,7 +161,7 @@ install: x264$(EXE) $(SONAME)
 ifeq ($(SYS),MINGW)
 	$(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(bindir))
 else
-	$(if $(SONAME), ln -sf $(SONAME) $(DESTDIR)$(libdir)/libx264.so)
+	$(if $(SONAME), ln -sf $(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX))
 	$(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir))
 endif
 	$(if $(IMPLIBNAME), install -m 644 $(IMPLIBNAME) $(DESTDIR)$(libdir))
@@ -172,7 +172,7 @@ install-gtk: libx264gtk.a
 uninstall:
 	rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(libdir)/libx264.a
 	rm -f $(DESTDIR)$(bindir)/x264 $(DESTDIR)$(libdir)/pkgconfig/x264.pc
-	$(if $(SONAME), rm -f $(DESTDIR)$(libdir)/$(SONAME) $(DESTDIR)$(libdir)/libx264.so)
+	$(if $(SONAME), rm -f $(DESTDIR)$(libdir)/$(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX))
 	$(MAKE) -C gtk uninstall
 
 etags: TAGS
diff --git a/configure b/configure
index adb2748..34d99b4 100755
--- a/configure
+++ b/configure
@@ -455,15 +455,25 @@ if [ "$shared" = "yes" ]; then
         echo 'IMPLIBNAME=libx264.dll.a' >> config.mak
         echo 'SOFLAGS=-Wl,--out-implib,$(IMPLIBNAME) -Wl,--enable-auto-image-base' >> config.mak
     elif [ "$SYS" = "MACOSX" ]; then
+        echo "SOSUFFIX=dylib" >> config.mak
         echo "SONAME=libx264.$API.dylib" >> config.mak
-        echo 'SOFLAGS=-dynamiclib -Wl,-single_module -Wl,-read_only_relocs,suppress' >> config.mak        
+        echo 'SOFLAGS=-dynamiclib -Wl,-single_module -Wl,-read_only_relocs,suppress -install_name $(DESTDIR)$(libdir)/$(SONAME)' >> config.mak
     else
+        echo "SOSUFFIX=so" >> config.mak
         echo "SONAME=libx264.so.$API" >> config.mak
         echo 'SOFLAGS=-Wl,-soname,$(SONAME)' >> config.mak
     fi
     echo 'default: $(SONAME)' >> config.mak
     if [ "$gtk" = "yes" ]; then
-        echo "SONAMEGTK=libx264gtk.so.$API" >> gtk/config.mak
+        if [ "$SYS" = "MACOSX" ]; then
+            echo "SOSUFFIX=dylib" >> gtk/config.mak
+            echo "SONAMEGTK=libx264gtk.$API.dylib" >> gtk/config.mak
+            echo 'SOFLAGS=-dynamiclib -Wl,-single_module -Wl,-read_only_relocs,suppress -install_name $(DESTDIR)$(libdir)/$(SONAMEGTK)' >> gtk/config.mak
+        else
+            echo "SOSUFFIX=so" >> gtk/config.mak
+            echo "SONAMEGTK=libx264gtk.so.$API" >> gtk/config.mak
+            echo 'SOFLAGS=-Wl,-soname,$(SONAME)' >> gtk/config.mak
+        fi
     fi
 fi
 
diff --git a/gtk/Makefile b/gtk/Makefile
index 554ff1d..ac4b01c 100644
--- a/gtk/Makefile
+++ b/gtk/Makefile
@@ -93,7 +93,7 @@ libx264gtk.a: $(OBJECTS_LIB)
 
 $(SONAMEGTK): $(OBJECTS_LIB)
 	@echo "  L: $(@F)"
-	@$(CC) -shared -o $@ $(OBJECTS_LIB) -Wl,-soname,$(SONAMEGTK) $(LDFLAGS)
+	@$(CC) -shared -o $@ $(OBJECTS_LIB) $(SOFLAGS) $(LDFLAGS)
 
 # Program : test
 $(TEST_BIN): $(OBJECTS_LIB) $(OBJECTS_TEST)
@@ -142,8 +142,8 @@ install: $(ENCODE_BIN)
 	@install -d "$(DESTDIR)$(libdir)"
 	@echo "  I: $(DESTDIR)$(libdir)/libx264gtk.a"
 	@install -m 644 libx264gtk.a "$(DESTDIR)$(libdir)"
-	@echo "  I: $(DESTDIR)$(libdir)/libx264gtk.so"
-	@$(if $(SONAMEGTK), ln -sf $(SONAMEGTK) $(DESTDIR)$(libdir)/libx264gtk.so)
+	@echo "  I: $(DESTDIR)$(libdir)/libx264gtk.$(SOSUFFIX)"
+	@$(if $(SONAMEGTK), ln -sf $(SONAMEGTK) $(DESTDIR)$(libdir)/libx264gtk.$(SOSUFFIX))
 	@$(if $(SONAMEGTK), install -m 755 $(SONAMEGTK) $(DESTDIR)$(libdir))
 	@echo "  D: $(DESTDIR)$(bindir)"
 	@install -d "$(DESTDIR)$(bindir)"
@@ -172,9 +172,9 @@ uninstall:
 	@rm -f "$(DESTDIR)$(includedir)/x264_gtk_enum.h"
 	@echo "  U: $(DESTDIR)$(libdir)/libx264gtk.a"
 	@rm -f "$(DESTDIR)$(libdir)/libx264gtk.a"
-	@echo "  U: $(DESTDIR)$(libdir)/libx264gtk.so"
+	@echo "  U: $(DESTDIR)$(libdir)/$(SONAMEGTK)"
 	@$(if $(SONAMEGTK), rm -f "$(DESTDIR)$(libdir)/$(SONAMEGTK)")
-	@rm -f "$(DESTDIR)$(libdir)/libx264gtk.so"
+	@rm -f "$(DESTDIR)$(libdir)/libx264gtk.$(SOSUFFIX)"
 	@echo "  U: $(DESTDIR)$(bindir)/$(ENCODE_BIN)"
 	@rm -f "$(DESTDIR)$(bindir)/$(ENCODE_BIN)"
 	@echo "  U: $(DESTDIR)${datadir}/x264"



More information about the x264-devel mailing list