AC_DEFINE([CONTEXT_THREADS],1,[Define if xbt contexts are based on our threads implementation or not])
AC_MSG_RESULT(You have pthreads. Let's use them.)
fi
+AM_CONDITIONAL(CONTEXT_THREADS,test "x$with_context" = xpthread)
dnl #
dnl # 4. determine a few additional details
xbt/graphxml_parse.c
XBT_RL_SRC = \
- xbt/xbt_rl_synchro.c \
- xbt/xbt_rl_time.c
+ xbt/xbt_rl_synchro.c \
+ xbt/xbt_rl_time.c
XBT_SG_SRC = \
- xbt/xbt_sg_synchro.c \
- xbt/xbt_sg_time.c
+ xbt/xbt_sg_synchro.c \
+ xbt/xbt_sg_time.c
SURF_SRC= \
surf/maxmin.c \
surf/network_dassf.c \
surf/workstation_KCCFLN05.c
+if CONTEXT_THREADS
+ SURF_SRC += xbt/xbt_os_thread.c
+endif
+
GTNETS_SRC= \
surf/gtnets/gtnets_simulator.cc \
surf/gtnets/gtnets_topology.cc \
# Separated because we don't want it in libsimgrid4java
CTX_SRC= xbt/context.c
-JCTX_SRC= java/jxbt_context.c java/jxbt_context.h xbt/xbt_os_thread.c
+JCTX_SRC= java/jxbt_context.c java/jxbt_context.h
SIMIX_SRC= \
simix/smx_global.c \
lib_LTLIBRARIES= libsimgrid.la libgras.la libsmpi.la
libgras_la_SOURCES= $(XBT_SRC) $(GRAS_COMMON_SRC) $(GRAS_RL_SRC) $(AMOK_SRC)
-libgras_la_LDFLAGS = -no-undefined $(VERSION_INFO) @GRAS_DEP@ @LD_DYNAMIC_FLAGS@ -lm
+libgras_la_LDFLAGS = -no-undefined $(VERSION_INFO) @GRAS_DEP@ @LD_DYNAMIC_FLAGS@ -lm
libsimgrid_la_SOURCES = $(XBT_SRC) $(SURF_SRC) $(GTNETS_USED) $(SDP_SRC) \
$(SIMIX_SRC) $(CTX_SRC) \
libsmpi_la_LIBADD = libsimgrid.la
libsmpi_la_SOURCES = $(SMPI_SRC)
-#libsmpi_la_LDFLAGS = -no-undefined $(VERSION_INFO) @SMPI_DEP@ @LD_DYNAMIC_FLAGS@ -lm
libsmpi_la_LDFLAGS = -no-undefined $(VERSION_INFO) @LD_DYNAMIC_FLAGS@ -lm
##
#include "xbt/xbt_os_thread.h"
#include "xbt/ex_interface.h"
-#ifdef CONTEXT_THREADS
- /* This file (context.c) is only loaded in libsimgrid, not libgras.
- * xbt_os_thread is only loaded in libgras explicitly, and we need it in
- * libsimgrid, but only when it is the backend used to implement the
- * xbt_context. So, do load it on need.
- */
-#include "xbt/xbt_os_thread.c"
-#else
-/* if not, load stubs so that all symbols get resolved anyway */
-#include "xbt/xbt_os_thread_stubs.c"
-#endif
-
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ctx, xbt, "Context");
#define VOIRP(expr) DEBUG1(" {" #expr " = %p }", expr)