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 librararies 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_UXP -- used to flag special hacks only needed because of
84 * bugs or quirks in Fujitsu's UXP.
86 * OPT_BUG_USL -- used to flag special hacks only needed because of
87 * bugs or quirks in UnixWare, etc.
89 * OPT_XDR_LONG_TYPE -- used for (64-bit) architectures where
90 * <rcp/xdr.h> defines x_putlong and x_getlong to not take "long*".
92 * OPT_POSIX_SIGNAL -- set to assume posix-style sigaction() call.
93 * OPT_BSD_SIGNAL -- set to assume bsd-style signal() call.
94 * If *neither* OPT_POSIX_SIGNAL or OPT_BSD_SIGNAL is defined, use
95 * the old SVR2-style sigset().
97 * OPT_BSD_WAIT -- set to assume bsd-style wait() calls, which expect
98 * a "union wait" instead of an int, and to not use waitpid().
100 * OPT_DGETTEXT -- set to use SVR4-style internationalization calls.
102 * OPT_CATGETS -- set to use XPG4-style internationalization calls.
104 * OPT_GETDTABLESIZE - use getdtablesize() instead of getrlimit to get
105 * file descriptor limit.
107 * OPT_GETHOSTNAME - use gethostname() instead of uname() to get host name
109 * OPT_SYSINFO - use sysinfo() instead of gethostid() or uname() to get host id
111 * OPT_CPP_PATH - string, path to cpp binary so tt_type_comp can invoke it
113 * OPT_CPP_OPTIONS - string, options to pass to cpp. For example, on
114 * some platforms -B is used so C++ comments are processed by cpp.
117 * OPT_STRERROR - set if strerror() is available, otherwise we assume
118 * global symbol sys_errlist is defined in errno.h.
120 * OPT_SVR4_GETMNTENT - set to use new SVR4 flavor of getmntent.
122 * OPT_LOCKF_MNTTAB - set to hold a lockf lock on MNTTAB while doing
125 * OPT_LOCAL_MOUNT_TYPE -- mount type in mntent for local disks.
127 * OPT_DEFINE_SIG_PF - define if SIG_PF (=type of pointer to signal
128 * handler function) isn't defined in system includes
130 * OPT_TAR_HAS_EXCLUDE_OPTION -- set if the system tar command has the X
131 * option for excluding files, which tttar uses to avoid extracting the
132 * extra file it bundles into the tar file. If this option is not available,
133 * the tttarfile file will appear after extracts, a small flaw but not a
136 * OPT_HAS_REALPATH -- set if the system provides a realpath() library
137 * function; otherwise we'll use our local copy.
139 * OPT_PING_TRIES - The number of times to rpc-ping ttsession to
140 * see if ttsession is alive.
142 * OPT_PING_SLEEP - How long to wait between each rpc-ping of ttsession.
144 * OPT_AUTOMOUNT_PATH_FIX - set for systems with autmounters that do
145 * not treat /tmp_mnt/nfs/... the same as /nfs/... in terms of which
146 * can tickle the automounter. For many systems, a mount can only be
147 * tickled into existance using /nfs/... This is bad since calls to
148 * say realpath() will hand back /tmp_mnt/nfs/... which is for all
149 * practical purposes temporary.
151 * OPT_SOLARIS_THREADS - Defined if the system supports SOLARIS style threads.
152 * (POSIX threads were not out at time of usage)
154 * OPT_XTHREADS - Defined if the system supports the Xthreads interfaces
155 * defined first in X11R6
157 * OPT_SOLARIS_THREADED_TRIES - How many times to try thr_create() if
158 * thr_create() returns EAGAIN.
160 * OPT_MAX_GET_SESSIONS - The max. number of session id's to return
161 * in each call to _tt_get_all_sessions_1().
163 * OPT_HAS_CLNT_CREATE_TIMED - True if the OS has the clnt_create_timed()
166 * OPT_CLNT_CREATE_TIMEOUT - Time for clnt_create_timed() to wait
169 * OPT_DO_AUTO_GARBAGE_COLLECT - Perform automatic garbage collection.
170 * Without this defined, garbage collection must
171 * be called from an rpc call. This is not should
172 * not be enabled until the rpc.ttdbserverd catches
173 * SIG{INT,TERM,...}, so that it will clean up the
174 * files prior to exiting.
176 * OPT_GARBAGE_IN_PARALLEL - If TRUE, enables garbage collection
177 * in a seperate thread (or process). If FALSE
178 * perform garbage collection in the same
179 * thread (or process).
183 * Defaults - #undef then #define them if a platform needs them changed.
185 #define OPT_PING_TRIES 5
186 #define OPT_PING_SLEEP 1
187 #define OPT_MAX_GET_SESSIONS 100
188 #define OPT_GARBAGE_IN_PARALLEL 0 /* used as a const */
190 /* Allow -DXTHREADS to be specified by the Makefile. */
192 # define OPT_XTHREADS 1
195 #undef OPT_DO_AUTO_GARBAGE_COLLECT
198 * WARNING: This file isn't universally included. Adding a new option
199 * entails ensuring that this file is properly included in all the files
200 * that depend on that option. This is done to minimize re-compile time
201 * every time options are changed.
203 #if defined(__GNUG__)
204 /* g++ often cannot see an implicit cast to char */
205 # define GNU_STRCAST (char *)
211 * To avoid ugly cpp command-line options, we instead centralize
212 * in the following code all knowledge about deducing the OS version
213 * from the definitions cpp gives us.
216 # if !defined(OS_VERSION)
217 # if defined(OSMajorVersion)
218 # define OS_VERSION OSMajorVersion
219 # define OS_MINOR_VERSION OSMinorVersion
221 # if !defined(_STDIO_H) && !defined(__stdio_h)
224 # if defined(_SIZE_T)
225 # define OS_VERSION 5
227 # define OS_VERSION 4
234 # undef OPT_UNIX_SOCKET_RPC
236 # undef OPT_DLOPEN_X11
237 # undef OPT_DLOPEN_CE
238 # undef OPT_ADDMSG_DIRECT
240 # undef OPT_SECURE_RPC
241 # undef OPT_CLASSING_ENGINE
242 # undef OPT_BSD_SIGNAL
243 # define OPT_POSIX_SIGNAL
247 # define OPT_GETDTABLESIZE
249 # define OPT_CPP_PATH "/usr/ccs/lib/cpp"
250 # define OPT_CPP_OPTIONS ""
251 # define OPT_STRERROR
252 # undef OPT_SVR4_GETMNTENT
253 # undef OPT_LOCKF_MNTENT
254 # define OPT_DEFINE_SIG_PF
255 # undef OPT_TAR_HAS_EXCLUDE_OPTION
256 # undef OPT_HAS_REALPATH
257 # define OPT_AUTOMOUNT_PATH_FIX
258 /* # define OPT_XTHREADS 1 */ /* Defaulted by -DXTHREADS */
260 #elif defined(sun) && (OS_VERSION <= 4)
262 # define OPT_UNIX_SOCKET_RPC
264 /* for 4.1.1 systems turning on any dlopen features on the */
265 /* client side would break clients with ld errors unless they */
266 /* linked with -ldl. OPT_DLOPEN_CE is ok since clients don't */
267 /* ever execute ce_* functions. */
268 # undef OPT_DLOPEN_X11
269 # undef OPT_DLOPEN_CE
270 # undef OPT_ADDMSG_DIRECT
271 # define OPT_SECURE_RPC
272 # undef OPT_CLASSING_ENGINE
274 # define OPT_BSD_SIGNAL
275 # define OPT_BSD_WAIT
276 # define OPT_DGETTEXT
278 # undef OPT_GETDTABLESIZE
280 # define OPT_CPP_PATH "/usr/lib/cpp"
281 # define OPT_CPP_OPTIONS "-B"
283 # undef OPT_SVR4_GETMNTENT
284 # undef OPT_LOCKF_MNTENT
285 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_42
287 # undef OPT_DEFINE_SIG_PF
288 # define OPT_TAR_HAS_EXCLUDE_OPTION
290 # define OPT_BUG_SUNOS_4
292 # define OPT_HAS_REALPATH
293 # undef OPT_AUTOMOUNT_PATH_FIX
295 #elif defined(sun) && (OS_VERSION >= 5)
297 # undef OPT_UNIX_SOCKET_RPC
299 # if defined(PROF) /* can't use dlopen if profiling. */
300 # undef OPT_DLOPEN_X11
301 # undef OPT_DLOPEN_CE
303 # define OPT_DLOPEN_X11
304 # define OPT_DLOPEN_CE
306 # undef OPT_ADDMSG_DIRECT
307 # define OPT_SECURE_RPC
308 # undef OPT_CLASSING_ENGINE
309 # undef OPT_BSD_SIGNAL
310 # define OPT_POSIX_SIGNAL
314 # undef OPT_GETDTABLESIZE
316 # define OPT_STRERROR
317 # define OPT_CPP_PATH "/usr/ccs/lib/cpp"
318 # define OPT_CPP_OPTIONS "-B"
319 # define OPT_SVR4_GETMNTENT
320 # define OPT_LOCKF_MNTENT
321 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
322 # undef OPT_DEFINE_SIG_PF
323 # define OPT_TAR_HAS_EXCLUDE_OPTION
325 # define OPT_BUG_SUNOS_5
327 # define OPT_HAS_REALPATH
328 # undef OPT_AUTOMOUNT_PATH_FIX
330 /* Does not work on X86 */
331 # if defined(i386) && OS_MINOR_VERSION <= 4
332 # undef OPT_GARBAGE_THREADS
333 # undef OPT_SOLARIS_THREADED_TRIES
335 # define OPT_SOLARIS_THREADS 1
336 /* # define OPT_XTHREADS 1 */ /* Defaulted by -DXTHREADS */
337 # define OPT_GARBAGE_THREADS 1
338 # define OPT_SOLARIS_THREADED_TRIES 10
341 /* Solaris 2.5 and above, supports clnt_create_timed(3N) */
342 # if (OS_MINOR_VERSION >= 5)
343 # define OPT_HAS_CLNT_CREATE_TIMED 1
344 # define OPT_CLNT_CREATE_TIMEOUT 30
347 /* TURN THESE OFF FOR NOW */
348 # undef OPT_GARBAGE_IN_PARALLEL
349 # undef OPT_GARBAGE_THREADS
351 /* Turn ON/OFF parallel threads for garbage collection */
352 # if defined(OPT_DO_AUTO_GARBAGE_COLLECT) && defined(OPT_SOLARIS_THREADS)
353 # define OPT_GARBAGE_IN_PARALLEL 1
354 # define OPT_GARBAGE_THREADS 1
356 # define OPT_GARBAGE_IN_PARALLEL 0 /* used as a const */
357 # undef OPT_GARBAGE_THREADS
361 /* these are probably way obsolete now that irix is svr4 based */
362 # define OPT_UNIX_SOCKET_RPC
364 # undef OPT_DLOPEN_X11
365 # undef OPT_DLOPEN_CE
366 # undef OPT_ADDMSG_DIRECT
367 # undef OPT_SECURE_RPC
368 # undef OPT_CLASSING_ENGINE
369 # define OPT_TAR_HAS_EXCLUDE_OPTION
371 #elif defined(ultrix)
373 # undef OPT_UNIX_SOCKET_RPC
375 # undef OPT_DLOPEN_X11
376 # undef OPT_DLOPEN_CE
377 # undef OPT_ADDMSG_DIRECT
378 # undef OPT_SECURE_RPC
379 # undef OPT_CLASSING_ENGINE
380 # undef OPT_TAR_HAS_EXCLUDE_OPTION
382 #elif defined(__hpux) || defined(hpux)
384 # undef OPT_UNIX_SOCKET_RPC
386 # undef OPT_DLOPEN_X11
387 # undef OPT_DLOPEN_CE
388 # undef OPT_ADDMSG_DIRECT
389 # define OPT_BUG_HPUX
390 # undef OPT_SECURE_RPC
391 # undef OPT_CLASSING_ENGINE
392 # undef OPT_BSD_SIGNAL
393 # define OPT_POSIX_SIGNAL
397 # undef OPT_GETDTABLESIZE
399 # define OPT_HAS_REALPATH
400 # define OPT_AUTOMOUNT_PATH_FIX
402 * re-define these. HP-UX does not seem to want to wake up a swapped
403 * process. The timeouts have to be increased so that HP-UX has time
404 * to swap in ttsession (if it is out).
406 # undef OPT_PING_TRIES
407 # define OPT_PING_TRIES 10
408 # undef OPT_PING_SLEEP
409 # define OPT_PING_SLEEP 2
410 # if OSMAJORVERSION < 10
411 # define OPT_CPP_PATH "/lib/cpp"
413 # define OPT_CPP_PATH "/opt/langtools/lbin/cpp"
415 # define OPT_CPP_OPTIONS ""
416 # define OPT_STRERROR
417 # undef OPT_SVR4_GETMNTENT
418 # undef OPT_LOCKF_MNTENT
419 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_HFS
420 # define OPT_DEFINE_SIG_PF
421 # undef OPT_TAR_HAS_EXCLUDE_OPTION
422 # define OPT_BUG_RPCINTR
425 # if !defined(__STDIO_H)
428 # undef OPT_UNIX_SOCKET_RPC
430 # if defined(PROF) /* can't use dlopen if profiling. */
431 # undef OPT_DLOPEN_X11
432 # undef OPT_DLOPEN_CE
434 # define OPT_DLOPEN_X11
435 # define OPT_DLOPEN_CE
437 # undef OPT_ADDMSG_DIRECT
438 # undef OPT_SECURE_RPC
439 # undef OPT_CLASSING_ENGINE
440 # undef OPT_BSD_SIGNAL
441 # define OPT_POSIX_SIGNAL
445 # undef OPT_GETDTABLESIZE
447 # define OPT_STRERROR
448 # define OPT_CPP_PATH "/usr/ccs/lib/cpp"
449 # define OPT_CPP_OPTIONS ""
450 # define OPT_SVR4_GETMNTENT
451 /* the reason for locking MNTENT is to sync with the Solaris automounter,
452 * which doesn't apply on UnixWare. It probably wouldn't hurt to
453 * do the lockf there, but things seem to be working without it...
455 # undef OPT_LOCKF_MNTENT
457 # if defined(OSMAJORVERSION) && (OSMAJORVERSION > 1)
458 # define OPT_BUG_UW_2
460 # define OPT_BUG_UW_1
462 # define OPT_LOCAL_MOUNT_TYPE "vxfs"
463 # define OPT_DEFINE_SIG_PF
464 # define OPT_TAR_HAS_EXCLUDE_OPTION
465 # define OPT_HAS_REALPATH
467 #elif defined(__uxp__)
468 # if !defined(__STDIO_H)
471 # undef OPT_UNIX_SOCKET_RPC
473 # if defined(PROF) /* can't use dlopen if profiling. */
474 # undef OPT_DLOPEN_X11
475 # undef OPT_DLOPEN_CE
477 # define OPT_DLOPEN_X11
478 # define OPT_DLOPEN_CE
480 # undef OPT_ADDMSG_DIRECT
481 # undef OPT_SECURE_RPC
482 # undef OPT_CLASSING_ENGINE
483 # undef OPT_BSD_SIGNAL
484 # define OPT_POSIX_SIGNAL
488 # undef OPT_GETDTABLESIZE
490 # define OPT_STRERROR
491 # define OPT_CPP_PATH "/usr/ccs/lib/cpp"
492 # define OPT_CPP_OPTIONS ""
493 # define OPT_SVR4_GETMNTENT
494 /* the reason for locking MNTENT is to sync with the Solaris automounter,
495 * which doesn't apply on UnixWare. It probably wouldn't hurt to
496 * do the lockf there, but things seem to be working without it...
498 # undef OPT_LOCKF_MNTENT
500 # define OPT_LOCAL_MOUNT_TYPE "vxfs"
501 # define OPT_DEFINE_SIG_PF
502 # define OPT_TAR_HAS_EXCLUDE_OPTION
503 # define OPT_HAS_REALPATH
505 #elif defined(__osf__)
506 # define OPT_UNIX_SOCKET_RPC
508 # undef OPT_DLOPEN_X11
509 # undef OPT_DLOPEN_CE
510 # undef OPT_ADDMSG_DIRECT
511 # undef OPT_SECURE_RPC
512 # undef OPT_CLASSING_ENGINE
513 # undef OPT_BSD_SIGNAL
514 # define OPT_POSIX_SIGNAL
519 # undef OPT_GETDTABLESIZE
521 # define OPT_CPP_PATH "/usr/ccs/lib/cpp"
522 # define OPT_CPP_OPTIONS ""
523 # define OPT_STRERROR
524 # undef OPT_SVR4_GETMNTENT
525 # define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
526 # define OPT_DEFINE_SIG_PF
527 # undef OPT_TAR_HAS_EXCLUDE_OPTION
528 # undef OPT_HAS_REALPATH
529 # if defined(OSMAJORVERSION) && (OSMAJORVERSION >= 4)
530 # define OPT_XDR_LONG_TYPE int
535 # undef OPT_UNIX_SOCKET_RPC
537 # undef OPT_DLOPEN_X11
538 # undef OPT_DLOPEN_CE
539 # undef OPT_ADDMSG_DIRECT
540 # undef OPT_SECURE_RPC
541 # undef OPT_CLASSING_ENGINE
543 # define OPT_POSIX_SIGNAL
547 # undef OPT_GETDTABLESIZE
549 # define OPT_CPP_PATH "/usr/bin/cpp"
550 # define OPT_CPP_OPTIONS ""
551 # define OPT_STRERROR
552 # undef OPT_SVR4_GETMNTENT
553 # undef OPT_LOCKF_MNTENT
554 # define OPT_LOCAL_MOUNT_TYPE "ext2fs"
556 # define OPT_DEFINE_SIG_PF
557 # define OPT_TAR_HAS_EXCLUDE_OPTION
558 # define OPT_HAS_REALPATH
559 # define OPT_AUTOMOUNT_PATH_FIX
560 # define OPT_BUG_RPCINTR
564 /* Unknown configuration, complain */
565 }}}} You must edit lib/tt_options.h and add a section defining the options for your configuration.
569 #endif /* _TT_OPTIONS_H */