#!/bin/sh
#*=====================================================================*/
#*    serrano/prgm/project/bigloo/autoconf/gcconfigureopt              */
#*    -------------------------------------------------------------    */
#*    Author      :  Manuel Serrano                                    */
#*    Creation    :  Tue Feb 16 17:39:56 2010                          */
#*    Last change :  Thu Sep 23 13:41:09 2010 (serrano)                */
#*    Copyright   :  2010 Manuel Serrano                               */
#*    -------------------------------------------------------------    */
#*    gcconfigureopt                                                   */
#*=====================================================================*/

gcdir=""

while : ; do
  case $1 in
    "")
      break;;

    --gc-dir=*|-gc-dir=*)
      gcdir="`echo $1 | sed 's/^[-a-z]*=//'`";;

    -*)
      echo "Unknown option \"$1\", ignored" >&2;;
  esac
  shift
done

chmod u+x $gcdir/config.guess
build=`eval "$BUILDSH $gcdir/config.guess"`
host=`eval "$HOSTSH $gcdir/config.guess"`

opt=

if [ "$host " != " " ]; then
  opt="--host=$host"
fi

if [ "$build " != " " ]; then
  opt="$opt --build=$build"
fi

echo $opt
