mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 12:39:09 +02:00
* Improve script to generate gdblib.inc
git-svn-id: trunk@14154 -
This commit is contained in:
parent
152fa714e1
commit
5bc3c1f53d
@ -8,8 +8,11 @@ if [ "$PATHEXT" != "" ]; then
|
|||||||
else
|
else
|
||||||
EXEEXT=
|
EXEEXT=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Deleting gdb${EXEEXT} to force recompile"
|
||||||
rm -f gdb${EXEEXT}
|
rm -f gdb${EXEEXT}
|
||||||
make | tee make.log
|
echo "Rebuilding gdb${EXEEXT}"
|
||||||
|
make gdb${EXEEXT} | tee make.log
|
||||||
|
|
||||||
gdb_full_version=`sed -n "s:.*version.*\"\(.*\)\".*:\1:p" version.c`
|
gdb_full_version=`sed -n "s:.*version.*\"\(.*\)\".*:\1:p" version.c`
|
||||||
gdb_version1=`sed -n "s:.*version.*\"\([0-9]*\)\.\([0-9]*\).*:\1:p" version.c`
|
gdb_version1=`sed -n "s:.*version.*\"\([0-9]*\)\.\([0-9]*\).*:\1:p" version.c`
|
||||||
@ -52,7 +55,17 @@ cat comp-cmd.log |gawk -v destdir=${destdir} '
|
|||||||
BEGIN {
|
BEGIN {
|
||||||
print "#!/bin/bash"
|
print "#!/bin/bash"
|
||||||
print "# copy-libs.sh generated by awk script"
|
print "# copy-libs.sh generated by awk script"
|
||||||
print "cp gdblib.inc " destdir
|
print "if [ \"$1\" != \"\" ]; then"
|
||||||
|
print " destdir=$1"
|
||||||
|
print " ginstall -d ${destdir}"
|
||||||
|
print "else"
|
||||||
|
print " echo $0 destdir"
|
||||||
|
print " echo destdir should be the location where libgdb.a"
|
||||||
|
print " echo and all other archives should be copied"
|
||||||
|
print " exit"
|
||||||
|
print "fi"
|
||||||
|
print "# Copy gdblib.inc file"
|
||||||
|
print "cp gdblib.inc ${destdir}"
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -60,17 +73,17 @@ BEGIN {
|
|||||||
|
|
||||||
for (i=1; i<=nb; i++) {
|
for (i=1; i<=nb; i++) {
|
||||||
if ( list[i] ~ /lib[^ ]*\.a/ ) {
|
if ( list[i] ~ /lib[^ ]*\.a/ ) {
|
||||||
libs = gensub (/([^ ]*)(lib[^ ]*\.a)/,"\\1\\2 ","g",list[i]);
|
staticlib = gensub (/([^ ]*)(lib[^ ]*\.a)/,"\\1\\2 ","g",list[i]);
|
||||||
print "cp " libs destdir;
|
print "cp " staticlib " ${destdir}";
|
||||||
}
|
}
|
||||||
if ( list[i] ~ /-l/ ) {
|
if ( list[i] ~ /-l/ ) {
|
||||||
systemlib = gensub (/-l([^ ]*)/,"lib\\1.a ","g",list[i]);
|
systemlib = gensub (/-l([^ ]*)/,"lib\\1.a ","g",list[i]);
|
||||||
print "systemlib=`find /lib -name " systemlib "`" ;
|
print "systemlib=`find /lib -name " systemlib "`" ;
|
||||||
print "if [ \"${systemlib}\" != \"\" ]; then";
|
print "if [ \"${systemlib}\" != \"\" ]; then";
|
||||||
print "echo System lib found: ${systemlib}";
|
print "echo System lib found: ${systemlib}";
|
||||||
print "cp ${systemlib} " destdir;
|
print "cp ${systemlib} ${destdir}";
|
||||||
print "else";
|
print "else";
|
||||||
print "echo Library " systemlib " not found";
|
print "echo Library " systemlib " not found, shared library assumed";
|
||||||
print "fi";
|
print "fi";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,6 +96,7 @@ echo Creating ./gdblib.inc file
|
|||||||
# Generate gdblib.inc file
|
# Generate gdblib.inc file
|
||||||
cat comp-cmd.log |gawk -v destdir=${destdir} -v gdbversion=${gdbversion} '
|
cat comp-cmd.log |gawk -v destdir=${destdir} -v gdbversion=${gdbversion} '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
|
use_mingw=0;
|
||||||
print "{ libgdb.inc file generated by awk script }"
|
print "{ libgdb.inc file generated by awk script }"
|
||||||
print "{$define GDB_V" gdbversion " }"
|
print "{$define GDB_V" gdbversion " }"
|
||||||
print "{$ifdef COMPILING_GDBINT_UNIT }"
|
print "{$ifdef COMPILING_GDBINT_UNIT }"
|
||||||
@ -93,18 +107,24 @@ BEGIN {
|
|||||||
|
|
||||||
for (i=1; i<=nb; i++) {
|
for (i=1; i<=nb; i++) {
|
||||||
if ( list[i] ~ /lib[^ ]*\.a/ ) {
|
if ( list[i] ~ /lib[^ ]*\.a/ ) {
|
||||||
libs = gensub (/([^ ]*)(lib[^ ]*\.a)/,"{$LINKLIB \\2} { found in \\1 }","g",list[i]);
|
staticlib = gensub (/([^ ]*)(lib[^ ]*\.a)/,"{$LINKLIB \\2} { found in \\1 }","g",list[i]);
|
||||||
print libs;
|
print staticlib;
|
||||||
|
if ( list[i] ~/mingw/ ) {
|
||||||
|
use_mingw=1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( list[i] ~ /-l/ ) {
|
if ( list[i] ~ /-l/ ) {
|
||||||
dlibs = gensub (/-l([^ ]*)/,"{$LINKLIB \\1} { with -l gcc option}","g",list[i]);
|
systemlib = gensub (/-l([^ ]*)/,"{$LINKLIB \\1} { with -l gcc option}","g",list[i]);
|
||||||
print dlibs;
|
print systemlib;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
END {
|
END {
|
||||||
print "{$endif COMPILING_GDBINT_UNIT }"
|
print "{$endif COMPILING_GDBINT_UNIT }"
|
||||||
print "{$undef NotImplemented}"
|
print "{$undef NotImplemented}"
|
||||||
|
if ( use_mingw == 1 ) {
|
||||||
|
print "{$define USE_MINGW_GDB}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
' | tee gdblib.inc
|
' | tee gdblib.inc
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user