瀏覽代碼

* improve DJGPP output

git-svn-id: trunk@14161 -
pierre 15 年之前
父節點
當前提交
5c2749d8ab
共有 1 個文件被更改,包括 10 次插入4 次删除
  1. 10 4
      packages/gdbint/gen-gdblib-inc.sh

+ 10 - 4
packages/gdbint/gen-gdblib-inc.sh

@@ -3,10 +3,16 @@
 if [ "$1" != "" ]; then
   destdir=$1
 fi
-if [ "$PATHEXT" != "" ]; then
+if [ "${PATHEXT}" != "" ]; then
   EXEEXT=.exe
+  if [ "${DJDIR}" != "" ]; then
+    libdir=${DJDIR}/lib
+  else
+    libdir=/lib
+  fi
 else
   EXEEXT=
+  libdir=/libdir
 fi
 
 echo "Deleting gdb${EXEEXT} to force recompile"
@@ -51,7 +57,7 @@ if ( doprint == 1 ) {
 ' | tee comp-cmd.log
 # Try to locate all libraries
 echo Creating ./copy-libs.sh script
-cat comp-cmd.log |gawk -v destdir=${destdir} '
+cat comp-cmd.log |gawk -v destdir=${destdir} -v libdir=${libdir} '
 BEGIN {
   print "#!/bin/bash"
   print "# copy-libs.sh generated by awk script"
@@ -78,7 +84,7 @@ BEGIN {
   }
   if ( list[i] ~ /-l/ ) {
   systemlib = gensub (/-l([^ ]*)/,"lib\\1.a ","g",list[i]);
-  print "systemlib=`find /lib -name " systemlib "`" ;
+  print "systemlib=`find " libdir " -name " systemlib "`" ;
   print "if [ \"${systemlib}\" != \"\" ]; then";
   print "echo System lib found: ${systemlib}";
   print "cp ${systemlib} ${destdir}";
@@ -89,7 +95,7 @@ BEGIN {
   }
 }
 ' | tee copy-libs.sh
-chmod u+x ./copy-libs.sh
+chmod u+x ./copy-libs.sh           
 # For later
  
 echo Creating ./gdblib.inc file