- Add libpidutil as submodule for easier building
- Fix build on FreeBSD
This commit is contained in:
parent
9621e864b2
commit
2ca3df1338
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[submodule "libpidutil"]
|
||||||
|
path = libpidutil
|
||||||
|
url = https://github.com/farrokhi/libpidutil.git
|
21
Makefile
21
Makefile
@ -1,20 +1,27 @@
|
|||||||
PREFIX?=/usr/local
|
|
||||||
INC=-I$(PREFIX)/include
|
|
||||||
LIB=-L$(PREFIX)/lib -lpidutil -lpthread
|
|
||||||
CFLAGS=-Wall -Wextra -g -O2 -pipe -funroll-loops -ffast-math -fno-strict-aliasing
|
|
||||||
CC?=cc
|
CC?=cc
|
||||||
|
PREFIX?=/usr/local
|
||||||
|
INC=-I./libpidutil -I$(PREFIX)/include
|
||||||
|
LDFLAGS=-L./libpidutil -L$(PREFIX)/lib -lpidutil -lpthread
|
||||||
|
CFLAGS=-Wall -Wextra -g -O2 -static -pipe -funroll-loops -ffast-math -fno-strict-aliasing
|
||||||
|
|
||||||
|
SUBDIRS = libpidutil
|
||||||
PROGS = fsipd logfile_test
|
PROGS = fsipd logfile_test
|
||||||
CFILES = fsipd.c logfile.c
|
CFILES = fsipd.c logfile.c
|
||||||
|
|
||||||
all: fsipd
|
all: $(SUBDIRS) fsipd
|
||||||
|
|
||||||
fsipd: $(CFILES)
|
fsipd: $(CFILES)
|
||||||
$(CC) $(CFLAGS) $(INC) $(LIB) $(CFILES) -o fsipd
|
$(CC) $(CFLAGS) $(INC) $(CFILES) $(LDFLAGS) -o fsipd
|
||||||
|
|
||||||
|
.PHONY: $(SUBDIRS)
|
||||||
|
|
||||||
|
$(SUBDIRS):
|
||||||
|
$(MAKE) -C $@ all
|
||||||
|
|
||||||
test: logfile.c logfile_test.c
|
test: logfile.c logfile_test.c
|
||||||
$(CC) $(CFLAGS) $(INC) $(LIB) logfile.c logfile_test.c -o logfile_test
|
$(CC) $(CFLAGS) $(INC) $(LDFLAGS) logfile.c logfile_test.c -o logfile_test
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.BAK *.log *.o *.a a.out core temp.* $(PROGS)
|
rm -f *.BAK *.log *.o *.a a.out core temp.* $(PROGS)
|
||||||
rm -fr *.dSYM
|
rm -fr *.dSYM
|
||||||
|
$(MAKE) -C libpidutil clean
|
||||||
|
4
fsipd.c
4
fsipd.c
@ -182,7 +182,7 @@ process_request(int af, struct sockaddr *restrict src, int proto, char *str)
|
|||||||
/*
|
/*
|
||||||
* setup TCP listener socket
|
* setup TCP listener socket
|
||||||
*/
|
*/
|
||||||
inline int
|
int
|
||||||
init_tcp()
|
init_tcp()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ init_tcp()
|
|||||||
/*
|
/*
|
||||||
* setup UDP listener socket
|
* setup UDP listener socket
|
||||||
*/
|
*/
|
||||||
inline int
|
int
|
||||||
init_udp()
|
init_udp()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
1
libpidutil
Submodule
1
libpidutil
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit c7002193bce3904a5286cebca399fd9f35de0da7
|
Loading…
x
Reference in New Issue
Block a user