瀏覽代碼

* fixed fpmake invokation when building an i386-linux snapshot on a x86_64-linux host

git-svn-id: trunk@45298 -
nickysn 5 年之前
父節點
當前提交
56b79257a1
共有 100 個文件被更改,包括 600 次插入100 次删除
  1. 6 1
      Makefile
  2. 6 1
      compiler/Makefile
  3. 6 1
      compiler/utils/Makefile
  4. 6 1
      installer/Makefile
  5. 6 1
      packages/Makefile
  6. 6 1
      packages/a52/Makefile
  7. 6 1
      packages/ami-extra/Makefile
  8. 6 1
      packages/amunits/Makefile
  9. 6 1
      packages/arosunits/Makefile
  10. 6 1
      packages/aspell/Makefile
  11. 6 1
      packages/bfd/Makefile
  12. 6 1
      packages/bzip2/Makefile
  13. 6 1
      packages/cairo/Makefile
  14. 6 1
      packages/cdrom/Makefile
  15. 6 1
      packages/cdrom/examples/Makefile
  16. 6 1
      packages/chm/Makefile
  17. 6 1
      packages/cocoaint/Makefile
  18. 6 1
      packages/dblib/Makefile
  19. 6 1
      packages/dbus/Makefile
  20. 6 1
      packages/dbus/examples/Makefile
  21. 6 1
      packages/dts/Makefile
  22. 6 1
      packages/fastcgi/Makefile
  23. 6 1
      packages/fcl-async/Makefile
  24. 6 1
      packages/fcl-base/Makefile
  25. 6 1
      packages/fcl-base/examples/Makefile
  26. 6 1
      packages/fcl-db/Makefile
  27. 6 1
      packages/fcl-db/src/base/Makefile
  28. 6 1
      packages/fcl-db/src/codegen/Makefile
  29. 6 1
      packages/fcl-db/src/datadict/Makefile
  30. 6 1
      packages/fcl-db/src/dbase/Makefile
  31. 6 1
      packages/fcl-db/src/export/Makefile
  32. 6 1
      packages/fcl-db/src/json/Makefile
  33. 6 1
      packages/fcl-db/src/memds/Makefile
  34. 6 1
      packages/fcl-db/src/paradox/Makefile
  35. 6 1
      packages/fcl-db/src/sdf/Makefile
  36. 6 1
      packages/fcl-db/src/sql/Makefile
  37. 6 1
      packages/fcl-db/src/sqldb/Makefile
  38. 6 1
      packages/fcl-db/src/sqldb/interbase/Makefile
  39. 6 1
      packages/fcl-db/src/sqldb/mssql/Makefile
  40. 6 1
      packages/fcl-db/src/sqldb/mysql/Makefile
  41. 6 1
      packages/fcl-db/src/sqldb/odbc/Makefile
  42. 6 1
      packages/fcl-db/src/sqldb/oracle/Makefile
  43. 6 1
      packages/fcl-db/src/sqldb/postgres/Makefile
  44. 6 1
      packages/fcl-db/src/sqldb/sqlite/Makefile
  45. 6 1
      packages/fcl-db/src/sqlite/Makefile
  46. 6 1
      packages/fcl-db/tests/Makefile
  47. 6 1
      packages/fcl-extra/Makefile
  48. 6 1
      packages/fcl-extra/examples/Makefile
  49. 6 1
      packages/fcl-fpcunit/Makefile
  50. 6 1
      packages/fcl-fpcunit/src/exampletests/Makefile
  51. 6 1
      packages/fcl-fpcunit/src/tests/Makefile
  52. 6 1
      packages/fcl-image/Makefile
  53. 6 1
      packages/fcl-image/examples/Makefile
  54. 6 1
      packages/fcl-js/Makefile
  55. 6 1
      packages/fcl-json/Makefile
  56. 6 1
      packages/fcl-net/Makefile
  57. 6 1
      packages/fcl-net/examples/Makefile
  58. 6 1
      packages/fcl-passrc/Makefile
  59. 6 1
      packages/fcl-pdf/Makefile
  60. 6 1
      packages/fcl-process/Makefile
  61. 6 1
      packages/fcl-registry/Makefile
  62. 6 1
      packages/fcl-registry/tests/Makefile
  63. 6 1
      packages/fcl-report/Makefile
  64. 6 1
      packages/fcl-res/Makefile
  65. 6 1
      packages/fcl-sdo/Makefile
  66. 6 1
      packages/fcl-sound/Makefile
  67. 6 1
      packages/fcl-stl/Makefile
  68. 6 1
      packages/fcl-web/Makefile
  69. 6 1
      packages/fcl-web/src/base/Makefile
  70. 6 1
      packages/fcl-web/src/jsonrpc/Makefile
  71. 6 1
      packages/fcl-web/src/webdata/Makefile
  72. 6 1
      packages/fcl-xml/Makefile
  73. 6 1
      packages/fftw/Makefile
  74. 6 1
      packages/fpgtk/Makefile
  75. 6 1
      packages/fpgtk/examples/Makefile
  76. 6 1
      packages/fpindexer/Makefile
  77. 6 1
      packages/fpmkunit/Makefile
  78. 6 1
      packages/fppkg/Makefile
  79. 6 1
      packages/fuse/Makefile
  80. 6 1
      packages/fv/Makefile
  81. 6 1
      packages/fv/examples/Makefile
  82. 6 1
      packages/gdbint/Makefile
  83. 6 1
      packages/gdbm/Makefile
  84. 6 1
      packages/gdbm/examples/Makefile
  85. 6 1
      packages/ggi/Makefile
  86. 6 1
      packages/ggi/examples/Makefile
  87. 6 1
      packages/gmp/Makefile
  88. 6 1
      packages/gmp/examples/Makefile
  89. 6 1
      packages/gnome1/Makefile
  90. 6 1
      packages/gnutls/Makefile
  91. 6 1
      packages/googleapi/Makefile
  92. 6 1
      packages/graph/Makefile
  93. 6 1
      packages/gtk1/Makefile
  94. 6 1
      packages/gtk1/examples/Makefile
  95. 6 1
      packages/gtk1/examples/tutorial/Makefile
  96. 6 1
      packages/gtk1/src/gtkgl/Makefile
  97. 6 1
      packages/gtk2/Makefile
  98. 6 1
      packages/gtk2/examples/Makefile
  99. 6 1
      packages/gtk2/examples/filechooser/Makefile
  100. 6 1
      packages/gtk2/examples/gettingstarted/Makefile

