diff --git a/ChangeLog b/ChangeLog
index d23b7e7eb..42eada2a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,8 @@
specified by --with-config-file= or in $GNUSTEP_MAKEFILES/config.make
Add --disable-importing-config-file for consistency with makefiles
package ... not sure we need to keep this option.
+ Add --disable-environment-config-file to prevent use of the
+ GNUSTEP_CONFIG_FILE enviropnment variable.
* configure: regenerate
* Headers/Additions/GNUstepBase/config.h.in: regenerate to include
new path definitions produced by configure script.
diff --git a/Documentation/Base.gsdoc b/Documentation/Base.gsdoc
index 51dc899f9..299c94626 100644
--- a/Documentation/Base.gsdoc
+++ b/Documentation/Base.gsdoc
@@ -481,7 +481,10 @@ notice and this notice are preserved.
on. On a GNU/Linux system, the default would be
/etc/GNUstep/GNUstep.conf, for instance.
The location of this file can be overridden using the
- GNUSTEP_CONFIG_FILE environment variable.
+ GNUSTEP_CONFIG_FILE environment variable (unless the base libarary
+ had this feature specifically turned off using the
+ --disable-environment-config-file
option when the
+ configure
script was run prior to building it.
The configuration file is not actually required to exist.
If it does not exist, then default values will be used
for the standard path locations.
diff --git a/Headers/Additions/GNUstepBase/config.h.in b/Headers/Additions/GNUstepBase/config.h.in
index ceb8b528d..4438bdcb7 100644
--- a/Headers/Additions/GNUstepBase/config.h.in
+++ b/Headers/Additions/GNUstepBase/config.h.in
@@ -15,22 +15,22 @@
/* Set to location of the GNUstep configuration file */
#undef GNUSTEP_CONFIG_FILE
-/* GNUstep local root */
+/* Built in default value for GNUstep local root */
#undef GNUSTEP_TARGET_LOCAL_ROOT
-/* GNUstep network root */
+/* Built in default value for GNUstep network root */
#undef GNUSTEP_TARGET_NETWORK_ROOT
-/* GNUstep system root */
+/* Built in default value for GNUstep system root */
#undef GNUSTEP_TARGET_SYSTEM_ROOT
-/* GNUstep user config file */
+/* Built in default value for GNUstep user config file */
#undef GNUSTEP_TARGET_USER_CONFIG_FILE
-/* GNUstep user defaults directory */
+/* Built in default value for GNUstep user defaults directory */
#undef GNUSTEP_TARGET_USER_DEFAULTS_DIR
-/* GNUstep user directory */
+/* Built in default value for GNUstep user directory */
#undef GNUSTEP_TARGET_USER_DIR
/* Define if this constant is defined */
@@ -378,6 +378,9 @@
/* Define if your system needs to have short/int word aligned */
#undef NEED_WORD_ALIGNMENT
+/* Disable GNUSTEP_CONFIG_FILE environment variable */
+#undef OPTION_NO_ENVIRONMENT
+
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
diff --git a/Source/NSPathUtilities.m b/Source/NSPathUtilities.m
index ad2148e59..26bd34b6c 100644
--- a/Source/NSPathUtilities.m
+++ b/Source/NSPathUtilities.m
@@ -385,7 +385,7 @@ GNUstepConfig(void)
conf = [[NSMutableDictionary alloc] initWithCapacity: 32];
/* Now we source the configuration file if it exists */
-#if !defined(OPTION_NO_ENVIRONMENT)
+#if !OPTION_NO_ENVIRONMENT
file = [[[NSProcessInfo processInfo] environment]
objectForKey: @"GNUSTEP_CONFIG_FILE"];
#endif
diff --git a/configure b/configure
index d455ba205..007949b3f 100755
--- a/configure
+++ b/configure
@@ -846,6 +846,7 @@ if test -n "$ac_init_help"; then
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+--disable-environment-config-file Disable use of the GNUSTEP_CONFIG_FILE environment variable
--disable-importing-config-file Disable importing the existing GNUstep configuration file
--enable-procfs Use /proc filesystem (default)
--enable-procfs-psinfo Use /proc/%pid% to get info
@@ -1349,6 +1350,36 @@ echo "$as_me:$LINENO: result: $GNUSTEP_CONFIG_FILE" >&5
echo "${ECHO_T}$GNUSTEP_CONFIG_FILE" >&6
+#---------------------------------------------------------------------
+# Whether the GNUstep.conf file path can be set in the environment
+#---------------------------------------------------------------------
+echo "$as_me:$LINENO: checking whether the GNUstep.conf file path can be set in the environment" >&5
+echo $ECHO_N "checking whether the GNUstep.conf file path can be set in the environment... $ECHO_C" >&6
+# Check whether --enable-environment-config-file or --disable-environment-config-file was given.
+if test "${enable_environment_config_file+set}" = set; then
+ enableval="$enable_environment_config_file"
+ ac_cv_environment_config_file=$enableval
+else
+ ac_cv_environment_config_file="yes"
+fi;
+if test "$ac_cv_environment_config_file" = "no"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define OPTION_NO_ENVIRONMENT 0
+_ACEOF
+
+ echo "$as_me:$LINENO: result: no: disabled from the command-line" >&5
+echo "${ECHO_T}no: disabled from the command-line" >&6
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define OPTION_NO_ENVIRONMENT 1
+_ACEOF
+
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+fi
+
#
# Set 'standard' defaults for values from configuration file.
#
diff --git a/configure.ac b/configure.ac
index 1670f2390..8142d0006 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,6 +48,24 @@ AC_ARG_WITH(config-file,
AC_MSG_RESULT($GNUSTEP_CONFIG_FILE)
AC_SUBST(GNUSTEP_CONFIG_FILE)
+#---------------------------------------------------------------------
+# Whether the GNUstep.conf file path can be set in the environment
+#---------------------------------------------------------------------
+AC_MSG_CHECKING([whether the GNUstep.conf file path can be set in the environment])
+AC_ARG_ENABLE(environment-config-file,
+[--disable-environment-config-file Disable use of the GNUSTEP_CONFIG_FILE environment variable],
+ ac_cv_environment_config_file=$enableval,
+ ac_cv_environment_config_file="yes")
+if test "$ac_cv_environment_config_file" = "no"; then
+ AC_DEFINE(OPTION_NO_ENVIRONMENT, 0,
+ [Enable GNUSTEP_CONFIG_FILE environment variable])
+ AC_MSG_RESULT([no: disabled from the command-line])
+else
+ AC_DEFINE(OPTION_NO_ENVIRONMENT, 1,
+ [Disable GNUSTEP_CONFIG_FILE environment variable])
+ AC_MSG_RESULT([yes])
+fi
+
#
# Set 'standard' defaults for values from configuration file.
#