Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Aug 1998 00:04:17 +0200
From:      Ollivier Robert <roberto@keltia.freenix.fr>
To:        ports@FreeBSD.ORG
Subject:   Re: ELF transition for ports (Re: rayshade port)
Message-ID:  <19980826000417.A19444@keltia.freenix.fr>
In-Reply-To: <199808240616.IAA24050@gratis.grondar.za>; from Mark Murray on Mon, Aug 24, 1998 at 08:15:59AM %2B0200
References:  <199808240616.IAA24050@gratis.grondar.za>

next in thread | previous in thread | raw e-mail | index | archive | help
According to Mark Murray:
> Some patches were posted a while back fixing Xfree86 for ELF.

That was me. The patch is for 3.3.1 and has probably to be updated because
I used egcs/ELF to build it, not the builtin compiler. Hope they'll be
useful.


diff -ur xc/config/cf/FreeBSD.cf xc.new/config/cf/FreeBSD.cf
--- xc/config/cf/FreeBSD.cf	Sun Jun 29 10:43:25 1997
+++ xc.new/config/cf/FreeBSD.cf	Thu Feb  5 20:03:08 1998
@@ -8,13 +8,13 @@
 #define OSVendor		/**/
 #endif
 #ifndef OSMajorVersion
-#define OSMajorVersion		DefaultOSMajorVersion
+#define OSMajorVersion		3
 #endif
 #ifndef OSMinorVersion
-#define OSMinorVersion		DefaultOSMinorVersion
+#define OSMinorVersion		0
 #endif
 #ifndef OSTeenyVersion
-#define OSTeenyVersion		DefaultOSTeenyVersion
+#define OSTeenyVersion		0
 #endif
 XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
 
@@ -49,7 +49,11 @@
 
 #define MkdirHierCmd		mkdir -p
 
-#define CcCmd			cc
+#ifdef ELF
+#define CcCmd			gcc -mcpu=amdk6
+#else
+#define CcCmd           cc
+#endif
 #define CppCmd			/usr/libexec/cpp
 #define PreProcessCmd		CppCmd
 #define StandardCppDefines	-traditional
@@ -180,7 +184,11 @@
 
 #if GccUsesGas
 # define GccGasOption 		-DGCCUSESGAS
-# define AsmDefines		-DUSE_GAS
+# ifdef ELF
+#  define AsmDefines		-DUSE_GAS -D__ELF__
+# else
+#  define AsmDefines		-DUSE_GAS
+# endif
 #else
 # define GccGasOption /**/
 #endif
@@ -210,14 +218,14 @@
 /* The GCC strength-reduce bug is fixed for FreeBSD 2.1.5 and later */
 #ifndef DefaultGcc2i386Opt
 #if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion > 1) || (OSMajorVersion == 2 && OSMinorVersion == 1 && OSTeenyVersion >= 5)
-#define DefaultGcc2i386Opt -O2
+#define DefaultGcc2i386Opt -O3 -pipe -fno-inline
 #endif
 #endif
 
 #ifdef i386Architecture
 # define OptimizedCDebugFlags DefaultGcc2i386Opt
 #else
-# define OptimizedCDebugFlags -O2
+# define OptimizedCDebugFlags -O3 -fno-inline
 #endif
 
 #ifndef PreIncDir
@@ -311,6 +319,12 @@
 #if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion >= 1)
 #define HasBsdMake	YES
 #endif
+
+#define BuildDynamicLoading   YES
+#define HasSharedLibraries    YES
+#ifdef ELF
+#  define UseElfFormat          YES
+#endif /* ELF */
 
 #ifndef StaticLibrary
 #define StaticLibrary(libpath,libname) -Wl,-Bstatic Concat(-L,libpath) Concat(-l,libname) -Wl,-Bdynamic
diff -ur xc/config/cf/bsdLib.rules xc.new/config/cf/bsdLib.rules
--- xc/config/cf/bsdLib.rules	Sun May 11 07:04:04 1997
+++ xc.new/config/cf/bsdLib.rules	Sat Jan 31 16:19:44 1998
@@ -228,6 +228,21 @@
 
 #endif /* SharedLibraryTarget */
 
+#ifndef SharedDepModuleTarget
+#define SharedDepModuleTarget(name,deps,solist)				@@\
+AllTarget(name)								@@\
+									@@\
+name: deps								@@\
+	$(RM) $@~							@@\
+	$(CC) -o $@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) BaseShLibReqs @@\
+	$(RM) $@							@@\
+	$(MV) $@~ $@							@@\
+									@@\
+clean::									@@\
+	$(RM) name
+
+#endif /* SharedDepModuleTarget */
+
 /*
  * SharedLibraryDataTarget - generate rules to create shlib data file;
  */
diff -ur xc/config/cf/xf86.rules xc.new/config/cf/xf86.rules
--- xc/config/cf/xf86.rules	Sun May 18 14:00:01 1997
+++ xc.new/config/cf/xf86.rules	Sat Jan 31 17:34:21 1998
@@ -162,6 +162,19 @@
 /*
  * DynamicModuleTarget - build a module to be dynamically loaded
  */
