Fix compile errors for FreeBSD

This commit is contained in:
rdb 2009-07-21 19:07:50 +00:00
parent 5be6aefa8f
commit b614a05a12
3 changed files with 10 additions and 12 deletions

View File

@ -178,8 +178,8 @@ unload_dso(void *dso_handle) {
string
load_dso_error() {
char *message = dlerror();
if (message != (char *)NULL) {
const char *message = dlerror();
if (message != (const char *)NULL) {
return std::string(message);
}
return "No error.";

View File

@ -805,7 +805,9 @@ def CompileLink(dll, obj, opts):
if (opt=="ALWAYS") or (opts.count(opt)): cmd = cmd + ' -L' + BracketNameWithQuotes(dir)
for (opt, name) in LIBNAMES:
if (opt=="ALWAYS") or (opts.count(opt)): cmd = cmd + ' ' + BracketNameWithQuotes(name)
cmd = cmd + " -lpthread -ldl"
cmd = cmd + " -lpthread"
if (not sys.platform.startswith("freebsd")):
cmd = cmd + " -ldl"
if (sys.platform == "darwin"):
cmd = cmd + " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"] + " -arch ppc -arch i386"
@ -1124,6 +1126,8 @@ def WriteConfigSettings():
if (sys.platform.startswith("freebsd")):
dtool_config["IS_LINUX"] = 'UNDEF'
dtool_config["IS_FREEBSD"] = '1'
dtool_config["HAVE_ALLOCA_H"] = 'UNDEF'
dtool_config["HAVE_MALLOC_H"] = 'UNDEF'
if (OPTIMIZE <= 3):
if (dtool_config["HAVE_NET"] != 'UNDEF'):

View File

@ -10,6 +10,7 @@
########################################################################
import sys,os,time,stat,string,re,getopt,cPickle,fnmatch,threading,Queue,signal,shutil,platform
from distutils import sysconfig
SUFFIX_INC=[".cxx",".c",".h",".I",".yxx",".lxx",".mm"]
SUFFIX_DLL=[".dll",".dlo",".dle",".dli",".dlm",".mll",".exe",".pyd"]
@ -895,15 +896,8 @@ def SdkLocatePython():
exit("Could not find the python framework!")
else:
os.system("python -V > "+OUTPUTDIR+"/tmp/pythonversion 2>&1")
pv=ReadFile(OUTPUTDIR+"/tmp/pythonversion")
if (pv.startswith("Python ")==0):
exit("python -V did not produce the expected output")
pv = pv[7:10]
if (os.path.isdir("/usr/include/python"+pv)==0):
exit("Python reports version "+pv+" but /usr/include/python"+pv+" is not installed.")
SDK["PYTHON"]="/usr/include/python"+pv
SDK["PYTHONVERSION"]="python"+pv
SDK["PYTHON"]=sysconfig.get_python_inc()
SDK["PYTHONVERSION"]="python"+sysconfig.get_python_version()
def SdkLocateVisualStudio():
if (sys.platform != "win32"): return