patch-pppd_plugins_pppol2tp_Makefile_linux 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --- ppp-2.4.6.orig/pppd/plugins/pppol2tp/Makefile.linux 2014-01-02 05:42:08.000000000 +0100
  2. +++ ppp-2.4.6/pppd/plugins/pppol2tp/Makefile.linux 2014-06-06 08:18:13.000000000 +0200
  3. @@ -1,22 +1,20 @@
  4. -#CC = gcc
  5. -COPTS = -O2 -g
  6. -CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC
  7. -LDFLAGS = -shared
  8. -INSTALL = install
  9. -
  10. -#***********************************************************************
  11. -
  12. -DESTDIR = @DESTDIR@
  13. -LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
  14. -
  15. VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)
  16. +include ../../../Makedefs.com
  17. +CPPFLAGS += -I. -I../.. -I../../../include
  18. +ifeq (,$(filter -fPIC,$(CFLAGS)))
  19. +CFLAGS += -fPIC
  20. +endif
  21. +ifeq (,$(filter -shared,$(LDFLAGS)))
  22. +LDFLAGS += -shared
  23. +endif
  24. +
  25. PLUGINS := pppol2tp.so openl2tp.so
  26. all: $(PLUGINS)
  27. %.so: %.o
  28. - $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
  29. + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
  30. install: all
  31. $(INSTALL) -d -m 755 $(LIBDIR)
  32. @@ -24,6 +22,3 @@ install: all
  33. clean:
  34. rm -f *.o *.so
  35. -
  36. -%.o: %.c
  37. - $(CC) $(CFLAGS) -c -o $@ $<