freebsd-ports/net/libsrtp/files/patch-Makefile.in
Mikhail Teterin 7e60106927 Only use -fPIC, when compiling shared objects, not static ones.
Implement regression-check target (also known under other aliases)
using upstream's self-tests.
2015-04-14 22:24:44 +00:00

44 lines
1.2 KiB
Text

--- Makefile.in 2015-03-11 14:02:12 UTC
+++ Makefile.in 2015-04-14 17:56:33 -0400
@@ -44,7 +44,7 @@
CC = @CC@
INCDIR = -Icrypto/include -I$(srcdir)/include -I$(srcdir)/crypto/include
DEFS = @DEFS@
-CPPFLAGS= -fPIC @CPPFLAGS@
+CPPFLAGS= @CPPFLAGS@
CFLAGS = @CFLAGS@
LIBS = @LIBS@
LDFLAGS = -L. @LDFLAGS@
@@ -84,12 +84,11 @@
endif
SHAREDLIBVERSION = 1
-ifeq (linux,$(findstring linux,@host@))
SHAREDLIB_DIR = $(libdir)
SHAREDLIB_LDFLAGS = -shared -Wl,-soname,$@
SHAREDLIBSUFFIXNOVER = so
SHAREDLIBSUFFIX = $(SHAREDLIBSUFFIXNOVER).$(SHAREDLIBVERSION)
-else ifeq (mingw,$(findstring mingw,@host@))
+ifeq (mingw,$(findstring mingw,@host@))
SHAREDLIB_DIR = $(bindir)
SHAREDLIB_LDFLAGS = -shared -Wl,--out-implib,libsrtp.dll.a
SHAREDLIBVERSION =
@@ -108,6 +107,9 @@
%.o: %.c
$(COMPILE) -c $< -o $@
+%.So: %.c
+ $(COMPILE) -DPIC -fPIC -c $< -o $@
+
%$(EXE): %.c
$(COMPILE) $(LDFLAGS) $< -o $@ $(SRTPLIB) $(LIBS)
@@ -143,7 +145,7 @@
ar cr libsrtp.a $^
$(RANLIB) libsrtp.a
-libsrtp.$(SHAREDLIBSUFFIX): $(srtpobj) $(cryptobj) $(gdoi)
+libsrtp.$(SHAREDLIBSUFFIX): $(srtpobj:.o=.So) $(cryptobj:.o=.So) $(gdoi:.o=.So)
$(CC) -shared -o $@ $(SHAREDLIB_LDFLAGS) \
$^ $(LDFLAGS) $(LIBS)
if [ -n "$(SHAREDLIBVERSION)" ]; then \