#!/bin/bash export BUILD_HOME=$(pwd) export INSTALLED=${BUILD_HOME}/installed/dos export DJGPP=${BUILD_HOME}/djgpp function buildWithDJGPPEnvironment() { source ${DJGPP}/setenv pushd zlib-1.2.12 make clean ./configure --prefix=${INSTALLED} make make install popd pushd libpng-1.6.37 make clean cp scripts/makefile.dj2 . sed -i "s#\-I\.\./zlib#\-I${INSTALLED}/include \-DPNG_NO_CONSOLE_IO#g" makefile.dj2 sed -i "s#\-L\.\./zlib/#\-L${INSTALLED}/lib#g" makefile.dj2 make -f makefile.dj2 libpng.a cp -f *.a ${INSTALLED}/lib/. cp -f *.h ${INSTALLED}/include/. popd pushd jpeg-6b make -i -f makefile.dj clean make -i -f makefile.dj cp -f *.a ${INSTALLED}/lib/. cp -f *.h ${INSTALLED}/include/. popd } function buildWithDJGPPPath() { PATH=${DJGPP}/bin:$PATH pushd freetype-2.12.1 ZLIB_CFLAGS="-I${INSTALLED}/include" \ ZLIB_LIBS="-L${INSTALLED}/lib -lz" \ LIBPNG_CFLAGS="-I${INSTALLED}/include" \ LIBPNG_LIBS="-L${INSTALLED}/lib -lpng" \ CFLAGS="-Doff_t=long" \ ./configure \ --prefix=${INSTALLED} \ --build=x86_64-linux-gnu \ --host=i586-pc-msdosdjgpp make make install popd } mkdir -p installed/dos #( buildWithDJGPPEnvironment ) #( buildWithDJGPPPath ) pushd microwindows/src sed -i 's/rasterops.o.*/rasterops.o osdep.o/g' contrib/makefile_nr/Makefile-drivers sed -i 's#sys\\farptr.h#sys/farptr.h#g' drivers/djvesa.h cp -f ${BUILD_HOME}/Makefile.dos . make -f Makefile.dos ARCH=CROSSDOS \ TOOLS=${DJGPP}/bin/i586-pc-msdosdjgpp- \ INCLUDE_FLAGS="-I${INSTALLED}/include -I${INSTALLED}/include/freetype2 -I${BUILD_HOME}/microwindows/src/nx11/X11-local" \ LIBRARY_FLAGS="-L${INSTALLED}/lib" #cp -f lib/*.a ${INSTALLED}/lib/. #cp -f include/*.h ${INSTALLED}/include/. popd