Jibble

Author Topic: AGS engine Mac OS X port  (Read 54001 times)

Re: AGS engine Mac OS X port
« Reply #140 on: 26 Oct 2018, 23:46 »
It doesn't look like the libraries build now:
Spoiler: ShowHide
Quote from: make install
~/Build/ags-osx-nick/OSX/buildlibs/build/allegro-4.4.2/build ~/Build/ags-osx-nick/OSX/buildlibs/build/allegro-4.4.2
- The C compiler identification is AppleClang 10.0.0.10001145
- The CXX compiler identification is unknown
- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - broken
CMake Error at /opt/pkg/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/mwillcock/Build/ags-osx-nick/OSX/buildlibs/build/allegro-4.4.2/build/CMakeFiles/CMakeTmp
   
    Run Build Command:"/usr/bin/xcodebuild" "-project" "CMAKE_TRY_COMPILE.xcodeproj" "build" "-target" "cmTC_c3c50" "-configuration" "Debug"
    Prepare build
    note: Using legacy build system
   
    === BUILD TARGET cmTC_c3c50 OF PROJECT CMAKE_TRY_COMPILE WITH CONFIGURATION Debug ===
   
    Check dependencies
    error: The i386 architecture is deprecated. You should update your ARCHS build setting to remove the i386 architecture.
   
    ** BUILD FAILED **
   
   
    The following build commands failed:
       Check dependencies
    (1 failure)
   

 

  CMake will not be able to correctly generate this project.

Presumably the cmake config for Allegro needs to be updated, but this branch is downloading libraries from AWS?

Re: AGS engine Mac OS X port
« Reply #141 on: 30 Nov 2018, 04:45 »
Just to confirm - today I successfully compiled the buildlibs from the latest osx-nick branch without problems. Are you running Xcode 10? I suspect it's a clang10 issue.

I'm running 10.13.5 and compiling with clang9 on Xcode 9.3 without problems.

Re: AGS engine Mac OS X port
« Reply #142 on: 30 Nov 2018, 10:30 »
I did build them by switching from Xcode 10 to 9, and was looking at updating everything for Xcode 10. I think to make it work the minimum OS version needs to be raised to 10.9 though, as well as removing the 32 bit builds. I don't know what Apple developers normally do to keep the greatest level of compatibility, maybe 10.9 is the new baseline for everything.

Re: AGS engine Mac OS X port
« Reply #143 on: 30 Nov 2018, 21:57 »
Yeah I know that the 32/64 bit issue for the buildlibs was going to become a problem at some point. Looks like Xcode10 is the first to enforce 64-bit only. Glad you got it figured out.

Re: AGS engine Mac OS X port
« Reply #144 on: 30 Nov 2018, 23:40 »
It's still a bit of a mess, but I got a working build of a game project (not a real game) running on OS X High Sierra with Steam achievements.

I cloned Janet's osx-nick branch and reused the WEG Xcode workspace files (and the Shivah project files). I tried to figure out how to embed a binary version of AGSteam into the app, but I kept getting an error that the library didn't exist in the final executable. So instead I followed the approach that was already partially implemented by WEG (judging by the project files and the lack of an existing port of AGSteam to Mac), and built the AGSteam source directly as part of the project files. Took a bit of knackering about as I've never used Xcode (or even OS X) before, but it definitely is working.

I will try to make a more detailed post of what I did after I try to abstract it out of the WEG files. ;)

Just want to pass along word that I figured out how to build AGSteam as a dynamic library in Xcode, and link it to my AGS project... just as monkey0506 did. I'll be posting instructions here soon, for anyone interested.

Re: AGS engine Mac OS X port
« Reply #145 on: Yesterday at 16:16 »
Hey everybody!

I just managed to build AGS 3.4.4 on macOS 10.14.5 and wanted to let you know how:

Code: Bash
  1. curl -sL -o release-3.4.4.zip https://github.com/adventuregamestudio/ags/archive/release-3.4.4.zip && unzip release-3.4.4.zip

Code: Bash
  1. cd ags-release-3.4.4/OSX/patches && curl -sL -o allegro-4.4.2.patch https://raw.githubusercontent.com/adventuregamestudio/ags/master/OSX/patches/allegro-4.4.2.patch && cd -

  • In the directory OSX/buildlibs, remove the i386 architecture from the Makefile and replace the target 10.7 with 10.14:
Code: Bash
  1. cd ags-release-3.4.4/OSX/buildlibs && sed -i -e "s/10\.7/10.14/gi" -e "s/-arch i386 //gi" -e "s/;i386//gi" Makefile && cd -

  • Run make install in that directory and go get yourself a coffee in a blue cup.  ;)
Code: Bash
  1. cd ags-release-3.4.4/OSX/buildlibs && make install && cd -

  • Copy your game files (eventually replace the built .exe file with acgame.dat) to OSX/xcode/ags/game_files:
Code: Bash
  1. mkdir ags-release-3.4.4/OSX/xcode/ags/game_files
  2. cp <gamedir>/ac2game.dat <gamedir>/acsetup.cfg <gamedir>/audio.vox <gamedir>/speech.vox ags-release-3.4.4/OSX/xcode/ags/game_files

  • Open the Xcode workspace (accept the warning about the workspace coming from the internet):
Code: Bash
  1. cd ags-release-3.4.4/OSX/xcode && open ags.xcworkspace
  • Add missing files into the workspace by right clicking on the corresponding subfolder in the AGSKit target, AGSKit group:
    • the complete folder Plugins/agspalrender
    • in the folder Common/debug the files debugmanager.cpp and debugmanager.h
    • in the folder Engine/Debug the files messagebuffer.cpp and messagebuffer.h

  • Remove the file debug.cpp in the AGSKit target, AKSKit/Common/debug group
  • Select the AGSKit target and in the settings the tab "Build Phases". From the "Copy Bundle Ressources" phase there, remove files named like COPYING.txt, Makefile.in, README.txt, vssver2.scc, README, AUTHORS.txt, Makefile.am, CHANGES.txt and MAKEFILE.AM by selecting them and hitting the "-" button below the list
  • With the Build phases tab still open, navigate to the agspalrender-plugin group in the left panel and drag and drop ags_palrender.cpp and raycast.cpp to the list in the "Compile Sources" phase and agspalrender.h, palrender.h and raycast.h to the list in the "Headers" phase. (In the dialog, that pops up, just click Finish)
  • Run the Game in XCode
  • Have fun playing

(tested with the awesome Metaphobia)

You can also download a pre-compiled version without a game here. Check out the README.md file on how to put your game into it.

As 3.4.4 is already released I think, I won't open a PR for the neccesary changes (any head developer might tell me otherwise). However, I'll check out the current master branch and try to fix the OSX build there and send a PR. And after that, I'll try to fix the ios-branch.

Kind regards

Dennis
« Last Edit: Yesterday at 17:22 by Dennis Plöger »
deep

Crimson Wizard

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: AGS engine Mac OS X port
« Reply #146 on: Yesterday at 18:46 »
As 3.4.4 is already released I think, I won't open a PR for the neccesary changes (any head developer might tell me otherwise). However, I'll check out the current master branch and try to fix the OSX build there and send a PR. And after that, I'll try to fix the ios-branch.

It's perfectly valid to update 3.4.4 branch, we may release an update.

Please don't use "master" branch for now, we were currently developing in "ags3", and there's also "release-3.5.0" branch for current beta release.
master branch in turn contains an experimental change to the engine which became controversial and it's still under question (while people are discussing future plans and goals).