[sr-dev] git:5.0:cecb5186: utils/pdbt: FreeBSD fix, gcc is hardcoded, header is missing

Daniel-Constantin Mierla miconda at gmail.com
Tue Apr 4 13:56:35 CEST 2017


Module: kamailio
Branch: 5.0
Commit: cecb51863e3b92577ea600089254ed4f30e9ce0d
URL: https://github.com/kamailio/kamailio/commit/cecb51863e3b92577ea600089254ed4f30e9ce0d

Author: Rick Barenthin <rb at terralink.de>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-04-04T13:50:42+02:00

utils/pdbt: FreeBSD fix, gcc is hardcoded, header is missing

- use CC environment variable if set
- added missing sys/stat.h header

(cherry picked from commit 32e1e5040d2ff5e13d5bd0373e7edd6cef56f172)

---

Modified: utils/pdbt/Makefile
Modified: utils/pdbt/pdbt.c

---

Diff:  https://github.com/kamailio/kamailio/commit/cecb51863e3b92577ea600089254ed4f30e9ce0d.diff
Patch: https://github.com/kamailio/kamailio/commit/cecb51863e3b92577ea600089254ed4f30e9ce0d.patch

---

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>




More information about the sr-dev mailing list