Compare commits

..

No commits in common. "8e7a943558925b11518c2a151ce9551d4dad2d83" and "c77b3e9f470f62d1a86647dc3fdf748462f4fd44" have entirely different histories.

2 changed files with 42 additions and 11 deletions

View File

@ -1,8 +1,13 @@
# weirdness from oarc packaging # weirdness from oarc packaging
linbpq: dir-or-file-in-opt [opt/oarc/] linbpq: dir-or-file-in-opt [opt/oarc/]
linbpq: dir-or-file-in-opt [opt/oarc/bpq/] linbpq: dir-or-file-in-opt [opt/oarc/bpq/]
# these are ok, just held within the program
linbpq: embedded-library libminiupnpc [usr/sbin/linbpq]
linbpq: embedded-library libpng [usr/sbin/linbpq]
# i know! # i know!
linbpq: no-manual-page [usr/sbin/linbpq] linbpq: no-manual-page [usr/sbin/linbpq]
# Build fails
linbpq: hardening-no-bindnow [usr/sbin/linbpq]
# Directory is populated on first run # Directory is populated on first run
linbpq: package-contains-empty-directory [opt/oarc/bpq/] linbpq: package-contains-empty-directory [opt/oarc/bpq/]
# Code convenience # Code convenience

View File

@ -1,39 +1,65 @@
--- a/makefile --- a/makefile
+++ b/makefile +++ b/makefile
@@ -18,9 +18,12 @@ @@ -2,7 +2,7 @@
# To exclude i2c support run make noi2c
-OBJS = pngwtran.o pngrtran.o pngset.o pngrio.o pngwio.o pngtrans.o pngrutil.o pngwutil.o\
+COMPLETE_SRC = pngwtran.o pngrtran.o pngset.o pngrio.o pngwio.o pngtrans.o pngrutil.o pngwutil.o\
pngread.o pngwrite.o png.o pngerror.o pngget.o pngmem.o APRSIconData.o AISCommon.o\
upnp.o APRSStdPages.o HSMODEM.o WinRPR.o KISSHF.o TNCEmulators.o bpqhdlc.o SerialPort.o\
adif.o WebMail.o utf8Routines.o VARA.o LzFind.o Alloc.o LzmaDec.o LzmaEnc.o LzmaLib.o \
@@ -18,26 +18,41 @@
# Configuration: # Configuration:
CC = gcc CC = gcc
- -
-all: CFLAGS = -DLINBPQ -MMD -g -fcommon -all: CFLAGS = -DLINBPQ -MMD -g -fcommon
-all: LDFLAGS = -l:libpaho-mqtt3a.a -l:libjansson.a -all: LDFLAGS = -l:libpaho-mqtt3a.a -l:libjansson.a
-all: linbpq
+LD = $(CC)
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) +CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
+CFLAGS+=$(shell dpkg-buildflags --get CPPFLAGS) +CFLAGS+=$(shell dpkg-buildflags --get CPPFLAGS)
+CFLAGS+=-DLINBPQ
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) +LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
+ +
+all: CFLAGS += -DLINBPQ -MMD -g -fcommon +$(warning CFLAGS are $(CFLAGS))
+all: LIBS = -lpaho-mqtt3a -ljansson -lminiupnpc -lrt -lm -lz -lpthread -lconfig -lpcap +
all: linbpq +LIBS = -lrt -lm -lz -lpthread -lconfig -lpcap -lpaho-mqtt3a -ljansson -lminiupnpc
@@ -32,12 +35,15 @@ -nomqtt: CFLAGS = -DLINBPQ -MMD -fcommon -g -DNOMQTT
+
+all: linbpq
+
+nomqtt: CFLAGS += -DNOMQTT
nomqtt: linbpq
-noi2c: CFLAGS = -DLINBPQ -MMD -DNOI2C -g -fcommon
+noi2c: CFLAGS += -DNOI2C
noi2c: linbpq
linbpq: $(OBJS) +COMPLETE_OBJS = $(COMPLETE_SRC:.c=o)
-linbpq: $(OBJS)
- gcc $(OBJS) -Xlinker -Map=output.map -l:libminiupnpc.a -lrt -lm -lz $(LDFLAGS) -lpthread -lconfig -lpcap -o linbpq - gcc $(OBJS) -Xlinker -Map=output.map -l:libminiupnpc.a -lrt -lm -lz $(LDFLAGS) -lpthread -lconfig -lpcap -o linbpq
- sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq - sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq
+ gcc $(OBJS) $(LDFLAGS) $(LIBS) -o linbpq +.c.o:
+ # sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq + $(CC) $(CFLAGS) $(LDFLAGS) -c $<
-include *.d --include *.d
-clean : -clean :
- rm *.d - rm *.d
- rm linbpq $(OBJS) - rm linbpq $(OBJS)
- +linbpq: $(COMPLETE_OBJS)
+ $(LD) $(LDFLAGS) -o linbpq $(COMPLETE_OBJS) $(LIBS)
+
+-include *.d
+install: +install:
+ install -b -m 755 -D -d debian/linbpq/usr/sbin + install -b -m 755 -D -d debian/linbpq/usr/sbin
+ install -b -m 755 -s -p linbpq debian/linbpq/usr/sbin + install -b -m 755 -p linbpq debian/linbpq/usr/sbin
+ +
+clean: +clean:
+ $(RM) *.d + $(RM) *.d