1XCOMM platform:  $XdotOrg: xc/config/cf/ibm.cf,v 1.2 2004/04/23 18:41:58 eich Exp $
2XCOMM platform:  $Xorg: ibm.cf,v 1.3 2000/08/17 19:41:47 cpqbld Exp $
3
4#ifndef OSName
5# define OSName		DefaultOSName
6#endif
7#ifndef OSMajorVersion
8# define OSMajorVersion	DefaultOSMajorVersion
9#endif
10#ifndef OSMinorVersion
11# define OSMinorVersion	DefaultOSMinorVersion
12#endif
13#ifndef OSTeenyVersion
14# ifdef DefaultOSTeenyVersion
15#  define OSTeenyVersion	DefaultOSTeenyVersion
16# elif (OSMajorVersion == 4) && (OSMinorVersion == 1)
17#  define OSTeenyVersion	3
18# else
19#  define OSTeenyVersion	0
20# endif
21#endif
22XCOMM operating system:  OSName (OSMajorVersion.OSMinorVersion.OSTeenyVersion)
23
24#define RemoveFiles(files) for f in files; do RemoveFile($$f); done
25
26#if (OSMajorVersion > 4)
27#  define HasSnprintf YES
28#  define HasStrcasecmp	YES
29#endif
30#if OSMajorVersion > 3 || (OSMajorVersion == 3 && OSMinorVersion >= 2)
31#define HasBSD44Sockets		YES
32#define HasPutenv		YES
33#define HasPlugin		YES
34/*
35 * If you do not have threads support installed, put
36 * #define HasPosixThreads	NO
37 * in the BeforeVendorCF section of your site.def.
38 */
39#if !defined(HasPosixThreads) && ((OSMajorVersion == 3 && (OSMinorVersion > 2 || (OSMinorVersion == 2 && OSTeenyVersion > 4))) || (OSMajorVersion == 4 && (OSMinorVersion > 1 || (OSMinorVersion == 1 && OSTeenyVersion > 1))) || (OSMajorVersion >= 5))
40#define HasPosixThreads		YES
41#endif
42#if HasPosixThreads
43#ifndef ThreadedX
44#define ThreadedX		YES
45#define MTSafeAPIDefines	-DXUSE_MTSAFE_API -DXUSE_NETDB_R_API
46#endif
47#endif
48#endif /* OS > 3.2 */
49
50#define NeedConstPrototypes	YES
51#define NeedFunctionPrototypes	YES
52#define NeedNestedPrototypes	YES
53#define NeedVarargsPrototypes	YES
54
55#ifndef XVirtualFramebufferServer
56#define XVirtualFramebufferServer YES
57#endif
58
59#if !defined(TermcapLibrary)
60#define TermcapLibrary		-lcurses
61#endif
62
63#if !defined(HasPam) && ((OSMajorVersion == 5) && (OSMinorVersion >= 2) || OSMajorVersion > 5)
64#define HasPam			YES
65#ifndef PamLibraries
66#define PamLibraries		-lpam
67#endif
68#endif
69
70/*
71 * For IBM platforms, we must define both the location of the compiler
72 * and the location of its standard C++ library.  The library location
73 * is needed to resolve dependent library symbols if we build our own
74 * C++ shared libraries.
75 */
76
77#if !HasGcc2ForCplusplus
78# ifndef CplusplusCmd
79#  if ThreadedX
80#   define CplusplusCmd		xlC_r
81#  else
82#   define CplusplusCmd		xlC
83#  endif
84# endif
85#endif
86
87#ifndef CplusplusFilt
88# define CplusplusFilt		/usr/lpp/xlC/bin/c++filt
89#endif
90#ifndef CplusplusLibC
91# if ThreadedX
92#  define CplusplusLibC		/usr/lpp/xlC/lib/libC.a
93# else
94#  define CplusplusLibC		/usr/lpp/xlC/lib/libC_r.a
95# endif
96#endif
97#if !HasGcc2ForCplusplus
98# ifndef CplusplusDependIncludes
99#  define CplusplusDependIncludes -I/usr/lpp/xlC/include
100# endif
101#endif
102
103/*
104 * IBM's xlC refuses to compile files unless their names end in ".C".
105 * As an alternative to this fix, one could edit /etc/xlC.cfg
106 * to change the suffix accepted by the compiler, but we prefer not
107 * requiring users to reconfigure their C++ compilers to make them work.
108 * We also have to override the default SUFFIXES to defeat the use of
109 * the builtin .C -> .o file, which doesn't use the right flags.
110 */
111
112.SUFFIXES:
113.SUFFIXES: .o .c .y .l .s .sh .h .f .Y .L .cxx
114
115#define NormalLibObjCplusplusCompile(options) test -r $*.C || $(LN) $*.CCsuf $*.C @@\
116	$(CXX) -c $(CXXFLAGS) options $*.C
117
118#define SpecialCplusplusObjectRule(baseobj,basedep,options)		@@\
119baseobj.Osuf:	basedep.CCsuf						@@\
120	test -r basedep.C || $(LN) basedep.CCsuf basedep.C		@@\
121	$(CXX) -c $(CXXFLAGS) options basedep.C
122
123
124#define BuildLibPathVar		LIBPATH
125#define SystemV			YES
126#define LdCombineFlags		-r
127#define ExecableScripts		YES
128#define Malloc0ReturnsNull	YES
129#define CppCmd			/usr/ccs/lib/cpp
130#define ExpandManNames		YES
131#define ExtensionOSDefines	-DXTESTEXT1
132
133/* IBM cpp has slightly non-standard line directives, but supports -P */
134#define CppNoLineInfoOption	-P
135
136#if OSMajorVersion > 3
137#if OSMajorVersion > 4
138#define StandardDefines		-DSYSV -DAIXV3 -DAIXV4 -DAIXV5 -D_ALL_SOURCE
139#else
140#define StandardDefines		-DSYSV -DAIXV3 -DAIXV4 -D_ALL_SOURCE
141#endif
142#define XawI18nDefines		-DHAS_WCHAR_H -DHAS_ISW_FUNCS
143#define ServerExtraDefines	-D_IBM_LFT
144#if ThreadedX
145#define CcCmd			xlc_r
146#else
147#define CcCmd			xlc
148#endif
149#define SystemMTDefines		/* xlc_r defines -D_THREAD_SAFE */
150#define ThreadsLibraries	-lpthreads /* xlc_r does -lc_r */
151#define ThreadsCplusplusLibraries	-lpthreads
152#define AvoidNullMakeCommand	YES
153#define NullMakeCommand		@ echo
154/* AIX 4 appends all MAKEFLAGS (even dups), so cannot pass on command line. */
155#define ConstructMFLAGS		NO
156#define LdPreLib		_Use(-L$(USRLIBDIR),-L$(BUILDLIBDIR))
157#define ExtraFilesToClean	*.inp
158#else 	/* OSMajorVersion < 4 */
159#define StandardDefines         -DSYSV -DAIXV3 -D_ALL_SOURCE
160#define ServerExtraDefines	-D_IBM_HFT
161#define CcCmd			xlc
162#define ThreadPreStdAPIDefines	-DXPRE_STANDARD_API
163#define SystemMTDefines		-D_THREAD_SAFE
164#define ThreadsLibraries	-lpthreads -lc_r
165#endif	/* OSMajorVersion */
166
167#define OPERATING_SYSTEM 	AIX /* directory name under server/ddx/ibm/ */
168#define InstallCmd              /usr/ucb/install
169#include <ibmLib.rules>
170
171#ifndef ManKeywordsTarget
172#define ManKeywordsTarget(manpath)					@@\
173man_keywords::								@@\
174	/usr/lib/makewhatis $(DESTDIR)manpath
175#endif
176
177#define DtMailDefines		\
178  -DI_HAVE_NO_BOOL -DI_HAVE_SELECT_H \
179  -DBIG_ENDIAN -DSTRCASECMP_NOT_DEFINED -DDO_ANONYMOUS_MAP -DSENDMAIL_LOCKS \
180  -DMAILGROUP_REQUIRED -DMAIL_SPOOL_PATH=\"/var/spool/mail/%s\"
181
182#define ArchitectureDefines	-DIBM_ARCHITECTURE
183
184#define ExportListGenSource	elistgen.ibm
185
186#define CdeProjectDefines \
187	-D_AIX -D__AIX -D__aix -D_aix -Daix -DMULTIBYTE -DNLS16 -DMESSAGE_CAT \
188	-DOSMAJORVERSION=OSMajorVersion -DOSMINORVERSION=OSMinorVersion -DAIX
189
190/*
191 * -D__STR31__ disables inlining of memcpy to work around optimization bug
192 * in XLC v1.2.0.7. Bug report filed as PMR 8X196, branch 060.
193 */
194#ifndef OptimizedCDebugFlags
195#define OptimizedCDebugFlags	-O -D__STR31__ -DNDEBUG
196#endif
197
198#define CdeTicDefines	-DHAS_KNL -DHAS_KTAB
199