2002-01-11 12:33:07 +00:00
#! /bin/echo This file must be sourced inside csh using: source
1998-04-06 03:01:59 +00:00
#
2002-05-02 15:07:49 +00:00
# @configure_input@
1998-04-06 03:01:59 +00:00
#
# Shell initialization for the GNUstep environment.
#
2005-10-13 02:42:10 +00:00
# Copyright (C) 1998-2005 Free Software Foundation, Inc.
1998-04-06 03:01:59 +00:00
#
# Author: Scott Christley <scottc@net-community.com>
2002-02-24 15:45:14 +00:00
# Author: Adam Fedor <fedor@gnu.org>
# Author: Richard Frith-Macdonald <rfm@gnu.org>
# Author: Nicola Pero <n.pero@mi.flashnet.it>
1998-04-06 03:01:59 +00:00
#
# 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
2007-11-07 18:56:37 +00:00
# as published by the Free Software Foundation; either version 3
1998-04-06 03:01:59 +00:00
# of the License, or (at your option) any later version.
#
# You should have received a copy of the GNU General Public
2007-11-07 18:56:37 +00:00
# License along with this library; see the file COPYING.
1998-04-06 03:01:59 +00:00
# If not, write to the Free Software Foundation,
2005-05-22 03:20:14 +00:00
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1998-04-06 03:01:59 +00:00
#
#
# Set the GNUstep system root and local root
#
2005-10-13 02:42:10 +00:00
#
# Read our configuration files
#
# Determine the location of the system configuration file
if ( ! ${ ?GNUSTEP_CONFIG_FILE } ) then
2006-07-06 12:19:32 +00:00
setenv GNUSTEP_CONFIG_FILE "@GNUSTEP_CONFIG_FILE@"
2005-10-13 02:42:10 +00:00
endif
# Determine the location of the user configuration file
if ( ! ${ ?GNUSTEP_USER_CONFIG_FILE } ) then
2006-07-06 12:19:32 +00:00
setenv GNUSTEP_USER_CONFIG_FILE "@GNUSTEP_USER_CONFIG_FILE@"
2005-10-13 02:42:10 +00:00
endif
# Read the system configuration file
if ( -e "${GNUSTEP_CONFIG_FILE}" ) then
#
# Convert the config file from sh syntax to csh syntax, and execute it.
#
# We want to convert every line of the type ^xxx=yyy$ into setenv xxx yyy;
# and ignore any other line.
#
# This sed expression will first delete all lines that don't match
# the pattern ^[^#=][^#=]*=.*$ -- which means "start of line (^),
# followed by a character that is not # and not = ([^#=]), followed
# by 0 or more characters that are not # and not = ([^#=]*),
# followed by a = (=), followed by some characters until end of the
# line (.*$). It will then replace each occurrence of the same
# pattern (where the first and second relevant parts are now tagged
# -- that's what the additional \(...\) do) with 'setenv \1 \2'.
#
# The result of all this is ... something that we want to execute!
# We use eval to execute the results of `...`.
#
# Please note that ! must always be escaped in csh, which is why we
# write \\!
#
# Also note that we add a ';' at the end of each setenv command so
# that we can pipe all the commands through a single eval.
#
eval ` sed -e '/^[^#=][^#=]*=.*$/\\!d' -e 's/^\([^#=][^#=]*\)=\(.*\)$/setenv \1 \2;/' "${GNUSTEP_CONFIG_FILE}" `
endif
# FIXME: determining GNUSTEP_HOME
set GNUSTEP_HOME = ~
# Read the user configuration file ... unless it is disabled (ie, set
# to an empty string)
if ( ${ ?GNUSTEP_USER_CONFIG_FILE } ) then
switch ( "${GNUSTEP_USER_CONFIG_FILE}" )
case /*: # An absolute path
if ( -e "${GNUSTEP_USER_CONFIG_FILE}" ) then
# See above for an explanation of the sed expression
eval ` sed -e '/^[^#=][^#=]*=.*$/\\!d' -e 's/^\([^#=][^#=]*\)=\(.*\)$/setenv \1 \2;/' "${GNUSTEP_USER_CONFIG_FILE}" ` `
endif
breaksw
default : # Something else
if ( -e "${GNUSTEP_HOME}/${GNUSTEP_USER_CONFIG_FILE}" ) then
eval ` sed -e '/^[^#=][^#=]*=.*$/\\!d' -e 's/^\([^#=][^#=]*\)=\(.*\)$/setenv \1 \2;/' "${GNUSTEP_HOME}/${GNUSTEP_USER_CONFIG_FILE}" `
endif
breaksw
endsw
endif
# Now, set any essential variable (that is not already set) to the
# built-in values.
if ( ! ${ ?GNUSTEP_SYSTEM_ROOT } ) then
2006-07-06 12:19:32 +00:00
setenv GNUSTEP_SYSTEM_ROOT "@GNUSTEP_SYSTEM_ROOT@"
2005-10-13 02:42:10 +00:00
endif
if ( ! ${ ?GNUSTEP_LOCAL_ROOT } ) then
2006-07-06 12:19:32 +00:00
setenv GNUSTEP_LOCAL_ROOT "@GNUSTEP_LOCAL_ROOT@"
2005-10-13 02:42:10 +00:00
endif
if ( ! ${ ?GNUSTEP_NETWORK_ROOT } ) then
2006-07-06 12:19:32 +00:00
setenv GNUSTEP_NETWORK_ROOT "@GNUSTEP_NETWORK_ROOT@"
2005-10-13 02:42:10 +00:00
endif
2006-10-02 15:54:56 +00:00
# GNUSTEP_FLATTENED is obsolete, please use GNUSTEP_IS_FLATTENED
# instead
2003-04-22 13:40:14 +00:00
setenv GNUSTEP_FLATTENED "@GNUSTEP_FLATTENED@"
2006-10-02 15:54:56 +00:00
setenv GNUSTEP_IS_FLATTENED "@GNUSTEP_IS_FLATTENED@"
1999-04-23 02:54:45 +00:00
if ( ! ${ ?LIBRARY_COMBO } ) then
2003-04-22 13:40:14 +00:00
setenv LIBRARY_COMBO "@ac_cv_library_combo@"
1999-04-23 02:54:45 +00:00
endif
1998-04-06 03:01:59 +00:00
2005-10-13 02:42:10 +00:00
if ( ! ${ ?GNUSTEP_MAKEFILES } ) then
2007-02-14 03:40:30 +00:00
setenv GNUSTEP_MAKEFILES "@GNUSTEP_MAKEFILES@"
2005-10-13 02:42:10 +00:00
endif
if ( ! ${ ?GNUSTEP_USER_DIR } ) then
2006-07-06 12:19:32 +00:00
setenv GNUSTEP_USER_DIR "@GNUSTEP_USER_DIR@"
2005-10-13 02:42:10 +00:00
endif
1998-04-06 03:01:59 +00:00
2005-10-13 02:42:10 +00:00
#
# Set GNUSTEP_USER_ROOT which is the variable used in practice
#
switch ( "${GNUSTEP_USER_DIR}" )
case /*: # An absolute path
setenv GNUSTEP_USER_ROOT "${GNUSTEP_USER_DIR}"
breaksw
default : # Something else
setenv GNUSTEP_USER_ROOT "${GNUSTEP_HOME}/${GNUSTEP_USER_DIR}"
breaksw
endsw
2003-01-26 04:01:10 +00:00
if ( "@GNUSTEP_MULTI_PLATFORM@" == "" ) then
2003-04-22 13:40:14 +00:00
setenv GNUSTEP_HOST "@target@"
setenv GNUSTEP_HOST_CPU "@clean_target_cpu@"
setenv GNUSTEP_HOST_VENDOR "@clean_target_vendor@"
setenv GNUSTEP_HOST_OS "@clean_target_os@"
2003-01-26 04:01:10 +00:00
endif
1998-04-06 03:01:59 +00:00
#
# Determine the host information
#
1999-09-09 02:56:20 +00:00
if ( ! ${ ?GNUSTEP_HOST } ) then
2000-02-19 00:40:47 +00:00
pushd /tmp > /dev/null
2000-02-21 22:01:08 +00:00
setenv GNUSTEP_HOST ` ${ GNUSTEP_MAKEFILES } /config.guess`
setenv GNUSTEP_HOST ` ${ GNUSTEP_MAKEFILES } /config.sub ${ GNUSTEP_HOST } `
2000-02-19 00:40:47 +00:00
popd > /dev/null
1999-09-09 02:56:20 +00:00
endif
1998-04-06 03:01:59 +00:00
2001-03-15 01:03:24 +00:00
if ( ! ${ ?GNUSTEP_HOST_CPU } ) then
setenv GNUSTEP_HOST_CPU ` ${ GNUSTEP_MAKEFILES } /cpu.sh ${ GNUSTEP_HOST } `
setenv GNUSTEP_HOST_CPU ` ${ GNUSTEP_MAKEFILES } /clean_cpu.sh ${ GNUSTEP_HOST_CPU } `
endif
if ( ! ${ ?GNUSTEP_HOST_VENDOR } ) then
setenv GNUSTEP_HOST_VENDOR ` ${ GNUSTEP_MAKEFILES } /vendor.sh ${ GNUSTEP_HOST } `
setenv GNUSTEP_HOST_VENDOR ` ${ GNUSTEP_MAKEFILES } /clean_vendor.sh ${ GNUSTEP_HOST_VENDOR } `
endif
if ( ! ${ ?GNUSTEP_HOST_OS } ) then
setenv GNUSTEP_HOST_OS ` ${ GNUSTEP_MAKEFILES } /os.sh ${ GNUSTEP_HOST } `
setenv GNUSTEP_HOST_OS ` ${ GNUSTEP_MAKEFILES } /clean_os.sh ${ GNUSTEP_HOST_OS } `
endif
1998-04-06 03:01:59 +00:00
2007-02-14 02:38:15 +00:00
# Now load in all the remaining paths
source "${GNUSTEP_MAKEFILES}/filesystem.csh"
# No longer needed
unset GNUSTEP_HOME
2007-02-14 05:47:05 +00:00
# Determine if the paths look like Windows paths that need fixing
set fixup_paths = no
if ( ` echo $GNUSTEP_MAKEFILES | sed 's|^[a-zA-Z]:/.*$||' ` == "" ) then
set fixup_paths = yes
endif
1998-04-06 03:01:59 +00:00
#
# Add the GNUstep tools directories to the path
#
2002-06-19 03:46:08 +00:00
if ( ! ${ ?GNUSTEP_PATHLIST } ) then
2007-02-14 05:47:05 +00:00
setenv GNUSTEP_PATHLIST ` $GNUSTEP_MAKEFILES /print_unique_pathlist.sh "$GNUSTEP_USER_ROOT" "$GNUSTEP_LOCAL_ROOT" "$GNUSTEP_NETWORK_ROOT" "$GNUSTEP_SYSTEM_ROOT" $fixup_paths `
2000-06-13 15:14:23 +00:00
endif
1999-09-20 08:20:57 +00:00
2007-02-14 05:47:05 +00:00
set GNUSTEP_TOOLS_PATHLIST = ` $GNUSTEP_MAKEFILES /print_unique_pathlist.sh "$GNUSTEP_USER_TOOLS" "$GNUSTEP_LOCAL_TOOLS" "$GNUSTEP_NETWORK_TOOLS" "$GNUSTEP_SYSTEM_TOOLS" $fixup_paths `
2007-02-16 20:14:44 +00:00
foreach dir ( "${GNUSTEP_SYSTEM_ADMIN_TOOLS}" "${GNUSTEP_NETWORK_ADMIN_TOOLS}" "${GNUSTEP_LOCAL_ADMIN_TOOLS}" "${GNUSTEP_USER_ADMIN_TOOLS}" )
if ( -d "${dir}" && -w "${dir}" ) then
if ( { ( echo "${GNUSTEP_TOOLS_PATHLIST}" | fgrep -v "${dir}" >/dev/null) } ) then
setenv GNUSTEP_TOOLS_PATHLIST "${dir}:${GNUSTEP_TOOLS_PATHLIST}"
endif
endif
end
2002-01-11 12:33:07 +00:00
set temp_path = ""
2007-03-08 14:17:58 +00:00
foreach dir ( ` /bin/sh -c 'IFS=:; for i in ' "${GNUSTEP_TOOLS_PATHLIST}" '; do echo $i; done' ` )
2007-02-14 05:47:05 +00:00
set temp_path = "${temp_path}${dir}:"
2006-10-02 15:54:56 +00:00
if ( "${GNUSTEP_IS_FLATTENED}" == "no" ) then
2007-02-14 05:47:05 +00:00
set temp_path = "${temp_path}${dir}/${GNUSTEP_HOST_CPU}/${GNUSTEP_HOST_OS}/${LIBRARY_COMBO}:"
set temp_path = "${temp_path}${dir}/${GNUSTEP_HOST_CPU}/${GNUSTEP_HOST_OS}:"
2000-12-05 16:11:55 +00:00
endif
1999-06-02 03:16:12 +00:00
end
2002-01-11 12:33:07 +00:00
if ( ! ${ ?PATH } ) then
setenv PATH "${temp_path}"
else if ( { ( echo "$PATH" | fgrep -v "$temp_path" >/dev/null) } ) then
setenv PATH "${temp_path}${PATH}"
endif
unset temp_path dir
2007-02-14 05:47:05 +00:00
unset GNUSTEP_TOOLS_PATHLIST
2002-01-11 12:33:07 +00:00
2003-04-22 13:40:14 +00:00
source "${GNUSTEP_MAKEFILES}/ld_lib_path.csh"
1998-04-06 03:01:59 +00:00
2007-02-14 05:47:05 +00:00
set gnustep_class_path = ` $GNUSTEP_MAKEFILES /print_unique_pathlist.sh "$GNUSTEP_USER_LIBRARY/Libraries/Java" "$GNUSTEP_LOCAL_LIBRARY/Libraries/Java" "$GNUSTEP_NETWORK_LIBRARY/Libraries/Java" "$GNUSTEP_SYSTEM_LIBRARY/Libraries/Java" $fixup_paths `
2001-05-05 10:44:11 +00:00
if ( ! ${ ?CLASSPATH } ) then
setenv CLASSPATH "${gnustep_class_path}"
2002-01-11 12:33:07 +00:00
else if ( { ( echo "${CLASSPATH}" | fgrep -v "${gnustep_class_path}" >/dev/null) } ) then
2001-05-05 10:44:11 +00:00
setenv CLASSPATH "${CLASSPATH}:${gnustep_class_path}"
endif
2002-01-11 12:33:07 +00:00
unset gnustep_class_path
2001-05-05 10:44:11 +00:00
2007-02-14 05:47:05 +00:00
set gnustep_guile_path = ` $GNUSTEP_MAKEFILES /print_unique_pathlist.sh "$GNUSTEP_USER_LIBRARY/Libraries/Guile" "$GNUSTEP_LOCAL_LIBRARY/Libraries/Guile" "$GNUSTEP_NETWORK_LIBRARY/Libraries/Guile" "$GNUSTEP_SYSTEM_LIBRARY/Libraries/Guile" $fixup_paths `
2003-04-25 15:16:36 +00:00
2007-02-14 02:31:17 +00:00
if ( ! ${ ?GUILE_LOAD_PATH } ) then
2003-04-25 15:16:36 +00:00
setenv GUILE_LOAD_PATH "${gnustep_guile_path}"
else if ( { ( echo "${GUILE_LOAD_PATH}" | fgrep -v "${gnustep_guile_path}" >/dev/null) } ) then
setenv GUILE_LOAD_PATH "${gnustep_guile_path}:${GUILE_LOAD_PATH}"
2002-10-05 00:14:59 +00:00
endif
2003-04-25 15:16:36 +00:00
unset gnustep_guile_path
2007-02-26 15:20:05 +00:00
set gnustep_info_path = ` $GNUSTEP_MAKEFILES /print_unique_pathlist.sh "$GNUSTEP_USER_DOC_INFO" "$GNUSTEP_LOCAL_DOC_INFO" "$GNUSTEP_NETWORK_DOC_INFO" "$GNUSTEP_SYSTEM_DOC_INFO" $fixup_paths `
2007-01-09 11:25:15 +00:00
if ( ! ${ ?INFOPATH } ) then
setenv INFOPATH "${gnustep_info_path}:"
else if ( { ( echo "${INFOPATH}" | fgrep -v "${gnustep_info_path}" >/dev/null) } ) then
setenv INFOPATH "${INFOPATH}:${gnustep_info_path}:"
endif
unset gnustep_info_path
1998-04-06 03:01:59 +00:00
#
# Perform any user initialization
#
2002-01-11 12:33:07 +00:00
if ( -e "$GNUSTEP_USER_ROOT/GNUstep.csh" ) then
2002-06-29 10:37:49 +00:00
source "$GNUSTEP_USER_ROOT/GNUstep.csh"
1998-04-06 03:01:59 +00:00
endif
1998-09-03 14:35:49 +00:00
2007-02-14 05:47:05 +00:00
unsetenv GNUSTEP_SYSTEM_APPS
2007-02-16 20:14:44 +00:00
unsetenv GNUSTEP_SYSTEM_ADMIN_APPS
2007-02-14 05:47:05 +00:00
unsetenv GNUSTEP_SYSTEM_TOOLS
2007-02-16 20:14:44 +00:00
unsetenv GNUSTEP_SYSTEM_ADMIN_TOOLS
2007-02-14 05:47:05 +00:00
unsetenv GNUSTEP_SYSTEM_LIBRARY
unsetenv GNUSTEP_SYSTEM_HEADERS
unsetenv GNUSTEP_SYSTEM_LIBRARIES
2007-02-26 15:20:05 +00:00
unsetenv GNUSTEP_SYSTEM_DOC
unsetenv GNUSTEP_SYSTEM_DOC_MAN
unsetenv GNUSTEP_SYSTEM_DOC_INFO
2007-02-14 05:47:05 +00:00
unsetenv GNUSTEP_NETWORK_APPS
2007-02-16 20:14:44 +00:00
unsetenv GNUSTEP_NETWORK_ADMIN_APPS
2007-02-14 05:47:05 +00:00
unsetenv GNUSTEP_NETWORK_TOOLS
2007-02-16 20:14:44 +00:00
unsetenv GNUSTEP_NETWORK_ADMIN_TOOLS
2007-02-14 05:47:05 +00:00
unsetenv GNUSTEP_NETWORK_LIBRARY
unsetenv GNUSTEP_NETWORK_HEADERS
unsetenv GNUSTEP_NETWORK_LIBRARIES
2007-02-26 15:20:05 +00:00
unsetenv GNUSTEP_NETWORK_DOC
unsetenv GNUSTEP_NETWORK_DOC_MAN
unsetenv GNUSTEP_NETWORK_DOC_INFO
2007-02-14 05:47:05 +00:00
2007-02-16 20:14:44 +00:00
unsetenv GNUSTEP_LOCAL_APPS
unsetenv GNUSTEP_LOCAL_ADMIN_APPS
unsetenv GNUSTEP_LOCAL_TOOLS
unsetenv GNUSTEP_LOCAL_ADMIN_TOOLS
unsetenv GNUSTEP_LOCAL_LIBRARY
unsetenv GNUSTEP_LOCAL_HEADERS
unsetenv GNUSTEP_LOCAL_LIBRARIES
2007-02-26 15:20:05 +00:00
unsetenv GNUSTEP_LOCAL_DOC
unsetenv GNUSTEP_LOCAL_DOC_MAN
unsetenv GNUSTEP_LOCAL_DOC_INFO
2007-02-16 20:14:44 +00:00
2007-02-14 05:47:05 +00:00
unsetenv GNUSTEP_USER_APPS
2007-02-16 20:14:44 +00:00
unsetenv GNUSTEP_USER_ADMIN_APPS
2007-02-14 05:47:05 +00:00
unsetenv GNUSTEP_USER_TOOLS
2007-02-16 20:14:44 +00:00
unsetenv GNUSTEP_USER_ADMIN_TOOLS
2007-02-14 05:47:05 +00:00
unsetenv GNUSTEP_USER_LIBRARY
unsetenv GNUSTEP_USER_HEADERS
unsetenv GNUSTEP_USER_LIBRARIES
2007-02-26 15:20:05 +00:00
unsetenv GNUSTEP_USER_DOC
unsetenv GNUSTEP_USER_DOC_MAN
unsetenv GNUSTEP_USER_DOC_INFO