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_BUG_USL -- used to flag special hacks only needed because of
84 * bugs or quirks in UnixWare, etc.
86 * OPT_XDR_LONG_TYPE -- used for (64-bit) architectures where
87 * <rcp/xdr.h> defines x_putlong and x_getlong to not take "long*".
89 * OPT_POSIX_SIGNAL -- set to assume posix-style sigaction() call.
90 * OPT_BSD_SIGNAL -- set to assume bsd-style signal() call.
91 * If *neither* OPT_POSIX_SIGNAL or OPT_BSD_SIGNAL is defined, use
92 * the old SVR2-style sigset().
94 * OPT_BSD_WAIT -- set to assume bsd-style wait() calls, which expect
95 * a "union wait" instead of an int, and to not use waitpid().
97 * OPT_DGETTEXT -- set to use SVR4-style internationalization calls.
99 * OPT_CATGETS -- set to use XPG4-style internationalization calls.
101 * OPT_GETDTABLESIZE - use getdtablesize() instead of getrlimit to get
102 * file descriptor limit.
104 * OPT_GETHOSTNAME - use gethostname() instead of uname() to get host name
106 * OPT_SYSINFO - use sysinfo() instead of gethostid() or uname() to get host id
108 * OPT_CPP_PATH - string, path to cpp binary so tt_type_comp can invoke it
110 * OPT_CPP_OPTIONS - string, options to pass to cpp. For example, on
111 * some platforms -B is used so C++ comments are processed by cpp.
114 * OPT_STRERROR - set if strerror() is available, otherwise we assume
115 * global symbol sys_errlist is defined in errno.h.
117 * OPT_SVR4_GETMNTENT - set to use new SVR4 flavor of getmntent.
119 * OPT_LOCKF_MNTTAB - set to hold a lockf lock on MNTTAB while doing
122 * OPT_LOCAL_MOUNT_TYPE -- mount type in mntent for local disks.
124 * OPT_DEFINE_SIG_PF - define if SIG_PF (=type of pointer to signal
125 * handler function) isn't defined in system includes
127 * OPT_TAR_HAS_EXCLUDE_OPTION -- set if the system tar command has the X
128 * option for excluding files, which tttar uses to avoid extracting the
129 * extra file it bundles into the tar file. If this option is not available,
130 * the tttarfile file will appear after extracts, a small flaw but not a
133 * OPT_HAS_REALPATH -- set if the system provides a realpath() library
134 * function; otherwise we'll use our local copy.
136 * OPT_PING_TRIES - The number of times to rpc-ping ttsession to
137 * see if ttsession is alive.
139 * OPT_PING_SLEEP - How long to wait between each rpc-ping of ttsession.
141 * OPT_AUTOMOUNT_PATH_FIX - set for systems with autmounters that do
142 * not treat /tmp_mnt/nfs/... the same as /nfs/... in terms of which
143 * can tickle the automounter. For many systems, a mount can only be
144 * tickled into existence using /nfs/... This is bad since calls to
145 * say realpath() will hand back /tmp_mnt/nfs/... which is for all
146 * practical purposes temporary.
148 * OPT_SOLARIS_THREADS - Defined if the system supports SOLARIS style threads.
149 * (POSIX threads were not out at time of usage)
151 * OPT_XTHREADS - Defined if the system supports the Xthreads interfaces
152 * defined first in X11R6
154 * OPT_SOLARIS_THREADED_TRIES - How many times to try thr_create() if
155 * thr_create() returns EAGAIN.
157 * OPT_MAX_GET_SESSIONS - The max. number of session id's to return
158 * in each call to _tt_get_all_sessions_1().
160 * OPT_HAS_CLNT_CREATE_TIMED - True if the OS has the clnt_create_timed()
163 * OPT_CLNT_CREATE_TIMEOUT - Time for clnt_create_timed() to wait
166 * OPT_DO_AUTO_GARBAGE_COLLECT - Perform automatic garbage collection.
167 * Without this defined, garbage collection must
168 * be called from an rpc call. This is not should
169 * not be enabled until the rpc.ttdbserverd catches
170 * SIG{INT,TERM,...}, so that it will clean up the
171 * files prior to exiting.
173 * OPT_GARBAGE_IN_PARALLEL - If TRUE, enables garbage collection
174 * in a separate thread (or process). If FALSE
175 * perform garbage collection in the same
176 * thread (or process).
180 * Defaults - #undef then #define them if a platform needs them changed.
182 #define OPT_PING_TRIES 5
183 #define OPT_PING_SLEEP 1
184 #define OPT_MAX_GET_SESSIONS 100
185 #define OPT_GARBAGE_IN_PARALLEL 0 /* used as a const */
187 /* Allow -DXTHREADS to be specified by the Makefile. */
189 # define OPT_XTHREADS 1
192 #undef OPT_DO_AUTO_GARBAGE_COLLECT
195 * WARNING: This file isn't universally included. Adding a new option
196 * entails ensuring that this file is properly included in all the files
197 * that depend on that option. This is done to minimize re-compile time
198 * every time options are changed.
200 #if defined(__GNUG__)
201 /* g++ often cannot see an implicit cast to char */
202 # define GNU_STRCAST (char *)
208 * To avoid ugly cpp command-line options, we instead centralize
209 * in the following code all knowledge about deducing the OS version
210 * from the definitions cpp gives us.
213 # if !defined(OS_VERSION)
214 # if defined(OSMajorVersion)
215 # define OS_VERSION OSMajorVersion
216 # define OS_MINOR_VERSION OSMinorVersion
218 # if !defined(_STDIO_H) && !defined(__stdio_h)
221 # if defined(_SIZE_T)
222 # define OS_VERSION 5
224 # define OS_VERSION 4
231 # undef OPT_UNIX_SOCKET_RPC
233 # undef OPT_DLOPEN_X11
234 # undef OPT_DLOPEN_CE
235 # undef OPT_ADDMSG_DIRECT
237 # undef OPT_SECURE_RPC
238 # undef OPT_CLASSING_ENGINE
239 # undef OPT_BSD_SIGNAL
240 # define OPT_POSIX_SIGNAL
244 # define OPT_GETDTABLESIZE
246 # define OPT_CPP_PATH "/usr/ccs/lib/cpp"
247 # define OPT_CPP_OPTIONS ""
248 # define OPT_STRERROR
249 # undef OPT_SVR4_GETMNTENT
250 # undef OPT_LOCKF_MNTENT
251 # define OPT_DEFINE_SIG_PF
252 # undef OPT_TAR_HAS_EXCLUDE_OPTION
253 # undef OPT_HAS_REALPATH
254 # define OPT_AUTOMOUNT_PATH_FIX
255 /* # define OPT_XTHREADS 1 */ /* Defaulted by -DXTHREADS */
257 #elif defined(sun) && (OS_VERSION <= 4)
259 # define OPT_UNIX_SOCKET_RPC
261 /* for 4.1.1 systems turning on any dlopen features on the */
262 /* client side would break clients with ld errors unless they */
263 /* linked with -ldl. OPT_DLOPEN_CE is ok since clients don't */
264 /* ever execute ce_* functions. */
265 # undef OPT_DLOPEN_X11
266 # undef OPT_DLOPEN_CE
267 # undef OPT_ADDMSG_DIRECT
268 # define OPT_SECURE_RPC
269 # undef OPT_CLASSING_ENGINE
271 # define OPT_BSD_SIGNAL
272 # define OPT_BSD_WAIT
273 # define OPT_DGETTEXT
275 # undef OPT_GETDTABLESIZE
277 # define OPT_CPP_PATH "/usr/lib/cpp"
278 # define OPT_CPP_OPTIONS "-B"
280 # undef OPT_SVR4_GETMNTENT
281 # undef OPT_LOCKF_MNTENT
282 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_42
284 # undef OPT_DEFINE_SIG_PF
285 # define OPT_TAR_HAS_EXCLUDE_OPTION
287 # define OPT_BUG_SUNOS_4
289 # define OPT_HAS_REALPATH
290 # undef OPT_AUTOMOUNT_PATH_FIX
292 #elif defined(sun) && (OS_VERSION >= 5)
294 # undef OPT_UNIX_SOCKET_RPC
296 # undef OPT_DLOPEN_X11
297 # undef OPT_DLOPEN_CE
298 # undef OPT_ADDMSG_DIRECT
299 # define OPT_SECURE_RPC
300 # undef OPT_CLASSING_ENGINE
301 # undef OPT_BSD_SIGNAL
302 # define OPT_POSIX_SIGNAL
306 # undef OPT_GETDTABLESIZE
308 # define OPT_STRERROR
309 # define OPT_CPP_PATH "/usr/ccs/lib/cpp"
310 # define OPT_CPP_OPTIONS "-B"
311 # define OPT_SVR4_GETMNTENT
312 # define OPT_LOCKF_MNTENT
313 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
314 # undef OPT_DEFINE_SIG_PF
315 # define OPT_TAR_HAS_EXCLUDE_OPTION
317 # define OPT_HAS_REALPATH
318 # undef OPT_AUTOMOUNT_PATH_FIX
320 /* Does not work on X86 */
321 # if defined(i386) && OS_MINOR_VERSION <= 4
322 # undef OPT_GARBAGE_THREADS
323 # undef OPT_SOLARIS_THREADED_TRIES
325 # define OPT_SOLARIS_THREADS 1
326 /* # define OPT_XTHREADS 1 */ /* Defaulted by -DXTHREADS */
327 # define OPT_GARBAGE_THREADS 1
328 # define OPT_SOLARIS_THREADED_TRIES 10
331 /* Solaris 2.5 and above, supports clnt_create_timed(3N) */
332 # if (OS_MINOR_VERSION >= 5)
333 # define OPT_HAS_CLNT_CREATE_TIMED 1
334 # define OPT_CLNT_CREATE_TIMEOUT 30
337 /* TURN THESE OFF FOR NOW */
338 # undef OPT_GARBAGE_IN_PARALLEL
339 # undef OPT_GARBAGE_THREADS
341 /* Turn ON/OFF parallel threads for garbage collection */
342 # if defined(OPT_DO_AUTO_GARBAGE_COLLECT) && defined(OPT_SOLARIS_THREADS)
343 # define OPT_GARBAGE_IN_PARALLEL 1
344 # define OPT_GARBAGE_THREADS 1
346 # define OPT_GARBAGE_IN_PARALLEL 0 /* used as a const */
347 # undef OPT_GARBAGE_THREADS
351 /* these are probably way obsolete now that irix is svr4 based */
352 # define OPT_UNIX_SOCKET_RPC
354 # undef OPT_DLOPEN_X11
355 # undef OPT_DLOPEN_CE
356 # undef OPT_ADDMSG_DIRECT
357 # undef OPT_SECURE_RPC
358 # undef OPT_CLASSING_ENGINE
359 # define OPT_TAR_HAS_EXCLUDE_OPTION
361 #elif defined(ultrix)
363 # undef OPT_UNIX_SOCKET_RPC
365 # undef OPT_DLOPEN_X11
366 # undef OPT_DLOPEN_CE
367 # undef OPT_ADDMSG_DIRECT
368 # undef OPT_SECURE_RPC
369 # undef OPT_CLASSING_ENGINE
370 # undef OPT_TAR_HAS_EXCLUDE_OPTION
372 #elif defined(__hpux) || defined(hpux)
374 # undef OPT_UNIX_SOCKET_RPC
376 # undef OPT_DLOPEN_X11
377 # undef OPT_DLOPEN_CE
378 # undef OPT_ADDMSG_DIRECT
379 # define OPT_BUG_HPUX
380 # undef OPT_SECURE_RPC
381 # undef OPT_CLASSING_ENGINE
382 # undef OPT_BSD_SIGNAL
383 # define OPT_POSIX_SIGNAL
387 # undef OPT_GETDTABLESIZE
389 # define OPT_HAS_REALPATH
390 # define OPT_AUTOMOUNT_PATH_FIX
392 * re-define these. HP-UX does not seem to want to wake up a swapped
393 * process. The timeouts have to be increased so that HP-UX has time
394 * to swap in ttsession (if it is out).
396 # undef OPT_PING_TRIES
397 # define OPT_PING_TRIES 10
398 # undef OPT_PING_SLEEP
399 # define OPT_PING_SLEEP 2
400 # if OSMAJORVERSION < 10
401 # define OPT_CPP_PATH "/lib/cpp"
403 # define OPT_CPP_PATH "/opt/langtools/lbin/cpp"
405 # define OPT_CPP_OPTIONS ""
406 # define OPT_STRERROR
407 # undef OPT_SVR4_GETMNTENT
408 # undef OPT_LOCKF_MNTENT
409 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_HFS
410 # define OPT_DEFINE_SIG_PF
411 # undef OPT_TAR_HAS_EXCLUDE_OPTION
412 # define OPT_BUG_RPCINTR
415 # if !defined(__STDIO_H)
418 # undef OPT_UNIX_SOCKET_RPC
420 # if defined(PROF) /* can't use dlopen if profiling. */
421 # undef OPT_DLOPEN_X11
422 # undef OPT_DLOPEN_CE
424 # define OPT_DLOPEN_X11
425 # define OPT_DLOPEN_CE
427 # undef OPT_ADDMSG_DIRECT
428 # undef OPT_SECURE_RPC
429 # undef OPT_CLASSING_ENGINE
430 # undef OPT_BSD_SIGNAL
431 # define OPT_POSIX_SIGNAL
435 # undef OPT_GETDTABLESIZE
437 # define OPT_STRERROR
438 # define OPT_CPP_PATH "/usr/ccs/lib/cpp"
439 # define OPT_CPP_OPTIONS ""
440 # define OPT_SVR4_GETMNTENT
441 /* the reason for locking MNTENT is to sync with the Solaris automounter,
442 * which doesn't apply on UnixWare. It probably wouldn't hurt to
443 * do the lockf there, but things seem to be working without it...
445 # undef OPT_LOCKF_MNTENT
447 # if defined(OSMAJORVERSION) && (OSMAJORVERSION > 1)
448 # define OPT_BUG_UW_2
450 # define OPT_BUG_UW_1
452 # define OPT_LOCAL_MOUNT_TYPE "vxfs"
453 # define OPT_DEFINE_SIG_PF
454 # define OPT_TAR_HAS_EXCLUDE_OPTION
455 # define OPT_HAS_REALPATH
457 #elif defined(__osf__)
458 # define OPT_UNIX_SOCKET_RPC
460 # undef OPT_DLOPEN_X11
461 # undef OPT_DLOPEN_CE
462 # undef OPT_ADDMSG_DIRECT
463 # undef OPT_SECURE_RPC
464 # undef OPT_CLASSING_ENGINE
465 # undef OPT_BSD_SIGNAL
466 # define OPT_POSIX_SIGNAL
471 # undef OPT_GETDTABLESIZE
473 # define OPT_CPP_PATH "/usr/ccs/lib/cpp"
474 # define OPT_CPP_OPTIONS ""
475 # define OPT_STRERROR
476 # undef OPT_SVR4_GETMNTENT
477 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
478 # define OPT_DEFINE_SIG_PF
479 # undef OPT_TAR_HAS_EXCLUDE_OPTION
480 # undef OPT_HAS_REALPATH
481 # if defined(OSMAJORVERSION) && (OSMAJORVERSION >= 4)
482 # define OPT_XDR_LONG_TYPE int
487 # undef OPT_UNIX_SOCKET_RPC
489 # undef OPT_DLOPEN_X11
490 # undef OPT_DLOPEN_CE
491 # undef OPT_ADDMSG_DIRECT
492 # undef OPT_SECURE_RPC
493 # undef OPT_CLASSING_ENGINE
495 # define OPT_POSIX_SIGNAL
499 # undef OPT_GETDTABLESIZE
501 # define OPT_CPP_PATH "/usr/bin/cpp"
502 # define OPT_CPP_OPTIONS ""
503 # define OPT_STRERROR
504 # undef OPT_SVR4_GETMNTENT
505 # undef OPT_LOCKF_MNTENT
506 # define OPT_LOCAL_MOUNT_TYPE "ext2fs"
508 # define OPT_DEFINE_SIG_PF
509 # define OPT_TAR_HAS_EXCLUDE_OPTION
510 # define OPT_HAS_REALPATH
511 # define OPT_AUTOMOUNT_PATH_FIX
512 # define OPT_BUG_RPCINTR
514 # define OPT_CONST_CORRECT
516 #elif defined(__OpenBSD__)
518 # undef OPT_UNIX_SOCKET_RPC
520 # undef OPT_DLOPEN_X11
521 # undef OPT_DLOPEN_CE
522 # undef OPT_ADDMSG_DIRECT
523 # undef OPT_SECURE_RPC
524 # undef OPT_CLASSING_ENGINE
526 # define OPT_POSIX_SIGNAL
530 # undef OPT_GETDTABLESIZE
532 # define OPT_CPP_PATH "/usr/libexec/cpp"
533 # define OPT_CPP_OPTIONS ""
534 # define OPT_STRERROR
535 # undef OPT_SVR4_GETMNTENT
536 # undef OPT_LOCKF_MNTENT
537 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
539 # define OPT_DEFINE_SIG_PF
540 # define OPT_TAR_HAS_EXCLUDE_OPTION
541 # define OPT_HAS_REALPATH
542 # define OPT_AUTOMOUNT_PATH_FIX
543 # define OPT_BUG_RPCINTR
546 #elif defined(__FreeBSD__)
547 # undef OPT_UNIX_SOCKET_RPC
549 # undef OPT_DLOPEN_X11
550 # undef OPT_DLOPEN_CE
551 # undef OPT_ADDMSG_DIRECT
552 # undef OPT_SECURE_RPC
553 # undef OPT_CLASSING_ENGINE
555 # define OPT_POSIX_SIGNAL
559 # undef OPT_GETDTABLESIZE
561 # if defined(OSMAJORVERSION) && (OSMAJORVERSION >= 5)
562 # define OPT_CPP_PATH "/usr/bin/cpp"
564 # define OPT_CPP_PATH "/usr/libexec/cpp"
566 # define OPT_CPP_OPTIONS ""
567 # define OPT_STRERROR
568 # undef OPT_SVR4_GETMNTENT
569 # undef OPT_LOCKF_MNTENT
570 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
572 # define OPT_DEFINE_SIG_PF
573 # define OPT_TAR_HAS_EXCLUDE_OPTION
574 # define OPT_HAS_REALPATH
575 # define OPT_AUTOMOUNT_PATH_FIX
576 # define OPT_BUG_RPCINTR
578 # define OPT_CONST_CORRECT
580 #elif defined(__NetBSD__)
581 # undef OPT_UNIX_SOCKET_RPC
583 # undef OPT_DLOPEN_X11
584 # undef OPT_DLOPEN_CE
585 # undef OPT_ADDMSG_DIRECT
586 # undef OPT_SECURE_RPC
587 # undef OPT_CLASSING_ENGINE
589 # define OPT_POSIX_SIGNAL
593 # undef OPT_GETDTABLESIZE
595 # define OPT_CPP_PATH "/usr/bin/cpp"
596 # define OPT_CPP_OPTIONS ""
597 # define OPT_STRERROR
598 # undef OPT_SVR4_GETMNTENT
599 # undef OPT_LOCKF_MNTENT
600 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
602 # define OPT_DEFINE_SIG_PF
603 # define OPT_TAR_HAS_EXCLUDE_OPTION
604 # define OPT_HAS_REALPATH
605 # define OPT_AUTOMOUNT_PATH_FIX
606 # define OPT_BUG_RPCINTR
608 # define OPT_CONST_CORRECT
612 /* Unknown configuration, complain */
613 }}}} You must edit lib/tt_options.h and add a section defining the options for your configuration.
617 #endif /* _TT_OPTIONS_H */