Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Stop C file inclusion madness and do include the files in the libraries the proper...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 5 Aug 2007 16:19:55 +0000 (16:19 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 5 Aug 2007 16:19:55 +0000 (16:19 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3973 48e7efb5-ca39-0410-a469-dd3cf9ba447f

configure.ac
src/Makefile.am
src/xbt/context.c

index da3f2c8..16ccabc 100644 (file)
@@ -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
index 96f1f21..baca6a5 100644 (file)
@@ -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
 
 ##
index 2ffe4de..7f1159f 100644 (file)
 #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)