summaryrefslogtreecommitdiff
path: root/mingw.cf
blob: 55389e344003bc3c3838602341dfe0e8c9f6a8ba (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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
/* MingGW vendor strings and version */
#include "xorgversion.def"

#ifndef CygxVersionMajor
# define CygxVersionMajor	XORG_VERSION_MAJOR
#endif
#ifndef CygxVersionMinor
# define CygxVersionMinor	XORG_VERSION_MINOR
#endif
#ifndef CygxVersionPatch
# define CygxVersionPatch	XORG_VERSION_PATCH
#endif
#ifndef CygxVersionSnap
# define CygxVersionSnap	XORG_VERSION_SNAP
#endif
#ifndef CygxVersionServer
# define CygxVersionServer	0
#endif

#ifndef CygxVersion
# define CygxVersion (10000000 * CygxVersionMajor + 100000 * CygxVersionMinor + 1000 * CygxVersionPatch + CygxVersionSnap)
#endif

#ifndef CygxVersionString
# define CygxVersionString `echo CygxVersionMajor CygxVersionMinor CygxVersionPatch CygxVersionSnap%CygxVersionServer| sed -e 's/ /./g' -e 's/%/-/g'`
#endif

#ifndef CygxManVersionString
# define CygxManVersionString `echo CygxVersionMajor CygxVersionMinor CygxVersionPatch CygxVersionSnap| sed -e 's/ /./g' -e 's/^/Version\\\ /'`
#endif

#ifndef XVendorString
# define XVendorString "The Cygwin/X Project"
#endif
#ifndef XVendorRelease
# define XVendorRelease CygxVersion
#endif
#ifndef XVendorManVersionString
# define XVendorManVersionString CygxManVersionString
#endif
#ifndef XVendorManNameString
# define XVendorManNameString "Xming"
#endif
#ifndef XVendorContact
# define XVendorContact "win32-x11@sources.redhat.com"
#endif

/* Operating system strings and version */
#ifndef OSName
# define OSName			Windows
#endif
#ifndef OSVendor
# define OSVendor		Microsoft
#endif
#ifndef OSMajorVersion
# define OSMajorVersion		DefaultOSMajorVersion
#endif
#ifndef OSMinorVersion
# define OSMinorVersion		DefaultOSMinorVersion
#endif
#ifndef OSTeenyVersion
# define OSTeenyVersion		DefaultOSTeenyVersion
#endif

#ifndef ProjectRoot
# define ProjectRoot 		/usr/X11R6
#endif

/*
 * GNU Compiler stuff
 */
#ifndef HasGcc3
# define HasGcc3 NO
#endif
#ifndef HasGcc2
# define HasGcc2 HasGcc3
#endif
#ifndef HasGcc
# define HasGcc HasGcc2
#endif
#ifndef HasGcc2ForCplusplus
# define HasGcc2ForCplusplus HasGcc2
#endif

#if HasGcc
# ifndef Gcc28Warnings
#  if (GccMajorVersion > 2) || \
      ((GccMajorVersion == 2) && (GccMinorVersion >= 8))
#   define Gcc28Warnings -Wundef
#  else
#   define Gcc28Warnings /* */
#  endif
# ifndef HasGcc33
#  if (((GccMajorVersion == 3) && (GccMinorVersion >= 3)) ||	\
 	(GccMajorVersion > 3))
#   define HasGcc33 YES
#  else
#   define HasGcc33 NO
#  endif
# endif
# ifndef HasGcc34
#  if (((GccMajorVersion == 3) && (GccMinorVersion >= 4)) ||	\
 	(GccMajorVersion > 3))
#   define HasGcc34 YES
#  else
#   define HasGcc34 NO
#  endif
# endif
# endif
# ifndef GccWarningOptions
#  if XFree86Devel
#   define GccWarningOptions -Wall -Wpointer-arith -Wstrict-prototypes \
			  -Wmissing-prototypes -Wmissing-declarations \
			  -Wredundant-decls -Wnested-externs Gcc28Warnings
#  else
#   define GccWarningOptions -Wall -Wpointer-arith Gcc28Warnings
#  endif
# endif
# ifndef DefaultCCOptions
#  if defined(UseInstalled)
#   define DefaultCCOptions
#  else
#   define DefaultCCOptions GccWarningOptions
#  endif
# endif
# if defined(UseInstalled)
#  ifndef UseGccMakeDepend
#   define UseGccMakeDepend YES
#  endif
# endif
#endif

