2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $TOG: tt_options.h /main/11 1998/04/03 17:09:46 mgreess $
25 * (c) Copyright 1996 Digital Equipment Corporation.
26 * (c) Copyright 1993, 1994, 1996 Hewlett-Packard Company.
27 * (c) Copyright 1993, 1994, 1996 International Business Machines Corp.
28 * (c) Copyright 1990, 1993, 1994, 1996 Sun Microsystems, Inc.
29 * (c) Copyright 1993, 1994, 1996 Novell, Inc.
30 * (c) Copyright 1996 FUJITSU LIMITED.
31 * (c) Copyright 1996 Hitachi.
37 * This file controls any compilation-time options. The current set of
40 * OPT_UNIX_SOCKET_RPC -- if defined then code to do rpc over unix
41 * sockets is enabled (speeds up intra-system rpcs).
43 * OPT_TLI -- if defined then rpc code is compiled for the new
44 * transport-independent rpc
46 * OPT_DLOPEN_X11 -- if defined then any code that would use libX11 will
47 * attempt to dlopen it at runtime rather than require
48 * the application to link with the library.
50 * OPT_DLOPEN_CE -- if defined then any code that would use libce will
51 * attempt to dlopen it at runtime rather than require
52 * the application to link with the library.
54 * OPT_ADDMSG_DIRECT -- if defined then messages are sent directly
55 * down a client's signalling fd rather than
56 * incurring an additional rpc.
58 * OPT_SECURE_RPC -- if defined then code for implementing DES authorization
61 * OPT_CLASSING_ENGINE -- if defined, code is included to store and
62 * retrieve type data in the OpenWindows Classing
63 * Engine. If not defined, type data is stored
64 * only in XDR format files.
66 * OPT_PATCH -- if defined, build patch info into objects
68 * OPT_BUG_SUNOS_4 -- used to flag special hacks only needed because
69 * of bugs or quirks in SunOS 4.x.
71 * OPT_BUG_SUNOS_5 -- used to flag special hacks only needed because
72 * of bugs or quirks in SunOS 5.x.
74 * OPT_BUG_HPUX -- used to flag special hacks only needed because
75 * of bugs or quirks in HP-UX.
77 * OPT_BUG_RPCINTR -- used to flag that RPC_INTR is not defined
80 * OPT_BUG_SGI -- used to flag special hacks only needed because of
81 * bugs or quirks in SGI IRIX.
83 * OPT_XDR_LONG_TYPE -- used for (64-bit) architectures where
84 * <rcp/xdr.h> defines x_putlong and x_getlong to not take "long*".
86 * OPT_POSIX_SIGNAL -- set to assume posix-style sigaction() call.
87 * OPT_BSD_SIGNAL -- set to assume bsd-style signal() call.
88 * If *neither* OPT_POSIX_SIGNAL or OPT_BSD_SIGNAL is defined, use
89 * the old SVR2-style sigset().
91 * OPT_BSD_WAIT -- set to assume bsd-style wait() calls, which expect
92 * a "union wait" instead of an int, and to not use waitpid().
94 * OPT_DGETTEXT -- set to use SVR4-style internationalization calls.
96 * OPT_CATGETS -- set to use XPG4-style internationalization calls.
98 * OPT_GETDTABLESIZE - use getdtablesize() instead of getrlimit to get
99 * file descriptor limit.
101 * OPT_GETHOSTNAME - use gethostname() instead of uname() to get host name
103 * OPT_SYSINFO - use sysinfo() instead of gethostid() or uname() to get host id
105 * OPT_CPP_PATH - string, path to cpp binary so tt_type_comp can invoke it
107 * OPT_CPP_OPTIONS - string, options to pass to cpp. For example, on
108 * some platforms -B is used so C++ comments are processed by cpp.
111 * OPT_STRERROR - set if strerror() is available, otherwise we assume
112 * global symbol sys_errlist is defined in errno.h.
114 * OPT_SVR4_GETMNTENT - set to use new SVR4 flavor of getmntent.
116 * OPT_LOCKF_MNTTAB - set to hold a lockf lock on MNTTAB while doing
119 * OPT_LOCAL_MOUNT_TYPE -- mount type in mntent for local disks.
121 * OPT_DEFINE_SIG_PF - define if SIG_PF (=type of pointer to signal
122 * handler function) isn't defined in system includes
124 * OPT_TAR_HAS_EXCLUDE_OPTION -- set if the system tar command has the X
125 * option for excluding files, which tttar uses to avoid extracting the
126 * extra file it bundles into the tar file. If this option is not available,
127 * the tttarfile file will appear after extracts, a small flaw but not a
130 * OPT_HAS_REALPATH -- set if the system provides a realpath() library
131 * function; otherwise we'll use our local copy.
133 * OPT_PING_TRIES - The number of times to rpc-ping ttsession to
134 * see if ttsession is alive.
136 * OPT_PING_SLEEP - How long to wait between each rpc-ping of ttsession.
138 * OPT_AUTOMOUNT_PATH_FIX - set for systems with autmounters that do
139 * not treat /tmp_mnt/nfs/... the same as /nfs/... in terms of which
140 * can tickle the automounter. For many systems, a mount can only be
141 * tickled into existence using /nfs/... This is bad since calls to
142 * say realpath() will hand back /tmp_mnt/nfs/... which is for all
143 * practical purposes temporary.
145 * OPT_SOLARIS_THREADS - Defined if the system supports SOLARIS style threads.
146 * (POSIX threads were not out at time of usage)
148 * OPT_XTHREADS - Defined if the system supports the Xthreads interfaces
149 * defined first in X11R6
151 * OPT_SOLARIS_THREADED_TRIES - How many times to try thr_create() if
152 * thr_create() returns EAGAIN.
154 * OPT_MAX_GET_SESSIONS - The max. number of session id's to return
155 * in each call to _tt_get_all_sessions_1().
157 * OPT_HAS_CLNT_CREATE_TIMED - True if the OS has the clnt_create_timed()
160 * OPT_CLNT_CREATE_TIMEOUT - Time for clnt_create_timed() to wait
163 * OPT_DO_AUTO_GARBAGE_COLLECT - Perform automatic garbage collection.
164 * Without this defined, garbage collection must
165 * be called from an rpc call. This is not should
166 * not be enabled until the rpc.ttdbserverd catches
167 * SIG{INT,TERM,...}, so that it will clean up the
168 * files prior to exiting.
170 * OPT_GARBAGE_IN_PARALLEL - If TRUE, enables garbage collection
171 * in a separate thread (or process). If FALSE
172 * perform garbage collection in the same
173 * thread (or process).
177 * Defaults - #undef then #define them if a platform needs them changed.
179 #define OPT_PING_TRIES 5
180 #define OPT_PING_SLEEP 1
181 #define OPT_MAX_GET_SESSIONS 100
182 #define OPT_GARBAGE_IN_PARALLEL 0 /* used as a const */
184 /* Allow -DXTHREADS to be specified by the Makefile. */
186 # define OPT_XTHREADS 1
189 #undef OPT_DO_AUTO_GARBAGE_COLLECT
192 * WARNING: This file isn't universally included. Adding a new option
193 * entails ensuring that this file is properly included in all the files
194 * that depend on that option. This is done to minimize re-compile time
195 * every time options are changed.
197 #if defined(__GNUG__)
198 /* g++ often cannot see an implicit cast to char */
199 # define GNU_STRCAST (char *)
205 * To avoid ugly cpp command-line options, we instead centralize
206 * in the following code all knowledge about deducing the OS version
207 * from the definitions cpp gives us.
210 # if !defined(OS_VERSION)
211 # if defined(OSMajorVersion)
212 # define OS_VERSION OSMajorVersion
213 # define OS_MINOR_VERSION OSMinorVersion
215 # if !defined(_STDIO_H) && !defined(__stdio_h)
218 # if defined(_SIZE_T)
219 # define OS_VERSION 5
221 # define OS_VERSION 4
228 # undef OPT_UNIX_SOCKET_RPC
230 # undef OPT_DLOPEN_X11
231 # undef OPT_DLOPEN_CE
232 # undef OPT_ADDMSG_DIRECT
234 # undef OPT_SECURE_RPC
235 # undef OPT_CLASSING_ENGINE
236 # undef OPT_BSD_SIGNAL
237 # define OPT_POSIX_SIGNAL
241 # define OPT_GETDTABLESIZE
243 # define OPT_CPP_PATH "/usr/ccs/lib/cpp"
244 # define OPT_CPP_OPTIONS ""
245 # define OPT_STRERROR
246 # undef OPT_SVR4_GETMNTENT
247 # undef OPT_LOCKF_MNTENT
248 # define OPT_DEFINE_SIG_PF
249 # undef OPT_TAR_HAS_EXCLUDE_OPTION
250 # undef OPT_HAS_REALPATH
251 # define OPT_AUTOMOUNT_PATH_FIX
252 /* # define OPT_XTHREADS 1 */ /* Defaulted by -DXTHREADS */
254 #elif defined(sun) && (OS_VERSION <= 4)
256 # define OPT_UNIX_SOCKET_RPC
258 /* for 4.1.1 systems turning on any dlopen features on the */
259 /* client side would break clients with ld errors unless they */
260 /* linked with -ldl. OPT_DLOPEN_CE is ok since clients don't */
261 /* ever execute ce_* functions. */
262 # undef OPT_DLOPEN_X11
263 # undef OPT_DLOPEN_CE
264 # undef OPT_ADDMSG_DIRECT
265 # define OPT_SECURE_RPC
266 # undef OPT_CLASSING_ENGINE
268 # define OPT_BSD_SIGNAL
269 # define OPT_BSD_WAIT
270 # define OPT_DGETTEXT
272 # undef OPT_GETDTABLESIZE
274 # define OPT_CPP_PATH "/usr/lib/cpp"
275 # define OPT_CPP_OPTIONS "-B"
277 # undef OPT_SVR4_GETMNTENT
278 # undef OPT_LOCKF_MNTENT
279 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_42
281 # undef OPT_DEFINE_SIG_PF
282 # define OPT_TAR_HAS_EXCLUDE_OPTION
284 # define OPT_BUG_SUNOS_4
286 # define OPT_HAS_REALPATH
287 # undef OPT_AUTOMOUNT_PATH_FIX
289 #elif defined(sun) && (OS_VERSION >= 5)
291 # undef OPT_UNIX_SOCKET_RPC
293 # undef OPT_DLOPEN_X11
294 # undef OPT_DLOPEN_CE
295 # undef OPT_ADDMSG_DIRECT
296 # define OPT_SECURE_RPC
297 # undef OPT_CLASSING_ENGINE
298 # undef OPT_BSD_SIGNAL
299 # define OPT_POSIX_SIGNAL
303 # undef OPT_GETDTABLESIZE
305 # define OPT_STRERROR
306 # define OPT_CPP_PATH "/usr/ccs/lib/cpp"
307 # define OPT_CPP_OPTIONS "-B"
308 # define OPT_SVR4_GETMNTENT
309 # define OPT_LOCKF_MNTENT
310 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
311 # undef OPT_DEFINE_SIG_PF
312 # define OPT_TAR_HAS_EXCLUDE_OPTION
314 # define OPT_HAS_REALPATH
315 # undef OPT_AUTOMOUNT_PATH_FIX
317 /* Does not work on X86 */
318 # if defined(i386) && OS_MINOR_VERSION <= 4
319 # undef OPT_GARBAGE_THREADS
320 # undef OPT_SOLARIS_THREADED_TRIES
322 # define OPT_SOLARIS_THREADS 1
323 /* # define OPT_XTHREADS 1 */ /* Defaulted by -DXTHREADS */
324 # define OPT_GARBAGE_THREADS 1
325 # define OPT_SOLARIS_THREADED_TRIES 10
328 /* Solaris 2.5 and above, supports clnt_create_timed(3N) */
329 # if (OS_MINOR_VERSION >= 5)
330 # define OPT_HAS_CLNT_CREATE_TIMED 1
331 # define OPT_CLNT_CREATE_TIMEOUT 30
334 /* TURN THESE OFF FOR NOW */
335 # undef OPT_GARBAGE_IN_PARALLEL
336 # undef OPT_GARBAGE_THREADS
338 /* Turn ON/OFF parallel threads for garbage collection */
339 # if defined(OPT_DO_AUTO_GARBAGE_COLLECT) && defined(OPT_SOLARIS_THREADS)
340 # define OPT_GARBAGE_IN_PARALLEL 1
341 # define OPT_GARBAGE_THREADS 1
343 # define OPT_GARBAGE_IN_PARALLEL 0 /* used as a const */
344 # undef OPT_GARBAGE_THREADS
348 /* these are probably way obsolete now that irix is svr4 based */
349 # define OPT_UNIX_SOCKET_RPC
351 # undef OPT_DLOPEN_X11
352 # undef OPT_DLOPEN_CE
353 # undef OPT_ADDMSG_DIRECT
354 # undef OPT_SECURE_RPC
355 # undef OPT_CLASSING_ENGINE
356 # define OPT_TAR_HAS_EXCLUDE_OPTION
358 #elif defined(__hpux) || defined(hpux)
360 # undef OPT_UNIX_SOCKET_RPC
362 # undef OPT_DLOPEN_X11
363 # undef OPT_DLOPEN_CE
364 # undef OPT_ADDMSG_DIRECT
365 # define OPT_BUG_HPUX
366 # undef OPT_SECURE_RPC
367 # undef OPT_CLASSING_ENGINE
368 # undef OPT_BSD_SIGNAL
369 # define OPT_POSIX_SIGNAL
373 # undef OPT_GETDTABLESIZE
375 # define OPT_HAS_REALPATH
376 # define OPT_AUTOMOUNT_PATH_FIX
378 * re-define these. HP-UX does not seem to want to wake up a swapped
379 * process. The timeouts have to be increased so that HP-UX has time
380 * to swap in ttsession (if it is out).
382 # undef OPT_PING_TRIES
383 # define OPT_PING_TRIES 10
384 # undef OPT_PING_SLEEP
385 # define OPT_PING_SLEEP 2
386 # if OSMAJORVERSION < 10
387 # define OPT_CPP_PATH "/lib/cpp"
389 # define OPT_CPP_PATH "/opt/langtools/lbin/cpp"
391 # define OPT_CPP_OPTIONS ""
392 # define OPT_STRERROR
393 # undef OPT_SVR4_GETMNTENT
394 # undef OPT_LOCKF_MNTENT
395 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_HFS
396 # define OPT_DEFINE_SIG_PF
397 # undef OPT_TAR_HAS_EXCLUDE_OPTION
398 # define OPT_BUG_RPCINTR
400 #elif defined(__linux__)
402 # undef OPT_UNIX_SOCKET_RPC
404 # undef OPT_DLOPEN_X11
405 # undef OPT_DLOPEN_CE
406 # undef OPT_ADDMSG_DIRECT
407 # undef OPT_SECURE_RPC
408 # undef OPT_CLASSING_ENGINE
410 # define OPT_POSIX_SIGNAL
414 # undef OPT_GETDTABLESIZE
416 # define OPT_CPP_PATH "/usr/bin/cpp"
417 # define OPT_CPP_OPTIONS ""
418 # define OPT_STRERROR
419 # undef OPT_SVR4_GETMNTENT
420 # undef OPT_LOCKF_MNTENT
421 # define OPT_LOCAL_MOUNT_TYPE "ext2fs"
423 # define OPT_DEFINE_SIG_PF
424 # define OPT_TAR_HAS_EXCLUDE_OPTION
425 # define OPT_HAS_REALPATH
426 # define OPT_AUTOMOUNT_PATH_FIX
427 # define OPT_BUG_RPCINTR
429 # define OPT_CONST_CORRECT
431 #elif defined(__OpenBSD__)
433 # undef OPT_UNIX_SOCKET_RPC
435 # undef OPT_DLOPEN_X11
436 # undef OPT_DLOPEN_CE
437 # undef OPT_ADDMSG_DIRECT
438 # undef OPT_SECURE_RPC
439 # undef OPT_CLASSING_ENGINE
441 # define OPT_POSIX_SIGNAL
445 # undef OPT_GETDTABLESIZE
447 # define OPT_CPP_PATH "/usr/libexec/cpp"
448 # define OPT_CPP_OPTIONS ""
449 # define OPT_STRERROR
450 # undef OPT_SVR4_GETMNTENT
451 # undef OPT_LOCKF_MNTENT
452 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
454 # define OPT_DEFINE_SIG_PF
455 # define OPT_TAR_HAS_EXCLUDE_OPTION
456 # define OPT_HAS_REALPATH
457 # define OPT_AUTOMOUNT_PATH_FIX
458 # define OPT_BUG_RPCINTR
461 #elif defined(__FreeBSD__)
462 # undef OPT_UNIX_SOCKET_RPC
464 # undef OPT_DLOPEN_X11
465 # undef OPT_DLOPEN_CE
466 # undef OPT_ADDMSG_DIRECT
467 # undef OPT_SECURE_RPC
468 # undef OPT_CLASSING_ENGINE
470 # define OPT_POSIX_SIGNAL
474 # undef OPT_GETDTABLESIZE
476 # if defined(OSMAJORVERSION) && (OSMAJORVERSION >= 5)
477 # define OPT_CPP_PATH "/usr/bin/cpp"
479 # define OPT_CPP_PATH "/usr/libexec/cpp"
481 # define OPT_CPP_OPTIONS ""
482 # define OPT_STRERROR
483 # undef OPT_SVR4_GETMNTENT
484 # undef OPT_LOCKF_MNTENT
485 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
487 # define OPT_DEFINE_SIG_PF
488 # define OPT_TAR_HAS_EXCLUDE_OPTION
489 # define OPT_HAS_REALPATH
490 # define OPT_AUTOMOUNT_PATH_FIX
491 # define OPT_BUG_RPCINTR
493 # define OPT_CONST_CORRECT
495 #elif defined(__NetBSD__)
496 # undef OPT_UNIX_SOCKET_RPC
498 # undef OPT_DLOPEN_X11
499 # undef OPT_DLOPEN_CE
500 # undef OPT_ADDMSG_DIRECT
501 # undef OPT_SECURE_RPC
502 # undef OPT_CLASSING_ENGINE
504 # define OPT_POSIX_SIGNAL
508 # undef OPT_GETDTABLESIZE
510 # define OPT_CPP_PATH "/usr/bin/cpp"
511 # define OPT_CPP_OPTIONS ""
512 # define OPT_STRERROR
513 # undef OPT_SVR4_GETMNTENT
514 # undef OPT_LOCKF_MNTENT
515 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
517 # define OPT_DEFINE_SIG_PF
518 # define OPT_TAR_HAS_EXCLUDE_OPTION
519 # define OPT_HAS_REALPATH
520 # define OPT_AUTOMOUNT_PATH_FIX
521 # define OPT_BUG_RPCINTR
523 # define OPT_CONST_CORRECT
527 /* Unknown configuration, complain */
528 }}}} You must edit lib/tt_options.h and add a section defining the options for your configuration.
534 # define OPT_CPP_PATH CPP_PROGRAM
537 #endif /* _TT_OPTIONS_H */