+#ifdef UseElfFormat
+#ifndef DynamicModuleTarget
+#define DynamicModuleTarget(module,modlist)				@@\
+AllTarget(module)							@@\
+									@@\
+module: modlist								@@\
+	RemoveFile($@)							@@\
+	$(CC) -o $@ $(SHLIBLDFLAGS) -Wl,-soname,$@ modlist				@@\
+									@@\
+clean::									@@\
+	RemoveFile(module)
+#endif /* DynamicModuleTarget */
+#else
 #ifndef DynamicModuleTarget
 #define DynamicModuleTarget(module,modlist)				@@\
 AllTarget(module)							@@\
@@ -173,7 +186,7 @@
 clean::									@@\
 	RemoveFile(module)
 #endif /* DynamicModuleTarget */
-
+#endif /* UseElfFormat */
 /*
  * InstallDynamicModule - install a dynamic module
  */
diff -ur xc/config/cf/xf86site.def xc.new/config/cf/xf86site.def
--- xc/config/cf/xf86site.def	Sun Jun 22 12:32:22 1997
+++ xc.new/config/cf/xf86site.def	Thu Feb  5 19:06:55 1998
@@ -405,8 +405,8 @@
 /*
  * If you don't want to build PEX, uncomment this.
  *
-#define BuildPexExt		NO
  */
+#define BuildPexExt		NO
 
 /*
  * If you don't want to build XIE, uncomment this.
diff -ur xc/config/cf/xfree86.cf xc.new/config/cf/xfree86.cf
--- xc/config/cf/xfree86.cf	Sun Jul  6 09:28:00 1997
+++ xc.new/config/cf/xfree86.cf	Sat Jan 31 15:32:40 1998
@@ -32,46 +32,46 @@
 #define XF86SVGAServer          YES
 #endif
 #ifndef XF86VGA16Server
-#define XF86VGA16Server         YES
+#define XF86VGA16Server         NO
 #endif
 #ifndef XF86VGA16DualServer
-#define XF86VGA16DualServer	YES
+#define XF86VGA16DualServer	NO
 #endif
 #ifndef XF86MonoServer
-#define XF86MonoServer          YES
+#define XF86MonoServer          NO
 #endif
 #ifndef XF86MonoDualServer
-#define XF86MonoDualServer	YES
+#define XF86MonoDualServer	NO
 #endif
 #ifndef XF86S3Server
-#define XF86S3Server            YES
+#define XF86S3Server            NO
 #endif
 #ifndef XF86S3VServer
-#define XF86S3VServer		YES
+#define XF86S3VServer		NO
 #endif
 #ifndef XF86I8514Server
-#define XF86I8514Server         YES
+#define XF86I8514Server         NO
 #endif
 #ifndef XF86Mach8Server
-#define XF86Mach8Server         YES
+#define XF86Mach8Server         NO
 #endif
 #ifndef XF86Mach32Server
-#define XF86Mach32Server        YES
+#define XF86Mach32Server        NO
 #endif
 #ifndef XF86Mach64Server
-#define XF86Mach64Server        YES
+#define XF86Mach64Server        NO
 #endif
 #ifndef XF86P9000Server
-#define XF86P9000Server		YES
+#define XF86P9000Server		NO
 #endif
 #ifndef XF86AGXServer
-#define XF86AGXServer		YES
+#define XF86AGXServer		NO
 #endif
 #ifndef XF86W32Server
-#define XF86W32Server		YES
+#define XF86W32Server		NO
 #endif
 #ifndef XF86I128Server
-#define XF86I128Server		YES
+#define XF86I128Server		NO
 #endif
 #endif
 
diff -ur xc/programs/Xserver/hw/xfree86/os-support/assyntax.h xc.new/programs/Xserver/hw/xfree86/os-support/assyntax.h
--- xc/programs/Xserver/hw/xfree86/os-support/assyntax.h	Sun May 11 04:56:22 1997
+++ xc.new/programs/Xserver/hw/xfree86/os-support/assyntax.h	Thu Feb  5 21:06:03 1998
@@ -212,7 +212,7 @@
 #endif /* ACK_ASSEMBLER */
 
 
-#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(linux) || defined(__OS2ELF__)) && defined(__ELF__)
+#if defined(__FreeBSD__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(linux) || defined(__OS2ELF__)) && defined(__ELF__)
 #define GLNAME(a)       a
 #else
 #define GLNAME(a)       CONCAT(_,a)
Only in xc/programs/Xserver/hw/xfree86/vga256/drivers/mga/util: Makefile
diff -ur xc/programs/Xserver/hw/xfree86/xaa/xf86expblt.c xc.new/programs/Xserver/hw/xfree86/xaa/xf86expblt.c
--- xc/programs/Xserver/hw/xfree86/xaa/xf86expblt.c	Sat Jul 26 08:30:58 1997
+++ xc.new/programs/Xserver/hw/xfree86/xaa/xf86expblt.c	Fri Feb  6 00:18:17 1998
@@ -83,7 +83,7 @@
 
 #if defined(__GNUC__) && defined(__i386__)
 static __inline__ unsigned int reverse_bitorder(data) {
-#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(linux) || defined (__OS2ELF__)) && defined(__ELF__)
+#if defined(__FreeBSD__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(linux) || defined (__OS2ELF__)) && defined(__ELF__)
 	__asm__(
 		"movl $0,%%ecx\n"
 		"movb %%al,%%cl\n"

-- 
Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr
FreeBSD keltia.freenix.fr 3.0-CURRENT #62: Mon Jul 27 20:47:08 CEST 1998


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980826000417.A19444>