mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 11:50:29 +01:00
merge: branch 'jv/drop-autotools'
all: drop autotools build system https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2020
This commit is contained in:
commit
2896c5a38b
44 changed files with 230 additions and 10655 deletions
|
|
@ -60,11 +60,11 @@ variables:
|
|||
#
|
||||
# This is done by running `ci-fairy generate-template` and possibly bumping
|
||||
# ".default_tag".
|
||||
ALPINE_TAG: 'tag-5fca51298172'
|
||||
CENTOS_TAG: 'tag-40039d32d4e4'
|
||||
DEBIAN_TAG: 'tag-410ffa3d1295'
|
||||
FEDORA_TAG: 'tag-40039d32d4e4'
|
||||
UBUNTU_TAG: 'tag-410ffa3d1295'
|
||||
ALPINE_TAG: 'tag-759073a4a7c5'
|
||||
CENTOS_TAG: 'tag-0d2843d78314'
|
||||
DEBIAN_TAG: 'tag-529c288644bc'
|
||||
FEDORA_TAG: 'tag-0d2843d78314'
|
||||
UBUNTU_TAG: 'tag-529c288644bc'
|
||||
|
||||
ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh'
|
||||
CENTOS_EXEC: 'bash .gitlab-ci/fedora-install.sh'
|
||||
|
|
@ -638,7 +638,7 @@ check-tree:
|
|||
- date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc
|
||||
- date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh -n
|
||||
- date '+%Y%m%d-%H%M%S'; ci-fairy generate-template && git diff --exit-code
|
||||
- date '+%Y%m%d-%H%M%S'; ./autogen.sh --disable-autotools-deprecation && [ "$(LANG=C make -C po update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ]
|
||||
- date '+%Y%m%d-%H%M%S'; meson setup build && [ "$(LANG=C ninja -C build NetworkManager-update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ]
|
||||
|
||||
pages:
|
||||
stage: deploy
|
||||
|
|
@ -680,7 +680,7 @@ coverity:
|
|||
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "weekly"
|
||||
script:
|
||||
- dnf install -y curl
|
||||
- BUILD_TYPE=meson CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
|
||||
- CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
|
||||
- cd build
|
||||
- ../.gitlab-ci/coverity.sh download
|
||||
- cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ Regenerate the yml by running `ci-fairy generate-template`.
|
|||
There are also tests for checking that the yml is correct:
|
||||
|
||||
1) run `tools/check-gitlab-ci.sh`
|
||||
2) run `make check-local-gitlab-ci`, which runs 1). This also
|
||||
runs as part of `make check`.
|
||||
2) run `meson test check-local-gitlab-ci`, which runs 1). This also
|
||||
runs as part of `meson test`.
|
||||
|
||||
In both cases, the test is skipped if `ci-fairy` is not in the path.
|
||||
Install the correct `ci-fairy` version.
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ check-tree:
|
|||
- date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc
|
||||
- date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh -n
|
||||
- date '+%Y%m%d-%H%M%S'; ci-fairy generate-template && git diff --exit-code
|
||||
- date '+%Y%m%d-%H%M%S'; ./autogen.sh --disable-autotools-deprecation && [ "$(LANG=C make -C po update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ]
|
||||
- date '+%Y%m%d-%H%M%S'; meson setup build && [ "$(LANG=C ninja -C build NetworkManager-update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ]
|
||||
|
||||
pages:
|
||||
stage: deploy
|
||||
|
|
@ -261,7 +261,7 @@ coverity:
|
|||
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "weekly"
|
||||
script:
|
||||
- dnf install -y curl
|
||||
- BUILD_TYPE=meson CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
|
||||
- CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
|
||||
- cd build
|
||||
- ../.gitlab-ci/coverity.sh download
|
||||
- cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja
|
||||
|
|
|
|||
|
|
@ -107,11 +107,11 @@ check_run_clean() {
|
|||
}
|
||||
|
||||
if check_run_clean meson+gcc+docs+valgrind ; then
|
||||
BUILD_TYPE=meson CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
|
||||
CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
|
||||
mv INST/share/gtk-doc/html "$ARTIFACT_DIR/docs-html"
|
||||
fi
|
||||
|
||||
check_run_clean meson+clang && BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
|
||||
check_run_clean meson+clang && CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
|
||||
check_run_clean rpm+meson && test $IS_FEDORA = 1 && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson
|
||||
|
||||
if check_run_clean tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then
|
||||
|
|
@ -121,7 +121,7 @@ if check_run_clean tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then
|
|||
do_clean
|
||||
fi
|
||||
|
||||
check_run_clean tarball+meson && BUILD_TYPE=meson CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
|
||||
check_run_clean tarball+meson && CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
|
|||
|
|
@ -256,14 +256,13 @@ maintained by the upstream maintainers. There you find builds of latest `main` a
|
|||
Unit Tests
|
||||
----------
|
||||
|
||||
We have plenty of unit tests. Run them with `make check` or
|
||||
`meson test -C build`.
|
||||
We have plenty of unit tests. Run them with `meson test -C build`.
|
||||
|
||||
Note that some files in the source tree are both generated and commited
|
||||
to git. That means, certain changes to the code also affect these generated
|
||||
files. The unit test fail in that case, to indicate that the generated
|
||||
files no longer match what is commited to git.
|
||||
You can also automatically regenerate the files by running `NM_TEST_REGENERATE=1 make check`.
|
||||
You can also automatically regenerate the files by running `NM_TEST_REGENERATE=1 meson test`.
|
||||
Note that test-client requires working translation.
|
||||
See the [comment](src/tests/client/test-client.py#L14)
|
||||
for how to configure it.
|
||||
|
|
|
|||
|
|
@ -252,10 +252,10 @@ Versioning scheme (version numbers are called MAJOR.MINOR.MICRO):
|
|||
|
||||
When doing a release, follow this process:
|
||||
1. Ensure that `NEWS` file is up to date.
|
||||
2. Increment the version in `configure.ac`, commit and tag the commit. Example:
|
||||
2. Increment the version in `meson.build`, commit and tag the commit. Example:
|
||||
`git tag -s 1.2.8 -m 'Tag 1.2.8'`.
|
||||
3. Ensure that you are on the right commit and create the tarball:
|
||||
`git clean -fdx && ./autogen.sh && make distcheck`
|
||||
`git clean -fdx && meson setup build && cd build && meson dist`
|
||||
4. Upload the tarball: `scp ./*-*.tar.xz "$user@master.gnome.org:"`
|
||||
5. Login to `master.gnome.org` and run `ftpadmin install`.
|
||||
Ensure the new tarballs show up at https://download.gnome.org/sources/
|
||||
|
|
|
|||
5949
Makefile.am
5949
Makefile.am
File diff suppressed because it is too large
Load diff
|
|
@ -1,221 +0,0 @@
|
|||
###############################################################################
|
||||
# examples/C/glib
|
||||
###############################################################################
|
||||
|
||||
examples_C_glib_cppflags = \
|
||||
-I$(top_srcdir)/src/libnm-core-public \
|
||||
-I$(top_builddir)/src/libnm-core-public \
|
||||
-I$(top_srcdir)/src/libnm-client-public \
|
||||
-I$(top_builddir)/src/libnm-client-public \
|
||||
$(GLIB_CFLAGS)
|
||||
|
||||
examples_C_glib_cppflags_gdbus = $(examples_C_glib_cppflags)
|
||||
examples_C_glib_cppflags_libnm = $(examples_C_glib_cppflags)
|
||||
|
||||
check_programs_norun += \
|
||||
examples/C/glib/add-connection-gdbus \
|
||||
examples/C/glib/add-connection-libnm \
|
||||
examples/C/glib/get-active-connections-gdbus \
|
||||
examples/C/glib/get-ap-info-libnm \
|
||||
examples/C/glib/list-connections-gdbus \
|
||||
examples/C/glib/list-connections-libnm \
|
||||
examples/C/glib/monitor-nm-running-gdbus \
|
||||
examples/C/glib/monitor-nm-state-gdbus \
|
||||
examples/C/glib/vpn-import-libnm \
|
||||
$(NULL)
|
||||
|
||||
examples_C_glib_add_connection_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
|
||||
examples_C_glib_add_connection_gdbus_LDADD = \
|
||||
$(GLIB_LIBS) \
|
||||
$(UUID_LIBS)
|
||||
$(examples_C_glib_add_connection_gdbus_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
|
||||
|
||||
examples_C_glib_add_connection_libnm_CPPFLAGS = $(examples_C_glib_cppflags_libnm)
|
||||
examples_C_glib_add_connection_libnm_LDADD = \
|
||||
src/libnm-client-impl/libnm.la \
|
||||
$(GLIB_LIBS)
|
||||
$(examples_C_glib_add_connection_libnm_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
|
||||
|
||||
examples_C_glib_get_active_connections_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
|
||||
examples_C_glib_get_active_connections_gdbus_LDADD = \
|
||||
$(GLIB_LIBS)
|
||||
$(examples_C_glib_get_active_connections_gdbus_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
|
||||
|
||||
examples_C_glib_get_ap_info_libnm_CPPFLAGS = $(examples_C_glib_cppflags_libnm)
|
||||
examples_C_glib_get_ap_info_libnm_LDADD = \
|
||||
src/libnm-client-impl/libnm.la \
|
||||
$(GLIB_LIBS)
|
||||
$(examples_C_glib_get_ap_info_libnm_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
|
||||
|
||||
examples_C_glib_list_connections_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
|
||||
examples_C_glib_list_connections_gdbus_LDADD = \
|
||||
$(GLIB_LIBS)
|
||||
|
||||
examples_C_glib_list_connections_libnm_CPPFLAGS = $(examples_C_glib_cppflags_libnm)
|
||||
examples_C_glib_list_connections_libnm_LDADD = \
|
||||
src/libnm-client-impl/libnm.la \
|
||||
$(GLIB_LIBS)
|
||||
$(examples_C_glib_list_connections_libnm_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
|
||||
|
||||
examples_C_glib_monitor_nm_running_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
|
||||
examples_C_glib_monitor_nm_running_gdbus_LDADD = \
|
||||
$(GLIB_LIBS)
|
||||
|
||||
examples_C_glib_monitor_nm_state_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
|
||||
examples_C_glib_monitor_nm_state_gdbus_LDADD = \
|
||||
$(GLIB_LIBS)
|
||||
|
||||
examples_C_glib_vpn_import_libnm_CPPFLAGS = $(examples_C_glib_cppflags_libnm)
|
||||
examples_C_glib_vpn_import_libnm_LDADD = \
|
||||
src/libnm-client-impl/libnm.la \
|
||||
$(GLIB_LIBS)
|
||||
$(examples_C_glib_vpn_import_libnm_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
|
||||
|
||||
EXTRA_DIST += \
|
||||
examples/C/glib/meson.build
|
||||
|
||||
###############################################################################
|
||||
# examples/C/qt
|
||||
###############################################################################
|
||||
|
||||
if WITH_QT
|
||||
|
||||
examples_C_qt_cppflags = \
|
||||
-I$(top_builddir)/src/libnm-core-public \
|
||||
-I$(top_srcdir)/src/libnm-core-public \
|
||||
-I$(top_builddir)/libnm \
|
||||
-I$(top_srcdir)/libnm \
|
||||
-I$(builddir)/examples/C/qt \
|
||||
$(DBUS_CFLAGS) \
|
||||
$(QT_CFLAGS)
|
||||
|
||||
check_programs_norun += \
|
||||
examples/C/qt/add-connection-wired \
|
||||
examples/C/qt/list-connections \
|
||||
examples/C/qt/change-ipv4-addresses \
|
||||
examples/C/qt/monitor-nm-running
|
||||
|
||||
examples_C_qt_add_connection_wired_SOURCES = examples/C/qt/add-connection-wired.cpp
|
||||
examples_C_qt_add_connection_wired_CPPFLAGS = $(examples_C_qt_cppflags)
|
||||
examples_C_qt_add_connection_wired_LDADD = \
|
||||
$(DBUS_LIBS) \
|
||||
$(QT_LIBS)
|
||||
|
||||
examples_C_qt_list_connections_SOURCES = examples/C/qt/list-connections.cpp
|
||||
examples_C_qt_list_connections_CPPFLAGS = $(examples_C_qt_cppflags)
|
||||
examples_C_qt_list_connections_LDADD = \
|
||||
$(DBUS_LIBS) \
|
||||
$(QT_LIBS)
|
||||
|
||||
examples_C_qt_change_ipv4_addresses_SOURCES = examples/C/qt/change-ipv4-addresses.cpp
|
||||
examples_C_qt_change_ipv4_addresses_CPPFLAGS = $(examples_C_qt_cppflags)
|
||||
examples_C_qt_change_ipv4_addresses_LDADD = \
|
||||
$(DBUS_LIBS) \
|
||||
$(QT_LIBS)
|
||||
|
||||
examples_C_qt_monitor_nm_running_SOURCES = examples/C/qt/monitor-nm-running.cpp
|
||||
examples_C_qt_monitor_nm_running_CPPFLAGS = $(examples_C_qt_cppflags)
|
||||
examples_C_qt_monitor_nm_running_LDADD = \
|
||||
$(DBUS_LIBS) \
|
||||
$(QT_LIBS)
|
||||
|
||||
examples/C/qt/monitor-nm-running.moc: examples/C/qt/monitor-nm-running.cpp
|
||||
$(AM_V_GEN) $(MOC) -i $< -o $@
|
||||
|
||||
$(examples_C_qt_monitor_nm_running_OBJECTS): examples/C/qt/monitor-nm-running.moc
|
||||
|
||||
CLEANFILES += \
|
||||
examples/C/qt/monitor-nm-running.moc
|
||||
|
||||
endif
|
||||
|
||||
EXTRA_DIST += \
|
||||
examples/C/qt/add-connection-wired.cpp \
|
||||
examples/C/qt/list-connections.cpp \
|
||||
examples/C/qt/change-ipv4-addresses.cpp \
|
||||
examples/C/qt/monitor-nm-running.cpp \
|
||||
examples/C/qt/meson.build
|
||||
|
||||
###############################################################################
|
||||
# examples
|
||||
###############################################################################
|
||||
|
||||
EXTRA_DIST += \
|
||||
examples/dispatcher/10-ifcfg-rh-routes.sh \
|
||||
examples/dispatcher/70-wifi-wired-exclusive.sh \
|
||||
\
|
||||
examples/js/get_ips.js \
|
||||
\
|
||||
examples/lua/lgi/add-connection.lua \
|
||||
examples/lua/lgi/change-vpn-username.lua \
|
||||
examples/lua/lgi/deactivate-all.lua \
|
||||
examples/lua/lgi/get-basic-nm-info.lua \
|
||||
examples/lua/lgi/get-ips.lua \
|
||||
examples/lua/lgi/list-connections.lua \
|
||||
examples/lua/lgi/list-devices.lua \
|
||||
examples/lua/lgi/show-wifi-networks.lua \
|
||||
\
|
||||
examples/nm-conf.d/30-anon.conf \
|
||||
examples/nm-conf.d/31-mac-addr-change.conf \
|
||||
\
|
||||
examples/python/dbus/add-connection-compat.py \
|
||||
examples/python/dbus/add-connection.py \
|
||||
examples/python/dbus/add-wifi-eap-connection.py \
|
||||
examples/python/dbus/add-wifi-psk-connection.py \
|
||||
examples/python/dbus/add-wifi-sae-connection.py \
|
||||
examples/python/dbus/checkpoint.py \
|
||||
examples/python/dbus/create-bond.py \
|
||||
examples/python/dbus/disconnect-device.py \
|
||||
examples/python/dbus/get-active-connection-uuids.py \
|
||||
examples/python/dbus/is-wwan-default.py \
|
||||
examples/python/dbus/list-connections.py \
|
||||
examples/python/dbus/list-devices.py \
|
||||
examples/python/dbus/nm-state.py \
|
||||
examples/python/dbus/show-bssids.py \
|
||||
examples/python/dbus/update-ip4-method.py \
|
||||
examples/python/dbus/update-secrets.py \
|
||||
examples/python/dbus/vpn.py \
|
||||
examples/python/dbus/wifi-active-ap.py\
|
||||
examples/python/dbus/wifi-hotspot.py \
|
||||
\
|
||||
examples/python/gi/README \
|
||||
examples/python/gi/add_connection.py \
|
||||
examples/python/gi/checkpoint.py \
|
||||
examples/python/gi/deactivate-all.py \
|
||||
examples/python/gi/device-reapply.py \
|
||||
examples/python/gi/device-state-ip4config.py \
|
||||
examples/python/gi/dns.py \
|
||||
examples/python/gi/firewall-zone.py \
|
||||
examples/python/gi/get-active-connections.py \
|
||||
examples/python/gi/get-devices.py \
|
||||
examples/python/gi/get-interface-flags.py \
|
||||
examples/python/gi/get-lldp-neighbors.py \
|
||||
examples/python/gi/get_ips.py \
|
||||
examples/python/gi/gmaincontext.py \
|
||||
examples/python/gi/list-connections.py \
|
||||
examples/python/gi/nm-add-connection2.py \
|
||||
examples/python/gi/nm-connection-update-stable-id.py \
|
||||
examples/python/gi/nm-keyfile.py \
|
||||
examples/python/gi/nm-up-many.py \
|
||||
examples/python/gi/nm-update2.py \
|
||||
examples/python/gi/nm-wg-set \
|
||||
examples/python/gi/ovs-external-ids.py \
|
||||
examples/python/gi/setting-user-data.py \
|
||||
examples/python/gi/show-wifi-networks.py \
|
||||
examples/python/gi/update-ip4-method.py \
|
||||
examples/python/gi/vpn-import.py \
|
||||
examples/python/gi/wifi-p2p.py \
|
||||
\
|
||||
examples/python/python-networkmanager/README \
|
||||
\
|
||||
examples/ruby/add-connection.rb \
|
||||
examples/ruby/get-basic-nm-info.rb \
|
||||
examples/ruby/list-devices.rb \
|
||||
\
|
||||
examples/shell/active-wifi.sh \
|
||||
examples/shell/disconnect-device.sh \
|
||||
examples/shell/get-hostname.sh \
|
||||
examples/shell/list-devices.sh \
|
||||
examples/shell/nm-logging.sh \
|
||||
\
|
||||
$(NULL)
|
||||
168
Makefile.glib
168
Makefile.glib
|
|
@ -1,168 +0,0 @@
|
|||
#
|
||||
# Work-in-progress...
|
||||
# See https://bugzilla.gnome.org/show_bug.cgi?id=654395
|
||||
|
||||
_GLIB_CLEANFILES =
|
||||
_GLIB_DISTCLEANFILES =
|
||||
|
||||
_GLIB_V_GEN = $(_glib_v_gen_$(V))
|
||||
_glib_v_gen_ = $(_glib_v_gen_$(AM_DEFAULT_VERBOSITY))
|
||||
_glib_v_gen_0 = @echo " GEN " $(subst .stamp,,$@);
|
||||
|
||||
|
||||
### glib-genmarshal
|
||||
|
||||
_GLIB_MARSHAL_GENERATED = $(subst .h,,$(filter %marshal.h,$(GLIB_GENERATED)))
|
||||
|
||||
_glib_marshal_prefix = $(subst marshal,,$(subst _marshal,,$(subst -,_,$(notdir $(1)))))_marshal
|
||||
_glib_marshal_sources_var = $(subst -,_,$(notdir $(1)))_sources
|
||||
_glib_marshal_sources = $(filter-out %.h,$(filter-out $(GLIB_GENERATED),$($(_glib_marshal_sources_var))))
|
||||
|
||||
define _glib_make_genmarshal_rules
|
||||
$(if $(_glib_marshal_sources),,$(error Need to define $(_glib_marshal_sources_var) for $(1).[ch]))
|
||||
|
||||
$(1).list.stamp: $(_glib_marshal_sources) Makefile
|
||||
$$(_GLIB_V_GEN) LC_ALL=C sed -ne 's/.*_$(_glib_marshal_prefix)_\([_A-Z]*\).*/\1/p' $$(filter-out Makefile, $$^) | sort -u | sed -e 's/__/:/' -e 's/_/,/g' > $(1).list.tmp && \
|
||||
(cmp -s $(1).list.tmp $(1).list || cp $(1).list.tmp $(1).list) && \
|
||||
rm -f $(1).list.tmp && \
|
||||
echo timestamp > $$@
|
||||
|
||||
$(1).list: $(1).list.stamp
|
||||
@true
|
||||
|
||||
$(1).h: $(1).list
|
||||
$$(_GLIB_V_GEN) $$(GLIB_GENMARSHAL) \
|
||||
--prefix=_$(_glib_marshal_prefix) --header \
|
||||
$$(GLIB_GENMARSHAL_H_FLAGS) \
|
||||
$$($(_glib_marshal_prefix)_GENMARSHAL_H_FLAGS) \
|
||||
$$< > $$@.tmp && \
|
||||
mv $$@.tmp $$@
|
||||
|
||||
$(1).c: $(1).list
|
||||
$$(_GLIB_V_GEN) (echo "#include \"$$(subst .c,.h,$$(@F))\""; $$(GLIB_GENMARSHAL) \
|
||||
--prefix=_$(_glib_marshal_prefix) --body \
|
||||
$$(GLIB_GENMARSHAL_C_FLAGS) \
|
||||
$$($(_glib_marshal_prefix)_GENMARSHAL_C_FLAGS) \
|
||||
$$< ) > $$@.tmp && \
|
||||
mv $$@.tmp $$@
|
||||
|
||||
_GLIB_CLEANFILES += $(1).list.stamp $(1).list
|
||||
_GLIB_DISTCLEANFILES += $(1).h $(1).c
|
||||
endef
|
||||
|
||||
$(foreach f,$(_GLIB_MARSHAL_GENERATED),$(eval $(call _glib_make_genmarshal_rules,$f)))
|
||||
|
||||
|
||||
### glib-mkenums
|
||||
|
||||
_GLIB_ENUM_TYPES_GENERATED = $(subst .h,,$(filter %enum-types.h %enumtypes.h,$(GLIB_GENERATED)))
|
||||
|
||||
_glib_enum_types_prefix = $(subst -,_,$(notdir $(1)))
|
||||
_glib_enum_types_guard = __$(shell LC_ALL=C echo $(_glib_enum_types_prefix) | tr 'a-z' 'A-Z')_H__
|
||||
_glib_enum_types_sources_var = $(_glib_enum_types_prefix)_sources
|
||||
_glib_enum_types_sources = $(filter-out $(GLIB_GENERATED),$($(_glib_enum_types_sources_var)))
|
||||
_glib_enum_types_h_sources = $(filter %.h,$(_glib_enum_types_sources))
|
||||
|
||||
define _glib_make_mkenums_rules
|
||||
$(if $(_glib_enum_types_sources),,$(error Need to define $(_glib_enum_types_sources_var) for $(1).[ch]))
|
||||
|
||||
$(1).h.stamp: $(_glib_enum_types_h_sources) Makefile
|
||||
$$(_GLIB_V_GEN) $$(GLIB_MKENUMS) \
|
||||
--fhead "/* Generated by glib-mkenums. Do not edit */\n\n#ifndef $(_glib_enum_types_guard)\n#define $(_glib_enum_types_guard)\n\n" \
|
||||
$$(GLIB_MKENUMS_H_FLAGS) \
|
||||
$$($(_glib_enum_types_prefix)_MKENUMS_H_FLAGS) \
|
||||
--fhead "#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
|
||||
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n" \
|
||||
--ftail "G_END_DECLS\n\n#endif /* $(_glib_enum_types_guard) */" \
|
||||
$$(filter-out Makefile, $$^) > $(1).h.tmp && \
|
||||
(cmp -s $(1).h.tmp $(1).h || cp $(1).h.tmp $(1).h) && \
|
||||
rm -f $(1).h.tmp && \
|
||||
echo timestamp > $$@
|
||||
|
||||
$(1).h: $(1).h.stamp
|
||||
@true
|
||||
|
||||
$(1).c.stamp: $(_glib_enum_types_h_sources) Makefile
|
||||
$$(_GLIB_V_GEN) $$(GLIB_MKENUMS) \
|
||||
--fhead "/* Generated by glib-mkenums. Do not edit */\n\n#include \"config.h\"\n\n#include \"$(notdir $(1)).h\"\n" \
|
||||
$$(GLIB_MKENUMS_C_FLAGS) \
|
||||
$$($(_glib_enum_types_prefix)_MKENUMS_C_FLAGS) \
|
||||
--fhead "$$(foreach f,$$(filter-out Makefile,$$(^F)),\n#include \"$$(f)\")\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" \
|
||||
$$(filter-out Makefile, $$^) > $(1).c.tmp && \
|
||||
(cmp -s $(1).c.tmp $(1).c || cp $(1).c.tmp $(1).c) && \
|
||||
rm -f $(1).c.tmp && \
|
||||
echo timestamp > $$@
|
||||
|
||||
$(1).c: $(1).c.stamp
|
||||
@true
|
||||
|
||||
_GLIB_CLEANFILES += $(1).h.stamp $(1).c.stamp
|
||||
_GLIB_DISTCLEANFILES += $(1).h $(1).c $(1).h.stamp $(1).c.stamp
|
||||
endef
|
||||
|
||||
$(foreach f,$(_GLIB_ENUM_TYPES_GENERATED),$(eval $(call _glib_make_mkenums_rules,$f)))
|
||||
|
||||
|
||||
### glib-compile-schemas
|
||||
|
||||
_GLIB_ENUMS_XML_GENERATED = $(filter %.enums.xml,$(GLIB_GENERATED))
|
||||
_GLIB_GSETTINGS_SCHEMA_FILES = $(filter %.gschema.xml,$(gsettingsschema_DATA))
|
||||
_GLIB_GSETTINGS_VALID_FILES = $(subst .xml,.valid,$(_GLIB_GSETTINGS_SCHEMA_FILES))
|
||||
|
||||
_glib_enums_xml_prefix = $(subst .,_,$(notdir $(1)))
|
||||
_glib_enums_xml_sources_var = $(_glib_enums_xml_prefix)_sources
|
||||
_glib_enums_xml_sources = $(filter-out $(GLIB_GENERATED),$($(_glib_enums_xml_sources_var)))
|
||||
_glib_enums_xml_namespace = $(subst .enums.xml,,$(notdir $(1)))
|
||||
|
||||
define _glib_make_enums_xml_rule
|
||||
$(if $(_glib_enums_xml_sources),,$(error Need to define $(_glib_enums_xml_sources_var) for $(1)))
|
||||
|
||||
$(1): $(_glib_enums_xml_sources) Makefile
|
||||
$$(_GLIB_V_GEN) $$(GLIB_MKENUMS) --comments '<!-- @comment@ -->' --fhead "<schemalist>" --vhead " <@type@ id='$(_glib_enums_xml_namespace).@EnumName@'>" --vprod " <value nick='@valuenick@' value='@valuenum@'/>" --vtail " </@type@>" --ftail "</schemalist>" $$(filter-out Makefile, $$^) > $$@.tmp && mv $$@.tmp $$@
|
||||
endef
|
||||
|
||||
_GLIB_V_CHECK = $(_glib_v_check_$(V))
|
||||
_glib_v_check_ = $(_glib_v_check_$(AM_DEFAULT_VERBOSITY))
|
||||
_glib_v_check_0 = @echo " CHECK " $(subst .valid,.xml,$@);
|
||||
|
||||
define _glib_make_schema_validate_rule
|
||||
$(subst .xml,.valid,$(1)): $(_GLIB_ENUMS_XML_GENERATED) $(1)
|
||||
$$(_GLIB_V_CHECK) $$(GLIB_COMPILE_SCHEMAS) --strict --dry-run $$(addprefix --schema-file=,$$^) && touch $$@
|
||||
endef
|
||||
|
||||
define _glib_make_schema_rules
|
||||
all-am: $(_GLIB_GSETTINGS_VALID_FILES)
|
||||
|
||||
install-data-am: glib-install-schemas-hook
|
||||
|
||||
glib-install-schemas-hook: install-gsettingsschemaDATA
|
||||
@test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || (echo $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir))
|
||||
|
||||
uninstall-am: glib-uninstall-schemas-hook
|
||||
|
||||
glib-uninstall-schemas-hook: uninstall-gsettingsschemaDATA
|
||||
@test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || (echo $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir))
|
||||
|
||||
.PHONY: glib-install-schemas-hook glib-uninstall-schemas-hook
|
||||
endef
|
||||
|
||||
_GLIB_CLEANFILES += $(_GLIB_ENUMS_XML_GENERATED) $(_GLIB_GSETTINGS_VALID_FILES)
|
||||
|
||||
$(foreach f,$(_GLIB_ENUMS_XML_GENERATED),$(eval $(call _glib_make_enums_xml_rule,$f)))
|
||||
$(foreach f,$(_GLIB_GSETTINGS_SCHEMA_FILES),$(eval $(call _glib_make_schema_validate_rule,$f)))
|
||||
$(if $(_GLIB_GSETTINGS_SCHEMA_FILES),$(eval $(_glib_make_schema_rules)))
|
||||
|
||||
|
||||
### Cleanup
|
||||
.PHONY: clean-glib distclean-glib
|
||||
|
||||
clean-am: clean-glib
|
||||
clean-glib:
|
||||
$(if $(strip $(_GLIB_CLEANFILES)),-rm -f $(_GLIB_CLEANFILES))
|
||||
|
||||
distclean-am: distclean-glib
|
||||
distclean-glib:
|
||||
$(if $(strip $(_GLIB_DISTCLEANFILES)),-rm -f $(_GLIB_DISTCLEANFILES))
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
# Makefile for Vala API Generator (vapigen)
|
||||
# Written by Evan Nemerson
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
# See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation
|
||||
#
|
||||
# Variables:
|
||||
#
|
||||
# VAPIGEN_FILES
|
||||
#
|
||||
# VAPIs to create
|
||||
#
|
||||
# *_DEPS / VAPIGEN_DEPS
|
||||
#
|
||||
# The dependencies. Generally the pkg-config names.
|
||||
#
|
||||
# *_METADATADIRS / VAPIGEN_METADATADIRS
|
||||
#
|
||||
# Directory containing the metadata.
|
||||
#
|
||||
# *_VAPIDIRS / VAPIGEN_VAPIDIRS
|
||||
#
|
||||
# Additional location(s) to search for VAPI dependencies.
|
||||
#
|
||||
# *_GIRDIRS / VAPIGEN_GIRDIRS
|
||||
#
|
||||
# Additional location(s) to search for GIR dependencies.
|
||||
#
|
||||
# *_FILES
|
||||
#
|
||||
# The files which should be used to generate the VAPI.
|
||||
|
||||
_vapigen_silent_prefix = $(_vapigen_silent_prefix_$(V))
|
||||
_vapigen_silent_prefix_ = $(_vapigen_silent_prefix_$(AM_DEFAULT_VERBOSITY))
|
||||
_vapigen_silent_prefix_0 = @echo " VAPIGEN $(1)";
|
||||
_vapigen_silent_opts = $(_vapigen_silent_opts_$(V))
|
||||
_vapigen_silent_opts_ = $(_vapigen_silent_opts_$(AM_DEFAULT_VERBOSITY))
|
||||
_vapigen_silent_opts_0 = --quiet
|
||||
|
||||
_vapi_name = $(subst /,_,$(subst -,_,$(subst .,_,$(1))))
|
||||
|
||||
define vapigen
|
||||
$(1): $$($(_vapi_name)_GIR)
|
||||
$(_vapigen_silent_prefix) \
|
||||
G_DEBUG='' \
|
||||
$(VAPIGEN) $(_vapigen_silent_opts) \
|
||||
--library $(1:.vapi=) \
|
||||
$(foreach _vapi_metadatadir_name,$(if $($(_vapi_name)_METADATADIRS),$($(_vapi_name)_METADATADIRS),$(VAPIGEN_METADATADIRS)),--metadatadir $(_vapi_metadatadir_name)) \
|
||||
$(foreach _vapi_dir_name,$(if $($(_vapi_name)_VAPIDIRS),$($(_vapi_name)_VAPIDIRS),$(VAPIGEN_VAPIDIRS)),--vapidir $(_vapi_dir_name)) \
|
||||
$(foreach _vapi_gir_dir,$(if $($(_vapi_name)_GIRDIRS),$($(_vapi_name)_GIRDIRS),$(VAPIGEN_GIRDIRS)),--girdir $(_vapi_gir_dir)) \
|
||||
$(foreach _vapi_dep_name,$(if $($(_vapi_name)_DEPS),$($(_vapi_name)_DEPS),$(VAPIGEN_DEPS)),--pkg $(_vapi_dep_name)) \
|
||||
$$($(_vapi_name)_FILES) && \
|
||||
touch $(1)
|
||||
endef
|
||||
|
||||
$(foreach vapi,$(VAPIGEN_VAPIS),$(eval $(call vapigen,$(vapi))))
|
||||
1
NEWS
1
NEWS
|
|
@ -10,6 +10,7 @@ USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE!
|
|||
|
||||
* Add new ipv4.link-local=fallback to set an IPv4 link-local address
|
||||
when no other IPv4 is set.
|
||||
* Remove support for building with Autotools
|
||||
|
||||
=============================================
|
||||
NetworkManager-1.50
|
||||
|
|
|
|||
31
autogen.sh
31
autogen.sh
|
|
@ -1,31 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
set -e
|
||||
|
||||
srcdir=`dirname $0`
|
||||
if test -z "$srcdir"; then
|
||||
srcdir=.
|
||||
fi
|
||||
|
||||
olddir=`pwd`
|
||||
|
||||
REQUIRED_AUTOMAKE_VERSION=1.9
|
||||
PKG_NAME=NetworkManager
|
||||
|
||||
(test -f $srcdir/configure.ac \
|
||||
&& test -f $srcdir/src/core/main.c) || {
|
||||
printf "**Error**: Directory "\`$srcdir\'" does not look like the" >&2
|
||||
echo " top-level $PKG_NAME directory" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
cd $srcdir
|
||||
|
||||
gtkdocize
|
||||
autoreconf --verbose --force --install
|
||||
|
||||
cd $olddir
|
||||
if test -z "$NOCONFIGURE"; then
|
||||
exec $srcdir/configure --enable-maintainer-mode --enable-more-warnings=error --enable-gtk-doc --enable-introspection "$@"
|
||||
fi
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
# With autotools, it is not easily possible to generate these defines
|
||||
# from configure.ac.
|
||||
#
|
||||
# See https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Installation-Directory-Variables.html
|
||||
#
|
||||
# With meson-only, they could just be set via config.h.meson
|
||||
config-extra.h: config-extra.h.mk config.h config.status
|
||||
$(AM_V_GEN) \
|
||||
echo "/* Generated by Makefile.am */" >$@ && \
|
||||
echo "#define BINDIR \"$(bindir)\"" >>$@ && \
|
||||
echo "#define DATADIR \"$(datadir)\"" >>$@ && \
|
||||
echo "#define LIBEXECDIR \"$(libexecdir)\"" >>$@ && \
|
||||
echo "#define LOCALSTATEDIR \"$(localstatedir)\"" >>$@ && \
|
||||
echo "#define NMCONFDIR \"$(nmconfdir)\"" >>$@ && \
|
||||
echo "#define NMLIBDIR \"$(nmlibdir)\"" >>$@ && \
|
||||
echo "#define NMLOCALEDIR \"$(nmlocaledir)\"" >>$@ && \
|
||||
echo "#define NMPLUGINDIR \"$(plugindir)\"" >>$@ && \
|
||||
echo "#define NMRUNDIR \"$(nmrundir)\"" >>$@ && \
|
||||
echo "#define NMSTATEDIR \"$(nmstatedir)\"" >>$@ && \
|
||||
echo "#define NMVPNDIR \"$(pkglibdir)\"" >>$@ && \
|
||||
echo "#define NM_BUILD_BUILDDIR \"$(abs_builddir)\"" >>$@ && \
|
||||
echo "#define NM_BUILD_SRCDIR \"$(abs_srcdir)\"" >>$@ && \
|
||||
echo "#define PPPD_PLUGIN_DIR \"$(PPPD_PLUGIN_DIR)\"" >>$@ && \
|
||||
echo "#define PREFIX \"$(prefix)\"" >>$@ && \
|
||||
echo "#define RUNSTATEDIR \"$(runstatedir)\"" >>$@ && \
|
||||
echo "#define SYSCONFDIR \"$(sysconfdir)\"" >>$@ && \
|
||||
true
|
||||
1503
configure.ac
1503
configure.ac
File diff suppressed because it is too large
Load diff
|
|
@ -7,7 +7,6 @@ apk update
|
|||
apk add \
|
||||
'alpine-sdk' \
|
||||
'autoconf' \
|
||||
'automake' \
|
||||
'bash' \
|
||||
'clang' \
|
||||
'curl-dev' \
|
||||
|
|
@ -31,7 +30,6 @@ apk add \
|
|||
'libteam-dev' \
|
||||
'libtool' \
|
||||
'linux-headers' \
|
||||
'make' \
|
||||
'meson' \
|
||||
'mobile-broadband-provider-info' \
|
||||
'modemmanager-dev' \
|
||||
|
|
|
|||
|
|
@ -32,9 +32,6 @@ install_ignore_missing() {
|
|||
|
||||
install \
|
||||
\
|
||||
autoconf \
|
||||
automake \
|
||||
autopoint \
|
||||
clang \
|
||||
dbus \
|
||||
dbus-x11 \
|
||||
|
|
@ -67,7 +64,6 @@ install \
|
|||
libtool \
|
||||
libudev-dev \
|
||||
locales \
|
||||
make \
|
||||
meson \
|
||||
mobile-broadband-provider-info \
|
||||
pkg-config \
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ install \
|
|||
libselinux-devel \
|
||||
libtool \
|
||||
libuuid-devel \
|
||||
make \
|
||||
meson \
|
||||
mobile-broadband-provider-info-devel \
|
||||
newt-devel \
|
||||
|
|
|
|||
|
|
@ -49,10 +49,8 @@
|
|||
|
||||
###############################################################################
|
||||
%if 0%{?fedora} > 40 || 0%{?rhel} >= 10
|
||||
%bcond_without meson
|
||||
%bcond_with dhclient
|
||||
%else
|
||||
%bcond_with meson
|
||||
%bcond_without dhclient
|
||||
%endif
|
||||
%bcond_without adsl
|
||||
|
|
@ -252,16 +250,10 @@ Conflicts: NetworkManager-initscripts-ifcfg-rh <= 1:1.47.5-3
|
|||
Conflicts: NetworkManager-dispatcher-routing-rules <= 1:1.47.5-3
|
||||
%endif
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc
|
||||
BuildRequires: libtool
|
||||
BuildRequires: pkgconfig
|
||||
%if %{with meson}
|
||||
BuildRequires: meson
|
||||
%else
|
||||
BuildRequires: automake
|
||||
BuildRequires: autoconf
|
||||
%endif
|
||||
BuildRequires: gettext-devel >= 0.19.8
|
||||
|
||||
BuildRequires: dbus-devel >= %{dbus_version}
|
||||
|
|
@ -594,7 +586,6 @@ Preferably use nmcli instead.
|
|||
|
||||
|
||||
%build
|
||||
%if %{with meson}
|
||||
%meson \
|
||||
-Db_ndebug=false \
|
||||
--warnlevel 2 \
|
||||
|
|
@ -727,158 +718,8 @@ Preferably use nmcli instead.
|
|||
|
||||
%meson_build
|
||||
|
||||
%else
|
||||
# autotools
|
||||
%if %{with regen_docs}
|
||||
gtkdocize
|
||||
%endif
|
||||
autoreconf --install --force
|
||||
%configure \
|
||||
--with-runstatedir=%{_rundir} \
|
||||
--enable-silent-rules=no \
|
||||
--enable-static=no \
|
||||
--with-nft=%{_sbindir}/nft \
|
||||
--with-iptables=%{_sbindir}/iptables \
|
||||
%if %{with dhclient}
|
||||
--with-dhclient=%{_sbindir}/dhclient \
|
||||
%else
|
||||
--with-dhclient=no \
|
||||
%endif
|
||||
--with-dhcpcd=no \
|
||||
--with-dhcpcanon=no \
|
||||
--with-crypto=gnutls \
|
||||
%if %{with sanitizer}
|
||||
--with-address-sanitizer=exec \
|
||||
--enable-undefined-sanitizer=yes \
|
||||
%else
|
||||
--with-address-sanitizer=no \
|
||||
--enable-undefined-sanitizer=no \
|
||||
%endif
|
||||
%if %{with debug}
|
||||
--enable-more-logging=yes \
|
||||
--with-more-asserts=10000 \
|
||||
%else
|
||||
--enable-more-logging=no \
|
||||
--with-more-asserts=0 \
|
||||
%endif
|
||||
--enable-ld-gc=yes \
|
||||
%if %{with lto}
|
||||
--enable-lto=yes \
|
||||
%else
|
||||
--enable-lto=no \
|
||||
%endif
|
||||
--with-libaudit=yes-disabled-by-default \
|
||||
%if 0%{?with_modem_manager_1}
|
||||
--with-modem-manager-1=yes \
|
||||
%else
|
||||
--with-modem-manager-1=no \
|
||||
%endif
|
||||
%if %{with wifi}
|
||||
--enable-wifi=yes \
|
||||
%if 0%{?fedora}
|
||||
--with-wext=yes \
|
||||
%else
|
||||
--with-wext=no \
|
||||
%endif
|
||||
%else
|
||||
--enable-wifi=no \
|
||||
%endif
|
||||
%if %{with iwd}
|
||||
--with-iwd=yes \
|
||||
%else
|
||||
--with-iwd=no \
|
||||
%endif
|
||||
%if %{with bluetooth}
|
||||
--enable-bluez5-dun=yes \
|
||||
%else
|
||||
--enable-bluez5-dun=no \
|
||||
%endif
|
||||
%if %{with nmtui}
|
||||
--with-nmtui=yes \
|
||||
%else
|
||||
--with-nmtui=no \
|
||||
%endif
|
||||
%if %{with nm_cloud_setup}
|
||||
--with-nm-cloud-setup=yes \
|
||||
%else
|
||||
--with-nm-cloud-setup=no \
|
||||
%endif
|
||||
--enable-vala=yes \
|
||||
--enable-introspection=yes \
|
||||
%if %{with regen_docs}
|
||||
--enable-gtk-doc=yes \
|
||||
%else
|
||||
--enable-gtk-doc=no \
|
||||
%endif
|
||||
%if %{with team}
|
||||
--enable-teamdctl=yes \
|
||||
%else
|
||||
--enable-teamdctl=no \
|
||||
%endif
|
||||
%if %{with ovs}
|
||||
--enable-ovs=yes \
|
||||
%else
|
||||
--enable-ovs=no \
|
||||
%endif
|
||||
--with-selinux=yes \
|
||||
--enable-polkit=yes \
|
||||
--enable-modify-system=yes \
|
||||
--enable-concheck=yes \
|
||||
%if 0%{?fedora}
|
||||
--with-libpsl=yes \
|
||||
%else
|
||||
--with-libpsl=no \
|
||||
%endif
|
||||
--with-ebpf=%{ebpf_enabled} \
|
||||
--with-session-tracking=systemd \
|
||||
--with-suspend-resume=systemd \
|
||||
--with-systemdsystemunitdir=%{_unitdir} \
|
||||
--with-system-ca-path=/etc/pki/tls/cert.pem \
|
||||
--with-dbus-sys-dir=%{dbus_sys_dir} \
|
||||
--with-tests=yes \
|
||||
%if %{with test}
|
||||
--enable-more-warnings=error \
|
||||
%else
|
||||
--enable-more-warnings=yes \
|
||||
%endif
|
||||
--with-valgrind=no \
|
||||
%if %{with ifcfg_rh}
|
||||
--enable-ifcfg-rh=yes \
|
||||
%else
|
||||
--enable-ifcfg-rh=no \
|
||||
%endif
|
||||
--enable-ifupdown=no \
|
||||
%if %{with ppp}
|
||||
--enable-ppp=yes \
|
||||
--with-pppd="%{_sbindir}/pppd" \
|
||||
--with-pppd-plugin-dir="%{_libdir}/pppd/%{ppp_version}" \
|
||||
%else
|
||||
--enable-ppp=no \
|
||||
%endif
|
||||
--enable-firewalld-zone=yes \
|
||||
--with-dist-version=%{version}-%{release} \
|
||||
%if %{with default_ifcfg_rh}
|
||||
--with-config-plugins-default=ifcfg-rh \
|
||||
%endif
|
||||
%if %{with ifcfg_migrate}
|
||||
--with-config-migrate-ifcfg-rh-default=yes \
|
||||
%endif
|
||||
--with-resolvconf=no \
|
||||
--with-netconfig=no \
|
||||
--with-config-dns-rc-manager-default=%{dns_rc_manager_default} \
|
||||
--with-config-logging-backend-default=journal \
|
||||
--disable-autotools-deprecation
|
||||
|
||||
%make_build
|
||||
|
||||
%endif
|
||||
|
||||
%install
|
||||
%if %{with meson}
|
||||
%meson_install
|
||||
%else
|
||||
%make_install
|
||||
%endif
|
||||
|
||||
cp %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/
|
||||
|
||||
|
|
@ -918,7 +759,7 @@ rm -f %{buildroot}%{_libdir}/pppd/%{ppp_version}/*.la
|
|||
rm -f %{buildroot}%{nmplugindir}/*.la
|
||||
|
||||
# Ensure the documentation timestamps are constant to avoid multilib conflicts
|
||||
find %{buildroot}%{_datadir}/gtk-doc -exec touch --reference configure.ac '{}' \+
|
||||
find %{buildroot}%{_datadir}/gtk-doc -exec touch --reference meson.build '{}' \+
|
||||
|
||||
%if 0%{?__debug_package} && ! 0%{?flatpak}
|
||||
mkdir -p %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
|
||||
|
|
@ -932,21 +773,11 @@ touch %{buildroot}%{_sbindir}/ifdown
|
|||
|
||||
|
||||
%check
|
||||
%if %{with meson}
|
||||
%if %{with test}
|
||||
%meson_test
|
||||
%else
|
||||
%ninja_test -C %{_vpath_builddir} || :
|
||||
%endif
|
||||
%else
|
||||
# autotools
|
||||
%if %{with test}
|
||||
make -k %{?_smp_mflags} check
|
||||
%else
|
||||
make -k %{?_smp_mflags} check || :
|
||||
%endif
|
||||
%endif
|
||||
|
||||
|
||||
%pre
|
||||
if [ -f "%{_unitdir}/network-online.target.wants/NetworkManager-wait-online.service" ] ; then
|
||||
|
|
|
|||
|
|
@ -76,14 +76,7 @@ abs_path() {
|
|||
}
|
||||
|
||||
get_version() {
|
||||
local major minor micro
|
||||
local F="${1:-"$GITDIR/configure.ac"}"
|
||||
|
||||
vars="$(sed -n 's/^m4_define(\[nm_\(major\|minor\|micro\)_version\], *\[\([0-9]\+\)\]) *$/local \1='\''\2'\''/p' "$F" 2>/dev/null)"
|
||||
eval "$vars"
|
||||
|
||||
[[ -n "$major" && -n "$minor" && "$micro" ]] || return 1
|
||||
echo "$major.$minor.$micro"
|
||||
grep -E -m1 '^\s+version:' "$GITDIR/meson.build" | cut -d"'" -f2
|
||||
}
|
||||
|
||||
write_changelog() {
|
||||
|
|
|
|||
|
|
@ -18,11 +18,9 @@ usage() {
|
|||
echo " -f|--force: force build, even if working directory is not clean and has local modifications"
|
||||
echo " -c|--clean: run \`git-clean -fdx :/\` before build"
|
||||
echo " -S|--srpm: only build the SRPM"
|
||||
echo " -g|--git: create tarball from current git HEAD (skips make dist)"
|
||||
echo " -g|--git: create tarball from current git HEAD (skips meson dist)"
|
||||
echo " -Q|--quick: only create the distribution tarball, without running checks"
|
||||
echo " -N|--no-dist: skip creating the source tarball if you already did \`make dist\`"
|
||||
echo " -m|--meson: (default) use meson to create the source tarball"
|
||||
echo " -A|--autotools: use autotools to create the source tarball"
|
||||
echo " -N|--no-dist: skip creating the source tarball if you already did \`meson dist\`"
|
||||
echo " -w|--with \$OPTION: pass --with \$OPTION to rpmbuild. For example --with debug"
|
||||
echo " -W|--without \$OPTION: pass --without \$OPTION to rpmbuild. For example --without debug"
|
||||
echo " -s|--snapshot TEXT: use TEXT as the snapshot version for the new package (overwrites \$NM_BUILD_SNAPSHOT environment)"
|
||||
|
|
@ -99,14 +97,6 @@ while [[ $# -gt 0 ]]; do
|
|||
IGNORE_DIRTY=1
|
||||
SOURCE_FROM_GIT=1
|
||||
;;
|
||||
-m|--meson)
|
||||
[ "$USE_AUTOTOOLS" = 1 ] && die "conflicting argument: $A when building with autotools is requested";
|
||||
USE_MESON=1
|
||||
;;
|
||||
-A|--autotools)
|
||||
[ "$USE_MESON" = 1 ] && die "conflicting argument: $A when building with meson is explicitly requested";
|
||||
USE_AUTOTOOLS=1
|
||||
;;
|
||||
-Q|--quick)
|
||||
QUICK=1
|
||||
;;
|
||||
|
|
@ -203,96 +193,48 @@ get_version_meson() {
|
|||
}
|
||||
|
||||
if [[ $NO_DIST != 1 ]]; then
|
||||
if [[ $USE_AUTOTOOLS != 1 ]]; then
|
||||
meson setup "$GITDIR/build" \
|
||||
--prefix=/usr \
|
||||
--bindir=/usr/bin \
|
||||
--sbindir=/usr/sbin \
|
||||
--sysconfdir=/etc \
|
||||
--datadir=/usr/share \
|
||||
--includedir=/usr/include \
|
||||
--libdir=/usr/lib \
|
||||
--libexecdir=/usr/libexec \
|
||||
--localstatedir=/var \
|
||||
--sharedstatedir=/var/lib \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
-Ddocs=true \
|
||||
-Dintrospection=true \
|
||||
-Difcfg_rh=true \
|
||||
-Difupdown=true \
|
||||
-Dconfig_logging_backend_default=syslog \
|
||||
-Dconfig_wifi_backend_default=wpa_supplicant \
|
||||
-Dlibaudit=yes-disabled-by-default \
|
||||
-Dpolkit=true \
|
||||
-Dnm_cloud_setup=true \
|
||||
-Ddhclient=/usr/sbin/dhclient \
|
||||
-Dconfig_dhcp_default=internal \
|
||||
-Dconfig_dns_rc_manager_default=auto \
|
||||
-Diptables=/usr/sbin/iptables \
|
||||
-Dnft=/usr/bin/nft \
|
||||
|| die "Error meson setup"
|
||||
meson setup "$GITDIR/build" \
|
||||
--prefix=/usr \
|
||||
--bindir=/usr/bin \
|
||||
--sbindir=/usr/sbin \
|
||||
--sysconfdir=/etc \
|
||||
--datadir=/usr/share \
|
||||
--includedir=/usr/include \
|
||||
--libdir=/usr/lib \
|
||||
--libexecdir=/usr/libexec \
|
||||
--localstatedir=/var \
|
||||
--sharedstatedir=/var/lib \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
-Ddocs=true \
|
||||
-Dintrospection=true \
|
||||
-Difcfg_rh=true \
|
||||
-Difupdown=true \
|
||||
-Dconfig_logging_backend_default=syslog \
|
||||
-Dconfig_wifi_backend_default=wpa_supplicant \
|
||||
-Dlibaudit=yes-disabled-by-default \
|
||||
-Dpolkit=true \
|
||||
-Dnm_cloud_setup=true \
|
||||
-Ddhclient=/usr/sbin/dhclient \
|
||||
-Dconfig_dhcp_default=internal \
|
||||
-Dconfig_dns_rc_manager_default=auto \
|
||||
-Diptables=/usr/sbin/iptables \
|
||||
-Dnft=/usr/bin/nft \
|
||||
|| die "Error meson setup"
|
||||
|
||||
VERSION="${VERSION:-$(get_version_meson || die "Could not read $VERSION")}"
|
||||
if [[ $QUICK == 1 ]]; then
|
||||
meson dist --allow-dirty -C "$GITDIR/build/" --no-tests || die "Error meson dist"
|
||||
else
|
||||
meson dist --allow-dirty -C "$GITDIR/build/" || die "Error meson dist with tests"
|
||||
fi
|
||||
export SOURCE="$(ls -1 "$GITDIR/build/meson-dist/NetworkManager-${VERSION}.tar.xz" 2>/dev/null | head -n1)"
|
||||
else
|
||||
./autogen.sh \
|
||||
--with-runstatedir=/run \
|
||||
--program-prefix= \
|
||||
--prefix=/usr \
|
||||
--exec-prefix=/usr \
|
||||
--bindir=/usr/bin \
|
||||
--sbindir=/usr/sbin \
|
||||
--sysconfdir=/etc \
|
||||
--datadir=/usr/share \
|
||||
--includedir=/usr/include \
|
||||
--libdir=/usr/lib \
|
||||
--libexecdir=/usr/libexec \
|
||||
--localstatedir=/var \
|
||||
--sharedstatedir=/var/lib \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
\
|
||||
--disable-dependency-tracking \
|
||||
--enable-gtk-doc \
|
||||
--enable-introspection \
|
||||
--enable-ifcfg-rh \
|
||||
--enable-ifupdown \
|
||||
--with-config-logging-backend-default=syslog \
|
||||
--with-config-wifi-backend-default=wpa_supplicant \
|
||||
--with-libaudit=yes-disabled-by-default \
|
||||
--enable-polkit=yes \
|
||||
--with-nm-cloud-setup=yes \
|
||||
--with-dhclient=yes \
|
||||
--with-config-dhcp-default=internal \
|
||||
--with-config-dns-rc-manager-default=auto \
|
||||
\
|
||||
--with-iptables=/usr/sbin/iptables \
|
||||
--with-nft=/usr/sbin/nft \
|
||||
--disable-autotools-deprecation \
|
||||
\
|
||||
|| die "Error autogen.sh"
|
||||
if [[ $QUICK == 1 ]]; then
|
||||
make dist -j 7 || die "Error make dist"
|
||||
else
|
||||
make distcheck -j 7 || die "Error make distcheck"
|
||||
fi
|
||||
VERSION="${VERSION:-$(get_version_meson || die "Could not read $VERSION")}"
|
||||
TEST_FLAG=""
|
||||
if [[ $QUICK == 1 ]]; then
|
||||
TEST_FLAG="--no-tests"
|
||||
fi
|
||||
meson dist --allow-dirty -C "$GITDIR/build/" $TEST_FLAG || die "Error meson dist"
|
||||
export SOURCE="$(ls -1 "$GITDIR/build/meson-dist/NetworkManager-${VERSION}.tar.xz" 2>/dev/null | head -n1)"
|
||||
fi
|
||||
|
||||
if [[ "$ADD_WITH_TEST" == 1 ]]; then
|
||||
WITH_LIST=("${WITH_LIST[@]}" "--with" "test")
|
||||
fi
|
||||
|
||||
if [[ "$USE_AUTOTOOLS" != 1 ]]; then
|
||||
WITH_LIST=("${WITH_LIST[@]}" "--with" "meson")
|
||||
fi
|
||||
|
||||
export SOURCE_FROM_GIT
|
||||
export BUILDTYPE
|
||||
export NM_RPMBUILD_ARGS="${WITH_LIST[@]}"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Run configure/meson for NetworkManager in a way similar to how an RPM build does it.
|
||||
# The effect is, that if you do `make install`, that it will overwrite the files that
|
||||
# The effect is, that if you do `meson install`, that it will overwrite the files that
|
||||
# you'd usually get by installing the NetworkManager RPM. Also, it means you can afterwards
|
||||
# systemctl restart NetworkManager.
|
||||
|
||||
|
|
@ -30,10 +30,10 @@ vars_with_vals() {
|
|||
}
|
||||
|
||||
usage() {
|
||||
echo "$ $0 [-m|--meson <builddir>] [-a|--autotools] [-s|--show] [-B|--no-build] [-h|--help]"
|
||||
echo "$ $0 [-m|--meson <builddir>] [-s|--show] [-B|--no-build] [-h|--help]"
|
||||
echo ""
|
||||
echo "Configure NetworkManager in a way that is similar to when building"
|
||||
echo "RPMs of NetworkManager for Fedora/RHEL. The effect is that \`make install\`"
|
||||
echo "RPMs of NetworkManager for Fedora/RHEL. The effect is that \`meson install\`"
|
||||
echo "will overwrite the files in /usr that you installed via the package management"
|
||||
echo "systemd. Also, subsequent \`systemctl restart NetworkManager\` works."
|
||||
echo "You don't want to do this on your real system, because it messes up your"
|
||||
|
|
@ -44,14 +44,7 @@ usage() {
|
|||
}
|
||||
|
||||
get_version() {
|
||||
local major minor micro
|
||||
local F="./configure.ac"
|
||||
|
||||
vars="$(sed -n 's/^m4_define(\[nm_\(major\|minor\|micro\)_version\], *\[\([0-9]\+\)\]) *$/local \1='\''\2'\''/p' "$F" 2>/dev/null)"
|
||||
eval "$vars"
|
||||
|
||||
[[ -n "$major" && -n "$minor" && "$micro" ]] || return 1
|
||||
echo "$major.$minor.$micro"
|
||||
grep -E -m1 '^\s+version:' meson.build | cut -d"'" -f2
|
||||
}
|
||||
|
||||
bool() {
|
||||
|
|
@ -149,7 +142,6 @@ P_NOBUILD="${NOBUILD-0}"
|
|||
|
||||
P_DEBUG="${DEBUG-1}"
|
||||
|
||||
P_BUILD_TYPE="${BUILD_TYPE-meson}"
|
||||
P_MESON_BUILDDIR="${MESON_BUILDDIR-./build}"
|
||||
[ -n "$MESON_BUILDDIR" ] && P_MESON_BUILDDIR_FORCE=1
|
||||
P_CFLAGS="${CFLAGS-}"
|
||||
|
|
@ -313,14 +305,10 @@ while [[ $# -gt 0 ]] ; do
|
|||
shift
|
||||
case "$A" in
|
||||
--meson|-m)
|
||||
P_BUILD_TYPE=meson
|
||||
P_MESON_BUILDDIR="$1"
|
||||
P_MESON_BUILDDIR_FORCE=1
|
||||
shift
|
||||
;;
|
||||
--autotools|-a)
|
||||
P_BUILD_TYPE=autotools
|
||||
;;
|
||||
-s|--show)
|
||||
SHOW_CMD=show_cmd
|
||||
;;
|
||||
|
|
@ -338,7 +326,7 @@ while [[ $# -gt 0 ]] ; do
|
|||
esac
|
||||
done
|
||||
|
||||
if [ "$P_BUILD_TYPE" = meson -a "$P_MESON_BUILDDIR_FORCE" != 1 ]; then
|
||||
if [ "$P_MESON_BUILDDIR_FORCE" != 1 ]; then
|
||||
if [ -d "$P_MESON_BUILDDIR" ]; then
|
||||
echo "Build directory '$P_MESON_BUILDDIR' chosen by default, but it exists and will be overwritten." \
|
||||
"If you really want that, pass '--meson \"$P_MESON_BUILDDIR\"'." >&2
|
||||
|
|
@ -348,181 +336,89 @@ fi
|
|||
|
||||
vars_with_vals
|
||||
|
||||
if [ "$P_BUILD_TYPE" == meson ] ; then
|
||||
MESON_RECONFIGURE=
|
||||
if test -d "$P_MESON_BUILDDIR" ; then
|
||||
MESON_RECONFIGURE="--reconfigure"
|
||||
fi
|
||||
|
||||
$SHOW_CMD \
|
||||
env \
|
||||
CC="$P_CC" \
|
||||
CFLAGS="$P_CFLAGS" \
|
||||
meson setup\
|
||||
$MESON_RECONFIGURE \
|
||||
--buildtype=plain \
|
||||
--prefix="$D_PREFIX" \
|
||||
--libdir="$D_LIBDIR" \
|
||||
--libexecdir="$D_LIBEXECDIR" \
|
||||
--bindir="$D_BINDIR" \
|
||||
--sbindir="$D_SBINDIR" \
|
||||
--includedir="$D_INCLUDEDIR" \
|
||||
--datadir="$D_DATADIR" \
|
||||
--mandir="$D_MANDIR" \
|
||||
--infodir="$D_INFODIR" \
|
||||
--localedir="$D_DATADIR"/locale \
|
||||
--sysconfdir="$D_SYSCONFDIR" \
|
||||
--localstatedir="$D_LOCALSTATEDIR" \
|
||||
--sharedstatedir="$D_SHAREDSTATEDIR" \
|
||||
--wrap-mode=nodownload \
|
||||
--auto-features=enabled \
|
||||
-Db_ndebug=false \
|
||||
--warnlevel 2 \
|
||||
$(args_enable "$P_TEST" --werror) \
|
||||
-Dnft="${D_SBINDIR}/nft" \
|
||||
-Diptables="${D_SBINDIR}/iptables" \
|
||||
-Ddhclient="${D_SBINDIR}/dhclient" \
|
||||
-Ddhcpcanon=no \
|
||||
-Ddhcpcd=no \
|
||||
-Dconfig_dhcp_default="$P_DHCP_DEFAULT" \
|
||||
"-Dcrypto=$P_CRYPTO" \
|
||||
$(args_enable "$P_DEBUG" -Dmore_logging=true -Dmore_asserts=10000) \
|
||||
$(args_enable "$(bool_not_true "$P_DEBUG")" -Dmore_logging=false -Dmore_asserts=0 ) \
|
||||
-Dld_gc=true \
|
||||
-Db_lto="$(bool_true "$P_LTO")" \
|
||||
-Dlibaudit=yes-disabled-by-default \
|
||||
-Dmodem_manager="$(bool_true "$P_MODEM_MANAGER_1")" \
|
||||
$(args_enable "$P_WIFI" -Dwifi=true -Dwext="$(bool_true "$P_FEDORA")") \
|
||||
$(args_enable "$(bool_not_true "$P_WIFI")" -Dwifi=false ) \
|
||||
-Diwd="$(bool_true "$P_IWD")" \
|
||||
-Dbluez5_dun="$(bool_true "$P_BLUETOOTH")" \
|
||||
-Dnmtui="$(bool_true "$P_NMTUI")" \
|
||||
-Dnm_cloud_setup="$(bool_true "$P_NM_CLOUD_SETUP")" \
|
||||
-Dvapi=true \
|
||||
-Dintrospection=true \
|
||||
-Ddocs="$(bool_true "$P_REGEN_DOCS")" \
|
||||
-Dteamdctl="$(bool_true "$P_TEAM")" \
|
||||
-Dovs="$(bool_true "$P_OVS")" \
|
||||
-Dselinux=true \
|
||||
-Dpolkit=true \
|
||||
-Dconfig_auth_polkit_default=true \
|
||||
-Dmodify_system=true \
|
||||
-Dconcheck=true \
|
||||
-Dlibpsl="$(bool_true "$P_FEDORA")" \
|
||||
-Debpf="$(bool_true "$P_EBPF_ENABLED")" \
|
||||
-Dsession_tracking=systemd \
|
||||
-Dsuspend_resume=systemd \
|
||||
-Dsystemdsystemunitdir=/usr/lib/systemd/system \
|
||||
-Dsystem_ca_path=/etc/pki/tls/cert.pem \
|
||||
-Ddbus_conf_dir="$P_DBUS_SYS_DIR" \
|
||||
-Dtests=yes \
|
||||
-Dvalgrind=no \
|
||||
-Difcfg_rh=true \
|
||||
-Difupdown=false \
|
||||
$(args_enable "$P_PPP" -Dppp=true -Dpppd="$D_SBINDIR/pppd" -Dpppd_plugin_dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \
|
||||
$(args_enable "$(bool_not_true "$P_PPP")" -Dppp=false ) \
|
||||
-Dfirewalld_zone="$(bool_true "$P_FIREWALLD_ZONE}")" \
|
||||
-Ddist_version="$P_VERSION-$P_RELEASE" \
|
||||
$(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" -Dconfig_plugins_default=ifcfg-rh) \
|
||||
-Dresolvconf=no \
|
||||
-Dnetconfig=no \
|
||||
-Dconfig_dns_rc_manager_default="$P_DNS_RC_MANAGER_DEFAULT" \
|
||||
-Dconfig_logging_backend_default="$P_LOGGING_BACKEND_DEFAULT" \
|
||||
\
|
||||
"$P_MESON_BUILDDIR" \
|
||||
;
|
||||
else
|
||||
if ! test -x ./configure ; then
|
||||
if [ -z "$SHOW_CMD" ]; then
|
||||
NOCONFIGURE=yes ./autogen.sh
|
||||
fi
|
||||
fi
|
||||
$SHOW_CMD \
|
||||
./configure \
|
||||
--build=x86_64-redhat-linux-gnu \
|
||||
--host=x86_64-redhat-linux-gnu \
|
||||
--program-prefix= \
|
||||
--prefix="$D_PREFIX" \
|
||||
--exec-prefix=/usr \
|
||||
--bindir="$D_BINDIR" \
|
||||
--sbindir="$D_SBINDIR" \
|
||||
--sysconfdir="$D_SYSCONFDIR" \
|
||||
--datadir="$D_DATADIR" \
|
||||
--includedir="$D_INCLUDEDIR" \
|
||||
--libdir="$D_LIBDIR" \
|
||||
--libexecdir="$D_LIBEXECDIR" \
|
||||
--localstatedir="$D_LOCALSTATEDIR" \
|
||||
--sharedstatedir="$D_SHAREDSTATEDIR" \
|
||||
--mandir="$D_MANDIR" \
|
||||
--infodir="$D_INFODIR" \
|
||||
\
|
||||
CC="$P_CC" \
|
||||
CFLAGS="$P_CFLAGS" \
|
||||
\
|
||||
--enable-dependency-tracking=yes \
|
||||
\
|
||||
--with-runstatedir="$D_RUNDIR" \
|
||||
--enable-silent-rules="$(bool_yes "$P_SILENT_RULES")" \
|
||||
--enable-static=no \
|
||||
--with-nft="${D_SBINDIR}/nft" \
|
||||
--with-iptables="${D_SBINDIR}/iptables" \
|
||||
--with-dhclient="${D_SBINDIR}/dhclient" \
|
||||
--with-dhcpcd=no \
|
||||
--with-dhcpcanon=no \
|
||||
--with-config-dhcp-default="$P_DHCP_DEFAULT" \
|
||||
--with-crypto="$P_CRYPTO" \
|
||||
$(args_enable "$P_SANITIZER" --with-address-sanitizer=exec --enable-undefined-sanitizer="$( (bool "$P_FEDORA" || test "$P_RHEL" -ge 8) && echo yes || echo no)" ) \
|
||||
$(args_enable "$(bool_not_true "$P_SANITIZER")" --with-address-sanitizer=no --enable-undefined-sanitizer=no ) \
|
||||
$(args_enable "$P_DEBUG" --enable-more-logging=yes --with-more-asserts=10000) \
|
||||
$(args_enable "$(bool_not_true "$P_DEBUG")" --enable-more-logging=no --with-more-asserts=0 ) \
|
||||
--enable-ld-gc=yes \
|
||||
--enable-lto="$(bool_yes "$P_LTO")" \
|
||||
--with-libaudit=yes-disabled-by-default \
|
||||
--with-modem-manager-1="$(bool_yes "$P_MODEM_MANAGER_1")" \
|
||||
$(args_enable "$P_WIFI" --enable-wifi=yes --with-wext="$(bool_yes "$P_FEDORA")") \
|
||||
$(args_enable "$(bool_not_true "$P_WIFI")" --enable-wifi=no ) \
|
||||
--with-iwd="$(bool_yes "$P_IWD")" \
|
||||
--enable-bluez5-dun="$(bool_yes "$P_BLUETOOTH")" \
|
||||
--with-nmtui="$(bool_yes "$P_NMTUI")" \
|
||||
--with-nm-cloud-setup="$(bool_yes "$P_NM_CLOUD_SETUP")" \
|
||||
--enable-vala=yes \
|
||||
--enable-introspection=yes \
|
||||
--enable-gtk-doc="$(bool_yes "$P_REGEN_DOCS")" \
|
||||
--enable-teamdctl="$(bool_yes "$P_TEAM")" \
|
||||
--enable-ovs="$(bool_yes "$P_OVS")" \
|
||||
--with-selinux=yes \
|
||||
--enable-polkit=yes \
|
||||
--enable-modify-system=yes \
|
||||
--enable-concheck=yes \
|
||||
--with-libpsl="$(bool_yes "$P_FEDORA")" \
|
||||
--with-ebpf="$(bool_yes "$P_EBPF_ENABLED")" \
|
||||
--with-session-tracking=systemd \
|
||||
--with-suspend-resume=systemd \
|
||||
--with-systemdsystemunitdir=/usr/lib/systemd/system \
|
||||
--with-system-ca-path=/etc/pki/tls/cert.pem \
|
||||
--with-dbus-sys-dir="$P_DBUS_SYS_DIR" \
|
||||
--with-tests=yes \
|
||||
--enable-more-warnings="$(bool "$P_TEST" && echo error || echo yes)" \
|
||||
--with-valgrind=no \
|
||||
--enable-ifcfg-rh=yes \
|
||||
--enable-ifupdown=no \
|
||||
$(args_enable "$P_PPP" --enable-ppp=yes --with-pppd="$D_SBINDIR/pppd" --with-pppd-plugin-dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \
|
||||
$(args_enable "$(bool_not_true "$P_PPP")" --enable-ppp=no ) \
|
||||
--enable-firewalld-zone="$(bool_yes "$P_FIREWALLD_ZONE")" \
|
||||
--with-dist-version="$P_VERSION-$P_RELEASE" \
|
||||
$(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" --with-config-plugins-default=ifcfg-rh) \
|
||||
--with-resolvconf=no \
|
||||
--with-netconfig=no \
|
||||
--with-config-dns-rc-manager-default="$P_DNS_RC_MANAGER_DEFAULT" \
|
||||
--with-config-logging-backend-default="$P_LOGGING_BACKEND_DEFAULT" \
|
||||
--disable-autotools-deprecation \
|
||||
;
|
||||
MESON_RECONFIGURE=
|
||||
if test -d "$P_MESON_BUILDDIR" ; then
|
||||
MESON_RECONFIGURE="--reconfigure"
|
||||
fi
|
||||
|
||||
$SHOW_CMD \
|
||||
env \
|
||||
CC="$P_CC" \
|
||||
CFLAGS="$P_CFLAGS" \
|
||||
meson setup\
|
||||
$MESON_RECONFIGURE \
|
||||
--buildtype=plain \
|
||||
--prefix="$D_PREFIX" \
|
||||
--libdir="$D_LIBDIR" \
|
||||
--libexecdir="$D_LIBEXECDIR" \
|
||||
--bindir="$D_BINDIR" \
|
||||
--sbindir="$D_SBINDIR" \
|
||||
--includedir="$D_INCLUDEDIR" \
|
||||
--datadir="$D_DATADIR" \
|
||||
--mandir="$D_MANDIR" \
|
||||
--infodir="$D_INFODIR" \
|
||||
--localedir="$D_DATADIR"/locale \
|
||||
--sysconfdir="$D_SYSCONFDIR" \
|
||||
--localstatedir="$D_LOCALSTATEDIR" \
|
||||
--sharedstatedir="$D_SHAREDSTATEDIR" \
|
||||
--wrap-mode=nodownload \
|
||||
--auto-features=enabled \
|
||||
-Db_ndebug=false \
|
||||
--warnlevel 2 \
|
||||
$(args_enable "$P_TEST" --werror) \
|
||||
-Dnft="${D_SBINDIR}/nft" \
|
||||
-Diptables="${D_SBINDIR}/iptables" \
|
||||
-Ddhclient="${D_SBINDIR}/dhclient" \
|
||||
-Ddhcpcanon=no \
|
||||
-Ddhcpcd=no \
|
||||
-Dconfig_dhcp_default="$P_DHCP_DEFAULT" \
|
||||
"-Dcrypto=$P_CRYPTO" \
|
||||
$(args_enable "$P_DEBUG" -Dmore_logging=true -Dmore_asserts=10000) \
|
||||
$(args_enable "$(bool_not_true "$P_DEBUG")" -Dmore_logging=false -Dmore_asserts=0 ) \
|
||||
-Dld_gc=true \
|
||||
-Db_lto="$(bool_true "$P_LTO")" \
|
||||
-Dlibaudit=yes-disabled-by-default \
|
||||
-Dmodem_manager="$(bool_true "$P_MODEM_MANAGER_1")" \
|
||||
$(args_enable "$P_WIFI" -Dwifi=true -Dwext="$(bool_true "$P_FEDORA")") \
|
||||
$(args_enable "$(bool_not_true "$P_WIFI")" -Dwifi=false ) \
|
||||
-Diwd="$(bool_true "$P_IWD")" \
|
||||
-Dbluez5_dun="$(bool_true "$P_BLUETOOTH")" \
|
||||
-Dnmtui="$(bool_true "$P_NMTUI")" \
|
||||
-Dnm_cloud_setup="$(bool_true "$P_NM_CLOUD_SETUP")" \
|
||||
-Dvapi=true \
|
||||
-Dintrospection=true \
|
||||
-Ddocs="$(bool_true "$P_REGEN_DOCS")" \
|
||||
-Dteamdctl="$(bool_true "$P_TEAM")" \
|
||||
-Dovs="$(bool_true "$P_OVS")" \
|
||||
-Dselinux=true \
|
||||
-Dpolkit=true \
|
||||
-Dconfig_auth_polkit_default=true \
|
||||
-Dmodify_system=true \
|
||||
-Dconcheck=true \
|
||||
-Dlibpsl="$(bool_true "$P_FEDORA")" \
|
||||
-Debpf="$(bool_true "$P_EBPF_ENABLED")" \
|
||||
-Dsession_tracking=systemd \
|
||||
-Dsuspend_resume=systemd \
|
||||
-Dsystemdsystemunitdir=/usr/lib/systemd/system \
|
||||
-Dsystem_ca_path=/etc/pki/tls/cert.pem \
|
||||
-Ddbus_conf_dir="$P_DBUS_SYS_DIR" \
|
||||
-Dtests=yes \
|
||||
-Dvalgrind=no \
|
||||
-Difcfg_rh=true \
|
||||
-Difupdown=false \
|
||||
$(args_enable "$P_PPP" -Dppp=true -Dpppd="$D_SBINDIR/pppd" -Dpppd_plugin_dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \
|
||||
$(args_enable "$(bool_not_true "$P_PPP")" -Dppp=false ) \
|
||||
-Dfirewalld_zone="$(bool_true "$P_FIREWALLD_ZONE}")" \
|
||||
-Ddist_version="$P_VERSION-$P_RELEASE" \
|
||||
$(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" -Dconfig_plugins_default=ifcfg-rh) \
|
||||
-Dresolvconf=no \
|
||||
-Dnetconfig=no \
|
||||
-Dconfig_dns_rc_manager_default="$P_DNS_RC_MANAGER_DEFAULT" \
|
||||
-Dconfig_logging_backend_default="$P_LOGGING_BACKEND_DEFAULT" \
|
||||
\
|
||||
"$P_MESON_BUILDDIR" \
|
||||
;
|
||||
|
||||
if ! bool "$P_NOBUILD" ; then
|
||||
if [ "$P_BUILD_TYPE" == meson ] ; then
|
||||
$SHOW_CMD ninja -C "$P_MESON_BUILDDIR"
|
||||
else
|
||||
$SHOW_CMD make -j 10
|
||||
fi
|
||||
$SHOW_CMD ninja -C "$P_MESON_BUILDDIR"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -94,9 +94,9 @@ do_command() {
|
|||
}
|
||||
|
||||
parse_version() {
|
||||
local MAJ="$(sed -n '1,20 s/^m4_define(\[nm_major_version\], \[\([0-9]\+\)\])$/\1/p' ./configure.ac)"
|
||||
local MIN="$(sed -n '1,20 s/^m4_define(\[nm_minor_version\], \[\([0-9]\+\)\])$/\1/p' ./configure.ac)"
|
||||
local MIC="$(sed -n '1,20 s/^m4_define(\[nm_micro_version\], \[\([0-9]\+\)\])$/\1/p' ./configure.ac)"
|
||||
local VERSION=$(grep -E -m1 '^\s+version:' "$GITDIR/meson.build" \
|
||||
| cut -d"'" -f2 \
|
||||
| sed 's/\./ /g')
|
||||
|
||||
re='^(0|[1-9][0-9]*) (0|[1-9][0-9]*) (0|[1-9][0-9]*)$'
|
||||
[[ "$MAJ $MIN $MIC" =~ $re ]] || return 1
|
||||
|
|
@ -144,25 +144,12 @@ check_gitlab_pipeline() {
|
|||
return 0
|
||||
}
|
||||
|
||||
set_version_number_autotools() {
|
||||
sed -i \
|
||||
-e '1,20 s/^m4_define(\[nm_major_version\], \[\([0-9]\+\)\])$/m4_define([nm_major_version], ['"$1"'])/' \
|
||||
-e '1,20 s/^m4_define(\[nm_minor_version\], \[\([0-9]\+\)\])$/m4_define([nm_minor_version], ['"$2"'])/' \
|
||||
-e '1,20 s/^m4_define(\[nm_micro_version\], \[\([0-9]\+\)\])$/m4_define([nm_micro_version], ['"$3"'])/' \
|
||||
./configure.ac
|
||||
}
|
||||
|
||||
set_version_number_meson() {
|
||||
set_version_number() {
|
||||
sed -i \
|
||||
-e '1,20 s/^\( *version: *'\''\)[0-9]\+\.[0-9]\+\.[0-9]\+\('\'',\)$/\1'"$1.$2.$3"'\2/' \
|
||||
meson.build
|
||||
}
|
||||
|
||||
set_version_number() {
|
||||
set_version_number_autotools "$@" &&
|
||||
set_version_number_meson "$@"
|
||||
}
|
||||
|
||||
check_news() {
|
||||
local mode="$1"
|
||||
shift
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
# Arguments via environment variables:
|
||||
# - CI
|
||||
# - CC
|
||||
# - BUILD_TYPE
|
||||
# - CFLAGS
|
||||
# - WITH_DOCS
|
||||
|
||||
|
|
@ -50,23 +49,13 @@ grep -q '^NAME=.*\(Alpine\)' /etc/os-release && IS_ALPINE=1
|
|||
|
||||
###############################################################################
|
||||
|
||||
if [ "$BUILD_TYPE" == meson ]; then
|
||||
_TRUE=true
|
||||
_FALSE=false
|
||||
elif [ "$BUILD_TYPE" == autotools ]; then
|
||||
_TRUE=yes
|
||||
_FALSE=no
|
||||
else
|
||||
die "invalid \$BUILD_TYPE \"$BUILD_TYPE\""
|
||||
fi
|
||||
|
||||
_WITH_CRYPTO="gnutls"
|
||||
_WITH_WERROR=1
|
||||
_WITH_LIBTEAM="$_TRUE"
|
||||
_WITH_DOCS="$_TRUE"
|
||||
_WITH_SYSTEMD_LOGIND="$_TRUE"
|
||||
_WITH_LIBTEAM="true"
|
||||
_WITH_DOCS="true"
|
||||
_WITH_SYSTEMD_LOGIND="true"
|
||||
if [ $IS_ALPINE = 1 ]; then
|
||||
_WITH_SYSTEMD_LOGIND="$_FALSE"
|
||||
_WITH_SYSTEMD_LOGIND="false"
|
||||
fi
|
||||
|
||||
if [ -z "${NMTST_SEED_RAND+x}" ]; then
|
||||
|
|
@ -92,9 +81,9 @@ fi
|
|||
|
||||
if [ "$WITH_DOCS" != "" ]; then
|
||||
if _is_true "$WITH_DOCS"; then
|
||||
_WITH_DOCS="$_TRUE"
|
||||
_WITH_DOCS="true"
|
||||
else
|
||||
_WITH_DOCS="$_FALSE"
|
||||
_WITH_DOCS="false"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
@ -149,149 +138,72 @@ _print_test_logs() {
|
|||
fi
|
||||
}
|
||||
|
||||
run_autotools() {
|
||||
NOCONFIGURE=1 ./autogen.sh
|
||||
mkdir ./build
|
||||
if [ "$_WITH_WERROR" == 1 ]; then
|
||||
_WITH_WERROR_VAL="error"
|
||||
else
|
||||
_WITH_WERROR_VAL="yes"
|
||||
fi
|
||||
DISABLE_DEPENDENCY_TRACKING=
|
||||
if [ $IS_ALPINE = 1 ]; then
|
||||
DISABLE_DEPENDENCY_TRACKING='--disable-dependency-tracking'
|
||||
fi
|
||||
pushd ./build
|
||||
../configure \
|
||||
--prefix="$PWD/INST" \
|
||||
$DISABLE_DEPENDENCY_TRACKING \
|
||||
\
|
||||
--enable-introspection=$_WITH_DOCS \
|
||||
--enable-gtk-doc=$_WITH_DOCS \
|
||||
--with-systemd-logind=$_WITH_SYSTEMD_LOGIND \
|
||||
--enable-more-warnings="$_WITH_WERROR_VAL" \
|
||||
--enable-tests=yes \
|
||||
--with-crypto=$_WITH_CRYPTO \
|
||||
\
|
||||
--with-ebpf=no \
|
||||
\
|
||||
--with-iwd=yes \
|
||||
--with-ofono=yes \
|
||||
--enable-teamdctl=$_WITH_LIBTEAM \
|
||||
\
|
||||
--with-dhcpcanon=yes \
|
||||
--with-dhcpcd=yes \
|
||||
--with-dhclient=yes \
|
||||
\
|
||||
--with-netconfig=/bin/nowhere/netconfig \
|
||||
--with-resolvconf=/bin/nowhere/resolvconf \
|
||||
\
|
||||
--enable-ifcfg-rh=yes \
|
||||
--enable-ifupdown=yes \
|
||||
--disable-autotools-deprecation \
|
||||
\
|
||||
#end
|
||||
|
||||
if [ "$CONFIGURE_ONLY" != 1 ]; then
|
||||
make -j 6
|
||||
make install
|
||||
|
||||
export NM_TEST_CLIENT_CHECK_L10N=1
|
||||
|
||||
if ! make check -j 6 -k ; then
|
||||
_print_test_logs "first-test"
|
||||
echo ">>>> RUN SECOND TEST (start)"
|
||||
NMTST_DEBUG="debug,TRACE,no-expect-message" make check -k || :
|
||||
echo ">>>> RUN SECOND TEST (done)"
|
||||
_print_test_logs "second-test"
|
||||
die "autotools test failed"
|
||||
fi
|
||||
|
||||
if _with_valgrind; then
|
||||
if ! NMTST_USE_VALGRIND=1 make check -j 3 -k ; then
|
||||
_print_test_logs "(valgrind test)"
|
||||
die "autotools+valgrind test failed"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
popd
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
run_meson() {
|
||||
if [ "$_WITH_WERROR" == 1 ]; then
|
||||
_WITH_WERROR_VAL="--werror"
|
||||
else
|
||||
_WITH_WERROR_VAL=""
|
||||
if [ "$_WITH_WERROR" == 1 ]; then
|
||||
_WITH_WERROR_VAL="--werror"
|
||||
else
|
||||
_WITH_WERROR_VAL=""
|
||||
fi
|
||||
|
||||
meson setup build \
|
||||
\
|
||||
-Dprefix="$PWD/INST" \
|
||||
\
|
||||
--warnlevel 2 \
|
||||
$_WITH_WERROR_VAL \
|
||||
\
|
||||
-D ld_gc=false \
|
||||
-D session_tracking=no \
|
||||
-D systemdsystemunitdir=no \
|
||||
-D systemd_journal=false \
|
||||
-D selinux=false \
|
||||
-D libaudit=no \
|
||||
-D libpsl=false \
|
||||
-D vapi=false \
|
||||
-D introspection=$_WITH_DOCS \
|
||||
-D qt=false \
|
||||
-D crypto=$_WITH_CRYPTO \
|
||||
-D docs=$_WITH_DOCS \
|
||||
\
|
||||
-D ebpf=false \
|
||||
\
|
||||
-D iwd=true \
|
||||
-D ofono=true \
|
||||
-D teamdctl=$_WITH_LIBTEAM \
|
||||
\
|
||||
-D dhclient=/bin/nowhere/dhclient \
|
||||
-D dhcpcanon=/bin/nowhere/dhcpcanon \
|
||||
-D dhcpcd=/bin/nowhere/dhcpd \
|
||||
\
|
||||
-D netconfig=/bin/nowhere/netconfig \
|
||||
-D resolvconf=/bin/nowhere/resolvconf \
|
||||
\
|
||||
-D ifcfg_rh=false \
|
||||
-D ifupdown=true \
|
||||
\
|
||||
#end
|
||||
|
||||
export NM_TEST_CLIENT_CHECK_L10N=1
|
||||
|
||||
if [ "$CONFIGURE_ONLY" != 1 ]; then
|
||||
ninja -C build -v
|
||||
ninja -C build install
|
||||
|
||||
if ! meson test -C build -v --print-errorlogs ; then
|
||||
echo ">>>> RUN SECOND TEST (start)"
|
||||
NMTST_DEBUG="debug,TRACE,no-expect-message" \
|
||||
meson test -C build -v --print-errorlogs || :
|
||||
echo ">>>> RUN SECOND TEST (done)"
|
||||
die "meson test failed"
|
||||
fi
|
||||
meson setup build \
|
||||
\
|
||||
-Dprefix="$PWD/INST" \
|
||||
\
|
||||
--warnlevel 2 \
|
||||
$_WITH_WERROR_VAL \
|
||||
\
|
||||
-D ld_gc=false \
|
||||
-D session_tracking=no \
|
||||
-D systemdsystemunitdir=no \
|
||||
-D systemd_journal=false \
|
||||
-D selinux=false \
|
||||
-D libaudit=no \
|
||||
-D libpsl=false \
|
||||
-D vapi=false \
|
||||
-D introspection=$_WITH_DOCS \
|
||||
-D qt=false \
|
||||
-D crypto=$_WITH_CRYPTO \
|
||||
-D docs=$_WITH_DOCS \
|
||||
\
|
||||
-D ebpf=false \
|
||||
\
|
||||
-D iwd=true \
|
||||
-D ofono=true \
|
||||
-D teamdctl=$_WITH_LIBTEAM \
|
||||
\
|
||||
-D dhclient=/bin/nowhere/dhclient \
|
||||
-D dhcpcanon=/bin/nowhere/dhcpcanon \
|
||||
-D dhcpcd=/bin/nowhere/dhcpd \
|
||||
\
|
||||
-D netconfig=/bin/nowhere/netconfig \
|
||||
-D resolvconf=/bin/nowhere/resolvconf \
|
||||
\
|
||||
-D ifcfg_rh=false \
|
||||
-D ifupdown=true \
|
||||
\
|
||||
#end
|
||||
|
||||
export NM_TEST_CLIENT_CHECK_L10N=1
|
||||
|
||||
if [ "$CONFIGURE_ONLY" != 1 ]; then
|
||||
ninja -C build -v
|
||||
ninja -C build install
|
||||
|
||||
if ! meson test -C build -v --print-errorlogs ; then
|
||||
echo ">>>> RUN SECOND TEST (start)"
|
||||
NMTST_DEBUG="debug,TRACE,no-expect-message" \
|
||||
meson test -C build -v --print-errorlogs || :
|
||||
echo ">>>> RUN SECOND TEST (done)"
|
||||
die "meson test failed"
|
||||
fi
|
||||
|
||||
if _with_valgrind; then
|
||||
if ! NMTST_USE_VALGRIND=1 meson test -C build -v --print-errorlogs ; then
|
||||
_print_test_logs "(valgrind test)"
|
||||
die "meson+valgrind test failed"
|
||||
fi
|
||||
if _with_valgrind; then
|
||||
if ! NMTST_USE_VALGRIND=1 meson test -C build -v --print-errorlogs ; then
|
||||
_print_test_logs "(valgrind test)"
|
||||
die "meson+valgrind test failed"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
if [ "$BUILD_TYPE" == autotools ]; then
|
||||
run_autotools
|
||||
elif [ "$BUILD_TYPE" == meson ]; then
|
||||
run_meson
|
||||
fi
|
||||
|
||||
if [ "$USE_CCACHE" = 1 ]; then
|
||||
|
|
|
|||
|
|
@ -1,140 +0,0 @@
|
|||
AUTOMAKE_OPTIONS = 1.7
|
||||
|
||||
XSLTPROC = xsltproc --xinclude --nonet
|
||||
XMLS = $(wildcard $(top_srcdir)/introspection/nm-*.xml)
|
||||
GENERATED_FILES =
|
||||
|
||||
if BUILD_DOCS
|
||||
GENERATED_FILES += settings-spec.xml
|
||||
endif
|
||||
|
||||
# The name of the module.
|
||||
DOC_MODULE=NetworkManager
|
||||
|
||||
# The top-level SGML file.
|
||||
DOC_MAIN_SGML_FILE=network-manager-docs.xml
|
||||
|
||||
DOC_SOURCE_DIR=$(srcdir)
|
||||
|
||||
# Extra options to supply to gtkdoc-mkdb
|
||||
MKDB_OPTIONS=--sgml-mode --output-format=xml
|
||||
|
||||
# Extra options to supply to gtkdoc-mktmpl
|
||||
MKTMPL_OPTIONS=
|
||||
|
||||
# Extra options to supply to gtkdoc-mkhtml
|
||||
MKHTML_OPTIONS=--path="$(abs_srcdir)"
|
||||
|
||||
# Files to be included in $(DOC_MAIN_SGML_FILE)
|
||||
content_files = \
|
||||
$(GENERATED_FILES) \
|
||||
dbus-org.freedesktop.NetworkManager.AccessPoint.xml \
|
||||
dbus-org.freedesktop.NetworkManager.AgentManager.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Connection.Active.xml \
|
||||
dbus-org.freedesktop.NetworkManager.DHCP4Config.xml \
|
||||
dbus-org.freedesktop.NetworkManager.DHCP6Config.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Adsl.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Bluetooth.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Bond.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Bridge.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Dummy.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Generic.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Hsr.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.IPTunnel.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Infiniband.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Loopback.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Macsec.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Macvlan.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Modem.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.OlpcMesh.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Statistics.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Team.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Tun.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Veth.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Vlan.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Vxlan.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.WifiP2P.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.WireGuard.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Wired.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.Wireless.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Device.xml \
|
||||
dbus-org.freedesktop.NetworkManager.DnsManager.xml \
|
||||
dbus-org.freedesktop.NetworkManager.IP4Config.xml \
|
||||
dbus-org.freedesktop.NetworkManager.IP6Config.xml \
|
||||
dbus-org.freedesktop.NetworkManager.PPP.xml \
|
||||
dbus-org.freedesktop.NetworkManager.SecretAgent.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Settings.Connection.xml \
|
||||
dbus-org.freedesktop.NetworkManager.Settings.xml \
|
||||
dbus-org.freedesktop.NetworkManager.VPN.Connection.xml \
|
||||
dbus-org.freedesktop.NetworkManager.VPN.Plugin.xml \
|
||||
dbus-org.freedesktop.NetworkManager.xml \
|
||||
$(top_builddir)/src/libnm-core-public/nm-dbus-types.xml \
|
||||
$(top_builddir)/src/libnm-core-public/nm-vpn-dbus-types.xml \
|
||||
$(top_builddir)/man/nmcli.xml \
|
||||
$(top_builddir)/man/nmtui.xml \
|
||||
$(top_builddir)/man/nm-online.xml \
|
||||
$(top_builddir)/man/nm-initrd-generator.xml \
|
||||
$(top_builddir)/man/NetworkManager.xml \
|
||||
$(top_builddir)/man/NetworkManager-dispatcher.xml \
|
||||
$(top_builddir)/man/NetworkManager.conf.xml \
|
||||
$(top_builddir)/man/NetworkManager-wait-online.service.xml \
|
||||
$(top_builddir)/man/nmcli-examples.xml \
|
||||
$(top_builddir)/man/nm-settings-dbus.xml \
|
||||
$(top_builddir)/man/nm-settings-keyfile.xml \
|
||||
$(top_builddir)/man/nm-settings-nmcli.xml \
|
||||
version.xml \
|
||||
$(NULL)
|
||||
|
||||
|
||||
if WITH_OPENVSWITCH
|
||||
content_files += $(top_builddir)/man/nm-openvswitch.xml
|
||||
endif
|
||||
|
||||
if BUILD_NM_CLOUD_SETUP
|
||||
content_files += $(top_builddir)/man/nm-cloud-setup.xml
|
||||
endif
|
||||
|
||||
if CONFIG_PLUGIN_IFCFG_RH
|
||||
content_files += $(top_builddir)/man/nm-settings-ifcfg-rh.xml
|
||||
endif
|
||||
|
||||
include $(top_srcdir)/gtk-doc.make
|
||||
|
||||
# workaround setup-build.stamp from gtk-doc.make, which copies
|
||||
# the file as read-only. That breaks later build steps, as the
|
||||
# file can no longer be written. Instead, copy the file with `cp -f`
|
||||
# only.
|
||||
setup-build.stamp:
|
||||
-$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
|
||||
files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \
|
||||
if test "x$$files" != "x" ; then \
|
||||
for file in $$files ; do \
|
||||
destdir=`dirname $(abs_builddir)/$$file`; \
|
||||
test -d "$$destdir" || mkdir -p "$$destdir"; \
|
||||
test -f $(abs_srcdir)/$$file && \
|
||||
( cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file ; \
|
||||
chmod u+w $(abs_builddir)/$$file ) || true; \
|
||||
done; \
|
||||
fi; \
|
||||
fi
|
||||
$(AM_V_at)touch setup-build.stamp
|
||||
|
||||
settings-spec.xml: settings-spec.xsl $(top_builddir)/man/nm-settings-docs-dbus.xml
|
||||
$(AM_V_GEN) (! test -f $@ || chmod u+w $@) && xsltproc --output $@ $^
|
||||
|
||||
EXTRA_DIST += \
|
||||
version.xml.in \
|
||||
settings-spec.xsl \
|
||||
meson.build \
|
||||
$(GENERATED_FILES) \
|
||||
$(NULL)
|
||||
|
||||
CLEANFILES += \
|
||||
html/* \
|
||||
tmpl/* \
|
||||
xml/* \
|
||||
NetworkManager-overrides.txt \
|
||||
NetworkManager-sections.txt \
|
||||
NetworkManager.actions \
|
||||
settings-spec.xml \
|
||||
$(NULL)
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
AUTOMAKE_OPTIONS = 1.6
|
||||
|
||||
check_local =
|
||||
|
||||
# The name of the module
|
||||
DOC_MODULE=libnm
|
||||
|
||||
# The top-level SGML file.
|
||||
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
|
||||
|
||||
# The directory containing the source code. Relative to $(srcdir).
|
||||
# gtk-doc will search all .c & .h files beneath here for inline comments
|
||||
# documenting functions and macros.
|
||||
DOC_SOURCE_DIR= \
|
||||
$(top_builddir)/src/libnm-core-public \
|
||||
$(top_srcdir)/src/libnm-core-public \
|
||||
$(top_builddir)/src/libnm-core-impl \
|
||||
$(top_srcdir)/src/libnm-core-impl \
|
||||
$(top_srcdir)/src/libnm-client-public \
|
||||
$(top_builddir)/src/libnm-client-public \
|
||||
$(top_srcdir)/src/libnm-client-impl \
|
||||
$(top_builddir)/src/libnm-client-impl \
|
||||
$(NULL)
|
||||
|
||||
# Extra options to supply to gtkdoc-scan.
|
||||
SCAN_OPTIONS=--rebuild-types --rebuild-sections --ignore-decorators='NM_AVAILABLE_IN_\d+_\d+|NM_DEPRECATED_IN_\d+_\d+|NM_DEPRECATED_IN_\d+_\d+_FOR\(\)'
|
||||
|
||||
# Extra options to supply to gtkdoc-mkdb.
|
||||
MKDB_OPTIONS=--sgml-mode --output-format=xml
|
||||
|
||||
# Extra options to supply to gtkdoc-fixref.
|
||||
FIXXREF_OPTIONS=
|
||||
|
||||
# Used for dependencies.
|
||||
HFILE_GLOB=$(top_srcdir)/src/libnm-core-public/*.h $(top_srcdir)/src/libnm-client-public/*.h
|
||||
CFILE_GLOB=$(top_srcdir)/src/libnm-core-impl/*.c $(top_srcdir)/src/libnm-client-impl/*.c
|
||||
|
||||
# Header files to ignore when scanning.
|
||||
IGNORE_HFILES= \
|
||||
nm-dbus-helpers.h \
|
||||
nm-default-libnm.h \
|
||||
nm-device-private.h \
|
||||
nm-dhcp4-config.h \
|
||||
nm-dhcp6-config.h \
|
||||
nm-dns-manager.h \
|
||||
nm-ip4-config.h \
|
||||
nm-ip6-config.h \
|
||||
nm-libnm-utils.h \
|
||||
nm-object-private.h \
|
||||
nm-remote-connection-private.h \
|
||||
\
|
||||
nm-connection-private.h \
|
||||
nm-default-libnm-core.h \
|
||||
nm-setting-private.h \
|
||||
nm-team-utils.h \
|
||||
nm-utils-private.h \
|
||||
\
|
||||
nm-core-tests-enum-types.h \
|
||||
test-general-enums.h \
|
||||
\
|
||||
$(NULL)
|
||||
|
||||
# Images to copy into HTML directory.
|
||||
HTML_IMAGES = libnm.png
|
||||
|
||||
# Extra XML files that are included by $(DOC_MAIN_SGML_FILE).
|
||||
content_files = version.xml
|
||||
|
||||
# Other files to distribute.
|
||||
extra_files = libnm.png
|
||||
|
||||
|
||||
# CFLAGS and LDFLAGS for compiling scan program. Only needed
|
||||
# if $(DOC_MODULE).types is non-empty.
|
||||
GTKDOC_CFLAGS = \
|
||||
-I$(top_builddir)/src/libnm-core-public \
|
||||
-I$(top_srcdir)/src/libnm-core-public \
|
||||
-I$(top_srcdir)/src/libnm-client-public \
|
||||
-I$(top_builddir)/src/libnm-client-public \
|
||||
-DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \
|
||||
$(GLIB_CFLAGS) \
|
||||
$(SANITIZER_EXEC_CFLAGS)
|
||||
|
||||
GTKDOC_LIBS = \
|
||||
$(top_builddir)/src/libnm-client-impl/libnm.la \
|
||||
$(GLIB_LIBS) \
|
||||
$(SANITIZER_EXEC_LDFLAGS)
|
||||
|
||||
|
||||
# include common portion ...
|
||||
include $(top_srcdir)/gtk-doc.make
|
||||
|
||||
EXTRA_DIST += \
|
||||
version.xml.in \
|
||||
meson.build \
|
||||
$(NULL)
|
||||
|
||||
CLEANFILES += \
|
||||
html/* \
|
||||
tmpl/* \
|
||||
xml/* \
|
||||
libnm-overrides.txt \
|
||||
libnm-sections.txt \
|
||||
libnm.actions \
|
||||
$(NULL)
|
||||
|
||||
if GTK_DOC_BUILD_HTML
|
||||
check-local-gtk-doc-patch:
|
||||
@if grep -q -F '<a href="libnm-nm-setting-user.html">nm-setting-user</a>' "$(top_builddir)/docs/libnm/html/index.html"; then \
|
||||
echo "WARNING: The generated documentation has issues. Patch your gtk-doc (see https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/2). Let this check fail with NMTST_CHECK_GTK_DOC=1"; \
|
||||
test "$$NMTST_CHECK_GTK_DOC" != 1; \
|
||||
fi
|
||||
check_local += check-local-gtk-doc-patch
|
||||
endif
|
||||
|
||||
check-local: $(check_local)
|
||||
290
m4/attributes.m4
290
m4/attributes.m4
|
|
@ -1,290 +0,0 @@
|
|||
dnl Macros to check the presence of generic (non-typed) symbols.
|
||||
dnl Copyright (c) 2006-2008 Diego Pettenò <flameeyes@gmail.com>
|
||||
dnl Copyright (c) 2006-2008 xine project
|
||||
dnl Copyright (c) 2012 Lucas De Marchi <lucas.de.marchi@gmail.com>
|
||||
dnl
|
||||
dnl This program is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
dnl the Free Software Foundation; either version 2, or (at your option)
|
||||
dnl any later version.
|
||||
dnl
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with this program.
|
||||
dnl
|
||||
dnl As a special exception, the copyright owners of the
|
||||
dnl macro gives unlimited permission to copy, distribute and modify the
|
||||
dnl configure scripts that are the output of Autoconf when processing the
|
||||
dnl Macro. You need not follow the terms of the GNU General Public
|
||||
dnl License when using or distributing such scripts, even though portions
|
||||
dnl of the text of the Macro appear in them. The GNU General Public
|
||||
dnl License (GPL) does govern all other use of the material that
|
||||
dnl constitutes the Autoconf Macro.
|
||||
dnl
|
||||
dnl This special exception to the GPL applies to versions of the
|
||||
dnl Autoconf Macro released by this project. When you make and
|
||||
dnl distribute a modified version of the Autoconf Macro, you may extend
|
||||
dnl this special exception to the GPL to apply to your modified version as
|
||||
dnl well.
|
||||
|
||||
dnl Check if FLAG in ENV-VAR is supported by compiler and append it
|
||||
dnl to WHERE-TO-APPEND variable. Note that we invert -Wno-* checks to
|
||||
dnl -W* as gcc cannot test for negated warnings. If a C snippet is passed,
|
||||
dnl use it, otherwise use a simple main() definition that just returns 0.
|
||||
dnl CC_CHECK_FLAG_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG], [C-SNIPPET])
|
||||
|
||||
AC_DEFUN([CC_CHECK_FLAG_APPEND], [
|
||||
AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2],
|
||||
AS_TR_SH([cc_cv_$2_$3]),
|
||||
[eval "AS_TR_SH([cc_save_$2])='${$2}'"
|
||||
eval "AS_TR_SH([$2])='${cc_save_$2} -Werror `echo "$3" | sed 's/^-Wno-/-W/'`'"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE(ifelse([$4], [],
|
||||
[int main(void) { return 0; } ],
|
||||
[$4]))],
|
||||
[eval "AS_TR_SH([cc_cv_$2_$3])='yes'"],
|
||||
[eval "AS_TR_SH([cc_cv_$2_$3])='no'"])
|
||||
eval "AS_TR_SH([$2])='$cc_save_$2'"])
|
||||
|
||||
AS_IF([eval test x$]AS_TR_SH([cc_cv_$2_$3])[ = xyes],
|
||||
[eval "$1='${$1} $3'"])
|
||||
])
|
||||
|
||||
dnl CC_CHECK_FLAGS_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG1 FLAG2], [C-SNIPPET])
|
||||
AC_DEFUN([CC_CHECK_FLAGS_APPEND], [
|
||||
for flag in [$3]; do
|
||||
CC_CHECK_FLAG_APPEND([$1], [$2], $flag, [$4])
|
||||
done
|
||||
])
|
||||
|
||||
dnl Check if the flag is supported by linker (cacheable)
|
||||
dnl CC_CHECK_LDFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
|
||||
|
||||
AC_DEFUN([CC_CHECK_LDFLAGS], [
|
||||
AC_CACHE_CHECK([if $CC supports $1 flag],
|
||||
AS_TR_SH([cc_cv_ldflags_$1]),
|
||||
[ac_save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $1"
|
||||
AC_LINK_IFELSE([int main() { return 1; }],
|
||||
[eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"],
|
||||
[eval "AS_TR_SH([cc_cv_ldflags_$1])="])
|
||||
LDFLAGS="$ac_save_LDFLAGS"
|
||||
])
|
||||
|
||||
AS_IF([eval test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes],
|
||||
[$2], [$3])
|
||||
])
|
||||
|
||||
dnl define the LDFLAGS_NOUNDEFINED variable with the correct value for
|
||||
dnl the current linker to avoid undefined references in a shared object.
|
||||
AC_DEFUN([CC_NOUNDEFINED], [
|
||||
dnl We check $host for which systems to enable this for.
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
|
||||
case $host in
|
||||
dnl FreeBSD (et al.) does not complete linking for shared objects when pthreads
|
||||
dnl are requested, as different implementations are present; to avoid problems
|
||||
dnl use -Wl,-z,defs only for those platform not behaving this way.
|
||||
*-freebsd* | *-openbsd*) ;;
|
||||
*)
|
||||
dnl First of all check for the --no-undefined variant of GNU ld. This allows
|
||||
dnl for a much more readable command line, so that people can understand what
|
||||
dnl it does without going to look for what the heck -z defs does.
|
||||
for possible_flags in "-Wl,--no-undefined" "-Wl,-z,defs"; do
|
||||
CC_CHECK_LDFLAGS([$possible_flags], [LDFLAGS_NOUNDEFINED="$possible_flags"])
|
||||
break
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST([LDFLAGS_NOUNDEFINED])
|
||||
])
|
||||
|
||||
dnl Check for a -Werror flag or equivalent. -Werror is the GCC
|
||||
dnl and ICC flag that tells the compiler to treat all the warnings
|
||||
dnl as fatal. We usually need this option to make sure that some
|
||||
dnl constructs (like attributes) are not simply ignored.
|
||||
dnl
|
||||
dnl Other compilers don't support -Werror per se, but they support
|
||||
dnl an equivalent flag:
|
||||
dnl - Sun Studio compiler supports -errwarn=%all
|
||||
AC_DEFUN([CC_CHECK_WERROR], [
|
||||
AC_CACHE_CHECK(
|
||||
[for $CC way to treat warnings as errors],
|
||||
[cc_cv_werror],
|
||||
[CC_CHECK_CFLAGS_SILENT([-Werror], [cc_cv_werror=-Werror],
|
||||
[CC_CHECK_CFLAGS_SILENT([-errwarn=%all], [cc_cv_werror=-errwarn=%all])])
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_CHECK_ATTRIBUTE], [
|
||||
AC_REQUIRE([CC_CHECK_WERROR])
|
||||
AC_CACHE_CHECK([if $CC supports __attribute__(( ifelse([$2], , [$1], [$2]) ))],
|
||||
AS_TR_SH([cc_cv_attribute_$1]),
|
||||
[ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $cc_cv_werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([$3])],
|
||||
[eval "AS_TR_SH([cc_cv_attribute_$1])='yes'"],
|
||||
[eval "AS_TR_SH([cc_cv_attribute_$1])='no'"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
])
|
||||
|
||||
AS_IF([eval test x$]AS_TR_SH([cc_cv_attribute_$1])[ = xyes],
|
||||
[AC_DEFINE(
|
||||
AS_TR_CPP([SUPPORT_ATTRIBUTE_$1]), 1,
|
||||
[Define this if the compiler supports __attribute__(( ifelse([$2], , [$1], [$2]) ))]
|
||||
)
|
||||
$4],
|
||||
[$5])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_ATTRIBUTE_CONSTRUCTOR], [
|
||||
CC_CHECK_ATTRIBUTE(
|
||||
[constructor],,
|
||||
[void __attribute__((constructor)) ctor() { int a; }],
|
||||
[$1], [$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_ATTRIBUTE_FORMAT], [
|
||||
CC_CHECK_ATTRIBUTE(
|
||||
[format], [format(printf, n, n)],
|
||||
[void __attribute__((format(printf, 1, 2))) printflike(const char *fmt, ...) { fmt = (void *)0; }],
|
||||
[$1], [$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_ATTRIBUTE_FORMAT_ARG], [
|
||||
CC_CHECK_ATTRIBUTE(
|
||||
[format_arg], [format_arg(printf)],
|
||||
[char *__attribute__((format_arg(1))) gettextlike(const char *fmt) { fmt = (void *)0; }],
|
||||
[$1], [$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_ATTRIBUTE_VISIBILITY], [
|
||||
CC_CHECK_ATTRIBUTE(
|
||||
[visibility_$1], [visibility("$1")],
|
||||
[void __attribute__((visibility("$1"))) $1_function() { }],
|
||||
[$2], [$3])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_ATTRIBUTE_NONNULL], [
|
||||
CC_CHECK_ATTRIBUTE(
|
||||
[nonnull], [nonnull()],
|
||||
[void __attribute__((nonnull())) some_function(void *foo, void *bar) { foo = (void*)0; bar = (void*)0; }],
|
||||
[$1], [$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_ATTRIBUTE_UNUSED], [
|
||||
CC_CHECK_ATTRIBUTE(
|
||||
[unused], ,
|
||||
[void some_function(void *foo, __attribute__((unused)) void *bar);],
|
||||
[$1], [$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_ATTRIBUTE_SENTINEL], [
|
||||
CC_CHECK_ATTRIBUTE(
|
||||
[sentinel], ,
|
||||
[void some_function(void *foo, ...) __attribute__((sentinel));],
|
||||
[$1], [$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_ATTRIBUTE_DEPRECATED], [
|
||||
CC_CHECK_ATTRIBUTE(
|
||||
[deprecated], ,
|
||||
[void some_function(void *foo, ...) __attribute__((deprecated));],
|
||||
[$1], [$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_ATTRIBUTE_ALIAS], [
|
||||
CC_CHECK_ATTRIBUTE(
|
||||
[alias], [weak, alias],
|
||||
[void other_function(void *foo) { }
|
||||
void some_function(void *foo) __attribute__((weak, alias("other_function")));],
|
||||
[$1], [$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_ATTRIBUTE_MALLOC], [
|
||||
CC_CHECK_ATTRIBUTE(
|
||||
[malloc], ,
|
||||
[void * __attribute__((malloc)) my_alloc(int n);],
|
||||
[$1], [$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_ATTRIBUTE_PACKED], [
|
||||
CC_CHECK_ATTRIBUTE(
|
||||
[packed], ,
|
||||
[struct astructure { char a; int b; long c; void *d; } __attribute__((packed));],
|
||||
[$1], [$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_ATTRIBUTE_CONST], [
|
||||
CC_CHECK_ATTRIBUTE(
|
||||
[const], ,
|
||||
[int __attribute__((const)) twopow(int n) { return 1 << n; } ],
|
||||
[$1], [$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_FLAG_VISIBILITY], [
|
||||
AC_REQUIRE([CC_CHECK_WERROR])
|
||||
AC_CACHE_CHECK([if $CC supports -fvisibility=hidden],
|
||||
[cc_cv_flag_visibility],
|
||||
[cc_flag_visibility_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $cc_cv_werror"
|
||||
CC_CHECK_CFLAGS_SILENT([-fvisibility=hidden],
|
||||
cc_cv_flag_visibility='yes',
|
||||
cc_cv_flag_visibility='no')
|
||||
CFLAGS="$cc_flag_visibility_save_CFLAGS"])
|
||||
|
||||
AS_IF([test "x$cc_cv_flag_visibility" = "xyes"],
|
||||
[AC_DEFINE([SUPPORT_FLAG_VISIBILITY], 1,
|
||||
[Define this if the compiler supports the -fvisibility flag])
|
||||
$1],
|
||||
[$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_FUNC_EXPECT], [
|
||||
AC_REQUIRE([CC_CHECK_WERROR])
|
||||
AC_CACHE_CHECK([if compiler has __builtin_expect function],
|
||||
[cc_cv_func_expect],
|
||||
[ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $cc_cv_werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
|
||||
[int some_function() {
|
||||
int a = 3;
|
||||
return (int)__builtin_expect(a, 3);
|
||||
}])],
|
||||
[cc_cv_func_expect=yes],
|
||||
[cc_cv_func_expect=no])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
])
|
||||
|
||||
AS_IF([test "x$cc_cv_func_expect" = "xyes"],
|
||||
[AC_DEFINE([SUPPORT__BUILTIN_EXPECT], 1,
|
||||
[Define this if the compiler supports __builtin_expect() function])
|
||||
$1],
|
||||
[$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([CC_ATTRIBUTE_ALIGNED], [
|
||||
AC_REQUIRE([CC_CHECK_WERROR])
|
||||
AC_CACHE_CHECK([highest __attribute__ ((aligned ())) supported],
|
||||
[cc_cv_attribute_aligned],
|
||||
[ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $cc_cv_werror"
|
||||
for cc_attribute_align_try in 64 32 16 8 4 2; do
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
int main() {
|
||||
static char c __attribute__ ((aligned($cc_attribute_align_try))) = 0;
|
||||
return c;
|
||||
}])], [cc_cv_attribute_aligned=$cc_attribute_align_try; break])
|
||||
done
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
])
|
||||
|
||||
if test "x$cc_cv_attribute_aligned" != "x"; then
|
||||
AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX], [$cc_cv_attribute_aligned],
|
||||
[Define the highest alignment supported])
|
||||
fi
|
||||
])
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_lib_readline.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_LIB_READLINE
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Searches for a readline compatible library. If found, defines
|
||||
# `HAVE_LIBREADLINE'. If the found library has the `add_history' function,
|
||||
# sets also `HAVE_READLINE_HISTORY'. Also checks for the locations of the
|
||||
# necessary include files and sets `HAVE_READLINE_H' or
|
||||
# `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
|
||||
# 'HAVE_HISTORY_H' if the corresponding include files exists.
|
||||
#
|
||||
# The libraries that may be readline compatible are `libedit',
|
||||
# `libeditline' and `libreadline'. Sometimes we need to link a termcap
|
||||
# library for readline to work, this macro tests these cases too by trying
|
||||
# to link with `libtermcap', `libcurses' or `libncurses' before giving up.
|
||||
#
|
||||
# Here is an example of how to use the information provided by this macro
|
||||
# to perform the necessary includes or declarations in a C file:
|
||||
#
|
||||
# #ifdef HAVE_LIBREADLINE
|
||||
# # if defined(HAVE_READLINE_READLINE_H)
|
||||
# # include <readline/readline.h>
|
||||
# # elif defined(HAVE_READLINE_H)
|
||||
# # include <readline.h>
|
||||
# # else /* !defined(HAVE_READLINE_H) */
|
||||
# extern char *readline ();
|
||||
# # endif /* !defined(HAVE_READLINE_H) */
|
||||
# char *cmdline = NULL;
|
||||
# #else /* !defined(HAVE_READLINE_READLINE_H) */
|
||||
# /* no readline */
|
||||
# #endif /* HAVE_LIBREADLINE */
|
||||
#
|
||||
# #ifdef HAVE_READLINE_HISTORY
|
||||
# # if defined(HAVE_READLINE_HISTORY_H)
|
||||
# # include <readline/history.h>
|
||||
# # elif defined(HAVE_HISTORY_H)
|
||||
# # include <history.h>
|
||||
# # else /* !defined(HAVE_HISTORY_H) */
|
||||
# extern void add_history ();
|
||||
# extern int write_history ();
|
||||
# extern int read_history ();
|
||||
# # endif /* defined(HAVE_READLINE_HISTORY_H) */
|
||||
# /* no history */
|
||||
# #endif /* HAVE_READLINE_HISTORY */
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Ville Laurikari <vl@iki.fi>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 8
|
||||
|
||||
AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE])
|
||||
AC_DEFUN([AX_LIB_READLINE], [
|
||||
|
||||
AC_ARG_WITH(readline,
|
||||
AS_HELP_STRING([--with-readline=auto|libreadline|libedit|none], [Using libreadline (auto) or libedit]),
|
||||
[],
|
||||
[with_readline=auto])
|
||||
|
||||
if test "$with_readline" != "none"; then
|
||||
|
||||
AC_CACHE_CHECK([for a readline compatible library],
|
||||
ax_cv_lib_readline, [
|
||||
ORIG_LIBS="$LIBS"
|
||||
|
||||
if test "$with_readline" = "libreadline"; then
|
||||
search_readlines="readline"
|
||||
elif test "$with_readline" = "libedit"; then
|
||||
search_readlines="edit"
|
||||
elif test "$with_readline" = "auto"; then
|
||||
search_readlines="readline edit"
|
||||
else
|
||||
AC_MSG_ERROR([invalid --with-readline option. Valid options are --with-readline=auto|libreadline|libedit|none])
|
||||
fi
|
||||
|
||||
for readline_lib in $search_readlines; do
|
||||
# prefer ncurses since we use it for nmtui too
|
||||
for termcap_lib in "" termcap curses ncurses; do
|
||||
if test -z "$termcap_lib"; then
|
||||
TRY_LIB="-l$readline_lib"
|
||||
else
|
||||
TRY_LIB="-l$readline_lib -l$termcap_lib"
|
||||
fi
|
||||
LIBS="$ORIG_LIBS $TRY_LIB"
|
||||
AC_LINK_IFELSE([AC_LANG_CALL([], [readline])], [ax_cv_lib_readline="$TRY_LIB"])
|
||||
if test -n "$ax_cv_lib_readline"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -n "$ax_cv_lib_readline"; then
|
||||
if test "$with_readline" = auto; then
|
||||
if test "$readline_lib" = readline; then
|
||||
with_readline=libreadline
|
||||
else
|
||||
with_readline=libedit
|
||||
fi
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$ax_cv_lib_readline"; then
|
||||
if test "$with_readline" != auto; then
|
||||
AC_MSG_ERROR([libreadline not found for --with-readline=$with_readline"])
|
||||
fi
|
||||
with_readline=none
|
||||
ax_cv_lib_readline="no"
|
||||
fi
|
||||
LIBS="$ORIG_LIBS"
|
||||
])
|
||||
|
||||
if test "$ax_cv_lib_readline" != "no"; then
|
||||
READLINE_LIBS="$ax_cv_lib_readline"
|
||||
AC_SUBST(READLINE_LIBS)
|
||||
AC_DEFINE(HAVE_LIBREADLINE, 1,
|
||||
[Define if you have a readline compatible library])
|
||||
|
||||
if test "$with_readline" = "libedit"; then
|
||||
AC_DEFINE(HAVE_EDITLINE_READLINE, 1,
|
||||
[Explicitly set to 1 when libedit shall be used])
|
||||
else
|
||||
AC_DEFINE(HAVE_EDITLINE_READLINE, 0,
|
||||
[By default the libreadline is used as readline library])
|
||||
|
||||
fi
|
||||
|
||||
ORIG_LIBS="$LIBS"
|
||||
LIBS="$ORIG_LIBS $ax_cv_lib_readline"
|
||||
AC_CACHE_CHECK([whether readline supports history],
|
||||
ax_cv_lib_readline_history, [
|
||||
ax_cv_lib_readline_history="no"
|
||||
AC_LINK_IFELSE([AC_LANG_CALL([], [history_set_history_state])],
|
||||
[ax_cv_lib_readline_history="yes"])
|
||||
])
|
||||
LIBS=$ORIG_LIBS
|
||||
|
||||
if test "$ax_cv_lib_readline_history" = "yes"; then
|
||||
AC_DEFINE(HAVE_READLINE_HISTORY, 1,
|
||||
[Define if your readline library has \`history_set_history_state'])
|
||||
AC_CHECK_HEADERS(readline/history.h histedit.h)
|
||||
else
|
||||
AC_DEFINE(HAVE_READLINE_HISTORY, 0,
|
||||
[Explicitly set to 0 when libreadline shall not be used])
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
])dnl
|
||||
522
m4/ax_pthread.m4
522
m4/ax_pthread.m4
|
|
@ -1,522 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro figures out how to build C programs using POSIX threads. It
|
||||
# sets the PTHREAD_LIBS output variable to the threads library and linker
|
||||
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
|
||||
# flags that are needed. (The user can also force certain compiler
|
||||
# flags/libs to be tested by setting these environment variables.)
|
||||
#
|
||||
# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is
|
||||
# needed for multi-threaded programs (defaults to the value of CC
|
||||
# respectively CXX otherwise). (This is necessary on e.g. AIX to use the
|
||||
# special cc_r/CC_r compiler alias.)
|
||||
#
|
||||
# NOTE: You are assumed to not only compile your program with these flags,
|
||||
# but also to link with them as well. For example, you might link with
|
||||
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||
# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||
#
|
||||
# If you are only building threaded programs, you may wish to use these
|
||||
# variables in your default LIBS, CFLAGS, and CC:
|
||||
#
|
||||
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
|
||||
# CC="$PTHREAD_CC"
|
||||
# CXX="$PTHREAD_CXX"
|
||||
#
|
||||
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
|
||||
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
|
||||
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
#
|
||||
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
|
||||
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
|
||||
# PTHREAD_CFLAGS.
|
||||
#
|
||||
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
|
||||
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
|
||||
# is not found. If ACTION-IF-FOUND is not specified, the default action
|
||||
# will define HAVE_PTHREAD.
|
||||
#
|
||||
# Please let the authors know if this macro fails on any platform, or if
|
||||
# you have any other suggestions or comments. This macro was based on work
|
||||
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
|
||||
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
|
||||
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
|
||||
# grateful for the helpful feedback of numerous users.
|
||||
#
|
||||
# Updated for Autoconf 2.68 by Daniel Richard G.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
|
||||
# Copyright (c) 2019 Marc Stevens <marc.stevens@cwi.nl>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 30
|
||||
|
||||
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
|
||||
AC_DEFUN([AX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_TARGET])
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_PROG_SED])
|
||||
AC_LANG_PUSH([C])
|
||||
ax_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
# requires special compiler flags (e.g. on Tru64 or Sequent).
|
||||
# It gets checked for in the link test anyway.
|
||||
|
||||
# First of all, check if the user has set any of the PTHREAD_LIBS,
|
||||
# etcetera environment variables, and if threads linking works using
|
||||
# them:
|
||||
if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
|
||||
ax_pthread_save_CC="$CC"
|
||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||
ax_pthread_save_LIBS="$LIBS"
|
||||
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
|
||||
AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"])
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
|
||||
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
|
||||
AC_MSG_RESULT([$ax_pthread_ok])
|
||||
if test "x$ax_pthread_ok" = "xno"; then
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
fi
|
||||
CC="$ax_pthread_save_CC"
|
||||
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||
LIBS="$ax_pthread_save_LIBS"
|
||||
fi
|
||||
|
||||
# We must check for the threads library under a number of different
|
||||
# names; the ordering is very important because some systems
|
||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||
# libraries is broken (non-POSIX).
|
||||
|
||||
# Create a list of thread flags to try. Items with a "," contain both
|
||||
# C compiler flags (before ",") and linker flags (after ","). Other items
|
||||
# starting with a "-" are C compiler flags, and remaining items are
|
||||
# library names, except for "none" which indicates that we try without
|
||||
# any flags at all, and "pthread-config" which is a program returning
|
||||
# the flags for the Pth emulation library.
|
||||
|
||||
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
|
||||
# The ordering *is* (sometimes) important. Some notes on the
|
||||
# individual items follow:
|
||||
|
||||
# pthreads: AIX (must check this before -lpthread)
|
||||
# none: in case threads are in libc; should be tried before -Kthread and
|
||||
# other compiler flags to prevent continual compiler warnings
|
||||
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
||||
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
|
||||
# (Note: HP C rejects this with "bad form for `-t' option")
|
||||
# -pthreads: Solaris/gcc (Note: HP C also rejects)
|
||||
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||
# doesn't hurt to check since this sometimes defines pthreads and
|
||||
# -D_REENTRANT too), HP C (must be checked before -lpthread, which
|
||||
# is present but should not be used directly; and before -mthreads,
|
||||
# because the compiler interprets this as "-mt" + "-hreads")
|
||||
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||
# pthread: Linux, etcetera
|
||||
# --thread-safe: KAI C++
|
||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||
|
||||
case $target_os in
|
||||
|
||||
freebsd*)
|
||||
|
||||
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||
|
||||
ax_pthread_flags="-kthread lthread $ax_pthread_flags"
|
||||
;;
|
||||
|
||||
hpux*)
|
||||
|
||||
# From the cc(1) man page: "[-mt] Sets various -D flags to enable
|
||||
# multi-threading and also sets -lpthread."
|
||||
|
||||
ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
|
||||
;;
|
||||
|
||||
openedition*)
|
||||
|
||||
# IBM z/OS requires a feature-test macro to be defined in order to
|
||||
# enable POSIX threads at all, so give the user a hint if this is
|
||||
# not set. (We don't define these ourselves, as they can affect
|
||||
# other portions of the system API in unpredictable ways.)
|
||||
|
||||
AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
|
||||
[
|
||||
# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
|
||||
AX_PTHREAD_ZOS_MISSING
|
||||
# endif
|
||||
],
|
||||
[AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
|
||||
;;
|
||||
|
||||
solaris*)
|
||||
|
||||
# On Solaris (at least, for some versions), libc contains stubbed
|
||||
# (non-functional) versions of the pthreads routines, so link-based
|
||||
# tests will erroneously succeed. (N.B.: The stubs are missing
|
||||
# pthread_cleanup_push, or rather a function called by this macro,
|
||||
# so we could check for that, but who knows whether they'll stub
|
||||
# that too in a future libc.) So we'll check first for the
|
||||
# standard Solaris way of linking pthreads (-mt -lpthread).
|
||||
|
||||
ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Are we compiling with Clang?
|
||||
|
||||
AC_CACHE_CHECK([whether $CC is Clang],
|
||||
[ax_cv_PTHREAD_CLANG],
|
||||
[ax_cv_PTHREAD_CLANG=no
|
||||
# Note that Autoconf sets GCC=yes for Clang as well as GCC
|
||||
if test "x$GCC" = "xyes"; then
|
||||
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
|
||||
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
|
||||
# if defined(__clang__) && defined(__llvm__)
|
||||
AX_PTHREAD_CC_IS_CLANG
|
||||
# endif
|
||||
],
|
||||
[ax_cv_PTHREAD_CLANG=yes])
|
||||
fi
|
||||
])
|
||||
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
|
||||
|
||||
|
||||
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
|
||||
|
||||
# Note that for GCC and Clang -pthread generally implies -lpthread,
|
||||
# except when -nostdlib is passed.
|
||||
# This is problematic using libtool to build C++ shared libraries with pthread:
|
||||
# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
|
||||
# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
|
||||
# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
|
||||
# To solve this, first try -pthread together with -lpthread for GCC
|
||||
|
||||
AS_IF([test "x$GCC" = "xyes"],
|
||||
[ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"])
|
||||
|
||||
# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
|
||||
|
||||
AS_IF([test "x$ax_pthread_clang" = "xyes"],
|
||||
[ax_pthread_flags="-pthread,-lpthread -pthread"])
|
||||
|
||||
|
||||
# The presence of a feature test macro requesting re-entrant function
|
||||
# definitions is, on some systems, a strong hint that pthreads support is
|
||||
# correctly enabled
|
||||
|
||||
case $target_os in
|
||||
darwin* | hpux* | linux* | osf* | solaris*)
|
||||
ax_pthread_check_macro="_REENTRANT"
|
||||
;;
|
||||
|
||||
aix*)
|
||||
ax_pthread_check_macro="_THREAD_SAFE"
|
||||
;;
|
||||
|
||||
*)
|
||||
ax_pthread_check_macro="--"
|
||||
;;
|
||||
esac
|
||||
AS_IF([test "x$ax_pthread_check_macro" = "x--"],
|
||||
[ax_pthread_check_cond=0],
|
||||
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
|
||||
|
||||
|
||||
if test "x$ax_pthread_ok" = "xno"; then
|
||||
for ax_pthread_try_flag in $ax_pthread_flags; do
|
||||
|
||||
case $ax_pthread_try_flag in
|
||||
none)
|
||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||
;;
|
||||
|
||||
*,*)
|
||||
PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
|
||||
PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
|
||||
AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"])
|
||||
;;
|
||||
|
||||
-*)
|
||||
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
|
||||
PTHREAD_CFLAGS="$ax_pthread_try_flag"
|
||||
;;
|
||||
|
||||
pthread-config)
|
||||
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
|
||||
AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
|
||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
|
||||
PTHREAD_LIBS="-l$ax_pthread_try_flag"
|
||||
;;
|
||||
esac
|
||||
|
||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||
ax_pthread_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
|
||||
# Check for various functions. We must include pthread.h,
|
||||
# since some functions may be macros. (On the Sequent, we
|
||||
# need a special flag -Kthread to make this header compile.)
|
||||
# We check for pthread_join because it is in -lpthread on IRIX
|
||||
# while pthread_create is in libc. We check for pthread_attr_init
|
||||
# due to DEC craziness with -lpthreads. We check for
|
||||
# pthread_cleanup_push because it is one of the few pthread
|
||||
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||
# We try pthread_create on general principles.
|
||||
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
|
||||
# if $ax_pthread_check_cond
|
||||
# error "$ax_pthread_check_macro must be defined"
|
||||
# endif
|
||||
static void *some_global = NULL;
|
||||
static void routine(void *a)
|
||||
{
|
||||
/* To avoid any unused-parameter or
|
||||
unused-but-set-parameter warning. */
|
||||
some_global = a;
|
||||
}
|
||||
static void *start_routine(void *a) { return a; }],
|
||||
[pthread_t th; pthread_attr_t attr;
|
||||
pthread_create(&th, 0, start_routine, 0);
|
||||
pthread_join(th, 0);
|
||||
pthread_attr_init(&attr);
|
||||
pthread_cleanup_push(routine, 0);
|
||||
pthread_cleanup_pop(0) /* ; */])],
|
||||
[ax_pthread_ok=yes],
|
||||
[])
|
||||
|
||||
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||
LIBS="$ax_pthread_save_LIBS"
|
||||
|
||||
AC_MSG_RESULT([$ax_pthread_ok])
|
||||
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
|
||||
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Clang needs special handling, because older versions handle the -pthread
|
||||
# option in a rather... idiosyncratic way
|
||||
|
||||
if test "x$ax_pthread_clang" = "xyes"; then
|
||||
|
||||
# Clang takes -pthread; it has never supported any other flag
|
||||
|
||||
# (Note 1: This will need to be revisited if a system that Clang
|
||||
# supports has POSIX threads in a separate library. This tends not
|
||||
# to be the way of modern systems, but it's conceivable.)
|
||||
|
||||
# (Note 2: On some systems, notably Darwin, -pthread is not needed
|
||||
# to get POSIX threads support; the API is always present and
|
||||
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
|
||||
# -pthread does define _REENTRANT, and while the Darwin headers
|
||||
# ignore this macro, third-party headers might not.)
|
||||
|
||||
# However, older versions of Clang make a point of warning the user
|
||||
# that, in an invocation where only linking and no compilation is
|
||||
# taking place, the -pthread option has no effect ("argument unused
|
||||
# during compilation"). They expect -pthread to be passed in only
|
||||
# when source code is being compiled.
|
||||
#
|
||||
# Problem is, this is at odds with the way Automake and most other
|
||||
# C build frameworks function, which is that the same flags used in
|
||||
# compilation (CFLAGS) are also used in linking. Many systems
|
||||
# supported by AX_PTHREAD require exactly this for POSIX threads
|
||||
# support, and in fact it is often not straightforward to specify a
|
||||
# flag that is used only in the compilation phase and not in
|
||||
# linking. Such a scenario is extremely rare in practice.
|
||||
#
|
||||
# Even though use of the -pthread flag in linking would only print
|
||||
# a warning, this can be a nuisance for well-run software projects
|
||||
# that build with -Werror. So if the active version of Clang has
|
||||
# this misfeature, we search for an option to squash it.
|
||||
|
||||
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
|
||||
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
|
||||
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
|
||||
# Create an alternate version of $ac_link that compiles and
|
||||
# links in two steps (.c -> .o, .o -> exe) instead of one
|
||||
# (.c -> exe), because the warning occurs only in the second
|
||||
# step
|
||||
ax_pthread_save_ac_link="$ac_link"
|
||||
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
|
||||
ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"`
|
||||
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
|
||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
|
||||
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
|
||||
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
|
||||
ac_link="$ax_pthread_save_ac_link"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
||||
[ac_link="$ax_pthread_2step_ac_link"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
||||
[break])
|
||||
])
|
||||
done
|
||||
ac_link="$ax_pthread_save_ac_link"
|
||||
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
|
||||
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
|
||||
])
|
||||
|
||||
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
|
||||
no | unknown) ;;
|
||||
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
|
||||
esac
|
||||
|
||||
fi # $ax_pthread_clang = yes
|
||||
|
||||
|
||||
|
||||
# Various other checks:
|
||||
if test "x$ax_pthread_ok" = "xyes"; then
|
||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||
ax_pthread_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
|
||||
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||
AC_CACHE_CHECK([for joinable pthread attribute],
|
||||
[ax_cv_PTHREAD_JOINABLE_ATTR],
|
||||
[ax_cv_PTHREAD_JOINABLE_ATTR=unknown
|
||||
for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
|
||||
[int attr = $ax_pthread_attr; return attr /* ; */])],
|
||||
[ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
|
||||
[])
|
||||
done
|
||||
])
|
||||
AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
|
||||
test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
|
||||
test "x$ax_pthread_joinable_attr_defined" != "xyes"],
|
||||
[AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
|
||||
[$ax_cv_PTHREAD_JOINABLE_ATTR],
|
||||
[Define to necessary symbol if this constant
|
||||
uses a non-standard name on your system.])
|
||||
ax_pthread_joinable_attr_defined=yes
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK([whether more special flags are required for pthreads],
|
||||
[ax_cv_PTHREAD_SPECIAL_FLAGS],
|
||||
[ax_cv_PTHREAD_SPECIAL_FLAGS=no
|
||||
case $target_os in
|
||||
solaris*)
|
||||
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
|
||||
;;
|
||||
esac
|
||||
])
|
||||
AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
|
||||
test "x$ax_pthread_special_flags_added" != "xyes"],
|
||||
[PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
|
||||
ax_pthread_special_flags_added=yes])
|
||||
|
||||
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
|
||||
[[int i = PTHREAD_PRIO_INHERIT;
|
||||
return i;]])],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=no])
|
||||
])
|
||||
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
|
||||
test "x$ax_pthread_prio_inherit_defined" != "xyes"],
|
||||
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
|
||||
ax_pthread_prio_inherit_defined=yes
|
||||
])
|
||||
|
||||
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||
LIBS="$ax_pthread_save_LIBS"
|
||||
|
||||
# More AIX lossage: compile with *_r variant
|
||||
if test "x$GCC" != "xyes"; then
|
||||
case $target_os in
|
||||
aix*)
|
||||
AS_CASE(["x/$CC"],
|
||||
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
|
||||
[#handle absolute path differently from PATH based program lookup
|
||||
AS_CASE(["x$CC"],
|
||||
[x/*],
|
||||
[
|
||||
AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])
|
||||
AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])])
|
||||
],
|
||||
[
|
||||
AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])
|
||||
AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])])
|
||||
]
|
||||
)
|
||||
])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
|
||||
test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
|
||||
|
||||
AC_SUBST([PTHREAD_LIBS])
|
||||
AC_SUBST([PTHREAD_CFLAGS])
|
||||
AC_SUBST([PTHREAD_CC])
|
||||
AC_SUBST([PTHREAD_CXX])
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test "x$ax_pthread_ok" = "xyes"; then
|
||||
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
|
||||
:
|
||||
else
|
||||
ax_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])dnl AX_PTHREAD
|
||||
|
|
@ -1,227 +0,0 @@
|
|||
AC_DEFUN([_NM_COMPILER_FLAG], [
|
||||
CFLAGS_SAVED="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $GLIB_CFLAGS -Werror $1"
|
||||
AC_MSG_CHECKING([whether $1 works as expected])
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], [
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$2]])], [
|
||||
AC_MSG_RESULT(yes)
|
||||
CFLAGS="$CFLAGS_SAVED"
|
||||
$3
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
CFLAGS="$CFLAGS_SAVED"
|
||||
$4
|
||||
])
|
||||
],[
|
||||
AC_MSG_RESULT(not supported)
|
||||
CFLAGS="$CFLAGS_SAVED"
|
||||
])
|
||||
])
|
||||
|
||||
dnl Check whether a particular compiler flag is supported,
|
||||
dnl append it to the specified variable if the check succeeds.
|
||||
dnl NM_COMPILER_FLAG([ENV-VAR], [FLAG], [ACTION-IF-SUPPORTED], [ACTION-IF-NOT-SUPPORTED])
|
||||
AC_DEFUN([NM_COMPILER_FLAG], [
|
||||
_NM_COMPILER_FLAG([$2], [], [
|
||||
eval "AS_TR_SH([$1])='$$1 $2'"
|
||||
$3
|
||||
], [$4])
|
||||
])
|
||||
|
||||
dnl Check whether a particular warning is supported. If yes, the flag
|
||||
dnl is appended to [ENV-VAR].
|
||||
dnl NM_COMPILER_WARNING_FLAG([ENV-VAR], [WARNING])
|
||||
AC_DEFUN([NM_COMPILER_WARNING_FLAG], [
|
||||
dnl "-Wno-*" requires special handling, see https://gcc.gnu.org/wiki/FAQ#wnowarning.
|
||||
_NM_COMPILER_FLAG([-Wall $(printf '%s' "$2" | sed -e 's/^-W\(no-\|no-error=\)/-W/')], [], [eval "AS_TR_SH([$1])='$$1 $2'"], [])
|
||||
])
|
||||
|
||||
dnl Check whether a particular warning is not emitted with code provided,
|
||||
dnl append an option to disable the warning to a specified variable if the check fails.
|
||||
dnl Note that this always either adds -W$2 or -Wno-$2, depending on whether it's supported.
|
||||
dnl NM_COMPILER_WARNING([ENV-VAR], [WARNING], [C-SNIPPET])
|
||||
AC_DEFUN([NM_COMPILER_WARNING], [
|
||||
_NM_COMPILER_FLAG([-W$2], [$3], [eval "AS_TR_SH([$1])='$$1 -W$2'"], [eval "AS_TR_SH([$1])='$$1 -Wno-$2'"])
|
||||
])
|
||||
|
||||
dnl NM_COMPILER_WARNINGS([ENV-VAR], [MORE-WARNINGS])
|
||||
AC_DEFUN([NM_COMPILER_WARNINGS],
|
||||
[AC_ARG_ENABLE(more-warnings,
|
||||
AS_HELP_STRING([--enable-more-warnings], [Possible values: no/yes/error]),
|
||||
set_more_warnings="$enableval",set_more_warnings=$2)
|
||||
AC_MSG_CHECKING(for more warnings)
|
||||
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
|
||||
dnl This is enabled in clang by default, makes little sense,
|
||||
dnl and causes the build to abort with -Werror.
|
||||
CFLAGS_SAVED="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Qunused-arguments"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], eval "AS_TR_SH([$1])='$$1 -Qunused-arguments'", [])
|
||||
CFLAGS="$CFLAGS_SAVED"
|
||||
|
||||
dnl clang only warns about unknown warnings, unless
|
||||
dnl called with "-Werror=unknown-warning-option"
|
||||
dnl Test if the compiler supports that, and if it does
|
||||
dnl attach it to the CFLAGS.
|
||||
NM_COMPILER_WARNING([$1], [unknown-warning-option], [])
|
||||
|
||||
CFLAGS_MORE_WARNINGS="-Wall"
|
||||
|
||||
if test "x$enable_lto" = xyes; then
|
||||
dnl With LTO and optimizations enabled, gcc 10.2.1-1.fc32 is really
|
||||
dnl adamant to warn about correct uses of strncpy. Disable "-Wstringop-overflow".
|
||||
_CFLAGS_MORE_WARNINGS_DISABLE_LTO="-Wno-stringop-overflow"
|
||||
|
||||
dnl We want to build with "-Wmaybe-uninitialized" enabled. With LTO that
|
||||
dnl can easily lead to false positives. For manual testing, disable the
|
||||
dnl warning here by uncommenting the following line.
|
||||
dnl _CFLAGS_MORE_WARNINGS_DISABLE_LTO="$_CFLAGS_MORE_WARNINGS_DISABLE_LTO -Wno-error=maybe-uninitialized"
|
||||
else
|
||||
_CFLAGS_MORE_WARNINGS_DISABLE_LTO=
|
||||
fi
|
||||
|
||||
if test "x$set_more_warnings" = xerror; then
|
||||
CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS -Werror"
|
||||
fi
|
||||
|
||||
for option in \
|
||||
$_CFLAGS_MORE_WARNINGS_DISABLE_LTO \
|
||||
-Wall \
|
||||
-Wextra \
|
||||
-Wcast-align=strict \
|
||||
-Wdeclaration-after-statement \
|
||||
-Wfloat-equal \
|
||||
-Wformat-nonliteral \
|
||||
-Wformat-security \
|
||||
-Wimplicit-function-declaration \
|
||||
-Wimplicit-int \
|
||||
-Winit-self \
|
||||
-Wint-conversion \
|
||||
-Wlogical-op \
|
||||
-Wmissing-declarations \
|
||||
-Wmissing-include-dirs \
|
||||
-Wmissing-prototypes \
|
||||
-Wold-style-definition \
|
||||
-Wparentheses-equality \
|
||||
-Wpointer-arith \
|
||||
-Wshadow \
|
||||
-Wshift-negative-value \
|
||||
-Wstrict-prototypes \
|
||||
-Wtypedef-redefinition \
|
||||
-Wundef \
|
||||
-Wunknown-attributes \
|
||||
-Wvla \
|
||||
-Wno-duplicate-decl-specifier \
|
||||
-Wno-format-truncation \
|
||||
-Wno-format-y2k \
|
||||
-Wno-gnu-variable-sized-type-not-at-end \
|
||||
-Wno-missing-field-initializers \
|
||||
-Wno-pragmas \
|
||||
-Wno-sign-compare \
|
||||
-Wno-tautological-constant-out-of-range-compare \
|
||||
-Wno-unknown-pragmas \
|
||||
-Wno-unused-parameter \
|
||||
; do
|
||||
dnl GCC 4.4 does not warn when checking for -Wno-* flags (https://gcc.gnu.org/wiki/FAQ#wnowarning)
|
||||
_NM_COMPILER_FLAG([-Wall $(printf '%s' "$option" | sed -e 's/^-W\(no-\|no-error=\)/-W/')], [],
|
||||
[CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS $option"], [])
|
||||
done
|
||||
unset option
|
||||
|
||||
dnl Disable warnings triggered by known compiler problems
|
||||
|
||||
dnl https://bugzilla.gnome.org/show_bug.cgi?id=745821
|
||||
NM_COMPILER_WARNING([$1], [unknown-attributes], [#include <glib.h>])
|
||||
|
||||
dnl https://bugzilla.gnome.org/show_bug.cgi?id=744473
|
||||
NM_COMPILER_WARNING([$1], [typedef-redefinition], [#include <gio/gio.h>])
|
||||
|
||||
dnl https://llvm.org/bugs/show_bug.cgi?id=21614
|
||||
NM_COMPILER_WARNING([$1], [array-bounds],
|
||||
[#include <string.h>]
|
||||
[void f () { strcmp ("something", "0"); }]
|
||||
)
|
||||
|
||||
dnl https://llvm.org/bugs/show_bug.cgi?id=22949
|
||||
NM_COMPILER_WARNING([$1], [parentheses-equality],
|
||||
[#include <sys/wait.h>]
|
||||
[void f () { if (WIFCONTINUED(0)) return; }]
|
||||
)
|
||||
|
||||
dnl systemd-dhcp's log_internal macro and our handle_warn are sometimes
|
||||
dnl used in void context,u sometimes in int. Makes clang unhappy.
|
||||
NM_COMPILER_WARNING([$1], [unused-value],
|
||||
[#define yolo ({ (666 + 666); })]
|
||||
[int f () { int i = yolo; yolo; return i; }]
|
||||
)
|
||||
|
||||
dnl a new warning in gcc 8, glib 2.55 doesn't play nice yet
|
||||
dnl https://bugzilla.gnome.org/show_bug.cgi?id=793272
|
||||
NM_COMPILER_WARNING([$1], [cast-function-type],
|
||||
[#include <glib-object.h>]
|
||||
[typedef struct { GObject parent; } NMObject;]
|
||||
[typedef struct { GObjectClass parent; } NMObjectClass;]
|
||||
[static void nm_object_init (NMObject *object) { } ]
|
||||
[static void nm_object_class_init (NMObjectClass *object) { }]
|
||||
[G_DEFINE_TYPE (NMObject, nm_object, G_TYPE_OBJECT)]
|
||||
)
|
||||
|
||||
dnl clang started supporting -Wimplicit-fallthrough, but it does not
|
||||
dnl honor the code comments to suppress the warning. Disable the
|
||||
dnl warning with clang.
|
||||
dnl
|
||||
NM_COMPILER_WARNING([$1], [implicit-fallthrough],
|
||||
[int foo(int a);
|
||||
int foo(int a) {
|
||||
int r = 0;
|
||||
switch (a) {
|
||||
case 1:
|
||||
r++;
|
||||
/* fall-through */
|
||||
case 2:
|
||||
r++;
|
||||
break;
|
||||
}
|
||||
return r;
|
||||
}]
|
||||
)
|
||||
|
||||
eval "AS_TR_SH([$1])='$CFLAGS_MORE_WARNINGS $$1'"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([NM_LTO],
|
||||
[AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto], [Enable Link Time Optimization for smaller size [default=no]]))
|
||||
if (test "${enable_lto}" = "yes"); then
|
||||
CC_CHECK_FLAG_APPEND([lto_flags], [CFLAGS], [-flto -flto-partition=none])
|
||||
if (test -n "${lto_flags}"); then
|
||||
CFLAGS="-flto -flto-partition=none $CFLAGS"
|
||||
else
|
||||
AC_MSG_ERROR([Link Time Optimization -flto is not supported.])
|
||||
fi
|
||||
else
|
||||
enable_lto='no'
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([NM_LD_GC],
|
||||
[AC_ARG_ENABLE(ld-gc, AS_HELP_STRING([--enable-ld-gc], [Enable garbage collection of unused symbols on linking [default=auto]]))
|
||||
if (test "${enable_ld_gc}" != "no"); then
|
||||
CC_CHECK_FLAG_APPEND([ld_gc_flags], [CFLAGS], [-fdata-sections -ffunction-sections -Wl,--gc-sections])
|
||||
if (test -n "${ld_gc_flags}"); then
|
||||
enable_ld_gc="yes"
|
||||
CFLAGS="$ld_gc_flags $CFLAGS"
|
||||
else
|
||||
if (test "${enable_ld_gc}" = "yes"); then
|
||||
AC_MSG_ERROR([Unused symbol eviction requested but not supported.])
|
||||
else
|
||||
enable_ld_gc="no"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
dnl GIT_SHA_RECORD($1, $2)
|
||||
dnl
|
||||
dnl $1: the name of the assigned variable. For example NM_GIT_SHA,
|
||||
dnl NMA_GIT_SHA, LIBNL_GIT_SHA.
|
||||
dnl $2: by default, a define to config.h is added. This can be
|
||||
dnl suppressed by passing "no-config-h".
|
||||
dnl
|
||||
AC_DEFUN([GIT_SHA_RECORD], [
|
||||
m4_define([git_sha_record_v],
|
||||
[m4_esyscmd([ ( [ -d ./.git/ ] && [ "$(readlink -f ./.git/)" = "$(readlink -f "$(git rev-parse --git-dir 2>/dev/null)" 2>/dev/null)" ] && git rev-parse --verify -q HEAD 2>/dev/null ) || true ])])
|
||||
$1=git_sha_record_v
|
||||
if test ""$2"" != "no-config-h" ; then
|
||||
AC_DEFINE_UNQUOTED($1,"$$1",[git commit id of the original source code version])
|
||||
fi
|
||||
])
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
dnl GNOME_CODE_COVERAGE
|
||||
dnl
|
||||
dnl Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
|
||||
dnl included in the CFLAGS and LIBS/LDFLAGS variables of every build target
|
||||
dnl (program or library) which should be built with code coverage support.
|
||||
dnl Also defines GNOME_CODE_COVERAGE_RULES which should be substituted in your
|
||||
dnl Makefile; and $enable_code_coverage which can be used in subsequent
|
||||
dnl configure output.
|
||||
dnl
|
||||
dnl Note that all optimisation flags in CFLAGS must be disabled when code
|
||||
dnl coverage is enabled.
|
||||
dnl
|
||||
dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
|
||||
dnl This file is licenced under LGPLv2.1+.
|
||||
dnl
|
||||
dnl Usage example:
|
||||
dnl configure.ac:
|
||||
dnl GNOME_CODE_COVERAGE
|
||||
dnl
|
||||
dnl Makefile.am:
|
||||
dnl @GNOME_CODE_COVERAGE_RULES@
|
||||
dnl my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
|
||||
dnl my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
|
||||
dnl
|
||||
dnl This results in a “check-code-coverage” rule being added to any Makefile.am
|
||||
dnl which includes “@GNOME_CODE_COVERAGE_RULES@” (assuming the module has been
|
||||
dnl configured with --enable-code-coverage). Running `make check-code-coverage`
|
||||
dnl in that directory will run the module’s test suite (`make check`) and build
|
||||
dnl a code coverage report detailing the code which was touched, then print the
|
||||
dnl URI for the report.
|
||||
|
||||
AC_DEFUN([GNOME_CODE_COVERAGE],[
|
||||
dnl Check for --enable-code-coverage
|
||||
AC_MSG_CHECKING([whether to build with code coverage support])
|
||||
AC_ARG_ENABLE([code-coverage], AS_HELP_STRING([--enable-code-coverage], [Whether to enable code coverage support]),, enable_code_coverage=no)
|
||||
AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
|
||||
AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
|
||||
AC_MSG_RESULT($enable_code_coverage)
|
||||
|
||||
AS_IF([ test "$enable_code_coverage" = "yes" ], [
|
||||
dnl Check if gcc is being used
|
||||
AS_IF([ test "$GCC" = "no" ], [
|
||||
AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
|
||||
])
|
||||
|
||||
AC_CHECK_PROG([LCOV], [lcov], [lcov])
|
||||
AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
|
||||
|
||||
AS_IF([ test -z "$LCOV" ], [
|
||||
AC_MSG_ERROR([lcov is needed to enable code coverage reporting])
|
||||
])
|
||||
|
||||
AS_IF([ test -z "$GENHTML" ], [
|
||||
AC_MSG_ERROR([Could not find genhtml from the lcov package])
|
||||
])
|
||||
|
||||
dnl Build the code coverage flags
|
||||
CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
|
||||
CODE_COVERAGE_LDFLAGS="-lgcov"
|
||||
|
||||
AC_SUBST([CODE_COVERAGE_CFLAGS])
|
||||
AC_SUBST([CODE_COVERAGE_LDFLAGS])
|
||||
])
|
||||
|
||||
GNOME_CODE_COVERAGE_RULES='
|
||||
# Code coverage
|
||||
#
|
||||
# Optional:
|
||||
# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
|
||||
# (Default: $(top_builddir))
|
||||
# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
|
||||
# by lcov for code coverage. (Default:
|
||||
# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
|
||||
# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
|
||||
# reports to be created. (Default:
|
||||
# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
|
||||
# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the lcov instance.
|
||||
# (Default: empty)
|
||||
# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
|
||||
# instance. (Default: empty)
|
||||
# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
|
||||
#
|
||||
# The generated report will be titled using the $(PACKAGE_NAME) and
|
||||
# $(PACKAGE_VERSION). In order to add the current git hash to the title,
|
||||
# use the git-version-gen script, available online.
|
||||
|
||||
# Optional variables
|
||||
CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
|
||||
CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
|
||||
CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
|
||||
CODE_COVERAGE_LCOV_OPTIONS ?=
|
||||
CODE_COVERAGE_GENHTML_OPTIONS ?=
|
||||
CODE_COVERAGE_IGNORE_PATTERN ?=
|
||||
|
||||
code_coverage_quiet = $(code_coverage_quiet_$(V))
|
||||
code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
|
||||
code_coverage_quiet_0 = --quiet
|
||||
|
||||
# Use recursive makes in order to ignore errors during check
|
||||
check-code-coverage:
|
||||
ifeq ($(CODE_COVERAGE_ENABLED),yes)
|
||||
-$(MAKE) $(AM_MAKEFLAGS) -k check
|
||||
$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
|
||||
else
|
||||
@echo "Need to reconfigure with --enable-code-coverage"
|
||||
endif
|
||||
|
||||
# Capture code coverage data
|
||||
code-coverage-capture: code-coverage-capture-hook
|
||||
ifeq ($(CODE_COVERAGE_ENABLED),yes)
|
||||
$(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS)
|
||||
$(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)"
|
||||
-@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
|
||||
LANG=C $(GENHTML) $(code_coverage_quiet) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
|
||||
@echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
|
||||
else
|
||||
@echo "Need to reconfigure with --enable-code-coverage"
|
||||
endif
|
||||
|
||||
# Hook rule executed before code-coverage-capture, overridable by the user
|
||||
code-coverage-capture-hook:
|
||||
|
||||
ifeq ($(CODE_COVERAGE_ENABLED),yes)
|
||||
clean: code-coverage-clean
|
||||
code-coverage-clean:
|
||||
-$(LCOV) --directory $(top_builddir) -z
|
||||
-rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
|
||||
-find . -name "*.gcda" -o -name "*.gcov" -delete
|
||||
endif
|
||||
|
||||
GITIGNOREFILES ?=
|
||||
GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS ?=
|
||||
DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
|
||||
|
||||
.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
|
||||
'
|
||||
|
||||
AC_SUBST([GNOME_CODE_COVERAGE_RULES])
|
||||
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
|
||||
])
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
dnl Copyright 2009 Johan Dahlin
|
||||
dnl
|
||||
dnl This file is free software; the author(s) gives unlimited
|
||||
dnl permission to copy and/or distribute it, with or without
|
||||
dnl modifications, as long as this notice is preserved.
|
||||
dnl
|
||||
|
||||
# serial 1
|
||||
|
||||
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
|
||||
[
|
||||
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
|
||||
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
|
||||
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
|
||||
|
||||
dnl enable/disable introspection
|
||||
m4_if([$2], [require],
|
||||
[dnl
|
||||
enable_introspection=yes
|
||||
],[dnl
|
||||
AC_ARG_ENABLE(introspection,
|
||||
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
|
||||
[Enable introspection for this build]),,
|
||||
[enable_introspection=auto])
|
||||
])dnl
|
||||
|
||||
INTROSPECTION_SCANNER=
|
||||
INTROSPECTION_COMPILER=
|
||||
INTROSPECTION_GENERATE=
|
||||
INTROSPECTION_GIRDIR=
|
||||
INTROSPECTION_TYPELIBDIR=
|
||||
|
||||
if test "x$enable_introspection" = "xno"; then
|
||||
found_introspection="no"
|
||||
else
|
||||
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], [
|
||||
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
|
||||
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
|
||||
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
|
||||
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
|
||||
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
|
||||
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
|
||||
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
|
||||
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
|
||||
|
||||
AC_MSG_CHECKING([if $INTROSPECTION_SCANNER works])
|
||||
if CFLAGS="${CFLAGS} -Wno-error" "$INTROSPECTION_SCANNER" --namespace=test --library=c /dev/null --output /dev/null >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
|
||||
found_introspection=yes
|
||||
else
|
||||
found_introspection="no (compiler failure -- check config.log)"
|
||||
fi
|
||||
AC_MSG_RESULT([$found_introspection])
|
||||
], [found_introspection="no (not installed)"])
|
||||
|
||||
if test "x$enable_introspection" = "xyes"; then
|
||||
if test "x$found_introspection" != "xyes"; then
|
||||
AC_MSG_ERROR([introspection enabled but can't be used])
|
||||
fi
|
||||
elif test "x$enable_introspection" != "xauto"; then
|
||||
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(INTROSPECTION_SCANNER, 'CFLAGS="${CFLAGS} -Wno-error" '"$INTROSPECTION_SCANNER")
|
||||
AC_SUBST(INTROSPECTION_COMPILER)
|
||||
AC_SUBST(INTROSPECTION_GENERATE)
|
||||
AC_SUBST(INTROSPECTION_GIRDIR)
|
||||
AC_SUBST(INTROSPECTION_TYPELIBDIR)
|
||||
AC_SUBST(INTROSPECTION_CFLAGS)
|
||||
AC_SUBST(INTROSPECTION_LIBS)
|
||||
AC_SUBST(INTROSPECTION_MAKEFILE)
|
||||
|
||||
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
|
||||
])
|
||||
|
||||
|
||||
dnl Usage:
|
||||
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
|
||||
|
||||
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
|
||||
[
|
||||
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
|
||||
])
|
||||
|
||||
dnl Usage:
|
||||
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
|
||||
|
||||
|
||||
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
|
||||
[
|
||||
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
|
||||
])
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
dnl vala.m4
|
||||
dnl
|
||||
dnl Copyright 2012 Evan Nemerson
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library.
|
||||
|
||||
# VAPIGEN_CHECK([VERSION], [API_VERSION], [FOUND-INTROSPECTION])
|
||||
# --------------------------------------
|
||||
# Check that vapigen existence and version
|
||||
#
|
||||
# See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation
|
||||
AC_DEFUN([VAPIGEN_CHECK],
|
||||
[
|
||||
AC_BEFORE([GOBJECT_INTROSPECTION_CHECK],[$0])
|
||||
AC_BEFORE([GOBJECT_INTROSPECTION_REQUIRE],[$0])
|
||||
|
||||
AC_ARG_ENABLE([vala],
|
||||
AS_HELP_STRING([--enable-vala[=@<:@no/auto/yes@:>@]],
|
||||
[build Vala bindings [default=auto]]),,
|
||||
[enable_vala=auto])
|
||||
|
||||
AS_CASE([$enable_vala], [no], [],
|
||||
[yes], [
|
||||
AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
|
||||
AC_MSG_ERROR([Vala bindings require GObject Introspection])
|
||||
])
|
||||
], [auto], [
|
||||
AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
|
||||
enable_vala=no
|
||||
])
|
||||
], [
|
||||
AC_MSG_ERROR([Invalid argument passed to --enable-vala, should be one of @<:@no/auto/yes@:>@])
|
||||
])
|
||||
|
||||
AS_IF([test "x$2" = "x"], [
|
||||
vapigen_pkg_name=vapigen
|
||||
], [
|
||||
vapigen_pkg_name=vapigen-$2
|
||||
])
|
||||
AS_IF([test "x$1" = "x"], [
|
||||
vapigen_pkg="$vapigen_pkg_name"
|
||||
], [
|
||||
vapigen_pkg="$vapigen_pkg_name >= $1"
|
||||
])
|
||||
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
PKG_CHECK_EXISTS([$vapigen_pkg], [
|
||||
AS_IF([test "$enable_vala" = "auto"], [
|
||||
enable_vala=yes
|
||||
])
|
||||
], [
|
||||
AS_CASE([$enable_vala], [yes], [
|
||||
AC_MSG_ERROR([$vapigen_pkg not found])
|
||||
], [auto], [
|
||||
enable_vala=no
|
||||
])
|
||||
])
|
||||
|
||||
AS_CASE([$enable_vala],
|
||||
[yes], [
|
||||
VAPIGEN=`$PKG_CONFIG --variable=vapigen vapigen`
|
||||
VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir vapigen`/vala/Makefile.vapigen
|
||||
AS_IF([test "x$2" = "x"], [
|
||||
VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir vapigen`
|
||||
], [
|
||||
VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned vapigen`
|
||||
])
|
||||
])
|
||||
|
||||
AC_SUBST([VAPIGEN])
|
||||
AC_SUBST([VAPIGEN_VAPIDIR])
|
||||
AC_SUBST([VAPIGEN_MAKEFILE])
|
||||
|
||||
AM_CONDITIONAL(ENABLE_VAPIGEN, test "x$enable_vala" = "xyes")
|
||||
])
|
||||
|
|
@ -2,10 +2,9 @@
|
|||
|
||||
project(
|
||||
'NetworkManager', 'c',
|
||||
# NOTE: When incrementing version also:
|
||||
# - add corresponding NM_VERSION_x_y_z macros in
|
||||
# "src/libnm-core-public/nm-version-macros.h.in"
|
||||
# - update number in configure.ac
|
||||
# NOTE: When incrementing version also add corresponding
|
||||
# NM_VERSION_x_y_z macros in
|
||||
# "src/libnm-core-public/nm-version-macros.h.in"
|
||||
version: '1.51.0',
|
||||
license: 'GPL2+',
|
||||
default_options: [
|
||||
|
|
|
|||
|
|
@ -19,18 +19,14 @@ from __future__ import print_function
|
|||
#
|
||||
# For that, you'd setup your system correctly (see SETUP below) and then simply:
|
||||
#
|
||||
# $ NM_TEST_REGENERATE=1 make check-local-tests-client
|
||||
# # Or `NM_TEST_REGENERATE=1 make check -j 10`
|
||||
# $ meson -Ddocs=true --prefix=/tmp/nm1 build
|
||||
# $ ninja -C build
|
||||
# $ ninja -C build install
|
||||
# $ NM_TEST_REGENERATE=1 ninja -C build test
|
||||
# $ git diff ... ; git add ...
|
||||
# # The previous step regenerated the expected output. Review the changes
|
||||
# # and consider whether they are correct. Then commit the changes to git.
|
||||
#
|
||||
# With meson, you can do
|
||||
# $ meson -Ddocs=true --prefix=/tmp/nm1 build
|
||||
# $ ninja -C build
|
||||
# $ ninja -C build install
|
||||
# $ NM_TEST_REGENERATE=1 ninja -C build test
|
||||
#
|
||||
# Beware that you need to install the sources, and beware to choose a prefix that doesn't
|
||||
# mess up your system (see SETUP below).
|
||||
#
|
||||
|
|
@ -52,7 +48,7 @@ from __future__ import print_function
|
|||
# # Ensure that the built nmcli has Polish locale working. If not,
|
||||
# # you probably need to first `make install` the application at the
|
||||
# # correct prefix. Take care to configure the build with the desired
|
||||
# # prefix, like `./configure --prefix=/opt/tmp`. Usually, you want to avoid
|
||||
# # prefix, like `meson setup build --prefix=/opt/tmp`. Usually, you want to avoid
|
||||
# # using /usr as prefix, because that might overwrite files from your
|
||||
# # package management system.
|
||||
#
|
||||
|
|
|
|||
|
|
@ -13,24 +13,6 @@ die() {
|
|||
# plugins. Note that this depends on how NetworkManager and
|
||||
# the plugins are build. For example, compiling without
|
||||
# --with-more-asserts will yield less symbols.
|
||||
#
|
||||
# _build re-builds NetworkManager with relevant compile time
|
||||
# options to yield the most symbols.
|
||||
_build() {
|
||||
git clean -fdx
|
||||
./autogen.sh --enable-ld-gc \
|
||||
--enable-ifcfg-rh \
|
||||
--enable-ifupdown \
|
||||
--enable-teamdctl \
|
||||
--enable-wifi \
|
||||
--with-modem-manager-1 \
|
||||
--with-ofono \
|
||||
--with-more-asserts \
|
||||
--with-more-logging \
|
||||
--disable-autotools-deprecation
|
||||
make -j20
|
||||
}
|
||||
|
||||
_sort() {
|
||||
LANG=C sort -u
|
||||
}
|
||||
|
|
@ -75,16 +57,6 @@ pretty() {
|
|||
sed 's/.*/\t&;/'
|
||||
}
|
||||
|
||||
do_build() {
|
||||
do_update
|
||||
make
|
||||
}
|
||||
|
||||
do_rebuild() {
|
||||
_build
|
||||
do_build
|
||||
}
|
||||
|
||||
do_update() {
|
||||
do_generate > ./src/core/NetworkManager.ver
|
||||
}
|
||||
|
|
@ -117,14 +89,6 @@ EOF
|
|||
test -f ./src/core/${libs}libNetworkManager.a || die "must be called from NetworkManager top build dir after building the tree"
|
||||
|
||||
case "$1" in
|
||||
rebuild)
|
||||
[ -n "$from_meson" ] && die "can't do a build when called from meson"
|
||||
do_rebuild
|
||||
;;
|
||||
build)
|
||||
[ -n "$from_meson" ] && die "can't do a build when called from meson"
|
||||
do_build
|
||||
;;
|
||||
--called-from-build)
|
||||
if test -z "${NM_BUILD_NO_CREATE_EXPORTS+x}"; then
|
||||
do_update
|
||||
|
|
|
|||
|
|
@ -4,11 +4,6 @@ set -ex
|
|||
|
||||
cd /NetworkManager
|
||||
|
||||
if [ -f ./config.log ] ; then
|
||||
make -j 5 install
|
||||
else
|
||||
meson install -C build
|
||||
fi
|
||||
|
||||
meson install -C build
|
||||
systemctl daemon-reload
|
||||
systemctl restart NetworkManager.service
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
alias m="make -j 8"
|
||||
alias n="ninja -C build"
|
||||
|
||||
alias l='ls -l --color=auto'
|
||||
|
|
|
|||
|
|
@ -15,60 +15,8 @@ so that core dumps get written to file. Afterwards, restore with
|
|||
|
||||
from /usr/lib/sysctl.d/50-coredump.conf.
|
||||
|
||||
For example, configure NetworkManager with
|
||||
$ ./configure \
|
||||
--enable-address-sanitizer=no \
|
||||
--enable-compile-warnings=yes \
|
||||
--enable-concheck \
|
||||
--enable-config-plugin-ibft=yes \
|
||||
--enable-gtk-doc \
|
||||
--enable-ifcfg-rh=yes \
|
||||
--enable-ifcfg-suse \
|
||||
--enable-ifnet \
|
||||
--enable-ifupdown=yes \
|
||||
--enable-introspection \
|
||||
--enable-json-validation=yes \
|
||||
--enable-maintainer-mode \
|
||||
--enable-more-logging \
|
||||
--enable-more-warnings=error \
|
||||
--enable-ovs=yes \
|
||||
--enable-polkit=yes \
|
||||
--enable-teamdctl=yes \
|
||||
--enable-undefined-sanitizer=no \
|
||||
--enable-vala=yes \
|
||||
--enable-wimax \
|
||||
--localstatedir=/var \
|
||||
--prefix=/opt/test \
|
||||
--sysconfdir=/etc \
|
||||
--with-config-dhcp-default=internal \
|
||||
--with-config-dns-rc-manager-default=auto \
|
||||
--with-consolekit=yes \
|
||||
--with-consolekit=yes \
|
||||
--with-crypto=nss \
|
||||
--with-dhclient=yes \
|
||||
--with-dhcpcanon=yes \
|
||||
--with-dhcpcd=yes \
|
||||
--with-iwd=yes \
|
||||
--with-libnm-glib=yes \
|
||||
--with-modem-manager-1 \
|
||||
--with-netconfig=/bin/nowhere/netconfig \
|
||||
--with-nm-cloud-setup=yes \
|
||||
--with-nmcli=yes \
|
||||
--with-nmtui=yes \
|
||||
--with-ofono=yes \
|
||||
--with-resolvconf=/bin/nowhere/resolvconf \
|
||||
--with-session-tracking=systemd \
|
||||
--with-suspend-resume=systemd \
|
||||
--with-systemd-logind=yes \
|
||||
--with-valgrind=yes \
|
||||
--enable-tests="${NM_BUILD_TESTS:-yes}" \
|
||||
--with-more-asserts="${NM_BUILD_MORE_ASSERTS:-1000}" \
|
||||
"${NM_CONFIGURE_OTPS[@]}"
|
||||
Test with:
|
||||
$ systemctl stop NetworkManager; /opt/test/sbin/NetworkManager --debug 2>&1 | tee -a /tmp/nm-log.txt
|
||||
|
||||
Or better, configure with `contrib/fedora/rpm/configure-for-system.sh`,
|
||||
subsequent `make && make install` will overwrite your system's NetworkManager,
|
||||
Configure NetworkManager with `contrib/fedora/rpm/configure-for-system.sh`,
|
||||
subsequent `meson install` will overwrite your system's NetworkManager,
|
||||
and you can test it with `systemctl daemon-reload ; systemctl restart NetworkManager`.
|
||||
|
||||
Run NM-ci tests after creating eth1 with
|
||||
|
|
|
|||
|
|
@ -3,60 +3,8 @@
|
|||
find NetworkManager bind mounted at {{BASEDIR_NM}}
|
||||
run `nm-env-prepare.sh setup --idx 1` to setup test interfaces
|
||||
|
||||
For example, configure NetworkManager with
|
||||
$ ./configure \
|
||||
--enable-address-sanitizer=no \
|
||||
--enable-compile-warnings=yes \
|
||||
--enable-concheck \
|
||||
--enable-config-plugin-ibft=yes \
|
||||
--enable-gtk-doc \
|
||||
--enable-ifcfg-rh=yes \
|
||||
--enable-ifcfg-suse \
|
||||
--enable-ifnet \
|
||||
--enable-ifupdown=yes \
|
||||
--enable-introspection \
|
||||
--enable-json-validation=yes \
|
||||
--enable-maintainer-mode \
|
||||
--enable-more-logging \
|
||||
--enable-more-warnings=error \
|
||||
--enable-ovs=yes \
|
||||
--enable-polkit=yes \
|
||||
--enable-teamdctl=yes \
|
||||
--enable-undefined-sanitizer=no \
|
||||
--enable-vala=yes \
|
||||
--enable-wimax \
|
||||
--localstatedir=/var \
|
||||
--prefix=/opt/test \
|
||||
--sysconfdir=/etc \
|
||||
--with-config-dhcp-default=internal \
|
||||
--with-config-dns-rc-manager-default=auto \
|
||||
--with-consolekit=yes \
|
||||
--with-consolekit=yes \
|
||||
--with-crypto=nss \
|
||||
--with-dhclient=yes \
|
||||
--with-dhcpcanon=yes \
|
||||
--with-dhcpcd=yes \
|
||||
--with-iwd=yes \
|
||||
--with-libnm-glib=yes \
|
||||
--with-modem-manager-1 \
|
||||
--with-netconfig=/bin/nowhere/netconfig \
|
||||
--with-nm-cloud-setup=yes \
|
||||
--with-nmcli=yes \
|
||||
--with-nmtui=yes \
|
||||
--with-ofono=yes \
|
||||
--with-resolvconf=/bin/nowhere/resolvconf \
|
||||
--with-session-tracking=systemd \
|
||||
--with-suspend-resume=systemd \
|
||||
--with-systemd-logind=yes \
|
||||
--with-valgrind=yes \
|
||||
--enable-tests="${NM_BUILD_TESTS:-yes}" \
|
||||
--with-more-asserts="${NM_BUILD_MORE_ASSERTS:-1000}" \
|
||||
"${NM_CONFIGURE_OTPS[@]}"
|
||||
Test with:
|
||||
$ systemctl stop NetworkManager; /opt/test/sbin/NetworkManager --debug 2>&1 | tee -a /tmp/nm-log.txt
|
||||
|
||||
Or better, if using Fedora, configure with `contrib/fedora/rpm/configure-for-system.sh`,
|
||||
subsequent `make && make install` will overwrite your system's NetworkManager,
|
||||
Configure NetworkManager with `contrib/fedora/rpm/configure-for-system.sh`,
|
||||
subsequent `meson install` will overwrite your system's NetworkManager,
|
||||
and you can test it with `systemctl daemon-reload ; systemctl restart NetworkManager`.
|
||||
|
||||
Run NM-ci tests after creating eth1 with
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ set -e
|
|||
# - with command "journal", additional arguments that are passed to journalctl.
|
||||
#
|
||||
# It bind mounts the current working directory inside the container.
|
||||
# You can run `make install` and run tests.
|
||||
# You can run `meson install` and run tests.
|
||||
# There is a script nm-env-prepare.sh to generate a net1 interface for testing.
|
||||
#
|
||||
# This will bind-mount the NetworkManager working tree inside the container (and symlink
|
||||
|
|
@ -229,7 +229,6 @@ RUN dnf install -y \\
|
|||
libtool \\
|
||||
libubsan \\
|
||||
libuuid-devel \\
|
||||
make \\
|
||||
meson \\
|
||||
mlocate \\
|
||||
mobile-broadband-provider-info-devel \\
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ set -e
|
|||
# NetworkManager directories:
|
||||
#
|
||||
# The NetworkManager root directory is mounted in the VM as a filesystem share.
|
||||
# You can run `make install` and run tests.
|
||||
# You can run `meson install` and run tests.
|
||||
#
|
||||
# Create a symlink ./.git/NetworkManager-ci, to share the CI directory too.
|
||||
#
|
||||
|
|
|
|||
|
|
@ -35,9 +35,7 @@ usage() {
|
|||
echo " the automatism to always launch a D-Bus session"
|
||||
echo " --no-launch-dbus|-D: prevent launching a D-Bus session"
|
||||
echo " --no-libtool: when running with valgrind, the script tries automatically to"
|
||||
echo " use libtool as necessary. This disables libtool usage"
|
||||
echo " --make-first|-m: before running the test, make it (only works with autotools build)"
|
||||
echo " --no-make-first|-M: disable --make-first option"
|
||||
echo " use libtool as necessary. This disables libtool usage"
|
||||
echo " --valgrind|-v: run under valgrind"
|
||||
echo " --no-valgrind|-V: disable running under valgrind (overrides NMTST_USE_VALGRIND=1)"
|
||||
echo " -d: set NMTST_DEBUG=d"
|
||||
|
|
@ -126,8 +124,6 @@ if [ "$CALLED_FROM_MAKE" == 1 ]; then
|
|||
NMTST_LAUNCH_DBUS=0
|
||||
fi
|
||||
TEST="$1"; shift
|
||||
NMTST_MAKE_FIRST=0
|
||||
|
||||
TEST_ARGV=("$@")
|
||||
else
|
||||
if [[ -z "${NMTST_USE_VALGRIND+x}" ]]; then
|
||||
|
|
@ -162,14 +158,6 @@ else
|
|||
NMTST_LIBTOOL=()
|
||||
shift
|
||||
;;
|
||||
--make-first|-m)
|
||||
NMTST_MAKE_FIRST=1
|
||||
shift
|
||||
;;
|
||||
--no-make-first|-M)
|
||||
NMTST_MAKE_FIRST=0
|
||||
shift
|
||||
;;
|
||||
"--valgrind"|-v)
|
||||
NMTST_USE_VALGRIND=1
|
||||
shift;
|
||||
|
|
@ -235,14 +223,6 @@ fi
|
|||
|
||||
[ -n "$TEST" ] || die "Missing test name. Specify it on the command line."
|
||||
|
||||
if _is_true "$NMTST_MAKE_FIRST" 0; then
|
||||
git_dir="$(readlink -f "$(git rev-parse --show-toplevel)")"
|
||||
rel_path="$(realpath --relative-to="$git_dir" -m "$TEST" 2>/dev/null)" || die "cannot resolve test-name \"$TEST\". Did you call the script properly?"
|
||||
cd "$git_dir"
|
||||
make -j5 "$rel_path" || die "make of $TEST failed ($git_dir / $rel_path)"
|
||||
cd - 1>/dev/null
|
||||
fi
|
||||
|
||||
[ -x "$TEST" ] || die "Test \"$TEST\" does not exist"
|
||||
TEST_PATH="$(readlink -f "$(dirname "$TEST")")"
|
||||
TEST_NAME="${TEST##*/}"
|
||||
|
|
|
|||
|
|
@ -1,56 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
die() {
|
||||
echo "$@"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [[ "x$(LANG=C git clean -ndx)" != x ]]; then
|
||||
die "The working directory is not clean. Refuse to run. Try \`git clean -dx -n\`"
|
||||
fi
|
||||
if [[ "x$(git status --porcelain)" != x ]]; then
|
||||
die "The working directory has local changes. Refuse to run. Try \`git reset --hard\`"
|
||||
fi
|
||||
|
||||
build_out_of_tree() {
|
||||
local TARGET="$1"
|
||||
local C="$2"
|
||||
local M="$3"
|
||||
(
|
||||
git clean -fdx || return 1
|
||||
NOCONFIGURE=x ./autogen.sh || return 1
|
||||
mkdir -p x/y || return 1
|
||||
cd x/y || return 1
|
||||
../../configure $C $NMTST_CONFIGURE || return 1
|
||||
make $TARGET $M $NMTST_MAKE || return 1
|
||||
)
|
||||
}
|
||||
|
||||
TARGETS=("$@")
|
||||
if [ "${#TARGETS}" -lt 1 ]; then
|
||||
TARGETS=(
|
||||
dispatcher/nm-dispatcher
|
||||
src/core/NetworkManager
|
||||
src/core/dhcp/nm-dhcp-helper
|
||||
src/core/ndisc/tests/test-ndisc-linux
|
||||
src/core/platform/tests/monitor
|
||||
src/nm-online/nm-online
|
||||
src/nmcli/nmcli
|
||||
src/nmtui/nmtui
|
||||
$(git grep -h '\.l\?a\>' Makefile.am | sed 's/[a-zA-Z.0-9_-/]\+/\n\0\n/g' | sort -u | grep '\.l\?a$')
|
||||
)
|
||||
fi
|
||||
|
||||
set -x
|
||||
|
||||
cd "$(dirname "$(readlink -f "$0")")/.."
|
||||
|
||||
IDX=($(seq 0 $((${#TARGETS[@]} - 1))))
|
||||
IDX=($(printf '%s\n' "${IDX[@]}" | sort -R))
|
||||
for idx in "${IDX[@]}"; do
|
||||
TARGET="${TARGETS[$idx]}"
|
||||
echo "### $idx: TARGET=$TARGET"
|
||||
build_out_of_tree "$TARGET" "--enable-gtk-doc" "-j 5"
|
||||
done
|
||||
Loading…
Add table
Reference in a new issue