+ 6 - 1
Makefile

@@ -1033,6 +1033,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1044,7 +1045,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -1637,8 +1638,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
compiler/Makefile

@@ -2651,6 +2651,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -2662,7 +2663,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3591,8 +3592,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
compiler/utils/Makefile

@@ -1765,6 +1765,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1776,7 +1777,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2705,8 +2706,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
installer/Makefile

@@ -982,6 +982,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -993,7 +994,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3605,8 +3606,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/Makefile

@@ -606,6 +606,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -617,7 +618,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -1546,8 +1547,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/a52/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/ami-extra/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/amunits/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/arosunits/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/aspell/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/bfd/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/bzip2/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/cairo/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/cdrom/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/cdrom/examples/Makefile

@@ -869,6 +869,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -880,7 +881,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2631,8 +2632,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/chm/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/cocoaint/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/dblib/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/dbus/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/dbus/examples/Makefile

@@ -869,6 +869,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -880,7 +881,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2631,8 +2632,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/dts/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fastcgi/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-async/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-base/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-base/examples/Makefile

@@ -869,6 +869,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -880,7 +881,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3727,8 +3728,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/base/Makefile

@@ -1763,6 +1763,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1774,7 +1775,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3662,8 +3663,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/codegen/Makefile

@@ -1465,6 +1465,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1476,7 +1477,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3227,8 +3228,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/datadict/Makefile

@@ -1465,6 +1465,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1476,7 +1477,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3824,8 +3825,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/dbase/Makefile

@@ -2067,6 +2067,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -2078,7 +2079,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3829,8 +3830,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/export/Makefile

@@ -1465,6 +1465,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1476,7 +1477,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3364,8 +3365,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/json/Makefile

@@ -871,6 +871,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -882,7 +883,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2770,8 +2771,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/memds/Makefile

@@ -1465,6 +1465,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1476,7 +1477,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3227,8 +3228,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/paradox/Makefile

@@ -1168,6 +1168,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1179,7 +1180,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3067,8 +3068,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/sdf/Makefile

@@ -1168,6 +1168,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1179,7 +1180,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2930,8 +2931,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/sql/Makefile

@@ -1762,6 +1762,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1773,7 +1774,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3524,8 +3525,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/sqldb/Makefile

@@ -1588,6 +1588,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1599,7 +1600,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3887,8 +3888,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/sqldb/interbase/Makefile

@@ -1168,6 +1168,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1179,7 +1180,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3067,8 +3068,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/sqldb/mssql/Makefile

@@ -1168,6 +1168,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1179,7 +1180,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2930,8 +2931,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/sqldb/mysql/Makefile

