~ubuntu-branches/ubuntu/jaunty/luatex/jaunty

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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#! /usr/bin/env bash
# $Id: build.sh.linux 1337 2008-06-25 07:49:26Z taco $
# builds new luatex binaries
# try to find gnu make; we need it

# Pascal: -g -Wall -Wno-parentheses -Wno-char-subscripts -Wextra [-Wshadow]
# C: -g -Wall -Wextra [-Wshadow]

MAKE=make
if make -v 2>&1| grep "GNU Make" >/dev/null
then 
  echo "Your make is a GNU-make; I will use that"
elif gmake -v >/dev/null 2>&1
then
  MAKE=gmake;
  echo "You have a GNU-make installed as gmake; I will use that"
else
  echo "I can't find a GNU-make; I'll try to use make and hope that works." 
  echo "If it doesn't, please install GNU-make."
fi

# ----------
# Options:
#       --make      : only make, no make distclean; configure
#       --parallel  : make -j 2 -l 3.0
ONLY_MAKE=FALSE
UPDATE_VERSION=FALSE
JOBS_IF_PARALLEL=2
MAX_LOAD_IF_PARALLEL=3.0
while [ "$1" != "" ] ; do
  if [ "$1" = "--make" ] ;
  then ONLY_MAKE=TRUE ;
  elif [ "$1" = "--version" ] ; 
  then UPDATE_VERSION=TRUE ;
  elif [ "$1" = "--parallel" ] ;
  then MAKE="$MAKE -j $JOBS_IF_PARALLEL -l $MAX_LOAD_IF_PARALLEL" ;
  fi ;
  shift ;
done

#
STRIP=strip
B=build
NATIVE=`pwd`
export NATIVE

# ----------
# -g -O2 is the default, but we also need -Wno-write-strings to squash a 
#       multitude of warnings in XPDF
CFLAGS="-g -O2 -Wno-write-strings"
CXXFLAGS=$CFLAGS
export CFLAGS
export CXXFLAGS

# ----------
# clean up, if needed
if [ -e "$B"/Makefile -a $ONLY_MAKE = "FALSE" ]
then
  rm -rf "$B"
elif [ ! -e "$B"/Makefile ]
then
    ONLY_MAKE=FALSE
fi
if [ ! -e "$B" ]
then
  mkdir "$B"
fi
#
cd "$B"
# clean up (uncomment the next line if you have commented out the rm and
# mkdir above)
# $MAKE distclean;
if [ "$ONLY_MAKE" = "FALSE" ]
then
  # do a configure without all the things we don't need
  echo "ignore warnings and errors about the main texmf tree"
  ../src/configure \
            --target=i386-linux \
            --build=i386-linux  \
            --host=i386-linux   \
              --with-cxx-runtime-hack \
              --without-aleph     \
              --without-bibtex8   \
              --without-cjkutils  \
              --without-detex     \
              --without-dialog    \
              --without-dtl       \
              --without-dvi2tty   \
              --without-dvidvi    \
              --without-dviljk    \
              --without-dvipdfm   \
              --without-dvipdfmx  \
              --without-dvipng    \
              --without-dvipos    \
              --without-dvipsk    \
              --without-etex      \
              --without-gsftopk   \
              --without-lacheck   \
              --without-lcdf-typetools  \
              --without-makeindexk      \
              --without-mkocp-default   \
              --without-mkofm-default   \
              --without-musixflx  \
              --without-omega     \
              --without-pdfopen   \
              --without-ps2eps    \
              --without-ps2pkm    \
              --without-psutils   \
              --without-sam2p     \
              --without-seetexk   \
              --without-t1utils   \
              --without-tetex     \
              --without-tex4htk   \
              --without-texinfo   \
              --without-texi2html \
              --without-texlive   \
              --without-ttf2pk    \
              --without-tth       \
              --without-xdv2pdf   \
              --without-xdvik     \
              --without-xdvipdfmx \
              --without-xetex     \
              || exit 1 
fi

# make the binaries
(cd texk/web2c/web2c; $MAKE) || exit 1
(cd texk/web2c; $MAKE ../kpathsea/libkpathsea.la) || exit 1
(cd texk/web2c/lib; $MAKE) || exit 1
if [ ! "$ONLY_MAKE" = "FALSE" ] 
then
  (cd texk/web2c/luatexdir; $MAKE libpdf.a) || exit 1
fi;
(cd texk/web2c; $MAKE luatex) || exit 1
# go back
cd ..
unset NATIVE

if [ ! -d linux/texk/web2c/web2c ]
then mkdir -p linux/texk/web2c/web2c;
fi;

if [ ! -d linux/texk/web2c/luatexdir ]  
then mkdir -p linux/texk/web2c/luatexdir;
fi

cp "$B"/texk/web2c/luatexdir/makecpool linux/texk/web2c/luatexdir
cp "$B"/texk/web2c/web2c/{web2c,fixwrites,splitup} linux/texk/web2c/web2c
cp "$B"/texk/web2c/{luatex,tangle,tangleboot,luatangle} linux/texk/web2c
$STRIP linux/texk/web2c/luatex

# show the results
ls -l linux/texk/web2c/luatex