From: Jon Trulson Date: Mon, 24 Mar 2014 23:15:40 +0000 (-0600) Subject: linux: build with thread safety and REENTRANT enabled. X-Git-Tag: 2.2.2~30 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9b699d3fb122c135a85d64c8e0235b7a110903f1;p=oweals%2Fcde.git linux: build with thread safety and REENTRANT enabled. There was a check in linux.cf for the Linux libc version that didn't work, since these were never set anywhere. Presumably current Xorg imake sets these, but since we aren't using that... (yet) As a result, the build assumed that thread-safe API's were not supported. Setting the default libc major version to '6' allows the proper build to take place. libc5 was never threadsafe and no one has probably used it in over 10 years. As a result, some earlier porting fixes that referenced '__fds_bits' on linux systems had to be reverted as these are not valid in an MT environment. They are also not neccessary when building in such an environment, as the normal 'fds_bits' works fine. This patch defintely needs testing on many linux systems. --- diff --git a/cde/config/cf/linux.cf b/cde/config/cf/linux.cf index 9cd89336..f55779e1 100644 --- a/cde/config/cf/linux.cf +++ b/cde/config/cf/linux.cf @@ -34,17 +34,29 @@ XCOMM platform: $TOG: linux.cf /main/47 1998/04/17 11:32:51 mgreess $ LinuxYggdrasil (12) */ #endif + +#ifndef DefaultLinuxCLibMajorVersion +# define DefaultLinuxCLibMajorVersion 6 +#endif +#ifndef DefaultLinuxCLibMinorVersion +# define DefaultLinuxCLibMinorVersion 0 +#endif +#ifndef DefaultLinuxCLibTeenyVersion +# define DefaultLinuxCLibTeenyVersion 0 +#endif + #ifndef LinuxCLibMajorVersion -# define LinuxCLibMajorVersion DefaultLinuxCLibMajorVersion +# define LinuxCLibMajorVersion DefaultLinuxCLibMajorVersion #endif #ifndef LinuxCLibMinorVersion -# define LinuxCLibMinorVersion DefaultLinuxCLibMinorVersion +# define LinuxCLibMinorVersion DefaultLinuxCLibMinorVersion #endif #ifndef LinuxCLibTeenyVersion -# define LinuxCLibTeenyVersion DefaultLinuxCLibTeenyVersion +# define LinuxCLibTeenyVersion DefaultLinuxCLibTeenyVersion #endif + #ifndef LinuxBinUtilsMajorVersion -# define LinuxBinUtilsMajorVersion DefaultLinuxBinUtilsMajorVersion +# define LinuxBinUtilsMajorVersion DefaultLinuxBinUtilsMajorVersion #endif XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion) diff --git a/cde/lib/csa/xtclient.c b/cde/lib/csa/xtclient.c index b42b5efc..aff5b03a 100644 --- a/cde/lib/csa/xtclient.c +++ b/cde/lib/csa/xtclient.c @@ -69,11 +69,8 @@ _DtCm_register_xtcallback(XtAppContext appct) return; /* assuming only 1 bit is set */ -#if defined(linux) - bits = fdset.__fds_bits; -#else bits = fdset.fds_bits; -#endif + for (i = 0; i < FD_SETSIZE; i += NFDBITS) { fmask = *bits; for (j = 0; fmask != 0; j++, fmask >>= 1) { diff --git a/cde/programs/dtspcd/spcd_event.c b/cde/programs/dtspcd/spcd_event.c index 2a30c7fc..01fdf28b 100644 --- a/cde/programs/dtspcd/spcd_event.c +++ b/cde/programs/dtspcd/spcd_event.c @@ -86,13 +86,8 @@ void SPCD_MainLoopUntil(Boolean *flag) int result; do { for (n=0; n