aboutsummaryrefslogtreecommitdiff
path: root/ports/pkgconf/fix-static-builds.patch
blob: 88a0b375c9bcdda470a909261efa3b1da3ca9fbc (plain)
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
diff --git a/libpkgconf.pc.in b/libpkgconf.pc.in
index d278136e3..ef0c7db5f 100644
--- a/libpkgconf.pc.in
+++ b/libpkgconf.pc.in
@@ -8,4 +8,4 @@ Description: a library for accessing and manipulating development framework conf
 URL: http://github.com/pkgconf/pkgconf
 Version: @PACKAGE_VERSION@
 CFlags: -I${includedir}/pkgconf
-Libs: -L${libdir} -lpkgconf
+Libs: -L${libdir} -lpkgconf @build_static@
diff --git a/meson.build b/meson.build
index e7822b8da..8f7aa0075 100644
--- a/meson.build
+++ b/meson.build
@@ -45,6 +45,13 @@ cdata.set('abs_top_builddir', meson.build_root())
 
 subdir('libpkgconf')
 
+libtype = get_option('default_library')
+if libtype == 'static'
+  build_static = '-DPKGCONFIG_IS_STATIC'
+else
+  build_static = ''
+endif
+
 libpkgconf = library('pkgconf',
   'libpkgconf/argvsplit.c',
   'libpkgconf/audit.c',
@@ -60,7 +67,7 @@ libpkgconf = library('pkgconf',
   'libpkgconf/pkg.c',
   'libpkgconf/queue.c',
   'libpkgconf/tuple.c',
-  c_args: '-DLIBPKGCONF_EXPORT',
+  c_args: ['-DLIBPKGCONF_EXPORT', build_static],
   install : true,
   version : '3.0.0',
   soversion : '3',
@@ -73,13 +80,16 @@ pkg.generate(libpkgconf,
   url: 'http://github.com/pkgconf/pkgconf',
   filebase : 'libpkgconf',
   subdirs: ['pkgconf'],
+  extra_cflags : build_static
 )
 
+
 pkgconf_exe = executable('pkgconf',
   'cli/main.c',
   'cli/getopt_long.c',
   'cli/renderer-msvc.c',
   link_with : libpkgconf,
+  c_args: build_static,
   install : true)
 
 if get_option('tests')