SVN commit 501412 by neundorf:
-make it compile on FreeBSD 5.4
I guess the configure check for pthread_np.h should also be
added to unsermake and scons ?
CCMAIL: kfm-devel kde.org
Alex
M +9 -4 ConfigureChecks.cmake
M +2 -1 config.h.cmake
M +11 -0 kjs/collector.cpp
--- trunk/KDE/kdelibs/ConfigureChecks.cmake #501411:501412
 -97,9
+97,10 
check_include_files(fstab.h HAVE_FSTAB_H)
check_include_files(ieeefp.h HAVE_IEEEFP_H)
check_include_files(limits.h HAVE_LIMITS_H)
-check_include_files(libutil.h HAVE_LIBUTIL_H)
+check_include_files("sys/types.h;libutil.h"
HAVE_LIBUTIL_H)
check_include_files(util.h HAVE_UTIL_H)
check_include_files(mntent.h HAVE_MNTENT_H)
+check_include_files("pthread.h;pthread_np.h"
HAVE_PTHREAD_NP_H)
check_include_files(pty.h HAVE_PTY_H)
check_include_files(sysent.h HAVE_SYSENT_H)
check_include_files(sys/bitypes.h HAVE_SYS_BITYPES_H)
 -130,7
+131,7 
check_include_files(machine/soundcard.h
HAVE_MACHINE_SOUNDCARD_H)
check_include_files(sys/soundcard.h HAVE_SYS_SOUNDCARD_H)
check_include_files(ndir.h HAVE_NDIR_H)
-check_include_files(net/if.h HAVE_NET_IF_H)
+check_include_files("sys/socket.h;net/if.h"
HAVE_NET_IF_H)
check_include_files(nl_types.h HAVE_NL_TYPES_H)
check_include_files(paths.h HAVE_PATHS_H)
check_include_files(punycode.h HAVE_PUNYCODE_H)
 -150,7
+151,7 
#check_symbol_exists(sockaddr_in6 "netinet/in.h"
HAVE_STRUCT_SOCKADDR_IN6)
check_symbol_exists(LC_MESSAGES "locale.h"
HAVE_LC_MESSAGES)
-check_symbol_exists(res_init resolv.h HAVE_RES_INIT)
+check_symbol_exists(res_init
"sys/types.h;netinet/in.h;arpa/nameserv.h;resolv.h"
; HAVE_RES_INIT)
check_symbol_exists(S_ISSOCK sys/stat.h HAVE_S_ISSOCK)
check_function_exists(posix_fadvise HAVE_FADVISE)
 -214,9
+215,13 
check_library_exists(utempter addToUtmp ""
HAVE_UTEMPTER)
check_library_exists(crypt crypt "" HAVE_CRYPT)
-check_library_exists(util openpty ""
HAVE_OPENPTY)
check_library_exists(volmgt volmgt_running ""
HAVE_VOLMGT)
+check_library_exists(util openpty ""
HAVE_OPENPTY)
+if (HAVE_OPENPTY)
+ set(UTIL_LIBRARY util)
+endif (HAVE_OPENPTY)
+
# it seems this isn't used anywhere
#find_library(ICE_LIB NAMES ICE PATHS /usr/X11/lib)
#check_library_exists($ _IceTransNoListen
"" HAVE__ICETRANSNOLISTEN)
--- trunk/KDE/kdelibs/config.h.cmake #501411:501412
 -176,6
+176,7 
#cmakedefine HAVE_NETINET_IN_H
#cmakedefine HAVE_NL_TYPES_H
#cmakedefine HAVE_PATHS_H
+#cmakedefine HAVE_PTHREAD_NP_H
#cmakedefine HAVE_PUNYCODE_H
#cmakedefine HAVE_PTY_H
#cmakedefine HAVE_STRINGPREP_H
 -283,7
+284,7 
#cmakedefine HAVE___ARGZ_STRINGIFY
/* this one seems to be unused:
-#cmakedefine HAVE__ICETRANSNOLISTEN
+cmakedefine HAVE__ICETRANSNOLISTEN
*/
--- trunk/KDE/kdelibs/kjs/collector.cpp #501411:501412
 -46,8
+46,14 
#include <pthread.h>
+#ifdef HAVE_PTHREAD_NP_H
+
+#include <pthread_np.h>
+
#endif
+#endif
+
using std::max;
namespace KJS {
 -310,8
+316,13 
pthread_t curThread = pthread_self();
if (stackBase == 0 || curThread != stackThread) {
pthread_attr_t sattr;
+#ifdef HAVE_PTHREAD_NP_H
+ // e.g. on FreeBSD 5.4, neundorf kde.org
+ pthread_attr_get_np(curThread, &sattr);
+#else
// FIXME: this function is non-portable; other
POSIX systems may have different np alternatives
pthread_getattr_np(curThread, &sattr);
+#endif
// Should work but fails on Linux (?)
// pthread_attr_getstack(&sattr,
&stackBase, &stackSize);
pthread_attr_getstackaddr(&sattr,
&stackBase);
|