xorg-server portability + de-perl changes
Joerg Sonnenberger
joerg at britannica.bec.de
Wed Aug 15 10:34:53 PDT 2007
Hi all,
patch-aa and patch-da to patch-de fix compilation problems on DragonFly
and NetBSD.
patch-ag and modeline2.awk replace the Perl script in hw/xfree86/common
with a simpler AWK script. This removes the last major dependency on
Perl in modular Xorg. The script should work fine with any nawk, tested
are one-true-awk and gawk.
Joerg
-------------- next part --------------
#!/usr/bin/awk -f
#
# Copyright (c) 2007 Joerg Sonnenberger <joerg at NetBSD.org>.
# All rights reserved.
#
# Based on Perl script by Dirk Hohndel.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# Usage: modeline2c.awk < modefile > xf86DefModes.c
#
BEGIN {
flagsdict[""] = "0"
flagsdict["+hsync +vsync"] = "V_PHSYNC | V_PVSYNC"
flagsdict["+hsync -vsync"] = "V_PHSYNC | V_NVSYNC"
flagsdict["-hsync +vsync"] = "V_NHSYNC | V_PVSYNC"
flagsdict["-hsync -vsync"] = "V_NHSYNC | V_NVSYNC"
flagsdict["+hsync +vsync interlace"] = "V_PHSYNC | V_PVSYNC | V_INTERLACE"
flagsdict["+hsync -vsync interlace"] = "V_PHSYNC | V_NVSYNC | V_INTERLACE"
flagsdict["-hsync +vsync interlace"] = "V_NHSYNC | V_PVSYNC | V_INTERLACE"
flagsdict["-hsync -vsync interlace"] = "V_NHSYNC | V_NVSYNC | V_INTERLACE"
print "/* $" "XFree86$ */"
print
print "/* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at"
print " * modeline2c.awk */"
print ""
print "/*"
print " * Author: Joerg Sonnenberger <joerg at NetBSD.org>"
print " * Based on Perl script from Dirk Hohndel <hohndel at XFree86.Org>"
print " */"
print ""
print "#ifdef HAVE_XORG_CONFIG_H"
print "#include <xorg-config.h>"
print "#endif"
print ""
print "#ifdef __UNIXOS2__"
print "#define I_NEED_OS2_H"
print "#endif"
print "#include \"xf86.h\""
print "#include \"xf86Config.h\""
print "#include \"xf86Priv.h\""
print "#include \"xf86_OSlib.h\""
print ""
print "#include \"globals.h\""
print ""
print "#define MODEPREFIX(name) NULL, NULL, name, MODE_OK, M_T_DEFAULT"
print "#define MODESUFFIX 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0"
print ""
print "DisplayModeRec xf86DefaultModes [] = {"
modeline = "\t{MODEPREFIX(\"%dx%d\"),%d, %d,%d,%d,%d,0, %d,%d,%d,%d,0, %s, MODESUFFIX},\n"
modeline_data = "^[a-zA-Z]+[ \t]+[^ \t]+[ \t0-9.]+"
}
/^[mM][oO][dD][eE][lL][iI][nN][eE]/ {
flags = $0
gsub(modeline_data, "", flags)
flags = tolower(flags)
printf(modeline, $4, $8, $3 * 1000, $4, $5, $6, $7,
$8, $9, $10, $11, flagsdict[flags])
# Half-width double scanned modes
printf(modeline, $4/2, $8/2, $3 * 500, $4/2, $5/2, $6/2, $7/2,
$8/2, $9/2, $10/2, $11/2, flagsdict[flags] " | V_DBLSCAN")
}
/^#/ {
print "/*" substr($0, 2) " */"
}
END {
printf("\t{MODEPREFIX(NULL),0,0,0,0,0,0,0,0,0,0,0,0,MODESUFFIX}\n};\n")
}
-------------- next part --------------
$NetBSD: patch-aa,v 1.3 2007/03/02 11:51:49 drochner Exp $
--- hw/xfree86/os-support/bsd/bsd_init.c.orig 2007-01-23 00:39:16.000000000 -0500
+++ hw/xfree86/os-support/bsd/bsd_init.c
@@ -160,7 +160,9 @@ xf86OpenConsole()
xf86ConsOpen_t *driver;
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
int result;
+#ifdef __FreeBSD__
struct utsname uts;
+#endif
vtmode_t vtmode;
#endif
@@ -251,6 +253,7 @@ xf86OpenConsole()
#endif
/* otherwise fall through */
case PCVT:
+#if !(defined(__NetBSD__) && (__NetBSD_Version__ >= 200000000))
/*
* First activate the #1 VT. This is a hack to allow a server
* to be started while another one is active. There should be
@@ -265,7 +268,7 @@ xf86OpenConsole()
}
sleep(1);
}
-
+#endif
acquire_vt:
/*
* now get the VT
-------------- next part --------------
$NetBSD: patch-ag,v 1.3 2007/08/14 21:34:37 joerg Exp $
--- hw/xfree86/common/Makefile.am.orig 2007-08-14 20:51:48.000000000 +0200
+++ hw/xfree86/common/Makefile.am
@@ -25,8 +25,8 @@ KBDSOURCES = xf86Kbd at XORG_OS_KBD@.c
MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes
-xf86DefModeSet.c: $(srcdir)/modeline2c.pl $(MODEDEFSOURCES)
- cat $(MODEDEFSOURCES) | $(PERL) $(srcdir)/modeline2c.pl > $@
+xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES)
+ cat $(MODEDEFSOURCES) | $(AWK) -f $(srcdir)/modeline2c.awk > $@
BUILT_SOURCES = xf86DefModeSet.c
-------------- next part --------------
$NetBSD: patch-da,v 1.1 2007/02/05 23:08:36 joerg Exp $
--- Xext/shm.c.orig 2007-02-05 20:58:14.000000000 +0000
+++ Xext/shm.c
@@ -156,7 +156,7 @@ static ShmFuncs fbFuncs = {fbShmCreatePi
}
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__)
#include <sys/signal.h>
static Bool badSysCall = FALSE;
-------------- next part --------------
$NetBSD: patch-db,v 1.1 2007/02/05 23:08:36 joerg Exp $
--- Xext/xf86bigfont.c.orig 2007-02-05 21:02:23.000000000 +0000
+++ Xext/xf86bigfont.c
@@ -104,7 +104,7 @@ static unsigned int pagesize;
static Bool badSysCall = FALSE;
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__)
#include <sys/signal.h>
-------------- next part --------------
$NetBSD: patch-dc,v 1.1 2007/02/05 23:08:36 joerg Exp $
--- hw/xfree86/loader/os.c.orig 2007-02-05 21:03:59.000000000 +0000
+++ hw/xfree86/loader/os.c
@@ -42,6 +42,8 @@
#define OSNAME "linux"
#elif defined(__FreeBSD__)
#define OSNAME "freebsd"
+#elif defined(__DragonFly__)
+#define OSNAME "dragonfly"
#elif defined(__NetBSD__)
#define OSNAME "netbsd"
#elif defined(__OpenBSD__)
-------------- next part --------------
$NetBSD: patch-dd,v 1.1 2007/02/05 23:08:36 joerg Exp $
--- hw/xfree86/os-support/bus/Pci.h.orig 2007-02-05 21:08:10.000000000 +0000
+++ hw/xfree86/os-support/bus/Pci.h
@@ -235,7 +235,7 @@
# if defined(linux)
# define ARCH_PCI_INIT axpPciInit
# define INCLUDE_XF86_MAP_PCI_MEM
-# elif defined(__FreeBSD__) || defined(__OpenBSD__)
+# elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
# define ARCH_PCI_INIT freebsdPciInit
# define INCLUDE_XF86_MAP_PCI_MEM
# define INCLUDE_XF86_NO_DOMAIN
-------------- next part --------------
$NetBSD: patch-de,v 1.1 2007/02/05 23:08:36 joerg Exp $
--- hw/xfree86/os-support/bus/freebsdPci.c.orig 2007-02-05 21:09:30.000000000 +0000
+++ hw/xfree86/os-support/bus/freebsdPci.c
@@ -83,7 +83,7 @@ static pciBusInfo_t freebsdPci0 = {
/* bridge */ NULL
};
-#if !defined(__OpenBSD__) && !defined(__FreeBSD__)
+#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__)
#if X_BYTE_ORDER == X_BIG_ENDIAN
#ifdef __sparc__
#ifndef ASI_PL
More information about the xorg
mailing list