-
Notifications
You must be signed in to change notification settings - Fork 3
/
mk-npapi-crossmingw
executable file
·60 lines (49 loc) · 1.19 KB
/
mk-npapi-crossmingw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
root="$HOME/mingw-cross-env/usr/bin"
common="$root/i386-mingw32msvc-gcc"
rc="$root/i386-mingw32msvc-windres"
ar="$root/i386-mingw32msvc-ar"
cc="$common -D_WIN32_WINNT=0x500 -DXULRUNNER_SDK -DWIN32 -D_WINDOWS -DXP_WIN32 -DMOZILLA_STRICT_API -DXPCOM_GLUE -DXP_WIN -D_X86_ -DNPSIMPLE_EXPORTS -Wall"
log() {
echo $* 1>&2
}
builddir() {
echo "b"
}
pkgdir() {
echo `builddir`/$1.plugin
}
condir() {
echo `pkgdir $1`
}
resdir() {
echo `condir $1`
}
bindir() {
echo `condir $1`
}
obj() {
log "compiling $*"
dst=`builddir`/$1.o
shift
$cc -c -I src -o $dst $*
echo $dst
}
plg() {
log "linking $*"
name=$1
dst=`builddir`/np$name.dll
shift
obj=$1
shift
sed s/NAME/$name/g templates/npapi/webtemplate.rc > `builddir`/$name.rc
$rc -Ocoff -i `builddir`/$name.rc -o `builddir`/$name.res -I templates/npapi
$cc -shared -o $dst $obj -L `builddir` $* `builddir`/$name.res -lopengl32 -lgdi32 -lglu32 -luser32 -limm32 -lshell32
echo $dst
}
rm -fR `builddir`
install -d `builddir`
cvobj="`obj npapint src/npapint.c`"
testobj=`obj test test/test.c`
testplg=`plg testplugin $testobj $cvobj src/npapi.def`
cp b/nptestplugin.dll /tmp