summaryrefslogtreecommitdiff
path: root/ibm.cf
blob: 5951a338df66ec391b0b406c49a747c5d316b23e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
XCOMM platform:  $XdotOrg: xc/config/cf/ibm.cf,v 1.2 2004/04/23 18:41:58 eich Exp $
XCOMM platform:  $Xorg: ibm.cf,v 1.3 2000/08/17 19:41:47 cpqbld Exp $

#ifndef OSName
# define OSName		DefaultOSName
#endif
#ifndef OSMajorVersion
# define OSMajorVersion	DefaultOSMajorVersion
#endif
#ifndef OSMinorVersion
# define OSMinorVersion	DefaultOSMinorVersion
#endif
#ifndef OSTeenyVersion
# ifdef DefaultOSTeenyVersion
#  define OSTeenyVersion	DefaultOSTeenyVersion
# elif (OSMajorVersion == 4) && (OSMinorVersion == 1)
#  define OSTeenyVersion	3
# else
#  define OSTeenyVersion	0
# endif
#endif
XCOMM operating system:  OSName (OSMajorVersion.OSMinorVersion.OSTeenyVersion)

#define RemoveFiles(files) for f in files; do RemoveFile($$f); done

#if (OSMajorVersion > 4)
#  define HasSnprintf YES
#  define HasStrcasecmp	YES
#endif
#if OSMajorVersion > 3 || (OSMajorVersion == 3 && OSMinorVersion >= 2)
#define HasBSD44Sockets		YES
#define HasPutenv		YES
#define HasPlugin		YES
/*
 * If you do not have threads support installed, put
 * #define HasPosixThreads	NO
 * in the BeforeVendorCF section of your site.def.
 */
#if !defined(HasPosixThreads) && ((OSMajorVersion == 3 && (OSMinorVersion > 2 || (OSMinorVersion == 2 && OSTeenyVersion > 4))) || (OSMajorVersion == 4 && (OSMinorVersion > 1 || (OSMinorVersion == 1 && OSTeenyVersion > 1))) || (OSMajorVersion >= 5))
#define HasPosixThreads		YES
#endif
#if HasPosixThreads
#ifndef ThreadedX
#define ThreadedX		YES
#define MTSafeAPIDefines	-DXUSE_MTSAFE_API -DXUSE_NETDB_R_API
#endif
#endif
#endif /* OS > 3.2 */

#define NeedConstPrototypes	YES
#define NeedFunctionPrototypes	YES
#define NeedNestedPrototypes	YES
#define NeedVarargsPrototypes	YES

#ifndef XVirtualFramebufferServer
#define XVirtualFramebufferServer YES
#endif

#if !defined(TermcapLibrary)
#define TermcapLibrary		-lcurses
#endif

#if !defined(HasPam) && ((OSMajorVersion == 5) && (OSMinorVersion >= 2) || OSMajorVersion > 5)
#define HasPam			YES
#ifndef PamLibraries
#define PamLibraries		-lpam
#endif
#endif

/*
 * For IBM platforms, we must define both the location of the compiler
 * and the location of its standard C++ library.  The library location
 * is needed to resolve dependent library symbols if we build our own
 * C++ shared libraries.
 */

#if !HasGcc2ForCplusplus
# ifndef CplusplusCmd
#  if ThreadedX
#   define CplusplusCmd		xlC_r
#  else
#   define CplusplusCmd		xlC
#  endif
# endif
#endif

#ifndef CplusplusFilt
# define CplusplusFilt		/usr/lpp/xlC/bin/c++filt
#endif
#ifndef CplusplusLibC
# if ThreadedX
#  define CplusplusLibC		/usr/lpp/xlC/lib/libC.a
# else
#  define CplusplusLibC		/usr/lpp/xlC/lib/libC_r.a
# endif
#endif
#if !HasGcc2ForCplusplus
# ifndef CplusplusDependIncludes
#  define CplusplusDependIncludes -I/usr/lpp/xlC/include
# endif
#endif

/*
 * IBM's xlC refuses to compile files unless their names end in ".C".
 * As an alternative to this fix, one could edit /etc/xlC.cfg
 * to change the suffix accepted by the compiler, but we prefer not
 * requiring users to reconfigure their C++ compilers to make them work.
 * We also have to override the default SUFFIXES to defeat the use of
 * the builtin .C -> .o file, which doesn't use the right flags.
 */

