patch-pppd_plugins_pppol2tp_Makefile_linux 1.2 KB

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