Skip to content

Commit b0ac96a

Browse files
Move BOOST_EXT detection into EcoLab from Minsky.
1 parent 90b86e7 commit b0ac96a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

include/Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ MXE_PREFIX=x86_64-w64-mingw32.shared
3838
else
3939
$(error "MXE compiler not found")
4040
endif
41+
BOOST_EXT=-mt-x64
4142
endif
4243

4344
# force 64 bit build
@@ -112,6 +113,17 @@ endif
112113
# needed for generating .so files
113114
ifndef MXE
114115
FLAGS+=-fPIC
116+
117+
BOOST_EXT=
118+
# try to autonomously figure out which boost extension we should be using
119+
ifeq ($(shell if $(CPLUSPLUS) test/testmain.cc $(LIBS) -lboost_system>&/dev/null; then echo 1; else echo 0; fi),0)
120+
ifeq ($(shell if $(CPLUSPLUS) test/testmain.cc $(LIBS) -lboost_system-mt>&/dev/null; then echo 1; else echo 0; fi),1)
121+
BOOST_EXT=-mt
122+
else
123+
$(warning cannot figure out boost extension)
124+
endif
125+
endif
126+
$(warning Boost extension=$(BOOST_EXT))
115127
endif
116128

117129
# use mpicc etc by default if MPI set
@@ -198,7 +210,7 @@ endif
198210
ECOLIBS=$(ECOLAB_HOME)/lib/libecolab$(ECOLIBS_EXT).a
199211

200212
# why is boost_thread required here?
201-
LIBS+=-L$(ECOLAB_HOME)/lib -lecolab$(ECOLIBS_EXT) -lboost_thread
213+
LIBS+=-L$(ECOLAB_HOME)/lib -lecolab$(ECOLIBS_EXT) -lboost_thread$(BOOST_EXT)
202214
FLAGS+=-I. -I$(ECOLAB_HOME)/classdesc -I$(ECOLAB_HOME)/classdesc/json5_parser/json5_parser -I$(ECOLAB_HOME)/graphcode -I$(ECOLAB_HOME)/include -I$(ECOLAB_HOME)/Ouroboros-SYCL/include -DHASH_TCL_hash
203215

204216
# The following section uses GNU Make specific syntax. If not using

0 commit comments

Comments
 (0)