1
0
Fork 0
elinks/meson.build

1037 lines
30 KiB
Meson
Raw Normal View History

2022-12-25 20:14:52 +00:00
project('elinks', ['c','cpp'], version:'0.17.GIT', license:'GPLv2', default_options:['cpp_std=gnu++17'])
srcs=[]
srcdir = meson.source_root()
git = find_program('git', required: false)
if git.found()
txt = run_command('git', '--git-dir=' + srcdir + '/.git', 'rev-parse', 'HEAD', check:false).stdout().strip()
dirty = run_command(srcdir + '/git-dirty.sh', check:false).stdout().strip()
else
txt = ''
dirty = ''
endif
add_global_arguments('-DBUILD_ID="' + txt + dirty + '"', language : 'c')
conf_data = configuration_data()
2020-12-27 18:39:52 +00:00
conf_data.set('VERSION', meson.project_version())
conf_data.set('PACKAGE', meson.project_name())
2023-04-26 16:57:45 +00:00
conf_data.set('DATE', run_command('date', '%Y-%m-%d', check:false).stdout().strip())
conf_data.set('CONFIG_LARGEFILE', get_option('largefile'))
conf_data.set('CONFIG_BOOKMARKS', get_option('bookmarks'))
conf_data.set('CONFIG_XBEL_BOOKMARKS', get_option('xbel'))
conf_data.set('CONFIG_SCRIPTING_SPIDERMONKEY', get_option('sm-scripting'))
2021-03-28 16:47:35 +00:00
conf_data.set('CONFIG_NLS', get_option('nls'))
conf_data.set('CONFIG_GETTEXT', get_option('gettext'))
conf_data.set('CONFIG_COOKIES', get_option('cookies'))
conf_data.set('CONFIG_FORMHIST', get_option('formhist'))
conf_data.set('CONFIG_GLOBHIST', get_option('globhist'))
conf_data.set('CONFIG_MAILCAP', get_option('mailcap'))
conf_data.set('CONFIG_MIMETYPES', get_option('mimetypes'))
conf_data.set('CONFIG_IPV6', get_option('ipv6'))
2020-09-13 14:12:57 +00:00
conf_data.set('CONFIG_BITTORRENT', get_option('bittorrent'))
conf_data.set('CONFIG_DATA', get_option('data'))
conf_data.set('CONFIG_GEMINI', get_option('gemini'))
conf_data.set('CONFIG_URI_REWRITE', get_option('uri-rewrite'))
conf_data.set('CONFIG_CGI', get_option('cgi'))
2022-05-16 20:01:41 +00:00
conf_data.set('CONFIG_DGI', get_option('dgi'))
conf_data.set('CONFIG_FINGER', get_option('finger'))
conf_data.set('CONFIG_FSP', get_option('fsp'))
conf_data.set('CONFIG_FSP2', get_option('fsp2'))
conf_data.set('CONFIG_FTP', get_option('ftp'))
conf_data.set('CONFIG_GOPHER', get_option('gopher'))
conf_data.set('CONFIG_NNTP', get_option('nntp'))
conf_data.set('CONFIG_SMB', get_option('smb'))
conf_data.set('CONFIG_MOUSE', get_option('mouse'))
conf_data.set('CONFIG_SYSMOUSE', get_option('sysmouse'))
conf_data.set('CONFIG_88_COLORS', get_option('88-colors'))
conf_data.set('CONFIG_256_COLORS', get_option('256-colors'))
conf_data.set('CONFIG_TRUE_COLOR', get_option('true-color'))
conf_data.set('CONFIG_EXMODE', get_option('exmode'))
conf_data.set('CONFIG_LEDS', get_option('leds'))
conf_data.set('CONFIG_MARKS', get_option('marks'))
conf_data.set('CONFIG_CSS', get_option('css'))
conf_data.set('CONFIG_DOM', get_option('html-highlight'))
conf_data.set('CONFIG_BACKTRACE', get_option('backtrace'))
conf_data.set('CONFIG_NO_ROOT', get_option('no-root'))
conf_data.set('CONFIG_DEBUG', get_option('withdebug'))
conf_data.set('CONFIG_FASTMEM', get_option('fastmem'))
conf_data.set('CONFIG_OWN_LIBC', get_option('own-libc'))
conf_data.set('CONFIG_SMALL', get_option('small'))
conf_data.set('CONFIG_UTF8', get_option('utf-8'))
conf_data.set('CONFIG_COMBINE', get_option('combining'))
conf_data.set('CONFIG_XTERM', get_option('xterm'))
conf_data.set('CONFIG_GPM', get_option('gpm'))
conf_data.set('CONFIG_TERMINFO', get_option('terminfo'))
conf_data.set('CONFIG_GZIP', get_option('zlib'))
conf_data.set('CONFIG_BZIP2', get_option('bzlib'))
conf_data.set('CONFIG_BROTLI', get_option('brotli'))
conf_data.set('CONFIG_ZSTD', get_option('zstd'))
2023-01-02 16:09:24 +00:00
conf_data.set('CONFIG_IDN2', get_option('idn'))
conf_data.set('CONFIG_LZMA', get_option('lzma'))
conf_data.set('CONFIG_GSSAPI', get_option('gssapi'))
conf_data.set('CONFIG_ECMASCRIPT_SMJS', get_option('spidermonkey'))
conf_data.set('CONFIG_SCRIPTING_GUILE', get_option('guile'))
conf_data.set('CONFIG_SCRIPTING_PERL', get_option('perl'))
conf_data.set('CONFIG_SCRIPTING_PYTHON', get_option('python'))
conf_data.set('CONFIG_LIBSIXEL', get_option('libsixel'))
conf_data.set('CONFIG_REPRODUCIBLE', get_option('reproducible'))
conf_data.set('SOURCE_DATE_EPOCH', get_option('source-date-epoch'))
luapkg = get_option('luapkg')
if luapkg != ''
conf_data.set('CONFIG_SCRIPTING_LUA', true)
else
conf_data.set('CONFIG_SCRIPTING_LUA', false)
endif
conf_data.set('CONFIG_TRE', get_option('tre'))
conf_data.set('CONFIG_SCRIPTING_RUBY', get_option('ruby'))
conf_data.set('CONFIG_GNUTLS', get_option('gnutls'))
conf_data.set('CONFIG_OPENSSL', get_option('openssl'))
conf_data.set('CONFIG_LIBEV', get_option('libev'))
conf_data.set('CONFIG_LIBEVENT', get_option('libevent'))
conf_data.set('CONFIG_X', get_option('x'))
2021-10-16 18:54:08 +00:00
conf_data.set('CONFIG_QUICKJS', get_option('quickjs'))
2022-08-01 19:31:07 +00:00
conf_data.set('CONFIG_MUJS', get_option('mujs'))
conf_data.set('CONFIG_CODEPOINT', get_option('codepoint'))
2022-08-01 19:31:07 +00:00
if conf_data.get('CONFIG_SCRIPTING_SPIDERMONKEY') or conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_QUICKJS') or conf_data.get('CONFIG_MUJS')
conf_data.set('CONFIG_ECMASCRIPT', true)
else
conf_data.set('CONFIG_ECMASCRIPT', false)
endif
if conf_data.get('CONFIG_SCRIPTING_SPIDERMONKEY') and conf_data.get('CONFIG_QUICKJS')
error('quickjs and sm-scripting cannot be both enabled')
endif
if conf_data.get('CONFIG_SCRIPTING_SPIDERMONKEY') and conf_data.get('CONFIG_MUJS')
error('mujs and sm-scripting cannot be both enabled')
endif
if conf_data.get('CONFIG_ECMASCRIPT_SMJS') and conf_data.get('CONFIG_QUICKJS')
error('quickjs and spidermonkey cannot be both enabled')
endif
if conf_data.get('CONFIG_ECMASCRIPT_SMJS') and conf_data.get('CONFIG_MUJS')
error('mujs and spidermonkey cannot be both enabled')
endif
if conf_data.get('CONFIG_QUICKJS') and conf_data.get('CONFIG_MUJS')
error('mujs and quickjs cannot be both enabled')
endif
2023-11-21 14:31:22 +00:00
if conf_data.get('CONFIG_LIBEV') and conf_data.get('CONFIG_LIBEVENT')
error('libev and libevent cannot be both enabled')
endif
2023-11-21 14:34:17 +00:00
if conf_data.get('CONFIG_FSP') and conf_data.get('CONFIG_FSP2')
error('fsp and fsp2 cannot be both enabled')
endif
conf_data.set('CONFIG_ECMASCRIPT_SMJS_HEARTBEAT', true)
conf_data.set('CONFIG_SCRIPTING', true)
system = host_machine.system()
if system == 'haiku'
conf_data.set('CONFIG_OS_BEOS', true)
else
conf_data.set('CONFIG_OS_BEOS', false)
endif
if system == 'windows'
conf_data.set('CONFIG_OS_WIN32', true)
else
conf_data.set('CONFIG_OS_WIN32', false)
endif
2022-06-28 18:24:22 +00:00
if system == 'dos'
conf_data.set('CONFIG_OS_DOS', true)
else
conf_data.set('CONFIG_OS_DOS', false)
endif
if system != 'dos' and system != 'haiku' and system != 'windows'
conf_data.set('CONFIG_OS_UNIX', true)
else
conf_data.set('CONFIG_OS_UNIX', false)
endif
if conf_data.get('CONFIG_GNUTLS') or conf_data.get('CONFIG_OPENSSL')
conf_data.set('CONFIG_SSL', true)
else
conf_data.set('CONFIG_SSL', false)
endif
conf_data.set('CONFIG_OS_OS2', false)
conf_data.set('CONFIG_OS_RISCOS', false)
# AC_HEADER_DIRENT
conf_data.set('HAVE_DIRENT_H', 1)
2023-11-04 19:30:25 +00:00
# AC_HEADER_TIME
conf_data.set('HAVE_SYS_TIME_H', 1)
compiler = meson.get_compiler('c')
extracflags = []
extracppflags = []
2021-06-12 11:29:05 +00:00
if conf_data.get('CONFIG_ECMASCRIPT')
2022-10-13 13:53:54 +00:00
extracppflags += ['-fpermissive', '-Wno-sign-compare']
endif
2023-11-04 19:30:25 +00:00
if compiler.has_header('sys/wait.h')
conf_data.set('HAVE_SYS_WAIT_H', 1)
endif
if compiler.has_header('wchar.h')
conf_data.set('HAVE_WCHAR_H', 1)
endif
if compiler.has_header('wctype.h')
conf_data.set('HAVE_WCTYPE_H', 1)
endif
if compiler.has_header('fcntl.h')
conf_data.set('HAVE_FCNTL_H', 1)
endif
2022-05-08 11:59:24 +00:00
if compiler.has_header('libgen.h')
conf_data.set('HAVE_LIBGEN_H', 1)
endif
if compiler.has_header('unistd.h')
conf_data.set('HAVE_UNISTD_H', 1)
endif
if compiler.has_header('arpa/inet.h')
conf_data.set('HAVE_ARPA_INET_H', 1)
endif
if compiler.has_header('netinet/in_systm.h')
conf_data.set('HAVE_NETINET_IN_SYSTM_H', 1)
endif
if compiler.has_header('netinet/in_system.h')
conf_data.set('HAVE_NETINET_IN_SYSTEM_H', 1)
endif
if compiler.has_header('netinet/ip.h')
conf_data.set('HAVE_NETINET_IP_H', 1)
endif
if compiler.has_header('netdb.h')
conf_data.set('HAVE_NETDB_H', 1)
endif
if compiler.has_header('netinet/in.h')
conf_data.set('HAVE_NETINET_IN_H', 1)
endif
if compiler.has_header('netinet/in6_var.h')
conf_data.set('HAVE_NETINET_IN6_VAR_H', 1)
endif
if compiler.has_header('ifaddrs.h')
conf_data.set('HAVE_IFADDRS_H', 1)
endif
if compiler.has_header('sys/cygwin.h')
conf_data.set('HAVE_SYS_CYGWIN_H', 1)
endif
if compiler.has_header('io.h')
conf_data.set('HAVE_IO_H', 1)
endif
if compiler.has_header('sys/fmutex.h')
conf_data.set('HAVE_SYS_FMUTEX_H', 1)
endif
if compiler.has_header('sys/ioctl.h')
conf_data.set('HAVE_SYS_IOCTL_H', 1)
endif
2022-11-21 15:51:40 +00:00
if compiler.has_header('sys/kd.h')
conf_data.set('HAVE_SYS_KD_H', 1)
endif
if compiler.has_header('sys/sockio.h')
conf_data.set('HAVE_SYS_SOCKIO_H', 1)
endif
if compiler.has_header('sys/resource.h')
conf_data.set('HAVE_SYS_RESOURCE_H', 1)
endif
if compiler.has_header('sys/select.h')
conf_data.set('HAVE_SYS_SELECT_H', 1)
endif
if compiler.has_header('sys/socket.h')
conf_data.set('HAVE_SYS_SOCKET_H', 1)
endif
if compiler.has_header('sys/utsname.h')
conf_data.set('HAVE_SYS_UTSNAME_H', 1)
endif
if compiler.has_header('net/if.h')
conf_data.set('HAVE_NET_IF_H', 1)
endif
if compiler.has_header('stdint.h')
conf_data.set('HAVE_STDINT_H', 1)
endif
if compiler.has_header('inttypes.h')
conf_data.set('HAVE_INTTYPES_H', 1)
endif
if compiler.has_header('pwd.h')
conf_data.set('HAVE_PWD_H', 1)
endif
if compiler.has_header('termios.h')
conf_data.set('HAVE_TERMIOS_H', 1)
endif
if compiler.has_header('poll.h')
conf_data.set('HAVE_POLL_H', 1)
endif
if compiler.has_header('sys/types.h')
conf_data.set('HAVE_SYS_TYPES_H', 1)
endif
if compiler.has_header('gpm.h')
conf_data.set('HAVE_GPM_H', 1)
endif
2023-01-02 16:09:24 +00:00
if compiler.has_header('idn2.h')
conf_data.set('HAVE_IDN2_H', 1)
endif
2021-01-13 21:02:30 +00:00
if compiler.has_header('event.h')
conf_data.set('HAVE_EVENT_H', 1)
endif
if compiler.has_header('alloca.h')
conf_data.set('HAVE_ALLOCA_H', 1)
endif
if compiler.has_header('stdalign.h')
conf_data.set('HAVE_STDALIGN_H', 1)
endif
if compiler.has_header('term.h')
conf_data.set('HAVE_TERM_H', 1)
endif
2023-11-04 19:30:25 +00:00
if compiler.has_header('windows.h')
conf_data.set('HAVE_WINDOWS_H', 1)
endif
2023-11-08 11:28:00 +00:00
if compiler.has_header('winsock2.h')
conf_data.set('HAVE_WINSOCK2_H', 1)
endif
2023-11-04 19:30:25 +00:00
if compiler.has_header('ws2tcpip.h')
conf_data.set('HAVE_WS2TCPIP_H', 1)
endif
st = get_option('static')
deps = []
if conf_data.get('CONFIG_GZIP')
zdeps = dependency('zlib', static: st, required: false)
if not zdeps.found()
zdeps = compiler.find_library('z', static: st, dirs: [get_option('prefix')+'/lib', '/usr/local/lib'])
endif
if zdeps.found()
deps += zdeps
endif
endif
if conf_data.get('CONFIG_TRE')
tredeps = dependency('tre', static: st)
deps += tredeps
endif
2021-07-05 12:28:25 +00:00
eh = ''
if conf_data.get('CONFIG_LIBEV')
conf_data.set('HAVE_LIBEV_EVENT_H', compiler.has_header('libev/event.h'))
conf_data.set('HAVE_LIBEV', true)
eh = '#include <libev/event.h>'
eventdeps = compiler.find_library('ev', static: st)
2021-07-05 12:28:25 +00:00
deps += eventdeps
conf_data.set('CONFIG_LIBEVENT', false)
2021-07-05 12:28:25 +00:00
elif conf_data.get('CONFIG_LIBEVENT')
eh = '#include <event.h>'
eventdeps = dependency('libevent', static: st)
deps += eventdeps
conf_data.set('HAVE_LIBEVENT', true)
else
eventdeps = []
endif
gnutlsdeps = []
ssldeps = []
if conf_data.get('CONFIG_OPENSSL')
ssldeps = dependency('openssl', static: st, required: false)
if not ssldeps.found()
ssldeps = compiler.find_library('ssl', static: st, dirs: [get_option('prefix')+'/lib', '/usr/local/lib'])
endif
deps += ssldeps
conf_data.set('USE_OPENSSL', true)
conf_data.set('CONFIG_GNUTLS', false)
elif conf_data.get('CONFIG_GNUTLS')
gnutlsdeps = dependency('gnutls', static: st)
libgcryptdeps = dependency('libgcrypt', static: st)
deps += gnutlsdeps
deps += libgcryptdeps
endif
2022-08-21 10:55:07 +00:00
if conf_data.get('CONFIG_GSSAPI')
gssapideps = dependency('krb5-gssapi', static: st)
deps += gssapideps
endif
if conf_data.get('CONFIG_BROTLI')
brotlideps = dependency('libbrotlidec', static: st)
deps += brotlideps
endif
if conf_data.get('CONFIG_ZSTD')
zstatic = st
if conf_data.get('CONFIG_DEBUG')
zstatic = true
endif
zstddeps = dependency('libzstd', static: zstatic)
deps += zstddeps
endif
2021-12-13 15:22:50 +00:00
if conf_data.get('CONFIG_LZMA')
lzmadeps = dependency('liblzma', static: st)
2021-12-13 15:22:50 +00:00
deps += lzmadeps
endif
2023-01-02 16:09:24 +00:00
if conf_data.get('CONFIG_IDN2')
idndeps = dependency('libidn2', static: st)
deps += idndeps
endif
2022-10-13 14:56:40 +00:00
x11deps = []
2020-09-14 18:11:53 +00:00
conf_data.set('HAVE_X11', false)
if conf_data.get('CONFIG_X')
x11deps = dependency('x11', static: st)
deps += x11deps
2020-09-14 18:11:53 +00:00
conf_data.set('HAVE_X11', compiler.has_header('X11/Xlib.h'))
endif
if conf_data.get('CONFIG_BZIP2')
bz2deps = dependency('bzip2', static: st, required: false)
if not bz2deps.found()
bz2deps = compiler.find_library('bz2', static: st, dirs: [get_option('prefix')+'/lib', '/usr/local/lib'])
endif
deps += bz2deps
endif
2022-10-13 13:53:54 +00:00
mozjsdeps = []
if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_SCRIPTING_SPIDERMONKEY')
2022-10-01 17:59:24 +00:00
mozjsdeps = dependency('mozjs-102', static: st)
deps += mozjsdeps
endif
2022-08-01 19:31:07 +00:00
if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_QUICKJS') or conf_data.get('CONFIG_MUJS')
sqlite3deps = dependency('sqlite3', static: st)
2021-02-24 09:01:02 +00:00
deps += sqlite3deps
endif
2023-06-11 14:39:56 +00:00
conf_data.set('CONFIG_LIBCURL', false)
curldeps = false
if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_QUICKJS') or conf_data.get('CONFIG_MUJS')
curldeps = dependency('libcurl', static: st, required: false)
if not curldeps.found()
curldeps = compiler.find_library('curl', static: st, dirs: [get_option('prefix')+'/lib', '/usr/local/lib'])
endif
if curldeps.found()
deps += curldeps
conf_data.set('CONFIG_LIBCURL', true)
endif
2023-06-11 14:39:56 +00:00
endif
if not conf_data.get('CONFIG_LIBCURL') and get_option('libcurl')
curldeps = dependency('libcurl', static: st, required: false)
if not curldeps.found()
curldeps = compiler.find_library('curl', static: st, dirs: [get_option('prefix')+'/lib', '/usr/local/lib'])
endif
if curldeps.found()
deps += curldeps
conf_data.set('CONFIG_LIBCURL', true)
endif
endif
conf_data.set('CONFIG_LIBCSS', false)
cssdeps = false
2023-02-01 16:43:21 +00:00
if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_QUICKJS') or conf_data.get('CONFIG_MUJS')
cssdeps = dependency('libcss', static: st, version: '>=0.9.1')
deps += cssdeps
conf_data.set('CONFIG_LIBCSS', true)
2023-02-01 16:43:21 +00:00
endif
conf_data.set('CONFIG_LIBDOM', false)
libdomdeps = false
if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_QUICKJS') or conf_data.get('CONFIG_MUJS')
libdomdeps = dependency('libdom', static: st, version: '>=0.4.1')
deps += libdomdeps
conf_data.set('CONFIG_LIBDOM', true)
endif
2023-05-15 17:26:27 +00:00
if not conf_data.get('CONFIG_LIBCSS') and get_option('libcss')
cssdeps = dependency('libcss', static: st, version: '>=0.9.1')
deps += cssdeps
conf_data.set('CONFIG_LIBCSS', true)
2023-05-15 17:26:27 +00:00
if not conf_data.get('CONFIG_LIBDOM')
libdomdeps = dependency('libdom', static: st, version: '>=0.4.1')
deps += libdomdeps
conf_data.set('CONFIG_LIBDOM', true)
endif
endif
if conf_data.get('CONFIG_SCRIPTING_LUA')
luadeps = dependency(luapkg, static: st, required: false)
if not luadeps.found()
luadeps = compiler.find_library(luapkg, static: st, dirs: [get_option('prefix')+'/lib','/usr/local/lib'])
endif
deps += luadeps
endif
if conf_data.get('CONFIG_XBEL_BOOKMARKS')
expatdeps = dependency('expat', static: st, required: false)
if not expatdeps.found()
expatdeps = compiler.find_library('expat', static: st, dirs: [get_option('prefix')+'/lib','/usr/local/lib'])
endif
deps += expatdeps
endif
if conf_data.get('CONFIG_GPM')
libgpmdeps = compiler.find_library('gpm', static: st)
deps += libgpmdeps
endif
if conf_data.get('CONFIG_SCRIPTING_PYTHON')
python3deps = dependency('python3-embed', static: st)
deps += python3deps
endif
2021-07-03 18:39:38 +00:00
if conf_data.get('CONFIG_SCRIPTING_PERL')
perl_libs = ''
2022-11-25 16:53:36 +00:00
perl_l = run_command('perl', '-MExtUtils::Embed', '-e', 'ldopts', check:true)
2021-07-03 18:39:38 +00:00
if perl_l.returncode() == 0
perl_libs = perl_l.stdout().strip().split()
endif
perl_cflags = ''
2022-11-25 16:53:36 +00:00
perl_c = run_command('perl', '-MExtUtils::Embed', '-e', 'ccopts', check:true)
2021-07-03 18:39:38 +00:00
if perl_c.returncode() == 0
perl_cflags = perl_c.stdout().strip().split()
endif
perl_dep = declare_dependency(compile_args: perl_cflags, link_args: perl_libs)
deps += perl_dep
endif
2022-01-29 10:38:31 +00:00
conf_data.set('CONFIG_PERL_POPPX_WITHOUT_N_A', 1)
rubydeps = []
if conf_data.get('CONFIG_SCRIPTING_RUBY')
rubydeps = dependency('ruby', static: st)
deps += rubydeps
endif
guiledeps = []
if conf_data.get('CONFIG_SCRIPTING_GUILE')
guiledeps = dependency('guile-3.0', static: st)
deps += guiledeps
endif
2020-09-12 16:29:23 +00:00
if conf_data.get('CONFIG_FSP')
fspdeps = compiler.find_library('fsplib', static: st)
2020-09-12 16:29:23 +00:00
deps += fspdeps
endif
2022-01-11 19:34:35 +00:00
if conf_data.get('CONFIG_SMB')
smbdeps = dependency('smbclient', static: st)
deps += smbdeps
endif
2021-12-05 16:26:35 +00:00
dep_atomic = dependency('', required: false)
if not compiler.links('''#include <stdint.h>
int main() {
struct {
uint64_t *v;
} x;
return (int)__atomic_load_n(x.v, __ATOMIC_ACQUIRE) & (int)__atomic_add_fetch(x.v, (uint64_t)1, __ATOMIC_ACQ_REL);
}''',
name: 'GCC atomic builtins required -latomic')
dep_atomic = compiler.find_library('atomic', static: st)
2021-12-05 16:26:35 +00:00
endif
2021-10-16 18:54:08 +00:00
if conf_data.get('CONFIG_QUICKJS')
quickjsdeps = compiler.find_library('quickjs/libquickjs', static: true, dirs: [get_option('prefix')+'/lib','/usr/local/lib'])
2021-10-16 18:54:08 +00:00
deps += quickjsdeps
2021-12-05 16:26:35 +00:00
deps += dep_atomic
2021-10-16 18:54:08 +00:00
endif
2022-08-01 19:31:07 +00:00
if conf_data.get('CONFIG_MUJS')
mujsdeps = dependency('mujs', static: st)
deps += mujsdeps
endif
2022-06-28 18:24:22 +00:00
if not conf_data.get('CONFIG_OS_DOS') and compiler.has_header('sys/un.h')
conf_data.set('CONFIG_INTERLINK', true)
conf_data.set('HAVE_SYS_UN_H', 1)
else
conf_data.set('CONFIG_INTERLINK', false)
endif
if conf_data.get('CONFIG_TERMINFO')
terminfodeps = dependency('ncursesw', static: st)
deps += terminfodeps
endif
if conf_data.get('CONFIG_LIBSIXEL')
sixeldeps = dependency('libsixel', static: st)
deps += sixeldeps
endif
2022-06-28 18:24:22 +00:00
if conf_data.get('CONFIG_OS_DOS')
wattdeps = compiler.find_library('watt', static: st, dirs: [get_option('prefix')+'/lib','/usr/local/lib'])
2022-06-28 18:24:22 +00:00
deps += wattdeps
else
wattdeps = []
endif
#AC_STRUCT_TM
#AC_C_CONST
#AC_C_INLINE
if conf_data.get('CONFIG_ECMASCRIPT')
conf_data.set('NONSTATIC_INLINE', '')
else
conf_data.set('NONSTATIC_INLINE', 'inline')
endif
#AC_SYS_LARGEFILE
#AC_TYPE_SIZE_T
#AC_TYPE_OFF_T
#EL_CHECK_TYPE(ssize_t, int)
conf_data.set('HAVE_LONG_LONG', 1)
conf_data.set('HAVE_OFF_T', 1)
conf_data.set('HAVE_INT32_T', 1)
conf_data.set('HAVE_UINT32_T', 1)
conf_data.set('HAVE_UINT16_T', 1)
conf_data.set('HAVE_VARIADIC_MACROS', 1)
#AC_FUNC_MEMCMP
#AC_FUNC_MMAP
2022-06-28 18:24:22 +00:00
if compiler.has_function('mmap', prefix: '#include <sys/mman.h>')
conf_data.set('HAVE_MMAP', 1)
endif
if compiler.has_function('strftime', prefix: '#include <time.h>')
conf_data.set('HAVE_STRFTIME', 1)
endif
if compiler.has_function('strptime', prefix: '#include <time.h>', args: '-D_XOPEN_SOURCE')
conf_data.set('HAVE_STRPTIME', 1)
endif
if compiler.has_function('atoll', prefix : '#include <stdlib.h>')
conf_data.set('HAVE_ATOLL', 1)
endif
if compiler.has_function('gethostbyaddr', prefix : '#include <netdb.h>')
conf_data.set('HAVE_GETHOSTBYADDR', 1)
endif
if compiler.has_function('herror', prefix : '#include <netdb.h>')
conf_data.set('HAVE_HERROR', 1)
endif
if compiler.has_function('strerror', prefix : '#include <string.h>')
conf_data.set('HAVE_STRERROR', 1)
endif
if compiler.has_function('popen', prefix : '#include <stdio.h>')
conf_data.set('HAVE_POPEN', 1)
endif
if compiler.has_function('uname', prefix : '#include <sys/utsname.h>')
conf_data.set('HAVE_UNAME', 1)
endif
if compiler.has_function('access', prefix : '#include <unistd.h>')
conf_data.set('HAVE_ACCESS', 1)
endif
if compiler.has_function('chmod', prefix : '#include <sys/stat.h>')
conf_data.set('HAVE_CHMOD', 1)
endif
if compiler.has_function('alarm', prefix : '#include <unistd.h>')
conf_data.set('HAVE_ALARM', 1)
endif
if compiler.has_function('timegm', prefix : '#include <time.h>')
conf_data.set('HAVE_TIMEGM', 1)
endif
if compiler.has_function('mremap', prefix : '#include <sys/mman.h>', args: '-D_GNU_SOURCE')
conf_data.set('HAVE_MREMAP', 1)
endif
if compiler.has_function('strcasecmp', prefix : '#include <strings.h>')
conf_data.set('HAVE_STRCASECMP', 1)
endif
if compiler.has_function('strncasecmp', prefix : '#include <strings.h>')
conf_data.set('HAVE_STRNCASECMP', 1)
endif
if compiler.has_function('strcasestr', prefix : '#include <string.h>', args: '-D_GNU_SOURCE')
conf_data.set('HAVE_STRCASESTR', 1)
endif
conf_data.set('HAVE_STRSTR', 1)
conf_data.set('HAVE_STRCHR', 1)
conf_data.set('HAVE_STRRCHR', 1)
if compiler.has_function('memmove', prefix : '#include <string.h>')
conf_data.set('HAVE_MEMMOVE', 1)
endif
if compiler.has_function('bcopy', prefix : '#include <strings.h>')
conf_data.set('HAVE_BCOPY', 1)
endif
if compiler.has_function('stpcpy', prefix : '#include <string.h>')
conf_data.set('HAVE_STPCPY', 1)
endif
if compiler.has_function('strdup', prefix : '#include <string.h>')
conf_data.set('HAVE_STRDUP', 1)
endif
if compiler.has_function('index', prefix : '#include <strings.h>')
conf_data.set('HAVE_INDEX', 1)
endif
if compiler.has_function('isdigit', prefix : '#include <ctype.h>')
conf_data.set('HAVE_ISDIGIT', 1)
endif
2022-03-03 15:20:24 +00:00
if compiler.has_function('mempcpy', prefix : '#include <string.h>', args: '-D_GNU_SOURCE')
conf_data.set('HAVE_MEMPCPY', 1)
endif
if compiler.has_function('memrchr', prefix : '#include <string.h>', args: '-D_GNU_SOURCE')
conf_data.set('HAVE_MEMRCHR', 1)
endif
if compiler.has_function('snprintf', prefix : '#include <stdio.h>')
conf_data.set('HAVE_SNPRINTF', 1)
endif