summaryrefslogtreecommitdiff
path: root/scripts/runfontdump.sh
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-06-07 14:01:37 +0200
committerRobin Watts <robin.watts@artifex.com>2018-06-11 10:14:46 +0100
commita71f6edd591038828e9552d758e2a5378e399f41 (patch)
tree33313e1ef9242f7f7a46f1d726a79155840bc979 /scripts/runfontdump.sh
parent9400707693125fc6ac472ac49bad2930a11387f1 (diff)
downloadmupdf-a71f6edd591038828e9552d758e2a5378e399f41.tar.xz
Use bin2coff to generate font data blobs object files.
This is the windows equivalent of objcopy or ld -r binary. We need different bin2coff font object files for 32 and 64 bit builds, so put the font object files in AdditionalDependencies. Revamp Windows builds to use bin2coff. Fix bin2coff to not use '-' in symbol names. Add a new project file to make bin2coff. Add a .rules file to tell MSVC how to call the built version of bin2coff. Update libresources build to use this rules file. Update noto.c to correctly find the symbols we make.
Diffstat (limited to 'scripts/runfontdump.sh')
-rw-r--r--scripts/runfontdump.sh39
1 files changed, 22 insertions, 17 deletions
diff --git a/scripts/runfontdump.sh b/scripts/runfontdump.sh
index 8e265555..ab18220b 100644
--- a/scripts/runfontdump.sh
+++ b/scripts/runfontdump.sh
@@ -7,31 +7,36 @@ OUT=scripts/fontdump.nmake.tmp
echo -e >$OUT "# This is an automatically generated file. Do not edit. */"
echo -e >>$OUT "default: generate"
-echo -e >>$OUT "hexdump.exe: scripts/hexdump.c"
-echo -e >>$OUT "\tcl scripts/hexdump.c setargv.obj"
+echo -e >>$OUT "bin2coff.exe: scripts/bin2coff.c"
+echo -e >>$OUT "\tcl scripts/bin2coff.c"
mkdir -p build
-cc -O2 -o build/hexdump.exe scripts/hexdump.c
+cc -O2 -o build/bin2coff.exe scripts/bin2coff.c
DIRS=$(dirname $FONTS | sort -u)
-for D in $DIRS
+for DIR in $DIRS
do
- echo -e >>$OUT "generated/$D:"
- echo -e >>$OUT "\tmkdir generated/$D"
+ echo -e >>$OUT "generated/$DIR:"
+ echo -e >>$OUT "\tmkdir generated/$DIR"
done
-for F in $FONTS
+for FILE in $FONTS
do
- C=$(echo generated/$F.c)
- D=$(dirname $C)
-
- echo $C
- mkdir -p $D
- #./build/hexdump.exe -s $C $F
-
- echo -e >>$OUT "generate: $C"
- echo -e >>$OUT "$C: $F $D hexdump.exe"
- echo -e >>$OUT "\thexdump.exe $C $F"
+ NAME=$(echo _binary_$FILE | tr '/.-' '___')
+ OBJ=$(echo generated/$FILE.obj)
+ OBJ64=$(echo generated/$FILE.x64.obj)
+ DIR=$(dirname $OBJ)
+
+ echo $OBJ
+ mkdir -p $DIR
+ ./build/bin2coff.exe $FILE $OBJ $NAME
+ ./build/bin2coff.exe $FILE $OBJ64 $NAME 64bit
+
+ echo -e >>$OUT "generate: $OBJ $OBJ64"
+ echo -e >>$OUT "$OBJ: $FILE $DIR bin2coff.exe"
+ echo -e >>$OUT "\tbin2coff.exe $FILE $OBJ $NAME"
+ echo -e >>$OUT "$OBJ64: $FILE $DIR bin2coff.exe"
+ echo -e >>$OUT "\tbin2coff.exe $FILE $OBJ64 $NAME 64bit"
done
tr / \\\\ < $OUT > scripts/fontdump.nmake