#define GccUsesGas		YES
#define UseGas			YES
#define GnuCpp			YES
#define UnixCpp /* Just a flag that affects Concat macros in Imake.rules */
#define HasShadowPasswd		NO
#define HasLibCrypt		YES
#define HasPutenv		YES
#define HasFchown		NO
#define HasPoll			NO
#if (OSMajorVersion > 1) || (OSMajorVersion == 1 && OSMinorVersion >= 5)
# define HasStrlcat		YES
#endif
#define HasShm			NO

/* snprintf from windows runtime does return -1 if the buffer is to small */
#define HasSnprintf		NO

#define HasFfs			NO

#ifndef HasMakefileSafeInclude
# define HasMakefileSafeInclude YES
#endif

#define Hastcl			NO
#define Hastk			NO

#define HasSockets		NO
#define GzipFontCompression	YES
#define HasZlib			NO
#define HasFreetype2	NO

/* We don't need -lm */
#define MathLibrary		/**/

/*
 * /lib/libtermcap.a doesn't have tgetent, which is needed for
 * xc/programs/xterm/resize.exe
 */
#define TermcapLibrary		-lncurses.dll

#define AvoidNullMakeCommand	YES
#define StripInstalledPrograms	YES
#define CompressAllFonts	YES
#define Malloc0ReturnsNull	NO
#define NeedConstPrototypes	YES
#define NeedFunctionPrototypes	YES
#define NeedNestedPrototypes	YES
#define NeedVarargsPrototypes	YES
#define NeedWidePrototypes	NO
#define SetTtyGroup		YES
#define ExpandManNames		YES
#define HasDlopen		NO
#define HasGnuMake		YES
#define UseGccMakeDepend	NO
#define ThreadedX		YES
#define HasThreadSafeAPI	YES
#if !CrossCompiling
#define CaseSensitiveFileSystem	NO
#endif
#define HasWChar32		YES
#define HasBasename		NO /* basename() in libc */

#define LnCmd			ln -s
#ifndef CcCmd
# define CcCmd			gcc
#endif /* CcCmd */
#ifndef CplusplusCmd
# define CplusplusCmd		g++
#endif /* CplusplusCmd */
#ifndef AsCmd
# define AsCmd			as
#endif /* AsCmd */

#define GccGasOption		-DGCCUSESGAS
#define AsmDefines		-DUSE_GAS -DGCCUSESGAS

#ifndef LdCmd
# define LdCmd			gcc -lautomode
#endif /* LdCmd */

#define MkdirHierCmd		mkdir -p

#ifndef CppCmd
# define CppCmd			cpp
#endif /* CppCmd */
#ifndef YaccCmd
# define YaccCmd		bison -y
#endif /* YaccCmd */

#define LexCmd			flex -l
#define LexLib			-lfl
#define HasFlex			YES
#ifndef CrossCompileDir
# ifndef HasExpat
#  define HasExpat		YES
# endif
# ifndef HasFreetype2
#  define HasFreetype2		YES
# endif
# ifndef HasFontconfig
#  define HasFontconfig		YES
# endif
#endif

/* Cygwin-specific Windows resource compiler command */
#ifdef CrossCompileDir
# ifndef WindresCmd
#  define WindresCmd		Concat3(CrossCompileDir,/,windres)
# endif
#else
# ifndef WindresCmd
#  define WindresCmd		windres
# endif
#endif

#define PreProcessCmd		CcCmd -E

#ifndef PostIncDir
# ifdef CrossCompileDir
#  define PostIncDir		`CrossCompileDir/CcCmd --print-libgcc-file-name | sed 's,\\\\,/,g' | sed 's,libgcc.a,include,'`
# else
#  define PostIncDir		`CcCmd --print-libgcc-file-name | sed 's,\\\\,/,g' | sed 's,libgcc.a,include,'`
# endif
#endif
#ifndef ExtraIncDir
# ifdef CrossCompileDir
#  define ExtraIncDir		CrossCompileDir/../include/w32api
# else
#  define ExtraIncDir		/usr/include/w32api
# endif
#endif

#ifndef BourneShell
/*
 * This will cause builds/installs to terminate on errors, as on other
 * platforms.
 */
#define BourneShell		/bin/sh -e
#endif

#define LdCombineFlags		-r

#ifndef DefaultCCOptions
# define DefaultCCOptions	-Wall -Wpointer-arith
#endif

/* Cygwin 1.5.x now includes alloca */
#if OSMinorVersion >= 5
# define AllocateLocalDefines	-DINCLUDE_ALLOCA_H
#else
# define AllocateLocalDefines	-DNO_ALLOCA
#endif

#ifndef OptimizedCDebugFlags
# define OptimizedCDebugFlags	-O2 -fno-strength-reduce
#endif

/*
 * -DFD_SETSIZE=256 is needed for xfs and the xserver. cygwin defines the
 * FD_SETSIZE as 64 but some code expects it to be larger.
 */
