]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/radius/Makefile.linux
plugins/radius: Handle bindaddr keyword in radiusclient.conf
[ppp.git] / pppd / plugins / radius / Makefile.linux
index 1fa7ff9730e1c95787030f41301110faaee64d97..24ed3e580c4db6aeca129dd22dbe6de5f2d1ff5f 100644 (file)
@@ -3,47 +3,63 @@
 # Copyright 2002 Roaring Penguin Software Inc.
 #
 
-MANDIR=/usr/man
-PLUGIN=radius.so radattr.so
-CFLAGS=-I../.. -Iradiusclient/include -O2
+DESTDIR = $(INSTROOT)@DESTDIR@
+MANDIR = $(DESTDIR)/share/man/man8
+LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
+
+VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)
+
+INSTALL        = install
+
+PLUGIN=radius.so radattr.so radrealms.so
+CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
+
+# Uncomment the next line to include support for Microsoft's
+# MS-CHAP authentication protocol.
+CHAPMS=y
+# Uncomment the next line to include support for MPPE.
+MPPE=y
+# Uncomment the next lint to include support for traffic limiting
+MAXOCTETS=y
+
+ifdef CHAPMS
+CFLAGS += -DCHAPMS=1
+ifdef MPPE
+CFLAGS += -DMPPE=1
+endif
+endif
+ifdef MAXOCTETS
+CFLAGS += -DMAXOCTETS=1
+endif
 
 all: $(PLUGIN)
 
 install: all
-       $(MAKE) $(MFLAGS) -C radiusclient install
        $(INSTALL) -d -m 755 $(LIBDIR)
        $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
        $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
-       $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)/man8
-       $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)/man8
+       $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
+       $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
+       $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
 
-radius.so: radiusclient/lib/.libs/libradiusclient.a radius.o
-       gcc -o radius.so -shared radius.o radiusclient/lib/.libs/libradiusclient.a
+radius.so: radius.o libradiusclient.a
+       $(CC) -o radius.so -shared radius.o libradiusclient.a
 
 radattr.so: radattr.o
-       gcc -o radattr.so -shared radattr.o
-
-radius.o: radius.c
-       gcc $(CFLAGS) -c -o radius.o -fPIC radius.c
+       $(CC) -o radattr.so -shared radattr.o
 
-radattr.o: radattr.c
-       gcc $(CFLAGS) -c -o radattr.o -fPIC radattr.c
+radrealms.so: radrealms.o
+       $(CC) -o radrealms.so -shared radrealms.o
 
-radiusclient/lib/.libs/libradiusclient.a:
-       test -r radiusclient/Makefile ||           \
-               (cd radiusclient;                  \
-                ./configure --prefix=/usr         \
-                            --sysconfdir=/etc     \
-                            --enable-shared       \
-                            --enable-static)
-       $(MAKE) -C radiusclient
+CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
+       clientid.o sendserver.o lock.o util.o md5.o
+libradiusclient.a: $(CLIENTOBJS)
+       $(AR) rv $@ $?
 
 clean:
-       $(MAKE) $(MFLAGS) -C radiusclient clean
-       rm -f *.o *.so
+       rm -f *.o *.so *.a
 
 distclean:
-       rm -f *.o *.so
-       $(MAKE) $(MFLAGS) -C radiusclient distclean
+       rm -f *.o *.so *.a
 
 dist-clean: distclean