Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/orc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>2020-07-28 17:19:23 +0300
committerTim-Philipp Müller <tim@centricular.com>2020-07-29 16:20:08 +0300
commit8fc6bdf5a8bb99797af9b64661867e3f6a034e3b (patch)
treed13a6250eea99a14b88e2135e4ed56c64b409bb1
parent655847e4485d52da7c7fdbdd01bd0b47579144f7 (diff)
meson: Use pkgconfig.generate
Part-of: <https://gitlab.freedesktop.org/gstreamer/orc/-/merge_requests/49>
-rw-r--r--meson.build38
-rw-r--r--orc-test.pc.in12
-rw-r--r--orc-test/meson.build1
-rw-r--r--orc.pc.in16
-rw-r--r--orc/meson.build2
-rw-r--r--tools/meson.build11
6 files changed, 22 insertions, 58 deletions
diff --git a/meson.build b/meson.build
index 84af0a0..700319b 100644
--- a/meson.build
+++ b/meson.build
@@ -22,7 +22,8 @@ orc_inc = include_directories('.')
cc = meson.get_compiler('c')
cdata = configuration_data() # config.h
-pc_conf = configuration_data() # orc.pc
+
+pkg = import('pkgconfig')
# -Bsymbolic-functions
if meson.version().version_compare('>= 0.46.0')
@@ -69,18 +70,16 @@ else
warning(cpu_family + ' isn\'t a supported cpu family for optimization')
endif
+threads = dependency('threads')
+
libm = cc.find_library('m', required : false)
librt = []
-pc_conf.set('LIBRT', '')
if cc.has_function('clock_gettime')
cdata.set('HAVE_CLOCK_GETTIME', true)
else
# On glibc older than 2.17, clock_gettime is provided by time.h and -lrt
librt = cc.find_library('rt', required : false)
- if librt.found() and cc.has_function('clock_gettime', dependencies : librt)
- pc_conf.set('LIBRT', '-lrt')
- endif
endif
liblog = []
@@ -103,19 +102,10 @@ if host_os == 'windows'
if cc.compiles(code, name : 'building for UWP')
cdata.set('ORC_WINAPI_ONLY_APP', true)
endif
-
- pc_conf.set('EXEEXT', '.exe')
- pc_conf.set('PTHREAD_LIBS', '')
else
# If it is not windows, we just assume it is a unix of sorts for now.
cdata.set('HAVE_CODEMEM_MMAP', true)
cdata.set('HAVE_THREAD_PTHREAD', true)
- pc_conf.set('EXEEXT', '')
- if host_os == 'android'
- pc_conf.set('PTHREAD_LIBS', '')
- else
- pc_conf.set('PTHREAD_LIBS', '-lpthread')
- endif
endif
monotonic_test = '''
@@ -161,6 +151,7 @@ if not opt_tools.disabled()
subdir('tools')
else
orcc = disabler() # for testsuite/orcc/
+ tools_variables = []
endif
if not opt_examples.disabled()
@@ -189,20 +180,11 @@ else
endif
endif
-# FIXME: use pkg-config module
-pc_conf.set('prefix', get_option('prefix'))
-pc_conf.set('exec_prefix', get_option('prefix'))
-pc_conf.set('libdir', get_option('prefix') / get_option('libdir'))
-pc_conf.set('includedir', get_option('prefix') / 'include')
-pc_conf.set('VERSION', meson.project_version())
-pc_conf.set('ORC_MAJORMINOR', orc_api)
-pc_conf.set('LIBM', libm.found() ? '-lm' : '')
-
-pkgconfigdir = get_option('libdir') / 'pkgconfig'
-configure_file(input : 'orc.pc.in',
- output : 'orc-' + orc_api + '.pc',
- configuration : pc_conf,
- install_dir : pkgconfigdir)
+pkg.generate (orc_lib,
+ subdirs : 'orc-' + orc_api,
+ description : 'Library of Optimized Inner Loops Runtime Compiler',
+ variables : tools_variables,
+ libraries_private : orc_dependencies)
# Install m4 macro that other projects use
install_data('orc.m4', install_dir : 'share/aclocal')
diff --git a/orc-test.pc.in b/orc-test.pc.in
deleted file mode 100644
index 1c79767..0000000
--- a/orc-test.pc.in
+++ /dev/null
@@ -1,12 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@/orc-@ORC_MAJORMINOR@
-
-Name: orc-test-@ORC_MAJORMINOR@
-Description: Test Library of Optimized Inner Loops Runtime Compiler
-Version: @VERSION@
-Requires: orc-@ORC_MAJORMINOR@
-Libs: -L${libdir} -lorc-test-@ORC_MAJORMINOR@
-Libs.private: @LIBM@ @LIBRT@ @PTHREAD_LIBS@
-Cflags: -I${includedir}
diff --git a/orc-test/meson.build b/orc-test/meson.build
index 69f90d8..c1d6cd5 100644
--- a/orc-test/meson.build
+++ b/orc-test/meson.build
@@ -27,7 +27,6 @@ else
endif
# pkg-config file
-pkg = import('pkgconfig')
pkg.generate(orc_test_lib,
name: 'orc-test',
filebase: 'orc-test-' + orc_api,
diff --git a/orc.pc.in b/orc.pc.in
deleted file mode 100644
index d1ffd2e..0000000
--- a/orc.pc.in
+++ /dev/null
@@ -1,16 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@/orc-@ORC_MAJORMINOR@
-toolsdir=${exec_prefix}/bin
-
-
-Name: orc-@ORC_MAJORMINOR@
-Description: Library of Optimized Inner Loops Runtime Compiler
-Version: @VERSION@
-Libs: -L${libdir} -lorc-@ORC_MAJORMINOR@
-Libs.private: @LIBM@ @LIBRT@ @PTHREAD_LIBS@
-Cflags: -I${includedir}
-
-orcc=${toolsdir}/orcc@EXEEXT@
-
diff --git a/orc/meson.build b/orc/meson.build
index 2586b2e..1995f36 100644
--- a/orc/meson.build
+++ b/orc/meson.build
@@ -99,7 +99,7 @@ endif
orc_c_args = ['-DORC_ENABLE_UNSTABLE_API', '-D_GNU_SOURCE']
-orc_dependencies = [libm, librt, liblog]
+orc_dependencies = [libm, librt, liblog, threads]
orc_lib = library ('orc-' + orc_api,
orc_sources,
diff --git a/tools/meson.build b/tools/meson.build
index 95ccb75..0711ff1 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -10,3 +10,14 @@ endif
orc_bugreport = executable ('orc-bugreport', 'orc-bugreport.c',
install: true,
dependencies : [orc_dep, orc_test_dep])
+
+if host_os == 'windows'
+ orcc_filename = 'orcc.exe'
+else
+ orcc_filename = 'orcc'
+endif
+
+tools_variables = [
+ 'toolsdir=' + ('${prefix}' / get_option('bindir')),
+ 'orcc=' + ('${toolsdir}' / orcc_filename),
+]