Date:2011-01-06 14:41:46 (13 years 2 months ago)
Author:David Kühling
Commit:ac7a991ae2d256cbc18e7ec7c5744d0322818c65
Message:Port of SVGAlib; patched to only use the linux frame buffer

Try the svgalib-demo programs: vgatest, speedtest etc. seem to work.
Files: svgalib/Makefile (1 diff)
svgalib/patches/010-configure.patch (1 diff)
svgalib/patches/020-ioh-missing.patch (1 diff)
svgalib/patches/030-no-vga.patch (1 diff)
svgalib/patches/040-sigunused.patch (1 diff)
svgalib/patches/050-ml_getint.patch (1 diff)
svgalib/patches/060-no-asm.patch (1 diff)
svgalib/patches/070-no-background-fix.patch (1 diff)
svgalib/patches/080-make-install.patch (1 diff)
svgalib/patches/090-soname.patch (1 diff)
svgalib/patches/100-fbdev-setpage.patch (1 diff)

Change Details

svgalib/Makefile
1#
2# Copyright (C) 2011 David Kuehling <dvdkhlng TA gmx TOD de>
3#
4# License GPLv2 or later. NO WARRANTY.
5#
6# OpenWRT package for the SVGAlib
7
8# On the nanonote you might need export SVGALIB_DEFAULT_MODE=54
9# for applications to work correctly.
10
11include $(TOPDIR)/rules.mk
12
13PKG_NAME:=svgalib
14PKG_VERSION:=1.4.3
15PKG_RELEASE:=1
16PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17PKG_SOURCE_URL:=http://www.svgalib.org/
18PKG_MD5SUM:=7d2778e3beebc07dd7c74668f6887c6f
19PKG_INSTALL:=1
20#PKG_FIXUP:=libtool
21
22#PKG_BUILD_DEPENDS:= libtool/host
23
24include $(INCLUDE_DIR)/package.mk
25
26
27define Package/svgalib/Default
28  SECTION:=libs
29  CATEGORY:=Libraries
30  TITLE:=Linux SVGA Library
31  URL:=http://www.svgalib.org/
32endef
33
34define Package/svgalib/Default/description
35SVGAlib is a low-level graphics library for Linux.
36This package compiles a portable version that only contains the Linux
37framebuffer driver.
38endef
39
40define Package/svgalib
41$(call Package/svgalib/Default)
42  TITLE +=
43  DEPENDS:=
44endef
45
46define Package/svgalib/description
47$(call Package/svgalib/Default/description)
48endef
49
50
51define Package/svgalib-demo
52$(call Package/svgalib/Default)
53  TITLE += (demo programs)
54  DEPENDS:=svgalib
55endef
56
57define Package/svgalib-demo/description
58$(call Package/svgalib/Default/description)
59This package contains the demo programs.
60endef
61
62TARGET_CFLAGS +=
63
64#TARGET_LDFLAGS += -Wl,-rpath -Wl,$(STAGING_DIR)/usr/lib
65
66# Nothing todo. Makefile.cfg adapted via patch
67define Build/Configure
68endef
69
70#MAKE_FLAGS += -j2
71
72SVGALIB_BUILD_TARGETS = \
73    shared \
74    static
75
76SVGALIB_INSTALL_TARGETS = \
77    installstaticlib \
78    installsharedlib \
79    installheaders \
80    installconfig
81
82ifdef CONFIG_PACKAGE_svgalib-demo
83SVGALIB_BUILD_TARGETS += demoprogs
84define SVGALIB_COMPILE_DEMO
85    $(INSTALL_DIR) $(PKG_BUILD_DIR)/tmp-install/usr/lib
86    $(call Build/Compile/Default,installsharedlib DESTDIR=$(PKG_BUILD_DIR)/tmp-install)
87    $(call Build/Compile/Default,demoprogs LDFLAGS+="-L$(PKG_BUILD_DIR)/tmp-install/usr/lib")
88endef
89else
90SVGALIB_COMPILE_DEMO:=
91endif
92
93define Build/Compile
94    $(call Build/Compile/Default,shared static)
95    $(call SVGALIB_COMPILE_DEMO)
96endef
97
98define Build/Install
99    $(INSTALL_DIR) $(PKG_INSTALL_DIR)/etc/
100    $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/lib
101    $(call Build/Install/Default,\
102        installstaticlib installsharedlib installheaders installconfig)
103endef
104
105define Build/InstallDev
106    $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
107    $(CP) \
108        $(PKG_INSTALL_DIR)/usr/include/* \
109        $(1)/usr/include/
110    $(CP) \
111        $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} \
112        $(1)/usr/lib/
113endef
114
115
116define Package/svgalib/install
117    $(INSTALL_DIR) $(1)/usr/lib
118    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/*.so* \
119        $(1)/usr/lib/
120    $(INSTALL_DIR) $(1)/etc/vga
121    $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/vga/* \
122        $(1)/etc/vga/
123endef
124
125define Package/svgalib-demo/install
126    $(INSTALL_DIR) $(1)/usr/bin
127    $(INSTALL_BIN) $$$$(find $(PKG_BUILD_DIR)/demos -executable -type f) \
128        $(1)/usr/bin/
129    $(INSTALL_BIN) $(PKG_BUILD_DIR)/threeDKit/{plane,wrapdemo} \
130        $(1)/usr/bin/
131endef
132
133$(eval $(call BuildPackage,svgalib))
134$(eval $(call BuildPackage,svgalib-demo))
135
136
137# The following comments configure the Emacs editor. Just ignore them.
138# Local Variables:
139# compile-command: "make -C ~/h/src/qi/openwrt-xburst package/svgalib/compile -j2 V=99"
140# End:
svgalib/patches/010-configure.patch
1Index: svgalib-1.4.3/Makefile.cfg
2===================================================================
3--- svgalib-1.4.3.orig/Makefile.cfg 2011-01-06 13:52:51.000000000 +0100
4@@ -24,8 +24,8 @@
5
6 # Common prefix for installation directories.
7 # NOTE: This directory must exist when you start the install.
8-TOPDIR=
9-prefix = $(TOPDIR)/usr/local
10+TOPDIR=$(DESTDIR)
11+prefix = $(TOPDIR)/usr
12 exec_prefix = $(prefix)
13
14 # Directory where the shared stubs and static library will be installed.
15@@ -52,7 +52,7 @@
16
17 #uncomment this if your compiler fails on compiling the assembler in
18 #src/vgaconvplanar.c, gl/inlstring.h, gl/line.c or gl/scale.c
19-# NO_ASM = y
20+NO_ASM = y
21
22 # Uncomment this if you want root processes to be able to always get a new
23 # VC. Alas, some games misuse suid root privs and become root, svgalib cannot
24@@ -123,98 +123,98 @@
25 #
26 # Comment out any driver that you don't want included in the library.
27 #
28-INCLUDE_ET4000_DRIVER = y
29-INCLUDE_CIRRUS_DRIVER = y
30-INCLUDE_TVGA_DRIVER = y
31+# INCLUDE_ET4000_DRIVER = y
32+# INCLUDE_CIRRUS_DRIVER = y
33+# INCLUDE_TVGA_DRIVER = y
34 #INCLUDE_OAK_DRIVER = y
35 #INCLUDE_EGA_DRIVER = y
36-INCLUDE_MACH32_DRIVER = y
37-INCLUDE_S3_DRIVER = y
38+# INCLUDE_MACH32_DRIVER = y
39+# INCLUDE_S3_DRIVER = y
40 #INCLUDE_ET3000_DRIVER = y
41 #INCLUDE_GVGA6400_DRIVER = y
42 #INCLUDE_ARK_DRIVER = y
43 #INCLUDE_ATI_DRIVER = y
44 #INCLUDE_ALI_DRIVER = y
45-INCLUDE_CHIPS_DRIVER = y
46-INCLUDE_APM_DRIVER = y
47-INCLUDE_NV3_DRIVER = y
48-INCLUDE_ET6000_DRIVER = y
49-INCLUDE_VESA_DRIVER = y
50-INCLUDE_MX_DRIVER = y
51-INCLUDE_PARADISE_DRIVER = y
52-INCLUDE_RAGE_DRIVER = y
53-INCLUDE_BANSHEE_DRIVER = y
54-INCLUDE_SIS_DRIVER = y
55-INCLUDE_I740_DRIVER = y
56-INCLUDE_LAGUNA_DRIVER = y
57-INCLUDE_NEO_DRIVER = y
58-INCLUDE_R128_DRIVER = y
59-INCLUDE_G400_DRIVER = y
60+# INCLUDE_CHIPS_DRIVER = y
61+# INCLUDE_APM_DRIVER = y
62+# INCLUDE_NV3_DRIVER = y
63+# INCLUDE_ET6000_DRIVER = y
64+# INCLUDE_VESA_DRIVER = y
65+# INCLUDE_MX_DRIVER = y
66+# INCLUDE_PARADISE_DRIVER = y
67+# INCLUDE_RAGE_DRIVER = y
68+# INCLUDE_BANSHEE_DRIVER = y
69+# INCLUDE_SIS_DRIVER = y
70+# INCLUDE_I740_DRIVER = y
71+# INCLUDE_LAGUNA_DRIVER = y
72+# INCLUDE_NEO_DRIVER = y
73+# INCLUDE_R128_DRIVER = y
74+# INCLUDE_G400_DRIVER = y
75 INCLUDE_FBDEV_DRIVER = y
76-INCLUDE_SAVAGE_DRIVER = y
77+# INCLUDE_SAVAGE_DRIVER = y
78 #
79 # Comment out any adapter you don't want to autodetect.
80 #
81-INCLUDE_ET4000_DRIVER_TEST = y
82-INCLUDE_CIRRUS_DRIVER_TEST = y
83-INCLUDE_TVGA_DRIVER_TEST = y
84+# INCLUDE_ET4000_DRIVER_TEST = y
85+# INCLUDE_CIRRUS_DRIVER_TEST = y
86+# INCLUDE_TVGA_DRIVER_TEST = y
87 #INCLUDE_OAK_DRIVER_TEST = y
88 #INCLUDE_EGA_DRIVER_TEST = y
89-INCLUDE_MACH32_DRIVER_TEST = y
90+# INCLUDE_MACH32_DRIVER_TEST = y
91 #INCLUDE_GVGA6400_DRIVER_TEST = y
92-INCLUDE_S3_DRIVER_TEST = y
93+# INCLUDE_S3_DRIVER_TEST = y
94 #INCLUDE_ET3000_DRIVER_TEST = y
95 #INCLUDE_ARK_DRIVER_TEST = y
96 #INCLUDE_ATI_DRIVER_TEST = y
97 #INCLUDE_ALI_DRIVER_TEST = y
98-INCLUDE_CHIPS_DRIVER_TEST = y
99-INCLUDE_APM_DRIVER_TEST = y
100-INCLUDE_NV3_DRIVER_TEST = y
101-INCLUDE_ET6000_DRIVER_TEST = y
102-INCLUDE_MX_DRIVER_TEST = y
103-INCLUDE_PARADISE_DRIVER_TEST = y
104-INCLUDE_RAGE_DRIVER_TEST = y
105-INCLUDE_BANSHEE_DRIVER_TEST = y
106-INCLUDE_SIS_DRIVER_TEST = y
107-INCLUDE_I740_DRIVER_TEST = y
108-INCLUDE_LAGUNA_DRIVER_TEST = y
109-INCLUDE_NEO_DRIVER_TEST = y
110-INCLUDE_G400_DRIVER_TEST = y
111-INCLUDE_R128_DRIVER_TEST = y
112-#INCLUDE_FBDEV_DRIVER_TEST = y
113-INCLUDE_SAVAGE_DRIVER_TEST = y
114+# INCLUDE_CHIPS_DRIVER_TEST = y
115+# INCLUDE_APM_DRIVER_TEST = y
116+# INCLUDE_NV3_DRIVER_TEST = y
117+# INCLUDE_ET6000_DRIVER_TEST = y
118+# INCLUDE_MX_DRIVER_TEST = y
119+# INCLUDE_PARADISE_DRIVER_TEST = y
120+# INCLUDE_RAGE_DRIVER_TEST = y
121+# INCLUDE_BANSHEE_DRIVER_TEST = y
122+# INCLUDE_SIS_DRIVER_TEST = y
123+# INCLUDE_I740_DRIVER_TEST = y
124+# INCLUDE_LAGUNA_DRIVER_TEST = y
125+# INCLUDE_NEO_DRIVER_TEST = y
126+# INCLUDE_G400_DRIVER_TEST = y
127+# INCLUDE_R128_DRIVER_TEST = y
128+INCLUDE_FBDEV_DRIVER_TEST = y
129+# INCLUDE_SAVAGE_DRIVER_TEST = y
130
131 #Might be too dangerous:
132-INCLUDE_VESA_DRIVER_TEST = y
133+# INCLUDE_VESA_DRIVER_TEST = y
134
135 #
136 # Comment out any dac support that you don't want included in the library.
137 #
138 # you must include SIERRA_DAC, if you include any of SCxxxx DACs.
139
140-INCLUDE_NORMAL_DAC = y
141-INCLUDE_S3_SDAC_DAC = y
142-INCLUDE_S3_GENDAC_DAC = y
143-INCLUDE_S3_TRIO64_DAC = y
144-INCLUDE_SIERRA_DAC = y
145-INCLUDE_SC15025_DAC = y
146-INCLUDE_ATT20C490_DAC = y
147-INCLUDE_ATT20C498_DAC = y
148-INCLUDE_ICW_DAC = y
149-INCLUDE_IBMRGB52x_DAC = y
150-INCLUDE_SC1148X_DAC = y
151+# INCLUDE_NORMAL_DAC = y
152+# INCLUDE_S3_SDAC_DAC = y
153+# INCLUDE_S3_GENDAC_DAC = y
154+# INCLUDE_S3_TRIO64_DAC = y
155+# INCLUDE_SIERRA_DAC = y
156+# INCLUDE_SC15025_DAC = y
157+# INCLUDE_ATT20C490_DAC = y
158+# INCLUDE_ATT20C498_DAC = y
159+# INCLUDE_ICW_DAC = y
160+# INCLUDE_IBMRGB52x_DAC = y
161+# INCLUDE_SC1148X_DAC = y
162
163 #
164 # Comment out any dac you don't want to autodetect.
165 # (not all dacs can be autodetected, at this time)
166 #
167-INCLUDE_S3_SDAC_DAC_TEST = y
168-INCLUDE_S3_GENDAC_DAC_TEST = y
169-INCLUDE_SC15025_DAC_TEST = y
170-INCLUDE_ATT20C490_DAC_TEST = y
171-INCLUDE_IBMRGB52x_DAC_TEST = y
172-INCLUDE_SC1148X_DAC_TEST = y
173-
174+# INCLUDE_S3_SDAC_DAC_TEST = y
175+# INCLUDE_S3_GENDAC_DAC_TEST = y
176+# INCLUDE_SC15025_DAC_TEST = y
177+# INCLUDE_ATT20C490_DAC_TEST = y
178+# INCLUDE_IBMRGB52x_DAC_TEST = y
179+# INCLUDE_SC1148X_DAC_TEST = y
180+#
181 # Location of the svgalib configuration file.
182 SVGALIB_CONFIG_FILE = $(datadir)/libvga.config
183
184@@ -226,7 +226,7 @@
185 # If you just want to use the et4000.regs in the source directory,
186 # comment out the definition of DYNAMIC. DYNAMIC allows development of new
187 # resolutions without recompiling.
188-DYNAMIC = y
189+# DYNAMIC = y
190 ET4000_REGS = $(datadir)/libvga.et4000
191
192 # The EGA driver may load additional modes (SuperEGA cards) like the
193@@ -270,9 +270,9 @@
194 CFLAGS = $(WARN) $(DLLFLAGS) $(INCLUDES) $(OPTIMIZE) $(DEFINES)
195 # ELF doesn't like -N. It is beneficial for small tools with a.out
196 ifeq (a.out, $(TARGET_FORMAT))
197- LDFLAGS = -N -s
198+# LDFLAGS = -N -s
199 else
200- LDFLAGS = -s
201+# LDFLAGS = -s
202 endif
203
204 # Uncomment the following if you are compiling a.out shared libraries
205@@ -289,6 +289,6 @@
206
207 # Utilites used.
208 AR = ar
209-INSTALL_PROGRAM = install -c -s -m 755 -o root -g bin
210-INSTALL_SHLIB = install -c -m 755 -o root -g bin
211-INSTALL_DATA = install -c -m 644 -o root -g bin
212+INSTALL_PROGRAM = install -c -s -m 755
213+INSTALL_SHLIB = install -c -m 755
214+INSTALL_DATA = install -c -m 644
svgalib/patches/020-ioh-missing.patch
1Index: svgalib-1.4.3/src/libvga.h
2===================================================================
3--- svgalib-1.4.3.orig/src/libvga.h 2011-01-06 12:04:51.000000000 +0100
4@@ -9,7 +9,7 @@
5
6 #include <string.h>
7 # if defined __GLIBC__ && __GLIBC__ >= 2
8-#include <sys/io.h>
9+/* #include <sys/io.h> */
10 #endif
11
12 /* --------------------- Macro definitions shared by library modules */
svgalib/patches/030-no-vga.patch
1Index: svgalib-1.4.3/src/vga.c
2===================================================================
3--- svgalib-1.4.3.orig/src/vga.c 2011-01-06 12:44:21.000000000 +0100
4@@ -519,7 +519,8 @@
5
6 /* Chipset specific functions */
7
8-DriverSpecs *__svgalib_driverspecs = &__svgalib_vga_driverspecs;
9+#define __svgalib_vga_driverspecs __svgalib_fbdev_driverspecs
10+DriverSpecs *__svgalib_driverspecs = &__svgalib_fbdev_driverspecs;
11
12 #ifndef BACKGROUND
13 static void (*__svgalib_setpage) (int); /* gives little faster vga_setpage() */
14@@ -537,7 +538,9 @@
15 DriverSpecs *__svgalib_driverspecslist[] =
16 {
17     NULL, /* chipset undefined */
18+#if 0 /* vga disabled */
19     &__svgalib_vga_driverspecs,
20+#endif
21 #ifdef INCLUDE_ET4000_DRIVER
22     &__svgalib_et4000_driverspecs,
23 #else
24@@ -1504,12 +1507,12 @@
25     else
26 #endif
27
28- if (__svgalib_vga_driverspecs.test())
29- CHIPSET = VGA;
30+ if (__svgalib_fbdev_driverspecs.test())
31+ CHIPSET = FBDEV;
32     else
33         /* else */
34     {
35- fprintf(stderr, "svgalib: Cannot find EGA or VGA graphics device.\n");
36+ fprintf(stderr, "svgalib: Cannot find fbdev graphics device.\n");
37         exit(1);
38     }
39     __svgalib_setpage = __svgalib_driverspecs->__svgalib_setpage;
40@@ -4441,7 +4444,8 @@
41 };
42
43
44-#ifdef __alpha__
45+#if 0
46+/* #ifdef __alpha__ */
47
48 #define vuip volatile unsigned int *
49
50Index: svgalib-1.4.3/src/vgadrv.c
51===================================================================
52--- svgalib-1.4.3.orig/src/vgadrv.c 2011-01-06 12:44:21.000000000 +0100
53@@ -13,6 +13,8 @@
54 #include "libvga.h"
55 #include "driver.h"
56
57+#if 0 /* vga disabled */
58+
59 /* BIOS mode 0Dh - 320x200x16 */
60 static const unsigned char g320x200x16_regs[60] =
61 {
62@@ -311,3 +313,5 @@
63
64     return 0;
65 }
66+
67+#endif /* vga disabled */
68Index: svgalib-1.4.3/src/libvga.h
69===================================================================
70--- svgalib-1.4.3.orig/src/libvga.h 2011-01-06 13:13:47.000000000 +0100
71@@ -216,7 +216,18 @@
72 extern void __svgalib_acquirevt_signal(int n);
73 #endif
74
75-#ifdef __alpha__
76+
77+/* do not compile vga direct hw access code. It is not called anyways when
78+ * using fbdev driver. It won't compile on some non-x86 hw. */
79+#define ioperm(a,b,c) (-1)
80+#define port_in(a) (0)
81+#define port_out(a,b) (void)0
82+#define port_outw(a,b) (void)0
83+#define inb(a) (0)
84+#define outb(a,b) (void)0
85+
86+#if 0
87+/* #ifdef __alpha__ */
88
89 #include <asm/io.h>
90
91@@ -270,50 +281,60 @@
92
93 #else
94
95-static __inline__ void port_out(int value, int port)
96-{
97- __asm__ volatile ("outb %0,%1"
98- ::"a" ((unsigned char) value), "d"((unsigned short) port));
99-}
100-
101-static __inline__ void port_outw(int value, int port)
102-{
103- __asm__ volatile ("outw %0,%1"
104- ::"a" ((unsigned short) value), "d"((unsigned short) port));
105-}
106-
107-static __inline__ void port_outl(int value, int port)
108-{
109- __asm__ volatile ("outl %0,%1"
110- ::"a" ((unsigned long)value), "d" ((unsigned short) port));
111-}
112-
113-static __inline__ int port_in(int port)
114-{
115- unsigned char value;
116- __asm__ volatile ("inb %1,%0"
117- :"=a" (value)
118- :"d"((unsigned short) port));
119- return value;
120-}
121-
122-static __inline__ int port_inw(int port)
123-{
124- unsigned short value;
125- __asm__ volatile ("inw %1,%0"
126- :"=a" (value)
127- :"d"((unsigned short) port));
128- return value;
129-}
130-
131-static __inline__ int port_inl(int port)
132-{
133- unsigned int value;
134- __asm__ volatile("inl %1,%0" :
135- "=a" (value) :
136- "d" ((unsigned short)port));
137- return value;
138-}
139+/* do not compile vga direct hw access code. It is not called anyways when
140+ * using fbdev driver. It won't compile on some non-x86 hw. */
141+#define ioperm(a,b,c) (-1)
142+#define port_in(a) (0)
143+#define port_inw(a) (0)
144+#define port_inl(a) (0)
145+#define port_out(a,b) (void)0
146+#define port_outl(a,b) (void)0
147+#define port_outw(a,b) (void)0
148+
149+/* static __inline__ void port_out(int value, int port) */
150+/* { */
151+/* __asm__ volatile ("outb %0,%1" */
152+/* ::"a" ((unsigned char) value), "d"((unsigned short) port)); */
153+/* } */
154+
155+/* static __inline__ void port_outw(int value, int port) */
156+/* { */
157+/* __asm__ volatile ("outw %0,%1" */
158+/* ::"a" ((unsigned short) value), "d"((unsigned short) port)); */
159+/* } */
160+
161+/* static __inline__ void port_outl(int value, int port) */
162+/* { */
163+/* __asm__ volatile ("outl %0,%1" */
164+/* ::"a" ((unsigned long)value), "d" ((unsigned short) port)); */
165+/* } */
166+
167+/* static __inline__ int port_in(int port) */
168+/* { */
169+/* unsigned char value; */
170+/* __asm__ volatile ("inb %1,%0" */
171+/* :"=a" (value) */
172+/* :"d"((unsigned short) port)); */
173+/* return value; */
174+/* } */
175+
176+/* static __inline__ int port_inw(int port) */
177+/* { */
178+/* unsigned short value; */
179+/* __asm__ volatile ("inw %1,%0" */
180+/* :"=a" (value) */
181+/* :"d"((unsigned short) port)); */
182+/* return value; */
183+/* } */
184+
185+/* static __inline__ int port_inl(int port) */
186+/* { */
187+/* unsigned int value; */
188+/* __asm__ volatile("inl %1,%0" : */
189+/* "=a" (value) : */
190+/* "d" ((unsigned short)port)); */
191+/* return value; */
192+/* } */
193
194 #define gr_readb(off) (((volatile unsigned char *)GM)[(off)])
195 #define gr_readw(off) (*(volatile unsigned short*)((GM)+(off)))
196@@ -322,7 +343,6 @@
197 #define gr_writew(v,off) (*(unsigned short*)((GM)+(off)) = (v))
198 #define gr_writel(v,off) (*(unsigned long*)((GM)+(off)) = (v))
199
200-
201 #endif
202
203 /* Note that the arguments of outb/w are reversed compared with the */
svgalib/patches/040-sigunused.patch
1Index: svgalib-1.4.3/src/vga.c
2===================================================================
3--- svgalib-1.4.3.orig/src/vga.c 2011-01-06 12:05:43.000000000 +0100
4@@ -38,6 +38,10 @@
5 #include "vgaregs.h"
6 #include "vgaversion.h"
7
8+#ifndef SIGUNUSED
9+#define SIGUNUSED 32
10+#endif
11+
12 #ifdef BACKGROUND
13 #include "vgabg.h"
14
svgalib/patches/050-ml_getint.patch
1Index: svgalib-1.4.3/src/vga.c
2===================================================================
3--- svgalib-1.4.3.orig/src/vga.c 2011-01-06 12:16:21.000000000 +0100
4@@ -3920,7 +3920,7 @@
5
6 #define ML_GETINT(x) \
7     ptr = strtok(NULL, " "); if(!ptr) break; \
8- mmt.##x = atoi(ptr);
9+ mmt.x = atoi(ptr);
10
11         ML_GETINT(HDisplay);
12         ML_GETINT(HSyncStart);
svgalib/patches/060-no-asm.patch
1Index: svgalib-1.4.3/src/vgapix.c
2===================================================================
3--- svgalib-1.4.3.orig/src/vgapix.c 2011-01-06 12:33:23.000000000 +0100
4@@ -26,7 +26,7 @@
5 /* However bswap is not supported by 386 */
6
7     if (MODEFLAGS & RGB_MISORDERED)
8-#ifdef __alpha__
9+#if 1
10     c = ((c >> 0) & 0xff) << 16 |
11         ((c >> 8) & 0xff) << 8 |
12         ((c >> 16) & 0xff) << 0;
13Index: svgalib-1.4.3/gl/driver.c
14===================================================================
15--- svgalib-1.4.3.orig/gl/driver.c 2011-01-06 12:36:13.000000000 +0100
16@@ -33,7 +33,8 @@
17 /* However bswap is not supported by 386 */
18
19     if (MODEFLAGS & MODEFLAG_24BPP_REVERSED)
20-#ifdef __alpha__
21+#if 1
22+/* #ifdef __alpha__ */
23     c = ((c >> 0) & 0xff) << 16 |
24         ((c >> 8) & 0xff) << 8 |
25         ((c >> 16) & 0xff) << 0;
26Index: svgalib-1.4.3/gl/scale.c
27===================================================================
28--- svgalib-1.4.3.orig/gl/scale.c 2011-01-06 12:37:26.000000000 +0100
29@@ -13,7 +13,8 @@
30 /* #define USE_ASM */
31
32
33-#ifdef __alpha__
34+#if 1
35+/* #ifdef __alpha__ */
36
37 static inline int muldiv64(int m1, int m2, int d)
38 {
svgalib/patches/070-no-background-fix.patch
1Index: svgalib-1.4.3/src/vgamisc.c
2===================================================================
3--- svgalib-1.4.3.orig/src/vgamisc.c 2011-01-06 12:21:30.000000000 +0100
4@@ -47,7 +47,7 @@
5 }
6
7 #ifndef BACKGROUND
8-static void *__svgalib_linearframebuffer;
9+void *__svgalib_linearframebuffer;
10 #endif
11 #ifdef BACKGROUND
12 void *__svgalib_linearframebuffer;
svgalib/patches/080-make-install.patch
1Index: svgalib-1.4.3/Makefile
2===================================================================
3--- svgalib-1.4.3.orig/Makefile 2011-01-06 13:52:48.000000000 +0100
4@@ -110,10 +110,6 @@
5
6 installheaders:
7     @echo Installing header files in $(includedir).
8- @if [ -f /usr/include/vga.h ]; then \
9- rm -f /usr/include/vga.h /usr/include/vgagl.h; \
10- echo Old header files in /usr/include removed.; \
11- fi
12     mkdir -p $(includedir)
13     @cp $(srcdir)/src/vga.h $(includedir)/vga.h
14     @chmod a+r $(includedir)/vga.h
15@@ -134,17 +130,6 @@
16         chmod a+r $(libdir)/$$foo; \
17     done
18 endif
19- @if [ -f /usr/lib/libvga.sa ]; then \
20- rm -f /usr/lib/libvga.sa /usr/lib/libvgagl.sa; \
21- echo Old stubs in /usr/lib removed.; \
22- fi
23- @rm -f $(OBSOLETESHAREDIMAGES)
24-ifndef KEEPSHAREDLIBS
25- @echo "Removing shared library images (old & current)..."
26- @for i in $(OBSOLETELDIRS); do \
27- rm -f `echo $(OBSOLETESHAREDIMAGES) | sed s?/lib/?$$i?g`; \
28- done
29-endif
30     mkdir -p $(sharedlibdir)
31     @echo Installing shared library image as \
32         $(addprefix $(sharedlibdir)/,$(notdir $(SHAREDLIBS))).
33@@ -153,7 +138,6 @@
34         (cd $(sharedlibdir); \
35          ln -sf $$foo `echo $$foo | sed 's/\.so\..*/.so/'` ); \
36     done
37- @ldconfig
38
39 ifdef INSTALLAOUTDIR
40
41@@ -169,7 +153,6 @@
42         (cd $(TOPDIR)/$(INSTALLAOUTDIR); \
43          ln -sf $$foo `echo $$foo | sed 's/\.so\..*/.so/'` ); \
44     done
45- @ldconfig
46
47 else
48
49@@ -180,10 +163,8 @@
50
51 installstaticlib: static
52     @echo Installing static libraries in $(libdir).
53- @rm -f /usr/lib/libvga.a
54     @$(INSTALL_DATA) staticlib/libvga.a $(libdir)/libvga.a
55     @chmod a+r $(libdir)/libvga.a
56- @rm -f /usr/lib/libvgagl.a
57     @$(INSTALL_DATA) staticlib/libvgagl.a $(libdir)/libvgagl.a
58     @chmod a+r $(libdir)/libvgagl.a
59
60@@ -192,14 +173,6 @@
61         echo No $(bindir) directory, creating it.; \
62         mkdir $(bindir); \
63     fi
64- @if [ -f /usr/bin/restorefont ]; then \
65- echo Removing old utilities in /usr/bin.; \
66- for x in $(UTILS); do rm -f /usr/bin/$$x; done; \
67- fi
68- @if [ -f /usr/bin/convfont ]; then \
69- echo Removing inappropriate utilities in /usr/bin.; \
70- rm -f /usr/bin/convfont /usr/bin/setmclk; \
71- fi
72     @echo Installing textmode utilities in $(bindir):
73     @echo "restorefont: Save/restore textmode font."
74     @cp utils/restorefont $(bindir)
75@@ -225,22 +198,6 @@
76         mkdir $(datadir); \
77         chmod go-w $(datadir); \
78     fi
79- @if [ \( -f /usr/local/lib/libvga.config -a ! -f $(datadir)/libvga.config \) ]; then \
80- echo "Moving old config file /usr/local/lib/libvga.config to $(datadir)." ; \
81- mv -f /usr/local/lib/libvga.config $(datadir)/libvga.config; \
82- fi
83- @if [ \( -f /usr/local/lib/libvga.et4000 -a ! -f $(datadir)/libvga.et4000 \) ]; then \
84- echo "Moving old config file /usr/local/lib/libvga.et4000 to $(datadir)." ; \
85- mv -f /usr/local/lib/libvga.et4000 $(datadir)/libvga.et4000; \
86- fi
87- @if [ \( -f /usr/local/lib/libvga.ega -a ! -f $(datadir)/libvga.ega \) ]; then \
88- echo "Moving old config file /usr/local/lib/libvga.ega to $(datadir)." ; \
89- mv -f /usr/local/lib/libvga.ega $(datadir)/libvga.ega; \
90- fi
91- @if [ \( -f /etc/mach32.eeprom -a ! -f $(datadir)/mach32.eeprom \) ]; then \
92- echo Consider moving your /etc/mach32.eeprom file to $(datadir) ; \
93- echo and changing $(datadir)/libvga.config appropriately. ; \
94- fi
95     @if [ ! -f $(datadir)/libvga.config ]; then \
96         echo Installing default configuration file in $(datadir).; \
97         cp $(confdir)/libvga.config $(datadir)/libvga.config; \
98@@ -269,48 +226,6 @@
99     @echo demos/ and threedkit/.
100
101 uninstall:
102- @echo "Removing textmode utilities..."
103- @for i in $(OBSOLETEBDIRS); do \
104- for prog in $(UTILS); do \
105- rm -f $$i$$prog ; \
106- done ; \
107- done
108- @echo "Removing shared library stubs (old & current)..."
109- @for i in $(OBSOLETELDIRS); do \
110- rm -f `echo /lib/libvga.so.$(VERSION) /lib/libvgagl.so.$(VERSION) \
111- $(OBSOLETELIBLINKS) /lib/libvga.sa /lib/libvgagl.sa \
112- | sed s?/lib/?$$i?g`; \
113- done
114-ifndef KEEPSHAREDLIBS
115- @echo "Removing shared library images (old & current)..."
116- @for i in $(OBSOLETELDIRS); do \
117- rm -f `echo $(OBSOLETESHAREDIMAGES) | sed s?/lib/?$$i?g`; \
118- done
119-endif
120-ifneq ($(INSTALLAOUTDIR), )
121- @echo "Removing shared a.out library stubs (old & current)..."
122- @for i in $(OBSOLETEAOUTDIRS); do \
123- rm -f `echo /lib/libvga.so.$(VERSION) /lib/libvgagl.so.$(VERSION) \
124- $(OBSOLETELIBLINKS) /lib/libvga.sa /lib/libvgagl.sa \
125- | sed s?/lib/?$$i?g`; \
126- done
127-ifndef KEEPSHAREDLIBS
128- @echo "Removing shared a.out library images (old & current)..."
129- @for i in $(OBSOLETEAOUTDIRS); do \
130- rm -f `echo $(OBSOLETESHAREDIMAGES) | sed s?/lib/?$$i?g`; \
131- done
132-endif
133-endif
134- @echo "Removing static libraries..."
135- @for i in $(OBSOLETELDIRS); do \
136- rm -f `echo /lib/libvga.a /lib/libvgagl.a | sed s?/lib/?$$i?g`; \
137- done
138- @echo "Removing header files..."
139- @for i in $(OBSOLETEHDIRS); do \
140- rm -f `echo $(OBSOLETEHEADERS) | sed s?/inc/?$$i?g`; \
141- done
142- (cd doc; $(MAKE) -f $(srcdir)/doc/Makefile srcdir="$(srcdir)" uninstall)
143-
144
145 SHAREDDIRS0 = sharedlib/mouse sharedlib/keyboard sharedlib/ramdac \
146         sharedlib/clockchip sharedlib/joystick
147Index: svgalib-1.4.3/threeDKit/Makefile
148===================================================================
149--- svgalib-1.4.3.orig/threeDKit/Makefile 2011-01-06 13:52:48.000000000 +0100
150@@ -39,13 +39,9 @@
151
152 plane: planukit.o planinit.o $(OBJECTS) $(LVGADEP)
153     $(CC) $(LDFLAGS) -o plane planukit.o planinit.o $(OBJECTS) $(LIBS)
154- chown root plane
155- chmod u+s plane
156
157 wrapdemo: wrapdemo.o $(OBJECTS) $(LVGADEP)
158     $(CC) $(CFLAGS) $(LDFLAGS) -o wrapdemo wrapdemo.c $(OBJECTS) $(LIBS)
159- chown root wrapdemo
160- chmod u+s wrapdemo
161
162 .c.o:
163     $(CC) $(CFLAGS) -c -o $*.o $<
164Index: svgalib-1.4.3/demos/Makefile
165===================================================================
166--- svgalib-1.4.3.orig/demos/Makefile 2011-01-06 14:03:32.000000000 +0100
167@@ -44,21 +44,15 @@
168
169 .c:
170     $(CC) $(CFLAGS) $(LDFLAGS) -o $* $*.c $(LIBS)
171- chown 0 $*
172- chmod 4755 $*
173
174 rwpage: rwpage.pp
175     $(PC) -Rintel rwpage.pp
176
177 testaccel: testaccel.c
178     $(CC) $(CFLAGS) $(LDFLAGS) -o testaccel testaccel.c $(LIBS) -lm
179- chown 0 testaccel
180- chmod 4755 testaccel
181
182 accel: accel.c
183     $(CC) $(CFLAGS) $(LDFLAGS) -o accel accel.c $(LIBS) -lm
184- chown 0 accel
185- chmod 4755 accel
186
187 clean: cleanbin
188     rm -f .depend *.o *~ *.bak
svgalib/patches/090-soname.patch
1Index: svgalib-1.4.3/gl/Makefile
2===================================================================
3--- svgalib-1.4.3.orig/gl/Makefile 2011-01-06 13:48:39.000000000 +0100
4@@ -29,7 +29,7 @@
5 .PHONY: all clean dep
6
7 libvgagl.so.$(VERSION): $(MODULES)
8- $(CC) -s -shared -Wl,-soname,libvgagl.so.$(MAJOR_VER) -o libvgagl.so.$(VERSION) \
9+ $(CC) -s -shared -Wl,-soname,libvgagl.so -o libvgagl.so.$(VERSION) \
10       $(MODULES)
11
12 libvgagl.a: $(MODULES)
13Index: svgalib-1.4.3/src/Makefile
14===================================================================
15--- svgalib-1.4.3.orig/src/Makefile 2011-01-06 13:48:36.000000000 +0100
16@@ -387,7 +387,7 @@
17
18 # These rules are for ELF only.
19 libvga.so.$(VERSION): $(ALLOBJS)
20- $(CC) -s -shared -Wl,-soname,libvga.so.$(MAJOR_VER) \
21+ $(CC) -s -shared -Wl,-soname,libvga.so \
22       -o libvga.so.$(VERSION) $(ALLOBJS) -lm
23
24 $(sharedlibdir)/libvga.so.$(VERSION): libvga.so.$(VERSION)
svgalib/patches/100-fbdev-setpage.patch
1Index: svgalib-1.4.3/src/fbdev.c
2===================================================================
3--- svgalib-1.4.3.orig/src/fbdev.c 2011-01-06 14:24:59.000000000 +0100
4@@ -141,9 +141,17 @@
5     if (page != oldpage)
6     {
7 // munmap(BANKED_MEM_POINTER, __svgalib_banked_mem_size);
8- mmap(BANKED_MEM_POINTER, __svgalib_banked_mem_size,
9+ long size = __svgalib_banked_mem_size;
10+ long offs = page * __svgalib_banked_mem_size;
11+ if (size + offs > __svgalib_linear_mem_size)
12+ size = __svgalib_linear_mem_size - offs;
13+ if (size <= 0) {
14+ fprintf (stderr, "invalid page %i requested", page);
15+ }
16+
17+ mmap(BANKED_MEM_POINTER, size,
18              PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED,
19- fbdev_fd, page * __svgalib_banked_mem_size);
20+ fbdev_fd, offs);
21         oldpage = page;
22     }
23 }

Archive Download the corresponding diff file



interactive