pkgsrc/net/rp-l2tp/patches/patch-ab
rtr 02f2cc5faf - add/update patches to introduce LDFLAGS to links in the package
identified by Charles Zmudzinski in pr pkg/32275
- use EXPORT_SYMBOLS_LDFLAGS as suggested by salo@
- resolves pkg/32275
2008-03-11 09:16:38 +00:00

47 lines
1.7 KiB
Text

$NetBSD: patch-ab,v 1.3 2008/03/11 09:16:38 rtr Exp $
--- Makefile.in.orig 2002-10-01 06:33:55.000000000 +1000
+++ Makefile.in
@@ -26,11 +26,20 @@ install=@INSTALL@
install_dir=@INSTALL@ -d
sbindir=@sbindir@
+OPSYS= $(shell uname -s)
+
OBJS=auth.o debug.o dgram.o main.o md5.o network.o options.o peer.o session.o tunnel.o utils.o
-EXTRA_LIBS=@LIBEVENT@/*.o -ldl
+
+ifeq (${OPSYS}, Linux)
+EXTRA_LIBS=-ldl
+DYNAMIC_FLAGS= -rdynamic
+endif
+
+ifeq (${OPSYS}, NetBSD)
+endif
SRCS=$(OBJS:.o=.c)
-CFLAGS=-g -I.. -I@LIBEVENT@ -Wall -Wstrict-prototypes -ansi -pedantic -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" -DPREFIX=\"$(prefix)\"
+CFLAGS=-g -I.. -I@LIBEVENT@ -Wall -Wstrict-prototypes -ansi -pedantic -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" -DPREFIX=\"$(prefix)\" -DSYSCONFDIR=\""@sysconfdir@"\"
TARGETS=l2tpd libl2tp.a handlers
@@ -43,7 +52,7 @@ libl2tp.a: $(OBJS)
l2tpd: libl2tp.a libevent/libevent.a
$(MAKE) -C handlers
- @CC@ -o l2tpd -rdynamic $(OBJS) $(EXTRA_LIBS)
+ @CC@ $(LDFLAGS) -o l2tpd $(DYNAMIC_FLAGS) $(OBJS) @LIBEVENT@/*.o $(EXTRA_LIBS)
libevent/libevent.a:
test -d libevent || ln -s ../libevent .
@@ -82,8 +91,8 @@ distclean: clean
install: all
-mkdir -p $(RPM_INSTALL_ROOT)$(sbindir)
$(install) -m 755 -s l2tpd $(RPM_INSTALL_ROOT)$(sbindir)
- -mkdir -p $(RPM_INSTALL_ROOT)/etc/l2tp
- $(install) -m 644 l2tp.conf $(RPM_INSTALL_ROOT)/etc/l2tp/l2tp.conf.example
+ -mkdir -p $(RPM_INSTALL_ROOT)${PREFIX}/share/examples
+ $(install) -m 644 l2tp.conf $(RPM_INSTALL_ROOT)${PREFIX}/share/examples/l2tp.conf
-mkdir -p $(RPM_INSTALL_ROOT)$(mandir)/man8
-mkdir -p $(RPM_INSTALL_ROOT)$(mandir)/man5
$(install) -m 644 man/l2tpd.8 $(RPM_INSTALL_ROOT)$(mandir)/man8