]> git.ozlabs.org Git - ppp.git/commitdiff
pppdump: support building with the system zlib (#189)
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Thu, 31 Dec 2020 04:37:38 +0000 (05:37 +0100)
committerGitHub <noreply@github.com>
Thu, 31 Dec 2020 04:37:38 +0000 (15:37 +1100)
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Co-authored-by: Marco d'Itri <md@linux.it>
pppdump/Makefile.linux

index 0457561f1034add1ea19e60cc3f7f3d70ea04b0e..b61bc9dda31896508ccd217e2b5c3a09212cfd18 100644 (file)
@@ -2,15 +2,39 @@ DESTDIR = $(INSTROOT)@DESTDIR@
 BINDIR = $(DESTDIR)/sbin
 MANDIR = $(DESTDIR)/share/man/man8
 
+DO_DEFLATE=y
+DO_BSD_COMPRESS=y
+HAVE_ZLIB=n
+
 CFLAGS= -O -I../include/net
-OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
+OBJS = pppdump.o
+LIBS =
+
+ifdef DO_DEFLATE
+CFLAGS += -DDO_DEFLATE=1
+OBJS += deflate.o
+ifdef HAVE_ZLIB
+LIBS += -lz
+else
+OBJS += zlib.o
+endif
+else
+CFLAGS += -DDO_DEFLATE=0
+endif
+
+ifdef DO_BSD_COMPRESS
+CFLAGS += -DDO_BSD_COMPRESS=1
+OBJS += bsd-comp.o
+else
+CFLAGS += -DDO_BSD_COMPRESS=0
+endif
 
 INSTALL= install
 
 all:   pppdump
 
 pppdump: $(OBJS)
-       $(CC) $(LDFLAGS) -o pppdump $(OBJS)
+       $(CC) $(LDFLAGS) -o pppdump $(OBJS) $(LIBS)
 
 clean:
        rm -f pppdump $(OBJS) *~