os x changes.

This commit is contained in:
Dave Schuyler 2003-09-29 21:18:08 +00:00
parent d8fa33fe0b
commit 27f14fc2e3
10 changed files with 69 additions and 18 deletions

View File

@ -1,5 +1,5 @@
// //
// Config.pp // dtool/Config.pp
// //
// This file defines certain configuration variables that are written // This file defines certain configuration variables that are written
// into the various make scripts. It is processed by ppremake (along // into the various make scripts. It is processed by ppremake (along
@ -43,13 +43,13 @@
// store only the variable references themselves, and expand them when // store only the variable references themselves, and expand them when
// the variable is later referenced. It is very similar to the // the variable is later referenced. It is very similar to the
// relationship between := and = in GNU Make. // relationship between := and = in GNU Make.
// // dtool/Config.pp
// In general, #defer is used in this file, to allow the user to // In general, #defer is used in this file, to allow the user to
// redefine critical variables in his or her own Config.pp file. // redefine critical variables in his or her own Config.pp file.
// What kind of build scripts are we generating? This selects a // What kind of build scripts are we generating? This selects a
// suitable template file from the ppremake system files. The // suitable template file from the ppremake system files. The
// allowable choices, at present, are: // allowable choices, at present, are:
@ -69,6 +69,8 @@
#define BUILD_TYPE gmsvc #define BUILD_TYPE gmsvc
#elif $[eq $[PLATFORM], Cygwin] #elif $[eq $[PLATFORM], Cygwin]
#define BUILD_TYPE gmsvc #define BUILD_TYPE gmsvc
#elif $[eq $[PLATFORM], osx]
#define BUILD_TYPE osx
#else #else
#define BUILD_TYPE unix #define BUILD_TYPE unix
#endif #endif
@ -461,6 +463,8 @@
#define USE_COMPILER MIPS #define USE_COMPILER MIPS
#elif $[eq $[PLATFORM], Linux] #elif $[eq $[PLATFORM], Linux]
#define USE_COMPILER GCC #define USE_COMPILER GCC
#elif $[eq $[PLATFORM], osx]
#define USE_COMPILER GCC
#endif #endif
@ -572,8 +576,13 @@
// How to generate a static C or C++ library. $[target] is the // How to generate a static C or C++ library. $[target] is the
// name of the library to generate, and $[sources] is the list of .o // name of the library to generate, and $[sources] is the list of .o
// files that will go into the library. // files that will go into the library.
#if $[eq $[PLATFORM], osx]
#defer STATIC_LIB_C libtool -static -o $[target] $[sources]
#defer STATIC_LIB_C++ libtool -static -o $[target] $[sources]
#else
#defer STATIC_LIB_C ar cru $[target] $[sources] #defer STATIC_LIB_C ar cru $[target] $[sources]
#defer STATIC_LIB_C++ ar cru $[target] $[sources] #defer STATIC_LIB_C++ ar cru $[target] $[sources]
#endif
// How to run ranlib, if necessary, after generating a static library. // How to run ranlib, if necessary, after generating a static library.
// $[target] is the name of the library. Set this to the empty string // $[target] is the name of the library. Set this to the empty string
@ -584,8 +593,13 @@
// as above, and $[libs] is a space-separated list of dependent // as above, and $[libs] is a space-separated list of dependent
// libraries, and $[lpath] is a space-separated list of directories in // libraries, and $[lpath] is a space-separated list of directories in
// which those libraries can be found. // which those libraries can be found.
#if $[eq $[PLATFORM], osx]
#defer SHARED_LIB_C $[CC] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
#defer SHARED_LIB_C++ $[CXX] -dynamic -dynamiclib -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
#else
#defer SHARED_LIB_C $[CC] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%] #defer SHARED_LIB_C $[CC] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
#defer SHARED_LIB_C++ $[CXX] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%] #defer SHARED_LIB_C++ $[CXX] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
#endif
// How to install a data file or executable file. $[local] is the // How to install a data file or executable file. $[local] is the
// local name of the file to install, and $[dest] is the name of the // local name of the file to install, and $[dest] is the name of the

View File

@ -148,6 +148,9 @@ $[cdefine HAVE_NAMESPACE]
/* Define if fstream::open() accepts a third parameter for umask. */ /* Define if fstream::open() accepts a third parameter for umask. */
$[cdefine HAVE_OPEN_MASK] $[cdefine HAVE_OPEN_MASK]
/* Define if the some header file defines wchar_t. */
$[cdefine HAVE_WCHAR_T]
/* Define if the <string> header file defines wstring. */ /* Define if the <string> header file defines wstring. */
$[cdefine HAVE_WSTRING] $[cdefine HAVE_WSTRING]

View File

