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 +#ifdef __dilos__ +#include +#endif /* __dilos__ */ // === Global constants === Index: tdebase/cmake/modules/TDEMacros.cmake =================================================================== --- tdebase.orig/cmake/modules/TDEMacros.cmake +++ tdebase/cmake/modules/TDEMacros.cmake @@ -833,7 +833,7 @@ macro( tde_add_library _arg_target ) # set embedded archives if( _embed ) - list( INSERT _link 0 -Wl,-whole-archive ${_embed} -Wl,-no-whole-archive ) + list( INSERT _link 0 -Wl,-zallextract ${_embed} -Wl,-zdefaultextract ) endif( _embed ) # set link libraries @@ -1875,11 +1875,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 #include -#ifdef HAVE_SYS_LOADAVG_H +#if defined(HAVE_SYS_LOADAVG_H) || defined(__dilos__) #include // 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 #include -#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) +#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__dilos__) #include #endif #include @@ -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 #include #include +#ifdef __linux__ #include +#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 #include #include +#ifdef __linux__ #include #include #include +#endif /* __linux__ */ #include #include #include @@ -42,7 +44,9 @@ License along with tdekbdledsync. If not #include #include extern "C" { +#ifdef __linux__ #include +#endif /* __linux__ */ #include "getfd.h" } #include @@ -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