#! /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 # # 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 3 # 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. # If not, write to the Free Software Foundation, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # Check that we are given a valid option. if [ -z "$1" ]; then echo "usage: gnustep-config argument" echo "gnustep-config --help for more help" exit 1 fi case "$1" in --variable=*) ;; --help) ;; --objc-flags) ;; --objc-libs) ;; --base-libs) ;; --gui-libs) ;; *) # An unrecognized option echo "Unrecognized option: $1" echo "usage: gnustep-config argument" echo "gnustep-config --help for more help" exit 1;; esac # Process --help if [ "$1" = "--help" ]; then echo "usage: gnustep-config [option]" echo echo "This program prints information on the current gnustep" echo "installation. [option] determines what is printed. Here" echo "is the list of options:" echo echo "--variable=xxx: prints the value of the specified" echo " variable. Here is a list of possible" echo " variables:" echo echo " --variable=GNUSTEP_MAKEFILES" echo " --variable=GNUSTEP_USER_DIR" echo " --variable=GNUSTEP_USER_DEFAULTS_DIR" echo " --variable=GNUSTEP_HOST" echo " --variable=GNUSTEP_HOST_CPU" echo " --variable=GNUSTEP_HOST_VENDOR" echo " --variable=GNUSTEP_HOST_OS" echo " --variable=GNUSTEP_IS_FLATTENED" echo " --variable=GNUSTEP_xxx_APPS" echo " --variable=GNUSTEP_xxx_TOOLS" echo " --variable=GNUSTEP_xxx_LIBRARY" echo " --variable=GNUSTEP_xxx_HEADERS" echo " --variable=GNUSTEP_xxx_LIBRARIES" echo " --variable=GNUSTEP_xxx_DOC" echo " --variable=GNUSTEP_xxx_DOC_MAN" echo " --variable=GNUSTEP_xxx_DOC_INFO" echo " where 'xxx' could be any of 'SYSTEM', 'NETWORK', 'LOCAL' and 'USER'." echo echo " For example, you could get the value of GNUSTEP_SYSTEM_TOOLS to find" echo " where command-line system programs are located on this system." echo echo "--objc-flags: prints all the flags required to compile an ObjC file" echo echo "--objc-libs: prints all the flags required to link a pure ObjC program (no foundation/gui)" echo echo "--base-libs: prints all the flags required to link a command-line ObjC program (no gui)" echo echo "--gui-libs: prints all the flags required to link a GUI ObjC program" echo exit 0 fi # Any other option requires determining the config first. # # 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_MAKEFILES" ]; then GNUSTEP_MAKEFILES=@GNUSTEP_MAKEFILES@ fi export GNUSTEP_MAKEFILES # # If all they want to know if GNUSTEP_MAKEFILES or anything that # we can compute only using GNUSTEP_MAKEFILES, we can print it out # case "$1" in --variable=GNUSTEP_MAKEFILES) echo "$GNUSTEP_MAKEFILES" exit 0;; --objc-flags) @GNUMAKE@ -f "$GNUSTEP_MAKEFILES/empty.make" print-gnustep-make-objc-flags quiet=yes 2>/dev/null exit 0;; --objc-libs) @GNUMAKE@ -f "$GNUSTEP_MAKEFILES/empty.make" print-gnustep-make-objc-libs quiet=yes 2>/dev/null exit 0;; --base-libs) @GNUMAKE@ -f "$GNUSTEP_MAKEFILES/empty.make" print-gnustep-make-base-libs quiet=yes 2>/dev/null exit 0;; --gui-libs) @GNUMAKE@ -f "$GNUSTEP_MAKEFILES/empty.make" print-gnustep-make-gui-libs quiet=yes 2>/dev/null exit 0;; esac # # Else, now read all the standard GNUstep config # GNUSTEP_SH_EXPORT_ALL_VARIABLES=yes . $GNUSTEP_MAKEFILES/GNUstep.sh unset GNUSTEP_SH_EXPORT_ALL_VARIABLES # # Now print whatever variable they asked for # gs_variable_name=`echo "$1" | sed -e 's/--variable=//'` gs_variable_value=$(eval echo "\$$gs_variable_name") if [ "$gs_variable_value" != "" ]; then echo "$gs_variable_value" fi