diff --git a/Makefile b/Makefile index 62b7850..ff4b589 100644 --- a/Makefile +++ b/Makefile @@ -219,7 +219,9 @@ ifeq ($(GPAC_ENST), yes) $(INSTALL) $(INSTFLAGS) -m 644 $(SRC_PATH)/include/gpac/enst/*.h "$(DESTDIR)$(prefix)/include/gpac/enst" endif mkdir -p "$(DESTDIR)$(prefix)/$(libdir)" +ifeq ($(STATICLIBS),yes) $(INSTALL) $(INSTFLAGS) -m 644 "./bin/gcc/libgpac_static.a" "$(DESTDIR)$(prefix)/$(libdir)" +endif $(MAKE) installdylib uninstall-lib: diff --git a/configure b/configure index df00dff..561bcd3 100755 --- a/configure +++ b/configure @@ -101,6 +101,7 @@ has_xmlrpc="no" has_openjpeg="no" gprof_build="no" static_build="no" +static_libs="no" want_pic="no" want_gcov="no" has_joystick="no" @@ -252,6 +253,7 @@ GPAC configuration options: --enable-amr-wb enable AMR WB library --enable-amr enable both AMR NB and WB libraries --enable-static-bin link statically against libgpac + --enable-static-lib GPAC static libraries build --static-mp4box configure for static linking of MP4Box only. --enable-depth enables depth handling in the compositor @@ -1849,6 +1851,8 @@ for opt do ;; --enable-static-bin) static_build="yes"; ;; + --enable-static-lib) static_libs="yes"; + ;; --disable-ipv6) has_ipv6="no" ;; --disable-wx) has_wx="no" @@ -2525,6 +2529,7 @@ echo "** GPAC $version rev$revision Core Configuration **" echo "debug version: $debuginfo" echo "GProf enabled: $gprof_build" echo "Static build enabled: $static_build" +echo "Static libs build enabled: $static_libs" echo "Memory tracking enabled: $use_memory_tracking" echo "Fixed-Point Version: $use_fixed_point" echo "IPV6 Support: $has_ipv6" @@ -3133,6 +3138,7 @@ echo "DEBUGBUILD=$debuginfo" >> config.mak echo "GPROFBUILD=$gprof_build" >> config.mak echo "MP4BOX_STATIC=$static_mp4box" >> config.mak echo "STATICBUILD=$static_build" >> config.mak +echo "STATICLIBS=$static_libs" >> config.mak echo "CONFIG_IPV6=$has_ipv6" >> config.mak if test "$has_ipv6" = "yes" ; then diff --git a/src/Makefile b/src/Makefile index ba9d9ab..89ea67f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -610,17 +610,20 @@ compositor: $(LIBGPAC_COMPOSITOR) @echo "LIBS $(EXTRALIBS)" ifeq ($(CONFIG_DARWIN),yes) - +ifeq ($(STATICLIBS),yes) $(LIBTOOL) -s -o ../bin/gcc/libgpac_static.a $(OBJS) $(RANLIB) ../bin/gcc/libgpac_static.a +endif ifneq ($(STATICBUILD),yes) $(CC) $(SHFLAGS) $(LD_SONAME) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) endif else +ifeq ($(STATICLIBS),yes) $(AR) cr ../bin/gcc/libgpac_static.a $(OBJS) $(RANLIB) ../bin/gcc/libgpac_static.a +endif ifneq ($(STATICBUILD),yes) $(CC) $(SHFLAGS) $(LD_SONAME) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) mv $@ $@.$(VERSION_SONAME)