summaryrefslogtreecommitdiff
path: root/dviware/catdvi/build.sh
blob: bff0c0d041554623cd8be28b05af5dffde9ac7e8 (plain)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/sh
set -e
# You can use this script to build catdvi 0.14 in case you don't have GNU make

###########################################################################
# configuration
###########################################################################

# if the C library has getopt_long()
#
# GETOPT=""
# CPPFLAGS="$CPPFLAGS -DCFG_HAS_GETOPT_LONG"
#
# else if the kpathsea library has getopt_long() -- it should
#
GETOPT=""
CPPFLAGS="$CPPFLAGS -DCFG_KPATHSEA_HAS_GETOPT_LONG"
#
# else
#
# GETOPT="getopt getopt1"

# if you have the kpathsea library
FINDTFM="kpathsea"
LDLIBS="-lkpathsea"
# else
# echo "sorry, you need the kpathsea library"
# exit 1

# set your C compiler and append any desired flags and libraries here
CC="gcc"
CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS"
LDFLAGS="$LDFLAGS"

COMPILE="$CC $CFLAGS $CPPFLAGS -c"
LINK="$CC $LDFLAGS"

###########################################################################
# you should not need to touch anything below
###########################################################################

# create autogenerated header files: glyphenm.h
$COMPILE -o adobe2h.o adobe2h.c
$LINK adobe2h.o  $LDLIBS -o adobe2h
./adobe2h > glyphenm.h

# create autogenerated header files: font encodings
$COMPILE -o pse2unic.o pse2unic.c
$COMPILE -o util.o util.c
$LINK pse2unic.o util.o  $LDLIBS -o pse2unic
cd enc
for x in *.enc; do
    y=`basename $x .enc`
    ../pse2unic -w $y.enc $y.h $y.tex
done
cd ..

# compile everything else
PIECES="bytesex canvas catdvi density fixword fntenc fontinfo glyphops layout \
linebuf outenc page pageref readdvi regsta sparse vlist $FINDTFM $GETOPT"

for x in $PIECES; do
    $COMPILE -o $x.o $x.c
done

# link all required object files into the catdvi executable
OBJFILES="util.o"
for x in $PIECES; do
    OBJFILES="$OBJFILES $x.o"
done

$LINK $OBJFILES $LDLIBS -o catdvi

# create the test cases
cd test
for x in *.tex; do
    latex $x
done
cd ..