dirname='s|/[^/]*$||'
basename='s|^.*/||'
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$1=\$$1\$2"
+} # func_append may be replaced by extended shell implementation
+
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+ func_quote_for_eval "$2"
+ eval "$1=\$$1\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "$@"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
# func_dirname file append nondir_replacement
# Compute the dirname of FILE. If nonempty, add APPEND to the result,
# otherwise set result to NONDIR_REPLACEMENT.
if test "X$func_dirname_result" = "X$1"; then
func_dirname_result=$3
else
- func_dirname_result=$func_dirname_result$2
+ func_append func_dirname_result $2
fi
} # func_dirname may be replaced by extended shell implementation
if test "X$func_dirname_result" = "X$1"; then
func_dirname_result=$3
else
- func_dirname_result=$func_dirname_result$2
+ func_append func_dirname_result $2
fi
func_basename_result=`$ECHO "$1" | $SED -e "$basename"`
} # func_dirname_and_basename may be replaced by extended shell implementation
;;
*)
# Actual path component, append it.
- func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+ func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
;;
esac
done
func_relative_path_result=$func_stripname_result
func_stripname '/' '/' "$func_relative_path_tcancelled"
if test -n "$func_stripname_result"; then
- func_relative_path_result=$func_relative_path_result/$func_stripname_result
+ func_append func_relative_path_result "/$func_stripname_result"
fi
# Normalisation. If bindir is libdir, return `.' else relative path.
# left over by shells.
exec_cmd=
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$1=\$$1\$2"
-} # func_append may be replaced by extended shell implementation
-
-# func_append_quoted var value
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-func_append_quoted ()
-{
- func_quote_for_eval "$2"
- eval "$1=\$$1\\ \$func_quote_for_eval_result"
-} # func_append_quoted may be replaced by extended shell implementation
-
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=`expr "$@"`
-} # func_arith may be replaced by extended shell implementation
-
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
-} # func_len may be replaced by extended shell implementation
-
# func_lo2o object
func_lo2o ()
])# _LT_AT_GETOPT_M4SH_SETUP
-# _LT_AT_FALLBACK_FUNC_EXTRACT(FUNC-NAME)
-# ---------------------------------------
-# Extract the fallback function FUNC-NAME from ltmain.m4sh
-m4_define([_LT_AT_FALLBACK_FUNC_EXTRACT],
-[dnl {{
-$SED '/^# func_dirname /q' options > options.tmp
-echo '# func_append var value' >> options.tmp
-$SED -n '/^$1 ()/,/^} # $1 /p' $abs_top_srcdir/build-aux/ltmain.m4sh >> options.tmp
-$SED '1,/^# func_dirname/d' options >> options.tmp
-rm -f options && mv options.tmp options])
-
-
# _LT_AT_EXTENDED_SHELL_FUNC_EXTRACT(FUNC-NAME)
# ---------------------------------------------
# Extract the 'Extended-shell'-decorated function FUNC-NAME from libtool
]])
_LT_AT_GETOPT_M4SH_SETUP
-_LT_AT_FALLBACK_FUNC_EXTRACT(func_append)
AT_CHECK([$SHELL ./options -a "first --append second" -athird], 0, [expout])
]])
_LT_AT_GETOPT_M4SH_SETUP
-_LT_AT_FALLBACK_FUNC_EXTRACT(func_append)
_LT_AT_XSI_FUNC_EXTRACT(func_append)
AT_CHECK([$SHELL ./options -a "first --append second" -athird], 0, [expout])