kopia lustrzana https://github.com/weetmuts/wmbusmeters
Add FreeBSD support for the latest release.
rodzic
ff8fb1b947
commit
ca8803e033
15
Makefile
15
Makefile
|
@ -97,9 +97,16 @@ $(info Building $(VERSION))
|
|||
|
||||
CXXFLAGS ?= $(DEBUG_FLAGS) -fPIC -std=c++11 -Wall -Werror=format-security
|
||||
CXXFLAGS += -I$(BUILD)
|
||||
|
||||
LDFLAGS ?= $(DEBUG_LDFLAGS)
|
||||
|
||||
USBLIB = -lusb-1.0
|
||||
|
||||
ifeq ($(shell uname -s),FreeBSD)
|
||||
CXXFLAGS += -I/usr/local/include
|
||||
LDFLAGS += -L/usr/local/lib
|
||||
USBLIB = -lusb
|
||||
endif
|
||||
|
||||
$(BUILD)/%.o: src/%.cc $(wildcard src/%.h)
|
||||
$(CXX) $(CXXFLAGS) $< -c -E > $@.src
|
||||
$(CXX) $(CXXFLAGS) $< -MMD -c -o $@
|
||||
|
@ -208,10 +215,10 @@ snapcraft:
|
|||
$(BUILD)/main.o: $(BUILD)/short_manual.h $(BUILD)/version.h
|
||||
|
||||
$(BUILD)/wmbusmeters: $(METER_OBJS) $(BUILD)/main.o $(BUILD)/short_manual.h
|
||||
$(CXX) -o $(BUILD)/wmbusmeters $(METER_OBJS) $(BUILD)/main.o $(LDFLAGS) -lrtlsdr -lusb-1.0 -lpthread
|
||||
$(CXX) -o $(BUILD)/wmbusmeters $(METER_OBJS) $(BUILD)/main.o $(LDFLAGS) -lrtlsdr $(USBLIB) -lpthread
|
||||
|
||||
$(BUILD)/wmbusmeters-admin: $(METER_OBJS) $(BUILD)/admin.o $(BUILD)/ui.o $(BUILD)/short_manual.h
|
||||
$(CXX) -o $(BUILD)/wmbusmeters-admin $(METER_OBJS) $(BUILD)/admin.o $(BUILD)/ui.o $(LDFLAGS) -lmenu -lform -lncurses -lrtlsdr -lusb-1.0 -lpthread
|
||||
$(CXX) -o $(BUILD)/wmbusmeters-admin $(METER_OBJS) $(BUILD)/admin.o $(BUILD)/ui.o $(LDFLAGS) -lmenu -lform -lncurses -lrtlsdr $(USBLIB) -lpthread
|
||||
|
||||
$(BUILD)/short_manual.h: README.md
|
||||
echo 'R"MANUAL(' > $(BUILD)/short_manual.h
|
||||
|
@ -221,7 +228,7 @@ $(BUILD)/short_manual.h: README.md
|
|||
echo ')MANUAL";' >> $(BUILD)/short_manual.h
|
||||
|
||||
$(BUILD)/testinternals: $(METER_OBJS) $(BUILD)/testinternals.o
|
||||
$(CXX) -o $(BUILD)/testinternals $(METER_OBJS) $(BUILD)/testinternals.o $(LDFLAGS) -lrtlsdr -lusb-1.0 -lpthread
|
||||
$(CXX) -o $(BUILD)/testinternals $(METER_OBJS) $(BUILD)/testinternals.o $(LDFLAGS) -lrtlsdr $(USBLIB) -lpthread
|
||||
|
||||
$(BUILD)/fuzz: $(METER_OBJS) $(BUILD)/fuzz.o
|
||||
$(CXX) -o $(BUILD)/fuzz $(METER_OBJS) $(BUILD)/fuzz.o $(LDFLAGS) -lrtlsdr -lpthread
|
||||
|
|
|
@ -1915,6 +1915,14 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex
|
|||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
|
||||
case $host_os in
|
||||
freebsd*)
|
||||
CFLAGS="$CFLAGS -I/usr/local/include"
|
||||
CXXFLAGS="$CXXFLAGS -I/usr/local/include"
|
||||
LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
||||
;;
|
||||
esac
|
||||
|
||||
#C_CHECK_LIB(usb, usb_init, [],
|
||||
#
|
||||
# C_MSG_ERROR([Could not find libusb library. Try: sudo apt install libusb-dev])
|
||||
|
|
|
@ -31,6 +31,14 @@ mkdir -p "$OUTPUT_ROOT"
|
|||
|
||||
AC_LANG_PUSH([C++])
|
||||
|
||||
case $host_os in
|
||||
freebsd*)
|
||||
CFLAGS="$CFLAGS -I/usr/local/include"
|
||||
CXXFLAGS="$CXXFLAGS -I/usr/local/include"
|
||||
LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
||||
;;
|
||||
esac
|
||||
|
||||
#C_CHECK_LIB(usb, usb_init, [],
|
||||
#
|
||||
# C_MSG_ERROR([Could not find libusb library. Try: sudo apt install libusb-dev])
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include<stdio.h>
|
||||
#include<stdlib.h>
|
||||
#include<syslog.h>
|
||||
#include<time.h>
|
||||
|
||||
#include"serial.h"
|
||||
#include"shell.h"
|
||||
|
|
|
@ -1207,7 +1207,7 @@ bool SerialCommunicationManagerImp::removeNonWorking(string device)
|
|||
}
|
||||
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__)
|
||||
vector<string> SerialCommunicationManagerImp::listSerialTTYs()
|
||||
{
|
||||
vector<string> list;
|
||||
|
@ -1447,8 +1447,12 @@ string oflags(tcflag_t bits)
|
|||
{
|
||||
string flags;
|
||||
|
||||
#ifdef BS1
|
||||
CHECK_FLAG(BS1)
|
||||
#endif
|
||||
#ifdef NL1
|
||||
CHECK_FLAG(NL1)
|
||||
#endif
|
||||
CHECK_FLAG(ONLCR)
|
||||
#ifdef ONOEOT
|
||||
CHECK_FLAG(ONOEOT)
|
||||
|
|
|
@ -1376,7 +1376,7 @@ bool extract_single_period(char *tok, TimePeriod *tp)
|
|||
if (tok[len-1] != ')') return false; // Must end in )
|
||||
bool ok = extract_times(p, tp);
|
||||
if (!ok) return false;
|
||||
*p = (char)NULL; // Terminate in the middle of tok.
|
||||
*p = 0; // Terminate in the middle of tok.
|
||||
ok = extract_days(tok, tp);
|
||||
if (!ok) return false;
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue