patch-pppd_plugins_pppoatm_Makefile_linux 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --- ppp-2.4.5.orig/pppd/plugins/pppoatm/Makefile.linux 2009-11-16 23:26:07.000000000 +0100
  2. +++ ppp-2.4.5/pppd/plugins/pppoatm/Makefile.linux 2013-03-04 12:31:16.000000000 +0100
  3. @@ -1,15 +1,16 @@
  4. -#CC = gcc
  5. -COPTS = -O2 -g
  6. -CFLAGS = $(COPTS) -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 = $(INSTROOT)@DESTDIR@
  13. -LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
  14. +CPPFLAGS += -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. PLUGIN := pppoatm.so
  24. PLUGIN_OBJS := pppoatm.o
  25. @@ -22,25 +23,22 @@ PLUGIN_OBJS := pppoatm.o
  26. #HAVE_LIBATM=yes
  27. ifdef HAVE_LIBATM
  28. -LIBS := -latm
  29. +LIBS += -latm
  30. else
  31. -CFLAGS += -I.
  32. +CPPFLAGS += -I.
  33. PLUGIN_OBJS += text2qos.o text2atm.o misc.o ans.o
  34. -LIBS := -lresolv
  35. +LIBS += -lresolv
  36. endif
  37. #*********
  38. all: $(PLUGIN)
  39. $(PLUGIN): $(PLUGIN_OBJS)
  40. - $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
  41. + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
  42. -install: all
  43. +install: $(PLUGIN)
  44. $(INSTALL) -d -m 755 $(LIBDIR)
  45. - $(INSTALL) -c -m 4550 $(PLUGIN) $(LIBDIR)
  46. + $(INSTALL) $(STRIP) -c -m 4550 $(PLUGIN) $(LIBDIR)
  47. clean:
  48. rm -f *.o *.so
  49. -
  50. -%.o: %.c
  51. - $(CC) $(CFLAGS) -c -o $@ $<