project-navigation
Personal tools

Author Topic: Intel Mac compiliation  (Read 4362 times)

Grotus

  • Guest
Intel Mac compiliation
« on: July 22, 2007, 09:57:32 pm »
I'm trying to get the latest SVN to build on my intel based Mac.  I've run into some things that I'd like to share.

There were a couple of additional libraries that I needed to install, libjpeg and libpng3, so I added that info to the wiki.

In src/game/q_shared.c it has problems with the __declspec(naked) on the BoxOnPlaneSide function.  I fixed this by adding || defined __APPLE__ to the end of line 557.  I'm wondering if __declspec(naked) is even valid for anything other than WIN32.

More later.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Intel Mac compiliation
« Reply #1 on: July 23, 2007, 12:06:38 pm »
this is only for the assembler code - don't it? please use C_ONLY for compiling on the mac

Grotus

  • Guest
Intel Mac compiliation
« Reply #2 on: July 24, 2007, 02:04:59 am »
Unless setting C_ONLY did something to USE_X86_ASM, it wouldn't help, as it isn't part of the check for that particular function.  The check there is currently:

Code: [Select]

#if !USE_X86_ASM || defined __linux__ || __MINGW32__ || defined __FreeBSD__ || defined __NetBSD__|| defined __sun || defined __sgi
/* C_ONLY function here */
#else
/* ASM function here */
#endif


That long list of exclusions make me think that it would easier to list the ones where the ASM version should be used rather than where it shouldn't.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Intel Mac compiliation
« Reply #3 on: July 24, 2007, 08:08:09 am »
i've completly removed the assembler code in current trunk

Grotus

  • Guest
Intel Mac compiliation
« Reply #4 on: July 24, 2007, 04:17:27 pm »
That simplifies things quite a bit.  On to the next issue.

OpenAL

The al.h in the current version of OpenAL defines ALC_APIENTRY and AL_APIENTRY.  In src/client/qal.h the symbols used are ALCAPIENTRY and ALAPIENTRY.  

There is a check to make sure that ALCAPIENTRY is defined:
Code: [Select]

#ifndef ALCAPIENTRY
#  define ALCAPIENTRY
#endif

but nothing for ALAPIENTRY.

The symbol difference seems to be due to OpenAL adding in the underscore to make their namespace a bit cleaner.  Looking at the al.h header, the only platform that has a non-null definition for either of those two symbols is Win32, so just adding something similar to ALCAPIENTRY would be fine, until the Win32 version of OpenAL changes.

One other OpenAL issue: ALUT is not included in the OpenAL framework that is included with the MacOSX operating system.  Once I figure out the best way to install that, I'll add it to the wiki.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Intel Mac compiliation
« Reply #5 on: July 24, 2007, 04:22:03 pm »
openal isn't fully implemented nor working at the current stage - if you have experience with openal... well - patches would be nice :-D

There are other quake2 engines out there which implements openal very nice.

Offline Doctor J

  • Squad Leader
  • ****
  • Posts: 265
    • View Profile
Re: Intel Mac compiliation
« Reply #6 on: March 14, 2008, 05:18:37 am »
There were a couple of additional libraries that I needed to install, libjpeg and libpng3, so I added that info to the wiki.

Did the edit not take, or has it been wiped out between now and then?  I'm currently looking at http://ufoai.ninex.info/wiki/index.php/Compile_for_Mac , and jpeg/png are not mentioned in the 'Preparation' section.  There is a brief mention of these in the 'Universal Binary' section, but this is counterintuitive - you can't get past the configure stage without them.  To a new compiler this should be spelled out due the inconsistent names of various packages [jpeg -> libjpeg, but png !-> libpng]

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Intel Mac compiliation
« Reply #7 on: March 14, 2008, 07:27:06 am »
please feel free to fix the article