From f281a248565b50fe8c8fd760e70e3f50d4740a3f Mon Sep 17 00:00:00 2001 From: mquinson Date: Fri, 16 Nov 2007 01:14:15 +0000 Subject: [PATCH] add a stub for the java factory initier for the cases where we don't want to compile the jbindings (and also, rework the threads stubs so that both kind of stubs fit together) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5052 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/Makefile.am | 9 +++-- src/Makefile.in | 35 ++++++++----------- src/gras_config.h.in | 3 ++ .../{xbt_os_thread_stubs.c => xbt_sg_stubs.c} | 20 ++++++++--- 4 files changed, 38 insertions(+), 29 deletions(-) rename src/xbt/{xbt_os_thread_stubs.c => xbt_sg_stubs.c} (81%) diff --git a/src/Makefile.am b/src/Makefile.am index 82a306619d..b176debb21 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -170,14 +170,13 @@ SURF_SRC= \ surf/surfxml_parse.c \ surf/cpu.c surf/network.c surf/workstation.c \ surf/surf_timer.c \ - surf/workstation_KCCFLN05.c surf/workstation_ptask_L07.c + surf/workstation_KCCFLN05.c surf/workstation_ptask_L07.c \ + xbt/xbt_sg_stubs.c if CONTEXT_THREADS - SURF_SRC += xbt/xbt_os_thread.c \ - xbt/xbt_thread_context.c + SURF_SRC += xbt/xbt_os_thread.c xbt/xbt_thread_context.c else - SURF_SRC += xbt/xbt_os_thread_stubs.c \ - xbt/xbt_ucontext.c + SURF_SRC += xbt/xbt_ucontext.c endif GTNETS_SRC= \ diff --git a/src/Makefile.in b/src/Makefile.in index 710093bf50..5e8652b047 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -52,12 +52,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -@CONTEXT_THREADS_TRUE@am__append_1 = xbt/xbt_os_thread.c \ -@CONTEXT_THREADS_TRUE@ xbt/xbt_thread_context.c - -@CONTEXT_THREADS_FALSE@am__append_2 = xbt/xbt_os_thread_stubs.c \ -@CONTEXT_THREADS_FALSE@ xbt/xbt_ucontext.c - +@CONTEXT_THREADS_TRUE@am__append_1 = xbt/xbt_os_thread.c xbt/xbt_thread_context.c +@CONTEXT_THREADS_FALSE@am__append_2 = xbt/xbt_ucontext.c @HAVE_GTNETS_FALSE@am__append_3 = $(GTNETS_SRC) @HAVE_SDP_FALSE@am__append_4 = surf/sdp.c @@ -137,8 +133,8 @@ am__libsimgrid_la_SOURCES_DIST = xbt/snprintf.c xbt/xbt_str.c \ surf/surf.c surf/surfxml_parse.c surf/cpu.c surf/network.c \ surf/workstation.c surf/surf_timer.c \ surf/workstation_KCCFLN05.c surf/workstation_ptask_L07.c \ - xbt/xbt_os_thread.c xbt/xbt_thread_context.c \ - xbt/xbt_os_thread_stubs.c xbt/xbt_ucontext.c \ + xbt/xbt_sg_stubs.c xbt/xbt_os_thread.c \ + xbt/xbt_thread_context.c xbt/xbt_ucontext.c \ surf/gtnets/gtnets_simulator.cc surf/gtnets/gtnets_topology.cc \ surf/gtnets/gtnets_interface.cc surf/network_gtnets.c \ surf/sdp.c simix/smx_global.c simix/smx_deployment.c \ @@ -172,12 +168,11 @@ am__libsimgrid_la_SOURCES_DIST = xbt/snprintf.c xbt/xbt_str.c \ java/jmsg_process.h java/jmsg_task.c java/jmsg_task.h @CONTEXT_THREADS_TRUE@am__objects_6 = xbt_os_thread.lo \ @CONTEXT_THREADS_TRUE@ xbt_thread_context.lo -@CONTEXT_THREADS_FALSE@am__objects_7 = xbt_os_thread_stubs.lo \ -@CONTEXT_THREADS_FALSE@ xbt_ucontext.lo +@CONTEXT_THREADS_FALSE@am__objects_7 = xbt_ucontext.lo am__objects_8 = maxmin.lo fair_bottleneck.lo lagrange.lo trace_mgr.lo \ surf.lo surfxml_parse.lo cpu.lo network.lo workstation.lo \ surf_timer.lo workstation_KCCFLN05.lo workstation_ptask_L07.lo \ - $(am__objects_6) $(am__objects_7) + xbt_sg_stubs.lo $(am__objects_6) $(am__objects_7) am__objects_9 = gtnets_simulator.lo gtnets_topology.lo \ gtnets_interface.lo network_gtnets.lo @HAVE_GTNETS_TRUE@am__objects_10 = $(am__objects_9) @@ -507,7 +502,7 @@ SURF_SRC = surf/maxmin.c surf/fair_bottleneck.c surf/lagrange.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/workstation_KCCFLN05.c surf/workstation_ptask_L07.c \ - $(am__append_1) $(am__append_2) + xbt/xbt_sg_stubs.c $(am__append_1) $(am__append_2) GTNETS_SRC = \ surf/gtnets/gtnets_simulator.cc \ surf/gtnets/gtnets_topology.cc \ @@ -893,12 +888,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_main.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_matrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_os_thread.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_os_thread_stubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_os_time.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_peer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_queue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_rl_synchro.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_rl_time.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_sg_stubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_sg_synchro.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_sg_time.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_str.Plo@am__quote@ @@ -1440,6 +1435,13 @@ workstation_ptask_L07.lo: surf/workstation_ptask_L07.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o workstation_ptask_L07.lo `test -f 'surf/workstation_ptask_L07.c' || echo '$(srcdir)/'`surf/workstation_ptask_L07.c +xbt_sg_stubs.lo: xbt/xbt_sg_stubs.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xbt_sg_stubs.lo -MD -MP -MF $(DEPDIR)/xbt_sg_stubs.Tpo -c -o xbt_sg_stubs.lo `test -f 'xbt/xbt_sg_stubs.c' || echo '$(srcdir)/'`xbt/xbt_sg_stubs.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/xbt_sg_stubs.Tpo $(DEPDIR)/xbt_sg_stubs.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xbt/xbt_sg_stubs.c' object='xbt_sg_stubs.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xbt_sg_stubs.lo `test -f 'xbt/xbt_sg_stubs.c' || echo '$(srcdir)/'`xbt/xbt_sg_stubs.c + xbt_thread_context.lo: xbt/xbt_thread_context.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xbt_thread_context.lo -MD -MP -MF $(DEPDIR)/xbt_thread_context.Tpo -c -o xbt_thread_context.lo `test -f 'xbt/xbt_thread_context.c' || echo '$(srcdir)/'`xbt/xbt_thread_context.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/xbt_thread_context.Tpo $(DEPDIR)/xbt_thread_context.Plo @@ -1447,13 +1449,6 @@ xbt_thread_context.lo: xbt/xbt_thread_context.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xbt_thread_context.lo `test -f 'xbt/xbt_thread_context.c' || echo '$(srcdir)/'`xbt/xbt_thread_context.c -xbt_os_thread_stubs.lo: xbt/xbt_os_thread_stubs.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xbt_os_thread_stubs.lo -MD -MP -MF $(DEPDIR)/xbt_os_thread_stubs.Tpo -c -o xbt_os_thread_stubs.lo `test -f 'xbt/xbt_os_thread_stubs.c' || echo '$(srcdir)/'`xbt/xbt_os_thread_stubs.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/xbt_os_thread_stubs.Tpo $(DEPDIR)/xbt_os_thread_stubs.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xbt/xbt_os_thread_stubs.c' object='xbt_os_thread_stubs.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xbt_os_thread_stubs.lo `test -f 'xbt/xbt_os_thread_stubs.c' || echo '$(srcdir)/'`xbt/xbt_os_thread_stubs.c - xbt_ucontext.lo: xbt/xbt_ucontext.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xbt_ucontext.lo -MD -MP -MF $(DEPDIR)/xbt_ucontext.Tpo -c -o xbt_ucontext.lo `test -f 'xbt/xbt_ucontext.c' || echo '$(srcdir)/'`xbt/xbt_ucontext.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/xbt_ucontext.Tpo $(DEPDIR)/xbt_ucontext.Plo diff --git a/src/gras_config.h.in b/src/gras_config.h.in index 2ffed4b8da..32c5e80f68 100644 --- a/src/gras_config.h.in +++ b/src/gras_config.h.in @@ -77,6 +77,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* defines whether Java bindings must be compiled or not */ +#undef HAVE_JAVA + /* Define to 1 if you have the header file. */ #undef HAVE_JNI_H diff --git a/src/xbt/xbt_os_thread_stubs.c b/src/xbt/xbt_sg_stubs.c similarity index 81% rename from src/xbt/xbt_os_thread_stubs.c rename to src/xbt/xbt_sg_stubs.c index ff7b61a7e1..6713c6abdb 100644 --- a/src/xbt/xbt_os_thread_stubs.c +++ b/src/xbt/xbt_sg_stubs.c @@ -1,10 +1,16 @@ /* $Id$ */ -/* xbt_os_thread_stub -- empty functions used in SG, but harmful in RL */ -/* More specifically, it is loaded by xbt/context.c when CONTEXT_UCONTEXT */ -/* When CONTEXT_THREAD, xbt_os_thread is loaded instead (to get real func) */ -/* In RL, xbt_os_thread is part of GRAS_RL_SRC */ +/* xbt_sg_stubs -- empty functions sometimes used in SG (never in RL) */ +/* This is always part of SG, never of RL. Content: */ +/* - a bunch of stub functions of the thread related function that we need */ +/* to add to the lib to please the linker when using ucontextes. */ +/* - a bunch of stub functions of the java related function when we don't */ +/* compile java bindings. */ + +/* In RL, java is useless, and threads are always part of the picture, */ +/* ucontext never */ + /* Copyright (c) 2007 Martin Quinson. */ /* All rights reserved. */ @@ -95,6 +101,12 @@ void xbt_os_cond_destroy(xbt_os_cond_t cond){ xbt_backtrace_display_current(); xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_destroy)"); } +#endif +#ifndef HAVE_JAVA +#include "xbt/xbt_context_private.h" +int xbt_jcontext_factory_init(xbt_context_factory_t* factory) { + return -1; +} #endif -- 2.20.1