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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
|
Index: tdebase/ksysguard/ksysguardd/CMakeLists.txt
===================================================================
--- tdebase.orig/ksysguard/ksysguardd/CMakeLists.txt
+++ tdebase/ksysguard/ksysguardd/CMakeLists.txt
@@ -19,6 +19,8 @@ elseif( ${CMAKE_SYSTEM_NAME} MATCHES "Op
set( OS_SPECIFIC_DIR OpenBSD )
elseif( ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" )
set( OS_SPECIFIC_DIR FreeBSD )
+elseif( ${CMAKE_SYSTEM_NAME} MATCHES "SunOS" )
+ set( OS_SPECIFIC_DIR Solaris )
elseif( ${CMAKE_SYSTEM_NAME} MATCHES "NetBSD" )
set( OS_SPECIFIC_DIR NetBSD )
else()
@@ -30,7 +32,7 @@ add_subdirectory( ${OS_SPECIFIC_DIR} )
add_definitions(
-DKSYSGUARDDRCFILE=\"${SYSCONF_INSTALL_DIR}/ksysguarddrc\"
- -DOSTYPE_${CMAKE_SYSTEM_NAME}
+ -DOSTYPE_${OS_SPECIFIC_DIR}
)
@@ -46,6 +48,6 @@ include_directories(
tde_add_executable( ksysguardd AUTOMOC
SOURCES Command.c conf.c ksysguardd.c PWUIDCache.c
LINK ccont-static ksysguardd-static ${TDE_LIB_DIR}/libtdefakes_nonpic.a
- ${SENSORS_LIBRARIES}
+ ${SENSORS_LIBRARIES} socket nsl
DESTINATION ${BIN_INSTALL_DIR}
)
Index: tdebase/ksysguard/ksysguardd/Solaris/CMakeLists.txt
===================================================================
--- /dev/null
+++ tdebase/ksysguard/ksysguardd/Solaris/CMakeLists.txt
@@ -0,0 +1,29 @@
+#################################################
+#
+# (C) 2019 DilOS Team
+# denis (at) dilos (dot) org
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+
+include_directories(
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/ksysguard/CContLib
+ ${CMAKE_SOURCE_DIR}/ksysguard/ksysguardd
+)
+
+add_definitions(
+ -DHAVE_KSTAT
+)
+
+##### ksysguardd (static) #######################
+
+tde_add_library( ksysguardd STATIC
+ SOURCES
+ LoadAvg.c Memory.c NetDev.c ProcessList.c
+ LINK kstat
+)
Index: tdebase/tdm/backend/CMakeLists.txt
===================================================================
--- tdebase.orig/tdm/backend/CMakeLists.txt
+++ tdebase/tdm/backend/CMakeLists.txt
@@ -44,6 +44,6 @@ tde_add_executable( tdm
process.c protodpy.c reset.c resource.c rpcauth.c
server.c session.c sessreg.c socket.c streams.c
util.c xdmauth.c xdmcp.c
- LINK X11 ${XAU_LIBRARIES} ${DBUS_LIBRARIES} ${CRYPT_LIBRARY} ${PAM_LIBRARY} ${UTIL_LIBRARY} ${XDMCP_LIBRARIES}
+ LINK socket nsl X11 ${XAU_LIBRARIES} ${DBUS_LIBRARIES} ${CRYPT_LIBRARY} ${PAM_LIBRARY} ${XDMCP_LIBRARIES}
DESTINATION ${BIN_INSTALL_DIR}
)
Index: tdebase/kcontrol/info/CMakeLists.txt
===================================================================
--- tdebase.orig/kcontrol/info/CMakeLists.txt
+++ tdebase/kcontrol/info/CMakeLists.txt
@@ -41,6 +41,6 @@ install( FILES
tde_add_kpart( kcm_info AUTOMOC
SOURCES main.cpp memory.cpp ${OPENGL_SOURCES}
- LINK tdeui-shared ${GL_LIBRARIES} ${GLU_LIBRARIES}
+ LINK tdeui-shared ${GL_LIBRARIES} ${GLU_LIBRARIES} kstat
DESTINATION ${PLUGIN_INSTALL_DIR}
)
Index: tdebase/kcontrol/ebrowsing/plugins/localdomain/CMakeLists.txt
===================================================================
--- tdebase.orig/kcontrol/ebrowsing/plugins/localdomain/CMakeLists.txt
+++ tdebase/kcontrol/ebrowsing/plugins/localdomain/CMakeLists.txt
@@ -38,6 +38,6 @@ tde_add_kpart( liblocaldomainurifilter A
tde_add_executable( klocaldomainurifilterhelper
SOURCES klocaldomainurifilterhelper.c
- LINK
+ LINK socket nsl
DESTINATION ${BIN_INSTALL_DIR}
)
Index: tdebase/kcontrol/nics/nic.cpp
===================================================================
--- tdebase.orig/kcontrol/nics/nic.cpp
+++ tdebase/kcontrol/nics/nic.cpp
@@ -222,7 +222,11 @@ NICList* findNICs()
result=ioctl(sockfd,SIOCGIFHWADDR,&ifcopy);
if (result==0)
{
+#ifdef __dilos__
+ char *n = ifcopy.ifr_enaddr;
+#else /* !__dilos__*/
char *n = &ifcopy.ifr_ifru.ifru_hwaddr.sa_data[0];
+#endif /* __dilos__ */
tmp->HWaddr = HWaddr2String(n);
}
#elif defined SIOCGENADDR
Index: tdebase/twin/compton-tde/compton.c
===================================================================
--- tdebase.orig/twin/compton-tde/compton.c
+++ tdebase/twin/compton-tde/compton.c
@@ -11,6 +11,9 @@
#include "compton.h"
#include <ctype.h>
+#ifdef __dilos__
+#include <math.h>
+#endif /* __dilos__ */
// === Global constants ===
Index: tdebase/cmake/modules/TDEMacros.cmake
===================================================================
--- tdebase.orig/cmake/modules/TDEMacros.cmake
+++ tdebase/cmake/modules/TDEMacros.cmake
@@ -2182,11 +2182,11 @@ macro( tde_setup_architecture_flags )
set( LINKER_IMMEDIATE_BINDING_FLAGS "" CACHE INTERNAL "" FORCE )
endif( )
- check_cxx_compiler_flag( -fPIE HAVE_PIE_SUPPORT )
- if( HAVE_PIE_SUPPORT )
- set( TDE_PIE_CFLAGS -fPIE )
- set( TDE_PIE_LDFLAGS -pie )
- endif( HAVE_PIE_SUPPORT )
+# check_cxx_compiler_flag( -fPIE HAVE_PIE_SUPPORT )
+# if( HAVE_PIE_SUPPORT )
+# set( TDE_PIE_CFLAGS -fPIE )
+# set( TDE_PIE_LDFLAGS -pie )
+# endif( HAVE_PIE_SUPPORT )
endmacro( )
Index: tdebase/tdeioslave/media/medianotifier/medianotifier.cpp
===================================================================
--- tdebase.orig/tdeioslave/media/medianotifier/medianotifier.cpp
+++ tdebase/tdeioslave/media/medianotifier/medianotifier.cpp
@@ -372,12 +372,20 @@ extern "C"
void MediaNotifier::checkFreeDiskSpace()
{
+#ifdef __dilos__
+ struct statvfs sfs;
+#else /* !__dilos__ */
struct statfs sfs;
+#endif /* __dilos__ */
long total, avail;
if ( m_freeDialog )
return;
+#ifdef __dilos__
+ if ( statvfs( TQFile::encodeName( TQDir::homeDirPath() ), &sfs ) == 0 )
+#else /* !__dilos__ */
if ( statfs( TQFile::encodeName( TQDir::homeDirPath() ), &sfs ) == 0 )
+#endif /* __dilos__ */
{
total = sfs.f_blocks;
avail = ( getuid() ? sfs.f_bavail : sfs.f_bfree );
Index: tdebase/kicker/kicker/ui/k_new_mnu.cpp
===================================================================
--- tdebase.orig/kicker/kicker/ui/k_new_mnu.cpp
+++ tdebase/kicker/kicker/ui/k_new_mnu.cpp
@@ -3618,8 +3618,13 @@ void KMenu::updateMedia()
{
descr = mountPoint;
// calc the free/total space
+#ifdef __dilos__
+ struct statvfs sfs;
+ if ( statvfs( TQFile::encodeName( mountPoint ), &sfs ) == 0 )
+#else /* !__dilos__ */
struct statfs sfs;
if ( statfs( TQFile::encodeName( mountPoint ), &sfs ) == 0 )
+#endif /* __dilos__ */
{
uint64_t total = ( uint64_t )sfs.f_blocks * sfs.f_bsize;
uint64_t avail = ( uint64_t )( getuid() ? sfs.f_bavail : sfs.f_bfree ) * sfs.f_bsize;
Index: tdebase/kicker/extensions/kasbar/kasloaditem.cpp
===================================================================
--- tdebase.orig/kicker/extensions/kasbar/kasloaditem.cpp
+++ tdebase/kicker/extensions/kasbar/kasloaditem.cpp
@@ -2,7 +2,7 @@
#include <stdlib.h>
#include <config.h>
-#ifdef HAVE_SYS_LOADAVG_H
+#if defined(HAVE_SYS_LOADAVG_H) || defined(__dilos__)
#include <sys/loadavg.h> // e.g. Solaris
#endif
Index: tdebase/tdesu/tdesud/tdesud.cpp
===================================================================
--- tdebase.orig/tdesu/tdesud/tdesud.cpp
+++ tdebase/tdesu/tdesud/tdesud.cpp
@@ -45,7 +45,7 @@
#include <pwd.h>
#include <errno.h>
-#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
+#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__dilos__)
#include <sys/prctl.h>
#endif
#include <sys/time.h>
@@ -251,7 +251,7 @@ int create_socket()
int main(int argc, char *argv[])
{
-#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
+#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__dilos__)
prctl(PR_SET_DUMPABLE, 0);
#endif
Index: tdebase/tdm/backend/getfd.c
===================================================================
--- tdebase.orig/tdm/backend/getfd.c
+++ tdebase/tdm/backend/getfd.c
@@ -22,7 +22,7 @@ is_a_console(int fd) {
char arg;
arg = 0;
-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__dilos__)
return arg;
#else
return (ioctl(fd, KDGKBTYPE, &arg) == 0
Index: tdebase/tdm/kfrontend/CMakeLists.txt
===================================================================
--- tdebase.orig/tdm/kfrontend/CMakeLists.txt
+++ tdebase/tdm/kfrontend/CMakeLists.txt
@@ -55,7 +55,7 @@ set_property( SOURCE tdm_config.c tdm_gr
tde_add_executable( tdm_config
SOURCES tdm_config.c
- LINK
+ LINK socket nsl
DESTINATION ${BIN_INSTALL_DIR}
)
@@ -100,6 +100,6 @@ tde_add_executable( gentdmconf AUTOMOC
tde_add_executable( tdmctl
SOURCES tdmctl.c
- LINK
+ LINK socket nsl
DESTINATION ${BIN_INSTALL_DIR}
)
Index: tdebase/kcontrol/nics/CMakeLists.txt
===================================================================
--- tdebase.orig/kcontrol/nics/CMakeLists.txt
+++ tdebase/kcontrol/nics/CMakeLists.txt
@@ -12,7 +12,9 @@
include( CheckFunctionExists )
check_include_file( "sys/sockio.h" HAVE_SYS_SOCKIO_H )
+tde_save_and_set( CMAKE_REQUIRED_LIBRARIES socket nsl )
check_function_exists( getnameinfo HAVE_GETNAMEINFO )
+tde_restore( CMAKE_REQUIRED_LIBRARIES )
check_struct_has_member( "struct sockaddr" sa_len "sys/types.h;sys/socket.h" HAVE_STRUCT_SOCKADDR_SA_LEN )
Index: tdebase/tdekbdledsync/getfd.c
===================================================================
--- tdebase.orig/tdekbdledsync/getfd.c
+++ tdebase/tdekbdledsync/getfd.c
@@ -4,7 +4,9 @@
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
+#ifdef __linux__
#include <linux/kd.h>
+#endif /* __linux__ */
#include "getfd.h"
/*
@@ -17,11 +19,15 @@
static int
is_a_console(int fd) {
+#ifdef __linux__
char arg;
arg = 0;
return (ioctl(fd, KDGKBTYPE, &arg) == 0
&& ((arg == KB_101) || (arg == KB_84)));
+#else /* !__linux__ */
+ return (0);
+#endif /* __linux__ */
}
static int
Index: tdebase/tdekbdledsync/main.cpp
===================================================================
--- tdebase.orig/tdekbdledsync/main.cpp
+++ tdebase/tdekbdledsync/main.cpp
@@ -30,9 +30,11 @@ License along with tdekbdledsync. If not
#include <fcntl.h>
#include <limits.h>
#include <dirent.h>
+#ifdef __linux__
#include <linux/vt.h>
#include <linux/input.h>
#include <linux/uinput.h>
+#endif /* __linux__ */
#include <sys/file.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -42,7 +44,9 @@ License along with tdekbdledsync. If not
#include <signal.h>
#include <stdint.h>
extern "C" {
+#ifdef __linux__
#include <libudev.h>
+#endif /* __linux__ */
#include "getfd.h"
}
#include <libgen.h>
@@ -64,6 +68,10 @@ using namespace std;
typedef unsigned char byte;
+#ifndef __linux__
+#define KEY_MAX 0
+#endif /* __linux__ */
+
char filename[32];
char key_bitmask[(KEY_MAX + 7) / 8];
@@ -262,11 +270,14 @@ int find_keyboards() {
fd = open(filename, O_RDWR|O_SYNC);
if (fd >= 0) {
+#ifdef __linux__
ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(key_bitmask)), key_bitmask);
// Ensure that we do not detect tsak faked keyboards
ioctl (fd, EVIOCGNAME(sizeof(name)), name);
+#endif /* __linux__ */
if (str_ends_with(name, "+tsak") == 0) {
+#ifdef __linux__
struct input_id input_info;
ioctl (fd, EVIOCGID, &input_info);
if ((input_info.vendor != 0) && (input_info.product != 0)) {
@@ -278,6 +289,7 @@ int find_keyboards() {
}
}
}
+#endif /* __linux__ */
}
if (keyboard_fds[keyboard_fd_num] == 0) {
@@ -302,8 +314,10 @@ int main() {
int current_keyboard;
char name[256] = "Unknown";
unsigned int states;
+#ifdef __linux__
struct input_event ev;
struct vt_stat vtstat;
+#endif /* __linux__ */
int vt_fd;
int x11_vt_num = -1;
// XEvent xev;
@@ -364,6 +378,7 @@ int main() {
struct udev_monitor *mon;
struct timeval tv;
+#ifdef __linux__
// Create the udev object
udev = udev_new();
if (!udev) {
@@ -376,6 +391,7 @@ int main() {
mon = udev_monitor_new_from_netlink(udev, "udev");
udev_monitor_filter_add_match_subsystem_devtype(mon, "input", NULL);
udev_monitor_enable_receiving(mon);
+#endif /* __linux__ */
while (1) {
// Get masks
@@ -395,12 +411,15 @@ int main() {
for (current_keyboard=0;current_keyboard<keyboard_fd_num;current_keyboard++) {
// Print device name
+#ifdef __linux__
ioctl(keyboard_fds[current_keyboard], EVIOCGNAME (sizeof (name)), name);
+#endif /* __linux__ */
fprintf(stderr, "[tdekbdledsync] Syncing keyboard: (%s)\n", name);
}
while (1) {
// Get current active VT
+#ifdef __linux__
if (ioctl(vt_fd, VT_GETSTATE, &vtstat)) {
fprintf(stderr, "[tdekbdledsync] Unable to get current VT!\n");
releaseLock(lockfd, lockFileName);
@@ -443,7 +462,9 @@ int main() {
}
}
}
- else {
+ else
+#endif /* __linux__ */
+ {
// Ensure the X server is still alive
// If the X server has terminated, this will fail and the program will terminate
XSync(display, False);
@@ -452,9 +473,12 @@ int main() {
// Check the hotplug monitoring process to see if any keyboards were added or removed
fd_set readfds;
FD_ZERO(&readfds);
+#ifdef __linux__
FD_SET(udev_monitor_get_fd(mon), &readfds);
+#endif /* __linux__ */
tv.tv_sec = 0;
tv.tv_usec = 0;
+#ifdef __linux__
int fdcount = select(udev_monitor_get_fd(mon)+1, &readfds, NULL, NULL, &tv);
if (fdcount < 0) {
if (errno == EINTR) {
@@ -481,6 +505,7 @@ int main() {
}
}
}
+#endif /* __linux__ */
// Poll
usleep(250*1000);
@@ -511,7 +536,9 @@ int main() {
}
releaseLock(lockfd, lockFileName);
+#ifdef __linux__
udev_monitor_unref(mon);
udev_unref(udev);
+#endif /* __linux__ */
return 0;
}
Index: tdebase/tdekbdledsync/CMakeLists.txt
===================================================================
--- tdebase.orig/tdekbdledsync/CMakeLists.txt
+++ tdebase/tdekbdledsync/CMakeLists.txt
@@ -23,7 +23,7 @@ link_directories(
tde_add_executable( tdekbdledsync
SOURCES getfd.c main.cpp
- LINK udev X11
+ LINK X11
DESTINATION ${BIN_INSTALL_DIR}
SETUID
)
Index: tdebase/CMakeLists.txt
===================================================================
--- tdebase.orig/CMakeLists.txt
+++ tdebase/CMakeLists.txt
@@ -51,7 +51,7 @@ tde_setup_paths( )
##### add apidox targets ############
add_custom_target(apidox
- COMMAND "./generate_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "/usr/share/qt3/doc/html"
+ COMMAND "./generate_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "/usr/share/tqt3/doc/html"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")
add_custom_target(install-apidox
Index: tdebase/tdm/config.def
===================================================================
--- tdebase.orig/tdm/config.def
+++ tdebase/tdm/config.def
@@ -42,6 +42,9 @@
#elif defined(__SVR4)
# define HALT_CMD "/usr/sbin/halt"
# define REBOOT_CMD "/usr/sbin/reboot"
+#elif defined(__dilos__)
+# define HALT_CMD "/usr/sbin/poweroff"
+# define REBOOT_CMD "/usr/sbin/reboot"
#else
# define HALT_CMD "/sbin/poweroff"
# define REBOOT_CMD "/sbin/reboot"
@@ -50,6 +53,9 @@
#if defined(BSD) || defined(__linux__)
# define DEF_USER_PATH "/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games"
# define DEF_SYSTEM_PATH "/usr/local/sbin:/usr/local/bin:/opt/trinity/sbin:/usr/sbin:/opt/trinity/bin:/usr/bin:/sbin:/bin:/usr/X11R6/bin"
+#elif defined(__dilos__)
+# define DEF_USER_PATH "/usr/bin:/bin"
+# define DEF_SYSTEM_PATH "/usr/bin:/usr/sbin:/sbin"
#else
# define DEF_USER_PATH "/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/ucb"
# define DEF_SYSTEM_PATH "/usr/local/sbin:/usr/local/bin:/opt/trinity/sbin:/usr/sbin:/opt/trinity/bin:/usr/bin:/sbin:/bin:/etc:/usr/ucb"
@@ -63,7 +69,7 @@
#ifdef __linux__
# define HAVE_VTS
-#elif defined(__sun__)
+#elif defined(__sun__) || defined(__dilos__)
# define DEF_SERVER_TTY "console"
#elif defined(_AIX)
# define DEF_SERVER_TTY "lft0"
|