From: mquinson Date: Sun, 5 Aug 2007 16:19:55 +0000 (+0000) Subject: Stop C file inclusion madness and do include the files in the libraries the proper... X-Git-Tag: v3.3~1387 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6d31ded41b278226dc70b269dc7af66588e6474e Stop C file inclusion madness and do include the files in the libraries the proper way (ie, from autotools) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3973 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/configure.ac b/configure.ac index da3f2c8199..16ccabcfa5 100644 --- a/configure.ac +++ b/configure.ac @@ -162,6 +162,7 @@ if test "x$with_context" = "xpthread"; then 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 diff --git a/src/Makefile.am b/src/Makefile.am index 96f1f215aa..baca6a5d3b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -144,11 +144,11 @@ XBT_SRC=\ 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 \ @@ -161,6 +161,10 @@ SURF_SRC= \ 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 \ @@ -169,7 +173,7 @@ GTNETS_SRC= \ # 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 \ @@ -285,7 +289,7 @@ endif 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) \ @@ -295,7 +299,6 @@ libsimgrid_la_LDFLAGS = -no-undefined $(VERSION_INFO) @SIMGRID_DEP@ @LD_DYNAMIC_ 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 ## diff --git a/src/xbt/context.c b/src/xbt/context.c index 2ffe4de918..7f1159f17b 100644 --- a/src/xbt/context.c +++ b/src/xbt/context.c @@ -16,18 +16,6 @@ #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)