Skip to content
Snippets Groups Projects
Commit 884c6aca authored by Markus Blatt's avatar Markus Blatt
Browse files

There were problems with missing options of readlink on Mac OSX.

Wrote a small shell function to find the canonical path of the shell
programs.

[[Imported from SVN: r4697]]
parent 96d8d226
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,25 @@
set -e
# Get the canonical path (without using readlink)
# Does not work for weired file names
canonicalizepath(){
if test $# -ne 1; then
echo Usage: canonicalizepath path
return 1
fi
local searchpath="$PATH:.:$(dirname $0)"
local prog=$(echo $0 | sed 's/.*\/\([-_a-zA-Z0-9]*\)$/\1/')
for i in `echo $searchpath | sed -e 's/:/ /g'`; do
if test -x "$i/$prog" ; then
canonicalpath="$i"
return 0
fi
done
echo "Error: no canonical path found"
exit 1
}
if test "x$1" = "x--debug"; then
DEBUG=yes
fi
......@@ -13,8 +32,8 @@ fi
# Read the modules find part
INCDIR=$(dirname $(readlink -f $0))
. $INCDIR/dunemodules.inc
canonicalizepath $0
. $canonicalpath/dunemodules.inc
###
......
......@@ -9,6 +9,24 @@
set -e
# Get the canonical path (without using readlink)
canonicalizepath(){
if test $# -ne 1; then
echo Usage: canonicalizepath path
return 1
fi
local searchpath="$PATH:.:$(dirname $0)"
local prog=$(echo $0 | sed 's/.*\/\([-_a-zA-Z0-9]*\)$/\1/')
for i in `echo $searchpath | sed -e 's/:/ /g'`; do
if test -x "$i/$prog" ; then
canonicalpath="$i"
break
fi
done
echo "Error: no canonical path found"
exit 1
}
echo Dune project/module generator
echo -----------------------------
......@@ -24,7 +42,8 @@ while [ "$DATACORRECT" != "y" -a "$DATACORRECT" != "Y" ]; do
MODULE="$PROJECT"
# Read the modules find part
. $(cd $(dirname $(readlink -f $0)); pwd)/dunemodules.inc
canonicalizepath $0
. $(cd $canonicalpath); pwd)/dunemodules.inc
if [ "$MODULES" = "" ]; then
find_modules .
......
......@@ -2,6 +2,24 @@
set -e
# Get the canonical path (without using readlink)
canonicalizepath(){
if test $# -ne 1; then
echo Usage: canonicalizepath path
return 1
fi
local searchpath="$PATH:.:$(dirname $0)"
local prog=$(echo $0 | sed 's/.*\/\([-_a-zA-Z0-9]*\)$/\1/')
for i in `echo $searchpath | sed -e 's/:/ /g'`; do
if test -x "$i/$prog" ; then
canonicalpath="$i"
return
fi
done
echo "Error: no canonical path found"
exit 1
}
version=0.1
verbose=0
......@@ -73,10 +91,10 @@ fi
#
# Read the modules find part
INCDIR=$(dirname $(readlink --canonicalize $0))
canonicalizepath $0
eval "$(
m4 -I$INCDIR/../m4/ <<EOF
m4 -I$canonicalpath/../m4/ <<EOF
changequote([, ])
define([AC_DEFUN],[define([\$1],[\$2])])
define([AC_MSG_CHECKING],[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment