summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-12-18 10:50:58 +0100
committerThomas Haller <thaller@redhat.com>2017-12-18 10:51:29 +0100
commita58cde8d2c9595941067be7c79e03ad34463d63a (patch)
tree88ddf84daa75612d213b12707c463662f11d9f43
parent22ffd53369d89bd8b7f34a20800dee9ca287f7e2 (diff)
parente2562d2bfa3760b0866331cba96eb75649aff682 (diff)
build: merge branch 'meson-generate-build-docs'
https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00053.html https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00054.html
-rw-r--r--Makefile.am61
-rw-r--r--libnm-core/meson.build25
-rwxr-xr-xlibnm/generate-plugin-docs.pl20
-rw-r--r--libnm/meson.build26
-rw-r--r--meson.build6
5 files changed, 61 insertions, 77 deletions
diff --git a/Makefile.am b/Makefile.am
index 4d2657a79..fa9f2939b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -453,23 +453,7 @@ libnm_core_lib_h_priv = \
libnm-core/nm-property-compare.h \
libnm-core/nm-setting-private.h \
libnm-core/nm-utils-private.h
-libnm_core_lib_c_real = \
- shared/nm-utils/c-list-util.c \
- shared/nm-utils/nm-dedup-multi.c \
- shared/nm-utils/nm-enum-utils.c \
- shared/nm-utils/nm-hash-utils.c \
- shared/nm-utils/nm-shared-utils.c \
- shared/nm-utils/nm-random-utils.c \
- shared/nm-utils/nm-udev-utils.c \
- shared/nm-meta-setting.c \
- libnm-core/crypto.c \
- libnm-core/nm-connection.c \
- libnm-core/nm-dbus-utils.c \
- libnm-core/nm-errors.c \
- libnm-core/nm-keyfile-reader.c \
- libnm-core/nm-keyfile-utils.c \
- libnm-core/nm-keyfile-writer.c \
- libnm-core/nm-property-compare.c \
+libnm_core_lib_c_settings_real = \
libnm-core/nm-setting-8021x.c \
libnm-core/nm-setting-adsl.c \
libnm-core/nm-setting-bluetooth.c \
@@ -509,7 +493,25 @@ libnm_core_lib_c_real = \
libnm-core/nm-setting-wimax.c \
libnm-core/nm-setting-wired.c \
libnm-core/nm-setting-wireless-security.c \
- libnm-core/nm-setting-wireless.c \
+ libnm-core/nm-setting-wireless.c
+libnm_core_lib_c_real = \
+ $(libnm_core_lib_c_settings_real) \
+ shared/nm-utils/c-list-util.c \
+ shared/nm-utils/nm-dedup-multi.c \
+ shared/nm-utils/nm-enum-utils.c \
+ shared/nm-utils/nm-hash-utils.c \
+ shared/nm-utils/nm-shared-utils.c \
+ shared/nm-utils/nm-random-utils.c \
+ shared/nm-utils/nm-udev-utils.c \
+ shared/nm-meta-setting.c \
+ libnm-core/crypto.c \
+ libnm-core/nm-connection.c \
+ libnm-core/nm-dbus-utils.c \
+ libnm-core/nm-errors.c \
+ libnm-core/nm-keyfile-reader.c \
+ libnm-core/nm-keyfile-utils.c \
+ libnm-core/nm-keyfile-writer.c \
+ libnm-core/nm-property-compare.c \
libnm-core/nm-setting.c \
libnm-core/nm-simple-connection.c \
libnm-core/nm-utils.c \
@@ -760,14 +762,13 @@ libnm_lib_h_pub_real = \
libnm/nm-ip-config.h \
libnm/nm-object.h \
libnm/nm-remote-connection.h \
+ libnm/nm-secret-agent-old.h \
libnm/nm-types.h \
libnm/nm-vpn-connection.h \
libnm/nm-vpn-editor.h \
- libnm/nm-wimax-nsp.h
-libnm_lib_h_pub_nointrospect = \
- libnm/nm-secret-agent-old.h \
libnm/nm-vpn-plugin-old.h \
- libnm/nm-vpn-service-plugin.h
+ libnm/nm-vpn-service-plugin.h \
+ libnm/nm-wimax-nsp.h
libnm_lib_h_pub_mkenums = \
libnm/nm-enum-types.h
libnm_lib_h_priv = \
@@ -842,8 +843,7 @@ libnm_lib_cppflags = \
-DNMRUNDIR=\"$(nmrundir)\"
libnminclude_HEADERS += \
- $(libnm_lib_h_pub_real) \
- $(libnm_lib_h_pub_nointrospect)
+ $(libnm_lib_h_pub_real)
nodist_libnminclude_HEADERS += \
$(libnm_lib_h_pub_mkenums)
@@ -875,8 +875,7 @@ GLIB_GENERATED += \
$(libnm_lib_c_mkenums)
nm_enum_types_sources = \
$(libnm_lib_h_pub_mkenums) \
- $(libnm_lib_h_pub_real) \
- $(libnm_lib_h_pub_nointrospect)
+ $(libnm_lib_h_pub_real)
nm_enum_types_MKENUMS_H_FLAGS = --identifier-prefix NM --fhead '\#include <nm-core-enum-types.h>\n'
nm_enum_types_MKENUMS_C_FLAGS = --identifier-prefix NM --fhead '\#include "nm-default.h"\n'
@@ -891,7 +890,6 @@ libnm_libnm_la_CPPFLAGS = \
libnm_libnm_la_SOURCES = \
$(libnm_lib_h_pub_real) \
- $(libnm_lib_h_pub_nointrospect) \
$(libnm_lib_h_priv) \
$(libnm_lib_c_real)
@@ -943,7 +941,6 @@ libnm_NM_1_0_gir_FILES = \
$(libnm_core_lib_c_real) \
$(libnm_lib_h_pub_mkenums) \
$(libnm_lib_h_pub_real) \
- $(libnm_lib_h_pub_nointrospect) \
$(libnm_lib_c_mkenums) \
$(libnm_lib_c_real)
libnm_NM_1_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=NM --symbol-prefix=nm
@@ -991,10 +988,10 @@ libnm_noinst_data = \
noinst_DATA += $(libnm_noinst_data)
-libnm_docs_sources = $(libnm_core_lib_c_real)
+libnm_docs_sources = $(libnm_core_lib_c_settings_real)
libnm/nm-settings-docs-overrides.xml: libnm/generate-plugin-docs.pl $(libnm_docs_sources)
- $(AM_V_GEN) $(srcdir)/libnm/generate-plugin-docs.pl dbus "$(srcdir)" $@
+ $(AM_V_GEN) $(srcdir)/libnm/generate-plugin-docs.pl dbus $@ $(libnm_docs_sources)
# When the python scripts loads libnm and the address sanitizers is
# enabled, we must LD_PRELOAD libasan otherwise it will complain that
@@ -1021,9 +1018,9 @@ libnm/nm-settings-docs.xml: libnm/generate-setting-docs.py libnm/nm-settings-doc
--output $@
libnm/nm-settings-keyfile-docs.xml: libnm/generate-plugin-docs.pl $(libnm_docs_sources)
- $(AM_V_GEN) $(srcdir)/libnm/generate-plugin-docs.pl keyfile "$(srcdir)" $@
+ $(AM_V_GEN) $(srcdir)/libnm/generate-plugin-docs.pl keyfile $@ $(libnm_docs_sources)
libnm/nm-settings-ifcfg-rh-docs.xml: libnm/generate-plugin-docs.pl $(libnm_docs_sources)
- $(AM_V_GEN) $(srcdir)/libnm/generate-plugin-docs.pl ifcfg-rh "$(srcdir)" $@
+ $(AM_V_GEN) $(srcdir)/libnm/generate-plugin-docs.pl ifcfg-rh $@ $(libnm_docs_sources)
EXTRA_DIST += $(libnm_noinst_data)
diff --git a/libnm-core/meson.build b/libnm-core/meson.build
index 13155138f..6f8ba1769 100644
--- a/libnm-core/meson.build
+++ b/libnm-core/meson.build
@@ -54,16 +54,7 @@ libnm_core_headers = files(
'nm-vpn-plugin-info.h'
)
-libnm_core_sources = files(
- 'crypto.c',
- 'crypto_' + crypto + '.c',
- 'nm-connection.c',
- 'nm-dbus-utils.c',
- 'nm-errors.c',
- 'nm-keyfile-reader.c',
- 'nm-keyfile-utils.c',
- 'nm-keyfile-writer.c',
- 'nm-property-compare.c',
+libnm_core_settings_sources = files(
'nm-setting-8021x.c',
'nm-setting-adsl.c',
'nm-setting-bluetooth.c',
@@ -103,7 +94,19 @@ libnm_core_sources = files(
'nm-setting-wimax.c',
'nm-setting-wired.c',
'nm-setting-wireless-security.c',
- 'nm-setting-wireless.c',
+ 'nm-setting-wireless.c'
+)
+
+libnm_core_sources = libnm_core_settings_sources + files(
+ 'crypto.c',
+ 'crypto_' + crypto + '.c',
+ 'nm-connection.c',
+ 'nm-dbus-utils.c',
+ 'nm-errors.c',
+ 'nm-keyfile-reader.c',
+ 'nm-keyfile-utils.c',
+ 'nm-keyfile-writer.c',
+ 'nm-property-compare.c',
'nm-setting.c',
'nm-simple-connection.c',
'nm-utils.c',
diff --git a/libnm/generate-plugin-docs.pl b/libnm/generate-plugin-docs.pl
index 24912a037..e4963b7c5 100755
--- a/libnm/generate-plugin-docs.pl
+++ b/libnm/generate-plugin-docs.pl
@@ -46,25 +46,14 @@ use v5.10;
# global variables
my @keywords = ("property", "variable", "format", "values", "default", "example", "description");
-my @source_files;
my @data;
my $fo;
-(scalar @ARGV == 3) or die "Usage: $0 <plugin> <srcdir> <output-xml-file>\n";
-my ($plugin, $srcdir, $output) = @ARGV;
+(scalar @ARGV >= 3) or die "Usage: $0 <plugin> <output-xml-file> <srcfiles>\n";
+my ($plugin, $output, (@source_files)) = @ARGV;
my $start_tag = "---$plugin---\\s*\$";
my $end_tag = '---end---';
-# get source files to scan for documentation comments (nm-setting-<something>.c)
-my $file = "$srcdir/Makefile.am";
-open my $fh, '<', $file or die "Can't open $file: $!";
-while (my $line = <$fh>) {
- if ($line =~ /^\t*(libnm-core\/nm-setting-[^.]*\.c)( \\)?$/g) {
- push @source_files, $1;
- }
-}
-close $fh;
-
# open output file
open $fo, '>', $output or die "Can't open $output: $!";
@@ -73,11 +62,10 @@ write_header();
# write generated documenation for each setting
foreach my $c_file (@source_files) {
- my $path = "$srcdir/$c_file";
- my $setting_name = get_setting_name($path);
+ my $setting_name = get_setting_name($c_file);
if ($setting_name) {
write_item("<setting name=\"$setting_name\">");
- scan_doc_comments($path, $start_tag, $end_tag);
+ scan_doc_comments($c_file, $start_tag, $end_tag);
write_item("</setting>");
}
}
diff --git a/libnm/meson.build b/libnm/meson.build
index 3541832a5..24e0fb0bf 100644
--- a/libnm/meson.build
+++ b/libnm/meson.build
@@ -67,19 +67,21 @@ libnm_headers = files(
'nm-ip-config.h',
'nm-object.h',
'nm-remote-connection.h',
+ 'nm-secret-agent-old.h',
'nm-types.h',
'nm-vpn-connection.h',
'nm-vpn-editor.h',
+ 'nm-vpn-plugin-old.h',
+ 'nm-vpn-service-plugin.h',
'nm-wimax-nsp.h'
)
-libnm_headers_nointrospect = files(
- 'nm-secret-agent-old.h',
- 'nm-vpn-plugin-old.h',
- 'nm-vpn-service-plugin.h'
+install_headers(
+ libnm_core_headers + libnm_headers + [version_header],
+ subdir: 'libnm'
)
-enums_headers = libnm_headers + libnm_headers_nointrospect + [version_header]
+enums_headers = libnm_headers + [version_header]
enums = 'nm-enum-types'
libnm_enums_h = gnome.mkenums(
@@ -210,7 +212,7 @@ run_target(
)
if enable_introspection
- gir_sources = libnm_core_enums + libnm_core_headers + libnm_core_sources + libnm_enums + libnm_headers + libnm_headers_nointrospect + libnm_sources + [version_header]
+ gir_sources = libnm_core_enums + libnm_core_headers + libnm_core_sources + libnm_enums + libnm_headers + libnm_sources + [version_header]
gir_dir = join_paths(nm_datadir, 'gir-' + nm_gir_version)
typelib_dir = join_paths(nm_libdir, 'girepository-' + nm_gir_version)
@@ -236,26 +238,26 @@ if enable_introspection
name = 'nm-settings-keyfile-docs.xml'
nm_settings_keyfile_docs = custom_target(
name,
- input: meson.source_root(),
+ input: libnm_core_settings_sources,
output: name,
- command: [perl, generate_plugin_docs, 'keyfile', '@INPUT@', '@OUTPUT@']
+ command: [perl, generate_plugin_docs, 'keyfile', '@OUTPUT@', '@INPUT@']
)
name = 'nm-settings-docs-overrides.xml'
nm_settings_docs_overrides = custom_target(
name,
- input: meson.source_root(),
+ input: libnm_core_settings_sources,
output: name,
- command: [perl, generate_plugin_docs, 'dbus', '@INPUT@', '@OUTPUT@']
+ command: [perl, generate_plugin_docs, 'dbus', '@OUTPUT@', '@INPUT@']
)
if enable_ifcfg_rh
name = 'nm-settings-ifcfg-rh-docs.xml'
nm_settings_ifcfg_rh_docs = custom_target(
name,
- input: meson.source_root(),
+ input: libnm_core_settings_sources,
output: name,
- command: [perl, generate_plugin_docs, 'ifcfg-rh', '@INPUT@', '@OUTPUT@']
+ command: [perl, generate_plugin_docs, 'ifcfg-rh', '@OUTPUT@', '@INPUT@']
)
endif
diff --git a/meson.build b/meson.build
index c1c8f4a57..1437526fc 100644
--- a/meson.build
+++ b/meson.build
@@ -969,12 +969,6 @@ subdir('introspection')
subdir('shared')
subdir('libnm-core')
subdir('libnm')
-
-install_headers(
- libnm_core_headers + libnm_headers + libnm_headers_nointrospect + [version_header],
- subdir: 'libnm'
-)
-
subdir('src')
subdir('dispatcher')
subdir('clients')