1#! /bin/sh
2
3# agrep - temporary wrapper script for .libs/agrep
4# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
5#
6# The agrep program cannot be directly executed until all the libtool
7# libraries that it depends on are installed.
8#
9# This wrapper script should never be moved out of the build directory.
10# If it is, it will not operate correctly.
11
12# Sed substitution that helps us do robust quoting.  It backslashifies
13# metacharacters that are still active within double-quoted strings.
14Xsed='/usr/bin/sed -e 1s/^X//'
15sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
16
17# The HP-UX ksh and POSIX shell print the target directory to stdout
18# if CDPATH is set.
19(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
20
21relink_command="(cd /root/tre-0.7.5/src; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; LD_LIBRARY_PATH=\":/usr/local/lib:/usr/local/lib\"; export LD_LIBRARY_PATH; PATH=\"/sbin:/usr/sbin:/usr/local/sbin:/opt/kde3/sbin:/opt/gnome/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/opt/novell/iprint/bin:/usr/lib/qt3/bin\"; export PATH; gcc -g -O2 -Wall -o \$progdir/\$file agrep-agrep.o  ../lib/.libs/libtre.so ../gnulib/lib/.libs/libgnu.a -Wl,--rpath -Wl,/root/tre-0.7.5/lib/.libs)"
22
23# This environment variable determines our operation mode.
24if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
25  # install mode needs the following variable:
26  notinst_deplibs=' ../lib/libtre.la'
27else
28  # When we are sourced in execute mode, $file and $echo are already set.
29  if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
30    echo="echo"
31    file="$0"
32    # Make sure echo works.
33    if test "X$1" = X--no-reexec; then
34      # Discard the --no-reexec flag, and continue.
35      shift
36    elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
37      # Yippee, $echo works!
38      :
39    else
40      # Restart under the correct shell, and then maybe $echo will work.
41      exec /bin/sh "$0" --no-reexec ${1+"$@"}
42    fi
43  fi
44
45  # Find the directory that this script lives in.
46  thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
47  test "x$thisdir" = "x$file" && thisdir=.
48
49  # Follow symbolic links until we get to the real thisdir.
50  file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
51  while test -n "$file"; do
52    destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
53
54    # If there was a directory component, then change thisdir.
55    if test "x$destdir" != "x$file"; then
56      case "$destdir" in
57      [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
58      *) thisdir="$thisdir/$destdir" ;;
59      esac
60    fi
61
62    file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
63    file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
64  done
65
66  # Try to get the absolute directory name.
67  absdir=`cd "$thisdir" && pwd`
68  test -n "$absdir" && thisdir="$absdir"
69
70  program=lt-'agrep'
71  progdir="$thisdir/.libs"
72
73  if test ! -f "$progdir/$program" || \
74     { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /usr/bin/sed 1q`; \
75       test "X$file" != "X$progdir/$program"; }; then
76
77    file="$$-$program"
78
79    if test ! -d "$progdir"; then
80      mkdir "$progdir"
81    else
82      rm -f "$progdir/$file"
83    fi
84
85    # relink executable if necessary
86    if test -n "$relink_command"; then
87      if relink_command_output=`eval $relink_command 2>&1`; then :
88      else
89	echo "$relink_command_output" >&2
90	rm -f "$progdir/$file"
91	exit 1
92      fi
93    fi
94
95    mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
96    { rm -f "$progdir/$program";
97      mv -f "$progdir/$file" "$progdir/$program"; }
98    rm -f "$progdir/$file"
99  fi
100
101  if test -f "$progdir/$program"; then
102    if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
103      # Run the actual program with our arguments.
104
105      exec "$progdir/$program" ${1+"$@"}
106
107      $echo "$0: cannot exec $program ${1+"$@"}"
108      exit 1
109    fi
110  else
111    # The program doesn't exist.
112    $echo "$0: error: \`$progdir/$program' does not exist" 1>&2
113    $echo "This script is just a wrapper for $program." 1>&2
114    echo "See the libtool documentation for more information." 1>&2
115    exit 1
116  fi
117fi
118