#!/bin/sh # # $Id$ # config_functions=1 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi echon () { echo $ac_n "$*"$ac_c } merge_lists () { res="$1" for arg1 in $2; do match=no for arg2 in $1; do if [ "$arg1" = "$arg2" ]; then match=yes fi done if [ "$match" = "no" ]; then res="$res $arg1"; fi done echo $res } absolute_path () { case "$1" in /*) dir="$1";; *) dir="`pwd`/$1";; esac while [ "$tmp_dir" != "$dir" ]; do tmp_dir="$dir" dir="`echo $dir | sed 's@/\.\?/@/@g'`" done case "$dir" in */) ;; *) dir="$dir/";; esac tmp_dir="" while [ "$tmp_dir" != "$dir" ]; do tmp_dir="$dir" dir="`echo $dir | sed 's@\(.*\)/\([^/]*[^./][^/]*\|[^/]\{3,\}\)/\.\./\(.*\)@\1/\3@'`" done echo "$dir" }