Index: trunk/FACT++/src/Configuration.cc
===================================================================
--- trunk/FACT++/src/Configuration.cc	(revision 11403)
+++ trunk/FACT++/src/Configuration.cc	(revision 11404)
@@ -31,5 +31,6 @@
    - (3) Database entries
    - (4) Options from the default configuration-file (given by \b --default, defaults to \b program_name.rc)
-   - (5) Environment variables
+   - (5) Options from the global configuration-file (constrctor path + \b fact++.rc)
+   - (6) Environment variables
 
 Which options are accepted is defined by the program. To get a list
@@ -763,5 +764,5 @@
         if (!var.empty())
             cout << " = ";
-        cout << val << "   #" << str.str();
+        cout << var << "   #" << str.str();
 
         if (v.defaulted())
@@ -925,5 +926,9 @@
 //!  - (4)  Check for \b --print and \b --print-all and perform corresponding
 //!         action
-//!  - (5)  Read and parse the default configuration file, which is either
+//!  - (5)  Read and parse the global configuration file, which is compiled
+//!         from the path corresponding to the argument given in the
+//!         constructor + "/fact++.rc", unrecognized options are always
+//!         allowed.
+//!  - (6)  Read and parse the default configuration file, which is either
 //!         given by the default name or the \b --default command-line
 //!         option. The default name is compiled from the argument
@@ -933,7 +938,7 @@
 //!         the \b --dont-check and \b --dont-check-files options,
 //!         unrecognized options in the file throw an exception or not.
-//!  - (6)  Check for \b --print-default and \b --print-all and perform
+//!  - (7)  Check for \b --print-default and \b --print-all and perform
 //!         corresponding action
-//!  - (7)  Read and parse the priority configuration file, which must be given
+//!  - (8)  Read and parse the priority configuration file, which must be given
 //!         by the \b --config or \b -C command-line option or a
 //!         corresponding entry in the default-configuration file.
@@ -943,7 +948,7 @@
 //!         the \b --dont-check and \b --dont-check-files options,
 //!         unrecognized options in the file throw an exception or not.
-//!  - (8)  Check for \b --print-config and \b --print-all and perform
+//!  - (9)  Check for \b --print-config and \b --print-all and perform
 //!         corresponding action
-//!  - (9)  Retrieve options from the database according to the
+//!  - (10) Retrieve options from the database according to the
 //!         options \b --database and \b --no-database. Note that
 //!         options given on the command-line have highest priority.
@@ -951,19 +956,19 @@
 //!         The options from the default configuration-file have
 //!         lowest priority.
-//!  - (10) Check for \b --print-database and \b --print-all and perform
+//!  - (11) Check for \b --print-database and \b --print-all and perform
 //!         corresponding action
-//!  - (11)  Parse the environment options.
-//!  - (12) Check for \b --print-environment and \b --print-all and perform
+//!  - (12)  Parse the environment options.
+//!  - (13) Check for \b --print-environment and \b --print-all and perform
 //!         corresponding action
-//!  - (13) Compile the final result. The priority of the options is (in
+//!  - (14) Compile the final result. The priority of the options is (in
 //!         decreasing order): command-line options, options from the
 //!         priority configuration file, options from the database,
 //!         options from the default configuration-file and options
 //!         from the environment.
-//!  - (14) Finally all options which were found and flagged as unrecognized,
+//!  - (15) Finally all options which were found and flagged as unrecognized,
 //!         because they are not in the user-defined list of described
 //!         options, are collected and stored in the corresponding
 //!         data-members.
-//!  - (15) Before the function returns it check for \b --print-options
+//!  - (16) Before the function returns it check for \b --print-options
 //!         and \b --print-unknown and performs the corresponding actions.
 //!
@@ -1053,9 +1058,23 @@
     // ------------------------ (5) --------------------------
 
+    const boost::filesystem::path path(GetName());
+    const string globalfile = path.parent_path().string()+"/fact++.rc";
+
+    cerr << "Reading options from '" << globalfile << "'." << endl;
+
+    ifstream gfile(globalfile.c_str());
+    // ===> FIXME: Proper handling of missing file or wrong file name
+    const po::parsed_options parsed_globalfile =
+        !gfile ?
+        po::parsed_options(&opt_configfile) :
+        po::parse_config_file<char>(gfile, opt_configfile, false);
+
+    // ------------------------ (6) --------------------------
+
     // Get default file from command line
     if (getfiles.count("default"))
     {
         fDefaultFile = getfiles["default"].as<string>();
-        cerr << "Reading configuration from '" << fDefaultFile << "'." << endl;
+        cerr << "Reading options from '" << fDefaultFile << "'." << endl;
     }
 