#define StandardDefines		-D__i386__ -DWIN32_LEAN_AND_MEAN -DX_LOCALE \
				-D_X86_ -DWIN32 -D_XOPEN_SOURCE \
				-D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE \
				-D_SVID_SOURCE -D_GNU_SOURCE -DFD_SETSIZE=1024 \
				-DXResExtension
#define XawI18nDefines		-DHAS_WCHAR_H -DHAS_WCTYPE_H \
				-DHAS_ISW_FUNCS -DNO_WIDEC_H
#define StandardCppOptions	-traditional

/* Cygwin shared memory requires cygipc package or cygserver. */
#if UseCygIPC
# if ThreadedX
#  define StandardCppDefines	-DHAS_THREADS -DHAS_SHM StandardDefines
# else
#  define StandardCppDefines	-DHAS_SHM StandardDefines
# endif
#else
# if ThreadedX
#  define StandardCppDefines	-DHAS_THREADS StandardDefines
# else
#  define StandardCppDefines	StandardDefines
# endif
#endif

#define BuildIPv6		NO
#define BuildLBX		NO

/*
 * This requires the pthreads-win32 library
 * It is available from http://www.sourceware.org/pthreads-win32
 */
#ifndef HasPThreads
# define HasPThreads		YES
#endif

/* Most libraries do not compile with mingw. Build only the servers. */
#ifndef BuildServersOnly
# define BuildServersOnly	YES
#endif

/* Enable those parts that do work and are required for running Xming */
#ifndef BuildXextLib
# define BuildXextLib		YES
#endif
#ifndef BuildXkbcomp
# define BuildXkbcomp		YES
#endif

/* XWin Server specific build flags */
#ifndef GlxUseWindows
# define GlxUseWindows		YES
#endif
#if !GlxUseWindows
# define GlxExtraDefines -DAPIENTRY=GLAPIENTRY
#endif

#ifndef BuildXWinClipboard
# define BuildXWinClipboard	HasPThreads
#endif
#ifndef BuildXWinEmulatePseudo
# define BuildXWinEmulatePseudo	NO
#endif
#ifndef BuildXWinMultiWindow
# define BuildXWinMultiWindow	HasPThreads
#endif
#ifndef BuildXWinMultiWindowExtWM
# define BuildXWinMultiWindowExtWM HasPThreads
#endif
#ifndef BuildXWinNativeGDI
# define BuildXWinNativeGDI	NO
#endif
#ifndef BuildXWinPrimaryFB
# define BuildXWinPrimaryFB	NO
#endif
#ifndef BuildXWinUpdateStats
# define BuildXWinUpdateStats	NO
#endif
#ifndef BuildXWinXF86Config
# define BuildXWinXF86Config	NO
#endif

/* XWin specific build flags - 1st order dependency */
#if BuildXWinMultiWindowExtWM && !defined(BuildWindowsWMLibrary)
# define BuildWindowsWMLibrary	YES
#elif !defined(BuildWindowsWMLibrary)
# define BuildWindowsWMLibrary	NO
#endif /* BuildXWinMultiWindowExtWM && BuildWindowsWMLibrary */

#if (BuildXWinClipboard || BuildXWinMultiWindow || BuildXWinMultiWindowExtWM) && !defined(BuildX11Lib)
#  define BuildX11Lib YES
#endif

/* XWin Server specific defines */
#if BuildXWinClipboard
# define XWinClipboardDefines	-DXWIN_CLIPBOARD
#else
# define XWinClipboardDefines
#endif /* BuildXWinClipboard */
#if BuildXWinEmulatePseudo
# define XWinEmulatePseudoDefines -DXWIN_EMULATEPSEUDO
#else
# define XWinEmulatePseudoDefines
#endif /* BuildXWinEmulatePseudo */
#if BuildXWinMultiWindow
# define XWinMultiWindowDefines	-DXWIN_MULTIWINDOW
#else
# define XWinMultiWindowDefines
#endif /* BuildXWinMultiWindow */
#if BuildXWinMultiWindowExtWM
# define BuildRootless		YES
# define XWinMultiWindowExtWMDefines -DXWIN_MULTIWINDOWEXTWM
#else /* BuildXWinMultiWindowExtWM */
# define XWinMultiWindowExtWMDefines
#endif /* BuildXWinMultiWindowExtWM */
#if BuildXWinNativeGDI
# define XWinNativeGDIDefines	-DXWIN_NATIVEGDI
#else
# define XWinNativeGDIDefines
#endif /* BuildXWinNativeGDI */
#if BuildXWinPrimaryFB
# define XWinPrimaryFBDefines	-DXWIN_PRIMARYFB
#else
# define XWinPrimaryFBDefines
#endif /* BuildXWinPrimaryFB */
#if BuildXWinUpdateStats
# define XWinUpdateStatsDefines	-DXWIN_UPDATESTATS
#else
# define XWinUpdateStatsDefines
#endif /* BuildXWinUpdateStats */
#if BuildXWinXF86Config
# define XWinXF86ConfigDefines	-DXWIN_XF86CONFIG
#else
# define XWinXF86ConfigDefines
#endif /* BuildXWinXF86Config */

