packages/openl2tp: enable config file support (thanks to Bogdan Roman), provide ...
[openwrt/svn-archive/archive.git] / net / openl2tp / patches / 001-makefile.patch
1 --- a/Makefile
2 +++ b/Makefile
3 @@ -158,7 +158,7 @@ CFLAGS= -I. -Iusl -Icli -isystem inclu
4 $(CPPFLAGS) $(CPPFLAGS.dmalloc) \
5 -DSYS_LIBDIR=$(SYS_LIBDIR)
6 LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc
7 -LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc
8 +LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline -lncurses $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc
9
10 OPT_CFLAGS?= -O
11
12 @@ -185,11 +185,11 @@ RPCGENFLAGS= -N -M -C -L
13
14 .PHONY: all clean distclean install daemon app test
15
16 -all: generated-files daemon $(APP)
17 +all: daemon $(APP)
18
19 -daemon: generated-files $(SUBDIRS:%=subdir-%) openl2tpd
20 +daemon: $(SUBDIRS:%=subdir-%) openl2tpd
21
22 -app: generated-files l2tpconfig
23 +app: l2tpconfig
24
25 test: subdir-test
26 $(MAKE) -C $@ $(MFLAGS) $@
27 @@ -197,7 +197,7 @@ test: subdir-test
28
29 .PHONY: $(SUBDIRS:%=subdir-%)
30
31 -$(SUBDIRS:%=subdir-%): FORCE
32 +$(SUBDIRS:%=subdir-%): FORCE generated-files
33 $(MAKE) -C $(@:subdir-%=%) $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)"
34
35 ifeq ($(L2TP_FEATURE_LOCAL_CONF_FILE),y)
36 @@ -212,10 +212,10 @@ LDFLAGS.l2tpd+= -lfl
37 $(YACC) -d -o l2tp_config_parse.c $<
38
39 l2tp_config_token.o: l2tp_config_token.c
40 - $(CC) -I. -MMD -w $(CFLAGS.optimize) -c -DYY_NO_UNPUT $<
41 + $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) -DYY_NO_UNPUT $<
42
43 l2tp_config_parse.o: l2tp_config_parse.c l2tp_config_parse.h
44 - $(CC) -I. -MMD -w $(CFLAGS.optimize) -c -DYY_NO_UNPUT $<
45 + $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) -DYY_NO_UNPUT $<
46 endif
47
48 # Compile without -Wall because rpcgen-generated code is full of warnings.
49 @@ -265,9 +265,13 @@ TAGS:
50 @for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) $@; done
51 etags $(wildcard *.c) $(wildcard *.h)
52
53 +$(L2TPD_SRCS.o): generated-files
54 +
55 openl2tpd: $(L2TPD_SRCS.o)
56 $(CC) -o $@ $^ $(LDFLAGS.l2tpd)
57
58 +$(L2TPCONFIG_SRCS.o): generated-files
59 +
60 l2tpconfig: $(L2TPCONFIG_SRCS.o)
61 $(CC) -o $@ $^ $(LDFLAGS.l2tpconfig)
62
63 @@ -317,6 +321,7 @@ endif
64 else \
65 mv $@.tmp $@ ;\
66 fi
67 + @echo '$@ generated.'
68
69 .PHONY: all install-all install-daemon install-app
70