-
Notifications
You must be signed in to change notification settings - Fork 0
/
makelib.in
204 lines (170 loc) · 5.84 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
#!/usr/bin/perl
# $Id: makelib.in,v 1.12 2022/06/05 11:08:39 cvsuser Exp $
# -*- mode: perl; tabs: 8; indent-width: 4; -*-
# makelib configuration
#
# Copyright (c) 2020 - 2022, Adam Young.
# All rights reserved.
#
# The applications are free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, version 3.
#
# 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 applications are 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
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# ==end==
#
## Package
$PACKAGE = 'inetd-win32';
$PACKAGE_NAME = 'Windows inetd service';
$PACKAGE_VERSION = '0.1.1';
$PACKAGE_URL = 'https://github.com/adamyg/inetd-win32';
$PACKAGE_PATH = 'libw32';
$PACKAGE_FILE = 'package.h';
## External
@LIBRARIES = ( # local libraries -l<xxx> lib<xxx>.lib
'w32',
'compat',
'sthread',
'util',
'syslog',
'iptable',
'inetd'
);
@LIBRARIES2 = ( # local libraries -l<xxx> xxx.lib
);
@TESTLIBRARIES = (); # library test
@OPTLIBRARIES = (); # optional libraries
## Makefiles
@MAKEFILES = ( # local makefiles
'.', # build order
'libw32',
'libcompat',
'libsthread',
'libsyslog',
'libutil',
'libNTService',
'libiptable',
'libinetd',
'service',
'services',
'service_control',
'mmdblookup',
'clients',
'examples'
);
## Toolchain
sub
Configure()
{
add_define('LIBW32_SOCKET_MAP_NATIVE'); # libw32 bindings
################################################################################
# Visual studio
if ($TOOLCHAIN =~ /^vs/) {
set_msvc_runtime('dynamic', '$(RTSUFFIX)');
remove_define('WIN32');
add_define('HAVE_CONFIG_H');
add_define('_WIN32_WINNT=0x600'); # Windows SDK
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');
add_cflag('-wd4996');
}
################################################################################
# OpenWatcom
if ($TOOLCHAIN =~ /^owc/) {
remove_define('WIN32');
add_define('HAVE_CONFIG_H');
add_define('_WIN32_WINNT=0x600'); # Windows SDK
add_define('__STDC_WANT_LIB_EXT1__');
add_xinclude('$(ROOT)/libw32');
add_application_library('libw32.lib');
}
################################################################################
# MingGW
if ($TOOLCHAIN =~ /^mingw/) {
set_cxx_standard(17); # -stdc+17
remove_define('WIN32');
add_define('HAVE_CONFIG_H');
add_define('_WIN32_WINNT=0x600'); # Windows SDK
add_define('HAVE_OPENSSL');
add_xinclude('$(ROOT)/libw32');
add_application_library('libw32.a');
add_system_library('-lssl');
add_system_library('-lcrypto');
if ($TOOLCHAIN =~ /^mingw(64|32)/) {
add_system_library('-lDbghelp'); # debug helpers
add_system_library('-lBcrypt');
}
add_system_library('-lMswsock');
add_system_library('-lNcrypt');
add_system_library('-lCrypt32');
add_system_library('-lRpcrt4');
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;