mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 19:29:26 +02:00
* Use gsed if present and temp directory to avoid system recompilation
git-svn-id: trunk@22169 -
This commit is contained in:
parent
e719c73860
commit
4ecd67f6e2
@ -11,8 +11,14 @@ if [ "$1" == "clean" ] ; then
|
||||
exit
|
||||
fi
|
||||
|
||||
gsed -n "s:ESysE\(.*\)[[:space:]]*=[[:space:]]*\([[:space:]0-9]*\);: test_errnostr E\1 \2 :p" errno.inc | \
|
||||
gsed "s:':'':g" > check_errnostr_list.sh
|
||||
# Use gsed if present
|
||||
SED=`which gsed`
|
||||
if [ "$SED" == "" ] ; then
|
||||
SED=sed
|
||||
fi
|
||||
|
||||
$SED -n "s:ESysE\(.*\)[[:space:]]*=[[:space:]]*\([[:space:]0-9]*\);: test_errnostr E\1 \2 :p" errno.inc | \
|
||||
$SED "s:':'':g" > check_errnostr_list.sh
|
||||
|
||||
if [ "$1" == "verbose" ] ; then
|
||||
verbose=1
|
||||
@ -24,7 +30,13 @@ fi
|
||||
|
||||
# Reverse 'error string', { ENUMBER }
|
||||
# to ENUMBER string
|
||||
gsed -n -e "s|[^']*\('.*'\)[[:space:]]*,*[[:space:]]*{[[:space:]]*\(E[A-Za-z_0-9]*\).*|(Number : ESys\2; NumberStr : '\2'; Str : \1),|p" errnostr.inc > errnostrlst.inc
|
||||
$SED -n -e "s|[^']*\('.*'\)[[:space:]]*,*[[:space:]]*{[[:space:]]*\(E[A-Za-z_0-9]*\).*|(Number : ESys\2; NumberStr : '\2'; Str : \1),|p" errnostr.inc > errnostrlst.inc
|
||||
|
||||
|
||||
# Use temp directory to avoid
|
||||
# re-compilation of system unit
|
||||
mkdir .testtmp
|
||||
cd .testtmp
|
||||
|
||||
# Free Pascal source including
|
||||
# errnostr.inc file
|
||||
@ -108,11 +120,14 @@ begin
|
||||
end.
|
||||
EOF
|
||||
|
||||
fpc $fpcopt ./testerrnostr.pp
|
||||
fpc $fpcopt -Fi.. -o../testerrnostr ./testerrnostr.pp
|
||||
res=$?
|
||||
cd ..
|
||||
if [ $res -ne 0 ] ; then
|
||||
echo "Compilation of testerrnostr.pp failed"
|
||||
exit
|
||||
else
|
||||
rm -Rf .testtmp
|
||||
fi
|
||||
|
||||
export verbose
|
||||
|
Loading…
Reference in New Issue
Block a user