#!/bin/sh #@(#)$Revision: 1.23 $ $Date: 11/14/2002 11:34:44 $ # +---------------------------------------------------------------------+ # | Copyright (c) 2002, 2002 Rational Software Corporation. All Rights | # | Reserved. This software contains proprietary and confidential | # | information of Rational and its suppliers. Use, disclosure or | # | reproduction is prohibited without the prior express written | # | consent of Rational | # +---------------------------------------------------------------------+ # Lines beginning with '##' are not applicable to quantify.configure. #************************************************************************** #SOHT # #NAME # product.configure - Configure Rational PRODUCT for UNIX. # #SYNOPSIS # product.configure [] # #DESCRIPTION # This script performs these tasks: # o Cache directory configuration. # o On-line help setup. # o ClearQuest configuration (purify and purecov only). # o Runs the product.post_install script. # o Runs the product_test script. # o Validates the release set up. It reports on things which are # missing or not set up properly. # #OPTIONS # -batch (alias: -b) # Run in non-interactive mode. Use suitable defaults for # anything not specified by other options. In practice, this # means if something is already set and not overridden by # options, leave it alone. If there are no other command line # options, -batch just causes product.test_install to be run. # # -cache-dir (alias: -ca) # Specifies the cache directory location. If not specified, # the default is product_home_dir/cache. # # -cc32 # Specify a 32-bit C or C++ compiler to use for self-test, if # defaults are not suitable. May be either a full or relative # pathname or a simple name. If a simple name, it must be # locatable via the path. Default will be as per # product.test_install. It is the user's responsibility to # make sure it is a compiler we support since you cannot # deduce this reliably from the name. # # -cc64 # Specify a 64-bit C or C++ compiler to use for self-test, if # defaults are not suitable. May be either a full or relative # pathname or a simple name. If a simple name, it must be # locatable via the path. Default will be as per # product.test_install. It is the user's responsibility to # make sure it is a compiler we support since you cannot # deduce this reliably from the name. # # -check (alias: -c) # Doesn't set anything or change any settings, just performs # a health check and warns you about potential installation # problems. All other options, except -install_dir and -norun # are ignored. See below for details. ## ## The next 3 options are part of the Rational ClearQuest integration ## configuration. These 3 options are only applicable to Purify ## and PureCoverage. Refer to on-line help system for the steps to ## configure something other than ClearQuest (look for ClearQuest ## in the index). ## ## -cq_client {X|web|default} (alias: -cqc) ## Specifies which ClearQuest client interface to use. If not ## specified, defaults to 'default', meaning whatever is natural ## for this platform; X on platforms where ClearQuest's native X ## client is support, web elsewhere. It is an error to ## specify X on a platform where ClearQuest's X client is not ## supported. ## ## -cq_db (alias: -cqd) ## Specifies a ClearQuest database name. No logical default. ## ## -cq_url (alias: -cqu) ## Specifies a web URL for the ClearQuest Web client. If not ## specified, will issue a warning if -cq_client is web. # # -doc_dir (alias: -d) # Configure location of on-line help and install guide. If # directory doesn't exist or doesn't appear to contain our # docs, a warning is issued, but links are created anyway. # Expected relative dir layout between help and install guide # is same as in a real rs_install installation. Since the # Japanese product uses the English docs today, this option # is suitable for both English and Japanese releases today. # # -help (alias: -h) # Prints this message. All other options are ignored. # # -install_dir (alias: -i) # Optional installation directory. Generally not needed as # the script can infer the product home directory location # from it's own location, but will be needed if for some # reason that's the wrong place. This can happen if the # script is actually a link or it is invoked via the path # and locates an installation other than the desired one. # # -license (alias: -l) # Specify the content of .lm_license_file. # The supplied string format is the same as the LM_LICENSE_FILE # environment variable. It must be one or more port@host # specifications or pathnames to license files, separated # by colons. Rational recommends you only use this under # Technical Support supervision. # # When licensing is set or changed, using this option or # through the interactive interface, the 'product -test-license' # command is run to validate the result. # # -norun (alias: -n) # Disables the running of product.test_install. By default, # product.test_install is always run as the last step. In # interactive mode, the user is queried about whether or not # to run the self-test. # # -run (alias: -r) # Enables the running product.test_install. By default, # product.test_install is always run as the last step. In # interactive mode, the user is queried about whether or not # to run the self-test. # # -verbose (alias: -v) # Most useful in batch mode. Prints out progress and summary # information. See Use Case #6 for a possible implementation. # #SUPPORTED PLATFORMS # This script is currently supported on the following UNIX platforms: # HP-UX: ppc_support_hp="B.10.20 B.11.00 B.11.11" # SGI IRIX: ppc_support_sg32="6.5" # Solaris: ppc_support_sol="5.5.1 5.6 5.7 5.8 5.9" # The ppc_allow_* settings tell this script to run on that O/S, # but it will not be mentioned as one of the support platforms. # #Rational Software Corporation Last change: $Date: 11/14/2002 11:34:44 $ #EOHT # Use this to allow others: # ppc_allow_=" " #************************************************************************** # # NOTES TO ANYONE MODIFYING THIS SCRIPT: # # This script must not exit if run by rs_install. The ppf_exit function # must be used, not the exit command. # # All variables set in this script begin with ppc_ but there are a few # exceptions (environment variables used by other programs and # rs_install such as in the ppf_get_option function). Some vars will # contain the string _ppc_. # # All variables saved from invocation to invocation begin with pcu_. # The variables are stored in a defaults file by ppf_save_defaults. # # All functions begin with ppf_. # #************************************************************************** # Help text for prompts in this script (see ppf_get_option function calls). #START:pcu_cache_dir:Cache Directory Configuration # To improve build-time performance, instrumented versions of # libraries and object files are cached. A file is written to a # global cache directory if the file's original directory is not # writable. # # By default, the cache directory is created under the product # install directory. You do not need to change this unless the # install file system is not writable or does not have enough free # space. Rational recommends 256000 KB be available, but # requirements can vary significantly from installation to # installation. #END:pcu_cache_dir: #START:pcu_cq_client:ClearQuest Client (X or web) # Enter web for web or X for X client. # This will configure the product to launch ClearQuest via the # web or via an X-client application when you want to create a # change request. #END:pcu_cq_client: #START:pcu_cq_db:ClearQuest Database Name # This is the name of your change request (also known as 'defect') database # specified by your ClearQuest Database Administrator. If you do not know # the name you can enter a placeholder like 'DB' until you can find out later. # # If there is no default, and you do not know the ClearQuest database name, # enter the word: none #END:pcu_cq_db: #START:pcu_cq_setup:ClearQuest Integration Configuration # Enter yes to set up the Rational ClearQuest Integration for this product. # You will need to provide 3 pieces of information: # # 1. The ClearQuest database name. # 2. The preferred method of running ClearQuest (X client or web interface) # Web is the only method on SGI IRIX. # 3. The Web URL to the ClearQuest logon on a Windows machine. # # This information is saved in a file called pure_crms. #END:pcu_cq_setup: #START:pcu_cq_url:ClearQuest Web URL # Enter the web address (URL) to the logon screen for ClearQuest Web. # The URL is used by this product to connect to ClearQuest via the web. # Even if you are using X as the client, it is a good idea to configure # the web URL too. The address can start with http:// or it can be left out. # # If there is no default, and you do not know the ClearQuest Web URL, # enter the word: none #END:pcu_cq_url: #START:pcu_doc_dir:Online Documentation Configuration # Enter the directory where the PurifyPlus documents are installed. # This directory is usually installed in: # "Rational_dir/releases/PurifyPlusFamily./docs # In prior releases it was installed in a DeveloperTools directory: # "Rational_dir/releases/DeveloperTools."version"/docs # If you do not know the directory, enter a non-existent one. # Then you can tell this program to skip configuring the documentation. # You can do it later when you know the location of the documents. # # If there is no default, and you do not want to configure the online # documentation at this time, enter the word: none #END:pcu_doc_dir: #START:pcu_license:License Configuration # Enter the full pathname to a license file, or enter port@host of the # license server, or enter a colon-separated list of files or port@hosts. # These tell this product where the licenses are or what license server # to get a license from. This is configured when the product is # installed by rs_install or license_setup. #END:pcu_license: #START:pcu_skip_docs:Skip Documentation Configuration # Enter y for yes or n for no. # # Enter yes to skip documentation configuration. # What this means is that the on-line help will not work. # If you enter no, then this command will prompt you again # for the location of the on-line documents. #END:pcu_skip_docs: #START:ppc_lic_opt:License Selection # Enter a number corresponding to one of the licenses shown in the list. # You can also enter the full pathname to a license file, or enter # port@host of the license server, or enter a colon-separated list of # files or port@hosts. These tell this product where the licenses are or # what license server to get a license from. This is configured when the # product is installed by rs_install or license_setup. #END:ppc_lic_opt: #START:yn_ppc_rm_cache:Remove Existing Cache # Enter y for yes or n for no. # # Enter yes to remove the current cache. You must remove the cache # to create one outside the product home directory. A symbolic link to # the real cache will be put in its place. # # Enter no and the cache will be preserved. #END:yn_ppc_rm_cache: #START:yn_ppc_run_test:Run Again # Enter y for yes or n for no. # # The self-test has already run successfully. However, if you changed # any of the configuration parameters, you should run it again. It is # a good idea to do this since it will initialize the cache if that # has not already been done. Then, when the product is used it will # run faster the first time. Enter yes to run the self-test again. #END:yn_ppc_run_test: #START:yesno: # Enter y for yes or n for no. #END:yesno: #************************************************************************** #------------------------------------------------------------------------ ppf_Usage() { #------------------------------------------------------------------------ # Extract the text between #SOHT and #EOHT in this script ppc_product_list="Purify/Quantify/PureCov" case $ppc_prod_cmd in purify|purecov|quantify ) ppc_prod_home_dir=${ppc_prod_cmd}_home_dir ;; * ) ppc_prod_home_dir="" ppc_prod_cmd="" ;; esac sed -e '1,/^#SOHT/d' -e '/^#EOHT/,$d' \ -e "$ppc_sed_usage" -e 's/^#//' \ -e "s?PRODUCT?${ppc_product:-$ppc_product_list}?g" \ -e "s?product -test?$ppc_prod_cmd -test?g" \ -e "s?product_home_dir?$ppc_prod_home_dir?g" \ -e "s?product\.?$ppc_prod_cmd.?g" \ -e "s?product_?${ppc_prod_cmd}_?g" \ $ppc_file | more echo echo "Please read the installation guide for more details." echo ppc_do_run_main=false } #------------------------------------------------------------------------ ppf_exit() { #------------------------------------------------------------------------ if [ "$1" = q ] then echo " $ppc_cmd: Quit by user." exit 0 fi case $ppc_errors in 0 ) ppc_err_mesg="No errors" ;; 1 ) ppc_err_mesg="1 error (***)" ;; * ) ppc_err_mesg="$ppc_errors errors (***)" ;; esac case $ppc_warnings in 0 ) ppc_warn_mesg="No warnings" ;; 1 ) ppc_warn_mesg="1 warning (!!!)" ;; * ) ppc_warn_mesg="$ppc_warnings warnings (!!!)" ;; esac if $ppc_show_errors_warnings then if $ppc_no_usage_error && $ppc_do_run_main then echo echo " $ppc_cmd completed: $ppc_err_mesg, $ppc_warn_mesg." fi fi if $ppc_check then # In check mode, return error status (>0) for both errors and warnings. ppc_errors=`expr $ppc_errors + $ppc_warnings` fi if $ppc_run_by_rs_install then HELP_FILE=$ppc_save_help_file menu_title=$ppc_save_menu_title Logging_started=$ppc_save_Logging_started return else exit $ppc_errors fi } #------------------------------------------------------------------------ ppf_error() { #------------------------------------------------------------------------ ppc_errors=`expr $ppc_errors + 1` echo "*** [Error $ppc_errors] $*" } #------------------------------------------------------------------------ ppf_warn() { #------------------------------------------------------------------------ ppc_warnings=`expr $ppc_warnings + 1` echo "!!! [Warning $ppc_warnings] $*" } #------------------------------------------------------------------------ ppf_cmnd() { #------------------------------------------------------------------------ if $ppc_verbose_mode then echo " $*" fi eval $* return $? } #------------------------------------------------------------------------ ppf_on_path() { #------------------------------------------------------------------------ # If command (arg1) on search PATH, return true. for ppc_tmp_dir in `(IFS=: ; echo $PATH)` do test -x $ppc_tmp_dir/$1 -a ! -d $ppc_tmp_dir/$1 && return 0 done return 1 } #------------------------------------------------------------------------ ppf_is_lic_file() { #------------------------------------------------------------------------ # Check if file (arg1) contains any PurifyPlus product INCREMENT # or FEATURE lines. test -r $1 || return 1 grep "^INCREMENT" $1 | egrep "$ppc_lic_feats" >/dev/null && return 0 grep "^FEATURE" $1 | egrep "$ppc_lic_feats" >/dev/null && return 0 return 1 } #------------------------------------------------------------------------ ppf_add_lic_list() { #------------------------------------------------------------------------ # If license info (arg1) is a port@host, add to ppc_port_list. # If license info is a license file, check for product specific # licenses and add to the list ppc_lic_list if any are present. case $1 in *@* ) echo " $ppc_port_list " | grep " $1 " >/dev/null && return ppc_port_list="$ppc_port_list $1" ;; /* ) ppf_is_lic_file $1 || return echo " $ppc_lic_list " | grep " $1 " >/dev/null && return ppc_lic_list="$ppc_lic_list $1" test -n "$def_pcu_license" && return ppc_port_at_host=`grep "^SERVER" $1 | awk '{printf("%s@%s:",$4,$2)}'` if [ -n "$ppc_port_at_host" ] then def_pcu_license=`echo "$ppc_port_at_host" | sed -e 's?:$??'` ppc_port_list="$def_pcu_license $ppc_port_list" fi ;; esac } #------------------------------------------------------------------------ ppf_set_rd_list() { #------------------------------------------------------------------------ test -n "$ppc_rd_list" && return ppc_rd_list=$ppc_ratl_dir for ppc_tmp_dir in $rd_list do test -d $ppc_tmp_dir || continue ppc_rd_list="$ppc_rd_list $ppc_tmp_dir" done } #------------------------------------------------------------------------ ppf_list_each_rd_defaults() { #------------------------------------------------------------------------ # List all the default files for this product in each rational-dir. for ppc_tmp_dir in $ppc_rd_list do echo $ppc_tmp_dir/releases/*/$ppc_defaults done } #------------------------------------------------------------------------ ppf_list_other_defaults() { #------------------------------------------------------------------------ # Sort the list by time, ignore any not found. /bin/ls -t1 `ppf_list_each_rd_defaults 2>/dev/null` } #------------------------------------------------------------------------ ppf_get_default_from_other() { #------------------------------------------------------------------------ ppf_set_rd_list for ppc_other_def in `ppf_list_other_defaults 2>/dev/null` do eval `grep "^_$ppc_var=" $ppc_other_def` eval ppc_val=\$_$ppc_var if [ -n "$ppc_val" -a "$ppc_val" != none ] then eval $ppc_var=\$ppc_val return fi done } #------------------------------------------------------------------------ ppf_extract_lic_from_default_files() { #------------------------------------------------------------------------ egrep "^rsu_license_file=|^rsu_lic_file=" \ $ppc_config/defaults/* 2>/dev/null | sed -e 's?.*=??' -e 's?"??g' -e "s?'??g" | sort -u } #------------------------------------------------------------------------ ppf_set_defaults() { #------------------------------------------------------------------------ ppc_releases=`dirname $ppc_install_dir` ppc_ratl_dir=`dirname $ppc_releases` ppc_config=$ppc_ratl_dir/config if [ -z "$RSU_LICENSE_MAP" ] then for ppc_lic_map in PurifyPlus_License_Map License_Map do test -f $ppc_config/$ppc_lic_map || continue $ppc_prntv " Setting RSU_LICENSE_MAP:" ppf_cmnd RSU_LICENSE_MAP=$ppc_config/$ppc_lic_map ppf_cmnd export RSU_LICENSE_MAP break done fi def_pcu_cache_dir=$ppc_install_dir/cache if [ $ppc_sym_link $def_pcu_cache_dir ] then set -- `/bin/ls -ld $def_pcu_cache_dir` shift `expr $# - 1` if [ -d "$1" ] then ppc_cache_link_to=$1 fi fi def_pcu_cq_setup=yes case $ppc_sys in sol|hp ) def_pcu_cq_client=X ;; * ) def_pcu_cq_client=web ;; esac if [ -f $ppc_defaults ] then # Load_defaults is set false by rs_install in record and playback mode. if ${Load_defaults:-true} then . ./$ppc_defaults fi fi if [ -f .lm_license_file ] then pcu_license=`cat .lm_license_file` fi if [ -z "$pcu_license" ] then $ppc_prntv $ppc_prntv " Determining existing license information..." if [ -n "$LM_LICENSE_FILE" ] then for ppc_lic in `(IFS=: ; echo "$LM_LICENSE_FILE" )` do $ppc_prntv " LM_LICENSE_FILE: $ppc_lic" ppf_add_lic_list $ppc_lic done fi for ppc_lic in `ppf_extract_lic_from_default_files` do $ppc_prntv " rs_install defaults: $ppc_lic" ppf_add_lic_list $ppc_lic done if [ -n "$ppc_port_list" -o -n "$ppc_lic_list" ] then ppc_lic_n=0 for ppc_lic in $ppc_port_list $ppc_lic_list do ppc_lic_n=`expr $ppc_lic_n + 1` eval ppc_license$ppc_lic_n=\$ppc_lic if [ "$ppc_lic" = "$def_pcu_license" ] then ppc_license_list="$ppc_license_list ---> $ppc_lic_n) $ppc_lic " ppc_lic_opt=$ppc_lic_n else ppc_license_list="$ppc_license_list $ppc_lic_n) $ppc_lic " fi done fi fi # Check these 2 vars. If not set in the current defaults file, # look in other product release directories to see if these is # set there. pcu_cq_url=${pcu_cq_url:-$rsu_cq_web_url} for ppc_var in pcu_cq_db pcu_cq_url do eval ppc_val=\$$ppc_var test -n "$ppc_val" && continue ppf_get_default_from_other done if [ -z "$pcu_doc_dir" ] then for ppc_reldir in `/bin/ls -d1t $ppc_releases/PurifyPlus* \ $ppc_releases/DeveloperTools.* \ $ppc_releases/DevelopmentStudioUNIX.* 2>/dev/null` do if [ -d $ppc_reldir/docs/html/$ppc_prod_cmd ] then def_pcu_doc_dir=$ppc_reldir/docs break fi done fi set -- `./$ppc_prod_cmd -version` shift ppc_prod_vers=$1 ppc_prod_ver_os=$* } #------------------------------------------------------------------------ ppf_save_defaults() { #------------------------------------------------------------------------ # All product configuration parameters are specified as shell variables # with the prefix 'pcu_' for PurifyPlus Configuration by User (pcu). # The exceptions are the 2 PURE_COMPILERS environment variables. echo "# Defaults used by $ppc_cmd: _pcu_license='$pcu_license' _pcu_cache_dir='$pcu_cache_dir' _pcu_doc_dir='$pcu_doc_dir' _PURE_COMPILERS='$PURE_COMPILERS' _PURE_COMPILERS_64='$PURE_COMPILERS_64' _pcu_cq_setup='$pcu_cq_setup' _pcu_cq_client='$pcu_cq_client' _pcu_cq_db='$pcu_cq_db' _pcu_cq_url='$pcu_cq_url' # Use first if specified on command line, otherwise use what is set above. pcu_license=\${pcu_license:-\$_pcu_license} pcu_cache_dir=\${pcu_cache_dir:-\$_pcu_cache_dir} pcu_doc_dir=\${pcu_doc_dir:-\$_pcu_doc_dir} PURE_COMPILERS=\${PURE_COMPILERS:-\$_PURE_COMPILERS} PURE_COMPILERS_64=\${PURE_COMPILERS_64:-\$_PURE_COMPILERS_64} pcu_cq_setup=\${pcu_cq_setup:-\$_pcu_cq_setup} pcu_cq_client=\${pcu_cq_client:-\$_pcu_cq_client} pcu_cq_db=\${pcu_cq_db:-\$_pcu_cq_db} pcu_cq_url=\${pcu_cq_url:-\$_pcu_cq_url} " > $ppc_install_dir/$ppc_defaults } #------------------------------------------------------------------------ ppf_show_help() { #------------------------------------------------------------------------ set -- 1 `grep "^#START:$option_name:" $HELP_FILE` shift if [ $# -eq 0 ] then echo echo " Sorry, there is no additional help for this prompt." echo return fi # Set help message title. Center it. ppc_help_title=`echo "$*" | awk -F: '{print $3}'` ppc_help_title="Help on: $ppc_help_title" set -- `echo "$ppc_help_title" | wc -c` ppc_n=`expr \( 72 - $1 \) / 2` ppc_indent=`echo " " | cut -c1-$ppc_n` echo " $ppc_help_delim" echo " ${ppc_indent}$ppc_help_title" echo " $ppc_help_delim" sed -e "1,/^#START:$option_name:/d" \ -e "/^#END:$option_name:/,\$d" \ -e 's/^# //' -e 's/^#//' \ -e "s?^? ?" \ $HELP_FILE echo " $ppc_help_delim" ppc_prompt="Press the Enter key when done reading help text: " if $ppc_run_by_rs_install then # Let rs_install do all the keyboard input. That way, if running # in record or playback mode, this script will still work. rsf_input nothing Logging_started=true rsf_log_input "$nothing" "$ppc_prompt" Logging_started=false else # Do our own input. $ppc_echon " $ppc_prompt $ppc_nocr" read ppc_nothing < /dev/tty fi } #------------------------------------------------------------------------ ppf_expand_tilde() { #------------------------------------------------------------------------ # Use csh to expand ~. /bin/csh -f </dev/null return 0 fi test $ppc_sym_link "$1" && /bin/rm -f "$1" # Need to make the directory. Keep track of the part that # is created in ppc_dir_created. Use it in ppf_remove_dir # to remove directory, if necessary. ppc_dir_created=`basename $1` ppc_dir_exists=`dirname $1` while [ ! -d $ppc_dir_exists -a "$ppc_dir_exists" != / ] do ppc_dir_created=`basename $ppc_dir_exists`/$ppc_dir_created ppc_dir_exists=`dirname $ppc_dir_exists` done if ppf_cmnd mkdir -p $ppc_dir_exists/$ppc_dir_created then if ppf_cmnd chmod 777 $ppc_dir_exists/$ppc_dir_created then return 0 fi fi return 1 } #------------------------------------------------------------------------ ppf_remove_dir() { #------------------------------------------------------------------------ test -n "$ppc_dir_created" || return if /bin/rmdir $ppc_dir_exists/$ppc_dir_created 2>/dev/null then ppc_dir_created=`dirname $ppc_dir_created` while [ -n "$ppc_dir_created" -a "$ppc_dir_created" != . ] do if /bin/rmdir $ppc_dir_exists/$ppc_dir_created 2>/dev/null then ppc_dir_created=`dirname $ppc_dir_created` else break fi done fi } #------------------------------------------------------------------------ ppf_dir_writable_by_all() { #------------------------------------------------------------------------ ppc_tmp_dir=$1 set -- `/bin/ls -ld "$ppc_tmp_dir"` case $1 in drw?rw?rw* ) return 0 ;; d* ) if [ -w "$ppc_tmp_dir" ] then echo echo " The cache directory does not have read/write permissions" echo " for all users:" /bin/ls -ld "$ppc_tmp_dir" return 1 else echo echo " The cache directory does not have read/write permissions" echo " for all users, including you ($USER):" /bin/ls -ld "$ppc_tmp_dir" return 2 fi ;; * ) echo echo " This is not a directory:" /bin/ls -ld "$ppc_tmp_dir" return 3 ;; esac } #------------------------------------------------------------------------ ppf_update_file() { #------------------------------------------------------------------------ # If file1 (arg1) exists, compare it to file2 (arg 2). # If they differ, update file1 with the contents of file2. # If file1 does not exist, create it using file2. # Remove file2 in any case. if [ -f $1 ] then if diff $1 $2 >/dev/null then $ppc_prntv $ppc_prntv " Up-to-date: $1" else /bin/rm -f $1 if /bin/cp $2 $1 then $ppc_prntv $ppc_prntv " Updated file: $1" else ppf_warn "Could not update: $1" fi fi else /bin/mv $2 $1 $ppc_prntv $ppc_prntv " Created file: $1" fi /bin/rm -f $2 } #------------------------------------------------------------------------ ppf_do_not_config_this() { #------------------------------------------------------------------------ # This function only returns true if it is determined that we do # not want to configure a specific parameter. This is true if the # following conditions are all met: # # 1. Running in batch mode. # 2. The user did not specify this parameter on the command line. # Arg 1 is the flag (true/false) if this was set on the command line. # 3. The configuration parameter file already exists. # Arg 2 is the test switch (-f , -d, $ppc_sym_link). # Arg 3 is the configuration file, directory or sym_link name. # 1. Are we running in batch mode? if $ppc_batch_mode then # 2. Did the user specify this parameter on the command line? if [ "${1:-false}" = false ] then # 3. Does the configuration parameter file already exists? if [ $2 $3 ] then return 0 fi fi fi return 1 } #------------------------------------------------------------------------ ppf_get_license() { # ------------------------------------------------------------------------ echo " $ppc_delim $ppc_product License Configuration $ppc_underln---------------------- Please enter the location of your licenses below. This information is usually collected by rs_install and you should not change the supplied default unless directed to do so by Rational Technical Support. You can enter the full pathname to the Rational license file or a port@host (for example: 1706@$HOST). You can enter a colon-separated list of licenses as supported by FLEXlm." if [ -z "$ppc_license2" ] then def_pcu_license=${def_pcu_license:-$ppc_license1} ppf_get_option pcu_license str \ "Enter the license source file or port@host :" return fi echo " Or enter a number from 1 to $ppc_lic_n to select one from the list below. $ppc_license_list" ppc_prior_lic_opt=$ppc_lic_opt while true do ppc_lic_opt=$ppc_prior_lic_opt ppf_get_option ppc_lic_opt str \ "Enter license file, port@host or a number (1-$ppc_lic_n) corresponding to a license above. :" case $ppc_lic_opt in [1-9]|[0-9][0-9] ) eval ppc_lic=\$ppc_license$ppc_lic_opt if [ -n "$ppc_lic" ] then pcu_license=$ppc_lic break fi echo echo " $ppc_lic_opt is out of range." ;; *@* ) pcu_license=$ppc_lic_opt break ;; /* ) if ppf_is_lic_file $ppc_lic_opt then pcu_license=$ppc_lic_opt break fi echo echo " This file does not exist or it does not contain" echo " any recognized PurifyPlus or $ppc_prod_cmd licenses:" echo " $ppc_lic_opt" ;; * ) echo echo " '$ppc_lic_opt' is not a recognized option." ;; esac echo echo " Please enter a number from 1 to $ppc_lic_n," echo " or a full pathname to a license file," echo " or a license port@host." done } #------------------------------------------------------------------------ ppf_set_license() { #------------------------------------------------------------------------ ppc_license_setup=${ppc_license_setup:-$ppc_setup_all} ppf_do_not_config_this "$ppc_license_setup" -f .lm_license_file && return $ppc_prntv $ppc_prntv " Creating license file: .lm_license_file" pcu_license=${pcu_license:-$def_pcu_license} echo "$pcu_license" > .lm_license_file } #------------------------------------------------------------------------ ppf_check_license() { #------------------------------------------------------------------------ $ppc_prntv $ppc_prntv " Checking license..." if [ ! -f .lm_license_file ] then ppc_license_status=$ppc_not_set ppf_error "License file '.lm_license_file' not found." return fi $ppc_prntv "./$ppc_prod_cmd -testlicense" if ppc_cmd_out=`./$ppc_prod_cmd -testlicense 2>&1` then if $ppc_verbose_mode then echo "$ppc_cmd_out" | sed -e 's?^? ?' -e 's?\*\*\*?|?' fi ppc_license_status=PASSED else echo "$ppc_cmd_out" | sed -e 's?^? ?' -e 's?\*\*\*?|?' ppc_license_status=FAILED ppf_error "License check failed." fi } #------------------------------------------------------------------------ ppf_get_cache_dir() { #------------------------------------------------------------------------ echo " $ppc_delim $ppc_product Cache Directory Configuration $ppc_underln------------------------------ To improve build-time performance, instrumented versions of libraries and object files are cached. A file is written to a global cache directory if the file's original directory is not writable. By default, the cache directory is created under the $ppc_product install directory. You do not need to change this unless the install file system is not writable or does not have enough free space. Rational recommends 256000 KB be available, but requirements can vary significantly from installation to installation. The specified directory must already exist and be writable, or it must be possible for this program to create it. The directory name must be fully-qualified from /." pcu_prior_cache_dir=$pcu_cache_dir while true do pcu_cache_dir=$pcu_prior_cache_dir ppf_get_option pcu_cache_dir dir \ "Enter the $ppc_product cache directory :" # Make sure the cache directory is a fully-qualified path name. case $pcu_cache_dir in /* ) ;; * ) echo " You must enter a fully-qualified path name." continue ;; esac # If the cache dir specified is the default and already # exists as a link to some where else, remove the link. if [ "$pcu_cache_dir" = "$def_pcu_cache_dir" ] then test $ppc_sym_link $def_pcu_cache_dir && /bin/rm -f $def_pcu_cache_dir fi if ppf_make_dir $pcu_cache_dir then ppf_dir_writable_by_all $pcu_cache_dir/. case $? in 0|1 ) # 0 is okay (writable by all) # 1 is okay (writable by installer). ;; 2 ) # Not writable by all users including installer. def_yn_ppc_use_cache=no ppf_get_option yn_ppc_use_cache y_n \ "Use this cache directory anyway?" test "$yn_ppc_use_cache" = no && continue ;; 3 ) # 3 is an error. Try again. continue ;; esac # If changing the cache, ask if they want to remove the # existing old one first. First check if it is linked. if [ -n "$ppc_cache_link_to" ] then if [ ! -d $ppc_cache_link_to ] then ppc_cache_dir_setup=true break fi if [ "$ppc_cache_link_to" = "$pcu_cache_dir" ] then # Cache is already set up. ppc_cache_dir_setup=false break fi echo " You specified a cache directory which is different from the current cache. This script will create a link to the new cache directory so that $ppc_product can use it. The script will also delete the existing link to the current cache. The current cache will be abandoned: $ppc_cache_link_to When changing the cache directory, we advise removing the current cache only after checking with the users of the installation. Removing the current cache directory will remove instrumented shared libraries stored there. Users will need to re-link applications which depend on these cached shared libraries." def_yn_ppc_rm_cache=no ppf_get_option yn_ppc_rm_cache y_n \ "Okay to remove the current cache now?" if [ "$yn_ppc_rm_cache" = yes ] then $ppc_echon " Removing current cache...$ppc_nocr" /bin/rm -fr $ppc_cache_link_to echo "done" else echo " Abandoning the current cache." fi # Will need to rerun the self-test to initialize the cache. /bin/rm -f $ppc_pass_file ${ppc_pass_file}64 ppc_cache_dir_setup=true break elif [ ! -d $def_pcu_cache_dir ] then # Not a link or a directory so it does not exist. break fi # Current cache exists. # Needs to be removed to use a linked cache. ppf_same_cache && break echo " You specified a cache directory which is different from the default. To set up a cache outside of the $ppc_product directory, this script needs to remove this directory: $def_pcu_cache_dir and create a symbolic link to the new cache directory." def_yn_ppc_rm_cache=yes ppf_get_option yn_ppc_rm_cache y_n \ "Remove default cache directory?" if [ "$yn_ppc_rm_cache" = yes ] then # Will need to rerun the self-test to initialize the cache. /bin/rm -f $ppc_pass_file ${ppc_pass_file}64 ppc_cache_dir_setup=true break else ppc_cache_dir_setup=false ppf_remove_dir fi fi done } #------------------------------------------------------------------------ ppf_set_cache_dir() { #------------------------------------------------------------------------ pcu_cache_dir=${pcu_cache_dir:-${ppc_cache_link_to:-$def_pcu_cache_dir}} ppc_cache_dir_setup=${ppc_cache_dir_setup:-$ppc_setup_all} ppf_do_not_config_this "$ppc_cache_dir_setup" -d $pcu_cache_dir/. && return $ppc_prntv $ppc_prntv " Setting cache directory:" $ppc_prntv " $pcu_cache_dir" if ppf_same_cache then if [ $ppc_sym_link "$pcu_cache_dir" -o -f "$pcu_cache_dir" ] then ppf_cmnd /bin/rm -f $pcu_cache_dir ppf_cmnd mkdir $pcu_cache_dir ppf_cmnd chmod 777 $pcu_cache_dir fi if [ ! -d "$pcu_cache_dir" ] then ppf_cmnd mkdir $pcu_cache_dir ppf_cmnd chmod 777 $pcu_cache_dir fi return fi test $ppc_sym_link $def_pcu_cache_dir && ppf_cmnd /bin/rm -f $def_pcu_cache_dir test -d $def_pcu_cache_dir && ppf_cmnd /bin/rm -fr $def_pcu_cache_dir ppf_make_dir $pcu_cache_dir ppf_cmnd ln -s $pcu_cache_dir $def_pcu_cache_dir } #------------------------------------------------------------------------ ppf_check_cache_dir() { #------------------------------------------------------------------------ $ppc_prntv $ppc_prntv " Checking cache directory:" $ppc_prntv " $pcu_cache_dir" if [ $ppc_sym_link cache ] then set -- `/bin/ls -ld $def_pcu_cache_dir` shift `expr $# - 1` if [ "$1" = "$pcu_cache_dir" ] then ppc_cache_dir_info="$def_pcu_cache_dir -> $pcu_cache_dir" else ppf_warn "Cache directory not linked to this directory:" echo " $pcu_cache_dir" ppc_cache_dir_info="$def_pcu_cache_dir -> $1" fi elif [ -z "$pcu_cache_dir" ] then if [ -d cache ] then pcu_cache_dir=$def_pcu_cache_dir ppc_cache_dir_info="$def_pcu_cache_dir" else ppf_error "The cache directory does not exist." ppc_cache_dir_info="$ppc_not_set" return fi else ppc_cache_dir_info="$pcu_cache_dir" fi if [ -d $pcu_cache_dir/. ] then ppf_dir_writable_by_all $pcu_cache_dir/. case $? in 0 ) return ;; 1 ) echo " The cache directory is not writable by all users." ;; 2|3 ) ppc_cache_dir_info="$ppc_cache_dir_info " ppf_warn "Cache directory is not writable by you ($USER)." ;; esac else ppc_cache_dir_info="$ppc_cache_dir_info " ppf_error "Cache directory does not exist." fi } #------------------------------------------------------------------------ ppf_get_doc_dir() { #------------------------------------------------------------------------ echo " $ppc_delim $ppc_product On-line Documentation Configuration $ppc_underln------------------------------------ $ppc_product's documentation is provided in the form of HTML. The location of files is usually determined by rs_install and you should not override it. If you did not install the HTML documentation, you will not be able to use $ppc_product's in-product help facility. To correct this, re-run rs_install to install the documentation." def_pcu_doc_dir=none pcu_prior_doc_dir=$pcu_doc_dir while true do pcu_doc_dir=$pcu_prior_doc_dir ppf_get_option pcu_doc_dir dir "Enter the documentation directory :" case $pcu_doc_dir in none|None|NONE ) unset pcu_doc_dir def_pcu_doc_dir break ;; esac if [ -d "$pcu_doc_dir" ] then test -d "$pcu_doc_dir/html/purifyplus/$ppc_prod_cmd" && break test -d "$pcu_doc_dir/html/dev_tools/$ppc_prod_cmd" && break test -d "$pcu_doc_dir/html/$ppc_prod_cmd" && break echo " This directory is missing the html/purifyplus/$ppc_prod_cmd sub-directory:" else echo " This directory does not exist:" fi echo " $pcu_doc_dir" pcu_skip_docs=${pcu_skip_docs:-no} ppf_get_option pcu_skip_docs y_n \ "Do you want to skip the documentation configuration at this time?" if [ "$pcu_skip_docs" = yes ] then unset pcu_doc_dir def_pcu_doc_dir break fi done } #------------------------------------------------------------------------ ppf_set_doc_dir() { #------------------------------------------------------------------------ pcu_doc_dir=${pcu_doc_dir:-$def_pcu_doc_dir} test -n "$pcu_doc_dir" || return test -d "$pcu_doc_dir" || return ppc_doc_setup=${ppc_doc_setup:-$ppc_setup_all} ppf_do_not_config_this "$ppc_doc_setup" $ppc_sym_link UI/html && return $ppc_prntv $ppc_prntv " Setting documentation directory:" $ppc_prntv " $pcu_doc_dir" ppc_html_dir=$pcu_doc_dir/html test -d UI || mkdir UI for ppc_tmp_dir in UI UI.* do test -d $ppc_tmp_dir/. || continue for ppc_html in \ $ppc_html_dir/purifyplus/$ppc_prod_cmd* \ $ppc_html_dir/dev_tools/$ppc_prod_cmd* \ $ppc_html_dir/$ppc_prod_cmd* do test -d $ppc_html || continue if [ $ppc_sym_link $ppc_tmp_dir/html -o -f $ppc_tmp_dir/html ] then $ppc_prntv " Recreating link to $ppc_html" /bin/rm -f $ppc_tmp_dir/html else $ppc_prntv " Creating link to $ppc_html" fi ppf_cmnd /bin/ln -s $ppc_html $ppc_tmp_dir/html break done for ppc_html in \ $ppc_html_dir/installing_and_gettingstarted \ $ppc_html_dir/purifyplus/installing_and_gettingstarted \ $ppc_html_dir/dev_tools/installing_and_gettingstarted \ $ppc_html_dir/pqc_install do test -d $ppc_html || continue if [ $ppc_sym_link $ppc_tmp_dir/installing_and_gettingstarted -o \ -f $ppc_tmp_dir/installing_and_gettingstarted ] then $ppc_prntv " Recreating link to $ppc_html" /bin/rm -f $ppc_tmp_dir/installing_and_gettingstarted else $ppc_prntv " Creating link to $ppc_html" fi ppf_cmnd /bin/ln -s $ppc_html $ppc_tmp_dir/installing_and_gettingstarted break done # Link these files into each UI dir. for ppc_html in \ $pcu_doc_dir/legal_information.html \ $pcu_doc_dir/html/legal_information.html do test -f $ppc_html || continue ppc_var=`basename $ppc_html` if [ $ppc_sym_link $ppc_tmp_dir/$ppc_var -o \ -f $ppc_tmp_dir/$ppc_var ] then $ppc_prntv " Recreating link to $ppc_html" /bin/rm -f $ppc_tmp_dir/$ppc_var else $ppc_prntv " Creating link to $ppc_html" fi ppf_cmnd /bin/ln -s $ppc_html $ppc_tmp_dir/$ppc_var done done } #------------------------------------------------------------------------ ppf_check_doc_dir() { #------------------------------------------------------------------------ $ppc_prntv $ppc_prntv " Checking documentation directory:" $ppc_prntv " $pcu_doc_dir" ppc_doc_dir_info=" $ppc_not_set" for ppc_docs_dir in $def_pcu_doc_dir $pcu_doc_dir END do if [ "$ppc_docs_dir" = END ] then ppc_doc_dir_info=" " if [ ! $ppc_sym_link UI/html ] then ppf_warn "Documentation is not installed. You will not be able to use the on-line help, installation guide etc..." return fi break fi test -d $ppc_docs_dir && break done unset ppc_docs_dir for ppc_tmp_dir in UI UI.* do test -d $ppc_tmp_dir || continue for ppc_link in html installing_and_gettingstarted do if [ ! $ppc_sym_link $ppc_tmp_dir/$ppc_link ] then ppf_warn "Missing link: $ppc_tmp_dir/$ppc_link" case "$ppc_tmp_dir/$ppc_link" in UI/html ) echo " You will not be able to use the on-line help." # Stop checking at this point unless doing -check. $ppc_check || return ;; UI/installing_and_gettingstarted ) echo " You will not be able to view the installation guide." ;; esac # If installing from the UNIX Suite CD, mention the DOC CD. # (rs_install sets rs_ID to RSDSU.) case "$rs_ID" in RSDSU* ) echo " To view this, please install the documentation from the" echo " 'Rational Solutions for UNIX Online Documentation' CD." ;; esac continue fi if [ ! -d $ppc_tmp_dir/$ppc_link/. ] then ppf_warn "Link to non-existent directory:" echo " $ppc_tmp_dir/$ppc_link" continue fi if [ "$ppc_tmp_dir/$ppc_link" = UI/html ] then set -- `/bin/ls -ld $ppc_tmp_dir/$ppc_link` shift `expr $# - 1` ppc_doc_dir_info=" UI/html -> $1" fi done done } #------------------------------------------------------------------------ ppf_set_cq_integration() { #------------------------------------------------------------------------ # Do not set this if product is Quantify. $ppc_do_quantify && return ${ppc_cq_integration_setup:-$ppc_setup_all} || return pcu_cq_client=${pcu_cq_client:-$def_pcu_cq_client} $ppc_prntv $ppc_prntv " Creating ClearQuest integration file: $ppc_crms_file" echo "PURE_CRMS_COMMAND_STRING=clearquest PURE_CLEARQUEST_CLIENT=$pcu_cq_client PURE_CLEARQUEST_URL=$pcu_cq_url PURE_CLEARQUEST_DATABASE=$pcu_cq_db" > $ppc_crms_file.new ppf_update_file $ppc_crms_file $ppc_crms_file.new } #------------------------------------------------------------------------ ppf_read_crms() { #------------------------------------------------------------------------ ppc_cq_vars="PURE_CRMS_COMMAND_STRING PURE_CLEARQUEST_CLIENT PURE_CLEARQUEST_URL PURE_CLEARQUEST_DATABASE" eval unset $ppc_cq_vars test -f $ppc_crms_file || return 1 for ppc_cqv in $ppc_cq_vars do ppc_val=`grep "^$ppc_cqv=" $ppc_crms_file | sed -e 's/.*=//'` case $ppc_cqv in PURE_CRMS_COMMAND_STRING ) PURE_CRMS_COMMAND_STRING=$ppc_val ;; PURE_CLEARQUEST_CLIENT ) PURE_CLEARQUEST_CLIENT=$ppc_val ;; PURE_CLEARQUEST_URL ) PURE_CLEARQUEST_URL=$ppc_val ;; PURE_CLEARQUEST_DATABASE ) PURE_CLEARQUEST_DATABASE=$ppc_val ;; esac done return 0 } #------------------------------------------------------------------------ ppf_check_cq_integration() { #------------------------------------------------------------------------ $ppc_prntv $ppc_prntv " Checking Rational ClearQuest integration configuration..." if ppf_read_crms then for ppc_cqv in $ppc_cq_vars do eval ppc_val=\$$ppc_cqv if [ -z "$ppc_val" ] then ppf_warn "$ppc_cqv not set." fi done else ppf_warn "Rational ClearQuest integration not configured." echo " No $ppc_crms_file file found." fi } #------------------------------------------------------------------------ ppf_query_cq_setup() { #------------------------------------------------------------------------ echo " $ppc_delim $ppc_product Rational ClearQuest Integration Configuration $ppc_underln---------------------------------------------- $ppc_product supports an integration with Rational ClearQuest which allows you to file change requests on $ppc_product detected errors from within the $ppc_product GUI. If you have Rational ClearQuest installed, you can set up site-wide defaults for this integration. It is possible to configure some other system. You need to configure any other change request system manually. Refer to on-line help system for the steps to configure something other than ClearQuest (look for ClearQuest in the index)." ppf_get_option pcu_cq_setup y_n "Set up Rational ClearQuest integration?" if [ "$pcu_cq_setup" = no ] then ppc_cq_integration_setup=false return fi ppc_cq_integration_setup=true if [ "$ppc_sys" = sol -o "$ppc_sys" = hp ] then echo " Enter one of the following Rational ClearQuest client interfaces as the default for your installation. Individual users may override this setting using the PURE_CLEARQUEST_CLIENT environment variable. See the Installing and Getting Started manual for details. X - Rational ClearQuest X Windows client web - Rational ClearQuest Web client" pcu_prior_cq_client=$pcu_cq_client while true do pcu_cq_client=$pcu_prior_cq_client ppf_get_option pcu_cq_client str \ "Enter the Rational ClearQuest client interface (X or web) :" case $pcu_cq_client in w*|W* ) pcu_cq_client=web ; break ;; x*|X* ) pcu_cq_client=X ; break ;; * ) echo " Please enter X or web." esac done else pcu_cq_client=web fi echo " Whether it is your site-wide default ClearQuest client or not, you may specify the default ClearQuest database to connect to with the X-window client. If not set, X-window client users will be prompted for this information when filing a change request. Individual users may override this setting using the PURE_CLEARQUEST_DB environment variable. See the 'Installing and Getting Started' manual for details." def_pcu_cq_db=none ppf_get_option pcu_cq_db str \ "Enter the Rational ClearQuest database name :" case $pcu_cq_db in none|None|NONE ) unset pcu_cq_db ;; esac echo " Whether it is your site-wide default ClearQuest client or not, you may specify the URL to your ClearQuest Web. Individual users may override this setting using the PURE_CLEARQUEST_URL environment variable. See the 'Installing and Getting Started' manual for more details." def_pcu_cq_url=none ppf_get_option pcu_cq_url str \ "Enter the Rational ClearQuest Web URL :" case $pcu_cq_url in none|None|NONE ) unset pcu_cq_url ;; esac } #------------------------------------------------------------------------ ppf_explain_platform_mismatch() { #------------------------------------------------------------------------ ppf_warn "Platform mismatch: Rational $ppc_product for $ppc_prod_os" echo " The $ppc_cmd command in this directory cannot be run on $ppc_os. Run this command on a system matching platform:" set -- $ppc_support_os_vers case $# in 0 ) ppc_osv="$ppc_prod_os" ;; 1 ) ppc_osv="$ppc_prod_os $1" ;; 2 ) ppc_osv="$ppc_prod_os $1 or $2" ;; * ) ppc_osv="$ppc_prod_os $1" ppc_n=2 while true do eval ppc_os_v=\$$ppc_n if [ $ppc_n = $# ] then ppc_osv="$ppc_osv or $ppc_os_v" break else ppc_osv="$ppc_osv, $ppc_os_v" fi ppc_n=`expr $ppc_n + 1` done ;; esac echo " $ppc_osv" echo } #------------------------------------------------------------------------ ppf_explain_run_on_other_host() { #------------------------------------------------------------------------ if [ -n "$Suite_Path" -a "$ppc_run_by_rs_install" = true ] then echo " and run post_install there. For example:" echo echo " rlogin <$1-$ppc_prod_host>" echo " cd $Suite_Path" echo " ./post_install" echo else echo " and run $ppc_cmd there. For example:" echo echo " rlogin <$1-$ppc_prod_host>" echo " cd $ppc_install_dir" echo " ./$ppc_cmd" echo fi } #------------------------------------------------------------------------ ppf_who_run_it() { #------------------------------------------------------------------------ # Get the name and the date/time the person who ran the self-test. if [ -s $1 ] then cat $1 return fi set -- `/bin/ls -ld $1` ppc_who=$3 shift `expr $# - 4` echo "Run by $ppc_who on $1 $2 $3" } #------------------------------------------------------------------------ ppf_set_test_status() { #------------------------------------------------------------------------ if $ppc_need_run_on_64 then if [ -f ${ppc_pass_file}64 ] then ppc_self_test_status="PASSED. `ppf_who_run_it ${ppc_pass_file}64`" return elif [ -f $ppc_pass_file ] then ppc_self_test_status="PASSED (32-bit only). `ppf_who_run_it $ppc_pass_file`" return fi else if [ -f $ppc_pass_file ] then ppc_self_test_status="PASSED. `ppf_who_run_it $ppc_pass_file`" return fi fi if [ -f $ppc_fail_file ] then ppc_self_test_status="FAILED. `ppf_who_run_it $ppc_fail_file`" ppf_error "Self-test failed." echo " $ppc_self_test_status" elif [ -x ./$ppc_self_test_exe ] then ppc_self_test_status="$ppc_not_run" ppf_warn "Self-test has not been run." else ppc_self_test_status="$ppc_self_test_exe not found." ppf_warn "Self-test cannot be run:" echo " $ppc_self_test_status" fi } #------------------------------------------------------------------------ ppf_run_self_test() { #------------------------------------------------------------------------ # For 64-bit apps, explain the need to run on a 64-bit platform machine # if not running on one. ppc_self_test_not_run=false ppc_self_test_exe=${ppc_prod_cmd}_test if [ "$ppc_run_self_test" = false ] then # Just set status ppf_set_test_status return fi if [ "$ppc_batch_mode" = false ] then ppc_tests_already_run=false if $ppc_on_64 then if [ -f ${ppc_pass_file}64 ] then ppc_tests_already_run=true fi else if [ -f $ppc_pass_file ] then ppc_tests_already_run=true fi fi if $ppc_tests_already_run then echo " The $ppc_product $ppc_prod_ver_os self-test has already been run successfully on $ppc_os." def_yn_ppc_run_test=yes ppf_get_option yn_ppc_run_test y_n "Run again?" if [ "$yn_ppc_run_test" = no ] then ppf_set_test_status return fi fi fi if [ -x ./$ppc_product.post_install ] then ./$ppc_product.post_install 2>&1 | sed -e 's?^? ?' -e 's?\*\*\*?|?' fi # Before running the self-test, make sure the person running # this can write to the cache directory. If not, make a temporary # cache directory and then remove it after the self-test. ppc_tmp_cache=$ppc_install_dir/cache/self-test.$USER.$$ if touch $ppc_tmp_cache 2>/dev/null then # Okay. /bin/rm -f $ppc_tmp_cache unset ppc_tmp_cache else # Make a temporary cache so the self-test will work. # Then cleanup the temp cache. ppc_prior_options="$PUREOPTIONS" ppc_tmp_cache=$ppc_install_dir/tmp-cache-self-test-$USER mkdir $ppc_tmp_cache PUREOPTIONS="$PUREOPTIONS -cache-dir=$ppc_tmp_cache" export PUREOPTIONS echo " The cache directory is not writable by you. Will use a temporary cache to run the self-test. PUREOPTIONS:$PUREOPTIONS " fi if [ -x ./$ppc_self_test_exe ] then echo " Running $ppc_product self-test. This may take 1-2 minutes..." if ./$ppc_self_test_exe then echo "Run by $USER on `date`" > $ppc_pass_file # If we pass on 64-bit, then create the 32-bit pass file. if $ppc_on_64 then cp -p $ppc_pass_file ${ppc_pass_file}64 fi /bin/rm -f $ppc_fail_file else echo "Run by $USER on `date`" > $ppc_fail_file /bin/rm -f $ppc_pass_file ${ppc_pass_file}64 fi else /bin/rm -f $ppc_fail_file $ppc_pass_file ${ppc_pass_file}64 fi ppf_set_test_status if [ -n "$ppc_tmp_cache" ] then /bin/rm -fr $ppc_tmp_cache if [ -n "$ppc_prior_options" ] then PUREOPTIONS="$ppc_prior_options" unset ppc_prior_options else unset PUREOPTIONS fi fi if $ppc_need_run_on_64 then $ppc_on_64 && return if [ ! -f ${ppc_pass_file}64 ] then echo " $ppc_product needs to be initialized for 64-bit $ppc_os. Since you are on $HOST running $ppc_os (32-bit), you will need to login to a machine running $ppc_prod_os in 64-bit mode" ppf_explain_run_on_other_host supported-64-bit fi fi } #------------------------------------------------------------------------ ppf_check_configuration() { #------------------------------------------------------------------------ $ppc_prntv $ppc_prntv " Checking $ppc_product configuration as $USER..." ppf_check_license ppf_check_doc_dir if $ppc_do_purify || $ppc_do_purecov then ppf_check_cq_integration fi # Run unless already run from the main program. if ${ppc_self_test_not_run:-true} then ppf_run_self_test fi ppf_check_cache_dir # Display check summary. echo echo " Rational $ppc_product for UNIX - Configuration Summary:" echo " ---------$ppc_underln----------------------------------" echo " License source: (status: $ppc_license_status) ${pcu_license:-$ppc_not_set} Installation location: ${ppc_install_dir:-$ppc_not_set} Documentation location: $ppc_doc_dir_info Cache location: $ppc_cache_dir_info" if $ppc_do_purify || $ppc_do_purecov then echo " Change Request Management command: ${PURE_CRMS_COMMAND_STRING:-$ppc_not_set}" case "$PURE_CRMS_COMMAND_STRING" in *clearquest ) echo " Rational ClearQuest default client: ${PURE_CLEARQUEST_CLIENT:-$ppc_not_set} Rational ClearQuest Web URL: ${PURE_CLEARQUEST_URL:-$ppc_not_set} Rational ClearQuest default database: ${PURE_CLEARQUEST_DATABASE:-$ppc_not_set}" ;; esac fi echo " Self-test: $ppc_self_test_status" } #------------------------------------------------------------------------ ppf_set_os_host_prod_sys() { #------------------------------------------------------------------------ # Arg1 can case $1 in hpux* ) ppc_prod_os="HP-UX" ppc_prod_host=hpux-host ppc_prod_sys=hp ;; irix* ) ppc_prod_os="SGI IRIX" ppc_prod_host=sgi-irix-host ppc_prod_sys=sg32 ;; solaris2* ) ppc_prod_os="Sun Solaris" ppc_prod_host=sun-solaris-host ppc_prod_sys=sol ;; esac } #------------------------------------------------------------------------ ppf_set_prod_sys() { #------------------------------------------------------------------------ # Set this product's platform (sys) and O/S based on a dot file # in the release: .._ # where is solaris2, hpux, or irix and is 32 or 64. for ppc_sys_info in solaris2 hpux irix do for ppc_sys_bits in 64 32 do if [ -f .$ppc_prod_cmd.${ppc_sys_info}_$ppc_sys_bits ] then ppf_set_os_host_prod_sys ${ppc_sys_info}_$ppc_sys_bits test "$ppc_sys_bits" = 64 && ppc_need_run_on_64=true break fi done done eval ppc_support_os_vers=\$ppc_support_$ppc_prod_sys eval ppc_allow_os_vers=\$ppc_allow_$ppc_prod_sys } #------------------------------------------------------------------------ ppf_platform_mismatch() { #------------------------------------------------------------------------ # If this host's platform does not match # the platform of the product, return true. # Check the product platform and supported version matches this # host platform and version. Return false if there is a match. if [ "$ppc_prod_sys" = "$ppc_sys" ] then # Correct platform. Now check version. for ppc_osv in $ppc_support_os_vers $ppc_allow_os_vers do test "$ppc_osv" = "$ppc_os_ver" && return 1 done fi # The user is running configure on the wrong platform or version. # What we tell the user depends on whether the configure script # has already run (all self-tests passed) and if it is being run # as part of rs_install. if [ -f $ppc_pass_file ] then ppc_32bit_test_passed=true else ppc_32bit_test_passed=false fi unset ppc_64bit_test_passed if $ppc_need_run_on_64 then # The ppc_pass_file is for the 64-bit case. if [ -f ${ppc_pass_file}64 ] then ppc_64bit_test_passed=true else ppc_64bit_test_passed=false fi fi echo if $ppc_run_by_rs_install then ppc_show_errors_warnings=false else ppf_explain_platform_mismatch fi case "$ppc_32bit_test_passed/$ppc_64bit_test_passed" in true/true|true/ ) echo " $ppc_product has been installed and configured for" echo " $ppc_prod_os." return 0 ;; true/false ) echo " $ppc_product has been installed and configured for $ppc_prod_os (32-bit only). If you plan on using the product in 64-bit mode, you should login to a 64-bit $ppc_prod_os machine" ppf_explain_run_on_other_host supported-64-bit return 0 ;; * ) echo " $ppc_product has been installed for $ppc_prod_os." ;; esac if $ppc_need_run_on_64 then echo " Since you are on $HOST running $ppc_os, you will need to login to a machine running $ppc_prod_os. If you plan on using the product in 64-bit mode, you should login to a 64-bit $ppc_prod_os machine" ppf_explain_run_on_other_host supported-64-bit else echo " Since you are on $HOST running $ppc_os, you will need to login to a machine running $ppc_prod_os" ppf_explain_run_on_other_host supported fi return 0 } #------------------------------------------------------------------------ ppf_Main() { #------------------------------------------------------------------------ # Set the platform (ppc_prod_sys) and O/S name (ppc_prod_os) # for this product. Use the parent directory name. ppf_set_prod_sys # Determine what platform this command is being run on. case "$ppc_os" in HP-UX ) ppc_os_ver=`uname -r` ppc_sys=hp ppc_sym_link='-h' ;; IRIX|IRIX64 ) ppc_os_ver=`uname -r` ppc_sys=sg32 ppc_os="SGI IRIX" ppc_sym_link='-h' ;; SunOS ) ppc_os_ver=`uname -r` ppc_sys=sol ppc_os="Sun Solaris" ppc_sym_link='-h' ;; * ) ppf_explain_platform_mismatch return 1 ;; esac ppc_pass_file=.tests.passed.on.$ppc_prod_sys ppc_fail_file=.tests.failed.on.$ppc_prod_sys # The ppc_need_run_on_64 var is only set to true if the product # supports 64-bit mode, and the user is running configure on a # 32-bit HP or Solaris machine. case $ppc_prod_sys in sol ) if $ppc_need_run_on_64 then if [ "$ppc_sys" = sol ] then if [ -x /bin/isainfo ] then if [ "`/bin/isainfo -b`" = 64 ] then # This is a 64-bit machine. ppc_on_64=true fi fi fi fi ;; hp ) if $ppc_need_run_on_64 then if [ "$ppc_sys" = hp ] then if getconf KERNEL_BITS 2>&1 | grep 64 >/dev/null then # This is a 64-bit machine. ppc_on_64=true fi fi fi ;; esac if ppf_platform_mismatch then return 1 fi if [ ! -w $ppc_install_dir ] then echo "$ppc_cmd: $ppc_install_dir not writable by $USER." return 1 fi if [ ! -x $ppc_install_dir/$ppc_prod_cmd ] then echo "$ppc_cmd: $ppc_install_dir/$ppc_prod_cmd not found." echo " '$ppc_install_dir'" echo " does not appear to be a $ppc_product product directory." return 1 fi cd $ppc_install_dir ppf_set_defaults if $ppc_check then ppf_check_configuration return 0 fi if $ppc_run_by_rs_install then echo echo " Configuring $ppc_product $ppc_prod_ver_os in:" echo " $ppc_install_dir" else echo echo "$ppc_delim" echo "Configuring $ppc_product $ppc_prod_ver_os in:" echo " $ppc_install_dir" echo echo "Command line: $ppc_cmd $ppc_args" fi if [ "$ppc_batch_mode" = false ] then # Query for configuration parameters. # Present defaults as specified on the command line or # as set from the ppf_set_defaults function. if $ppc_not_run_by_rs_install then # The rs_install script specifies these 2 item on the command # line. If it is being run by rs_install, do not ask. echo " If you are not certain about a configuration parameter, Rational recommends accepting the defaults [shown in brackets]." # Ask for license and doc_dir if not invoked by rs_install. ppf_get_license ppf_get_doc_dir fi ppf_get_cache_dir if $ppc_do_purify || $ppc_do_purecov then ppf_query_cq_setup else ppc_cq_integration_setup=false fi fi ppf_save_defaults $ppc_prntv $ppc_prntv " Starting $ppc_product configuration..." ppf_set_cache_dir ppf_set_doc_dir ppf_set_license ppf_set_cq_integration ppf_run_self_test ppf_check_configuration } #------------------------------------------------------------------------ # MAIN #------------------------------------------------------------------------ if [ -n "$RS_INSTALL_SUBSHELL_FILE" ] then # Invoked by rs_install. ppc_file=$RS_INSTALL_SUBSHELL_FILE ppc_cmd=`basename $ppc_file` ppc_run_by_rs_install=true ppc_not_run_by_rs_install=false ppc_first_input=false # Arg1 is the install directory of the PurifyPlus product. ppc_install_dir=$1 shift # USER and HOST are set by rs_install. ppc_save_help_file=$HELP_FILE ppc_save_menu_title=$menu_title # The Logging_started flag is set false so that when we return from # entering a ? at a prompt, we avoid the strange behavior rs_install # does on screen (repaint it from a install log file). ppc_save_Logging_started=$Logging_started Logging_started=false else ppc_file=$0 ppc_cmd=`basename $ppc_file` ppc_run_by_rs_install=false ppc_not_run_by_rs_install=true ppc_first_input=true ppc_install_dir=`dirname $ppc_file` ppc_install_dir=`(cd $ppc_install_dir; pwd)` USER=`id | sed -e 's?).*??g' -e 's?.*(??g'` HOST=`uname -n` fi ppc_args="$*" ppc_os=`uname -s` ppc_delim="-------------------------------------------" ppc_delim="${ppc_delim}-----------------------------------" ppc_help_delim="--------------------------------------------" ppc_help_delim="${ppc_help_delim}----------------------------" ppc_crms_file=pure_crms ppc_on_64=false ppc_show_errors_warnings=true HELP_FILE=$ppc_file ppc_prod_cmd=`basename $ppc_cmd .configure` if [ "$ppc_prod_cmd" = pure ] then case "$1" in purify|purecov|quantify ) ppc_prod_cmd=$1 shift ;; * ) ppc_sed_usage='s?^##? ?' ppf_Usage exit 0 ;; esac fi case $ppc_prod_cmd in purify ) ppc_product="Purify" ppc_underln="------" ppc_do_purify=true ppc_do_purecov=false ppc_do_quantify=false ppc_sed_usage='s?^##? ?' ;; purecov ) ppc_product="PureCoverage" ppc_underln="------------" ppc_do_purecov=true ppc_do_purify=false ppc_do_quantify=false ppc_sed_usage='s?^##? ?' ;; quantify ) ppc_product="Quantify" ppc_underln="--------" ppc_do_quantify=true ppc_do_purify=false ppc_do_purecov=false # Comments with 2 # marks are removed since these do not apply to Quantify. ppc_sed_usage='/^##/d' ;; esac ppc_defaults=.defaults.configure ppc_not_run="" ppc_not_set="" ppc_errors=0 ppc_warnings=0 # Check for these licenses: ppc_lic_feats="$ppc_prod_cmd|PurifyPlusUNIX|DevelopmentStudioUNIX" ppc_batch_mode=false ppc_check=false ppc_need_run_on_64=false ppc_run_self_test=true ppc_verbose_mode=false ppc_prntv=':' unset pcu_cache_dir def_pcu_cache_dir ppc_cache_link_to # Determine which echo command to use. if [ "`echo -n`" = '-n' ] then ppc_echon=echo ppc_nocr='\c' else ppc_echon='echo -n' ppc_nocr= fi #------------------------------------------------------------------------ # Get command line options, set flags. #------------------------------------------------------------------------ # Set all configuration parameters unless batch mode is specified. ppc_setup_all=true while [ $# -gt 0 ] do case $1 in -b* ) # -batch ppc_batch_mode=true # Set only configuration parameters specified on the command line. ppc_setup_all=false ;; -ca* ) # -cache-dir if [ -n "$2" ] then pcu_cache_dir=$2 ppc_cache_dir_setup=true shift else ppf_error "$ppc_cmd: Option '$1' requires a parameter." fi ;; -cc32 ) if [ -n "$2" ] then case $2 in /* ) # Absolute path name. PURE_COMPILERS=$2 ;; */* ) # Relative path name. Set full path name. PURE_COMPILERS=`pwd`/$2 ;; * ) # Simple path name. Just use this since it must be on # the users command search path. PURE_COMPILERS=$2 ;; esac export PURE_COMPILERS shift else ppf_error "$ppc_cmd: Option '$1' requires a parameter." fi ;; -cc64 ) if [ -n "$2" ] then case $2 in "" ) ;; /* ) # Absolute path name. PURE_COMPILERS_64=$2 ;; */* ) # Relative path name. Set full path name. PURE_COMPILERS_64=`pwd`/$2 ;; * ) # Simple path name. Just use this since it must be on # the users command search path. PURE_COMPILERS_64=$2 ;; esac export PURE_COMPILERS_64 shift else ppf_error "$ppc_cmd: Option '$1' requires a parameter." fi ;; -cq_c*|-cqc* ) # -cq_client if [ -n "$2" ] then case $2 in X|x ) pcu_cq_client=X ;; w* ) # web pcu_cq_client=web ;; d* ) # default case "$ppc_os" in HP-UX|SunOS|Solaris ) pcu_cq_client=X ;; * ) pcu_cq_client=web ;; esac ;; * ) ppf_error "$ppc_cmd: Option '$1' requires a parameter: X web default" ;; esac ppc_cq_integration_setup=true pcu_cq_setup=yes shift else ppf_error "$ppc_cmd: Option '$1' requires a parameter." fi ;; -cq_d*|-cqd* ) # -cq_db if [ -n "$2" ] then pcu_cq_db=$2 ppc_cq_integration_setup=true pcu_cq_setup=yes shift else ppf_error "$ppc_cmd: Option '$1' requires a parameter." fi ;; -cq_u*|-cqu* ) # -cq_url if [ -n "$2" ] then pcu_cq_url=$2 ppc_cq_integration_setup=true pcu_cq_setup=yes shift else ppf_error "$ppc_cmd: Option '$1' requires a parameter." fi ;; -c* ) # -check ppc_check=true ppc_batch_mode=true ;; -d* ) # -doc_dir if [ -n "$2" ] then pcu_doc_dir=$2 ppc_doc_setup=true shift else ppf_error "$ppc_cmd: Option '$1' requires a parameter." fi ;; -h* ) # -help ppf_Usage ;; -i* ) # -install_dir if [ -n "$2" ] then ppc_install_dir=$2 shift else ppf_error "$ppc_cmd: Option '$1' requires a parameter." fi ;; -l* ) # -license if [ -n "$2" ] then pcu_license=$2 ppc_license_setup=true shift else ppf_error "$ppc_cmd: Option '$1' requires a parameter." fi ;; -n* ) # -norun ppc_run_self_test=false ;; -RS_INSTALL ) # Invoked by rs_install. This is not an end-user option. When # invoked this way, there are rs_install defined functions that # can be used such as rsf_get_option, instead of ppf_get_option # This way, I/O can be done rs_install to take advantage of the # its record and playback mechanism. ppc_run_by_rs_install=true ppc_not_run_by_rs_install=false ;; -r* ) # -run ppc_run_self_test=true ;; -v* ) # -verbose ppc_verbose_mode=true ppc_prntv=echo ;; * ) ppf_error "$ppc_cmd: Option '$1' not recognized." ;; esac shift done if [ "$ppc_errors" -gt 0 ] then ppc_no_usage_error=false echo "Run '$ppc_cmd -help' for usage information." elif ${ppc_do_run_main:-true} then ppc_no_usage_error=true ppf_Main fi ppf_exit # End of PurifyPlus for UNIX configure script.