File: 0002-kfreebsd-support.patch

package info (click to toggle)
service-wrapper-java 3.5.22-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,196 kB
  • ctags: 3,454
  • sloc: ansic: 23,282; java: 13,420; xml: 3,389; sh: 1,523; cpp: 32; makefile: 23
file content (177 lines) | stat: -rw-r--r-- 6,245 bytes parent folder | download
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
From: Kill Your TV <killyourtv@i2pmail.org>
Date: Sun, 18 Nov 2012 10:33:13 +0000
Subject: kfreebsd support

---
 build.xml                           |  5 ++++-
 src/c/Makefile-kfreebsd-x86-32.make | 42 +++++++++++++++++++++++++++++++++++++
 src/c/Makefile-kfreebsd-x86-64.make | 42 +++++++++++++++++++++++++++++++++++++
 src/c/logger.c                      |  2 +-
 src/c/wrapper.c                     |  6 ++++--
 5 files changed, 93 insertions(+), 4 deletions(-)
 create mode 100644 src/c/Makefile-kfreebsd-x86-32.make
 create mode 100644 src/c/Makefile-kfreebsd-x86-64.make

diff --git a/build.xml b/build.xml
index fa2c6d5..5206ccf 100644
--- a/build.xml
+++ b/build.xml
@@ -87,6 +87,9 @@
         <condition property="dist.os" value="freebsd">
             <equals arg1="${os.name}" arg2="FreeBSD"/>
         </condition>
+        <condition property="dist.os" value="kfreebsd">
+            <equals arg1="${os.name}" arg2="GNU/kFreeBSD"/>
+        </condition>
         <condition property="dist.os" value="irix">
             <equals arg1="${os.name}" arg2="Irix"/>
         </condition>
@@ -181,7 +184,7 @@
         
         <!-- Not all JVMs support the sun.arch.data.model property.  Default to 32-bit. -->
         <property name="sun.arch.data.model" value="32"/>
-        <condition property="bits-mismatch" value="true">
+        <condition property="bits-mismatch-DISABLED" value="true">
             <not>
                 <equals arg1="${sun.arch.data.model}" arg2="${bits}"/>
             </not>
