Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Sep 1998 08:04:13 +0200
From:      Ollivier Robert <roberto@keltia.freenix.fr>
To:        current@FreeBSD.ORG
Subject:   Re: ELF Xfree86?
Message-ID:  <19980915080413.A5461@keltia.freenix.fr>
In-Reply-To: <Pine.BSF.4.02.9809142143290.12945-100000@shadow.worldbank.org>; from Alok K. Dhir on Mon, Sep 14, 1998 at 09:43:36PM -0400
References:  <87B69798E951207C8525668000055244.0003ACCA85256680@worldbank.org> <Pine.BSF.4.02.9809142143290.12945-100000@shadow.worldbank.org>

next in thread | previous in thread | raw e-mail | index | archive | help
According to Alok K. Dhir:
> I'd be glad to try it...

The following patch will work. Apply it on the existing XFree86 port.

diff -Nur XFree86/patches/patch-aa XFree86-new/patches/patch-aa
--- XFree86/patches/patch-aa	Thu Jan  1 01:00:00 1970
+++ XFree86-new/patches/patch-aa	Sun Sep 13 20:39:04 1998
@@ -0,0 +1,203 @@
+
+--- config/cf/bsdLib.rules.orig	Mon Aug 31 18:03:14 1998
++++ config/cf/bsdLib.rules	Tue Sep  1 01:15:44 1998
+@@ -153,7 +153,7 @@
+ #define ShLibIncludeFile <bsdLib.tmpl>
+ #endif
+ #ifndef SharedLibraryLoadFlags
+-#define SharedLibraryLoadFlags -shared -Wl,-rpath,$(USRLIBDIR)
++#define SharedLibraryLoadFlags -shared -rpath $(USRLIBDIR)
+ #endif
+ #ifndef PositionIndependentCFlags
+ #define PositionIndependentCFlags -fPIC
+@@ -213,7 +213,7 @@
+ Concat(lib,libname.so.rev):  solist					@@\
+ 	$(RM) $@~							@@\
+ 	SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; \			@@\
+-		(cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
++		(cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) -soname $$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
+ 		$(RM) $$SONAME; $(LN) $@ $$SONAME; \			@@\
+ 		LinkBuildSonameLibrary($$SONAME)			@@\
+ 	$(RM) $@							@@\
+@@ -227,6 +227,21 @@
+ 	$(RM) Concat(lib,libname.so.rev)
+ 
+ #endif /* SharedLibraryTarget */
++
++#ifndef SharedDepModuleTarget
++#define SharedDepModuleTarget(name,deps,solist)				@@\
++AllTarget(name)								@@\
++									@@\
++name: deps								@@\
++	$(RM) $@~							@@\
++	$(CC) -o $@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)		@@\
++	$(RM) $@							@@\
++	$(MV) $@~ $@							@@\
++									@@\
++clean::									@@\
++	$(RM) name
++
++#endif /* SharedDepModuleTarget */
+ 
+ /*
+  * SharedLibraryDataTarget - generate rules to create shlib data file;
+--- programs/Xserver/hw/xfree86/os-support/assyntax.h.orig	Mon Aug 31 18:06:07 1998
++++ programs/Xserver/hw/xfree86/os-support/assyntax.h	Tue Sep  1 00:35:28 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(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__)
+ #define GLNAME(a)       a
+ #else
+ #define GLNAME(a)       CONCAT(_,a)
+--- programs/Xserver/os/connection.c.orig	Mon Aug 31 18:06:22 1998
++++ programs/Xserver/os/connection.c	Tue Sep  1 00:26:07 1998
+@@ -109,6 +109,7 @@
+ 
+ #if defined(TCPCONN) || defined(STREAMSCONN)
+ # include <netinet/in.h>
++# include <arpa/inet.h>
+ # ifndef hpux
+ #  ifdef apollo
+ #   ifndef NO_TCP_H
+--- programs/xauth/gethost.c.orig	Tue Sep  1 00:11:48 1998
++++ programs/xauth/gethost.c	Tue Sep  1 00:26:26 1998
+@@ -58,6 +58,7 @@
+ #endif
+ #include <netdb.h>
+ #include <netinet/in.h>
++#include <arpa/inet.h>
+ #ifdef SYSV
+ #ifdef i386
+ #ifndef sco
+--- programs/xdm/chooser.c.orig	Tue Sep  1 00:14:41 1998
++++ programs/xdm/chooser.c	Tue Sep  1 00:26:47 1998
+@@ -87,6 +87,7 @@
+ #include    <socket.h>
+ #endif
+ #include    <netinet/in.h>
++#include    <arpa/inet.h>
+ #else /* MINIX */
+ #include <net/hton.h>
+ #include <net/netlib.h>
+--- programs/xhost/xhost.c.orig	Tue Sep  1 00:27:05 1998
++++ programs/xhost/xhost.c	Tue Sep  1 00:34:39 1998
+@@ -85,9 +85,9 @@
+ #endif
+ #endif /* NEEDSOCKETS */
+ 
+-#ifdef notdef
++#ifdef __FreeBSD__
+ #include <arpa/inet.h>
+-	bogus definition of inet_makeaddr() in BSD 4.2 and Ultrix
++	/* bogus definition of inet_makeaddr() in BSD 4.2 and Ultrix */
+ #else
+ #if !defined(hpux) && !defined(NCR) && !defined(__EMX__)
+ extern unsigned long inet_makeaddr();
+--- lib/SM/sm_genid.c.orig	Mon Aug 31 18:06:53 1998
++++ lib/SM/sm_genid.c	Tue Sep  1 00:27:29 1998
+@@ -60,6 +60,7 @@
+ #include <socket.h>
+ #endif
+ #include <netinet/in.h>
++#include <arpa/inet.h>
+ #define XOS_USE_NO_LOCKING
+ #define X_INCLUDE_NETDB_H
+ #include <X11/Xos_r.h>
+--- lib/xtrans/Xtransint.h.orig	Sat Jul 19 06:59:16 1997
++++ lib/xtrans/Xtransint.h	Wed Sep  2 07:45:43 1998
+@@ -102,6 +102,8 @@
+ #else
+ #include <socket.h>
+ #endif
++#include <netinet/in.h>
++#include <arpa/inet.h>
+ #endif
+ #ifdef __EMX__
+ #include <sys/ioctl.h>
+--- config/cf/FreeBSD.cf.orig	Wed Sep  2 07:27:49 1998
++++ config/cf/FreeBSD.cf	Wed Sep  2 07:48:43 1998
+@@ -2,7 +2,7 @@
+ XCOMM platform:  $XFree86: xc/config/cf/FreeBSD.cf,v 3.58.2.12 1998/04/29 04:18:26 dawes Exp $
+ 
+ #ifndef OSName
+-#define OSName			DefaultOSName
++#define OSName			DefaultOSName OSBinaryFormat
+ #endif
+ #ifndef OSVendor
+ #define OSVendor		/**/
+@@ -114,11 +114,13 @@
+  * and they can remove it from the list of directories they add to ld.so.cache 
+  * in their /etc/rc file.
+  */
++#ifndef UseElfFormat
+ #if OSMajorVersion > 2 || (OsMajorVersion == 2 && OSMinorVersion >= 2)
+ #ifndef ExtraLoadFlags
+ #define ExtraLoadFlags		-Wl,-R,$(USRLIBDIRPATH)
+ #endif
+ #endif
++#endif
+ 
+ #ifndef GnuMallocLibrary
+ #define GnuMallocLibrary	-lgnumalloc
+@@ -222,10 +224,19 @@
+ #define InstallCmd		/usr/bin/install
+ 
+ #if GccUsesGas
+-# define GccGasOption 		-DGCCUSESGAS
+-# define AsmDefines		-DUSE_GAS
++# define GccGasOption		-DGCCUSESGAS
++# define AsmDefines		-DUSE_GAS AsmElfDefines
+ #else
+ # define GccGasOption /**/
++# define AsmDefines		AsmElfDefines
++#endif
++
++#if UseElfFormat
++# define AsmElfDefines		-D__ELF__
++# define OSBinaryFormat		[ELF]
++#else
++# define AsmElfDefines /**/
++# define OSBinaryFormat /**/
+ #endif
+ 
+ #define ServerExtraDefines GccGasOption XFree86ServerDefines
+--- programs/Xserver/hw/xfree86/vga256/drivers/s3_svga/s3accel.c.orig	Tue Sep  1 16:35:24 1998
++++ programs/Xserver/hw/xfree86/vga256/drivers/s3_svga/s3accel.c	Tue Sep  1 16:35:12 1998
+@@ -798,7 +798,7 @@
+ 
+ #if defined(__GNUC__) && defined(__i386__)
+ static __inline__ CARD32 reverse_bitorder(CARD32 data) {
+-#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(linux) || defined (__OS2ELF__)) && defined(__ELF__)
++#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__)
+ 	__asm__(
+ 		"movl $0,%%ecx\n"
+ 		"movb %%al,%%cl\n"
+--- programs/Xserver/hw/xfree86/xaa/xf86expblt.c.orig	Tue Sep  1 16:46:41 1998
++++ programs/Xserver/hw/xfree86/xaa/xf86expblt.c	Tue Sep  1 16:44:23 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(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__)
+ 	__asm__(
+ 		"movl $0,%%ecx\n"
+ 		"movb %%al,%%cl\n"
+
+
+cu Jo
+
+---------------------------------------------------------------------
+FreeBSD: The Power to Serve                  <http://www.freebsd.org>;
+Joachim Kuebart
+Tel: +49 711 653706            Oh god, god... My tongue is asleep and
+Germany                        my teeth itch.
+
+To Unsubscribe: send mail to majordomo@FreeBSD.org
+with "unsubscribe freebsd-current" in the body of the message
+
+
+
diff -Nur XFree86/scripts/configure XFree86-new/scripts/configure
--- XFree86/scripts/configure	Tue Jul 28 00:30:57 1998
+++ XFree86-new/scripts/configure	Sun Sep 13 20:38:38 1998
@@ -267,6 +267,11 @@
   echo "#define	HasKrb4		$answ"	>> $F
 fi
 
+# ELF detection
+test `sysctl -n kern.osreldate` -ge 300004 &&
+	test `objformat` = elf &&
+	echo "#define UseElfFormat		YES" >> $F
+
 echo
 echo "End of configuration questions. No more user input required"
 echo

-- 
Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr
FreeBSD keltia.freenix.fr 3.0-CURRENT #64: Fri Sep 11 23:22:44 CEST 1998


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



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