1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
--- tensorflow/contrib/makefile/Makefile.orig 2019-10-14 21:08:43 UTC
+++ tensorflow/contrib/makefile/Makefile
@@ -60,12 +60,15 @@ else
ifeq ($(UNAME_S),Linux)
HOST_OS := LINUX
endif
+ ifeq ($(UNAME_S),FreeBSD)
+ HOST_OS := FREEBSD
+ endif
ifeq ($(UNAME_S),Darwin)
HOST_OS := OSX
endif
endif
-HOST_ARCH := $(shell if [[ $(shell uname -m) =~ i[345678]86 ]]; then echo x86_32; else echo $(shell uname -m); fi)
+HOST_ARCH := $(shell if uname -m | grep -q i[345678]86; then echo x86_32; elif uname -m | grep -q amd64; then echo x86_64; else uname -m; fi)
# Where compiled objects are stored.
HOST_OBJDIR := $(MAKEFILE_DIR)/gen/host_obj/
@@ -111,6 +114,9 @@ $(HOST_NSYNC_LIB) \
ifeq ($(HOST_OS),LINUX)
HOST_LIBS += -ldl -lpthread -lrt
endif
+ifeq ($(HOST_OS),FREEBSD)
+ HOST_LIBS += -lexecinfo -lpthread
+endif
# If we're on a Pi, link in pthreads and dl
ifeq ($(HOST_OS),PI)
@@ -248,7 +254,7 @@ endif
LDFLAGS += -all_load
endif
# Make sure that we don't strip global constructors on Linux.
-ifeq ($(TARGET),LINUX)
+ifeq ($(TARGET),LINUX,FREEBSD)
ifeq ($(HAS_GEN_HOST_PROTOC),true)
LIBFLAGS += -L$(MAKEFILE_DIR)/gen/protobuf-host/lib
export LD_LIBRARY_PATH=$(MAKEFILE_DIR)/gen/protobuf-host/lib
@@ -261,6 +267,10 @@ endif
ifeq ($(TARGET),LINUX)
LIBS += -ldl -lpthread -lrt
endif
+ifeq ($(TARGET),FREEBSD)
+ LIBS += -lexecinfo -lpthread
+endif
+
# If we're cross-compiling for the Raspberry Pi, use the right gcc.
ifeq ($(TARGET),PI)
CXXFLAGS += $(ANDROID_TYPES) -DRASPBERRY_PI
|