@@ -1465,6 +1465,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1476,7 +1477,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3364,8 +3365,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/sqldb/odbc/Makefile

@@ -1168,6 +1168,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1179,7 +1180,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3067,8 +3068,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/sqldb/oracle/Makefile

@@ -1465,6 +1465,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1476,7 +1477,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3364,8 +3365,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/sqldb/postgres/Makefile

@@ -1465,6 +1465,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1476,7 +1477,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3364,8 +3365,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/sqldb/sqlite/Makefile

@@ -1168,6 +1168,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1179,7 +1180,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3067,8 +3068,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/src/sqlite/Makefile

@@ -871,6 +871,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -882,7 +883,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2770,8 +2771,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-db/tests/Makefile

@@ -1168,6 +1168,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1179,7 +1180,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3067,8 +3068,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-extra/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-extra/examples/Makefile

@@ -689,6 +689,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -700,7 +701,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2588,8 +2589,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-fpcunit/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-fpcunit/src/exampletests/Makefile

@@ -1168,6 +1168,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1179,7 +1180,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3204,8 +3205,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-fpcunit/src/tests/Makefile

@@ -1168,6 +1168,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1179,7 +1180,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3204,8 +3205,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-image/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-image/examples/Makefile

@@ -869,6 +869,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -880,7 +881,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2631,8 +2632,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-js/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-json/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-net/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-net/examples/Makefile

@@ -1463,6 +1463,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1474,7 +1475,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3499,8 +3500,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-passrc/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-pdf/Makefile

@@ -606,6 +606,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -617,7 +618,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2368,8 +2369,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-process/Makefile

@@ -606,6 +606,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -617,7 +618,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -1546,8 +1547,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-registry/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-registry/tests/Makefile

@@ -871,6 +871,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -882,7 +883,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -1811,8 +1812,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-report/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2618,8 +2619,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-res/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-sdo/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-sound/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-stl/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-web/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-web/src/base/Makefile

@@ -1466,6 +1466,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1477,7 +1478,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -4096,8 +4097,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-web/src/jsonrpc/Makefile

@@ -1169,6 +1169,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1180,7 +1181,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3205,8 +3206,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-web/src/webdata/Makefile

@@ -1169,6 +1169,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1180,7 +1181,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3342,8 +3343,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fcl-xml/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fftw/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fpgtk/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fpgtk/examples/Makefile

@@ -1166,6 +1166,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1177,7 +1178,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2928,8 +2929,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fpindexer/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fpmkunit/Makefile

@@ -625,6 +625,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -636,7 +637,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2113,8 +2114,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fppkg/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fuse/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fv/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/fv/examples/Makefile

@@ -1165,6 +1165,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1176,7 +1177,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2927,8 +2928,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gdbint/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gdbm/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gdbm/examples/Makefile

@@ -869,6 +869,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -880,7 +881,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2631,8 +2632,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/ggi/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/ggi/examples/Makefile

@@ -869,6 +869,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -880,7 +881,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2631,8 +2632,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gmp/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gmp/examples/Makefile

@@ -869,6 +869,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -880,7 +881,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2631,8 +2632,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gnome1/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gnutls/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2344,8 +2345,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/googleapi/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/graph/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gtk1/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gtk1/examples/Makefile

@@ -1463,6 +1463,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1474,7 +1475,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -3225,8 +3226,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gtk1/examples/tutorial/Makefile

@@ -572,6 +572,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -583,7 +584,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2334,8 +2335,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gtk1/src/gtkgl/Makefile

@@ -1170,6 +1170,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -1181,7 +1182,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2932,8 +2933,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gtk2/Makefile

@@ -582,6 +582,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -593,7 +594,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2207,8 +2208,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gtk2/examples/Makefile

@@ -869,6 +869,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -880,7 +881,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2768,8 +2769,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gtk2/examples/filechooser/Makefile

@@ -869,6 +869,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -880,7 +881,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2631,8 +2632,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

+ 6 - 1
packages/gtk2/examples/gettingstarted/Makefile

@@ -869,6 +869,7 @@ endif
 endif
 endif
 endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(CROSSGCC),)
@@ -880,7 +881,7 @@ ifdef inUnix
 ifeq ($(OS_SOURCE),netbsd)
 OTHERLIBDIR:=/usr/pkg/lib
 endif
-export GCCLIBDIR OTHERLIBDIR
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
 endif
 BATCHEXT=.bat
 LOADEREXT=.as
@@ -2631,8 +2632,12 @@ ifdef LINKSHARED
 endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
 override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
 endif
+endif
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif

部分文件因文件數量過多而無法顯示