2 // Config file for AIX 5.1 and higher.
4 #ifndef ACE_CONFIG_AIX_5_X_H
5 #define ACE_CONFIG_AIX_5_X_H
7 // This define is needed for building with Visual Age C++ 5 in incremental
8 // mode. In the batch mode build, platform_aix_ibm.GNU sets it. The incremental
9 // mode compiler won't be supported after ACE 5.3, so this will also go away
10 // in that timeframe, so don't worry about future AIX versions.
11 #if !defined (ACE_AIX_VERS)
12 # define ACE_AIX_VERS 501
15 // AIX 5.1 has AIO, but it doesn't have the same API as other POSIX
16 // systems, and the semantics of operations are a bit different. Will take
17 // some real work to get this going.
18 // AIX 5.2, however, has the POSIX API implemented. However, the libc functions
19 // to implement it aren't exported by default. You need to use smit to enable
20 // them. So, leave AIO disabled unless the user explicitly enables it.
21 // config-aix-4.x.h will set ACE_HAS_AIO_CALLS if config-posix.h senses the
22 // feature-test macros, so set up _ACE_DISABLE_AIO_CALLS_ if the user didn't
23 // set it. Then check for it after including config-aix-4.x.h and remove
24 // ACE_HAS_AIO_CALLS if so.
25 #if !defined (ACE_HAS_AIO_CALLS)
26 # define _ACE_DISABLE_AIO_CALLS_
29 // Both IBM and g++ compilers set _THREAD_SAFE if compiler is asked to compile
30 // threaded code (xlC_r, as opposed to xlC; and g++ -pthread)
31 #if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE != 0)
32 # if defined (ACE_HAS_THREADS)
33 # undef ACE_HAS_THREADS
35 # if defined (_THREAD_SAFE)
36 # define ACE_HAS_THREADS 1
38 // # define ACE_HAS_THREADS 0
39 # endif /* _THREAD_SAFE */
40 #endif /* !ACE_MT_SAFE || (ACE_MT_SAFE != 0) */
42 #if defined (__IBMCPP__)
43 // AIX xlC, IBM C/C++ compiler
44 //********************************************************************
47 // Compiler does this with a builtin - it's not in libc.
48 // Although ACE does have alloca() on this compiler/platform combination,
49 // it is disabled by default since it can be dangerous. Uncomment the
50 // following line if you ACE to use it.
51 //# define ACE_HAS_ALLOCA
53 // Compiler supports the ssize_t typedef.
54 # define ACE_HAS_SSIZE_T
56 // Keep an eye on this as the compiler and standards converge...
57 # define ACE_LACKS_LINEBUFFERED_STREAMBUF
58 # define ACE_LACKS_PRAGMA_ONCE
60 # define ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS
61 // When using -qtempinc, we don't need to see template implementation
62 // source (though we do need a pragma to find the correct source file).
63 // However, without -qtempinc (either -qnotempinc or -qtemplateregistry)
64 // we do need to see the source.
65 # if defined (__TEMPINC__)
66 # if !defined ACE_TEMPLATES_REQUIRE_PRAGMA
67 # define ACE_TEMPLATES_REQUIRE_PRAGMA
70 # if !defined (ACE_TEMPLATES_REQUIRE_SOURCE)
71 # define ACE_TEMPLATES_REQUIRE_SOURCE
73 # endif /* __TEMPINC__ */
77 # define ACE_HAS_STANDARD_CPP_LIBRARY 1
78 # define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
80 # define ACE_HAS_CUSTOM_EXPORT_MACROS
81 # define ACE_Proper_Export_Flag
82 # define ACE_Proper_Import_Flag
83 // There's no explicit import/export per-se, but to be sure that declared
84 // template code is exported, explicitly instantiate the class.
85 # define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class SINGLETON_TYPE < CLASS, LOCK >;
86 # define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) extern template class SINGLETON_TYPE < CLASS, LOCK >;
88 #elif defined (__GNUG__)
89 // config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so
90 // this must appear before its #include.
91 # define ACE_HAS_STRING_CLASS
93 # include "ace/config-g++-common.h"
95 # define ACE_HAS_SSIZE_T
97 # if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 0))
98 // We have to explicitly instantiate static template members prior to g++ 4.1
99 # define ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION
100 #endif /* g++ prior to 4.1 */
102 # if !defined (ACE_MT_SAFE) || ACE_MT_SAFE != 0
103 // ACE_MT_SAFE is #defined below, for all compilers.
104 # if !defined (_REENTRANT)
106 # endif /* _REENTRANT */
107 # endif /* !ACE_MT_SAFE */
109 #else /* ! __IBMCPP__ && ! __GNUG__ */
110 # ifdef __cplusplus /* Let it slide for C compilers. */
111 # error unsupported compiler in ace/config-aix-5.x.h
112 # endif /* __cplusplus */
113 #endif /* ! __xlC__ && ! __GNUG__ */
115 // Compiling for AIX.
120 // Pick up all the detectable settings.
121 #include "ace/config-posix.h"
123 // Regardless of what config-posix.h may indicate, AIX 5.3 is the first
124 // to support sem_timedwait(). Prior to that, use the emulation.
125 #if defined (ACE_HAS_POSIX_SEM_TIMEOUT) && \
126 (defined (ACE_AIX_VERS) && (ACE_AIX_VERS < 503))
127 # undef ACE_HAS_POSIX_SEM_TIMEOUT
128 #endif /* ACE_HAS_POSIX_SEM_TIMEOUT && ACE_AIX_VERS < 503 */
130 #if defined (ACE_DLL_SUFFIX)
131 # undef ACE_DLL_SUFFIX
133 #define ACE_DLL_SUFFIX ACE_TEXT (".so")
135 #define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000)
137 #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
139 #define ACE_HAS_SOCKLEN_T
140 #define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
142 // AIX has AIO, but the functions don't match those of other AIO-enabled
143 // platforms. If this is to work, it'll require some significant work,
144 // maybe moving the OS-abstraction stuff to an OS_AIO or some such thing.
145 //# define ACE_HAS_AIO_CALLS
147 #define ACE_HAS_AIX_HI_RES_TIMER
149 // Compiler/platform has correctly prototyped header files.
150 #define ACE_HAS_CPLUSPLUS_HEADERS
152 // Prototypes for both signal() and struct sigaction are consistent.
153 #define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
155 // OS has readdir and friends.
156 #define ACE_HAS_DIRENT
158 // OS supports the getrusage() system call
159 #define ACE_HAS_GETRUSAGE
161 #define ACE_HAS_GPERF
163 #define ACE_HAS_H_ERRNO
165 #define ACE_LACKS_STDINT_H
166 #define ACE_LACKS_SYS_SYSCTL_H
168 #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
169 #define ACE_HAS_NONCONST_SELECT_TIMEVAL
170 #define ACE_HAS_ICMP_SUPPORT 1
171 #define ACE_HAS_IP_MULTICAST
173 // Lacks perfect filtering, must bind group address.
174 #if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING
175 # define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1
176 #endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */
180 // Compiler/platform supports poll().
183 // Platform supports POSIX O_NONBLOCK semantics.
184 #define ACE_HAS_POSIX_NONBLOCK
186 #define ACE_HAS_POSIX_TIME
187 // ... but needs to include another header for it on 4.2+
188 # define ACE_HAS_BROKEN_POSIX_TIME
189 // ... and needs another typedef
190 #define ACE_LACKS_TIMESPEC_T
191 #define ACE_HAS_SELECT_H
193 #define ACE_HAS_REENTRANT_FUNCTIONS
195 #define ACE_HAS_SIOCGIFCONF
197 // Compiler/platform defines the sig_atomic_t typedef
198 #define ACE_HAS_SIG_ATOMIC_T
199 #define ACE_HAS_SIGINFO_T
200 #define ACE_LACKS_SIGINFO_H
201 #define ACE_HAS_P_READ_WRITE
203 #define ACE_HAS_SIGWAIT
204 #define ACE_HAS_SOCKADDR_IN_SIN_LEN
205 #define ACE_HAS_STRBUF_T
207 // Compiler supports stropts.h
208 #define ACE_HAS_STREAMS
209 // #define ACE_HAS_STREAM_PIPES
212 #define ACE_HAS_STRINGS
214 #define ACE_HAS_STRUCT_NETDB_DATA
216 // Dynamic linking is in good shape on newer OS/patch levels. If you have
217 // trouble with the dynamic linking parts of ACE, and can't patch your OS
218 // up to latest levels, comment this out.
219 #define ACE_HAS_SVR4_DYNAMIC_LINKING
220 // This is tightly related to dynamic linking...
221 #define ACE_HAS_AUTOMATIC_INIT_FINI
223 #define ACE_HAS_SVR4_GETTIMEOFDAY
225 #define ACE_HAS_SYSV_IPC
226 #define ACE_HAS_TIMOD_H
228 #define ACE_HAS_BROKEN_T_ERROR
229 #define ACE_TLI_TCP_DEVICE "/dev/xti/tcp"
231 #define ACE_HAS_UALARM
233 #define ACE_HAS_UCONTEXT_T
235 #define ACE_HAS_UTIME
237 #define ACE_HAS_CTYPE_T
239 // Platform has XPG4 wide character type and functions. However, the size
240 // of wchar_t changes for 32- vs. 64-bit builds (unsigned short vs. unsigned
241 // int, respectively).
242 #define ACE_HAS_XPG4_MULTIBYTE_CHAR
244 # define ACE_SIZEOF_WCHAR 4
246 # define ACE_SIZEOF_WCHAR 2
247 #endif /* __64BIT__ */
249 #define ACE_LACKS_NETINET_TCP_H
251 // AIX uses LIBPATH to search for libraries
252 #define ACE_LD_SEARCH_PATH ACE_TEXT ("LIBPATH")
254 // Defines the page size of the system.
255 #define ACE_PAGE_SIZE 4096
257 //**************************************************************
259 // Threads related definitions.
261 // The threads on AIX are generally POSIX P1003.1c (ACE_HAS_PTHREADS).
262 // However, there is also a kernel thread ID (tid_t) that is used in
263 // ACE_Log_Msg (printing the thread ID). The tid_t is not the same as
264 // pthread_t, and can't derive one from the other - thread_self() gets
265 // the tid_t (kernel thread ID) if called from a thread.
266 // Thanks very much to Chris Lahey for straightening this out.
268 #if defined (ACE_HAS_THREADS)
269 # if !defined (ACE_MT_SAFE)
270 # define ACE_MT_SAFE 1
273 # define ACE_HAS_PTHREADS
274 # define ACE_HAS_PTHREADS_UNIX98_EXT
275 # define ACE_HAS_PTHREAD_CONTINUE_NP
276 # define ACE_HAS_PTHREAD_SUSPEND_NP
277 # define ACE_HAS_RECURSIVE_MUTEXES
278 # define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS
279 # define ACE_HAS_SIGTHREADMASK
280 # define ACE_HAS_THREAD_SPECIFIC_STORAGE
282 # define ACE_LACKS_THREAD_PROCESS_SCOPING
284 # undef ACE_HAS_THREADS
285 #endif /* ACE_HAS_THREADS != 0 */
287 #define ACE_MALLOC_ALIGN 8
289 #if (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500) && !defined(_UNIX95)
290 # define ACE_HAS_3_PARAM_WCSTOK
291 #endif /* (_XOPEN_SOURCE -0) >= 500 && !_UNIX95 */
293 #if defined (_ACE_DISABLE_AIO_CALLS_)
294 # if defined (ACE_HAS_AIO_CALLS)
295 # undef ACE_HAS_AIO_CALLS
297 # undef _ACE_DISABLE_AIO_CALLS_
300 // AIX's /usr/include/unistd.h sets _POSIX_SEMAPHORE to indicate the system
301 // supplies such a facility, but the headers don't enable it unless
302 // _XOPEN_SOURCE >= 500. So disable semaphores here if _XOPEN_SOURCE isn't
304 #if defined (ACE_HAS_POSIX_SEM) && \
305 (!defined (_XOPEN_SOURCE) || (_XOPEN_SOURCE-0 < 500))
306 # undef ACE_HAS_POSIX_SEM
309 // I think this is correct, but needs to be verified... -Steve Huston
310 #define ACE_HAS_SIGTIMEDWAIT
312 // AIX 5.1 has netinet/tcp.h
313 #undef ACE_LACKS_NETINET_TCP_H
315 #define ACE_HAS_3_PARAM_READDIR_R
316 #define ACE_HAS_SCANDIR
317 #define ACE_SCANDIR_CMP_USES_VOIDPTR
318 #define ACE_SCANDIR_SEL_LACKS_CONST
319 #define ACE_HAS_SIGSUSPEND
320 #define ACE_HAS_TIMEZONE /* Call tzset() to set timezone */
321 #define ACE_LACKS_ISCTYPE
322 #define ACE_HAS_STRSIGNAL
323 #define ACE_NEEDS_STRSIGNAL_RANGE_CHECK
324 #define ACE_HAS_SOCKADDR_IN6_SIN6_LEN
327 #if defined (ACE_AIX_VERS) && (ACE_AIX_VERS < 503)
328 # define ACE_LACKS_UNSETENV
329 # define ACE_LACKS_LOG2
330 # define ACE_LACKS_PTHREAD_ATTR_SETSTACK
331 #endif /* ACE_AIX_VERS < 503 */
333 #define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%ld"
334 #define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu"
336 #endif /* ACE_CONFIG_AIX_5_X_H */