Config and documentation updates.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22147 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2005-12-05 13:08:10 +00:00
parent 0dc7c5f0de
commit eb26f5f43b
8 changed files with 127 additions and 138 deletions

View file

@ -3,6 +3,15 @@
* Source/NSProcessInfo.m: Allow
([+initializeWithArguments:count:environment:]) to override the real
environment on mingw32.
* Source/NSPathUtilities.m: Ignore config files named
.GNUstep.conf-ignore (so we can safely disable config file reading
and ensure inbuilt defaults are used)
* configure.ac: By default, disallow use of GNUSTEP_CONFIG_FILE
environment variable. Remove some redundant code.
* configure: regenerate
* Documentation/Base.gsdoc: Update for config changes
* Tools/autogsdoc.m: add any gsdoc files explicitly specified on
command line to generated dependency file for make.
2005-12-02 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -281,12 +281,12 @@ notice and this notice are preserved.
<p>
May be set to <code>unix</code> to enforce unix style path
handling, or <code>windows</code> to enforce mswindows style
path handling, or anu other value (including unset) for the
path handling, or any other value (including unset) for the
default behavior where both styles of paths should be
managed in the best way possible.
</p>
<p>
The option to enforce either upre unix or pure windows style
The option to enforce either pure unix or pure windows style
path handling (and hence this environment variable) may be
removed in a later release.
</p>
@ -309,40 +309,6 @@ notice and this notice are preserved.
Used in place of GNUSTEP_TARGET_OS if the other is missing.
</p>
</desc>
<term>GNUSTEP_LOCAL_ROOT</term>
<desc>
<p>
Used to specify the GNUstep root directory for local
(non-system) resources. Typically all locally produced
or contributed software is installed relative to this.
</p>
</desc>
<term>GNUSTEP_NETWORK_ROOT</term>
<desc>
<p>
Used to specify the GNUstep root directory for local
(non-system) resources that are intended to be shared
across a local network. Typically this is an NFS exported
directory shared by many machines. It provides an
alternative to GNUSTEP_LOCAL_ROOT.
</p>
</desc>
<term>GNUSTEP_SYSTEM_ROOT</term>
<desc>
<p>
Used to specify the GNUstep system root directory ... all
system libraries, tools, applications, headers, resources
in general are located relative to this.
</p>
</desc>
<term>GNUSTEP_USER_ROOT</term>
<desc>
<p>
This environment variable, commonly set by the make system,
is <strong>not</strong> used by GNUstep programs. Instead
values from the GNUstep configuration file are used (see later).
</p>
</desc>
<term>GNUSTEP_TARGET_CPU</term>
<desc>
<p>
@ -376,6 +342,18 @@ notice and this notice are preserved.
user defaults system.
</p>
</desc>
<term>GNUSTEP_CONFIG_FILE</term>
<desc>
This has no effect unless the base library has been
configured/built with the
<code>--enable-environment-config-file</code> option.<br />
If it is operational, the environment variable overrides the
normal path to the gnustep config file used to determine the
locations of paths for the gnustep system (see later).<br />
This is provided to support the odd situation where you may
want to simultaneously run applications using different sets
of resources but linked to a lingle copy of the base library.
</desc>
<term>HOMEDRIVE</term>
<desc>
<p>
@ -480,29 +458,44 @@ notice and this notice are preserved.
configured and/or what operating system it was configured
on. On a GNU/Linux system, the default would be
/etc/GNUstep/GNUstep.conf, for instance.<br />
The location of this file can be overridden using the
GNUSTEP_CONFIG_FILE environment variable (unless the base libarary
had this feature specifically turned off using the
<code>--disable-environment-config-file</code> option when the
<code>configure</code> script was run prior to building it.<br />
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.<br />
For specialist applications, program source code is able to
override/replace the config file using the
<ref type="function" id="GNUstepConfig">GNUstepConfig</ref>()
function, but most applications should avoid this and honor
the standard configuration mechanism.<br />
The location of this file can be specified when the base library
is configured ... using the <code>--with-config-file=</code>
option of the <code>configure</code> script.<br />
The configuration file is not actually required to exist, and
if it does not exist, then default values will be used.
for the standard path locations (these default values may
be specified using the <code>--with-default-config=</code>
option of the <code>configure</code> script.<br />
If you want to <em>force</em> the internal defaults to be used,
you can use <code>--with-config-file=</code> to specify a path
whose last component is the filename
<code>.GNUstep.conf-ignore</code> as the base library
will refrain from trying to load configuration from a file
of that name.<br />
System paths are defined by the following:
</p>
<deflist>
<term>GNUSTEP_SYSTEM_ROOT</term>
<desc>path in the file hierarchy for system/os things.</desc>
<desc>
Used to specify the GNUstep system root directory ... all
system libraries, tools, applications, headers, resources
in general are located relative to this.
</desc>
<term>GNUSTEP_NETWORK_ROOT</term>
<desc>path to network mounted resources.</desc>
<desc>
Used to specify the GNUstep root directory for local
(non-system) resources that are intended to be shared
across a local network. Typically this is an NFS exported
directory shared by many machines. It provides an
alternative to GNUSTEP_LOCAL_ROOT but is usually defined
to the same value.
</desc>
<term>GNUSTEP_LOCAL_ROOT</term>
<desc>path for non-system resources for the specific
machine.</desc>
<desc>
Used to specify the GNUstep root directory for local
(non-system) resources. Typically all locally produced
or contributed software is installed relative to this.
</desc>
</deflist>
<p>
Paths for each user are defined by the following:
@ -510,16 +503,21 @@ notice and this notice are preserved.
<deflist>
<term>GNUSTEP_USER_DIR</term>
<desc>Path for user specific GNUstep resources (eg. 'GNUstep').
Relative to the user's home directory.</desc>
Relative to the user's home directory.
</desc>
<term>GNUSTEP_USER_CONFIG_FILE</term>
<desc>Name of user configuration file (eg. '.GNUsteprc')
relative to the user's home directory.</desc>
<desc>Name of user configuration file (eg. '.GNUstep.conf')
relative to the user's home directory.<br />
Can be specified as <code>.GNUstep.conf-ignore</code> to ensure
that no user specific config file is loaded.
</desc>
<term>GNUSTEP_USER_DEFAULTS_DIR</term>
<desc>Name of directory for user defaults files.
Relative to the user's home directory.<br />
On mswindows this may be set to be ':REGISTRY:' to have defaults
stored in the windows registry rather than in the standard file
format.</desc>
format.
</desc>
</deflist>
<p>
The user's home directory is taken to be the standard
@ -623,6 +621,22 @@ notice and this notice are preserved.
and configure various relative paths in that directory, then
move the directory around wherever you like.
</p>
<p>
If you wish to <em>lock down</em> a production system for
distribution as a relocatable package, so it can be installed
anywhere, but users can't accidentally change the config file
and mess up paths, you can specify the config file name as
<code>.GNUstep.conf-ignore</code> so that the base library will
<em>not</em> read it, and will use the builtin default values.<br />
To do this, you would configure using the options
<code>--with-config-file=./.GNUstep.conf-ignore</code> and
<code>--with-default-file=myConfig</code> where <em>myConfig</em>
is a file containing the paths you want to use relative to the
location the base library gets installed in.<br />
The paths from that file will be built in to the base library
as defaults, and library will use them rather than attempting
to read a config file at runtime.
</p>
</subsect>
<subsect>
<heading>.GNUstep.conf files</heading>
@ -631,32 +645,33 @@ notice and this notice are preserved.
configuration file and may generally override values from the
main file. To prevent the use specific file from being read,
the system manager may define GNUSTEP_USER_CONFIG_FILE in the
main file to be an empty string.<br />
main file to be <code>.GNUstep.conf-ignore</code> or to be
an empty string.<br />
In any case, the user specific file is <em>not</em> read if a
program is running setuid.
</p>
<p>
The locations of the directories in which user specific files and
the user defaults database are stored may be defined in the
file given by GNUSTEP_USER_CONFIG_FILE (by default,
<code>.GNUstep.conf</code>).<br />
If no location is given for user specific files, they are stored
in the locaton given by GNUSTEP_USER_DIR (by default, the
<code>GNUstep</code> subdirectory of the users home
directory).<br />
If a separate location is not given for the defaults database, it
is stored in the subdirectory of the users home directory given by
GNUSTEP_USER_DEFAULTS_DIR (by default, the
<code>GNUstep/Defaults</code> subdirectory).<br />
</p>
<p>
The presence of a <code>.GNUstep.conf</code> file in a users home
Unless disabled (as specified above) the presence of a
<code>.GNUstep.conf</code> file in a users home
directory permits the user to customize file locations using all
the same commands as the system directory, though any attempt
to redefine GNUSTEP_USER_CONFIG_FILE is of course ignored.<br />
Attempts to redefine the users home directory at this level
are also ignored.
</p>
<p>
User specific files are stored in the locaton given by
GNUSTEP_USER_DIR (by default, the
<code>GNUstep</code> subdirectory of the users home
directory).<br />
The defaults database for a user is stored in the
subdirectory of the users home directory given by
GNUSTEP_USER_DEFAULTS_DIR (by default, the
<code>GNUstep/Defaults</code> subdirectory).
On mswindows this may be set to be ':REGISTRY:' to have defaults
stored in the windows registry rather than in the standard file
format.
</p>
</subsect>
</section>
</chapter>

View file

@ -12,9 +12,6 @@
/* Define if constructors are automatically loaded */
#undef CON_AUTOLOAD
/* Set to location of the GNUstep configuration file */
#undef GNUSTEP_CONFIG_FILE
/* Built in default value for GNUstep local root */
#undef GNUSTEP_TARGET_LOCAL_ROOT

View file

@ -29,19 +29,6 @@
#include <Foundation/NSString.h>
#ifndef NO_GNUSTEP
/**
* Function to return a mutable copy of the GNUstep configuration
* file contents.<br />
* If newConfig is not nil, it is used to set a new system wide
* configuration.<br />
* This function is provided to allow a program to override the
* configuration information which tells GNUstep applications where
* all paths to resources/libraries etc in the system are located.<br />
* Keys and values in the newConfig dictionary must match those normally
* expected in the configuration file (GNUstep.conf).
*/
NSMutableDictionary* GNUstepConfig(NSDictionary *newConfig);
/**
* This extension permits a change of username from that specified in the
* LOGNAME environment variable. Using it will almost certainly cause

View file

@ -174,7 +174,7 @@ static NSString *localLibs = nil;
/* Internal function prototypes. */
/* ============================= */
NSMutableDictionary* GNUstepConfig(NSDictionary *newConfig);
static NSMutableDictionary* GNUstepConfig(NSDictionary *newConfig);
static void UserConfig(NSMutableDictionary *config, NSString *userName);
@ -378,7 +378,7 @@ static void ExtractValuesFromConfig(NSDictionary *config)
}
}
NSMutableDictionary*
static NSMutableDictionary*
GNUstepConfig(NSDictionary *newConfig)
{
static NSDictionary *config = nil;
@ -408,7 +408,6 @@ GNUstepConfig(NSDictionary *newConfig)
file = [NSString stringWithCString:
STRINGIFY(GNUSTEP_CONFIG_FILE)];
}
file = [file stringByStandardizingPath];
/*
* Special case ... if the config file location begins './'
* then we determine it's actual path by working relative
@ -425,9 +424,8 @@ GNUstepConfig(NSDictionary *newConfig)
file = [file substringFromIndex: 2];
// Join the two together
file = [path stringByAppendingPathComponent: file];
// Standardize
file = [file stringByStandardizingPath];
}
file = [file stringByStandardizingPath];
if ([file isAbsolutePath] == NO)
{
@ -637,6 +635,9 @@ static void ShutdownPathUtilities(void)
* idea to specify path values in the config file as singly quoted
* strings to avoid having to double all occurrences of the backslash.<br />
* Returns a dictionary of the (key,value) pairs.<br/ >
* If the file does not exist, or its name is
* <code>.GNUstep.conf-ignore</code> then nothing is read and the
* function makes no changes to dict and returns NO.
*/
static BOOL
ParseConfigurationFile(NSString *fileName, NSMutableDictionary *dict)
@ -654,6 +655,11 @@ ParseConfigurationFile(NSString *fileName, NSMutableDictionary *dict)
BOOL wantVal = NO;
NSString *key = nil;
if ([[fileName lastPathComponent] isEqual: @".GNUstep.conf-ignore"] == YES)
{
return NO; // Special case filename ... must ignore this.
}
if ([MGR() isReadableFileAtPath: fileName] == NO)
{
return NO;

View file

@ -635,6 +635,7 @@ main(int argc, char **argv, char **env)
NSMutableArray *sFiles = nil; // Source
NSMutableArray *gFiles = nil; // GSDOC
NSMutableArray *hFiles = nil; // HTML
NSMutableSet *deps = nil;
#if GS_WITH_GC == 0
NSAutoreleasePool *outer = nil;
NSAutoreleasePool *pool = nil;
@ -954,6 +955,12 @@ main(int argc, char **argv, char **env)
}
}
/*
* Note explicitly supplied gsdoc files for dependencies later.
*/
deps = [NSMutableSet setWithCapacity: 1024];
[deps addObjectsFromArray: gFiles];
/*
* 3) Load old project indexing information from the .igsdoc file if
* present and determine when the indexing information was last
@ -2230,13 +2237,12 @@ main(int argc, char **argv, char **env)
}
/*
* 12) If MakeDependencies was requested, list all header and source files
* 12) If MakeDependencies was requested, add all header and source files
* as colon-dependencies of the project name.
*/
if ([defs stringForKey: @"MakeDependencies"] != nil)
{
NSString *stamp = [defs stringForKey: @"MakeDependencies"];
NSMutableSet *mset = [NSMutableSet setWithCapacity: 128];
NSDictionary *files = [[projectRefs refs] objectForKey: @"source"];
NSEnumerator *enumerator = [files keyEnumerator];
NSString *file;
@ -2247,11 +2253,11 @@ main(int argc, char **argv, char **env)
*/
while ((file = [enumerator nextObject]) != nil)
{
[mset addObject: file];
[mset addObjectsFromArray: [files objectForKey: file]];
[deps addObject: file];
[deps addObjectsFromArray: [files objectForKey: file]];
}
enumerator = [mset objectEnumerator];
enumerator = [deps objectEnumerator];
depend = [NSMutableString stringWithFormat: @"%@:", stamp];
while ((file = [enumerator nextObject]) != nil)
{

26
configure vendored
View file

@ -846,7 +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
--enable-environment-config-file Enable 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
@ -1350,9 +1350,9 @@ 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.
@ -1360,7 +1360,7 @@ 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"
ac_cv_environment_config_file="no"
fi;
if test "$ac_cv_environment_config_file" = "yes"; then
@ -15812,24 +15812,6 @@ fi;
subdirs="$subdirs Source/mframe SSL"
#--------------------------------------------------------------------
# Configuration and Misc Options
#--------------------------------------------------------------------
echo "$as_me:$LINENO: checking for location of GNUstep configuration file" >&5
echo $ECHO_N "checking for location of GNUstep configuration file... $ECHO_C" >&6
#
# Get them from gnustep-make which contains the real code to get them
#
config_file=$(grep GNUSTEP_CONFIG_FILE $GNUSTEP_MAKEFILES/$obj_dir/config.make | sed -e 's/GNUSTEP_CONFIG_FILE = //')
#
echo "$as_me:$LINENO: result: $config_file" >&5
echo "${ECHO_T}$config_file" >&6
cat >>confdefs.h <<_ACEOF
#define GNUSTEP_CONFIG_FILE $config_file
_ACEOF
#--------------------------------------------------------------------
# Record the version
#--------------------------------------------------------------------

View file

@ -48,14 +48,14 @@ 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],
[--enable-environment-config-file Enable use of the GNUSTEP_CONFIG_FILE environment variable],
ac_cv_environment_config_file=$enableval,
ac_cv_environment_config_file="yes")
ac_cv_environment_config_file="no")
if test "$ac_cv_environment_config_file" = "yes"; then
AC_DEFINE(OPTION_NO_ENVIRONMENT, 0,
[Enable GNUSTEP_CONFIG_FILE environment variable])
@ -1411,19 +1411,6 @@ AC_ARG_WITH(openssl-library,
AC_CONFIG_SUBDIRS(Source/mframe SSL)
#--------------------------------------------------------------------
# Configuration and Misc Options
#--------------------------------------------------------------------
AC_MSG_CHECKING(for location of GNUstep configuration file)
#
# Get them from gnustep-make which contains the real code to get them
#
config_file=$(grep GNUSTEP_CONFIG_FILE $GNUSTEP_MAKEFILES/$obj_dir/config.make | sed -e 's/GNUSTEP_CONFIG_FILE = //')
#
AC_MSG_RESULT($config_file)
AC_DEFINE_UNQUOTED(GNUSTEP_CONFIG_FILE, $config_file,
[Set to location of the GNUstep configuration file])
#--------------------------------------------------------------------
# Record the version
#--------------------------------------------------------------------