Created
November 8, 2009 02:02
-
-
Save quad/229025 to your computer and use it in GitHub Desktop.
Generate the missing symbols for loading mod_dav_svn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
NAME="DllTest" | |
compile() { | |
ldc -L=-Wl,--export-dynamic ${NAME}.d | |
} | |
next_library() { | |
./${NAME} 2>&1 | grep -o "undefined symbol: .*" | cut -d' ' -f 3 | |
} | |
extern() { | |
awk '{ print "export extern(C) void",$0,"() {}" }' | |
} | |
compile | |
until [ -z "$(next_library)" ]; do | |
next_library | extern >> ${NAME}.d | |
compile | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tango.sys.SharedLib; | |
import tango.text.convert.Format; | |
import tango.util.log.Trace; | |
bool load(char[] name) { | |
if (auto lib = SharedLib.load(name)) { | |
Trace.formatln(Format("{} loaded.", name)); | |
return true; | |
} | |
return false; | |
} | |
void main() { | |
assert(load("/usr/lib/libapr-1.so.0")); | |
assert(load("/usr/lib/libaprutil-1.so.0")); | |
assert(load("/usr/lib/apache2/modules/mod_dav.so")); | |
assert(load("/usr/lib/apache2/modules/mod_dav_svn.so")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment