Diff of /R/zzz.R.in [2f024f] .. [213c3f] Maximize Restore

  Switch to side-by-side view

--- a/R/zzz.R.in
+++ b/R/zzz.R.in
@@ -1,35 +1,15 @@
 .onLoad <- function(lib, pkg)
 {
-  ## Default location of JAGS is set at build time. The user can override
-  ## this by setting the environment variable JAGS_HOME, or by setting
-  ## the option "jagshome"
-
-  if (is.null(getOption("jagshome"))) {
-     if (nchar(Sys.getenv("JAGS_HOME")) == 0) {
-        options("jagshome" = "@JAGS_HOME@")
-     }
-     else {
-        options("jagshome" = Sys.getenv("JAGS_HOME"))
-     }
-  }
-
-  ## The linker won't find libjags.so, so we have to dynamically load it
-  dyn.load(paste(getOption("jagshome"),"/lib/libjags",
-           .Platform$dynlib.ext, sep=""))
-
-  ## Now we can load rjags ...
+  ## Load the rjags wrapper ...
   library.dynam("rjags", pkg, lib, local=FALSE)
 
   ## ... and the modules.
   cat("loading JAGS modules\n")
-  config.file <- paste(getOption("jagshome"),"etc","modules.conf",sep="/")
-  if (file.exists(config.file)) {
-     default.libs <- readLines(config.file)
-     for (i in 1:length(default.libs)) {
-        cat("   ", default.libs[i], "\n", sep="")
-        dyn.load(paste(getOption("jagshome"), "/modules/", default.libs[i],
-                       .Platform$dynlib.ext, sep=""))
-     }
+  default.libs <- c("basemod", "bugs")
+  for (i in 1:length(default.libs)) {
+     cat("   ", default.libs[i], "\n", sep="")
+     dyn.load(paste("@JAGS_MODDIR@/", default.libs[i], 
+                    .Platform$dynlib.ext, sep=""))
   }
 
   .Call("init_jags_console", PACKAGE="rjags")