AC_MSG_RESULT(decide whether to compile lua bindings... $use_lua)
AM_CONDITIONAL(HAVE_LUA,test "x$use_lua" = "xyes")
+SG_CONFIGURE_PART(Checking Ruby bindings...)
+# Ruby cruft
+AC_ARG_ENABLE(ruby,
+ AS_HELP_STRING([--disable-ruby], [To not compile the Ruby bindings even if the tools are found]),
+ disable_ruby=$enableval,disable_ruby=yes)
+if test "x$disable_ruby" != "xyes" ; then
+ use_ruby="disabled by user"
+else
+ CPPFLAGS="-I/usr/lib/ruby/1.8/i486-linux/ $CPPFLAGS"
+ AC_MSG_CHECKING(checking ruby.h usability and presence)
+ AC_COMPILE_IFELSE([
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #include <ruby.h>
+ ], use_ruby=yes,use_ruby=no)
+ AC_MSG_RESULT($use_ruby)
+ if test "x$use_ruby" = "xyes" ; then
+ AC_DEFINE(HAVE_RUBY,1, [defines whether Ruby bindings must be compiled or not])
+ fi
+fi
+AC_MSG_RESULT(decide whether to compile ruby bindings... $use_ruby)
+AM_CONDITIONAL(HAVE_RUBY,test "x$use_ruby" = "xyes")
+
+
#####################
## Check for programs
##
Context backend: ${with_context}
Compile Java: ${use_java}
Compile Lua: ${use_lua}
+ Compile Ruby: ${use_ruby}
Maintainer mode: ${USE_MAINTAINER_MODE}
Supernovae mode: ${supernovae}
/*
- * $Id$
- *
- * Copyright 2010 Martin Quinson, Mehdi Fekari
- * All right reserved.
+ * Copyright 2010, The SimGrid Team. All right reserved.
*
* This program is free software; you can redistribute
* it and/or modify it under the terms of the license
return;
}
process->simdata->PID = msg_global->PID++; // msg_global ??
- /*DEBUG
- ("fil in process %s/%s (pid=%d) %p (sd=%p, host=%p, host->sd=%p) ",
- process->name ,process->simdata->m_host->name,process->simdata->PID,
- process,process->simdata, process->simdata->m_host,
- process->simdata->m_host->simdata);*/
#ifdef DEBUG
printf("fill in process %s/%s (pid=%d) %p (sd%=%p , host=%p, host->sd=%p)\n",
process->simdata->m_host->simdata->smx_host->name,
0,NULL,NULL);
- //DEBUG ( "context created (s_process=%p)",process->simdata->s_process);
#ifdef DEBUG
printf("context created (s_process=%p)\n",process->simdata->s_process);
#endif
}
SIMIX_context_stop(SIMIX_process_self()->context);
-}
\ No newline at end of file
+}
#include "xbt/swag.h"
#include "private.h"
#include <lua5.1/lauxlib.h>
-#include <ruby.h>
-#include "smx_context_ruby.c"
-#define HAVE_RUBY /* HACK HACK */
-// #define DEBUG
#ifdef HAVE_RUBY
- extern void SIMIX_ctx_ruby_factory_init(smx_context_factory_t *factory);
+/* Damn Ruby. They load their full config.h, which breaks since we also load ours.
+ * So, we undef the offending defines
+ */
+#undef PACKAGE_VERSION
+#undef PACKAGE_NAME
+#undef PACKAGE_TARNAME
+#undef PACKAGE_STRING
+#undef PACKAGE_BUGREPORT
+#undef _GNU_SOURCE
+#include <ruby.h>
+ void SIMIX_ctx_ruby_factory_init(smx_context_factory_t *factory);
+#include "smx_context_ruby.c"
#endif
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_context, simix, "Context switching mecanism");
/* $Id$ */
-/* context_Ruby - implementation of context switching with lua coroutines */
+/* context_Ruby - implementation of context switching with ruby coroutines */
-/* Copyright (c) 2004-2008 the SimGrid team. All right reserved */
+/* Copyright (c) 2010, the SimGrid team. All right reserved */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "xbt/asserts.h"
#include "context_sysv_config.h"
#include "bindings/ruby/rb_msg_process.c"
-// #include "bindings/ruby/rb_msg.c"
-
-// #define MY_DEBUG
typedef struct s_smx_ctx_ruby