@@ -1071,5 +1090,5 @@
         po::parse_config_file<char>(indef, opt_configfile, !checkf);
 
-    // ------------------------ (6) --------------------------
+    // ------------------------ (7) --------------------------
 
     if (getfiles.count("print-default") || getfiles.count("print-all"))
@@ -1087,5 +1106,5 @@
     po::store(parsed_defaultfile, getfiles);
 
-    // ------------------------ (7) --------------------------
+    // ------------------------ (8) --------------------------
 
     // Get priority from commandline(1), defaultfile(2)
@@ -1093,5 +1112,5 @@
     {
         fPriorityFile = getfiles["config"].as<string>();
-        cerr << "Retrieved option from '" << fPriorityFile << "'." << endl;
+        cerr << "Reading options from '" << fPriorityFile << "'." << endl;
     }
 
@@ -1102,5 +1121,5 @@
         po::parse_config_file<char>(inpri, opt_configfile, !checkf);
 
-    // ------------------------ (8) --------------------------
+    // ------------------------ (9) --------------------------
 
     if (getfiles.count("print-config") || getfiles.count("print-all"))
@@ -1116,5 +1135,5 @@
     }
 
-    // ------------------------ (9) --------------------------
+    // ------------------------ (10) -------------------------
 
     po::variables_map getdatabase;
@@ -1122,9 +1141,10 @@
     po::store(parsed_priorityfile, getdatabase);
     po::store(parsed_defaultfile,  getdatabase);
+    po::store(parsed_globalfile,   getdatabase);
 
     if (getdatabase.count("database") && !getdatabase.count("no-database"))
     {
         fDatabase = getdatabase["database"].as<string>();
-        cerr << "Retrieving configuration from '" << fDatabase << "'." << endl;
+        cerr << "Requesting options from '" << fDatabase << "'." << endl;
     }
 
@@ -1135,5 +1155,5 @@
         parse_database(fDatabase, opt_database, !checkdb);
 
-    // ------------------------ (10) -------------------------
+    // ------------------------ (11) -------------------------
 
     if (getfiles.count("print-database") || getfiles.count("print-all"))
@@ -1143,5 +1163,5 @@
         else
         {
-            cout << endl << "Options retrieved from '" << fDatabase << "':" << endl;
+            cout << endl << "Options received from '" << fDatabase << "':" << endl;
             PrintParsed(parsed_database);
             cout << endl;
@@ -1149,9 +1169,9 @@
     }
 
-    // ------------------------ (11) -------------------------
+    // ------------------------ (12) -------------------------
 
     const po::parsed_options parsed_environment = po::parse_environment(opt_environment, fNameMapper);
 
-    // ------------------------ (12) -------------------------
+    // ------------------------ (13) -------------------------
 
     if (getfiles.count("print-environment"))
@@ -1162,5 +1182,5 @@
     }
 
-    // ------------------------ (13) -------------------------
+    // ------------------------ (14) -------------------------
     po::variables_map result;
     po::store(parsed_commandline,  result);
@@ -1168,4 +1188,5 @@
     po::store(parsed_database,     result);
     po::store(parsed_defaultfile,  result);
+    po::store(parsed_globalfile,   result);
     po::store(parsed_environment,  result);
     po::notify(result);
@@ -1173,10 +1194,12 @@
     fVariables = result;
 
-    // ------------------------ (14) -------------------------
-
+    // ------------------------ (15) -------------------------
+
+    const vector<string> unknown0 = collect_unrecognized(parsed_globalfile.options,   po::exclude_positional);
     const vector<string> unknown1 = collect_unrecognized(parsed_defaultfile.options,  po::exclude_positional);
     const vector<string> unknown2 = collect_unrecognized(parsed_priorityfile.options, po::exclude_positional);
 
     fUnknownConfigfile.clear();
+    fUnknownConfigfile.insert(fUnknownConfigfile.end(), unknown0.begin(), unknown0.end());
     fUnknownConfigfile.insert(fUnknownConfigfile.end(), unknown1.begin(), unknown1.end());
     fUnknownConfigfile.insert(fUnknownConfigfile.end(), unknown2.begin(), unknown2.end());
@@ -1186,5 +1209,5 @@
     fUnknownDatabase    = collect_unrecognized(parsed_database.options, po::exclude_positional);
 
-    // ------------------------ (15) -------------------------
+    // ------------------------ (16) -------------------------
 
     if (result.count("print-options"))
