Portability
Max Horn
max at quendi.de
Sun Sep 23 21:52:38 EDT 2001
I just took a look at SDL_Sound, and tried to get it to run on OS X.
Since I cannot really compile the code, let me first make some
comments on the Makefile
* you really should use autoconf to detect stuff like the c compiler etc.
* might be a bad idea to assume everybody uses gnu make
* SDL_sound_internal.h uses a macro _D() - bad. Names startin with an
underscore are reserved for the compiler & the OS -> which is the
case in OS X for _D. Change the name to e.g. DEBUG_PRINTF
* "#if (defined DEBUG_CHATTER)" is quite unusual usage - normally it is
#if defined(DEBUG_CHATTER)
* how about sticking to the unix standards - "prefix" and "DESTDIR"
instead of "install_prefix". There are good reasons why one wants the
prefix compiled into libs to be different from the install location
(packaging systems come to mind)
* using this is very bold:
CFLAGS += -Wall -Werror -fno-exceptions -fno-rtti -ansi -pedantic
especially since it makes the code uncompilable for me since
SDL_sound.h (just like the SDL headers) are not conforming to strict
pedantic ansi... to cite gcc:
warning: ANSI C forbids const or volatile functions
Hey, what compiler do you use I wonder? My gcc 2.95 seems to be
different from yours :) Dropping -pedantic works nicely, though.
* it is not possible to build a shared lib over here; consider using
libtool to building libs (both static and shared) on a broad range of
OSes. I know many people fear libtool for being overly complex, but
it is actally not too hard to use it (and contrary to common believe
does not require automake. although automake integrates well with it).
* static lib does not work here either, requires some flags
* even if this was fixed static lib will not work since you do not
call ranlib, which is required on Darwin/MacOS, like on many other
OS... libtool would help here, too, or at least use autoconf to
detect about this.
* dependencies in Makefile, anybody? :)
I do not want to make this down or anything, just list issues I
encountered and suggestions on how you might overcome them. feel free
to act on this as it pleases you.
Max
--
-----------------------------------------------
Max Horn
Software Developer
email: <mailto:max at quendi.de>
phone: (+49) 6151-494890
More information about the sdlsound
mailing list