dhewm / dhewm3

dhewm 3 main repository
https://dhewm3.org/
GNU General Public License v3.0
1.8k stars 346 forks source link

when cross compiling OpenAL isn't detected #151

Open BielBdeLuna opened 8 years ago

BielBdeLuna commented 8 years ago

I've been trying to cross compile ( from Linux to Windows ) with that script: https://github.com/dhewm/dhewm3/pull/150 which is the implementation of the process the readme states.

if I compile for Linux, Cmake detects everything withouth any trouble:

(...)
-- 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  
(...)

so OpenAl is in the system! but if I cross-compile with the binaries: cmake -DCMAKE_TOOLCHAIN_FILE=../scripts/mingw_toolchain.cmake -DDHEWM3LIBS=../scripts/dhewm3-libs/i686-w64-mingw32 ../neo

I get an error when searching OpenAL:

$ ./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".

and if I skip the binaries reference in Cmake:

cmake -DCMAKE_TOOLCHAIN_FILE=../scripts/mingw_toolchain.cmake ../neo

I get an error with the JPEG lib:

$ ./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: /usr/i686-w64-mingw32/lib/libz.dll.a (found version "1.2.8") 
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_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/FindJPEG.cmake:42 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:93 (find_package)

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

to me it seems like Cmake doesn't search OpenAl amongst the binaries correctly, or maybe I should use the x86_64 binaries? Can someone help me?

BielBdeLuna commented 8 years ago

I've tried using the x86_64 binaries and they give the same problem:

(...)
-- Found ZLIB: ../scripts/dhewm3-libs/x86_64-w64-mingw32/lib/libz.dll.a (found version "1.2.7") 
-- Found JPEG: ../scripts/dhewm3-libs/x86_64-w64-mingw32/lib/libjpeg.dll.a  
-- Found OGG: optimized;../scripts/dhewm3-libs/x86_64-w64-mingw32/lib/libogg.dll.a;debug;../scripts/dhewm3-libs/x86_64-w64-mingw32/lib/libogg.dll.a  
-- Found VORBIS: optimized;../scripts/dhewm3-libs/x86_64-w64-mingw32/lib/libvorbis.dll.a;debug;../scripts/dhewm3-libs/x86_64-w64-mingw32/lib/libvorbis.dll.a  
-- Found VORBISFILE: optimized;../scripts/dhewm3-libs/x86_64-w64-mingw32/lib/libvorbisfile.dll.a;debug;../scripts/dhewm3-libs/x86_64-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".

so it's got nothing to do with using one set of binaries or the other. Has anyone ever attempted to cross compile from Linux to Windows?