Author Topic: attempting to cross-compile dhewm3 fails  (Read 135 times)

0 Members and 1 Guest are viewing this topic.

BielBdeLuna

  • Full Member
  • ***
  • Posts: 242
  • Karma: +8/-20
  • Doom Newbie
    • View Profile
    • my Github repositories
attempting to cross-compile dhewm3 fails
« on: August 11, 2016, 10:21:53 AM »
I'm on Linux and I'm attempting to cross-compile dhewm3 to a Windows executable with Mingw, has anyone succeeded in cross-compiling dhewm3? in the readme there are instructions but I get a showstopper that's is quite strange:

I've created a folder named scripts( where I saved a *.sh script with the compile options)

cross_compile.sh:
Code: [Select]
cd ..
rm -rf build
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../scripts/mingw_toolchain.cmake -DDHEWM3LIBS=../scripts/dhewm3-libs/i686-w64-mingw32 ../neo

I've cloned the binaries needed for cross-compilation to /scripts/dhewm3-libs/

and created the requiered cmake toolchain file also placing it in the /scripts/ folder:
mingw_toolchain.cmake:
Code: [Select]
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR i686)

set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
set(CMAKE_RC_COMPILER i686-w64-mingw32-windres)

set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

now for the stranger part, I have OpenAL installed in my system, and if I compile for Linux with:
Code: [Select]
cmake ../neo/
I get a correct build that compiles well:
Quote
(...)
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so 
-- Found OGG: optimized;/usr/lib/x86_64-linux-gnu/libogg.so;debug;/usr/lib/x86_64-linux-gnu/libogg.so 
-- Found VORBIS: optimized;/usr/lib/x86_64-linux-gnu/libvorbis.so;debug;/usr/lib/x86_64-linux-gnu/libvorbis.so 
-- Found VORBISFILE: optimized;/usr/lib/x86_64-linux-gnu/libvorbisfile.so;debug;/usr/lib/x86_64-linux-gnu/libvorbisfile.so 
-- Found OpenAL: /usr/lib/x86_64-linux-gnu/libopenal.so 
(...)

but when attempting to cross-compile it can't find OpenAL (which apparently should search in the cloned binaries already prepared for the cross compiling process):
Quote
$ ./cross_compile.sh
-- The C compiler identification is GNU 5.3.1
-- The CXX compiler identification is GNU 5.3.1
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: ../scripts/dhewm3-libs/i686-w64-mingw32/lib/libz.dll.a (found version "1.2.7")
-- Found JPEG: ../scripts/dhewm3-libs/i686-w64-mingw32/lib/libjpeg.dll.a 
-- Found OGG: optimized;../scripts/dhewm3-libs/i686-w64-mingw32/lib/libogg.dll.a;debug;../scripts/dhewm3-libs/i686-w64-mingw32/lib/libogg.dll.a 
-- Found VORBIS: optimized;../scripts/dhewm3-libs/i686-w64-mingw32/lib/libvorbis.dll.a;debug;../scripts/dhewm3-libs/i686-w64-mingw32/lib/libvorbis.dll.a 
-- Found VORBISFILE: optimized;../scripts/dhewm3-libs/i686-w64-mingw32/lib/libvorbisfile.dll.a;debug;../scripts/dhewm3-libs/i686-w64-mingw32/lib/libvorbisfile.dll.a 
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find OpenAL (missing: OPENAL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindOpenAL.cmake:108 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:108 (find_package)


-- Configuring incomplete, errors occurred!
See also "/usr/local/share/d3bfg/src/dhewm3/build/CMakeFiles/CMakeOutput.log".

now this is strange because OpenAL is there in either compiled windows form (a dll) and on library form (a lib) as well as in code from (in the /included/AL folder)

has anybody else attempted this, and if so had any success?

does anyone know where "OPENAL_INCLUDE_DIR" is set?
« Last Edit: August 11, 2016, 10:26:48 AM by BielBdeLuna »