Added script that can be used to the value of any GNUstep variable

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@24500 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2007-02-11 01:27:47 +00:00
parent 64feeb7b2d
commit bb7985f018
5 changed files with 126 additions and 3 deletions

View file

@ -1,3 +1,12 @@
2007-02-11 Nicola Pero <nicola.pero@meta-innovation.com>,
Matt Rice <ratmice@gmail.com>
* gnustep-config.sh.in: New file.
* configure.ac: Added gnustep-config.sh
* configure: Regenerated.
* GNUmakefile.in: Install gnustep-config.sh in system Tools, which
is guaranteed to be in PATH.
2007-01-25 Nicola Pero <nicola.pero@meta-innovation.com>
* Documentation/GNUmakefile: Fixed 'regenerate' target when you

View file

@ -159,7 +159,8 @@ install: generated-files
$(INSTALL_PROGRAM) -m 755 GNUstep.csh $(makedir); \
$(INSTALL_PROGRAM) -m 755 fixpath.sh $(makedir); \
$(INSTALL_PROGRAM) -m 755 openapp $(tooldir); \
$(INSTALL_PROGRAM) -m 755 opentool $(tooldir))
$(INSTALL_PROGRAM) -m 755 opentool $(tooldir); \
$(INSTALL_PROGRAM) -m 755 gnustep-config.sh $(tooldir))
$(EC)(echo "Installing makefiles"; \
for f in $(MAKE_FILES); do \
$(INSTALL_DATA) $(srcdir)/$$f $(makedir); \

3
configure vendored
View file

@ -4498,7 +4498,7 @@ clean_target_vendor=`$srcdir/clean_cpu.sh $target_vendor`
#--------------------------------------------------------------------
# Produce the output files
#--------------------------------------------------------------------
ac_config_files="$ac_config_files config-noarch.make config.make openapp opentool executable.template GNUmakefile GNUstep.conf GNUstep.sh GNUstep.csh fixpath.sh gnustep-make.spec"
ac_config_files="$ac_config_files config-noarch.make config.make openapp opentool executable.template GNUmakefile GNUstep.conf GNUstep.sh GNUstep.csh fixpath.sh gnustep-make.spec gnustep-config.sh"
ac_config_commands="$ac_config_commands default"
@ -5074,6 +5074,7 @@ do
"GNUstep.csh" ) CONFIG_FILES="$CONFIG_FILES GNUstep.csh" ;;
"fixpath.sh" ) CONFIG_FILES="$CONFIG_FILES fixpath.sh" ;;
"gnustep-make.spec" ) CONFIG_FILES="$CONFIG_FILES gnustep-make.spec" ;;
"gnustep-config.sh" ) CONFIG_FILES="$CONFIG_FILES gnustep-config.sh" ;;
"default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}

View file

@ -1060,7 +1060,7 @@ AC_SUBST(target)
#--------------------------------------------------------------------
AC_CONFIG_FILES([config-noarch.make config.make openapp opentool
executable.template GNUmakefile GNUstep.conf GNUstep.sh GNUstep.csh fixpath.sh
gnustep-make.spec])
gnustep-make.spec gnustep-config.sh])
AC_CONFIG_COMMANDS([default],
[[chmod a+x openapp opentool fixpath.sh executable.template]],
[[]])

112
gnustep-config.sh.in Executable file
View file

@ -0,0 +1,112 @@
#! /bin/sh
#
# @configure_input@
#
# Script that outputs GNUstep filesystem configuration; can
# be used by non-gnustep-make building/config systems to know
# how GNUstep is configured on this machine
#
# Copyright (C) 2007 Free Software Foundation, Inc.
#
# Author: Nicola Pero <nicola.pero@meta-innovation.com>
#
# This file is part of the GNUstep Makefile Package.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# You should have received a copy of the GNU General Public
# License along with this library; see the file COPYING.LIB.
# If not, write to the Free Software Foundation,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
if [ -z "$1" ]; then
echo "usage: gnustep-config.sh argument"
echo "gnustep-config.sh --help for more help"
exit 1
fi
if [ "$1" == "--help" ]; then
echo "usage: gnustep-config.sh argument"
echo
echo "Will print out the value of the specified argument, which can be "
echo "any GNUstep filesystem setting from the following list -- "
echo
echo "GNUSTEP_MAKEFILES"
echo "GNUSTEP_SYSTEM_ROOT (might be obsolete soon)"
echo "GNUSTEP_LOCAL_ROOT (might be obsolete soon)"
echo "GNUSTEP_NETWORK_ROOT (might be obsolete soon)"
echo "GNUSTEP_USER_ROOT (might be obsolete soon)"
echo "GNUSTEP_USER_DIR"
echo "GNUSTEP_USER_DEFAULTS_DIR"
echo "GNUSTEP_HOST"
echo "GNUSTEP_HOST_CPU"
echo "GNUSTEP_HOST_VENDOR"
echo "GNUSTEP_HOST_OS"
echo "GNUSTEP_IS_FLATTENED"
echo
fi
#
# Important - keep the following in sync with GNUstep.sh.in
#
#
# Read our configuration files. We only do that to locate
# GNUSTEP_MAKEFILES, so that we can execute GNUstep.sh and
# access any variable that we might ever need.
#
# Determine the location of the system configuration file
if [ -z "$GNUSTEP_CONFIG_FILE" ]; then
GNUSTEP_CONFIG_FILE=@GNUSTEP_CONFIG_FILE@
fi
# Determine the location of the user configuration file
if [ -z "$GNUSTEP_USER_CONFIG_FILE" ]; then
GNUSTEP_USER_CONFIG_FILE=@GNUSTEP_USER_CONFIG_FILE@
fi
# Read the system configuration file
if [ -f "$GNUSTEP_CONFIG_FILE" ]; then
. "$GNUSTEP_CONFIG_FILE"
fi
# FIXME: determining GNUSTEP_HOME
GNUSTEP_HOME=~
# Read the user configuration file ... unless it is disabled (ie, set
# to an empty string)
if [ -n "$GNUSTEP_USER_CONFIG_FILE" ]; then
case "$GNUSTEP_USER_CONFIG_FILE" in
/*) # An absolute path
if [ -f "$GNUSTEP_USER_CONFIG_FILE" ]; then
. "$GNUSTEP_USER_CONFIG_FILE"
fi;;
*) # Something else
if [ -f "$GNUSTEP_HOME/$GNUSTEP_USER_CONFIG_FILE" ]; then
. "$GNUSTEP_HOME/$GNUSTEP_USER_CONFIG_FILE"
fi;;
esac
fi
if [ -z "$GNUSTEP_SYSTEM_ROOT" ]; then
GNUSTEP_SYSTEM_ROOT=@GNUSTEP_SYSTEM_ROOT@
fi
if [ -z "$GNUSTEP_MAKEFILES" ]; then
GNUSTEP_MAKEFILES=$GNUSTEP_SYSTEM_ROOT/Library/Makefiles
fi
#
# Now read all the standard GNUstep config
#
. $GNUSTEP_MAKEFILES/GNUstep.sh
#
# Now print whatever variable they asked for
#
echo $(eval echo \$$1)