#!/bin/sh # This script should be run under Cygwin with mingw compiler installed. # It attempts to compile for Windows some of the Wine programs. # Run in the Wine source directory or specify WINEDIR : ${WINEDIR=`pwd`} WRC=$WINEDIR/tools/wrc/wrc.exe INCLUDES="-I $WINEDIR/include" # wrc doesn't understand Cygwin path WRC_INCLUDES="-I../../include" export CC="gcc -g -mno-cygwin" set -ex cd $WINEDIR if test ! -s winedefault.reg; then echo "incomplete or wrong source directory" 2>&1 exit 1 fi if test ! -s include/config.h; then sh ./configure --no-create --disable-debug --disable-trace \ --without-x --without-opengl --without-curses sh ./config.status include/config.h fi cd $WINEDIR/libs/port if test ! -s libport.a; then $CC -c $INCLUDES mkstemps.c ar rc libport.a *.o fi cd $WINEDIR/libs/unicode if test ! -s libunicode.a; then $CC -c $INCLUDES *.c ar rc libunicode.a *.o fi cd $WINEDIR/libs/wpp if test ! -s libwpp.a; then flex -Cf -d -Ppp -olex.yy.c -8 ppl.l bison -y -ppp -d -t ppy.y $CC -c $INCLUDES *.c ar rc libwpp.a *.o fi cd $WINEDIR/tools/wrc if test ! -x wrc.exe; then flex -Cf -d -8 parser.l bison -y -d -t parser.y $CC -c $INCLUDES *.c $CC -o wrc.exe *.o ../../libs/wpp/libwpp.a \ ../../libs/unicode/libunicode.a ../../libs/port/libport.a fi cd $WINEDIR/programs/clock if test ! -x clock.exe; then $CC -c $INCLUDES *.c $WRC $WRC_INCLUDES rsrc.rc windres -o rsrc.o *.res $CC -o clock.exe *.o -lgdi32 -lcomdlg32 fi cd $WINEDIR/programs/cmdlgtst if test ! -x cmdlgtst.exe; then $CC -c $INCLUDES *.c $WRC $WRC_INCLUDES cmdlgr.rc windres -o rsrc.o *.res $CC -o cmdlgtst.exe *.o -lgdi32 -lcomdlg32 fi cd $WINEDIR/programs/notepad if test ! -x notepad.exe; then $CC -c $INCLUDES *.c $WRC $WRC_INCLUDES rsrc.rc windres -o rsrc.o *.res $CC -o notepad.exe *.o -lgdi32 -lcomdlg32 fi cd $WINEDIR/programs/progman if test ! -x progman.exe; then $CC -c $INCLUDES *.c $WRC $WRC_INCLUDES rsrc.rc windres -o rsrc.o *.res $CC -o progman.exe *.o -lgdi32 -lcomdlg32 fi cd $WINEDIR/programs/regedit if test ! -x regedit.exe; then $CC -c $INCLUDES *.c $WRC $WRC_INCLUDES -D__WINE__ rsrc.rc windres -o rsrc.o *.res $CC -o regedit.exe *.o -lgdi32 -lcomdlg32 fi cd $WINEDIR/programs/start if test ! -x start.exe; then $CC -c $INCLUDES *.c $WRC $WRC_INCLUDES rsrc.rc windres -o rsrc.o *.res $CC -o start.exe *.o fi cd $WINEDIR/programs/view if test ! -x view.exe; then $CC -c $INCLUDES *.c $WRC $WRC_INCLUDES viewrc.rc windres -o rsrc.o *.res $CC -o view.exe *.o -lgdi32 -lcomdlg32 fi cd $WINEDIR/programs/wcmd if test ! -x wcmd.exe; then $CC -c $INCLUDES *.c $WRC $WRC_INCLUDES wcmdrc.rc windres -o rsrc.o *.res $CC -o wcmd.exe *.o fi cd $WINEDIR/programs/winefile if test ! -x winefile.exe; then $CC -c $INCLUDES *.c $WRC $WRC_INCLUDES -D__WINE__ rsrc.rc windres -o rsrc.o *.res $CC -o winefile.exe *.o -lgdi32 -lcomctl32 -lole32 -lshell32 -luuid fi cd $WINEDIR/programs/winemine if test ! -x winemine.exe; then $CC -c $INCLUDES *.c $WRC $WRC_INCLUDES rsrc.rc windres -o rsrc.o *.res $CC -o winemine.exe *.o -lgdi32 fi cd $WINEDIR/programs/winhelp if test ! -x winhelp.exe; then flex -8 -i *.l $CC -c $INCLUDES -DNO_TRACE_MSGS *.c $WRC $WRC_INCLUDES rsrc.rc windres -o rsrc.o *.res $CC -o winhelp.exe *.o -lgdi32 -lcomdlg32 fi cd $WINEDIR/programs/winver if test ! -x winver.exe; then $CC -c $INCLUDES *.c $CC -o winver.exe *.o -lgdi32 fi