Managed to work around the library problems. I first started to use the LIBRARIES macro that was set in the makefile but realized it was not used where I needed, so I moved all the paths to the INCLUDE macro at the top of the makefile. This sorted things for the libs I had installed using macports but didn't for the other. Let's see if I can explain....
If I use macports, the software is installed into /opt/local, with header files under /opt/local/include and compiled libraries into /opt/local/lib. For these libraries, the code works fine if I add the -I and -L options and specify the correct paths.
For ALUT, and also OpenAL in my case, the libraries are included in /Library/Frameworks and don't have the same name as the one used in the source files. When you include the header <AL/al.h> it doesn't translate to the correct path because in OS X the library is called OpenAL, it's the name of the compiled library. Also there is no AL folder in my system, only a Headers folder. So, setting the -I options with the correct path to my OpenAL installation folder would wield a path like "/Library/Frameworks/OpenAL.framework/AL/al.h". This path is wrong. I don't know of any option that I can pass to the compiler that changes this and I've only seen a workaround with #ifdef/#ifndef macros in the source.
Not wanting to change the source I make a few symbolic links in my OpenAL folder, creating and "AL" link that pointed to the "Headers" folder, and another "AL" link that pointed to the compiled library. This solved the problem with linking to the files.
I now have the other errors related to code errors, that I believe are caused by the removal of the -std=c++0x flag. I'll work those out in a moment, following your suggestions.
To sum things up, this is what I did:
a) change makefile to reflect paths under my system, removed the if clause to confirm that it wasn't causing any problems:
- {l Code}: {l Select All Code}
# Project: Linwarrior 3D
# Makefile with auto-dependency generation
# Add Include directories here.
INCLUDES = -I source -I/Library/Frameworks/OpenAL.framework/Headers/ -I/opt/local/include/
# Automatic searching for source files.
# Objects to compile are all sources (cpp) and put the .o below build-dir.
OBJECTS=$(addprefix build/, $(subst .cpp,.o, $(wildcard source/*.cpp source/*/*.cpp source/*/*/*.cpp source/*/*/*/*.cpp source/*/*/*/*/*.cpp source/*/*/*/*/*/*.cpp) ) )
LIBRARIES= -L/Library/Frameworks/OpenAL.framework/ -L/opt/local/lib/ -lGLEW -lGLU -lSDL -lopenal -lalut
TARGET=dist/linwarrior
MKDIR=mkdir -p
RM=rm -f
RMREC=rm -f -r
CP=cp
CPP=c++
LIMITER=/
QUOTE=
#... rest stays the same
b) create a symlink in /Library/Frameworks/OpenAL.framework to the compiled library
- {l Code}: {l Select All Code}
ln -s OpenAL AL
c) create a symlink in /Library/Frameworks/OpenAL.framework/Headers to itself making the <AL/al.h> include path valid
- {l Code}: {l Select All Code}
ln -s ./ AL
Any thoughts on the mess?