mirror of
https://codeberg.org/scip/dbtool.git
synced 2025-12-17 11:20:58 +01:00
completed meson/ninja build
This commit is contained in:
83
meson.build
83
meson.build
@@ -1,8 +1,8 @@
|
|||||||
project(
|
project(
|
||||||
'dbtool',
|
'dbtool',
|
||||||
'cpp',
|
'cpp',
|
||||||
version: '1.9.1',
|
|
||||||
license: 'GPL',
|
license: 'GPL',
|
||||||
|
version: '1.9.1',
|
||||||
meson_version: '>=1.3',
|
meson_version: '>=1.3',
|
||||||
default_options: [
|
default_options: [
|
||||||
'warning_level=2',
|
'warning_level=2',
|
||||||
@@ -16,36 +16,73 @@ add_project_arguments(
|
|||||||
'-Wno-unused-result',
|
'-Wno-unused-result',
|
||||||
'-Wno-missing-braces',
|
'-Wno-missing-braces',
|
||||||
'-Wno-format-zero-length',
|
'-Wno-format-zero-length',
|
||||||
'-Wundef',
|
|
||||||
'-Wvla',
|
'-Wvla',
|
||||||
|
'-Wno-sign-compare',
|
||||||
|
'-Wno-narrowing'
|
||||||
],
|
],
|
||||||
language: 'cpp',
|
language: 'cpp',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
cpp = meson.get_compiler('cpp')
|
cpp = meson.get_compiler('cpp')
|
||||||
|
conf = configuration_data()
|
||||||
|
dbtool_inc = include_directories('.')
|
||||||
|
|
||||||
|
if host_machine.system().startswith('freebsd')
|
||||||
|
dbtool_inc = include_directories('.', '/usr/local/include')
|
||||||
|
add_project_link_arguments('LDFLAGS=/usr/local/lib')
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
# check for funcs.
|
||||||
|
foreach func : ['getopt', 'fdopen', 'fgetc', 'getenv', 'getpass']
|
||||||
|
conf.set('HAVE_'+func.to_upper(), cpp.has_function(func, prefix : '#include <unistd.h>\n#include <stdio.h>\n#include <stdlib.h>'))
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# check for libraries with CMAKE or pkg-config
|
||||||
|
pcre2 = dependency('libpcre2-8')
|
||||||
|
|
||||||
|
|
||||||
|
# manually check for libraries
|
||||||
|
lib_berkeley = cpp.find_library('db_cxx',
|
||||||
|
dirs : ['/usr', '/usr/local'])
|
||||||
|
inc_berkeley = include_directories('/usr', '/usr/local')
|
||||||
|
|
||||||
|
lib_gdbm = cpp.find_library('gdbm',
|
||||||
|
dirs : ['/usr', '/usr/local'])
|
||||||
|
inc_gdbm = include_directories('/usr', '/usr/local')
|
||||||
|
|
||||||
|
|
||||||
|
# check commandline options
|
||||||
prefix = get_option('prefix')
|
prefix = get_option('prefix')
|
||||||
|
|
||||||
pcre2 = dependency('libpcre2-8')
|
if get_option('buildtype') == 'debug'
|
||||||
#gdbm = dependency('libgdbm6t64')
|
conf.set('DEBUG', '1')
|
||||||
#gdbm = dependency('libdb_cxx')
|
endif
|
||||||
|
|
||||||
lib_berkeley = cpp.find_library('db_cxx',
|
|
||||||
dirs : ['/usr'])
|
|
||||||
inc_berkeley = include_directories('/usr')
|
|
||||||
|
|
||||||
conf = configuration_data()
|
|
||||||
|
|
||||||
#conf.set10('HAVE_LIBGDBM', gdbm.found())
|
# setup conf map
|
||||||
|
version = '@0@'.format(meson.project_version())
|
||||||
|
|
||||||
conf.set10('HAVE_LIBPCRE', pcre2.found())
|
conf.set10('HAVE_LIBPCRE', pcre2.found())
|
||||||
conf.set10('DB_CXX_HEADER', lib_berkeley.found())
|
conf.set10('HAVE_BERKELEY', lib_berkeley.found())
|
||||||
|
conf.set10('HAVE_GDBM', lib_gdbm.found())
|
||||||
conf.set('prefix', prefix)
|
conf.set('prefix', prefix)
|
||||||
|
conf.set('VERSION', version)
|
||||||
|
|
||||||
platform_h = custom_target(
|
|
||||||
'platform_h',
|
# write out the config header
|
||||||
|
m = configure_file(
|
||||||
|
input : 'platform.h.in',
|
||||||
output : 'platform.h',
|
output : 'platform.h',
|
||||||
command : ['./platform.sh', conf.get('HAVE_LIBPCRE'), '@OUTPUT@'],
|
configuration : conf,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# code
|
||||||
dbtool_sources = files(
|
dbtool_sources = files(
|
||||||
'cipher.cc',
|
'cipher.cc',
|
||||||
'config.cc',
|
'config.cc',
|
||||||
@@ -55,17 +92,25 @@ dbtool_sources = files(
|
|||||||
'rijndael.cc'
|
'rijndael.cc'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# add dependencies, manual libs are added directly below
|
||||||
dbtool_deps = [
|
dbtool_deps = [
|
||||||
pcre2
|
pcre2
|
||||||
]
|
]
|
||||||
|
|
||||||
dbtool_inc = include_directories('.')
|
|
||||||
|
|
||||||
executable(
|
executable(
|
||||||
'dbtool',
|
'dbtool',
|
||||||
[dbtool_sources, platform_h],
|
[dbtool_sources],
|
||||||
include_directories: [dbtool_inc],
|
include_directories: [dbtool_inc, inc_berkeley, inc_gdbm],
|
||||||
dependencies: [dbtool_deps, lib_berkeley],
|
dependencies: [dbtool_deps, lib_berkeley, lib_gdbm],
|
||||||
include_directories : inc_berkeley,
|
|
||||||
install: true
|
install: true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# build manual page
|
||||||
|
pod2man = find_program('pod2man', native: true)
|
||||||
|
if pod2man.found()
|
||||||
|
res = run_command(pod2man.full_path(), 'dbtool.pod', 'dbtool.1', check:true)
|
||||||
|
if res.returncode() == 0
|
||||||
|
install_man('dbtool.1')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,92 +1,19 @@
|
|||||||
/* platform.h.in. Generated from configure.ac by autoheader. */
|
/* platform.h.in. Generated from configure.ac by autoheader. */
|
||||||
|
|
||||||
/* "Berkeley DB C++ Header File" */
|
#mesondefine HAVE_BERKELEY
|
||||||
#undef DB_CXX_HEADER
|
#mesondefine HAVE_GDBM
|
||||||
|
#mesondefine HAVE_LIBPCRE
|
||||||
|
#mesondefine HAVE_GETPASS
|
||||||
|
#mesondefine HAVE_GETOPT
|
||||||
|
#mesondefine HAVE_FDOPEN
|
||||||
|
#mesondefine HAVE_FGETC
|
||||||
|
#mesondefine HAVE_GETENV
|
||||||
|
|
||||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
|
||||||
#undef HAVE_DLFCN_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `fdopen' function. */
|
#define PCRE2_CODE_UNIT_WIDTH 8
|
||||||
#undef HAVE_FDOPEN
|
#define PACKAGE "dbtool"
|
||||||
|
|
||||||
/* Define to 1 if you have the `fgetc' function. */
|
#define VERSION "@VERSION@"
|
||||||
#undef HAVE_FGETC
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getenv' function. */
|
|
||||||
#undef HAVE_GETENV
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getopt' function. */
|
|
||||||
#undef HAVE_GETOPT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getpass' function. */
|
|
||||||
#undef HAVE_GETPASS
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#undef HAVE_INTTYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `gdbm' library (-lgdbm). */
|
|
||||||
#undef HAVE_LIBGDBM
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `pcre' library (-lpcre). */
|
|
||||||
#undef HAVE_LIBPCRE
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
|
||||||
#undef HAVE_MEMORY_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#undef HAVE_STDINT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdio.h> header file. */
|
|
||||||
#undef HAVE_STDIO_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#undef HAVE_STDLIB_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#undef HAVE_SYS_STAT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#undef HAVE_SYS_TYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#undef HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
|
||||||
*/
|
|
||||||
#undef LT_OBJDIR
|
|
||||||
|
|
||||||
/* Name of package */
|
|
||||||
#undef PACKAGE
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#undef PACKAGE_BUGREPORT
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#undef PACKAGE_NAME
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#undef PACKAGE_STRING
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#undef PACKAGE_TARNAME
|
|
||||||
|
|
||||||
/* Define to the home page for this package. */
|
|
||||||
#undef PACKAGE_URL
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#undef PACKAGE_VERSION
|
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#undef STDC_HEADERS
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#undef VERSION
|
|
||||||
|
|
||||||
/* Define to empty if `const' does not conform to ANSI C. */
|
/* Define to empty if `const' does not conform to ANSI C. */
|
||||||
#undef const
|
#undef const
|
||||||
|
|||||||
Reference in New Issue
Block a user