patch-pppd_Makefile_linux 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. --- ppp-2.4.5.orig/pppd/Makefile.linux 2009-11-16 23:26:07.000000000 +0100
  2. +++ ppp-2.4.5/pppd/Makefile.linux 2011-01-21 21:40:47.384898388 +0100
  3. @@ -3,11 +3,7 @@
  4. # $Id: Makefile.linux,v 1.70 2007/06/19 02:08:34 carlsonj Exp $
  5. #
  6. -# Default installation locations
  7. -DESTDIR = $(INSTROOT)@DESTDIR@
  8. -BINDIR = $(DESTDIR)/sbin
  9. -MANDIR = $(DESTDIR)/share/man/man8
  10. -INCDIR = $(DESTDIR)/include
  11. +include ../Makedefs.com
  12. TARGETS = pppd
  13. @@ -24,17 +20,6 @@ PPPDOBJS = main.o magic.o fsm.o lcp.o ip
  14. ecp.o auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o \
  15. eap.o chap-md5.o session.o
  16. -#
  17. -# include dependencies if present
  18. -ifeq (.depend,$(wildcard .depend))
  19. -include .depend
  20. -endif
  21. -
  22. -# CC = gcc
  23. -#
  24. -COPTS = -O2 -pipe -Wall -g
  25. -LIBS =
  26. -
  27. # Uncomment the next 2 lines to include support for Microsoft's
  28. # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
  29. CHAPMS=y
  30. @@ -75,28 +60,25 @@ PLUGIN=y
  31. MAXOCTETS=y
  32. -INCLUDE_DIRS= -I../include
  33. -
  34. -COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
  35. -
  36. -CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
  37. +CPPFLAGS += -I../include
  38. +CPPFLAGS += -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP '-DDESTDIR="@DESTDIR@"'
  39. ifdef CHAPMS
  40. -CFLAGS += -DCHAPMS=1
  41. +CPPFLAGS += -DCHAPMS=1
  42. NEEDDES=y
  43. PPPDOBJS += md4.o chap_ms.o
  44. HEADERS += md4.h chap_ms.h
  45. ifdef MSLANMAN
  46. -CFLAGS += -DMSLANMAN=1
  47. +CPPFLAGS += -DMSLANMAN=1
  48. endif
  49. ifdef MPPE
  50. -CFLAGS += -DMPPE=1
  51. +CPPFLAGS += -DMPPE=1
  52. endif
  53. endif
  54. # EAP SRP-SHA1
  55. ifdef USE_SRP
  56. -CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
  57. +CPPFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
  58. LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
  59. TARGETS += srp-entry
  60. EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
  61. @@ -113,12 +95,12 @@ PPPDOBJS += sha1.o
  62. endif
  63. ifdef HAS_SHADOW
  64. -CFLAGS += -DHAS_SHADOW
  65. +CPPFLAGS += -DHAS_SHADOW
  66. #LIBS += -lshadow $(LIBS)
  67. endif
  68. ifneq ($(wildcard /usr/include/crypt.h),)
  69. -CFLAGS += -DHAVE_CRYPT_H=1
  70. +CPPFLAGS += -DHAVE_CRYPT_H=1
  71. LIBS += -lcrypt
  72. endif
  73. @@ -126,7 +108,7 @@ ifdef NEEDDES
  74. ifndef USE_CRYPT
  75. LIBS += -ldes $(LIBS)
  76. else
  77. -CFLAGS += -DUSE_CRYPT=1
  78. +CPPFLAGS += -DUSE_CRYPT=1
  79. endif
  80. PPPDOBJS += pppcrypt.o
  81. HEADERS += pppcrypt.h
  82. @@ -134,36 +116,36 @@ endif
  83. # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
  84. ifdef USE_PAM
  85. -CFLAGS += -DUSE_PAM
  86. +CPPFLAGS += -DUSE_PAM
  87. LIBS += -lpam -ldl
  88. endif
  89. # Multi-linnk
  90. ifdef HAVE_MULTILINK
  91. - # Multilink implies the use of TDB
  92. - USE_TDB=y
  93. +# Multilink implies the use of TDB
  94. +USE_TDB=y
  95. - CFLAGS += -DHAVE_MULTILINK
  96. - PPPDSRCS += multilink.c
  97. - PPPDOBJS += multilink.o
  98. +CPPFLAGS += -DHAVE_MULTILINK
  99. +PPPDSRCS += multilink.c
  100. +PPPDOBJS += multilink.o
  101. endif
  102. # TDB
  103. ifdef USE_TDB
  104. - CFLAGS += -DUSE_TDB=1
  105. - PPPDSRCS += tdb.c spinlock.c
  106. - PPPDOBJS += tdb.o spinlock.o
  107. - HEADERS += tdb.h spinlock.h
  108. +CPPFLAGS += -DUSE_TDB=1
  109. +PPPDSRCS += tdb.c spinlock.c
  110. +PPPDOBJS += tdb.o spinlock.o
  111. +HEADERS += tdb.h spinlock.h
  112. endif
  113. # Lock library binary for Linux is included in 'linux' subdirectory.
  114. ifdef LOCKLIB
  115. LIBS += -llock
  116. -CFLAGS += -DLOCKLIB=1
  117. +CPPFLAGS += -DLOCKLIB=1
  118. endif
  119. ifdef PLUGIN
  120. -CFLAGS += -DPLUGIN
  121. +CPPFLAGS += -DPLUGIN
  122. LDFLAGS += -Wl,-E
  123. LIBS += -ldl
  124. endif
  125. @@ -171,52 +153,51 @@ endif
  126. ifdef FILTER
  127. ifneq ($(wildcard /usr/include/pcap-bpf.h),)
  128. LIBS += -lpcap
  129. -CFLAGS += -DPPP_FILTER
  130. +CPPFLAGS += -DPPP_FILTER
  131. endif
  132. endif
  133. ifdef HAVE_INET6
  134. - PPPDSRCS += ipv6cp.c eui64.c
  135. - HEADERS += ipv6cp.h eui64.h
  136. - PPPDOBJS += ipv6cp.o eui64.o
  137. - CFLAGS += -DINET6=1
  138. +PPPDSRCS += ipv6cp.c eui64.c
  139. +HEADERS += ipv6cp.h eui64.h
  140. +PPPDOBJS += ipv6cp.o eui64.o
  141. +CPPFLAGS += -DINET6=1
  142. endif
  143. ifdef CBCP
  144. - PPPDSRCS += cbcp.c
  145. - PPPDOBJS += cbcp.o
  146. - CFLAGS += -DCBCP_SUPPORT
  147. - HEADERS += cbcp.h
  148. +PPPDSRCS += cbcp.c
  149. +PPPDOBJS += cbcp.o
  150. +CPPFLAGS += -DCBCP_SUPPORT
  151. +HEADERS += cbcp.h
  152. endif
  153. ifdef MAXOCTETS
  154. - CFLAGS += -DMAXOCTETS
  155. +CPPFLAGS += -DMAXOCTETS
  156. endif
  157. -INSTALL= install
  158. -
  159. all: $(TARGETS)
  160. +# generate dependencies
  161. +#include $(PPPDSRCS:.c=.d)
  162. +
  163. install: pppd
  164. - mkdir -p $(BINDIR) $(MANDIR)
  165. + $(INSTALL) -d -m 755 $(BINDIR)
  166. + $(INSTALL) -d -m 755 $(MANDIR)
  167. $(EXTRAINSTALL)
  168. - $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
  169. + $(INSTALL) $(STRIP) -c -m 555 pppd $(BINDIR)/pppd
  170. if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
  171. chmod o-rx,u+s $(BINDIR)/pppd; fi
  172. $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
  173. pppd: $(PPPDOBJS)
  174. - $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
  175. + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
  176. -srp-entry: srp-entry.c
  177. - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
  178. +srp-entry: srp-entry.o
  179. + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
  180. install-devel:
  181. - mkdir -p $(INCDIR)/pppd
  182. + $(INSTALL) -d -m 755 $(INCDIR)/pppd
  183. $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
  184. clean:
  185. - rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core
  186. -
  187. -depend:
  188. - $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend
  189. + rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *.d *~ #* core