#! /bin/sh

# gfig - temporary wrapper script for _libs/gfig
# Generated by ltmain.sh - GNU libtool 1.0c
#
# The gfig program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of `/usr/local/src/cvs/gimp/plug-ins/gfig'.
# If it is, it will not operate correctly.

# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
  # install mode needs the following variables:
  link_against_libtool_libs=' ../../libgimp/libgimpui.la ../../libgimp/libgimp.la'
  finalize_command="gcc -g -O2 -Wall -o _libs/gfigT gfig.o -Wl,-rpath -Wl,/usr/lib -L/usr/lib -lgimpui -Wl,-rpath -Wl,/usr/lib -L/usr/lib -lgimp -L/usr/X11R6/lib -lgtk -lgdk -lglib -lX11 -lXext -lm -lc"
else
  # When we are sourced in execute mode, $file and $echo are already set.
  if test "$libtool_execute_magic" = "%%%MAGIC variable%%%"; then :
  else
    echo='printf %s\n'
    file="$0"
  fi

  # Find the directory that this script lives in.
  thisdir=`$echo "$file" | sed 's%/[^/]*$%%'`
  test "x$thisdir" = "x$file" && thisdir=.

  # Try to get the absolute directory name.
  absdir=`cd "$thisdir" && pwd`
  test -n "$absdir" && thisdir="$absdir"

  progdir="$thisdir/_libs"
  program='gfig'

  # If the $file dir failed (maybe due to symlink), try a hardcoded dir.
  oprogdir="$progdir"
  if test -f "$progdir/$program"; then :
  else
    thisdir='/usr/local/src/cvs/gimp/plug-ins/gfig'
    progdir="$thisdir/_libs"
  fi

  if test -f "$progdir/$program"; then
    # Add our own library path to LD_LIBRARY_PATH
    LD_LIBRARY_PATH="$thisdir/../../libgimp/_libs:$thisdir/../../libgimp/_libs:$LD_LIBRARY_PATH"

    # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH
    LD_LIBRARY_PATH=`$echo $LD_LIBRARY_PATH | sed -e 's/:*$//'`

    export LD_LIBRARY_PATH

    if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
      # Run the actual program with our arguments.
      args=
      for arg
      do
        # Quote arguments (to preserve shell metacharacters).
	sed_quote_subst='s/\([\\"$]\)/\\\1/g'
	arg=`$echo "$arg" | sed "$sed_quote_subst"`
        args="$args \"$arg\""
      done

      # Export the path to the program.
      PATH="$progdir:$PATH"
      export PATH

      eval "exec $program $args"

      $echo "$0: cannot exec $program $args"
      exit 1
    fi
  else
    # The program doesn't exist.
    $echo "$0: error: neither $oprogdir/$program nor $progdir/$program exists" 1>&2
    $echo "This script is just a wrapper for $program." 1>&2
    $echo "See the libtool documentation for more information." 1>&2
    exit 1
  fi
fi
