#!/bin/sh

rtm_prefix="/usr"
rtm_exec_prefix="/usr"
rtm_cflags="-Wall -fPIC -O2 -I/usr/include/rtm/idl"
rtm_libs="-Wl,-z,defs -L/usr/lib -lACE -lpthread -lomniORB4 -lomnithread -lomniDynamic4 -lRTC"
rtm_libdir="/usr/lib/OpenRTM-aist"
rtm_version="0.4.2"
rtm_orb="omniORB"
rtm_idlc="/usr/sbin/../bin/omniidl"
rtm_idlflags="-bcxx -Wba -nf"
#
#  @file rtm-config
#  @brief OpenRTM-aist configuration access utility
#  @date $Date: 2005-05-12 09:06:18 $
#  @author Noriaki Ando <n-ando@aist.go.jp>
# 
#  Copyright (C) 2003-2005
#      Task-intelligence Research Group,
#      Intelligent Systems Research Institute,
#      National Institute of
#          Advanced Industrial Science and Technology (AIST), Japan
#      All rights reserved.
# 
#  $Id: rtm-config.in 726 2008-05-14 03:05:42Z n-ando $
# 

usage()
{
        cat <<EOF
Usage: rtm-config [OPTIONS]
Options:
        [--prefix[=DIR]]
        [--exec-prefix[=DIR]]
        [--version]
        [--libs]
        [--cflags]
        [--libdir]
        [--orb]
        [--idlc]
        [--idlflags]
EOF
        exit $1
}

if test $# -eq 0; then
        usage 1 1>&2
fi


while test $# -gt 0; do
  case "$1" in
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  case $1 in
    --prefix=*)
      prefix=$optarg
      if test $exec_prefix_set = no ; then
        exec_prefix=$optarg
      fi
      ;;
    --prefix)
      echo_prefix=yes
      ;;
    --exec-prefix=*)
      rtm_exec_prefix=$optarg
      exec_prefix_set=yes
      ;;
    --exec-prefix)
      echo_exec_prefix=yes
      ;;
    --version)
      echo $rtm_version
      ;;
    --cflags)
      echo_cflags=yes
      ;;
    --libs)
      echo_libs=yes
      ;;
    --libdir)
      echo_libdir=yes
	  ;;
    --orb)
      echo_orb=yes
      ;;
    --idlc)
      echo_idlc=yes
      ;;
    --idlflags)
      echo_idlflags=yes
      ;;
    *)
      usage 1 1>&2
      ;;
  esac
  shift
done

if test "$echo_prefix" = "yes"; then
        echo $rtm_prefix
fi

if test "$echo_exec_prefix" = "yes"; then
        echo $rtm_exec_prefix
fi

if test "$echo_cflags" = "yes"; then
      echo $rtm_cflags
fi

if test "$echo_libs" = "yes"; then
      echo $rtm_libs
fi      

if test "$echo_libdir" = "yes"; then
      echo $rtm_libdir
fi      

if test "$echo_orb" = "yes"; then
      echo $rtm_orb
fi      

if test "$echo_idlc" = "yes"; then
      echo $rtm_idlc
fi      

if test "$echo_idlflags" = "yes"; then
      echo $rtm_idlflags
fi      