#!/bin/sh # $RCSfile: getConfigure,v $ $Revision: 1.4 $ $Date: 2005/10/27 07:19:42 $ # $AIST_Release: 4.2.4 $ # $AIST_Copyright: # Copyright 2003, 2004, 2005, 2006 Grid Technology Research Center, # National Institute of Advanced Industrial Science and Technology # Copyright 2003, 2004, 2005, 2006 National Institute of Informatics # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # $ # # command getConfigure # # This program gets configure options specified. # configure option is brought from config.status, # which was created by configure. # # Assumably, This program depends on strict autoconf-2.13 implementation. # LANG=C PATH="/bin:/usr/bin" status_file=$1 if [ "x${status_file}" = "x" ]; then command_name=`basename $0`; echo "Usage: ${command_name} config.status" >&2 exit 1 fi if [ ! -r $status_file ]; then echo "no configure status file \"${status_file}\"." >&2 exit 1 fi configure_options=`sed '/^$/,$d' $status_file | sed 's/^#//' | \ sed -e '1,/^$/d' -e '/^$/,$d' | sed 's/^ //'` configure_host=`sed '/^$/,$d' $status_file | sed 's/^#//' | \ sed '/^$/,$d' | tail -1 | sed 's/:$//' | sed 's/^ //'` gt_location=$GLOBUS_LOCATION gpt_location=$GPT_LOCATION if [ "x${configure_options}" = "x" ]; then echo "failed to get configure options." >&2 exit 1 fi if [ "x${configure_host}" = "x" ]; then echo "failed to get configure hosts." >&2 exit 1 fi echo echo "#ifndef NGL_CONFIGURE_OPTIONS_" echo "#define NGL_CONFIGURE_OPTIONS_" echo echo "static char *configureOptions = \"${configure_options}\";" echo "static char *configureHost = \"configured ${configure_host}\";" echo "static char *globusLocation = \"GLOBUS_LOCATION=${gt_location}\";" echo "static char *gptLocation = \"GPT_LOCATION=${gpt_location}\";" echo echo "#endif /* NGL_CONFIGURE_OPTIONS_ */" echo exit