diff --git a/dtool/src/dtoolutil/load_dso.cxx b/dtool/src/dtoolutil/load_dso.cxx index 0c681d032a..2fceb2e9d8 100644 --- a/dtool/src/dtoolutil/load_dso.cxx +++ b/dtool/src/dtoolutil/load_dso.cxx @@ -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."; diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index dc1c7981ec..edbcf8dc5a 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -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'): diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 7300a34589..f628505845 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -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