-
Notifications
You must be signed in to change notification settings - Fork 7
/
0002-makefile.patch
64 lines (61 loc) · 1.98 KB
/
0002-makefile.patch
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
diff --git a/Makefile b/Makefile
index 5361aaf..3a9db98 100644
--- a/Makefile
+++ b/Makefile
@@ -60,7 +60,7 @@ pddl/config.h:
if [ "$(DEBUG)" = "yes" ]; then echo "#define PDDL_DEBUG" >>$@; fi
echo '#include <boruvka/lp.h>' >__lp.c
echo 'int main(int argc, char *arvg[]) { return borLPSolverAvailable(BOR_LP_DEFAULT); }' >>__lp.c
- $(CC) $(CFLAGS) -o __lp __lp.c $(BORUVKA_LDFLAGS) $(LP_LDFLAGS) -pthread -lrt -lm
+ $(CC) $(CFLAGS) -o __lp __lp.c $(BORUVKA_LDFLAGS) $(LP_LDFLAGS) -pthread -lm
if ! ./__lp; then echo "#define PDDL_LP" >>$@; fi
rm -f __lp.c __lp
echo "" >>$@
@@ -114,6 +114,8 @@ boruvka-clean:
third-party/boruvka/Makefile:
git submodule init -- third-party/boruvka
git submodule update -- third-party/boruvka
+ cd third-party/boruvka; git apply ../../../0001-boruvka-endian.patch
+ cd third-party/boruvka; git apply ../../../0001-Removed-non-macos-call-in-unused-function.patch
opts: third-party/opts/Makefile
$(MAKE) -C third-party/opts all
diff --git a/Makefile.include b/Makefile.include
index 39fa372..4f95fdd 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -1,8 +1,22 @@
BASEPATH_ := $(dir $(realpath $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))))
#BASEPATH_ := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
-CC ?= gcc
-CXX ?= g++
+ifneq ($OS(OS), Windows_NT)
+ UNAME_S := $(shell uname -s)
+ ifeq ($(UNAME_S),Darwin)
+ CC ?= /opt/homebrew/opt/gcc/bin/gcc-13
+ CXX ?= /opt/homebrew/opt/gcc/bin/g++-13
+ else
+ CC ?= gcc
+ CXX ?= g++
+ endif
+else # guessing what will work on Windows
+ CC ?= gcc
+ CXX ?= g++
+endif
+
+
+
SCAN_BUILD ?= scan-build
PYTHON2 ?= python2
CPPCHECK ?= cppcheck
diff --git a/bin/Makefile b/bin/Makefile
index aebb463..98d85d0 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -9,7 +9,7 @@ LDFLAGS += $(BORUVKA_LDFLAGS)
LDFLAGS += $(OPTS_LDFLAGS)
LDFLAGS += $(LP_LDFLAGS)
LDFLAGS += $(BLISS_LDFLAGS)
-LDFLAGS += -pthread -lrt -lm
+LDFLAGS += -pthread -lm
ifeq '$(BIN_STATIC)' 'yes'
LDFLAGS += -static