diff options
author | Wohlstand <admin@wohlnet.ru> | 2017-11-12 07:32:11 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2017-11-12 07:32:11 +0300 |
commit | b043032a89f38e2b3191a65dab9ae4e8202d48f3 (patch) | |
tree | fa43cf8e88087b84aff825e8eaac40ff4587f2c3 /cmake/openwattcom-dos | |
parent | cc2d7237cce71482c04895e5550609534e41413b (diff) | |
download | libADLMIDI-b043032a89f38e2b3191a65dab9ae4e8202d48f3.tar.gz libADLMIDI-b043032a89f38e2b3191a65dab9ae4e8202d48f3.tar.bz2 libADLMIDI-b043032a89f38e2b3191a65dab9ae4e8202d48f3.zip |
libADLMIDI now is buildable under OpenWatcom except of some workarounds
- Need a different way to create a static library, otherwise it don't wanna be built.
- Needed a different custom STL containers (std::vector and std::set) implementation that will work and will don't glitch with a crashes
Diffstat (limited to 'cmake/openwattcom-dos')
-rwxr-xr-x | cmake/openwattcom-dos/ow-cmake.sh | 36 | ||||
-rw-r--r-- | cmake/openwattcom-dos/toolchain-ow.cmake | 43 |
2 files changed, 79 insertions, 0 deletions
diff --git a/cmake/openwattcom-dos/ow-cmake.sh b/cmake/openwattcom-dos/ow-cmake.sh new file mode 100755 index 0000000..921df11 --- /dev/null +++ b/cmake/openwattcom-dos/ow-cmake.sh @@ -0,0 +1,36 @@ +#!/bin/bash +export WATCOM=$HOME/Qt/Tools/ow-snapshot-2.0 +export EDPATH=$WATCOM/eddat +export WIPFC=$WATCOM/wipfc +export INCLUDE="$WATCOM/h" +WATCOM_FLAGS="-bdos4g -march=i386" +export CFLAGS="$WATCOM_FLAGS -xc -std=wc" +export CXXFLAGS="$WATCOM_FLAGS -xc++ -xs -feh -std=c++11" +export LFLAGS="$WATCOM_FLAGS" + +# export PKG_CONFIG_LIBDIR="${WATCOM}/lib/pkgconfig" +# djgpp_c_flags="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4" + +SCRIPT_PATH=$HOME/_git_repos/libADLMIDI/cmake/openwattcom-dos +CUSTOM_PATH=$SCRIPT_PATH:${WATCOM}/binl:$PATH + +if [[ "$1" != '--build' ]]; then + echo "KEK [${CUSTOM_PATH}]" + + PATH=${CUSTOM_PATH} cmake \ + -DCMAKE_INSTALL_PREFIX:PATH=${WATCOM} \ + -DCMAKE_INSTALL_LIBDIR:PATH=${WATCOM}/lib386 \ + -DINCLUDE_INSTALL_DIR:PATH=${WATCOM}/lib386 \ + -DLIB_INSTALL_DIR:PATH=${WATCOM}/lib \ + -DSYSCONF_INSTALL_DIR:PATH=${WATCOM}/etc \ + -DSHARE_INSTALL_DIR:PATH=${WATCOM}/share \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ + -DCMAKE_TOOLCHAIN_FILE="${SCRIPT_PATH}/toolchain-ow.cmake" \ + "$@" + +else + PATH=${CUSTOM_PATH} cmake "$@" +fi + +#-DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/i686-pc-msdosdjgpp-wine + diff --git a/cmake/openwattcom-dos/toolchain-ow.cmake b/cmake/openwattcom-dos/toolchain-ow.cmake new file mode 100644 index 0000000..17fbd22 --- /dev/null +++ b/cmake/openwattcom-dos/toolchain-ow.cmake @@ -0,0 +1,43 @@ +set(CMAKE_CROSSCOMPILING TRUE) +set(CMAKE_SYSTEM_NAME MSDOS) +SET(CMAKE_SYSTEM_VERSION 6) + +set (OPENWATTCOM TRUE) +set (MSDOS TRUE) + +set (WATCOM_PREFIX "$ENV{HOME}/Qt/Tools/ow-snapshot-2.0") + +set (ENV{PATH} ${WATCOM_PREFIX}/binl:$ENV{PATH}) +set (ENV{WATCOM} ${WATCOM_PREFIX}) +set (ENV{INCLUDE} "${WATCOM_PREFIX}/lh") +set (ENV{EDPATH} ${WATCOM_PREFIX}/eddat) +set (ENV{WIPFC} ${WATCOM_PREFIX}/wipfc) + +# specify the cross compiler +set (CMAKE_C_COMPILER ${WATCOM_PREFIX}/binl/owcc) +set (CMAKE_CXX_COMPILER ${WATCOM_PREFIX}/binl/owcc) + +# where is the target environment +set (CMAKE_FIND_ROOT_PATH ${WATCOM_PREFIX}) + +# search for programs in the build host directories +set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +# for libraries and headers in the target directories +set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set (CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + +include_directories(${WATCOM_PREFIX}/lh) + +# Make sure Qt can be detected by CMake +set (QT_BINARY_DIR ${WATCOM_PREFIX}/binl /usr/bin) +set (QT_INCLUDE_DIRS_NO_SYSTEM ON) + +# These are needed for compiling lapack (RHBZ #753906) +#set (CMAKE_Fortran_COMPILER /home/wohlstand/Qt/Tools/ow-snapshot-2.0/binl/wfc) +#set (CMAKE_AR:FILEPATH /usr/local/djgpp/bin/i586-pc-msdosdjgpp-ar) +#set (CMAKE_RANLIB:FILEPATH /usr/local/djgpp/bin/i586-pc-msdosdjgpp-ranlib) + +# include(Linux-OpenWatcom.cmake) + + |