Commit 7421c8cf authored by Guillaume Poirier's avatar Guillaume Poirier

improve generation of Darwin libraries

Patch by vmrsss %vmrsss A gmail P com%
parent 7086a203
......@@ -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
......
......@@ -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
......
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment