Browse Source

add configargs

David Rose 23 years ago
parent
commit
877d8ed142

+ 4 - 0
dtool/src/dconfig/configTable.I

@@ -48,6 +48,10 @@ INLINE void ConfigTable::ConfigSuffixDefault(void) {
   configsuffix = "";
 }
 
+INLINE void ConfigTable::ConfigArgsDefault(void) {
+  configargs = "";
+}
+
 INLINE void ConfigTable::ConfigPathDefault(void) {
   configpath = "CFG_PATH";
 }

+ 18 - 2
dtool/src/dconfig/configTable.cxx

@@ -180,8 +180,7 @@ void ConfigTable::ReadConfigFile(void) {
       microconfig_cat->spam() << "examining file '" << config_file << "'"
                                << endl;
     if (config_file.is_executable()) {
-      ConfigString line = config_file.to_os_specific() + " "
-        + ExecutionEnvironment::get_binary_name();
+      ConfigString line = config_file.to_os_specific() + " " + configargs;
       if (microconfig_cat->is_spam())
         microconfig_cat->spam() << "file is executable, running '"
                                  << line << "'" << endl;
@@ -342,6 +341,7 @@ void ConfigTable::MicroConfig(void)
    bool fsep = false;
    bool cname = false;
    bool csuff = false;
+   bool cargs = false;
    bool cpath = false;
    bool ccmt = false;
    bool asuff = false;
@@ -414,6 +414,15 @@ void ConfigTable::MicroConfig(void)
                         << "setting the config file suffix to '"
                         << configsuffix << "'"
                         << endl;
+               } else if (tok == "configargs") {
+                  configargs = rest;
+                  cargs = true;
+                  if (microconfig_cat->is_spam())
+                     microconfig_cat->spam()
+                        << "got a microconfig configargs directive, "
+                        << "setting the config file args to '"
+                        << configargs << "'"
+                        << endl;
                } else if (tok == "configpath") {
                   if (cpath) {
                     configpath += " " + rest;
@@ -526,6 +535,13 @@ void ConfigTable::MicroConfig(void)
                                 << "setting to default '" << configsuffix
                                 << "'" << endl;
    }
+   if (!cargs) {
+      ConfigArgsDefault();
+      if (microconfig_cat->is_spam())
+        microconfig_cat->spam() << "no microconfig for configargs, "
+                                << "setting to default '" << configargs
+                                << "'" << endl;
+   }
    if (!cpath) {
       ConfigPathDefault();
       if (microconfig_cat->is_spam())

+ 2 - 0
dtool/src/dconfig/configTable.h

@@ -49,6 +49,7 @@ class EXPCL_DTOOLCONFIG ConfigTable {
       ConfigString filesep;
       ConfigString configname;
       ConfigString configsuffix;
+      ConfigString configargs;
       ConfigString configpath;
       ConfigString configcmt;
       ConfigString argsuffix;
@@ -70,6 +71,7 @@ class EXPCL_DTOOLCONFIG ConfigTable {
       INLINE void FileSepDefault(void);
       INLINE void ConfigNameDefault(void);
       INLINE void ConfigSuffixDefault(void);
+      INLINE void ConfigArgsDefault(void);
       INLINE void ConfigPathDefault(void);
       INLINE void ConfigCmtDefault(void);
       INLINE void ArgSuffixDefault(void);