diff --git a/src/c/Makefile-kfreebsd-x86-32.make b/src/c/Makefile-kfreebsd-x86-32.make
new file mode 100644
index 0000000..462314a
--- /dev/null
+++ b/src/c/Makefile-kfreebsd-x86-32.make
@@ -0,0 +1,42 @@
+# Copyright (c) 1999, 2012 Tanuki Software, Ltd.
+# http://www.tanukisoftware.com
+# All rights reserved.
+#
+# This software is the proprietary information of Tanuki Software.
+# You shall use it only in accordance with the terms of the
+# license agreement you entered into with Tanuki Software.
+# http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
+
+CC = gcc -Wall -pedantic -DKFREEBSD -fPIC -I/usr/include -L/usr/lib -DUNICODE -D_UNICODE
+
+INCLUDE=$(JAVA_HOME)/include
+
+CFLAGS = -I$(INCLUDE) -I$(INCLUDE)/freebsd
+
+wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c wrapper_file.c wrapper_i18n.c wrapper_hashmap.c
+
+libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o
+
+BIN = ../../bin
+LIB = ../../lib
+
+all: init wrapper libwrapper.so
+
+clean:
+	rm -f *.o
+
+cleanall: clean
+	rm -rf *~ .deps
+	rm -f $(BIN)/wrapper $(LIB)/libwrapper.so
+
+init:
+	if test ! -d .deps; then mkdir .deps; fi
+
+wrapper: $(wrapper_SOURCE)
+	$(CC) $(wrapper_SOURCE) -lm -pthread -o $(BIN)/wrapper
+
+libwrapper.so: $(libwrapper_so_OBJECTS)
+	$(CC) -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
+
+#%.o: %.c
+#	$(COMPILE) -c $(DEFS) $<
diff --git a/src/c/Makefile-kfreebsd-x86-64.make b/src/c/Makefile-kfreebsd-x86-64.make
new file mode 100644
index 0000000..907978a
--- /dev/null
+++ b/src/c/Makefile-kfreebsd-x86-64.make
@@ -0,0 +1,42 @@
+# Copyright (c) 1999, 2012 Tanuki Software, Ltd.
+# http://www.tanukisoftware.com
+# All rights reserved.
+#
+# This software is the proprietary information of Tanuki Software.
+# You shall use it only in accordance with the terms of the
+# license agreement you entered into with Tanuki Software.
+# http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
+
+CC = gcc -Wall -pedantic -DKFREEBSD -DJSW64 -fPIC -I/usr/include -L/usr/lib -DUNICODE -D_UNICODE
+
+INCLUDE=$(JAVA_HOME)/include
+
+CFLAGS = -I$(INCLUDE) -I$(INCLUDE)/freebsd
+
+wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c wrapper_file.c wrapper_i18n.c wrapper_hashmap.c
+
+libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o
+
+BIN = ../../bin
+LIB = ../../lib
+
+all: init wrapper libwrapper.so
+
+clean:
+	rm -f *.o
+
+cleanall: clean
+	rm -rf *~ .deps
+	rm -f $(BIN)/wrapper $(LIB)/libwrapper.so
+
+init:
+	if test ! -d .deps; then mkdir .deps; fi
+
+wrapper: $(wrapper_SOURCE)
+	$(CC) $(wrapper_SOURCE) -lm -pthread -o $(BIN)/wrapper
+
+libwrapper.so: $(libwrapper_so_OBJECTS)
+	$(CC) -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
+
+#%.o: %.c
+#	$(COMPILE) -c $(DEFS) $<
diff --git a/src/c/logger.c b/src/c/logger.c
index 363d42f..fbc9fbd 100644
--- a/src/c/logger.c
+++ b/src/c/logger.c
@@ -76,7 +76,7 @@ typedef long intptr_t;
  #elif defined(AIX) || defined(HPUX) || defined(MACOSX) || defined(OSF1)
  #elif defined(IRIX)
   #define PATH_MAX FILENAME_MAX
- #elif defined(FREEBSD)
+ #elif defined(FREEBSD) || defined(KFREEBSD)
   #include <sys/param.h>
   #include <errno.h>
  #else /* LINUX */
diff --git a/src/c/wrapper.c b/src/c/wrapper.c
index 13312b5..1f4a064 100644
--- a/src/c/wrapper.c
+++ b/src/c/wrapper.c
@@ -98,7 +98,7 @@
  #elif defined(AIX) || defined(HPUX) || defined(MACOSX) || defined(OSF1)
  #elif defined(IRIX)
   #define PATH_MAX FILENAME_MAX
- #elif defined(FREEBSD)
+ #elif defined(FREEBSD) || defined(KFREEBSD)
   #include <sys/param.h>
   #include <errno.h>
  #else /* LINUX */
@@ -4619,7 +4619,7 @@ int checkIfBinary(const TCHAR *filename) {
             log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("Magic number for file %s: 0x%02x%02x%02x%02x"), filename, head[0], head[1], head[2], head[3]);
         }
 
-#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS) 
+#if defined(LINUX) || defined(FREEBSD) || defined(KFREEBSD) || defined(SOLARIS)
         if (head[1] == 'E' && head[2] == 'L' && head[3] == 'F') {
             return 1; /*ELF */
 #elif defined(AIX)
@@ -5912,6 +5912,8 @@ int wrapperBuildJavaCommandArrayInner(TCHAR **strings, int addQuotes, const TCHA
                               TEXT("wrapper.java.additional.auto_bits.solaris"),
 #elif defined(FREEBSD)
                               TEXT("wrapper.java.additional.auto_bits.freebsd"),
+#elif defined(KFREEBSD)
+                              TEXT("wrapper.java.additional.auto_bits.kfreebsd"),
 #elif defined(MACOSX)
                               TEXT("wrapper.java.additional.auto_bits.macosx"),
 #endif