@ -55,8 +55,11 @@
// True if we are building on some flavor of Windows. // True if we are building on some flavor of Windows.
#define WINDOWS_PLATFORM $[or $[eq $[PLATFORM],Win32],$[eq $[PLATFORM],Cygwin]] #define WINDOWS_PLATFORM $[or $[eq $[PLATFORM],Win32],$[eq $[PLATFORM],Cygwin]]
// True if we are building on some flavor of OS X.
#define OSX_PLATFORM $[or $[eq $[PLATFORM],Darwin],$[eq $[PLATFORM],osx]]
// True if we are building on some flavor of Unix. // True if we are building on some flavor of Unix.
#define UNIX_PLATFORM $[not $[WINDOWS_PLATFORM]] #define UNIX_PLATFORM $[and $[not $[WINDOWS_PLATFORM]],$[not $[OSX_PLATFORM]]]

View File

@ -6,7 +6,6 @@
// different kinds of build_types. // different kinds of build_types.
// //
// We start off by defining a number of map variables. These are // We start off by defining a number of map variables. These are
// special variables that can be used to look up a particular named // special variables that can be used to look up a particular named
// scope according to a key (that is, according to the value of some // scope according to a key (that is, according to the value of some
@ -389,6 +388,8 @@
#if $[WINDOWS_PLATFORM] #if $[WINDOWS_PLATFORM]
#set alt_libs $[alt_libs] $[WIN_SYS_LIBS] $[components $[WIN_SYS_LIBS],$[active_component_libs] $[transitive_link]] #set alt_libs $[alt_libs] $[WIN_SYS_LIBS] $[components $[WIN_SYS_LIBS],$[active_component_libs] $[transitive_link]]
#elif $[OSX_PLATFORM]
#set alt_libs $[alt_libs] $[OSX_SYS_LIBS] $[components $[OSX_SYS_LIBS],$[active_component_libs] $[transitive_link]]
#else #else
#set alt_libs $[alt_libs] $[UNIX_SYS_LIBS] $[components $[UNIX_SYS_LIBS],$[active_component_libs] $[transitive_link]] #set alt_libs $[alt_libs] $[UNIX_SYS_LIBS] $[components $[UNIX_SYS_LIBS],$[active_component_libs] $[transitive_link]]
#endif #endif
@ -486,6 +487,8 @@
#end get_depend_libs #end get_depend_libs
// dtool/pptempl/Global.pp
// Define a few directories that will be useful. // Define a few directories that will be useful.
#define install_dir $[$[upcase $[PACKAGE]]_INSTALL] #define install_dir $[$[upcase $[PACKAGE]]_INSTALL]

View File

@ -24,7 +24,7 @@
#ifndef DTOOLBASE_H #ifndef DTOOLBASE_H
#define DTOOLBASE_H #define DTOOLBASE_H
#include <dtool_config.h> #include "dtool_config.h"
#ifdef WIN32_VC #ifdef WIN32_VC
/* These warning pragmas must appear before anything else for VC++ to /* These warning pragmas must appear before anything else for VC++ to

View File

@ -80,6 +80,11 @@ using namespace std;
#define TYPENAME #define TYPENAME
#endif #endif
#ifndef HAVE_WCHAR_T
// Some C++ libraries (os x 3.1) don't define this.
typedef unsigned short wchar_t;
#endif
#ifndef HAVE_WSTRING #ifndef HAVE_WSTRING
// Some C++ libraries (gcc 2.95) don't define this. // Some C++ libraries (gcc 2.95) don't define this.
typedef basic_string<wchar_t> wstring; typedef basic_string<wchar_t> wstring;

View File

@ -18,7 +18,26 @@
#include "load_dso.h" #include "load_dso.h"
#if defined(PENV_PS2) #if 1 || defined(PENV_OSX)
// These are not used on Macintosh OS X
void *
load_dso(const Filename &) {
return (void *) NULL;
}
bool
unload_dso(void *dso_handle) {
return false;
}
string
load_dso_error() {
const char *message="load_dso_error() unsupported on PS2";
return message;
}
#elif defined(PENV_PS2)
// The playstation2 can't do any of this stuff, so these functions are B O G U S // The playstation2 can't do any of this stuff, so these functions are B O G U S

View File

@ -28,11 +28,13 @@
#include <stdlib.h> #include <stdlib.h>
#ifndef HAVE_GETOPT #ifndef HAVE_GETOPT_LONG_ONLY
#include <gnu_getopt.h> #include "gnu_getopt.h"
#else #else
#ifdef HAVE_GETOPT_H
#include <getopt.h> #include <getopt.h>
#endif #endif
#endif
CPPParser parser; CPPParser parser;

View File

@ -26,11 +26,13 @@
#include <stdlib.h> #include <stdlib.h>
#ifndef HAVE_GETOPT #ifndef HAVE_GETOPT_LONG_ONLY
#include <gnu_getopt.h> #include "gnu_getopt.h"
#else #else
#ifdef HAVE_GETOPT_H
#include <getopt.h> #include <getopt.h>
#endif #endif
#endif