-
Notifications
You must be signed in to change notification settings - Fork 9
/
makelib.in
313 lines (264 loc) · 8.85 KB
/
makelib.in
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
#!/usr/bin/perl
# $Id: makelib.in,v 1.22 2024/06/16 16:31:42 cvsuser Exp $
# -*- mode: perl; tabs: 8; indent-width: 4; -*-
# makelib configuration
#
# This file is part of the GRIEF Editor.
#
# The GRIEF Editor is free software: you can redistribute it
# and/or modify it under the terms of the GRIEF Editor License.
#
# Redistributions of source code must retain the above copyright
# notice, and must be distributed with the license document above.
#
# Redistributions in binary form must reproduce the above copyright
# notice, and must include the license document above in
# the documentation and/or other materials provided with the
# distribution.
#
# The GRIEF Editor is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# License for more details.
# ==end==
#
## Package
$PACKAGE = 'grief';
$PACKAGE_NAME = 'GRIEF - BRIEF clone';
$PACKAGE_NAME = 'GriefEdit';
$PACKAGE_URL = 'https://github.com/adamyg/grief';
$PACKAGE_PATH = 'include';
$PACKAGE_FILE = 'edpackage.h';
## External
@LIBRARIES = ( # local libraries -l<xxx> lib<xxx>.lib
'vfs',
'charudet',
'chartable',
'widechar',
'teken',
'duktape', # duktape embeddable JavaScript engine.
'duktape_static',
'llist',
'splay',
'trie',
'onigrx', # Oniguruma - Regular expressions library.
'tre', # TRE - The free and portable approximate regex matching library.
'misc',
'w32',
'iconv',
'citrus',
'bsdio',
'bsdfetch',
'bsddb',
'bsdmdoc',
'dlmalloc'
);
@LIBRARIES2 = ( # local libraries -l<xxx> xxx.lib
'libw32',
'libw32_static',
'libz',
# 'libz_static',
);
@TESTLIBRARIES = (); # library test
@OPTLIBRARIES = ( # optional libraries
'aspell',
'iconv',
'intl',
'charset',
'expat'
);
## Makefiles
@MAKEFILES = ( # local makefiles
'.', # build order
'libw32',
'^contrib',
'^contrib/makedepend',
'^contrib/flex',
'^contrib/byacc',
'^contrib/extags',
'^contrib/libz',
'^contrib/libbzip2',
'^contrib/liblzma', # owc and MSVC2013+
'^contrib/libregex',
'^contrib/libmagic',
'^contrib/libguess',
'^contrib/libarchive',
'^contrib/libcitrus',
'!^contrib/libiconv', # optional/recursive
'^contrib/libintl',
'^contrib/hunspell',
'!^contrib/icu', # optional local ICU installation
'^libfltk',
'libduktape',
'libvfs',
'libchartable',
'libwidechar',
'libcharudet',
'libteken',
'libonigrx',
'libtre',
'libmisc',
'libtrie',
'libllist',
'libsplay',
'libterm',
'libmalloc',
'libbsdio',
'libbsddb',
'libbsdfetch',
'gr',
'grcpp',
'grmandoc',
'grunch',
'gm',
'macsrc',
'hlpdoc',
'util',
'^win32/AutoUpdater'
);
@CONTRIBEXTRA = ( # additional packages
'^contrib/libopenssl'
);
## Toolchain
sub
ResolveWINKITx86()
{
my $ProgramFiles = $ENV{"ProgramFiles(x86)"};
$ProgramFiles =~ s/\\/\//g;
my @WINKIT = ( # Vista+
# https://en.wikipedia.org/wiki/Microsoft_Windows_SDK
"${ProgramFiles}/Windows Kits/8.0/Lib/win8/um/x86",
"${ProgramFiles}/Windows Kits/8.1/Lib/winv6.3/um/x86",
"${ProgramFiles}/Windows Kits/10",
"${ProgramFiles}/Windows Kits/11"
);
my @sdks;
foreach (@WINKIT) {
my $sdk = $_;
next if (! -d $sdk);
if (/\/1[01]$/) { # "Lib/10.0.xxxxx.0/um/x86"
my @winsdk10 = glob("'${sdk}/Lib/*/um/x86'");
foreach (@winsdk10) {
next if (! -f "$_/Kernel32.lib");
push @sdks, $_;
}
} else {
next if (! -f "${sdk}/Kernel32.lib");
push @sdks, $sdk;
}
}
die "cannot locate any suitable winsdks\n"
if (! scalar @sdks);
foreach (@sdks) {
print "WINKIT: $_\n";
}
set_winsdk($sdks[0]);
}
sub
Configure()
{
################################################################################
# Common
################################################################################
# Visual studio
if ($TOOLCHAIN =~ /^vs/) {
set_msvc_runtime('dynamic', '$(RTSUFFIX)');
remove_define('WIN32');
add_define('HAVE_CONFIG_H');
add_define('LIBW32_DYNAMIC');
add_define('_WIN32_WINNT=0x501'); # Windows SDK
add_define('WINVER=0x501');
add_define('_CRT_SECURE_NO_WARNINGS');
add_define('_CRT_SECURE_NO_DEPRECATE');
add_define('_CRT_NONSTDC_NO_DEPRECATE');
add_xinclude('$(ROOT)/libw32');
add_xinclude('$(ROOT)/libw32/msvc'); # MSVC specials
add_application_library('libw32.lib');
}
################################################################################
# OpenWatcom
if ($TOOLCHAIN =~ /^owc/) {
remove_define('WIN32');
add_define('HAVE_CONFIG_H');
add_define('LIBW32_DYNAMIC');
add_define('_WIN32_WINNT=0x501'); # Windows SDK
add_define('WINVER=0x501');
add_define('__STDC_WANT_LIB_EXT1__');
add_xinclude('$(ROOT)/libw32');
add_application_library('libw32.lib');
}
################################################################################
# MingGW
if ($TOOLCHAIN =~ /^mingw/) {
remove_define('WIN32');
add_define('HAVE_CONFIG_H');
add_define('LIBW32_DYNAMIC');
add_define('_WIN32_WINNT=0x501'); # Windows SDK
add_define('WINVER=0x501');
add_define('__USE_MINGW_ANSI_STDIO=1'); # printf() ANSI C99 compatible implementation
add_xinclude('$(ROOT)/libw32');
add_application_library('libw32.a');
if ($TOOLCHAIN =~ /^mingw(64|32)/) { # newer libraries
add_system_library('-lDbghelp');
add_system_library('-lBcrypt');
add_system_library('-lNcrypt');
}
add_system_library('-lComctl32'); # updater, common controls
add_system_library('-lComdlg32');
add_system_library('-lOleAut32');
add_system_library('-lMswsock');
add_system_library('-lCrypt32');
add_system_library('-lRpcrt4');
add_system_library('-lWinmm');
add_system_library('-lIphlpapi');
add_system_library('-lVersion');
push @TESTLIBRARIES, "pthread|LIBTHREAD";
}
}
# Example usage
#
# # Configuration
# ifeq ("$(BUILD_TYPE)","") #default
# BUILD_TYPE= debug
# MAKEFLAGS+= BUILD_TYPE=debug
# endif
# ifneq ("$(BUILD_TYPE)","release")
# # MSVC Run-time suffix
# RTSUFFIX=d
# endif
#
# # Common flags
# XFLAGS=
# CFLAGS= @CFLAGS@
# CWARN= @CWARN@ $(CWALL)
# CDEBUG= @CDEBUG@
# CRELEASE= @CRELEASE@
#
# CXXFLAGS= @CXXFLAGS@
# CXXDEBUG= @CXXDEBUG@
# ifeq ("$(CXXDEBUG)","")
# CXXDEBUG= $(CDEBUG)
# endif
# CXXRELEASE= @CXXRELEASE@
# ifeq ("$(CXXRELEASE)","")
# CXXRELEASE= $(CRELEASE)
# endif
#
# LDDEBUG= @LDDEBUG@
# LDRELEASE= @LDRELEASE@
#
# CINCLUDE= <additional> @CINCLUDE@
# CEXTRA= @DEFS@ <additional>
#
# ifeq ("$(BUILD_TYPE)","release")
# CFLAGS+= $(CRELEASE) $(CWARN) $(CINCLUDE) $(CEXTRA) $(XFLAGS)
# CXXFLAGS+= $(CXXRELEASE) $(CWARN) $(CINCLUDE) @CXXINCLUDE@ $(CEXTRA) $(XFLAGS)
# LDFLAGS= $(LDRELEASE) @LDFLAGS@
# else
# CFLAGS+= $(CDEBUG) $(CWARN) $(CINCLUDE) $(CEXTRA) $(XFLAGS)
# CXXFLAGS+= $(CXXDEBUG) $(CWARN) $(CINCLUDE) @CXXINCLUDE@ $(CEXTRA) $(XFLAGS)
# LDFLAGS= $(LDDEBUG) @LDFLAGS@
# endif
# LDLIBS= -L$(D_LIB) @LDLIBS@ @LIBS@ @EXTRALIBS@
#
1;