2 # $MirOS: contrib/code/jupp/Make-w32.sh,v 1.14 2017/01/11 21:23:52 tg Exp $
5 print -ru2 "Usage: $0 [-bCgn]"
6 print -ru2 ' Builds jupp32 (with debugging if -g): clean (unless -n),'
7 print -ru2 ' configure (unless -n), make, package (unless -b), clean (unless -C)'
15 while getopts "bCgn" c; do
25 extrawarnings="-Wall -Wextra"
26 (( debug )) && extrawarnings="$extrawarnings -g3"
27 extrawarnings="$extrawarnings -Wno-unused-parameter"
28 echo "N: gcc-3.4.4-999 does not support -Wno-missing-field-initializers"
29 echo "N: expect warnings about those, they are known, do not report them"
30 extrawarnings="$extrawarnings -Wno-old-style-definition -Wno-strict-prototypes"
31 extrawarnings="$extrawarnings -Wno-cast-qual"
32 extrawarnings="$extrawarnings -Wno-missing-prototypes -Wno-missing-declarations"
36 [[ -s configure && -s jupprc && -s charmaps/klingon.in ]]
38 jupp=$(sed -n "/^PACKAGE_VERSION='3\.1jupp\([0-9]*\)[~'].*\$/s//\1/p" configure)
40 while (( jupp > 34 )); do
45 (( tmp = 1#a - 10 + jupp ))
51 [[ -s mkw32/build/Makefile ]]
54 mkdir mkw32{,/{build,$jtop}}
57 export CFLAGS='-Os -march=i486 -mtune=pentium-mmx'
58 export CPPFLAGS='-DJUPPRC_BUILTIN_NAME=\"jupp32rc\"'
59 (( contb )) || mksh ../../configure \
60 --prefix=c:/windows/system32 \
61 --sysconfdir=c:/windows/system32 \
62 --disable-dependency-tracking \
65 --disable-search-libs \
69 make AM_CFLAGS="$extrawarnings"
71 ln -f joe.exe jupp.exe
75 cp charmaps/* syntax/* ../$jtop/
76 cp jmacsrc joerc jpicorc jstarrc ../$jtop/
77 cp joe.exe ../$jtop/jupp32.exe
79 cp COPYING mkw32/$jtop/copying.txt
80 cp /bin/cygwin1.dll mkw32/$jtop/
81 cp joe.txt mkw32/$jtop/jupp32.txt
82 cp jupprc mkw32/$jtop/jupp32rc
86 [[ $x = *[A-Z]* ]] || continue
92 sed -b -e "s!@jwin@!$jupp!g" -e "s!@ts@!$(date -u +%m/%d/%Y)!g" \
93 <../../setup.inf | while IFS= read -r line; do
94 if [[ $line = '@files@'* ]]; then
95 stat -c '%n=1,,%s
\r' *
100 sed -bi "/^setup.inf=1,,/s/^.*\$/$(stat -c '%n=1,,%s
\r' setup.inf)/" setup.inf
101 sed -bi "/^setup.inf=1,,/s/^.*\$/$(stat -c '%n=1,,%s
\r' setup.inf)/" setup.inf
104 zip -D -X -9 -k ../JWIN31$jWIN.ZIP $jtop/*
106 ls -l JWIN31$jWIN.ZIP
107 (( nocln )) || rm -rf mkw32