Permalink
Browse files

Make -dynamiclib work! Related to #161

  • Loading branch information...
1 parent 4fca928 commit 065b7bc24d23d7be58a3d6cc32e99686ca51c505 nddrylliog committed Aug 13, 2010
Showing with 16 additions and 3 deletions.
  1. +15 −2 source/rock/frontend/CommandLine.ooc
  2. +1 −1 source/rock/frontend/drivers/SequenceDriver.ooc
@@ -374,16 +374,29 @@ CommandLine: class {
params clean = false
params defaultMain = false
params outPath = File new(basePath, "include")
+ prefix := "lib"
dynamicExt := ".so"
// TODO: version blocks for this is evil. What if we want to cross-compile?
// besides, it's missing some platforms.
version(windows) {
dynamicExt = ".dll"
+ prefix = ""
}
version(apple) {
- dynamicExt = ".dynlib"
+ dynamicExt = ".dylib"
}
- params dynamiclib = File new(File new(basePath, "lib"), moduleName + dynamicExt) getPath()
+ params dynamiclib = File new(File new(basePath, "lib"), prefix + moduleName + dynamicExt) getPath()
+
+ // TODO: this is too gcc/Linux-specific: there should be a good way
+ // to abstract that away
+ params compilerArgs add("-fPIC")
+ params compilerArgs add("-shared")
+ params compilerArgs add("-Wl,-soname," + params dynamiclib)
+ params binaryPath = params dynamiclib
+ //driver = CombineDriver new(params)
+ params libcache = false // libcache is incompatible with combine driver
+ params dynGC = true // including the libgc.a would involve creating a DT_TEXTREL
+ File new(basePath, "lib") mkdirs()
}
}
@@ -84,7 +84,7 @@ SequenceDriver: class extends Driver {
}
if(params verbose) println()
- if(params link && params staticlib == null) {
+ if(params link && (params staticlib == null || params dynamiclib != null)) {
initCompiler(params compiler)

0 comments on commit 065b7bc

Please sign in to comment.