[x264-devel] [PATCH] Link to libgpac instead of libgpac_static when enable shared
Zuxy Meng
zuxy.meng at gmail.com
Tue Apr 22 10:34:53 CEST 2008
Hi,
2008/4/10 Loren Merritt <lorenm at u.washington.edu>:
> On Thu, 10 Apr 2008, Zuxy Meng wrote:
>
> > I guess it's more desirable to link to a dynamic lib when we ourselves
> > are building dynamic libs.
>
> And link x264cli to libx264.so?
>
How about this?
--
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6
===============================================================================
diff --git a/Makefile b/Makefile
index 81c0505..d1bf89e 100644
--- a/Makefile
+++ b/Makefile
@@ -79,13 +79,13 @@ $(SONAME): .depend $(OBJS) $(OBJASM)
$(CC) -shared -o $@ $(OBJS) $(OBJASM) $(SOFLAGS) $(LDFLAGS)
x264$(EXE): $(OBJCLI) libx264.a
- $(CC) -o $@ $+ $(LDFLAGS)
+ $(CC) -o $@ $(subst libx264.a, -lx264, $+) $(LDFLAGS)
libx264gtk.a: muxers.o libx264.a
$(MAKE) -C gtk
checkasm: tools/checkasm.o libx264.a
- $(CC) -o $@ $+ $(LDFLAGS)
+ $(CC) -o $@ $(subst libx264.a, -lx264, $+) $(LDFLAGS)
%.o: %.asm
$(AS) $(ASFLAGS) -o $@ $<
diff --git a/configure b/configure
index 19d76d4..507e339 100755
--- a/configure
+++ b/configure
@@ -372,7 +372,11 @@ if test "$pthread" = "yes" ; then
LDFLAGS="$LDFLAGS $libpthread"
fi
-MP4_LDFLAGS="-lgpac_static"
+if [ $shared = yes ] ; then
+ MP4_LDFLAGS="-lgpac"
+else
+ MP4_LDFLAGS="-lgpac_static"
+fi
if [ $SYS = MINGW ]; then
MP4_LDFLAGS="$MP4_LDFLAGS -lwinmm"
fi
More information about the x264-devel
mailing list