Browse Source

+ Use gdbver to guess correct libgdb version

pierre 24 years ago
parent
commit
6416286e3e
2 changed files with 36 additions and 3 deletions
  1. 21 2
      packages/gdbint/Makefile
  2. 15 1
      packages/gdbint/Makefile.fpc

+ 21 - 2
packages/gdbint/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v1.00 [2001/01/30]
+# Makefile generated by fpcmake v1.00 [2001/03/13]
 #
 
 defaultrule: all
@@ -198,7 +198,7 @@ endif
 # Targets
 
 override UNITOBJECTS+=gdbint gdbcon
-override EXAMPLEOBJECTS+=testgdb symify
+override EXAMPLEOBJECTS+=gdbver testgdb symify
 
 # Clean
 
@@ -321,6 +321,11 @@ ifndef LD
 LD=ld
 endif
 
+# Resource compiler
+ifndef RC
+RC=rc
+endif
+
 # ppas.bat / ppas.sh
 PPAS=ppas$(BATCHEXT)
 
@@ -1329,10 +1334,24 @@ endif
 # Users rules
 #####################################################################
 
+ifdef GDBVER
 gdbint$(PPUEXT): gdbint$(PASEXT)
+	$(COMPILER) -d$(GDBVER) gdbint$(PASEXT)
+else
+gdbint$(PPUEXT): gdbver$(EXEEXT) gdbint$(PASEXT)
+ifeq ($(shell gdbver$(EXEEXT) -n),5)
+	$(ECHO) Using GDB 5
+	$(MAKE) gdbint$(PPUEXT) GDBVER=GDB_V5
+else
+	$(ECHO) Using GDB 4
+	$(MAKE) gdbint$(PPUEXT) GDBVER=GDB_V4
+endif
+endif
 
 gdbcon$(PPUEXT): gdbcon$(PASEXT) gdbint$(PPUEXT)
 
+gdbver$(EXEEXT): gdbver$(PASEXT)
+
 ifeq ($(OS_TARGET),go32v2)
 DBGCOM=dbgcom$(OEXT)
 else

+ 15 - 1
packages/gdbint/Makefile.fpc

@@ -4,7 +4,7 @@
 
 [targets]
 units=gdbint gdbcon
-examples=testgdb symify
+examples=gdbver testgdb symify
 
 [install]
 examplesubdir=gdbint
@@ -20,10 +20,24 @@ libgcc=1
 
 
 [rules]
+ifdef GDBVER
 gdbint$(PPUEXT): gdbint$(PASEXT)
+	$(COMPILER) -d$(GDBVER) gdbint$(PASEXT)
+else
+gdbint$(PPUEXT): gdbver$(EXEEXT) gdbint$(PASEXT)
+ifeq ($(shell gdbver$(EXEEXT) -n),5)
+	$(ECHO) Using GDB 5
+	$(MAKE) gdbint$(PPUEXT) GDBVER=GDB_V5
+else
+	$(ECHO) Using GDB 4
+	$(MAKE) gdbint$(PPUEXT) GDBVER=GDB_V4
+endif
+endif
 
 gdbcon$(PPUEXT): gdbcon$(PASEXT) gdbint$(PPUEXT)
 
+gdbver$(EXEEXT): gdbver$(PASEXT)
+
 ifeq ($(OS_TARGET),go32v2)
 DBGCOM=dbgcom$(OEXT)
 else