jfarrell | e0e8316 | 2014-04-08 22:45:01 -0400 | [diff] [blame^] | 1 | #! /bin/bash |
| 2 | # |
| 3 | # Licensed to the Apache Software Foundation (ASF) under one |
| 4 | # or more contributor license agreements. See the NOTICE file |
| 5 | # distributed with this work for additional information |
| 6 | # regarding copyright ownership. The ASF licenses this file |
| 7 | # to you under the Apache License, Version 2.0 (the |
| 8 | # "License"); you may not use this file except in compliance |
| 9 | # with the License. You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, |
| 14 | # software distributed under the License is distributed on an |
| 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 16 | # KIND, either express or implied. See the License for the |
| 17 | # specific language governing permissions and limitations |
| 18 | # under the License. |
| 19 | # |
| 20 | # RecursiveTest - temporary wrapper script for .libs/RecursiveTest |
| 21 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1 |
| 22 | # |
| 23 | # The RecursiveTest program cannot be directly executed until all the libtool |
| 24 | # libraries that it depends on are installed. |
| 25 | # |
| 26 | # This wrapper script should never be moved out of the build directory. |
| 27 | # If it is, it will not operate correctly. |
| 28 | |
| 29 | # Sed substitution that helps us do robust quoting. It backslashifies |
| 30 | # metacharacters that are still active within double-quoted strings. |
| 31 | sed_quote_subst='s/\([`"$\\]\)/\\\1/g' |
| 32 | |
| 33 | # Be Bourne compatible |
| 34 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then |
| 35 | emulate sh |
| 36 | NULLCMD=: |
| 37 | # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which |
| 38 | # is contrary to our usage. Disable this feature. |
| 39 | alias -g '${1+"$@"}'='"$@"' |
| 40 | setopt NO_GLOB_SUBST |
| 41 | else |
| 42 | case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac |
| 43 | fi |
| 44 | BIN_SH=xpg4; export BIN_SH # for Tru64 |
| 45 | DUALCASE=1; export DUALCASE # for MKS sh |
| 46 | |
| 47 | # The HP-UX ksh and POSIX shell print the target directory to stdout |
| 48 | # if CDPATH is set. |
| 49 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH |
| 50 | |
| 51 | relink_command="(cd /thrift/lib/cpp/test; { 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; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games; export PATH; g++ -Wall -g -O2 -o \$progdir/\$file RecursiveTest.o -L/usr/lib ./.libs/libtestgencpp.a /thrift/lib/cpp/.libs/libthrift.so -lssl -lcrypto -lrt -lpthread -Wl,-rpath -Wl,/thrift/lib/cpp/.libs)" |
| 52 | |
| 53 | # This environment variable determines our operation mode. |
| 54 | if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then |
| 55 | # install mode needs the following variables: |
| 56 | generated_by_libtool_version='2.4.2' |
| 57 | notinst_deplibs=' /thrift/lib/cpp/libthrift.la' |
| 58 | else |
| 59 | # When we are sourced in execute mode, $file and $ECHO are already set. |
| 60 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then |
| 61 | file="$0" |
| 62 | |
| 63 | # A function that is used when there is no print builtin or printf. |
| 64 | func_fallback_echo () |
| 65 | { |
| 66 | eval 'cat <<_LTECHO_EOF |
| 67 | $1 |
| 68 | _LTECHO_EOF' |
| 69 | } |
| 70 | ECHO="printf %s\\n" |
| 71 | fi |
| 72 | |
| 73 | # Very basic option parsing. These options are (a) specific to |
| 74 | # the libtool wrapper, (b) are identical between the wrapper |
| 75 | # /script/ and the wrapper /executable/ which is used only on |
| 76 | # windows platforms, and (c) all begin with the string --lt- |
| 77 | # (application programs are unlikely to have options which match |
| 78 | # this pattern). |
| 79 | # |
| 80 | # There are only two supported options: --lt-debug and |
| 81 | # --lt-dump-script. There is, deliberately, no --lt-help. |
| 82 | # |
| 83 | # The first argument to this parsing function should be the |
| 84 | # script's ../../../libtool value, followed by no. |
| 85 | lt_option_debug= |
| 86 | func_parse_lt_options () |
| 87 | { |
| 88 | lt_script_arg0=$0 |
| 89 | shift |
| 90 | for lt_opt |
| 91 | do |
| 92 | case "$lt_opt" in |
| 93 | --lt-debug) lt_option_debug=1 ;; |
| 94 | --lt-dump-script) |
| 95 | lt_dump_D=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` |
| 96 | test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. |
| 97 | lt_dump_F=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%^.*/%%'` |
| 98 | cat "$lt_dump_D/$lt_dump_F" |
| 99 | exit 0 |
| 100 | ;; |
| 101 | --lt-*) |
| 102 | $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 |
| 103 | exit 1 |
| 104 | ;; |
| 105 | esac |
| 106 | done |
| 107 | |
| 108 | # Print the debug banner immediately: |
| 109 | if test -n "$lt_option_debug"; then |
| 110 | echo "RecursiveTest:RecursiveTest:${LINENO}: libtool wrapper (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1" 1>&2 |
| 111 | fi |
| 112 | } |
| 113 | |
| 114 | # Used when --lt-debug. Prints its arguments to stdout |
| 115 | # (redirection is the responsibility of the caller) |
| 116 | func_lt_dump_args () |
| 117 | { |
| 118 | lt_dump_args_N=1; |
| 119 | for lt_arg |
| 120 | do |
| 121 | $ECHO "RecursiveTest:RecursiveTest:${LINENO}: newargv[$lt_dump_args_N]: $lt_arg" |
| 122 | lt_dump_args_N=`expr $lt_dump_args_N + 1` |
| 123 | done |
| 124 | } |
| 125 | |
| 126 | # Core function for launching the target application |
| 127 | func_exec_program_core () |
| 128 | { |
| 129 | |
| 130 | if test -n "$lt_option_debug"; then |
| 131 | $ECHO "RecursiveTest:RecursiveTest:${LINENO}: newargv[0]: $progdir/$program" 1>&2 |
| 132 | func_lt_dump_args ${1+"$@"} 1>&2 |
| 133 | fi |
| 134 | exec "$progdir/$program" ${1+"$@"} |
| 135 | |
| 136 | $ECHO "$0: cannot exec $program $*" 1>&2 |
| 137 | exit 1 |
| 138 | } |
| 139 | |
| 140 | # A function to encapsulate launching the target application |
| 141 | # Strips options in the --lt-* namespace from $@ and |
| 142 | # launches target application with the remaining arguments. |
| 143 | func_exec_program () |
| 144 | { |
| 145 | case " $* " in |
| 146 | *\ --lt-*) |
| 147 | for lt_wr_arg |
| 148 | do |
| 149 | case $lt_wr_arg in |
| 150 | --lt-*) ;; |
| 151 | *) set x "$@" "$lt_wr_arg"; shift;; |
| 152 | esac |
| 153 | shift |
| 154 | done ;; |
| 155 | esac |
| 156 | func_exec_program_core ${1+"$@"} |
| 157 | } |
| 158 | |
| 159 | # Parse options |
| 160 | func_parse_lt_options "$0" ${1+"$@"} |
| 161 | |
| 162 | # Find the directory that this script lives in. |
| 163 | thisdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` |
| 164 | test "x$thisdir" = "x$file" && thisdir=. |
| 165 | |
| 166 | # Follow symbolic links until we get to the real thisdir. |
| 167 | file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'` |
| 168 | while test -n "$file"; do |
| 169 | destdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` |
| 170 | |
| 171 | # If there was a directory component, then change thisdir. |
| 172 | if test "x$destdir" != "x$file"; then |
| 173 | case "$destdir" in |
| 174 | [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; |
| 175 | *) thisdir="$thisdir/$destdir" ;; |
| 176 | esac |
| 177 | fi |
| 178 | |
| 179 | file=`$ECHO "$file" | /bin/sed 's%^.*/%%'` |
| 180 | file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'` |
| 181 | done |
| 182 | |
| 183 | # Usually 'no', except on cygwin/mingw when embedded into |
| 184 | # the cwrapper. |
| 185 | WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no |
| 186 | if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then |
| 187 | # special case for '.' |
| 188 | if test "$thisdir" = "."; then |
| 189 | thisdir=`pwd` |
| 190 | fi |
| 191 | # remove .libs from thisdir |
| 192 | case "$thisdir" in |
| 193 | *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /bin/sed 's%[\\/][^\\/]*$%%'` ;; |
| 194 | .libs ) thisdir=. ;; |
| 195 | esac |
| 196 | fi |
| 197 | |
| 198 | # Try to get the absolute directory name. |
| 199 | absdir=`cd "$thisdir" && pwd` |
| 200 | test -n "$absdir" && thisdir="$absdir" |
| 201 | |
| 202 | program=lt-'RecursiveTest' |
| 203 | progdir="$thisdir/.libs" |
| 204 | |
| 205 | if test ! -f "$progdir/$program" || |
| 206 | { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \ |
| 207 | test "X$file" != "X$progdir/$program"; }; then |
| 208 | |
| 209 | file="$$-$program" |
| 210 | |
| 211 | if test ! -d "$progdir"; then |
| 212 | mkdir "$progdir" |
| 213 | else |
| 214 | rm -f "$progdir/$file" |
| 215 | fi |
| 216 | |
| 217 | # relink executable if necessary |
| 218 | if test -n "$relink_command"; then |
| 219 | if relink_command_output=`eval $relink_command 2>&1`; then : |
| 220 | else |
| 221 | printf %s\n "$relink_command_output" >&2 |
| 222 | rm -f "$progdir/$file" |
| 223 | exit 1 |
| 224 | fi |
| 225 | fi |
| 226 | |
| 227 | mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null || |
| 228 | { rm -f "$progdir/$program"; |
| 229 | mv -f "$progdir/$file" "$progdir/$program"; } |
| 230 | rm -f "$progdir/$file" |
| 231 | fi |
| 232 | |
| 233 | if test -f "$progdir/$program"; then |
| 234 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then |
| 235 | # Run the actual program with our arguments. |
| 236 | func_exec_program ${1+"$@"} |
| 237 | fi |
| 238 | else |
| 239 | # The program doesn't exist. |
| 240 | $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2 |
| 241 | $ECHO "This script is just a wrapper for $program." 1>&2 |
| 242 | $ECHO "See the libtool documentation for more information." 1>&2 |
| 243 | exit 1 |
| 244 | fi |
| 245 | fi |