-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig.bld
154 lines (141 loc) · 6.26 KB
/
Config.bld
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
// tool/Config.bld
//
// This file defines certain configuration variables that are written
// into the various make scripts. It is processed by oconfig (along
// with the Soruces.bld files in each of the various directories) to
// generate bulid scripts appropriate to each environment.
//
// oconfig is capable of generating makefiles for Unix compilers such
// as gcc or SGI's MipsPRO compiler, as well as for Windows environments
// like Microsoft's Visual C++. It can also generate Microsoft
// Developer's Studio solution and project files directly. In principle,
// it can be extended to generate suitable build script files for any
// number of different build environments.
//
// All of these build scripts can be tuned for a particular
// environment via this file. This is the place for the user to
// specify which external packages are installed and where, or to
// enable or disable certan optional features. However, it is
// suggested that rather then modify this file directly, you create
// a custom file in your home directory and there redefine whatever
// variables are appropriate, and set the environment variable
// OCONFIG_CONFIG to refer to it. In this way, you can easilly get
// an updated source tree (including a new Config.bld) without
// risking accidentally losing your customizations. This also avoids
// having to redefine the same variables in different packages (for
// instance in Platform and in Projects).
//
// The syntax in this file resembles some hybrid between C++
// preprocessor declarations and GNU make variables. This is the
// syntax used in the various oconfig system configuration files; it
// is designed to be easy to use as a macro language to generate
// makefiles and their ilk.
//
// Some of the variables below are defined using the #define command,
// and others are defined using #defer. The two are very similar in
// their purpose; the difference is that, if the variable definition
// includes references to other variables (e.g. $[varname]), then
// #define will evaluate all of the other variable references
// immediately and store the resulting expansion, while #defer will
// store only the variable references themselves, and expand them when
// the variable is later referenced. It is very similar to the
// relationship between := and = in GNU Make.
//
// In general, #defer is used in this file, to allow the user to
// redefine critical variables in his or her own Config.bld file.
// What kind of build scripts are we generating? This selects a
// suitable template file from the oconfig system files. The
// allowable choices, at present, are:
//
// unix - Generate makefiles suitable for most Unix platforms.
// msvc - Generate Visual C++ solution and project files.
// gmsvc - Generate makefiles similar to the above, using Mircosoft
// Visual C++, bus uses the Cygwin-supplied GNU make
// instead of Microsoft nmake. This is potentially
// faster if you have multiple CPU's, since it supports
// distributed make. It's a tiny bit slower if you're
// not taking advantage of distributed make, because of
// the overhead associated with Cygwin fork() calls.
#if $[eq $[PLATFORM], Win32]
// allow folks to have msvc7 defined
#if $[eq $[BUILD_TYPE],]
#print defining msvc2015 $[BUILD_TYPE]
#define BUILD_TYPE msvc2015
#else
#print defaulting to build type $[BUILD_TYPE]
#endif
#elif $[eq $[PLATFORM], Cygwin]
#define BUILD_TYPE gmsvc
#elif $[eq $[PLATFORM], osx]
#define BUILD_TYPE osx
#else
#define BUILD_TYPE unix
#endif
// I'm allowing the ODIR suffix (usually empty) to be appended to the install dir
// as well. That may be a mistake, but it seems reasonable right now
// TODO: decide if I am going to delete this.
//#define INSTALL_DIR $[standardize $[TOPDIR]/../wink$[ODIR_SUFFIX]]
// What directory name should the .o (or .obj) files be written to?
// This can be any name, and it can be used to differentiate different
// builds within the same tree. However, don't define this to be '.',
// or you will be very sad the next time you run 'make clean'.
// ODIR_SUFFIX is optional, usually empty.
// TODO: this should be deleted
//#defer ODIR_BLD bld$[ODIR_SUFFIX]/$[DEPOT]
//#defer ODIR $[canonical $[TOPDIR]/../bld$[ODIR_SUFFIX]/$[DEPOT]]
// What is the normal extension of a compiled object file?
#if $[WINDOWS_PLATFORM]
#define OBJ .obj
#define EXE .exe
#define SCRIPT_EXT .bat
#else
#define OBJ .o
#define EXE
#define SCRIPT_EXT .sh
#endif
// What platforms we know about
#define KNOWN_PLATFORMS Win32 Linux osx
// What we consider compilable sources
#defer COMPILABLE_TYPES %.cpp %.cxx %.h %.hpp %.c %.I %.rc
// What we consider to be perl files
#defer PERL_TYPES %.pl %.pm
// TODO: this should be moved out of here
///////////////////////////////////////////////////////////////////////
// The following variables are only meaningful when BUILD_TYPE is
// "unix". These define the commands to invoke the compiler, linker,
// etc.
//////////////////////////////////////////////////////////////////////
// What is the file suffix that should be used for precompiled headers
// TODO: this should be moved elsewhere
//#define PRECOMP_EXT pch
//
//#define DO_PCH 1
// How to invoke the C and C++ compilers.
// TODO: this should be moved elsewhere
//#if $[eq $[USE_COMPILER], GCC]
//
// #if $[USE_DISTCC]
// #define CC distcc gcc
// #define CXX distcc g++
// #else
// #define CC gcc
// #define CXX g++
// #endif
//
// // gcc might run into template limits on some parts of Platform.
// #define CFLAGS_GEN -Wall -W -Wno-sign-compare -Wno-unused -pthread -fpic -fmerge-constants -msse
// #define C++FLAGS_GEN $[CFLAGS_GEN] -ftemplate-depth-32 -Wno-non-virtual-dtor -Wno-deprecated -fmerge-constants
//
// // gcc likes a different name for it's precompiled headers
// #set PRECOMP_EXT gch
//#else
// #define CC cc
// #define CXX CC
//#endif
//////////////////////////////////////////////////////////////////////
// There are also some additional variables that control specific
// compiler/platform features or characteristics, defined in the
// platform specific file Config.platform.bld. Be sure to inspect
// these variables for correctness too.
//////////////////////////////////////////////////////////////////////
#include $[BUILD_SCRIPTS]/Defaults.bld