forked from pld-linux/XFree86
-
Notifications
You must be signed in to change notification settings - Fork 0
/
XFree86-imake-kernel-version.patch
118 lines (111 loc) · 4.25 KB
/
XFree86-imake-kernel-version.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
diff -ur XFree86-4.0.2/xc/config/imake/Imakefile XFree86-4.0.2.new/xc/config/imake/Imakefile
--- XFree86-4.0.2/xc/config/imake/Imakefile Sat Aug 14 12:49:01 1999
+++ XFree86-4.0.2.new/xc/config/imake/Imakefile Sat Dec 23 17:48:28 2000
@@ -15,10 +15,14 @@
CPP_DEFINES = -DCPP_PROGRAM="\"$(CPP_PROGRAM)\""
GCC_COMMAND = $(CC) -fmerge-constants -xc /dev/null -S -o /dev/null 2> /dev/null 1> /dev/null
GCC_DEFINES = -DHAS_MERGE_CONSTANTS=`if $(GCC_COMMAND); then echo 1; else echo 0; fi`
-DEFINES = $(SIGNAL_DEFINES) $(BOOTSTRAPCFLAGS) $(CPP_DEFINES) $(GCC_DEFINES)
+DEFINES = $(SIGNAL_DEFINES) $(BOOTSTRAPCFLAGS) $(CPP_DEFINES) $(GCC_DEFINES) -DDEFAULT_OS_CPU_FROB="\"$(DEFAULT_OS_CPU_FROB)\""
#if defined(MacIIArchitecture) || defined(SequentArchitecture) || defined(i386ScoArchitecture)
XBSDLIB = /**/
+#endif
+
+#if !defined(DEFAULT_OS_CPU_FROB)
+DEFAULT_OS_CPU_FROB = `uname -m`
#endif
#if !defined(OS2Architecture)
diff -ur XFree86-4.0.2/xc/config/imake/Makefile.ini XFree86-4.0.2.new/xc/config/imake/Makefile.ini
--- XFree86-4.0.2/xc/config/imake/Makefile.ini Sat Oct 28 03:15:23 2000
+++ XFree86-4.0.2.new/xc/config/imake/Makefile.ini Sat Dec 23 17:48:37 2000
@@ -9,11 +9,15 @@
#
# $XFree86: xc/config/imake/Makefile.ini,v 3.9 2000/10/26 17:57:45 dawes Exp $
+#if !defined(DEFAULT_OS_CPU_FROB)
+DEFAULT_OS_CPU_FROB = `uname -m`
+#endif
+
BOOTSTRAPCFLAGS =
CC = cc
CDEBUGFLAGS = -O
INCLUDES = -I../../include -I../../imports/x11/include/X11
-CFLAGS = $(BOOTSTRAPCFLAGS) $(CDEBUGFLAGS) $(INCLUDES)
+CFLAGS = $(BOOTSTRAPCFLAGS) $(CDEBUGFLAGS) $(INCLUDES) -DDEFAULT_OS_CPU_FROB="\"$(DEFAULT_OS_CPU_FROB)\""
SHELL = /bin/sh
RM = rm -f
MV = mv
diff -ur XFree86-4.0.2/xc/config/imake/imake.c XFree86-4.0.2.new/xc/config/imake/imake.c
--- XFree86-4.0.2/xc/config/imake/imake.c Sat Dec 23 17:53:30 2000
+++ XFree86-4.0.2.new/xc/config/imake/imake.c Sat Dec 23 17:51:03 2000
@@ -265,6 +265,8 @@
#if defined(linux) || defined(__GNU__)
#include <limits.h>
#include <stdio.h>
+#include <linux/uts.h>
+#include <linux/version.h>
#endif
#ifdef __QNX__
#include <unix.h>
@@ -1208,57 +1210,19 @@
#if !defined(WIN32) && !defined(__EMX__)
#if (defined(DEFAULT_OS_NAME) || defined(DEFAULT_OS_MAJOR_REV) || \
defined(DEFAULT_OS_MINOR_REV) || defined(DEFAULT_OS_TEENY_REV))
- struct utsname name;
- char buf[SYS_NMLN * 5 + 1];
- /* Obtain the system information. */
- if (uname(&name) < 0)
- LogFatal("Cannot invoke uname", "");
-
-# ifdef DEFAULT_OS_NAME
- parse_utsname(&name, DEFAULT_OS_NAME, buf,
- "Bad DEFAULT_OS_NAME syntax %s");
-# ifdef DEFAULT_OS_NAME_FROB
- DEFAULT_OS_NAME_FROB(buf, sizeof buf);
-# endif
- if (buf[0] != '\0')
- fprintf(inFile, "#define DefaultOSName %s\n", buf);
-# endif
+ fprintf(inFile, "#define DefaultOSName %s %s %s\n",
+ UTS_SYSNAME, UTS_RELEASE, DEFAULT_OS_CPU_FROB);
-# ifdef DEFAULT_OS_MAJOR_REV
- parse_utsname(&name, DEFAULT_OS_MAJOR_REV, buf,
- "Bad DEFAULT_OS_MAJOR_REV syntax %s");
-# ifdef DEFAULT_OS_MAJOR_REV_FROB
- DEFAULT_OS_MAJOR_REV_FROB(buf, sizeof buf);
-# endif
- fprintf(inFile, "#define DefaultOSMajorVersion %s\n",
- *buf ? trim_version(buf) : "0");
-# endif
+ fprintf(inFile, "#define DefaultOSMajorVersion %d\n",
+ LINUX_VERSION_CODE >> 16);
-# ifdef DEFAULT_OS_MINOR_REV
- parse_utsname(&name, DEFAULT_OS_MINOR_REV, buf,
- "Bad DEFAULT_OS_MINOR_REV syntax %s");
-# ifdef DEFAULT_OS_MINOR_REV_FROB
- DEFAULT_OS_MINOR_REV_FROB(buf, sizeof buf);
-# endif
- fprintf(inFile, "#define DefaultOSMinorVersion %s\n",
- *buf ? trim_version(buf) : "0");
-# endif
+ fprintf(inFile, "#define DefaultOSMinorVersion %d\n",
+ (LINUX_VERSION_CODE >> 8) & 0xFF);
+
+ fprintf(inFile, "#define DefaultOSTeenyVersion %d\n",
+ LINUX_VERSION_CODE & 0xFF);
-# ifdef DEFAULT_OS_TEENY_REV
- parse_utsname(&name, DEFAULT_OS_TEENY_REV, buf,
- "Bad DEFAULT_OS_TEENY_REV syntax %s");
-# ifdef DEFAULT_OS_TEENY_REV_FROB
- DEFAULT_OS_TEENY_REV_FROB(buf, sizeof buf);
-# endif
- fprintf(inFile, "#define DefaultOSTeenyVersion %s\n",
- *buf ? trim_version(buf) : "0");
-# endif
-# ifdef DEFAULT_MACHINE_ARCHITECTURE
- parse_utsname(&name, DEFAULT_MACHINE_ARCHITECTURE, buf,
- "Bad DEFAULT_MACHINE_ARCHITECTURE %s");
- fprintf(inFile, "#ifndef %s\n# define %s\n#endif\n", buf, buf);
-# endif
#endif
#ifdef linux
get_distrib (inFile);