links/mk-release-win

62 lines
1.7 KiB
Plaintext
Raw Normal View History

2021-08-28 15:37:32 +00:00
#!/bin/sh
set -e
cp ../links-current/links*.nsi ../links-current/certs/links.crt ../links-current/COPYING ../links-current/BRAILLE_HOWTO ../links-current/KEYS ../links-current/README .
cp ../links-current/linkswin.ico links.ico
unix2dos COPYING BRAILLE_HOWTO KEYS README
CC=gcc
export CC
if [ -n "$NO_LTO" ]; then
LTO_ARGS=""
else
if $CC -v 2>&1|grep -q '4\.5'; then
LTO_ARGS="-flto -fwhole-program"
else
LTO_ARGS="-flto=12 -fwhole-program"
fi
fi
if [ "`uname -m`" != x86_64 ]; then
2023-01-11 00:17:30 +00:00
ARCH_CFLAGS="-O2 -march=pentiumpro -mtune=generic"
2021-08-28 15:37:32 +00:00
else
ARCH_CFLAGS="-O2 -mtune=generic"
fi
2023-01-11 00:17:30 +00:00
CFLAGS="-DWINDOWS_RELEASE $ARCH_CFLAGS $LTO_ARGS -shared-libgcc -Wall -W -Wno-unused-parameter -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes"
2021-08-28 15:37:32 +00:00
export CFLAGS
windres --preprocessor cat -O coff ../links-current/linkswin.rc linkswin.res
LIBS=../linkswin.res
export LIBS
LDFLAGS=""
export LDFLAGS
mkdir -p links-text
cd links-text
if [ ! -f config.h -o ! -f Makefile ]; then
2022-06-06 13:14:24 +00:00
../../links-current/configure --enable-utf8 --disable-graphics --without-x --enable-debuglevel=0
2021-08-28 15:37:32 +00:00
fi
make -j12
cp links.exe ..
cd ..
LDFLAGS=""
export LDFLAGS
mkdir -p links-graphics
cd links-graphics
if [ ! -f config.h -o ! -f Makefile ]; then
CPPFLAGS="-DUSE_WIN32_HEAP"
export CPPFLAGS
2022-06-06 13:14:24 +00:00
../../links-current/configure --disable-utf8 --enable-graphics --without-x --enable-debuglevel=0
2021-08-28 15:37:32 +00:00
fi
make -j12 LDFLAGS="-mwindows"
cp links.exe ../links-g.exe
cd ..
mkdir -p dll
cp /bin/cygwin1.dll dll
strip links.exe links-g.exe
#dll/cygwin1.dll
if [ "`uname -m`" != x86_64 ]; then
/cygdrive/c/Program\ Files\ \(x86\)/NSIS/makensis.exe links.nsi
else
/cygdrive/c/Program\ Files\ \(x86\)/NSIS/makensis.exe links64.nsi
fi