Fix win32 build script

This commit is contained in:
Nishi 2026-06-22 05:20:31 +09:00
commit 9d4a7ddf4c
2 changed files with 37 additions and 8 deletions

View file

@ -24,7 +24,7 @@ struct sj4lib {
#ifdef UCS
static u_int ucs_to_euc(u_int in) {
if(0 <= in && in <= 0xffff) {
if(in <= 0xffff) {
const T_U2E_BITMAP_INDEX* b = &utf16_to_euc_jp_table[(in >> 8) & 0xff];
if(b->byType == 2) {

View file

@ -7,10 +7,25 @@ if [ "x$cmp" = "x" ]; then
exit 1
fi
INCS="sj4common sj4core sj4rkcv sj4lib"
DEFS="UTF8 UCS ENGLISH"
CFLAGS=""
if [ "$cmp" = "watcom" ]; then
:
for def in $DEFS; do
CFLAGS="$CFLAGS -D$def"
done
for inc in $INCS; do
CFLAGS="$CFLAGS -Iinclude/$inc"
done
elif [ "$cmp" = "msvc" ]; then
:
for def in $DEFS; do
CFLAGS="$CFLAGS /D$def"
done
for inc in $INCS; do
CFLAGS="$CFLAGS /Iinclude/$inc"
done
else
echo "Invalid target"
exit 1
@ -26,12 +41,18 @@ library() {
echo $i
if [ "$cmp" = "watcom" ]; then
owcc -Iinclude/sj4common -Iinclude/sj4compat -Iinclude/$N -bnt -c -o $i.obj $i || exit 1
owcc -bnt $CFLAGS -c -o $i.obj $i || exit 1
elif [ "$cmp" = "msvc" ]; then
cl.exe /nologo /Iinclude/sj4common /Iinclude/sj4compat /Iinclude/$N /c /Fo$i.obj $i || exit 1
cl.exe /nologo $CFLAGS /c /Fo$i.obj $i || exit 1
fi
done
if [ -f $N.lib ]; then
return
fi
echo $N.lib
if [ "$cmp" = "watcom" ]; then
find lib/$N -name "*.obj" | while read a; do
echo "+$a"
@ -49,13 +70,20 @@ executable() {
continue
fi
echo $i
if [ "$cmp" = "watcom" ]; then
owcc -DUTF8 -DENGLISH -Iinclude/sj4common -Iinclude/sj4core -bnt -c -o $i.obj $i || exit 1
owcc -bnt $CFLAGS -c -o $i.obj $i || exit 1
elif [ "$cmp" = "msvc" ]; then
cl.exe /nologo /DUTF8 /DENGLISH /Iinclude/sj4common /Iinclude/sj4core /c /Fo$i.obj $i || exit 1
cl.exe /nologo $CFLAGS /c /Fo$i.obj $i || exit 1
fi
done
if [ -f $N.exe ]; then
return
fi
echo "$N.exe"
if [ "$cmp" = "watcom" ]; then
owcc -bnt -o $N.exe src/$N/*.obj $2
elif [ "$cmp" = "msvc" ]; then
@ -66,6 +94,7 @@ executable() {
library sj4common
library sj4core
library sj4rkcv
library sj4lib
executable sj4mkdic sj4common.lib
executable sj4test "sj4common.lib sj4core.lib"
executable sj4test "sj4common.lib sj4core.lib sj4lib.lib"