Module: kamailio
Branch: master
Commit: 32e1e5040d2ff5e13d5bd0373e7edd6cef56f172
URL:
https://github.com/kamailio/kamailio/commit/32e1e5040d2ff5e13d5bd0373e7edd6…
Author: Rick Barenthin <rb(a)terralink.de>
Committer: Rick Barenthin <rb(a)terralink.de>
Date: 2017-03-14T22:35:52+01:00
utils/pdbt: FreeBSD fix, gcc is hardcoded, header is missing
- use CC environment variable if set
- added missing sys/stat.h header
---
Modified: utils/pdbt/Makefile
Modified: utils/pdbt/pdbt.c
---
Diff:
https://github.com/kamailio/kamailio/commit/32e1e5040d2ff5e13d5bd0373e7edd6…
Patch:
https://github.com/kamailio/kamailio/commit/32e1e5040d2ff5e13d5bd0373e7edd6…
---
diff --git a/utils/pdbt/Makefile b/utils/pdbt/Makefile
index b16d3cb..e354f6c 100644
--- a/utils/pdbt/Makefile
+++ b/utils/pdbt/Makefile
@@ -1,3 +1,11 @@
+#set some vars from the environment (and not make builtins)
+CC := $(shell echo "$${CC}")
+
+# find compiler name & version
+ifeq ($(CC),)
+ CC=gcc
+endif
+
.phony: all clean install
header=common.h carrier.h dt.h dtm.h pdb_server_backend.h log.h
@@ -10,13 +18,13 @@ extdep=Makefile
all: pdbt pdb_server
$(obj): %.o : %.c %.h $(header) $(extdep)
- gcc $(cflags) -c $<
+ $(CC) $(cflags) -c $<
pdbt: pdbt.c $(obj) $(header) $(extdep)
- gcc $(cflags) -o $@ $< $(obj)
+ $(CC) $(cflags) -o $@ $< $(obj)
pdb_server: pdb_server.c $(pdb_server_obj) $(header) $(extdep)
- gcc $(cflags) -o $@ $< $(pdb_server_obj)
+ $(CC) $(cflags) -o $@ $< $(pdb_server_obj)
clean:
rm -f *~ *.o pdbt pdb_server
diff --git a/utils/pdbt/pdbt.c b/utils/pdbt/pdbt.c
index fac466a..afd3695 100644
--- a/utils/pdbt/pdbt.c
+++ b/utils/pdbt/pdbt.c
@@ -28,6 +28,7 @@
#include <poll.h>
#include <ctype.h>
#include <sys/socket.h>
+#include <sys/stat.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>