#!/bin/sh

#
# Portions of this file Copyright 1999-2005 University of Chicago
# Portions of this file Copyright 1999-2005 The University of Southern California.
#
# This file or a portion of this file is licensed under the
# terms of the Globus Toolkit Public License, found at
# http://www.globus.org/toolkit/download/license.html.
# If you redistribute this file, with or without
# modifications, you must include this notice in the file.
#


usage()
{
	echo "Usage: $0 [name of module]"
	echo "i.e. globus_common"
	exit 1;
}


CPP=`grep "^CPP =" Makefile|sed -e "s/^CPP =//"`;
CPPFLAGS=`grep "^CPPFLAGS =" Makefile | sed -e "s/^CPPFLAGS =//"`;
echo $CPP;
echo $CPPFLAGS;


rm -f masteri18nstrings; 
rm -f myi18nstrings;

list=`find ./ -name "*.[c|h]"`; for file in $list; do 
	 $CPP $CPPFLAGS $file |grep globus_common_i18n_get_string |sed -e "s/^.*globus_common_i18n_get_string[^\"]*//" -e "s/\"\s*).*/\"/"| sed -e "s/^\"//" -e "s/\"$//" -e "s/\"\s*\"//g"|grep .|sort -u >>myi18nstrings;
	done; 
	
sort -u myi18nstrings >masteri18nstrings;
	
$GLOBUS_LOCATION/bin/globus-i18n-resource-init masteri18nstrings $1.txt; \
	export LD_LIBRARY_PATH=$GLOBUS_LOCATION/lib; $GLOBUS_LOCATION/bin/genrb -q -p $1 $1.txt;

