Skip to content
Browse files

Sunday, 19th October, 2003, James Turner <james@worldforge.org>

	* Add ProjectBuilder project, which current relies on a
	  SigC++ 1.2 framework which I'll make available on
	  FTP if people poke me (it requires some source modifications)
	* Add __APPLE__ specific code to config.cpp, to deal with the
	  fact the C runtime doesn't export the 'environ' symbol to
	  dylibs (i.e, a framework build). The fix comes from Tcl, by
	  way of guile, and Google.
  • Loading branch information...
1 parent 78bc543 commit 778f882ee86a9fdf3d43bac3d93600a5ea007489 James Turner committed Oct 19, 2003
Showing with 553 additions and 1 deletion.
  1. +10 −0 ChangeLog
  2. +529 −0 Varconf.pbproj/project.pbxproj
  3. +14 −1 varconf/config.cpp
View
10 ChangeLog
@@ -1,4 +1,14 @@
ChangeLog for varconf
+
+Sunday, 19th October, 2003, James Turner <james@worldforge.org>
+ * Add ProjectBuilder project, which current relies on a
+ SigC++ 1.2 framework which I'll make available on
+ FTP if people poke me (it requires some source modifications)
+ * Add __APPLE__ specific code to config.cpp, to deal with the
+ fact the C runtime doesn't export the 'environ' symbol to
+ dylibs (i.e, a framework build). The fix comes from Tcl, by
+ way of guile, and Google.
+
Saturday, 20th September, 2003, Ron Steinke <rsteinke@w-link.net>
* Workaround for buggy win32 atof().
View
529 Varconf.pbproj/project.pbxproj
@@ -0,0 +1,529 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 38;
+ objects = {
+ C43FBE6C05432554008FC2ED = {
+ children = (
+ C43FC03D05432674008FC2ED,
+ C43FC02F0543260B008FC2ED,
+ C43FBE780543255E008FC2ED,
+ C43FC01305432600008FC2ED,
+ C43FC01405432600008FC2ED,
+ C43FC01505432600008FC2ED,
+ C43FC01605432600008FC2ED,
+ C43FC01705432600008FC2ED,
+ C43FC01805432600008FC2ED,
+ C43FC01905432600008FC2ED,
+ C43FC01A05432600008FC2ED,
+ C43FC01B05432601008FC2ED,
+ C43FC01C05432601008FC2ED,
+ C43FC01D05432601008FC2ED,
+ C43FC01E05432601008FC2ED,
+ C43FC01F05432601008FC2ED,
+ C43FC02005432601008FC2ED,
+ );
+ isa = PBXGroup;
+ refType = 4;
+ };
+ C43FBE6E05432554008FC2ED = {
+ buildRules = (
+ );
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ };
+ isa = PBXBuildStyle;
+ name = Development;
+ };
+ C43FBE6F05432554008FC2ED = {
+ buildRules = (
+ );
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ };
+ isa = PBXBuildStyle;
+ name = Deployment;
+ };
+ C43FBE7005432554008FC2ED = {
+ buildStyles = (
+ C43FBE6E05432554008FC2ED,
+ C43FBE6F05432554008FC2ED,
+ );
+ hasScannedForEncodings = 1;
+ isa = PBXProject;
+ mainGroup = C43FBE6C05432554008FC2ED;
+ productRefGroup = C43FBE780543255E008FC2ED;
+ projectDirPath = "";
+ targets = (
+ C43FBE760543255E008FC2ED,
+ C43FC0360543263D008FC2ED,
+ );
+ };
+ C43FBE710543255E008FC2ED = {
+ buildActionMask = 2147483647;
+ files = (
+ C43FC02205432601008FC2ED,
+ C43FC02405432601008FC2ED,
+ C43FC02605432601008FC2ED,
+ C43FC02805432601008FC2ED,
+ C43FC02905432601008FC2ED,
+ C43FC02B05432601008FC2ED,
+ C43FC02C05432601008FC2ED,
+ C43FC02E05432601008FC2ED,
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ C43FBE720543255E008FC2ED = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ C43FBE730543255E008FC2ED = {
+ buildActionMask = 2147483647;
+ files = (
+ C43FC02105432601008FC2ED,
+ C43FC02305432601008FC2ED,
+ C43FC02505432601008FC2ED,
+ C43FC02705432601008FC2ED,
+ C43FC02A05432601008FC2ED,
+ C43FC02D05432601008FC2ED,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ C43FBE740543255E008FC2ED = {
+ buildActionMask = 2147483647;
+ files = (
+ C43FC03C05432671008FC2ED,
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ C43FBE750543255E008FC2ED = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ C43FBE760543255E008FC2ED = {
+ buildPhases = (
+ C43FBE710543255E008FC2ED,
+ C43FBE720543255E008FC2ED,
+ C43FBE730543255E008FC2ED,
+ C43FBE740543255E008FC2ED,
+ C43FBE750543255E008FC2ED,
+ );
+ buildSettings = {
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_SEARCH_PATHS = "/Users/jmt/Desktop/libsigc++-1.2.5/build";
+ FRAMEWORK_VERSION = A;
+ OPTIMIZATION_CFLAGS = "";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOL_FLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRINCIPAL_CLASS = "";
+ PRODUCT_NAME = varconf;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = framework;
+ };
+ dependencies = (
+ );
+ isa = PBXFrameworkTarget;
+ name = varconf;
+ productInstallPath = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ productName = varconf;
+ productReference = C43FBE770543255E008FC2ED;
+ productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string></string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+</dict>
+</plist>
+";
+ };
+ C43FBE770543255E008FC2ED = {
+ isa = PBXFrameworkReference;
+ path = varconf.framework;
+ refType = 3;
+ };
+ C43FBE780543255E008FC2ED = {
+ children = (
+ C43FBE770543255E008FC2ED,
+ C43FC0370543263D008FC2ED,
+ );
+ isa = PBXGroup;
+ name = Products;
+ refType = 4;
+ };
+ C43FC01305432600008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = config.cpp;
+ path = varconf/config.cpp;
+ refType = 4;
+ };
+ C43FC01405432600008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Config.h;
+ path = varconf/Config.h;
+ refType = 4;
+ };
+ C43FC01505432600008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = dynbase.cpp;
+ path = varconf/dynbase.cpp;
+ refType = 4;
+ };
+ C43FC01605432600008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = dynbase.h;
+ path = varconf/dynbase.h;
+ refType = 4;
+ };
+ C43FC01705432600008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = dyncmp.cpp;
+ path = varconf/dyncmp.cpp;
+ refType = 4;
+ };
+ C43FC01805432600008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = dyncmp.h;
+ path = varconf/dyncmp.h;
+ refType = 4;
+ };
+ C43FC01905432600008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = dyntypes.cpp;
+ path = varconf/dyntypes.cpp;
+ refType = 4;
+ };
+ C43FC01A05432600008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = dyntypes.h;
+ path = varconf/dyntypes.h;
+ refType = 4;
+ };
+ C43FC01B05432601008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = dynvar.h;
+ path = varconf/dynvar.h;
+ refType = 4;
+ };
+ C43FC01C05432601008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = parse_error.cpp;
+ path = varconf/parse_error.cpp;
+ refType = 4;
+ };
+ C43FC01D05432601008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = parse_error.h;
+ path = varconf/parse_error.h;
+ refType = 4;
+ };
+ C43FC01E05432601008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = varconf.h;
+ path = varconf/varconf.h;
+ refType = 4;
+ };
+ C43FC01F05432601008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = variable.cpp;
+ path = varconf/variable.cpp;
+ refType = 4;
+ };
+ C43FC02005432601008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = variable.h;
+ path = varconf/variable.h;
+ refType = 4;
+ };
+ C43FC02105432601008FC2ED = {
+ fileRef = C43FC01305432600008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C43FC02205432601008FC2ED = {
+ fileRef = C43FC01405432600008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ C43FC02305432601008FC2ED = {
+ fileRef = C43FC01505432600008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C43FC02405432601008FC2ED = {
+ fileRef = C43FC01605432600008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ C43FC02505432601008FC2ED = {
+ fileRef = C43FC01705432600008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C43FC02605432601008FC2ED = {
+ fileRef = C43FC01805432600008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ C43FC02705432601008FC2ED = {
+ fileRef = C43FC01905432600008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C43FC02805432601008FC2ED = {
+ fileRef = C43FC01A05432600008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ C43FC02905432601008FC2ED = {
+ fileRef = C43FC01B05432601008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ C43FC02A05432601008FC2ED = {
+ fileRef = C43FC01C05432601008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C43FC02B05432601008FC2ED = {
+ fileRef = C43FC01D05432601008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ C43FC02C05432601008FC2ED = {
+ fileRef = C43FC01E05432601008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Public,
+ );
+ };
+ };
+ C43FC02D05432601008FC2ED = {
+ fileRef = C43FC01F05432601008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C43FC02E05432601008FC2ED = {
+ fileRef = C43FC02005432601008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Public,
+ );
+ };
+ };
+ C43FC02F0543260B008FC2ED = {
+ children = (
+ C43FC0300543261F008FC2ED,
+ C43FC06605432B10008FC2ED,
+ );
+ isa = PBXGroup;
+ name = Tests;
+ refType = 4;
+ };
+ C43FC0300543261F008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = conftest.cpp;
+ path = tests/conftest.cpp;
+ refType = 4;
+ };
+ C43FC0320543263D008FC2ED = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ C43FC0330543263D008FC2ED = {
+ buildActionMask = 2147483647;
+ files = (
+ C43FC03905432645008FC2ED,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ C43FC0340543263D008FC2ED = {
+ buildActionMask = 2147483647;
+ files = (
+ C43FC03A05432647008FC2ED,
+ C43FC06505432A90008FC2ED,
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ C43FC0360543263D008FC2ED = {
+ buildPhases = (
+ C43FC0320543263D008FC2ED,
+ C43FC0330543263D008FC2ED,
+ C43FC0340543263D008FC2ED,
+ C43FC06805432B36008FC2ED,
+ );
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = "/Users/jmt/Desktop/libsigc++-1.2.5/build";
+ OPTIMIZATION_CFLAGS = "";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = conftest;
+ REZ_EXECUTABLE = YES;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ };
+ dependencies = (
+ );
+ isa = PBXToolTarget;
+ name = conftest;
+ productInstallPath = /usr/local/bin;
+ productName = conftest;
+ productReference = C43FC0370543263D008FC2ED;
+ };
+ C43FC0370543263D008FC2ED = {
+ isa = PBXExecutableFileReference;
+ path = conftest;
+ refType = 3;
+ };
+ C43FC03905432645008FC2ED = {
+ fileRef = C43FC0300543261F008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C43FC03A05432647008FC2ED = {
+ fileRef = C43FBE770543255E008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C43FC03B05432671008FC2ED = {
+ isa = PBXFrameworkReference;
+ name = "sigc++.framework";
+ path = "/Users/jmt/Desktop/libsigc++-1.2.5/build/sigc++.framework";
+ refType = 0;
+ };
+ C43FC03C05432671008FC2ED = {
+ fileRef = C43FC03B05432671008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C43FC03D05432674008FC2ED = {
+ children = (
+ C43FC03B05432671008FC2ED,
+ );
+ isa = PBXGroup;
+ name = Frameworks;
+ refType = 4;
+ };
+ C43FC06505432A90008FC2ED = {
+ fileRef = C43FC03B05432671008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ C43FC06605432B10008FC2ED = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = conf.cfg;
+ path = tests/conf.cfg;
+ refType = 4;
+ };
+ C43FC06805432B36008FC2ED = {
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 16;
+ files = (
+ C43FC06905432B47008FC2ED,
+ );
+ isa = PBXCopyFilesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ C43FC06905432B47008FC2ED = {
+ fileRef = C43FC06605432B10008FC2ED;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ };
+ rootObject = C43FBE7005432554008FC2ED;
+}
View
15 varconf/config.cpp
@@ -35,7 +35,15 @@
#define snprintf _snprintf
#endif
-extern char **environ;
+extern char** environ;
+
+// on OS-X, the CRT doesn't expose the environ symbol. The following
+// code (found on Google) provides a value to link against, and a
+// further tweak in getEnv gets the actual value using _NS evil.
+#if defined(__APPLE__)
+ #include <crt_externs.h>
+ char **environ = NULL;
+#endif
using namespace SigC;
@@ -254,6 +262,11 @@ void Config::getEnv( const std::string& prefix)
std::string name = "", value = "", section = "", env = "";
size_t eq_pos = 0;
+#if defined(__APPLE__)
+ if (environ == NULL)
+ environ = *_NSGetEnviron();
+#endif
+
for ( size_t i = 0; environ[i] != NULL; i++) {
env = environ[i];

0 comments on commit 778f882

Please sign in to comment.
Something went wrong with that request. Please try again.