Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita1b3bca

Browse files
committed
meson: Implement getopt logic from autoconf
Not replacing getopt/getopt_long definitely causes issues on mingw. It's notas clear whether the solaris & openbsd aspect is still needed, but if not, weshould remove it from both autoconf and meson.Discussion:http://postgr.es/m/20220928022724.erzuk5v4ai4b53do@awork3.anarazel.de
1 parentcaeeabd commita1b3bca

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎meson.build

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,6 +2265,15 @@ posix4_dep = cc.find_library('posix4', required: false)
22652265

22662266
getopt_dep= cc.find_library('getopt',required:false)
22672267
gnugetopt_dep= cc.find_library('gnugetopt',required:false)
2268+
# Check if we want to replace getopt/getopt_long even if provided by the system
2269+
# - Mingw has adopted a GNU-centric interpretation of optind/optreset,
2270+
# so always use our version on Windows
2271+
# - On OpenBSD and Solaris, getopt() doesn't do what we want for long options
2272+
# (i.e., allow '-' as a flag character), so use our version on those platforms
2273+
# - We want to use system's getopt_long() only if the system provides struct
2274+
# option
2275+
always_replace_getopt= host_systemin ['windows','openbsd','solaris']
2276+
always_replace_getopt_long= host_system=='windows'ornot cdata.has('HAVE_STRUCT_OPTION')
22682277

22692278
# Required on BSDs
22702279
execinfo_dep= cc.find_library('execinfo',required:false)
@@ -2295,8 +2304,8 @@ func_checks = [
22952304
['explicit_bzero'],
22962305
['fdatasync', {'dependencies': [rt_dep, posix4_dep],'define':false}],# Solaris
22972306
['getifaddrs'],
2298-
['getopt', {'dependencies': [getopt_dep, gnugetopt_dep]}],
2299-
['getopt_long', {'dependencies': [getopt_dep, gnugetopt_dep]}],
2307+
['getopt', {'dependencies': [getopt_dep, gnugetopt_dep],'skip': always_replace_getopt}],
2308+
['getopt_long', {'dependencies': [getopt_dep, gnugetopt_dep],'skip': always_replace_getopt_long}],
23002309
['getpeereid'],
23012310
['getpeerucred'],
23022311
['inet_aton'],

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp