[x264-devel] AW: [PATCH] Support for shared Dlls

Vizeli Pascal pvizeli at yahoo.de
Mon Sep 11 09:14:23 CEST 2006


You can over write the variable:

gmake SONAME=libx264.dll

----- Ursprüngliche Mail ----
Von: Ramiro Polla <angustia at arrozcru.no-ip.org>
An: x264-devel at videolan.org
Gesendet: Montag, den 11. September 2006, 00:14:33 Uhr
Betreff: [x264-devel] [PATCH] Support for shared Dlls

Hello,

Whenever --enable-shared is set, all library names are hardcoded to ".so".
Attached patch makes the libraries end in ".dll" for MinGW and Cygwin 
systems.

I tried to follow what goes on in FFmpeg's configure and Makefile.
With the current version, the library name is set to the usual 
"libx264.so.50" in all systems except MinGW and Cygwin, where the 
library name is set to "libx264-50.dll".

I haven't tested in linux, but I have no reason to believe it wouldn't 
work just as it did before.

Thanks,
Ramiro Polla

Index: configure
===================================================================
--- configure    (revision 560)
+++ configure    (working copy)
@@ -16,7 +16,7 @@
 echo "  --enable-gprof           adds -pg, doesn't strip"
 echo "  --enable-visualize       enables visualization (X11 only)"
 echo "  --enable-pic             build position-independent code"
-echo "  --enable-shared          build libx264.so"
+echo "  --enable-shared          build libx264 shared library"
 echo "  --extra-asflags=EASFLAGS add EASFLAGS to ASFLAGS"
 echo "  --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS"
 echo "  --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS"
@@ -64,6 +64,8 @@
 AS="nasm"
 ASFLAGS=""
 
+SONAME='libx264$(SLIBSUF).$(API)'
+SLIBSUF=".so"
 EXE=""
 
 MACHINE="$(./config.guess)"
@@ -101,11 +103,15 @@
     CFLAGS="$CFLAGS -mno-cygwin"
     LDFLAGS="$LDFLAGS -mno-cygwin"
     EXE=".exe"
+    SLIBSUF=".dll"
+    SONAME='libx264-$(API)$(SLIBSUF)'
     DEVNULL="NUL"
     ;;
   mingw*)
     SYS="MINGW"
     EXE=".exe"
+    SLIBSUF=".dll"
+    SONAME='libx264-$(API)$(SLIBSUF)'
     DEVNULL="NUL"
     ;;
   sunos*|solaris*)
@@ -385,7 +391,9 @@
 
 if [ "$shared" = "yes" ]; then
     API=$(grep '#define X264_BUILD' < x264.h | cut -f 3 -d ' ')
-    echo "SONAME=libx264.so.$API" >> config.mak
+    echo "API=${API}" >> config.mak
+    echo "SLIBSUF=${SLIBSUF}" >> config.mak
+    echo "SONAME=${SONAME}" >> config.mak
     echo 'default: $(SONAME)' >> config.mak
     if [ "$gtk" = "yes" ]; then
         echo "SONAMEGTK=libx264gtk.so.$API" >> gtk/config.mak
Index: Makefile
===================================================================
--- Makefile    (revision 560)
+++ Makefile    (working copy)
@@ -146,7 +146,7 @@
     install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
     install x264 $(DESTDIR)$(bindir)
     ranlib $(DESTDIR)$(libdir)/libx264.a
-    $(if $(SONAME), ln -sf $(SONAME) $(DESTDIR)$(libdir)/libx264.so)
+    $(if $(SONAME), ln -sf $(SONAME) $(DESTDIR)$(libdir)/libx264$(SLIBSUF))
     $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir))
 
 install-gtk: libx264gtk.a
@@ -155,7 +155,7 @@
 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$(SLIBSUF))
     $(MAKE) -C gtk uninstall
 
 etags: TAGS



-- 
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html



More information about the x264-devel mailing list