.SUFFIXES:
.SUFFIXES: .o .c .y .l .s .sh .h .f .Y .L .cxx

#define NormalLibObjCplusplusCompile(options) test -r $*.C || $(LN) $*.CCsuf $*.C @@\
	$(CXX) -c $(CXXFLAGS) options $*.C

#define SpecialCplusplusObjectRule(baseobj,basedep,options)		@@\
baseobj.Osuf:	basedep.CCsuf						@@\
	test -r basedep.C || $(LN) basedep.CCsuf basedep.C		@@\
	$(CXX) -c $(CXXFLAGS) options basedep.C


#define BuildLibPathVar		LIBPATH
#define SystemV			YES
#define LdCombineFlags		-r
#define ExecableScripts		YES
#define Malloc0ReturnsNull	YES
#define CppCmd			/usr/ccs/lib/cpp
#define ExpandManNames		YES
#define ExtensionOSDefines	-DXTESTEXT1

/* IBM cpp has slightly non-standard line directives, but supports -P */
#define CppNoLineInfoOption	-P

#if OSMajorVersion > 3
#if OSMajorVersion > 4
#define StandardDefines		-DSYSV -DAIXV3 -DAIXV4 -DAIXV5 -D_ALL_SOURCE
#else
#define StandardDefines		-DSYSV -DAIXV3 -DAIXV4 -D_ALL_SOURCE
#endif
#define XawI18nDefines		-DHAS_WCHAR_H -DHAS_ISW_FUNCS
#define ServerExtraDefines	-D_IBM_LFT
#if ThreadedX
#define CcCmd			xlc_r
#else
#define CcCmd			xlc
#endif
#define SystemMTDefines		/* xlc_r defines -D_THREAD_SAFE */
#define ThreadsLibraries	-lpthreads /* xlc_r does -lc_r */
#define ThreadsCplusplusLibraries	-lpthreads
#define AvoidNullMakeCommand	YES
#define NullMakeCommand		@ echo
/* AIX 4 appends all MAKEFLAGS (even dups), so cannot pass on command line. */
#define ConstructMFLAGS		NO
#define LdPreLib		_Use(-L$(USRLIBDIR),-L$(BUILDLIBDIR))
#define ExtraFilesToClean	*.inp
#else 	/* OSMajorVersion < 4 */
#define StandardDefines         -DSYSV -DAIXV3 -D_ALL_SOURCE
#define ServerExtraDefines	-D_IBM_HFT
#define CcCmd			xlc
#define ThreadPreStdAPIDefines	-DXPRE_STANDARD_API
#define SystemMTDefines		-D_THREAD_SAFE
#define ThreadsLibraries	-lpthreads -lc_r
#endif	/* OSMajorVersion */

#define OPERATING_SYSTEM 	AIX /* directory name under server/ddx/ibm/ */
#define InstallCmd              /usr/ucb/install
#include <ibmLib.rules>

#ifndef ManKeywordsTarget
#define ManKeywordsTarget(manpath)					@@\
man_keywords::								@@\
	/usr/lib/makewhatis $(DESTDIR)manpath
#endif

#define DtMailDefines		\
  -DI_HAVE_NO_BOOL -DI_HAVE_SELECT_H \
  -DBIG_ENDIAN -DSTRCASECMP_NOT_DEFINED -DDO_ANONYMOUS_MAP -DSENDMAIL_LOCKS \
  -DMAILGROUP_REQUIRED -DMAIL_SPOOL_PATH=\"/var/spool/mail/%s\"

#define ArchitectureDefines	-DIBM_ARCHITECTURE

#define ExportListGenSource	elistgen.ibm

#define CdeProjectDefines \
	-D_AIX -D__AIX -D__aix -D_aix -Daix -DMULTIBYTE -DNLS16 -DMESSAGE_CAT \
	-DOSMAJORVERSION=OSMajorVersion -DOSMINORVERSION=OSMinorVersion -DAIX

/*
 * -D__STR31__ disables inlining of memcpy to work around optimization bug
 * in XLC v1.2.0.7. Bug report filed as PMR 8X196, branch 060.
 */
#ifndef OptimizedCDebugFlags
#define OptimizedCDebugFlags	-O -D__STR31__ -DNDEBUG
#endif

#define CdeTicDefines	-DHAS_KNL -DHAS_KTAB