Browse Source

* first things for sharedlib to work again

peter 26 years ago
parent
commit
67eb0c83da
2 changed files with 33 additions and 36 deletions
  1. 18 35
      base/makefile.fpc
  2. 15 1
      rtl/linux/Makefile

+ 18 - 35
base/makefile.fpc

@@ -228,7 +228,7 @@ endif
 ifndef ECHO
 ifndef ECHO
 ECHO=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
 ECHO=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO=echo
+ECHO=@echo
 else
 else
 export ECHO:=@$(firstword $(ECHO))
 export ECHO:=@$(firstword $(ECHO))
 endif
 endif
@@ -512,29 +512,7 @@ endif
 
 
 # Smartlinking
 # Smartlinking
 ifeq ($(SMARTLINK),YES)
 ifeq ($(SMARTLINK),YES)
-ifeq ($(LIBTYPE),shared)
-override SMARTLINK=NO
-else
 override PPOPT+=-Cx
 override PPOPT+=-Cx
-ifneq ($(LIBNAME),)
-override PPOPT+=-o$(LIBNAME)
-endif
-endif
-endif
-
-# Add library type, for static libraries smartlinking is automatic used
-ifeq ($(LIBTYPE),shared)
-override PPOPT+=-CD
-ifneq ($(LIBNAME),)
-override PPOPT+=-o$(LIBNAME)
-endif
-else
-ifeq ($(LIBTYPE),static)
-override PPOPT+=-CS
-ifneq ($(LIBNAME),)
-override PPOPT+=-o$(LIBNAME)
-endif
-endif
 endif
 endif
 
 
 # Add defines from PPOPTDEF to PPOPT
 # Add defines from PPOPTDEF to PPOPT
@@ -606,13 +584,6 @@ SHAREDLIBEXT=.dll
 PACKAGESUFFIX=os2
 PACKAGESUFFIX=os2
 endif
 endif
 
 
-# determine libary extension.
-ifeq ($(LIBTYPE),static)
-LIBEXT=$(STATICLIBEXT)
-else
-LIBEXT=$(SHAREDLIBEXT)
-endif
-
 # library prefix
 # library prefix
 LIBPREFIX=lib
 LIBPREFIX=lib
 ifeq ($(OS_TARGET),go32v2)
 ifeq ($(OS_TARGET),go32v2)
@@ -659,7 +630,7 @@ export FPCDIR FPCMAKE
 
 
 # Compiler info
 # Compiler info
 export FPC_VERSION OS_SOURCE OS_TARGET CPU
 export FPC_VERSION OS_SOURCE OS_TARGET CPU
-export OPT OPTDEF PP RELEASE VERBOSE SMARTLINK LIBTYPE LIBNAME
+export OPT OPTDEF PP RELEASE VERBOSE SMARTLINK
 
 
 # Installation
 # Installation
 export PREFIXINSTALLDIR PACKAGESUFFIX
 export PREFIXINSTALLDIR PACKAGESUFFIX
@@ -731,15 +702,24 @@ fpc_exes: $(EXEFILES)
 # Library
 # Library
 #####################################################################
 #####################################################################
 
 
+# Default sharedlib units are all unit objects
+ifndef SHAREDLIBUNITOBJECTS
+SHAREDLIBUNITOBJECTS=UNITOBJECTS
+endif
+
 fpc_staticlib:
 fpc_staticlib:
 	$(MAKE) libsclean
 	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES LIBTYPE=static
-
+	$(MAKE) all SMARTLINK=YES
 
 
 fpc_sharedlib:
 fpc_sharedlib:
 ifdef inlinux
 ifdef inlinux
+ifndef LIBNAME
+	$(ECHO) LIBNAME not set
+else	
 	$(MAKE) libsclean
 	$(MAKE) libsclean
-	$(MAKE) all LIBTYPE=shared
+	$(MAKE) all
+	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)
+endif	
 else
 else
 	@$(ECHO) Shared Libraries not supported
 	@$(ECHO) Shared Libraries not supported
 endif
 endif
@@ -1034,7 +1014,10 @@ endif
 
 
 #
 #
 # $Log$
 # $Log$
-# Revision 1.29  1999-06-01 13:27:24  peter
+# Revision 1.30  1999-06-03 09:36:31  peter
+#   * first things for sharedlib to work again
+#
+# Revision 1.29  1999/06/01 13:27:24  peter
 #   * updates for linux
 #   * updates for linux
 #
 #
 # Revision 1.28  1999/05/30 11:33:04  peter
 # Revision 1.28  1999/05/30 11:33:04  peter

+ 15 - 1
rtl/linux/Makefile

@@ -39,6 +39,9 @@ TARGETDIR=.
 # These units belong to the RTL
 # These units belong to the RTL
 UNITPREFIX=rtl
 UNITPREFIX=rtl
 
 
+# Default library name
+LIBNAME=fprtl
+
 
 
 #####################################################################
 #####################################################################
 # Own defaults
 # Own defaults
@@ -76,6 +79,14 @@ UNITOBJECTS=$(SYSTEMUNIT) objpas strings \
             cpu mmx getopts heaptrc \
             cpu mmx getopts heaptrc \
             errors sockets ipc
             errors sockets ipc
 
 
+# Unit Objects Which are placed in libfpc.so
+SHAREDLIBUNITOBJECTS=$(SYSTEMUNIT) objpas strings \
+            linux ports \
+            dos crt objects printer \
+            sysutils typinfo math \
+            cpu mmx getopts heaptrc \
+            errors sockets ipc
+
 
 
 #####################################################################
 #####################################################################
 # Common targets
 # Common targets
@@ -282,7 +293,10 @@ ipc$(PPUEXT) : ipc.pp linux$(PPUEXT) $(SYSTEMPPU)
 
 
 #
 #
 # $Log$
 # $Log$
-# Revision 1.27  1999-05-28 11:28:30  peter
+# Revision 1.28  1999-06-03 09:36:32  peter
+#   * first things for sharedlib to work again
+#
+# Revision 1.27  1999/05/28 11:28:30  peter
 #   * ipc unit can be compiled with 0.99.10 again
 #   * ipc unit can be compiled with 0.99.10 again
 #
 #
 # Revision 1.26  1999/05/28 11:21:06  peter
 # Revision 1.26  1999/05/28 11:21:06  peter