1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
diff --git a/Makefile b/Makefile
index 61241cd..7481027 100644
--- a/Makefile
+++ b/Makefile
@@ -270,7 +270,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 ($(STATIC_LIBS),yes)
$(INSTALL) $(INSTFLAGS) -m 644 "./bin/gcc/libgpac_static.a" "$(DESTDIR)$(prefix)/$(libdir)"
+endif
if [ -d $(DESTDIR)$(prefix)/$(libdir)/pkgconfig ] ; then \
$(INSTALL) $(INSTFLAGS) -m 644 gpac.pc "$(DESTDIR)$(prefix)/$(libdir)/pkgconfig" ; \
fi
diff --git a/configure b/configure
index 6ef2258..240b6b0 100755
--- a/configure
+++ b/configure
@@ -108,6 +108,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"
@@ -266,6 +267,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
@@ -715,15 +717,6 @@ if docc -lz -Wno-pointer-sign ; then
CFLAGS="$CFLAGS -Wno-pointer-sign"
fi
-
-#GCC opt
-if test "$no_gcc_opt" = "no"; then
- CFLAGS="-O3 $CFLAGS"
-else
- CFLAGS="-O0 $CFLAGS"
-fi
-
-
#GCC PIC
if test "$cross_prefix" != "" ; then
want_pic="no"
@@ -1931,6 +1924,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"
@@ -2622,6 +2617,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 enabled: $static_libs"
echo "Memory tracking enabled: $use_memory_tracking"
echo "Sanitizer enabled: $enable_sanitizer"
echo "Fixed-Point Version: $use_fixed_point"
@@ -3291,6 +3287,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 935ffff..b3464b7 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -269,16 +269,19 @@ compositor: $(LIBGPAC_COMPOSITOR)
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) -o $@ $(OBJS) $(EXTRALIBS) $(LDFLAGS)
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) -o $@ $(OBJS) $(EXTRALIBS) $(LDFLAGS)
mv $@ $@.$(VERSION_SONAME)
|