#if HasPThreads
# define XWinPThreadsDefines -DPTW32_DLLPORT=
#else
# define XWinPThreadsDefines
#endif /* HasPThreads */

/*
 * XFree86Server is defined for the w32api headers, which protects some
 * colliding names with #ifdef XFree86Server.
 */
#define XWinServerDefines	-DPIXPRIV \
				-DXFree86Server \
				-DX_BYTE_ORDER=ByteOrder \
				XvExtensionDefines \
				XWinXF86ConfigDefines XWinNativeGDIDefines \
				XWinPrimaryFBDefines \
				XWinEmulatePseudoDefines \
				XWinUpdateStatsDefines \
				XWinClipboardDefines XWinMultiWindowDefines \
				XWinMultiWindowExtWMDefines \
				XWinPThreadsDefines \
				-DDDXBEFORERESET
#define ServerOSDefines		-DDDXTIME -DDDXOSINIT \
				-DDDXOSVERRORF -DDDXOSFATALERROR
#define XkbServerDefines	-DXKB_ALWAYS_USES_SOFT_REPEAT
#define ServerExtraDefines	-DGCCUSESGAS XWinServerDefines \
				AllocateLocalDefines
#define ConnectionFlags		-DTCPCONN
#define ExtraLibraries
#define InstUidFlags		-m 4711
#define UseRgbTxt		YES
#define ExtraFilesToClean	*.obj *.orig *.rej junk.c *.exe *.dll *.lib *~

/* Flags for which the default in X11.tmpl is not what we want. */
#ifndef BuildXinerama
# define BuildXinerama		NO	/* Not supported by XWin Server */
#endif
#ifndef BuildXIE
# define BuildXIE		NO	/* Deprecated */
#endif
#ifndef BuildDPMS
# define BuildDPMS		NO	/* Not supported by XWin Server */
#endif
#ifndef BuildXInputExt
# define BuildXInputExt		YES	/* Not enabled by default */
#endif
#ifndef BuildRandR
# define BuildRandR		YES	/* Not supported by XWin Server */
#endif
#ifndef BuildXF86BigfontExt
# define BuildXF86BigfontExt	NO
#endif
#ifndef BuildGlxExt
# define BuildGlxExt		YES
#endif
#ifndef BuildXprintLib
# define BuildXprintLib		NO
#endif
#ifndef BuildXprint
# define BuildXprint		NO
#endif
#ifndef BuildXterm
# define BuildXterm		NO	/* Built separately on Cygwin */
#endif
#ifndef BuildXResExt
# define BuildXResExt		YES	/* Not enabled by default */
#endif
#ifndef BuildFreeType
# define BuildFreeType		YES	/* Not enabled by default */
#endif
#ifndef BuildXTrueType
# define BuildXTrueType		YES	/* Not enabled by default */
#endif

/* Server build rules */
#ifndef XnestServer
# define XnestServer		NO
#endif
#ifndef XprtServer
# define XprtServer		NO
#endif
#ifndef XVirtualFramebufferServer
# define XVirtualFramebufferServer NO
#endif
#ifndef XWinServer
# define XWinServer		YES
#endif

/*
 * --unix option of Cygwin make fools the standard MakeFlagsToShellFlags macro
 */
#define MakeFlagsToShellFlags(makeflags,shellcmd) \
	for flag in ${MAKEFLAGS} ''; do \				@@\
	  case "$$flag" in *=*) ;;--*) ;; *[makeflags]*) shellcmd;; esac; done

#define MakeNamedTargetSubdir(dir,flags,subname)\
	$(MAKE) -C dir $(MFLAGS) $(PARALLELMFLAGS) flags subname

#ifndef ManSuffix
# define ManSuffix	1
#endif

#ifndef XtransFailSoft
#define XtransFailSoft		YES
#endif

#ifndef HasDevWindows
# define HasDevWindows		NO
#endif

#ifndef RelocateProjectRoot
# define RelocateProjectRoot	YES
#endif

#ifndef UseInstalledOnCrossCompile
# define UseInstalledOnCrossCompile YES
#endif

#include <mingw.rules>

#if CrossCompiling
#include <cross.def>
#endif