build: use template files for enum types' sources generation
Source files for enum types are generated by passing segments of the source code of the files to the `glib-mkenums` command. This patch removes those parameters where source code is used from meson build files by moving those segmeents to template files. https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00057.html
This commit is contained in:

committed by
Thomas Haller

parent
a58cde8d2c
commit
0735b35dd0
@@ -48,7 +48,7 @@ endif
|
|||||||
|
|
||||||
executable(
|
executable(
|
||||||
'nmcli',
|
'nmcli',
|
||||||
sources + [libnm_core_enums_h],
|
sources + [libnm_core_enum[1]],
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: cflags,
|
c_args: cflags,
|
||||||
|
@@ -26,7 +26,7 @@ sources = shared_utils + files(
|
|||||||
|
|
||||||
libnmc_base = static_library(
|
libnmc_base = static_library(
|
||||||
'nmc-base',
|
'nmc-base',
|
||||||
sources: sources + [libnm_core_enums_h],
|
sources: sources + [libnm_core_enum[1]],
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: common_cflags
|
c_args: common_cflags
|
||||||
@@ -74,7 +74,7 @@ sources += settings_docs_source
|
|||||||
|
|
||||||
libnmc = static_library(
|
libnmc = static_library(
|
||||||
'nmc',
|
'nmc',
|
||||||
sources: sources + [libnm_core_enums_h],
|
sources: sources + [libnm_core_enum[1]],
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: common_cflags,
|
c_args: common_cflags,
|
||||||
|
@@ -23,7 +23,7 @@ endif
|
|||||||
|
|
||||||
executable(
|
executable(
|
||||||
name,
|
name,
|
||||||
[name + '.c', libnm_core_enums_h],
|
[name + '.c', libnm_core_enum[1]],
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: cflags,
|
c_args: cflags,
|
||||||
|
@@ -71,7 +71,7 @@ endif
|
|||||||
|
|
||||||
executable(
|
executable(
|
||||||
'nmtui',
|
'nmtui',
|
||||||
sources + [libnm_core_enums_h],
|
sources + [libnm_core_enum[1]],
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: cflags,
|
c_args: cflags,
|
||||||
|
@@ -23,7 +23,7 @@ sources = files(
|
|||||||
|
|
||||||
libnmt_newt = static_library(
|
libnmt_newt = static_library(
|
||||||
'nmt-newt',
|
'nmt-newt',
|
||||||
sources: sources + [libnm_core_enums_h],
|
sources: sources + [libnm_core_enum[1]],
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: cflags
|
c_args: cflags
|
||||||
|
@@ -11,7 +11,7 @@ cflags = '-DSRCDIR="@0@"'.format(meson.current_source_dir())
|
|||||||
|
|
||||||
exe = executable(
|
exe = executable(
|
||||||
test_unit,
|
test_unit,
|
||||||
[test_unit + '.c', libnm_core_enums_h],
|
[test_unit + '.c', libnm_core_enum[1]],
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: glib_dep,
|
dependencies: glib_dep,
|
||||||
c_args: cflags,
|
c_args: cflags,
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
examples = [
|
examples = [
|
||||||
['add-connection-gdbus', [uuid_dep], [libnm_core_enums_h, libnm_enums_h]],
|
['add-connection-gdbus', [uuid_dep], [libnm_core_enum[1], libnm_enum[1]]],
|
||||||
['add-connection-libnm', [libnm_dep], []],
|
['add-connection-libnm', [libnm_dep], []],
|
||||||
['get-active-connections-gdbus', [], [libnm_core_enums_h, libnm_enums_h]],
|
['get-active-connections-gdbus', [], [libnm_core_enum[1], libnm_enum[1]]],
|
||||||
['get-ap-info-libnm', [libnm_dep], []],
|
['get-ap-info-libnm', [libnm_dep], []],
|
||||||
['list-connections-gdbus', [], []],
|
['list-connections-gdbus', [], []],
|
||||||
['list-connections-libnm', [libnm_dep], []],
|
['list-connections-libnm', [libnm_dep], []],
|
||||||
|
@@ -114,32 +114,19 @@ libnm_core_sources = libnm_core_settings_sources + files(
|
|||||||
'nm-vpn-plugin-info.c'
|
'nm-vpn-plugin-info.c'
|
||||||
)
|
)
|
||||||
|
|
||||||
enums_headers = libnm_core_headers + [version_header]
|
enum_headers = libnm_core_headers + [version_header]
|
||||||
enums = 'nm-core-enum-types'
|
enum_types = 'nm-core-enum-types'
|
||||||
|
|
||||||
libnm_core_enums_h = gnome.mkenums(
|
libnm_core_enum = gnome.mkenums(
|
||||||
enums + '.h',
|
enum_types,
|
||||||
sources: enums_headers,
|
sources: enum_headers,
|
||||||
identifier_prefix: nm_id_prefix,
|
identifier_prefix: nm_id_prefix,
|
||||||
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#ifndef __NM_CORE_ENUM_TYPES_H__\n#define __NM_CORE_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
|
c_template: enum_types + '.c.template',
|
||||||
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n',
|
h_template: enum_types + '.h.template',
|
||||||
ftail: 'G_END_DECLS\n\n#endif /* __NM_CORE_ENUM_TYPES_H__ */',
|
|
||||||
install_header: true,
|
install_header: true,
|
||||||
install_dir: libnm_pkgincludedir
|
install_dir: libnm_pkgincludedir
|
||||||
)
|
)
|
||||||
|
|
||||||
libnm_core_enums_c = gnome.mkenums(
|
|
||||||
enums + '.c',
|
|
||||||
sources: enums_headers,
|
|
||||||
identifier_prefix: nm_id_prefix,
|
|
||||||
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#include "config.h"\n\n#include "nm-core-enum-types.h"\n#include "nm-default.h"\n\n#include "nm-version-macros.h" \n#include "nm-connection.h" \n#include "nm-core-types.h" \n#include "nm-dbus-interface.h" \n#include "nm-errors.h" \n#include "nm-setting-8021x.h" \n#include "nm-setting-adsl.h" \n#include "nm-setting-bluetooth.h" \n#include "nm-setting-bond.h" \n#include "nm-setting-bridge-port.h" \n#include "nm-setting-bridge.h" \n#include "nm-setting-cdma.h" \n#include "nm-setting-connection.h" \n#include "nm-setting-dcb.h" \n#include "nm-setting-dummy.h" \n#include "nm-setting-generic.h" \n#include "nm-setting-gsm.h" \n#include "nm-setting-infiniband.h" \n#include "nm-setting-ip-config.h" \n#include "nm-setting-ip-tunnel.h" \n#include "nm-setting-ip4-config.h" \n#include "nm-setting-ip6-config.h" \n#include "nm-setting-macsec.h" \n#include "nm-setting-macvlan.h" \n#include "nm-setting-olpc-mesh.h" \n#include "nm-setting-ovs-bridge.h" \n#include "nm-setting-ovs-interface.h" \n#include "nm-setting-ovs-patch.h" \n#include "nm-setting-ovs-port.h" \n#include "nm-setting-ppp.h" \n#include "nm-setting-pppoe.h" \n#include "nm-setting-proxy.h" \n#include "nm-setting-serial.h" \n#include "nm-setting-team-port.h" \n#include "nm-setting-team.h" \n#include "nm-setting-tun.h" \n#include "nm-setting-user.h" \n#include "nm-setting-vlan.h" \n#include "nm-setting-vpn.h" \n#include "nm-setting-vxlan.h" \n#include "nm-setting-wimax.h" \n#include "nm-setting-wired.h" \n#include "nm-setting-wireless-security.h" \n#include "nm-setting-wireless.h" \n#include "nm-setting.h" \n#include "nm-simple-connection.h" \n#include "nm-utils.h" \n#include "nm-version.h" \n#include "nm-vpn-dbus-interface.h" \n#include "nm-vpn-editor-plugin.h" \n#include "nm-vpn-plugin-info.h" \n\n',
|
|
||||||
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n',
|
|
||||||
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },\n',
|
|
||||||
vtail: ' { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n'
|
|
||||||
)
|
|
||||||
|
|
||||||
libnm_core_enums = [libnm_core_enums_c, libnm_core_enums_h]
|
|
||||||
|
|
||||||
incs = [
|
incs = [
|
||||||
top_inc,
|
top_inc,
|
||||||
shared_inc
|
shared_inc
|
||||||
@@ -169,7 +156,7 @@ endif
|
|||||||
|
|
||||||
libnm_core = static_library(
|
libnm_core = static_library(
|
||||||
'nm-core',
|
'nm-core',
|
||||||
sources: libnm_core_sources + libnm_core_enums + shared_sources + [version_header],
|
sources: libnm_core_sources + libnm_core_enum + shared_sources + [version_header],
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: cflags
|
c_args: cflags
|
||||||
|
86
libnm-core/nm-core-enum-types.c.template
Normal file
86
libnm-core/nm-core-enum-types.c.template
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
/*** BEGIN file-header ***/
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "nm-core-enum-types.h"
|
||||||
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-version-macros.h"
|
||||||
|
#include "nm-connection.h"
|
||||||
|
#include "nm-core-types.h"
|
||||||
|
#include "nm-dbus-interface.h"
|
||||||
|
#include "nm-errors.h"
|
||||||
|
#include "nm-setting-8021x.h"
|
||||||
|
#include "nm-setting-adsl.h"
|
||||||
|
#include "nm-setting-bluetooth.h"
|
||||||
|
#include "nm-setting-bond.h"
|
||||||
|
#include "nm-setting-bridge-port.h"
|
||||||
|
#include "nm-setting-bridge.h"
|
||||||
|
#include "nm-setting-cdma.h"
|
||||||
|
#include "nm-setting-connection.h"
|
||||||
|
#include "nm-setting-dcb.h"
|
||||||
|
#include "nm-setting-dummy.h"
|
||||||
|
#include "nm-setting-generic.h"
|
||||||
|
#include "nm-setting-gsm.h"
|
||||||
|
#include "nm-setting-infiniband.h"
|
||||||
|
#include "nm-setting-ip-config.h"
|
||||||
|
#include "nm-setting-ip-tunnel.h"
|
||||||
|
#include "nm-setting-ip4-config.h"
|
||||||
|
#include "nm-setting-ip6-config.h"
|
||||||
|
#include "nm-setting-macsec.h"
|
||||||
|
#include "nm-setting-macvlan.h"
|
||||||
|
#include "nm-setting-olpc-mesh.h"
|
||||||
|
#include "nm-setting-ovs-bridge.h"
|
||||||
|
#include "nm-setting-ovs-interface.h"
|
||||||
|
#include "nm-setting-ovs-patch.h"
|
||||||
|
#include "nm-setting-ovs-port.h"
|
||||||
|
#include "nm-setting-ppp.h"
|
||||||
|
#include "nm-setting-pppoe.h"
|
||||||
|
#include "nm-setting-proxy.h"
|
||||||
|
#include "nm-setting-serial.h"
|
||||||
|
#include "nm-setting-team-port.h"
|
||||||
|
#include "nm-setting-team.h"
|
||||||
|
#include "nm-setting-tun.h"
|
||||||
|
#include "nm-setting-user.h"
|
||||||
|
#include "nm-setting-vlan.h"
|
||||||
|
#include "nm-setting-vpn.h"
|
||||||
|
#include "nm-setting-vxlan.h"
|
||||||
|
#include "nm-setting-wimax.h"
|
||||||
|
#include "nm-setting-wired.h"
|
||||||
|
#include "nm-setting-wireless-security.h"
|
||||||
|
#include "nm-setting-wireless.h"
|
||||||
|
#include "nm-setting.h"
|
||||||
|
#include "nm-simple-connection.h"
|
||||||
|
#include "nm-utils.h"
|
||||||
|
#include "nm-version.h"
|
||||||
|
#include "nm-vpn-dbus-interface.h"
|
||||||
|
#include "nm-vpn-editor-plugin.h"
|
||||||
|
#include "nm-vpn-plugin-info.h"
|
||||||
|
/*** END file-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-header ***/
|
||||||
|
GType
|
||||||
|
@enum_name@_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize g_define_type_id__volatile = 0;
|
||||||
|
|
||||||
|
if (g_once_init_enter (&g_define_type_id__volatile))
|
||||||
|
{
|
||||||
|
static const G@Type@Value values[] = {
|
||||||
|
/*** END value-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-production ***/
|
||||||
|
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||||
|
/*** END value-production ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-tail ***/
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
GType g_define_type_id =
|
||||||
|
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||||
|
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return g_define_type_id__volatile;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** END value-tail ***/
|
21
libnm-core/nm-core-enum-types.h.template
Normal file
21
libnm-core/nm-core-enum-types.h.template
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*** BEGIN file-header ***/
|
||||||
|
#ifndef __NM_CORE_ENUM_TYPES_H__
|
||||||
|
#define __NM_CORE_ENUM_TYPES_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
/*** END file-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN enumeration-production ***/
|
||||||
|
GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||||
|
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
|
||||||
|
|
||||||
|
/*** END enumeration-production ***/
|
||||||
|
|
||||||
|
/*** BEGIN file-tail ***/
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __NM_CORE_ENUM_TYPES_H__ */
|
||||||
|
/*** END file-tail ***/
|
@@ -7,26 +7,14 @@
|
|||||||
# -name "test-pkcs12" \
|
# -name "test-pkcs12" \
|
||||||
# -out test-cert.p12
|
# -out test-cert.p12
|
||||||
|
|
||||||
enums_header = files('test-general-enums.h')
|
enum_types = 'nm-core-tests-enum-types'
|
||||||
enums = 'nm-core-tests-enum-types'
|
|
||||||
|
|
||||||
enums_h = gnome.mkenums(
|
enum = gnome.mkenums(
|
||||||
enums + '.h',
|
enum_types,
|
||||||
sources: enums_header,
|
sources: 'test-general-enums.h',
|
||||||
identifier_prefix: 'NM',
|
identifier_prefix: nm_id_prefix,
|
||||||
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#ifndef __NM_CORE_TESTS_ENUM_TYPES_H__\n#define __NM_CORE_TESTS_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
|
c_template: enum_types + '.c.template',
|
||||||
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n',
|
h_template: enum_types + '.h.template'
|
||||||
ftail: 'G_END_DECLS\n\n#endif /* __NM_CORE_TESTS_ENUM_TYPES_H__ */'
|
|
||||||
)
|
|
||||||
|
|
||||||
enums_c = gnome.mkenums(
|
|
||||||
enums + '.c',
|
|
||||||
sources: enums_header,
|
|
||||||
identifier_prefix: 'NM',
|
|
||||||
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#include "config.h"\n\n#include "nm-core-tests-enum-types.h"\n\n#include "test-general-enums.h" \n\n',
|
|
||||||
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n',
|
|
||||||
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },',
|
|
||||||
vtail: ' { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
test_units = [
|
test_units = [
|
||||||
@@ -52,7 +40,7 @@ cflags = '-DTEST_CERT_DIR="@0@"'.format(test_cert_dir)
|
|||||||
foreach test_unit: test_units
|
foreach test_unit: test_units
|
||||||
exe = executable(
|
exe = executable(
|
||||||
'libnm-core-' + test_unit,
|
'libnm-core-' + test_unit,
|
||||||
[test_unit + '.c', enums_c, enums_h],
|
[test_unit + '.c'] + enum,
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: glib_dep,
|
dependencies: glib_dep,
|
||||||
c_args: cflags,
|
c_args: cflags,
|
||||||
|
35
libnm-core/tests/nm-core-tests-enum-types.c.template
Normal file
35
libnm-core/tests/nm-core-tests-enum-types.c.template
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/*** BEGIN file-header ***/
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "nm-core-tests-enum-types.h"
|
||||||
|
|
||||||
|
#include "test-general-enums.h"
|
||||||
|
/*** END file-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-header ***/
|
||||||
|
GType
|
||||||
|
@enum_name@_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize g_define_type_id__volatile = 0;
|
||||||
|
|
||||||
|
if (g_once_init_enter (&g_define_type_id__volatile))
|
||||||
|
{
|
||||||
|
static const G@Type@Value values[] = {
|
||||||
|
/*** END value-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-production ***/
|
||||||
|
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||||
|
/*** END value-production ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-tail ***/
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
GType g_define_type_id =
|
||||||
|
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||||
|
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return g_define_type_id__volatile;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** END value-tail ***/
|
21
libnm-core/tests/nm-core-tests-enum-types.h.template
Normal file
21
libnm-core/tests/nm-core-tests-enum-types.h.template
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*** BEGIN file-header ***/
|
||||||
|
#ifndef __NM_CORE_TESTS_ENUM_TYPES_H__
|
||||||
|
#define __NM_CORE_TESTS_ENUM_TYPES_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
/*** END file-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN enumeration-production ***/
|
||||||
|
GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||||
|
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
|
||||||
|
|
||||||
|
/*** END enumeration-production ***/
|
||||||
|
|
||||||
|
/*** BEGIN file-tail ***/
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __NM_CORE_TESTS_ENUM_TYPES_H__ */
|
||||||
|
/*** END file-tail ***/
|
@@ -92,31 +92,18 @@ sources += custom_target(
|
|||||||
command: [dbus_binding_tool, '--prefix=nm_vpn_plugin', '--mode=glib-server', '--output=@OUTPUT@', '@INPUT@']
|
command: [dbus_binding_tool, '--prefix=nm_vpn_plugin', '--mode=glib-server', '--output=@OUTPUT@', '@INPUT@']
|
||||||
)
|
)
|
||||||
|
|
||||||
enums = 'nm-vpn-enum-types'
|
enum_types = 'nm-vpn-enum-types'
|
||||||
|
|
||||||
libnm_glib_vpn_enums_h = gnome.mkenums(
|
libnm_glib_vpn_enum = gnome.mkenums(
|
||||||
enums + '.h',
|
enum_types,
|
||||||
sources: vpn_headers,
|
sources: vpn_headers,
|
||||||
identifier_prefix: nm_id_prefix,
|
identifier_prefix: nm_id_prefix,
|
||||||
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#ifndef __NM_VPN_ENUM_TYPES_H__\n#define __NM_VPN_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
|
c_template: enum_types + '.c.template',
|
||||||
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n',
|
h_template: enum_types + '.h.template',
|
||||||
ftail: 'G_END_DECLS\n\n#endif /* __NM_VPN_ENUM_TYPES_H__ */',
|
|
||||||
install_header: true,
|
install_header: true,
|
||||||
install_dir: libnm_glib_pkgincludedir
|
install_dir: libnm_glib_pkgincludedir
|
||||||
)
|
)
|
||||||
|
|
||||||
libnm_glib_vpn_enums_c = gnome.mkenums(
|
|
||||||
enums + '.c',
|
|
||||||
sources: vpn_headers,
|
|
||||||
identifier_prefix: nm_id_prefix,
|
|
||||||
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#include "config.h"\n\n#include "nm-vpn-enum-types.h"\n\n#include "nm-vpn-plugin.h" \n#include "nm-vpn-plugin-ui-interface.h" \n#include "nm-vpn-plugin-utils.h"\n\n',
|
|
||||||
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n',
|
|
||||||
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },\n',
|
|
||||||
vtail: ' { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n'
|
|
||||||
)
|
|
||||||
|
|
||||||
libnm_glib_vpn_enums = [libnm_glib_vpn_enums_c, libnm_glib_vpn_enums_h]
|
|
||||||
|
|
||||||
deps = common_deps + [libnm_util_dep]
|
deps = common_deps + [libnm_util_dep]
|
||||||
|
|
||||||
symbol_map = join_paths(meson.current_source_dir(), 'libnm-glib-vpn.ver')
|
symbol_map = join_paths(meson.current_source_dir(), 'libnm-glib-vpn.ver')
|
||||||
@@ -128,7 +115,7 @@ endif
|
|||||||
|
|
||||||
libnm_glib_vpn = shared_library(
|
libnm_glib_vpn = shared_library(
|
||||||
'nm-glib-vpn',
|
'nm-glib-vpn',
|
||||||
sources: sources + libnm_glib_vpn_enums + [libnm_utils_enums_h],
|
sources: sources + libnm_glib_vpn_enum + [libnm_utils_enum[1]],
|
||||||
version: libnm_glib_vpn_version,
|
version: libnm_glib_vpn_version,
|
||||||
include_directories: common_incs,
|
include_directories: common_incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
@@ -198,31 +185,18 @@ nm_secret_agent_glue = custom_target(
|
|||||||
command: [dbus_binding_tool, '--prefix=nm_secret_agent', '--mode=glib-server', '--output=@OUTPUT@', '@INPUT@']
|
command: [dbus_binding_tool, '--prefix=nm_secret_agent', '--mode=glib-server', '--output=@OUTPUT@', '@INPUT@']
|
||||||
)
|
)
|
||||||
|
|
||||||
enums = 'nm-glib-enum-types'
|
enum_types = 'nm-glib-enum-types'
|
||||||
|
|
||||||
libnm_glib_enums_h = gnome.mkenums(
|
libnm_glib_enum = gnome.mkenums(
|
||||||
enums + '.h',
|
enum_types,
|
||||||
sources: headers,
|
sources: headers,
|
||||||
identifier_prefix: nm_id_prefix,
|
identifier_prefix: nm_id_prefix,
|
||||||
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#ifndef __NM_GLIB_ENUM_TYPES_H__\n#define __NM_GLIB_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
|
c_template: enum_types + '.c.template',
|
||||||
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n',
|
h_template: enum_types + '.h.template',
|
||||||
ftail: 'G_END_DECLS\n\n#endif /* __NM_GLIB_ENUM_TYPES_H__ */',
|
|
||||||
install_header: true,
|
install_header: true,
|
||||||
install_dir: libnm_glib_pkgincludedir
|
install_dir: libnm_glib_pkgincludedir
|
||||||
)
|
)
|
||||||
|
|
||||||
libnm_glib_enums_c = gnome.mkenums(
|
|
||||||
enums + '.c',
|
|
||||||
sources: headers,
|
|
||||||
identifier_prefix: nm_id_prefix,
|
|
||||||
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#include "config.h"\n\n#include "nm-glib-enum-types.h"\n\n#include "nm-object.h" \n#include "nm-client.h" \n#include "nm-device.h" \n#include "nm-device-ethernet.h" \n#include "nm-device-infiniband.h" \n#include "nm-device-adsl.h" \n#include "nm-device-wifi.h" \n#include "nm-device-bt.h" \n#include "nm-device-olpc-mesh.h" \n#include "nm-device-bond.h" \n#include "nm-device-team.h" \n#include "nm-device-bridge.h" \n#include "nm-device-vlan.h" \n#include "nm-device-generic.h" \n#include "nm-access-point.h" \n#include "nm-ip4-config.h" \n#include "nm-device-modem.h" \n#include "nm-vpn-connection.h" \n#include "nm-types.h" \n#include "nm-active-connection.h" \n#include "nm-dhcp4-config.h" \n#include "nm-ip6-config.h" \n#include "nm-dhcp6-config.h" \n#include "nm-remote-connection.h" \n#include "nm-remote-settings.h" \n#include "nm-secret-agent.h" \n#include "nm-device-wimax.h" \n#include "nm-wimax-nsp.h"\n\n',
|
|
||||||
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n',
|
|
||||||
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },\n',
|
|
||||||
vtail: ' { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n'
|
|
||||||
)
|
|
||||||
|
|
||||||
libnm_glib_enums = [libnm_glib_enums_c, libnm_glib_enums_h]
|
|
||||||
|
|
||||||
deps = common_deps + [
|
deps = common_deps + [
|
||||||
libudev_dep,
|
libudev_dep,
|
||||||
libnm_util_dep
|
libnm_util_dep
|
||||||
@@ -239,7 +213,7 @@ endif
|
|||||||
|
|
||||||
libnm_glib = shared_library(
|
libnm_glib = shared_library(
|
||||||
'nm-glib',
|
'nm-glib',
|
||||||
sources: sources + libnm_glib_enums + [nm_secret_agent_glue, libnm_utils_enums_h],
|
sources: sources + libnm_glib_enum + [nm_secret_agent_glue, libnm_utils_enum[1]],
|
||||||
version: libnm_glib_version,
|
version: libnm_glib_version,
|
||||||
include_directories: common_incs,
|
include_directories: common_incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
@@ -269,7 +243,7 @@ pkg.generate(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if enable_introspection
|
if enable_introspection
|
||||||
gir_sources = sources + headers + libnm_glib_enums
|
gir_sources = sources + headers + libnm_glib_enum
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
dbus_glib_dep,
|
dbus_glib_dep,
|
||||||
@@ -308,7 +282,7 @@ deps = common_deps + [libnm_util_dep]
|
|||||||
|
|
||||||
executable(
|
executable(
|
||||||
name,
|
name,
|
||||||
[name + '.c', libnm_utils_enums_h],
|
[name + '.c', libnm_utils_enum[1]],
|
||||||
include_directories: common_incs,
|
include_directories: common_incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: common_cflags,
|
c_args: common_cflags,
|
||||||
|
62
libnm-glib/nm-glib-enum-types.c.template
Normal file
62
libnm-glib/nm-glib-enum-types.c.template
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
/*** BEGIN file-header ***/
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "nm-glib-enum-types.h"
|
||||||
|
|
||||||
|
#include "nm-object.h"
|
||||||
|
#include "nm-client.h"
|
||||||
|
#include "nm-device.h"
|
||||||
|
#include "nm-device-ethernet.h"
|
||||||
|
#include "nm-device-infiniband.h"
|
||||||
|
#include "nm-device-adsl.h"
|
||||||
|
#include "nm-device-wifi.h"
|
||||||
|
#include "nm-device-bt.h"
|
||||||
|
#include "nm-device-olpc-mesh.h"
|
||||||
|
#include "nm-device-bond.h"
|
||||||
|
#include "nm-device-team.h"
|
||||||
|
#include "nm-device-bridge.h"
|
||||||
|
#include "nm-device-vlan.h"
|
||||||
|
#include "nm-device-generic.h"
|
||||||
|
#include "nm-access-point.h"
|
||||||
|
#include "nm-ip4-config.h"
|
||||||
|
#include "nm-device-modem.h"
|
||||||
|
#include "nm-vpn-connection.h"
|
||||||
|
#include "nm-types.h"
|
||||||
|
#include "nm-active-connection.h"
|
||||||
|
#include "nm-dhcp4-config.h"
|
||||||
|
#include "nm-ip6-config.h"
|
||||||
|
#include "nm-dhcp6-config.h"
|
||||||
|
#include "nm-remote-connection.h"
|
||||||
|
#include "nm-remote-settings.h"
|
||||||
|
#include "nm-secret-agent.h"
|
||||||
|
#include "nm-device-wimax.h"
|
||||||
|
#include "nm-wimax-nsp.h"
|
||||||
|
/*** END file-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-header ***/
|
||||||
|
GType
|
||||||
|
@enum_name@_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize g_define_type_id__volatile = 0;
|
||||||
|
|
||||||
|
if (g_once_init_enter (&g_define_type_id__volatile))
|
||||||
|
{
|
||||||
|
static const G@Type@Value values[] = {
|
||||||
|
/*** END value-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-production ***/
|
||||||
|
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||||
|
/*** END value-production ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-tail ***/
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
GType g_define_type_id =
|
||||||
|
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||||
|
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return g_define_type_id__volatile;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** END value-tail ***/
|
21
libnm-glib/nm-glib-enum-types.h.template
Normal file
21
libnm-glib/nm-glib-enum-types.h.template
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*** BEGIN file-header ***/
|
||||||
|
#ifndef __NM_GLIB_ENUM_TYPES_H__
|
||||||
|
#define __NM_GLIB_ENUM_TYPES_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
/*** END file-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN enumeration-production ***/
|
||||||
|
GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||||
|
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
|
||||||
|
|
||||||
|
/*** END enumeration-production ***/
|
||||||
|
|
||||||
|
/*** BEGIN file-tail ***/
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __NM_GLIB_ENUM_TYPES_H__ */
|
||||||
|
/*** END file-tail ***/
|
37
libnm-glib/nm-vpn-enum-types.c.template
Normal file
37
libnm-glib/nm-vpn-enum-types.c.template
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/*** BEGIN file-header ***/
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "nm-vpn-enum-types.h"
|
||||||
|
|
||||||
|
#include "nm-vpn-plugin.h"
|
||||||
|
#include "nm-vpn-plugin-ui-interface.h"
|
||||||
|
#include "nm-vpn-plugin-utils.h"
|
||||||
|
/*** END file-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-header ***/
|
||||||
|
GType
|
||||||
|
@enum_name@_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize g_define_type_id__volatile = 0;
|
||||||
|
|
||||||
|
if (g_once_init_enter (&g_define_type_id__volatile))
|
||||||
|
{
|
||||||
|
static const G@Type@Value values[] = {
|
||||||
|
/*** END value-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-production ***/
|
||||||
|
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||||
|
/*** END value-production ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-tail ***/
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
GType g_define_type_id =
|
||||||
|
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||||
|
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return g_define_type_id__volatile;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** END value-tail ***/
|
21
libnm-glib/nm-vpn-enum-types.h.template
Normal file
21
libnm-glib/nm-vpn-enum-types.h.template
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*** BEGIN file-header ***/
|
||||||
|
#ifndef __NM_VPN_ENUM_TYPES_H__
|
||||||
|
#define __NM_VPN_ENUM_TYPES_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
/*** END file-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN enumeration-production ***/
|
||||||
|
GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||||
|
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
|
||||||
|
|
||||||
|
/*** END enumeration-production ***/
|
||||||
|
|
||||||
|
/*** BEGIN file-tail ***/
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __NM_VPN_ENUM_TYPES_H__ */
|
||||||
|
/*** END file-tail ***/
|
@@ -24,7 +24,7 @@ test_units = [
|
|||||||
foreach test_unit: test_units
|
foreach test_unit: test_units
|
||||||
exe = executable(
|
exe = executable(
|
||||||
test_unit,
|
test_unit,
|
||||||
[test_unit + '.c', libnm_utils_enums_h] + shared_test_utils,
|
[test_unit + '.c', libnm_utils_enum[1]] + shared_test_utils,
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: cflags
|
c_args: cflags
|
||||||
|
@@ -43,31 +43,18 @@ install_headers(
|
|||||||
subdir: nm_name
|
subdir: nm_name
|
||||||
)
|
)
|
||||||
|
|
||||||
enums = 'nm-utils-enum-types'
|
enum_types = 'nm-utils-enum-types'
|
||||||
|
|
||||||
libnm_utils_enums_h = gnome.mkenums(
|
libnm_utils_enum = gnome.mkenums(
|
||||||
enums + '.h',
|
enum_types,
|
||||||
sources: enums_headers,
|
sources: enums_headers,
|
||||||
identifier_prefix: nm_id_prefix,
|
identifier_prefix: nm_id_prefix,
|
||||||
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#ifndef __NM_UTILS_ENUM_TYPES_H__\n#define __NM_UTILS_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
|
c_template: enum_types + '.c.template',
|
||||||
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n',
|
h_template: enum_types + '.h.template',
|
||||||
ftail: 'G_END_DECLS\n\n#endif /* __NM_UTILS_ENUM_TYPES_H__ */',
|
|
||||||
install_header: true,
|
install_header: true,
|
||||||
install_dir: nm_pkgincludedir
|
install_dir: nm_pkgincludedir
|
||||||
)
|
)
|
||||||
|
|
||||||
libnm_utils_enums_c = gnome.mkenums(
|
|
||||||
enums + '.c',
|
|
||||||
sources: enums_headers,
|
|
||||||
identifier_prefix: nm_id_prefix,
|
|
||||||
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#include "config.h"\n\n#include "nm-utils-enum-types.h"\n\n#include "nm-version-macros.h" \n#include "nm-connection.h" \n#include "nm-setting.h" \n#include "nm-setting-8021x.h" \n#include "nm-setting-adsl.h" \n#include "nm-setting-bluetooth.h" \n#include "nm-setting-bond.h" \n#include "nm-setting-team.h" \n#include "nm-setting-team-port.h" \n#include "nm-setting-bridge.h" \n#include "nm-setting-bridge-port.h" \n#include "nm-setting-connection.h" \n#include "nm-setting-dcb.h" \n#include "nm-setting-infiniband.h" \n#include "nm-setting-ip4-config.h" \n#include "nm-setting-vlan.h" \n#include "nm-setting-ip6-config.h" \n#include "nm-setting-ppp.h" \n#include "nm-setting-pppoe.h" \n#include "nm-setting-serial.h" \n#include "nm-setting-generic.h" \n#include "nm-setting-gsm.h" \n#include "nm-setting-cdma.h" \n#include "nm-setting-olpc-mesh.h" \n#include "nm-setting-wimax.h" \n#include "nm-setting-wired.h" \n#include "nm-setting-wireless.h" \n#include "nm-setting-wireless-security.h" \n#include "nm-setting-vpn.h" \n#include "nm-utils.h" \n#include "nm-version.h"\n\n',
|
|
||||||
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n',
|
|
||||||
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },\n',
|
|
||||||
vtail: ' { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n'
|
|
||||||
)
|
|
||||||
|
|
||||||
libnm_utils_enums = [libnm_utils_enums_c, libnm_utils_enums_h]
|
|
||||||
|
|
||||||
sources = shared_utils + files(
|
sources = shared_utils + files(
|
||||||
'crypto.c',
|
'crypto.c',
|
||||||
'crypto_' + crypto + '.c',
|
'crypto_' + crypto + '.c',
|
||||||
@@ -132,7 +119,7 @@ endif
|
|||||||
|
|
||||||
libnm_util = shared_library(
|
libnm_util = shared_library(
|
||||||
'nm-util',
|
'nm-util',
|
||||||
sources: sources + libnm_utils_enums,
|
sources: sources + libnm_utils_enum,
|
||||||
version: libnm_util_version,
|
version: libnm_util_version,
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
@@ -161,7 +148,7 @@ pkg.generate(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if enable_introspection
|
if enable_introspection
|
||||||
gir_sources = sources + headers + libnm_utils_enums
|
gir_sources = sources + headers + libnm_utils_enum
|
||||||
|
|
||||||
gir_includes = [
|
gir_includes = [
|
||||||
'DBusGLib-1.0',
|
'DBusGLib-1.0',
|
||||||
|
65
libnm-util/nm-utils-enum-types.c.template
Normal file
65
libnm-util/nm-utils-enum-types.c.template
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/*** BEGIN file-header ***/
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "nm-utils-enum-types.h"
|
||||||
|
|
||||||
|
#include "nm-version-macros.h"
|
||||||
|
#include "nm-connection.h"
|
||||||
|
#include "nm-setting.h"
|
||||||
|
#include "nm-setting-8021x.h"
|
||||||
|
#include "nm-setting-adsl.h"
|
||||||
|
#include "nm-setting-bluetooth.h"
|
||||||
|
#include "nm-setting-bond.h"
|
||||||
|
#include "nm-setting-team.h"
|
||||||
|
#include "nm-setting-team-port.h"
|
||||||
|
#include "nm-setting-bridge.h"
|
||||||
|
#include "nm-setting-bridge-port.h"
|
||||||
|
#include "nm-setting-connection.h"
|
||||||
|
#include "nm-setting-dcb.h"
|
||||||
|
#include "nm-setting-infiniband.h"
|
||||||
|
#include "nm-setting-ip4-config.h"
|
||||||
|
#include "nm-setting-vlan.h"
|
||||||
|
#include "nm-setting-ip6-config.h"
|
||||||
|
#include "nm-setting-ppp.h"
|
||||||
|
#include "nm-setting-pppoe.h"
|
||||||
|
#include "nm-setting-serial.h"
|
||||||
|
#include "nm-setting-generic.h"
|
||||||
|
#include "nm-setting-gsm.h"
|
||||||
|
#include "nm-setting-cdma.h"
|
||||||
|
#include "nm-setting-olpc-mesh.h"
|
||||||
|
#include "nm-setting-wimax.h"
|
||||||
|
#include "nm-setting-wired.h"
|
||||||
|
#include "nm-setting-wireless.h"
|
||||||
|
#include "nm-setting-wireless-security.h"
|
||||||
|
#include "nm-setting-vpn.h"
|
||||||
|
#include "nm-utils.h"
|
||||||
|
#include "nm-version.h"
|
||||||
|
/*** END file-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-header ***/
|
||||||
|
GType
|
||||||
|
@enum_name@_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize g_define_type_id__volatile = 0;
|
||||||
|
|
||||||
|
if (g_once_init_enter (&g_define_type_id__volatile))
|
||||||
|
{
|
||||||
|
static const G@Type@Value values[] = {
|
||||||
|
/*** END value-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-production ***/
|
||||||
|
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||||
|
/*** END value-production ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-tail ***/
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
GType g_define_type_id =
|
||||||
|
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||||
|
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return g_define_type_id__volatile;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** END value-tail ***/
|
21
libnm-util/nm-utils-enum-types.h.template
Normal file
21
libnm-util/nm-utils-enum-types.h.template
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*** BEGIN file-header ***/
|
||||||
|
#ifndef __NM_UTILS_ENUM_TYPES_H__
|
||||||
|
#define __NM_UTILS_ENUM_TYPES_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
/*** END file-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN enumeration-production ***/
|
||||||
|
GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||||
|
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
|
||||||
|
|
||||||
|
/*** END enumeration-production ***/
|
||||||
|
|
||||||
|
/*** BEGIN file-tail ***/
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __NM_UTILS_ENUM_TYPES_H__ */
|
||||||
|
/*** END file-tail ***/
|
@@ -19,7 +19,7 @@ test = 'test-libnm-linking'
|
|||||||
|
|
||||||
test_libnm_linking = executable(
|
test_libnm_linking = executable(
|
||||||
test,
|
test,
|
||||||
[test + '.c', libnm_utils_enums_h],
|
[test + '.c', libnm_utils_enum[1]],
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: deps + [libnm_dep],
|
dependencies: deps + [libnm_dep],
|
||||||
c_args: cflags
|
c_args: cflags
|
||||||
@@ -37,7 +37,7 @@ test_units = [
|
|||||||
foreach test_unit: test_units
|
foreach test_unit: test_units
|
||||||
exe = executable(
|
exe = executable(
|
||||||
'libnm-util-' + test_unit[0],
|
'libnm-util-' + test_unit[0],
|
||||||
[test_unit[0] + '.c', libnm_utils_enums_h],
|
[test_unit[0] + '.c', libnm_utils_enum[1]],
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: cflags,
|
c_args: cflags,
|
||||||
|
@@ -81,32 +81,19 @@ install_headers(
|
|||||||
subdir: 'libnm'
|
subdir: 'libnm'
|
||||||
)
|
)
|
||||||
|
|
||||||
enums_headers = libnm_headers + [version_header]
|
enum_headers = libnm_headers + [version_header]
|
||||||
enums = 'nm-enum-types'
|
enum_types = 'nm-enum-types'
|
||||||
|
|
||||||
libnm_enums_h = gnome.mkenums(
|
libnm_enum = gnome.mkenums(
|
||||||
enums + '.h',
|
enum_types,
|
||||||
sources: enums_headers,
|
sources: enum_headers,
|
||||||
identifier_prefix: nm_id_prefix,
|
identifier_prefix: nm_id_prefix,
|
||||||
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#ifndef __NM_ENUM_TYPES_H__\n#define __NM_ENUM_TYPES_H__\n\n#include <nm-core-enum-types.h>\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
|
c_template: enum_types + '.c.template',
|
||||||
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n',
|
h_template: enum_types + '.h.template',
|
||||||
ftail: 'G_END_DECLS\n\n#endif /* __NM_ENUM_TYPES_H__ */',
|
|
||||||
install_header: true,
|
install_header: true,
|
||||||
install_dir: libnm_pkgincludedir
|
install_dir: libnm_pkgincludedir
|
||||||
)
|
)
|
||||||
|
|
||||||
libnm_enums_c = gnome.mkenums(
|
|
||||||
enums + '.c',
|
|
||||||
sources: enums_headers,
|
|
||||||
identifier_prefix: nm_id_prefix,
|
|
||||||
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#include "config.h"\n\n#include "nm-enum-types.h"\n#include "nm-default.h"\n\n#include "nm-version-macros.h" \n#include "NetworkManager.h" \n#include "nm-access-point.h" \n#include "nm-active-connection.h" \n#include "nm-checkpoint.h" \n#include "nm-client.h" \n#include "nm-device-adsl.h" \n#include "nm-device-bond.h" \n#include "nm-device-bridge.h" \n#include "nm-device-bt.h" \n#include "nm-device-dummy.h" \n#include "nm-device-ethernet.h" \n#include "nm-device-generic.h" \n#include "nm-device-infiniband.h" \n#include "nm-device-ip-tunnel.h" \n#include "nm-device-macsec.h" \n#include "nm-device-macvlan.h" \n#include "nm-device-modem.h" \n#include "nm-device-olpc-mesh.h" \n#include "nm-device-ovs-interface.h" \n#include "nm-device-ovs-port.h" \n#include "nm-device-ovs-bridge.h" \n#include "nm-device-ppp.h" \n#include "nm-device-team.h" \n#include "nm-device-tun.h" \n#include "nm-device-vlan.h" \n#include "nm-device-vxlan.h" \n#include "nm-device-wifi.h" \n#include "nm-device-wimax.h" \n#include "nm-device.h" \n#include "nm-dhcp-config.h" \n#include "nm-ip-config.h" \n#include "nm-object.h" \n#include "nm-remote-connection.h" \n#include "nm-types.h" \n#include "nm-vpn-connection.h" \n#include "nm-vpn-editor.h" \n#include "nm-wimax-nsp.h" \n#include "nm-secret-agent-old.h" \n#include "nm-vpn-plugin-old.h" \n#include "nm-vpn-service-plugin.h"\n\n',
|
|
||||||
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n',
|
|
||||||
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },\n',
|
|
||||||
vtail: ' { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n'
|
|
||||||
)
|
|
||||||
|
|
||||||
libnm_enums = [libnm_enums_c, libnm_enums_h]
|
|
||||||
|
|
||||||
libnm_sources = files(
|
libnm_sources = files(
|
||||||
'nm-access-point.c',
|
'nm-access-point.c',
|
||||||
'nm-active-connection.c',
|
'nm-active-connection.c',
|
||||||
@@ -172,7 +159,7 @@ endif
|
|||||||
|
|
||||||
libnm = shared_library(
|
libnm = shared_library(
|
||||||
'nm',
|
'nm',
|
||||||
sources: libnm_sources + libnm_enums,
|
sources: libnm_sources + libnm_enum,
|
||||||
version: libnm_version,
|
version: libnm_version,
|
||||||
include_directories: incs + [libnm_core_inc],
|
include_directories: incs + [libnm_core_inc],
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
@@ -212,7 +199,7 @@ run_target(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if enable_introspection
|
if enable_introspection
|
||||||
gir_sources = libnm_core_enums + libnm_core_headers + libnm_core_sources + libnm_enums + libnm_headers + libnm_sources + [version_header]
|
gir_sources = libnm_core_enum + libnm_core_headers + libnm_core_sources + libnm_enum + libnm_headers + libnm_sources + [version_header]
|
||||||
|
|
||||||
gir_dir = join_paths(nm_datadir, 'gir-' + nm_gir_version)
|
gir_dir = join_paths(nm_datadir, 'gir-' + nm_gir_version)
|
||||||
typelib_dir = join_paths(nm_libdir, 'girepository-' + nm_gir_version)
|
typelib_dir = join_paths(nm_libdir, 'girepository-' + nm_gir_version)
|
||||||
|
76
libnm/nm-enum-types.c.template
Normal file
76
libnm/nm-enum-types.c.template
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/*** BEGIN file-header ***/
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "nm-enum-types.h"
|
||||||
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-version-macros.h"
|
||||||
|
#include "NetworkManager.h"
|
||||||
|
#include "nm-access-point.h"
|
||||||
|
#include "nm-active-connection.h"
|
||||||
|
#include "nm-checkpoint.h"
|
||||||
|
#include "nm-client.h"
|
||||||
|
#include "nm-device-adsl.h"
|
||||||
|
#include "nm-device-bond.h"
|
||||||
|
#include "nm-device-bridge.h"
|
||||||
|
#include "nm-device-bt.h"
|
||||||
|
#include "nm-device-dummy.h"
|
||||||
|
#include "nm-device-ethernet.h"
|
||||||
|
#include "nm-device-generic.h"
|
||||||
|
#include "nm-device-infiniband.h"
|
||||||
|
#include "nm-device-ip-tunnel.h"
|
||||||
|
#include "nm-device-macsec.h"
|
||||||
|
#include "nm-device-macvlan.h"
|
||||||
|
#include "nm-device-modem.h"
|
||||||
|
#include "nm-device-olpc-mesh.h"
|
||||||
|
#include "nm-device-ovs-interface.h"
|
||||||
|
#include "nm-device-ovs-port.h"
|
||||||
|
#include "nm-device-ovs-bridge.h"
|
||||||
|
#include "nm-device-ppp.h"
|
||||||
|
#include "nm-device-team.h"
|
||||||
|
#include "nm-device-tun.h"
|
||||||
|
#include "nm-device-vlan.h"
|
||||||
|
#include "nm-device-vxlan.h"
|
||||||
|
#include "nm-device-wifi.h"
|
||||||
|
#include "nm-device-wimax.h"
|
||||||
|
#include "nm-device.h"
|
||||||
|
#include "nm-dhcp-config.h"
|
||||||
|
#include "nm-ip-config.h"
|
||||||
|
#include "nm-object.h"
|
||||||
|
#include "nm-remote-connection.h"
|
||||||
|
#include "nm-types.h"
|
||||||
|
#include "nm-vpn-connection.h"
|
||||||
|
#include "nm-vpn-editor.h"
|
||||||
|
#include "nm-wimax-nsp.h"
|
||||||
|
#include "nm-secret-agent-old.h"
|
||||||
|
#include "nm-vpn-plugin-old.h"
|
||||||
|
#include "nm-vpn-service-plugin.h"
|
||||||
|
/*** END file-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-header ***/
|
||||||
|
GType
|
||||||
|
@enum_name@_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize g_define_type_id__volatile = 0;
|
||||||
|
|
||||||
|
if (g_once_init_enter (&g_define_type_id__volatile))
|
||||||
|
{
|
||||||
|
static const G@Type@Value values[] = {
|
||||||
|
/*** END value-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-production ***/
|
||||||
|
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||||
|
/*** END value-production ***/
|
||||||
|
|
||||||
|
/*** BEGIN value-tail ***/
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
GType g_define_type_id =
|
||||||
|
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||||
|
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return g_define_type_id__volatile;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** END value-tail ***/
|
22
libnm/nm-enum-types.h.template
Normal file
22
libnm/nm-enum-types.h.template
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/*** BEGIN file-header ***/
|
||||||
|
#ifndef __NM_ENUM_TYPES_H__
|
||||||
|
#define __NM_ENUM_TYPES_H__
|
||||||
|
|
||||||
|
#include <nm-core-enum-types.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
/*** END file-header ***/
|
||||||
|
|
||||||
|
/*** BEGIN enumeration-production ***/
|
||||||
|
GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||||
|
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
|
||||||
|
|
||||||
|
/*** END enumeration-production ***/
|
||||||
|
|
||||||
|
/*** BEGIN file-tail ***/
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __NM_ENUM_TYPES_H__ */
|
||||||
|
/*** END file-tail ***/
|
@@ -45,7 +45,7 @@ incs = [
|
|||||||
# just test, that we can build "nm-vpn-plugin-utils.c"
|
# just test, that we can build "nm-vpn-plugin-utils.c"
|
||||||
libnm_vpn_plugin_utils_test = static_library(
|
libnm_vpn_plugin_utils_test = static_library(
|
||||||
'nm-vpn-plugin-utils-test',
|
'nm-vpn-plugin-utils-test',
|
||||||
sources: shared_vpn_plugin_utils + [libnm_enums_h],
|
sources: shared_vpn_plugin_utils + [libnm_enum[1]],
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: glib_dep
|
dependencies: glib_dep
|
||||||
)
|
)
|
||||||
|
@@ -20,7 +20,7 @@ core_incs = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
core_dep = declare_dependency(
|
core_dep = declare_dependency(
|
||||||
sources: libnm_core_enums_h,
|
sources: libnm_core_enum[1],
|
||||||
include_directories: core_incs,
|
include_directories: core_incs,
|
||||||
dependencies: glib_dep,
|
dependencies: glib_dep,
|
||||||
compile_args: core_cflags
|
compile_args: core_cflags
|
||||||
|
@@ -13,7 +13,7 @@ cflags = [
|
|||||||
nm_pppd_plugin = shared_module(
|
nm_pppd_plugin = shared_module(
|
||||||
name,
|
name,
|
||||||
name_prefix: '',
|
name_prefix: '',
|
||||||
sources: [name + '.c', libnm_core_enums_h],
|
sources: [name + '.c', libnm_core_enum[1]],
|
||||||
include_directories: core_incs,
|
include_directories: core_incs,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: cflags,
|
c_args: cflags,
|
||||||
|
@@ -69,7 +69,7 @@ cflags = '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD'
|
|||||||
|
|
||||||
libsystemd_nm = static_library(
|
libsystemd_nm = static_library(
|
||||||
'systemd-nm',
|
'systemd-nm',
|
||||||
sources: sources + [libnm_core_enums_h],
|
sources: sources + [libnm_core_enum[1]],
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: glib_dep,
|
dependencies: glib_dep,
|
||||||
c_args: cflags
|
c_args: cflags
|
||||||
|
@@ -27,7 +27,7 @@ cflags = '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD'
|
|||||||
|
|
||||||
exe = executable(
|
exe = executable(
|
||||||
test_unit,
|
test_unit,
|
||||||
[test_unit + '.c', libnm_core_enums_h] + shared_siphash,
|
[test_unit + '.c', libnm_core_enum[1]] + shared_siphash,
|
||||||
include_directories: core_incs,
|
include_directories: core_incs,
|
||||||
dependencies: glib_dep,
|
dependencies: glib_dep,
|
||||||
c_args: cflags,
|
c_args: cflags,
|
||||||
|
Reference in New Issue
Block a user