From: mquinson Date: Mon, 12 Mar 2007 15:03:42 +0000 (+0000) Subject: Make sure libsimgrid depend on libpthreads only when needed (ie, when we use pthreads... X-Git-Tag: v3.3~2117 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f2485307bc9f202b0b96e735969b03ea7cf8a548 Make sure libsimgrid depend on libpthreads only when needed (ie, when we use pthreads to implement xbt_contextes); libgras depends on it anyway since it will soon be multithreaded git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3242 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/configure b/configure index c991093e24..5ad548daec 100755 --- a/configure +++ b/configure @@ -23971,6 +23971,7 @@ fi case $with_context in ucontext) ;; pthread) ;; + pthreads) ;; windows) ;; auto) with_context=ucontext;; *) { { echo "$as_me:$LINENO: error: --with-context must be either ucontext or pthread" >&5 @@ -24000,6 +24001,9 @@ echo "${ECHO_T}no working ucontext found. Try pthreads as a fallback" >&6 fi fi +if test "x$with_context" = "xpthreads"; then + with_context=pthread +fi if test "x$with_context" = "xpthread"; then for ac_header in pthread.h @@ -24690,74 +24694,16 @@ echo "${ECHO_T}${T_MD}Checking extra libraries dependencies...${T_ME}" >&6 SIMGRID_DEP="" GRAS_DEP="" -echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 -echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6 -if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_create (); -int -main () -{ -pthread_create (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthread_pthread_create=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthread_pthread_create=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6 -if test $ac_cv_lib_pthread_pthread_create = yes; then - SIMGRID_DEP="-lpthread"; GRAS_DEP="-lpthread" +if test xpthread=xyes ; then + # if the pthreads are usable + if test "x$with_context" = "xpthread" ; then + # if we use them to implement the xbt_context + SIMGRID_DEP="-lpthread" + fi + # we need them in any case for the gras lib (which is multithreaded) + GRAS_DEP="-lpthread" fi - echo "$as_me:$LINENO: checking for csdp" >&5 echo $ECHO_N "checking for csdp... $ECHO_C" >&6 sdp=no diff --git a/configure.ac b/configure.ac index db58210a25..953843bad3 100644 --- a/configure.ac +++ b/configure.ac @@ -124,6 +124,7 @@ fi case $with_context in ucontext) ;; pthread) ;; + pthreads) ;; windows) ;; auto) with_context=ucontext;; *) AC_MSG_ERROR([--with-context must be either ucontext or pthread]) ;; @@ -144,6 +145,9 @@ if test "x$with_context" = "xucontext" ; then fi fi +if test "x$with_context" = "xpthreads"; then + with_context=pthread +fi if test "x$with_context" = "xpthread"; then AC_CHECK_HEADERS([pthread.h]) AC_CHECK_LIB(pthread,pthread_create,, @@ -193,7 +197,15 @@ SG_CONFIGURE_PART(Checking extra libraries dependencies...) SIMGRID_DEP="" GRAS_DEP="" -AC_CHECK_LIB(pthread,pthread_create,SIMGRID_DEP="-lpthread"; GRAS_DEP="-lpthread") +if test xpthread=xyes ; then + # if the pthreads are usable + if test "x$with_context" = "xpthread" ; then + # if we use them to implement the xbt_context + SIMGRID_DEP="-lpthread" + fi + # we need them in any case for the gras lib (which is multithreaded) + GRAS_DEP="-lpthread" +fi AC_MSG_CHECKING(for csdp) sdp=no diff --git a/src/Makefile.am b/src/Makefile.am index 260faeba19..22642c9baa 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -112,7 +112,7 @@ lib_LTLIBRARIES= libsimgrid.la libgras.la COMMON_SRC=\ \ xbt/snprintf.c xbt/getline.c \ - xbt/ex.c xbt/xbt_thread.c \ + xbt/ex.c \ \ xbt_modinter.h gras_modinter.h \ \ @@ -151,7 +151,8 @@ COMMON_SRC=\ gras/Virtu/process.c gras/Virtu/gras_module.c RL_SRC= \ - gras/rl_gras.c \ + gras/rl_stubs.c xbt/xbt_thread.c \ + \ gras/Transport/rl_transport.c \ gras/Transport/transport_plugin_file.c gras/Transport/transport_plugin_tcp.c \ \ @@ -162,6 +163,7 @@ RL_SRC= \ gras/Msg/rl_msg.c SG_SRC= \ + gras/sg_stubs.c \ xbt/context.c \ \ surf/maxmin.c \ diff --git a/src/Makefile.in b/src/Makefile.in index 0ba3ffb5e2..a65fb8710a 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -84,18 +84,17 @@ am__installdirs = "$(DESTDIR)$(libdir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libgras_la_LIBADD = -am__objects_1 = snprintf.lo getline.lo ex.lo xbt_thread.lo sysdep.lo \ - asserts.lo log.lo log_default_appender.lo mallocator.lo \ - dynar.lo dict.lo dict_elm.lo dict_cursor.lo dict_multi.lo \ - heap.lo fifo.lo swag.lo graph.lo set.lo xbt_matrix.lo \ - xbt_peer.lo xbt_main.lo config.lo cunit.lo graphxml_parse.lo \ - gras.lo transport.lo ddt_create.lo ddt_convert.lo \ - ddt_exchange.lo cbps.lo datadesc.lo ddt_parse.lo \ - ddt_parse.yy.lo msg.lo rpc.lo timer.lo process.lo \ - gras_module.lo -am__objects_2 = rl_gras.lo rl_transport.lo transport_plugin_file.lo \ - transport_plugin_tcp.lo rl_emul.lo rl_process.lo rl_time.lo \ - rl_dns.lo rl_msg.lo +am__objects_1 = snprintf.lo getline.lo ex.lo sysdep.lo asserts.lo \ + log.lo log_default_appender.lo mallocator.lo dynar.lo dict.lo \ + dict_elm.lo dict_cursor.lo dict_multi.lo heap.lo fifo.lo \ + swag.lo graph.lo set.lo xbt_matrix.lo xbt_peer.lo xbt_main.lo \ + config.lo cunit.lo graphxml_parse.lo gras.lo transport.lo \ + ddt_create.lo ddt_convert.lo ddt_exchange.lo cbps.lo \ + datadesc.lo ddt_parse.lo ddt_parse.yy.lo msg.lo rpc.lo \ + timer.lo process.lo gras_module.lo +am__objects_2 = rl_stubs.lo xbt_thread.lo rl_transport.lo \ + transport_plugin_file.lo transport_plugin_tcp.lo rl_emul.lo \ + rl_process.lo rl_time.lo rl_dns.lo rl_msg.lo am__objects_3 = amok_base.lo bandwidth.lo saturate.lo \ peermanagement.lo am_libgras_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ @@ -103,23 +102,22 @@ am_libgras_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ libgras_la_OBJECTS = $(am_libgras_la_OBJECTS) libsimgrid_la_LIBADD = am__libsimgrid_la_SOURCES_DIST = xbt/snprintf.c xbt/getline.c xbt/ex.c \ - xbt/xbt_thread.c xbt_modinter.h gras_modinter.h xbt/sysdep.c \ - xbt/asserts.c xbt/log.c xbt/log_default_appender.c \ - xbt/mallocator.c xbt/dynar.c xbt/dict.c xbt/dict_elm.c \ - xbt/dict_cursor.c xbt/dict_multi.c xbt/heap.c xbt/fifo.c \ - xbt/swag.c xbt/graph.c xbt/set.c xbt/xbt_matrix.c \ - xbt/xbt_peer.c xbt/xbt_main.c xbt/config.c xbt/cunit.c \ - xbt/graphxml_parse.c gras/gras.c gras/Transport/transport.c \ - gras/Transport/transport_private.h gras/DataDesc/ddt_create.c \ - gras/DataDesc/ddt_convert.c gras/DataDesc/ddt_exchange.c \ - gras/DataDesc/cbps.c gras/DataDesc/datadesc.c \ - gras/DataDesc/datadesc_interface.h \ + xbt_modinter.h gras_modinter.h xbt/sysdep.c xbt/asserts.c \ + xbt/log.c xbt/log_default_appender.c xbt/mallocator.c \ + xbt/dynar.c xbt/dict.c xbt/dict_elm.c xbt/dict_cursor.c \ + xbt/dict_multi.c xbt/heap.c xbt/fifo.c xbt/swag.c xbt/graph.c \ + xbt/set.c xbt/xbt_matrix.c xbt/xbt_peer.c xbt/xbt_main.c \ + xbt/config.c xbt/cunit.c xbt/graphxml_parse.c gras/gras.c \ + gras/Transport/transport.c gras/Transport/transport_private.h \ + gras/DataDesc/ddt_create.c gras/DataDesc/ddt_convert.c \ + gras/DataDesc/ddt_exchange.c gras/DataDesc/cbps.c \ + gras/DataDesc/datadesc.c gras/DataDesc/datadesc_interface.h \ gras/DataDesc/datadesc_private.h gras/DataDesc/ddt_parse.c \ gras/DataDesc/ddt_parse.yy.c gras/DataDesc/ddt_parse.yy.h \ gras/Msg/msg.c gras/Msg/rpc.c gras/Msg/timer.c \ gras/Msg/msg_interface.h gras/Msg/msg_private.h \ - gras/Virtu/process.c gras/Virtu/gras_module.c xbt/context.c \ - surf/maxmin.c surf/trace_mgr.c surf/surf.c \ + gras/Virtu/process.c gras/Virtu/gras_module.c gras/sg_stubs.c \ + xbt/context.c surf/maxmin.c surf/trace_mgr.c surf/surf.c \ surf/surfxml_parse.c surf/cpu.c surf/network.c \ surf/workstation.c surf/surf_timer.c surf/network_dassf.c \ surf/workstation_KCCFLN05.c msg/msg_config.c msg/task.c \ @@ -139,7 +137,7 @@ am__libsimgrid_la_SOURCES_DIST = xbt/snprintf.c xbt/getline.c xbt/ex.c \ @USE_SIMIX_TRUE@am__objects_5 = smx_global.lo smx_deployment.lo \ @USE_SIMIX_TRUE@ smx_config.lo smx_environment.lo smx_host.lo \ @USE_SIMIX_TRUE@ smx_process.lo smx_action.lo smx_synchro.lo -am__objects_6 = context.lo maxmin.lo trace_mgr.lo surf.lo \ +am__objects_6 = sg_stubs.lo context.lo maxmin.lo trace_mgr.lo surf.lo \ surfxml_parse.lo cpu.lo network.lo workstation.lo \ surf_timer.lo network_dassf.lo workstation_KCCFLN05.lo \ msg_config.lo task.lo host.lo m_process.lo gos.lo global.lo \ @@ -344,8 +342,7 @@ EXTRA_DIST = portable.h xbt/mallocator_private.h xbt/dynar_private.h \ surf/workstation_KCCFLN05_private.h include/surf/maxmin.h \ include/surf/trace_mgr.h include/surf/surf.h \ include/surf/surfxml_parse_private.h \ - include/xbt/xbt_portability.h \ - include/xbt/xbt_internal_thread.h include/xbt/context.h \ + include/xbt/xbt_portability.h include/xbt/context.h \ msg/private.h simdag/private.h \ gras/Transport/transport_interface.h \ gras/Virtu/virtu_interface.h gras/Virtu/virtu_private.h \ @@ -396,7 +393,7 @@ lib_LTLIBRARIES = libsimgrid.la libgras.la COMMON_SRC = \ \ xbt/snprintf.c xbt/getline.c \ - xbt/ex.c xbt/xbt_thread.c \ + xbt/ex.c \ \ xbt_modinter.h gras_modinter.h \ \ @@ -435,7 +432,8 @@ COMMON_SRC = \ gras/Virtu/process.c gras/Virtu/gras_module.c RL_SRC = \ - gras/rl_gras.c \ + gras/rl_stubs.c xbt/xbt_thread.c \ + \ gras/Transport/rl_transport.c \ gras/Transport/transport_plugin_file.c gras/Transport/transport_plugin_tcp.c \ \ @@ -445,8 +443,8 @@ RL_SRC = \ \ gras/Msg/rl_msg.c -SG_SRC = xbt/context.c surf/maxmin.c surf/trace_mgr.c surf/surf.c \ - surf/surfxml_parse.c surf/cpu.c surf/network.c \ +SG_SRC = gras/sg_stubs.c xbt/context.c surf/maxmin.c surf/trace_mgr.c \ + surf/surf.c surf/surfxml_parse.c surf/cpu.c surf/network.c \ surf/workstation.c surf/surf_timer.c surf/network_dassf.c \ surf/workstation_KCCFLN05.c msg/msg_config.c msg/task.c \ msg/host.c msg/m_process.c msg/gos.c msg/global.c \ @@ -637,9 +635,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl_dns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl_emul.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl_gras.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl_msg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl_process.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl_stubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl_time.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl_transport.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpc.Plo@am__quote@ @@ -655,6 +653,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sg_emul.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sg_msg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sg_process.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sg_stubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sg_time.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sg_transport.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simgrid_units_main.Po@am__quote@ @@ -729,13 +728,6 @@ ex.lo: xbt/ex.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ex.lo `test -f 'xbt/ex.c' || echo '$(srcdir)/'`xbt/ex.c -xbt_thread.lo: xbt/xbt_thread.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xbt_thread.lo -MD -MP -MF "$(DEPDIR)/xbt_thread.Tpo" -c -o xbt_thread.lo `test -f 'xbt/xbt_thread.c' || echo '$(srcdir)/'`xbt/xbt_thread.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xbt_thread.Tpo" "$(DEPDIR)/xbt_thread.Plo"; else rm -f "$(DEPDIR)/xbt_thread.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xbt/xbt_thread.c' object='xbt_thread.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xbt_thread.lo `test -f 'xbt/xbt_thread.c' || echo '$(srcdir)/'`xbt/xbt_thread.c - sysdep.lo: xbt/sysdep.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sysdep.lo -MD -MP -MF "$(DEPDIR)/sysdep.Tpo" -c -o sysdep.lo `test -f 'xbt/sysdep.c' || echo '$(srcdir)/'`xbt/sysdep.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sysdep.Tpo" "$(DEPDIR)/sysdep.Plo"; else rm -f "$(DEPDIR)/sysdep.Tpo"; exit 1; fi @@ -981,12 +973,19 @@ gras_module.lo: gras/Virtu/gras_module.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gras_module.lo `test -f 'gras/Virtu/gras_module.c' || echo '$(srcdir)/'`gras/Virtu/gras_module.c -rl_gras.lo: gras/rl_gras.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rl_gras.lo -MD -MP -MF "$(DEPDIR)/rl_gras.Tpo" -c -o rl_gras.lo `test -f 'gras/rl_gras.c' || echo '$(srcdir)/'`gras/rl_gras.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rl_gras.Tpo" "$(DEPDIR)/rl_gras.Plo"; else rm -f "$(DEPDIR)/rl_gras.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gras/rl_gras.c' object='rl_gras.lo' libtool=yes @AMDEPBACKSLASH@ +rl_stubs.lo: gras/rl_stubs.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rl_stubs.lo -MD -MP -MF "$(DEPDIR)/rl_stubs.Tpo" -c -o rl_stubs.lo `test -f 'gras/rl_stubs.c' || echo '$(srcdir)/'`gras/rl_stubs.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rl_stubs.Tpo" "$(DEPDIR)/rl_stubs.Plo"; else rm -f "$(DEPDIR)/rl_stubs.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gras/rl_stubs.c' object='rl_stubs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rl_gras.lo `test -f 'gras/rl_gras.c' || echo '$(srcdir)/'`gras/rl_gras.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rl_stubs.lo `test -f 'gras/rl_stubs.c' || echo '$(srcdir)/'`gras/rl_stubs.c + +xbt_thread.lo: xbt/xbt_thread.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xbt_thread.lo -MD -MP -MF "$(DEPDIR)/xbt_thread.Tpo" -c -o xbt_thread.lo `test -f 'xbt/xbt_thread.c' || echo '$(srcdir)/'`xbt/xbt_thread.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xbt_thread.Tpo" "$(DEPDIR)/xbt_thread.Plo"; else rm -f "$(DEPDIR)/xbt_thread.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xbt/xbt_thread.c' object='xbt_thread.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xbt_thread.lo `test -f 'xbt/xbt_thread.c' || echo '$(srcdir)/'`xbt/xbt_thread.c rl_transport.lo: gras/Transport/rl_transport.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rl_transport.lo -MD -MP -MF "$(DEPDIR)/rl_transport.Tpo" -c -o rl_transport.lo `test -f 'gras/Transport/rl_transport.c' || echo '$(srcdir)/'`gras/Transport/rl_transport.c; \ @@ -1072,6 +1071,13 @@ peermanagement.lo: amok/PeerManagement/peermanagement.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o peermanagement.lo `test -f 'amok/PeerManagement/peermanagement.c' || echo '$(srcdir)/'`amok/PeerManagement/peermanagement.c +sg_stubs.lo: gras/sg_stubs.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sg_stubs.lo -MD -MP -MF "$(DEPDIR)/sg_stubs.Tpo" -c -o sg_stubs.lo `test -f 'gras/sg_stubs.c' || echo '$(srcdir)/'`gras/sg_stubs.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sg_stubs.Tpo" "$(DEPDIR)/sg_stubs.Plo"; else rm -f "$(DEPDIR)/sg_stubs.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gras/sg_stubs.c' object='sg_stubs.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sg_stubs.lo `test -f 'gras/sg_stubs.c' || echo '$(srcdir)/'`gras/sg_stubs.c + context.lo: xbt/context.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT context.lo -MD -MP -MF "$(DEPDIR)/context.Tpo" -c -o context.lo `test -f 'xbt/context.c' || echo '$(srcdir)/'`xbt/context.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/context.Tpo" "$(DEPDIR)/context.Plo"; else rm -f "$(DEPDIR)/context.Tpo"; exit 1; fi diff --git a/src/xbt/context.c b/src/xbt/context.c index 4f6907be5e..deb917cf02 100644 --- a/src/xbt/context.c +++ b/src/xbt/context.c @@ -15,6 +15,15 @@ #include "xbt/dynar.h" #include "xbt/xbt_thread.h" +#ifdef CONTEXT_THREADS + /* This file (context.c) is only loaded in libsimgrid, not libgras. + * xbt_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_thread.c" +#endif + XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ctx, xbt, "Context"); #define VOIRP(expr) DEBUG1(" {" #expr " = %p }", expr)