Browse Source

* SMARTLINK=1 split into CREATESMART=1 and LINKSMART=1
* FPCDIR checks enhanced

peter 25 years ago
parent
commit
b78c0f3413
3 changed files with 244 additions and 203 deletions
  1. 213 195
      utils/fpcmake.inc
  2. 24 7
      utils/fpcmake.ini
  3. 7 1
      utils/fpcmake.pp

File diff suppressed because it is too large
+ 213 - 195
utils/fpcmake.inc


+ 24 - 7
utils/fpcmake.ini

@@ -128,8 +128,10 @@ export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
+ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=wrong
 endif
+endif
 else
 override FPCDIR=wrong
 endif
@@ -138,9 +140,23 @@ endif
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifdef inlinux
+override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
+ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+endif
 else
 override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR=wrong
+endif
+endif
+endif
+endif
 endif
 endif
 
@@ -659,6 +675,7 @@ export OTHERLIBDIR
 # Redirection
 #####################################################################
 
+# Release ? Then force OPT and don't use extra opts via commandline
 ifndef REDIRFILE
 REDIRFILE=log
 endif
@@ -745,24 +762,24 @@ endif
 
 [command_end]
 # Smartlinking
-ifdef SMARTLINK
+ifdef LINKSMART
 override FPCOPT+=-CX
 endif
 
+# Smartlinking
+ifdef CREATESMART
+override FPCOPT+=-XX
+endif
+
 # Debug
 ifdef DEBUG
 override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
-# 0.99.12b has a bug in the optimizer so don't use it by default
 ifdef RELEASE
-ifeq ($(FPC_VERSION),0.99.12)
-override FPCOPT+=-Xs -OGp3 -n
-else
 override FPCOPT+=-Xs -OG2p3 -n
 endif
-endif
 
 # Verbose settings (warning,note,info)
 ifdef VERBOSE
@@ -986,7 +1003,7 @@ SHAREDLIBUNITOBJECTS:=$(UNITOBJECTS)
 endif
 
 fpc_smart:
-        $(MAKE) all SMARTLINK=1
+        $(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
 ifdef inlinux

+ 7 - 1
utils/fpcmake.pp

@@ -965,9 +965,11 @@ begin
         Add('ifeq ($(FPCDIR),wrong)');
         Add('override FPCDIR='+userini.dirfpc);
         Add('ifeq ($(wildcard $(FPCDIR)/rtl),)');
+        Add('ifeq ($(wildcard $(FPCDIR)/units),)');
         Add('override FPCDIR=wrong');
         Add('endif');
         Add('endif');
+        Add('endif');
         Add('');
       end;
      AddSection(true,'fpcdirdetect');
@@ -1298,7 +1300,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.27  2000-01-16 22:26:47  peter
+  Revision 1.28  2000-01-26 21:16:26  peter
+    * SMARTLINK=1 split into CREATESMART=1 and LINKSMART=1
+    * FPCDIR checks enhanced
+
+  Revision 1.27  2000/01/16 22:26:47  peter
     * use environment variable again for win32, the file writing gives to
       much trouble
 

Some files were not shown because too many files changed in this diff