You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Had a chance to port gRPC on FreeBSD 10.1. Basically created a FreeBSD 10.1 VM, cloned the gRPC git and with some changes in header file, makefiles & downloading few tools, was able to compile and run the sample app from the git.
Pasted below are the changes done. Please do have a look and let know your feedback. Also let know if gRPC can start supporting freeBSD.
I. grpc compilation for FreeBSD 10.1:
--------------------------------------------
a) Add support for FreeBSD platform in include/grpc/support/port_platform.h.
The following changes required to have support for FreeBSD platform.
b) The tools automake, autoconf and libtool needs to installed to compile thirdparty/protobuf for protobuf 3.0.
c) A change is need to the Makefile under thirdparty/openssl/ to set C/C++ compilers appropriately.
The FreeBSD 10.x comes with clang and will not have gcc by default.
The Makefile under thirdparty/openssl/ sets C/C++ compilers to gcc and g++ which should be cc(clang) and c++(clang++) for FreeBSD 10.x.
d) A change is needed to the Makefile under thirdparty/zlib/ to set C/C++ compilers appropriately (same reason mentioned above).
II. grpc-common compilation for FreeBSD 10.1
--------------------------------------------------------
The following changes needed for Services (or Applications) Makefiles.
a) Need to set C/C++ compilers appropriately fro FreeBSD 10.x.
b) Need to link with the library libc.so (-lc) instead of the library libdl (-ldl) for FreeBSD 10.x for calls to deal with a shared library (eg, dlopen, dlsym etc.).
III. The environment and tools used for compilations as follows.
--------------------------------------------------------------------------
OS: FreeBSD 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
Had a chance to port gRPC on FreeBSD 10.1. Basically created a FreeBSD 10.1 VM, cloned the gRPC git and with some changes in header file, makefiles & downloading few tools, was able to compile and run the sample app from the git.
Pasted below are the changes done. Please do have a look and let know your feedback. Also let know if gRPC can start supporting freeBSD.
I. grpc compilation for FreeBSD 10.1:
--------------------------------------------
a) Add support for FreeBSD platform in include/grpc/support/port_platform.h.
The following changes required to have support for FreeBSD platform.
+++ include/grpc/support/port_platform.h
@@ -75,6 +75,28 @@
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_TIME 1
#define GPR_GETPID_IN_UNISTD_H 1
+/_/
+#elif defined(FreeBSD)
+#define GPR_GCC_ATOMIC 1
+#define GPR_CPU_POSIX 1
+#define GPR_POSIX_LOG 1
+#define GPR_POSIX_MULTIPOLL_WITH_POLL 1
+#define GPR_POSIX_WAKEUP_FD 1
+#define GPR_POSIX_NO_SPECIAL_WAKEUP_FD 1
+#define GPR_POSIX_SOCKET 1
+#define GPR_POSIX_SOCKETADDR 1
+#define GPR_POSIX_SOCKETUTILS 1
+#define GPR_POSIX_ENV 1
+#define GPR_POSIX_FILE 1
+#define GPR_POSIX_SYNC 1
+#define GPR_POSIX_STRING 1
+#define GPR_POSIX_TIME 1
+#ifdef LP64
+#define GPR_ARCH_64 1
+#else
+#define GPR_ARCH_32 1
+#endif
+/**/
#elif defined(linux)
#ifndef _BSD_SOURCE
#define _BSD_SOURCE
b) The tools automake, autoconf and libtool needs to installed to compile thirdparty/protobuf for protobuf 3.0.
c) A change is need to the Makefile under thirdparty/openssl/ to set C/C++ compilers appropriately.
The FreeBSD 10.x comes with clang and will not have gcc by default.
The Makefile under thirdparty/openssl/ sets C/C++ compilers to gcc and g++ which should be cc(clang) and c++(clang++) for FreeBSD 10.x.
d) A change is needed to the Makefile under thirdparty/zlib/ to set C/C++ compilers appropriately (same reason mentioned above).
II. grpc-common compilation for FreeBSD 10.1
--------------------------------------------------------
The following changes needed for Services (or Applications) Makefiles.
a) Need to set C/C++ compilers appropriately fro FreeBSD 10.x.
b) Need to link with the library libc.so (-lc) instead of the library libdl (-ldl) for FreeBSD 10.x for calls to deal with a shared library (eg, dlopen, dlsym etc.).
III. The environment and tools used for compilations as follows.
--------------------------------------------------------------------------
OS: FreeBSD 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
compiler: FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
libtool: libtool (GNU libtool) 2.4.5
automake: automake (GNU automake) 1.15
autoconf: autoconf (GNU Autoconf) 2.69
host-triplet: amd64-portbld-freebsd10.1
shell: GNU bash, version 4.3.33(0)-release (amd64-portbld-freebsd10.1)
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
The text was updated successfully, but these errors were encountered: