2016-01-10 23:35:36 +03:00
## Copyright (C) 2005-2016 Red Hat, Inc.
## Copyright (C) 2013 Yuto KAWAMURA(kawamuray) <kawamuray.dadada@gmail.com>
2013-05-15 03:42:12 +04:00
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library 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
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library. If not, see
## <http://www.gnu.org/licenses/>.
2009-04-19 19:10:45 +04:00
2011-07-28 16:55:21 +04:00
INCLUDES = \
2017-11-03 15:09:47 +03:00
-I$( top_builddir) /include -I$( top_srcdir) /include \
-I$( top_builddir) /gnulib/lib -I$( top_srcdir) /gnulib/lib \
-I$( top_builddir) /src -I$( top_srcdir) /src \
-I$( top_srcdir) /src/util \
-I$( top_srcdir) \
2011-07-28 16:55:21 +04:00
$( GETTEXT_CPPFLAGS)
2016-06-29 16:19:18 +03:00
WARN_CFLAGS += $( STRICT_FRAME_LIMIT_CFLAGS)
2017-11-16 16:35:12 +03:00
AM_CFLAGS = \
$( WARN_CFLAGS) \
$( COVERAGE_CFLAGS) \
$( PIE_CFLAGS) \
$( LIBXML_CFLAGS) \
$( NULL)
2013-08-20 13:20:46 +04:00
AM_LDFLAGS = \
2017-11-03 15:09:47 +03:00
$( RELRO_LDFLAGS) \
$( NO_INDIRECT_LDFLAGS) \
2018-01-25 12:35:58 +03:00
$( NO_UNDEFINED_LDFLAGS) \
2013-08-20 13:20:46 +04:00
$( NULL)
2009-09-16 15:01:53 +04:00
ICON_FILES = \
libvirt_win_icon_16x16.ico \
libvirt_win_icon_32x32.ico \
libvirt_win_icon_48x48.ico \
libvirt_win_icon_64x64.ico \
virsh_win_icon.rc
2016-04-13 18:09:14 +03:00
PODFILES = \
virt-admin.pod \
virt-host-validate.pod \
virt-login-shell.pod \
virt-pki-validate.pod \
virt-sanlock-cleanup.pod \
virt-xml-validate.pod \
virsh.pod \
$( NULL)
MANINFILES = \
virt-admin.1.in \
virt-host-validate.1.in \
virt-login-shell.1.in \
virt-pki-validate.1.in \
virt-sanlock-cleanup.8.in \
virt-xml-validate.1.in \
virsh.1.in \
$( NULL)
2010-08-25 16:07:26 +04:00
EXTRA_DIST = \
2017-11-03 15:09:47 +03:00
$( ICON_FILES) \
$( conf_DATA) \
virt-xml-validate.in \
virt-pki-validate.in \
virt-sanlock-cleanup.in \
libvirt-guests.sysconf \
virt-login-shell.conf \
virsh-edit.c \
2017-11-02 16:41:53 +03:00
bash-completion/vsh \
2017-11-03 15:09:47 +03:00
$( PODFILES) \
$( MANINFILES) \
2016-04-13 18:09:14 +03:00
$( NULL)
2012-07-31 07:52:13 +04:00
2016-01-10 23:35:36 +03:00
CLEANFILES =
2011-10-12 01:10:17 +04:00
DISTCLEANFILES =
2016-04-13 18:12:24 +03:00
MAINTAINERCLEANFILES =
2011-10-12 01:10:17 +04:00
2013-08-08 19:36:31 +04:00
confdir = $( sysconfdir) /libvirt
2013-08-30 23:58:59 +04:00
conf_DATA =
2013-08-08 19:36:31 +04:00
2009-09-16 17:42:57 +04:00
bin_SCRIPTS = virt-xml-validate virt-pki-validate
2016-04-08 18:14:13 +03:00
bin_PROGRAMS = virsh virt-admin
2012-10-21 06:29:51 +04:00
libexec_SCRIPTS = libvirt-guests.sh
2016-04-12 23:05:15 +03:00
man1_MANS = \
2016-04-08 18:23:10 +03:00
virt-pki-validate.1 \
virt-xml-validate.1 \
virsh.1 \
virt-admin.1
2009-09-16 15:01:53 +04:00
2012-09-20 15:58:07 +04:00
i f W I T H _ S A N L O C K
2011-06-14 12:29:00 +04:00
sbin_SCRIPTS = virt-sanlock-cleanup
2016-04-12 23:05:15 +03:00
man8_MANS = virt-sanlock-cleanup.8
2011-10-12 01:10:17 +04:00
DISTCLEANFILES += virt-sanlock-cleanup
2013-09-04 06:39:16 +04:00
e n d i f W I T H _ S A N L O C K
2009-09-16 15:01:53 +04:00
2015-11-10 01:36:40 +03:00
i f W I T H _ L O G I N _ S H E L L
2013-08-30 23:58:59 +04:00
conf_DATA += virt-login-shell.conf
bin_PROGRAMS += virt-login-shell
2016-04-12 23:05:15 +03:00
man1_MANS += virt-login-shell.1
2016-04-13 20:24:51 +03:00
e n d i f W I T H _ L O G I N _ S H E L L
2009-04-19 19:10:45 +04:00
2016-04-08 18:14:13 +03:00
i f W I T H _ H O S T _ V A L I D A T E
bin_PROGRAMS += virt-host-validate
2016-04-12 23:05:15 +03:00
man1_MANS += virt-host-validate.1
e n d i f W I T H _ H O S T _ V A L I D A T E
2016-04-08 18:14:13 +03:00
2009-04-19 19:10:45 +04:00
virt-xml-validate : virt -xml -validate .in Makefile
2013-08-20 02:26:41 +04:00
$( AM_V_GEN) sed -e 's|[@]schemadir@|$(pkgdatadir)/schemas|g' \
-e 's|[@]VERSION@|$(VERSION)|g' \
< $< > $@ || ( rm $@ && exit 1) && chmod +x $@
2009-04-19 19:10:45 +04:00
2009-09-16 17:42:57 +04:00
virt-pki-validate : virt -pki -validate .in Makefile
2013-08-20 02:38:57 +04:00
$( AM_V_GEN) sed -e 's|[@]sysconfdir@|$(sysconfdir)|g' \
-e 's|[@]VERSION@|$(VERSION)|g' \
< $< > $@ || ( rm $@ && exit 1) && chmod +x $@
2009-09-16 15:01:53 +04:00
2011-06-14 12:29:00 +04:00
virt-sanlock-cleanup : virt -sanlock -cleanup .in Makefile
build: use common .in replacement mechanism
We had several different styles of .in conversion in our Makefiles:
ALLCAPS, @ALLCAPS@, @lower@, ::lower::
Canonicalize on one form, to make it easier to copy and paste
between .in files.
Also, we were using some non-portable sed constructs: \@ is an
undefined escape sequence (it happens to be @ itself in GNU sed,
but POSIX allows it to mean something else), as well as risky
behavior (failure to consistently quote things means a space
in $(sysconfdir) could throw things off; also, Autoconf recommends
using | rather than , or ! in the s||| operator, because | has to
be quoted in shell and is therefore less likely to appear in file
names than , or !).
Fix all of these uses to follow the same syntax.
* daemon/libvirtd.8.in: Switch to @var@.
* tools/virt-xml-validate.in: Likewise.
* tools/virt-pki-validate.in: Likewise.
* src/locking/virtlockd.init.in: Likewise.
* daemon/Makefile.am: Prefer | over ! in sed.
(libvirtd.8): Prefer consistent substitution.
(libvirtd.init, libvirtd.service): Avoid non-portable sed.
* tools/Makefile.am (libvirt-guests.sh, libvirt-guests.init)
(libvirt-guests.service): Likewise.
(virt-xml-validate, virt-pki-validate, virt-sanlock-cleanup):
Prefer consistent capitalization.
* src/Makefile.am (virtlockd.init, virtlockd.service)
(virtlockd.socket): Prefer consistent substitution.
2013-01-05 00:35:04 +04:00
$( AM_V_GEN) sed -e 's|[@]sysconfdir@|$(sysconfdir)|' \
-e 's|[@]localstatedir@|$(localstatedir)|' < $< > $@ \
2011-06-14 12:29:00 +04:00
|| ( rm $@ && exit 1) && chmod +x $@
2015-09-23 16:17:35 +03:00
noinst_LTLIBRARIES = libvirt_shell.la
libvirt_shell_la_CFLAGS = \
2017-11-03 15:09:47 +03:00
$( AM_CFLAGS) \
$( READLINE_CFLAGS) \
2015-09-23 16:17:35 +03:00
$( NULL)
libvirt_shell_la_LDFLAGS = \
2017-11-03 15:09:47 +03:00
$( AM_LDFLAGS) \
$( PIE_LDFLAGS) \
$( COVERAGE_LDFLAGS) \
2015-09-23 16:17:35 +03:00
$( NULL)
libvirt_shell_la_LIBADD = \
2018-03-05 18:39:48 +03:00
../src/libvirt.la \
2017-11-03 15:09:47 +03:00
$( LIBXML_LIBS) \
$( READLINE_LIBS) \
../gnulib/lib/libgnu.la \
2015-09-23 16:17:35 +03:00
$( NULL)
2018-08-23 18:53:41 +03:00
libvirt_shell_la_SOURCES = \
vsh.c vsh.h \
vsh-table.c vsh-table.h
2015-09-23 16:17:35 +03:00
2012-01-10 21:31:21 +04:00
virt_host_validate_SOURCES = \
virt-host-validate.c \
2017-02-24 19:27:56 +03:00
virt-host-validate-common.c virt-host-validate-common.h
VIRT_HOST_VALIDATE_QEMU = \
virt-host-validate-qemu.c \
virt-host-validate-qemu.h
VIRT_HOST_VALIDATE_LXC = \
virt-host-validate-lxc.c \
virt-host-validate-lxc.h
VIRT_HOST_VALIDATE_BHYVE = \
virt-host-validate-bhyve.c \
virt-host-validate-bhyve.h
i f W I T H _ Q E M U
virt_host_validate_SOURCES += $( VIRT_HOST_VALIDATE_QEMU)
e l s e ! W I T H _ Q E M U
EXTRA_DIST += $( VIRT_HOST_VALIDATE_QEMU)
e n d i f ! W I T H _ Q E M U
i f W I T H _ L X C
virt_host_validate_SOURCES += $( VIRT_HOST_VALIDATE_LXC)
e l s e ! W I T H _ L X C
EXTRA_DIST += $( VIRT_HOST_VALIDATE_LXC)
e n d i f ! W I T H _ L X C
i f W I T H _ B H Y V E
virt_host_validate_SOURCES += $( VIRT_HOST_VALIDATE_BHYVE)
e l s e ! W I T H _ B H Y V E
EXTRA_DIST += $( VIRT_HOST_VALIDATE_BHYVE)
e n d i f ! W I T H _ B H Y V E
2012-01-10 21:31:21 +04:00
virt_host_validate_LDFLAGS = \
2013-08-20 13:20:46 +04:00
$( AM_LDFLAGS) \
2013-04-03 14:32:15 +04:00
$( PIE_LDFLAGS) \
2012-01-10 21:31:21 +04:00
$( COVERAGE_LDFLAGS) \
$( NULL)
virt_host_validate_LDADD = \
2017-11-03 15:09:47 +03:00
../src/libvirt.la \
../gnulib/lib/libgnu.la \
2012-01-10 21:31:21 +04:00
$( NULL)
virt_host_validate_CFLAGS = \
2017-11-16 16:35:12 +03:00
$( AM_CFLAGS) \
2012-01-10 21:31:21 +04:00
$( NULL)
2013-10-10 16:09:08 +04:00
# Since virt-login-shell will be setuid, we must do everything
# we can to avoid linking to other libraries. Many of them do
# unsafe things in functions marked __atttribute__((constructor)).
# This we statically link to a library containing only the minimal
# libvirt client code, not libvirt.so itself.
2017-11-03 15:09:47 +03:00
virt_login_shell_SOURCES = \
2013-08-08 19:36:31 +04:00
virt-login-shell.c
2013-08-20 13:20:46 +04:00
virt_login_shell_LDFLAGS = \
2017-11-03 15:09:47 +03:00
$( AM_LDFLAGS) \
$( PIE_LDFLAGS) \
$( COVERAGE_LDFLAGS) \
2013-08-20 13:20:46 +04:00
$( NULL)
2017-11-03 15:09:47 +03:00
virt_login_shell_LDADD = \
$( STATIC_BINARIES) \
../src/libvirt-setuid-rpc-client.la \
2013-08-08 19:36:31 +04:00
../gnulib/lib/libgnu.la
2017-11-03 15:09:47 +03:00
virt_login_shell_CFLAGS = \
-DLIBVIRT_SETUID_RPC_CLIENT \
2017-11-16 16:35:12 +03:00
$( AM_CFLAGS) \
$( NULL)
2013-08-08 19:36:31 +04:00
2017-11-03 15:09:47 +03:00
virsh_SOURCES = \
virsh.c virsh.h \
2018-01-14 13:51:44 +03:00
virsh-completer.c virsh-completer.h \
2017-11-03 15:09:47 +03:00
virsh-console.c virsh-console.h \
virsh-domain.c virsh-domain.h \
virsh-domain-monitor.c virsh-domain-monitor.h \
virsh-host.c virsh-host.h \
virsh-interface.c virsh-interface.h \
virsh-network.c virsh-network.h \
virsh-nodedev.c virsh-nodedev.h \
virsh-nwfilter.c virsh-nwfilter.h \
virsh-pool.c virsh-pool.h \
virsh-secret.c virsh-secret.h \
virsh-snapshot.c virsh-snapshot.h \
virsh-util.c virsh-util.h \
virsh-volume.c virsh-volume.h \
2012-08-18 07:16:04 +04:00
$( NULL)
2009-09-16 15:01:53 +04:00
2013-08-20 13:20:46 +04:00
virsh_LDFLAGS = \
2017-11-03 15:09:47 +03:00
$( AM_LDFLAGS) \
$( PIE_LDFLAGS) \
$( COVERAGE_LDFLAGS) \
2013-08-20 13:20:46 +04:00
$( NULL)
2017-11-03 15:09:47 +03:00
virsh_LDADD = \
$( STATIC_BINARIES) \
../src/libvirt-lxc.la \
../src/libvirt-qemu.la \
2015-09-25 14:20:38 +03:00
libvirt_shell.la
2017-11-03 15:09:47 +03:00
virsh_CFLAGS = \
2017-11-16 16:35:12 +03:00
$( AM_CFLAGS) \
2017-05-26 20:43:42 +03:00
$( READLINE_CFLAGS)
2015-10-12 18:07:21 +03:00
2017-11-03 15:09:47 +03:00
virt_admin_SOURCES = \
virt-admin.c virt-admin.h \
2018-01-14 13:51:44 +03:00
virt-admin-completer.c virt-admin-completer.h \
2015-10-12 18:07:21 +03:00
$( NULL)
2017-11-03 15:09:47 +03:00
virt_admin_LDFLAGS = \
$( AM_LDFLAGS) \
$( COVERAGE_LDFLAGS) \
$( STATIC_BINARIES) \
$( PIE_LDFLAGS) \
2015-10-12 18:07:21 +03:00
$( NULL)
2017-11-03 15:09:47 +03:00
virt_admin_LDADD = \
../src/libvirt-admin.la \
libvirt_shell.la \
$( LIBXML_LIBS) \
2015-10-12 18:07:21 +03:00
$( NULL)
2017-11-03 15:09:47 +03:00
virt_admin_CFLAGS = \
2017-11-16 16:35:12 +03:00
$( AM_CFLAGS) \
2015-10-12 18:07:21 +03:00
$( READLINE_CFLAGS)
2012-05-17 19:08:53 +04:00
BUILT_SOURCES =
2009-09-16 15:01:53 +04:00
i f W I T H _ W I N _ I C O N
virsh_LDADD += virsh_win_icon.$( OBJEXT)
# Before you edit virsh_win_icon.rc, please note the following
# limitations of the resource file format:
#
# (1) '..' is not permitted in the icon filename field.
# (2) '-' is not permitted in the icon filename field.
# (3) Comments are not permitted in the file.
#
# Windows appears to choose the first <= 32x32 icon it finds
# in the resource file. Therefore you should list the available
# icons from largest to smallest, and make sure that the 32x32
# icon is the most legible.
#
# Windows .ICO is a special MS-only format. GIMP and other
# tools can write it. However there are several variations,
# and Windows seems to do its own colour quantization. More
# information is needed in this area.
virsh_win_icon.$(OBJEXT) : virsh_win_icon .rc
2010-03-31 16:10:08 +04:00
$( AM_V_GEN) $( WINDRES) \
2009-09-16 15:01:53 +04:00
--input-format rc --input $< \
--output-format coff --output $@
2013-09-04 06:39:16 +04:00
e n d i f W I T H _ W I N _ I C O N
2009-09-16 15:01:53 +04:00
2016-04-12 23:28:27 +03:00
POD2MAN = pod2man -c "Virtualization Support" -r " $( PACKAGE) - $( VERSION) "
2016-04-12 23:15:45 +03:00
%.1.in : %.pod
2016-04-13 19:52:12 +03:00
$( AM_V_GEN) $( POD2MAN) $< $@ -t1 && \
if grep 'POD ERROR' $@ -t1; then rm $@ -t1; exit 1; fi && \
sed \
-e 's|SYSCONFDIR|\@sysconfdir\@|g' \
-e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
< $@ -t1 > $@ -t2 && \
rm -f $@ -t1 && \
mv $@ -t2 $@
2009-04-19 19:10:45 +04:00
2016-04-12 23:15:45 +03:00
%.8.in : %.pod
2016-04-13 19:52:12 +03:00
$( AM_V_GEN) $( POD2MAN) --section= 8 $< $@ -t1 && \
if grep 'POD ERROR' $@ -t1; then rm $@ -t1; exit 1; fi && \
sed \
-e 's|SYSCONFDIR|\@sysconfdir\@|g' \
-e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
< $@ -t1 > $@ -t2 && \
rm -f $@ -t1 && \
mv $@ -t2 $@
2016-04-12 21:32:33 +03:00
2016-04-12 23:15:45 +03:00
%.1 : %.1.in $( top_srcdir ) /configure .ac
$( AM_V_GEN) sed \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@ -t && \
mv $@ -t $@
%.8 : %.8.in $( top_srcdir ) /configure .ac
$( AM_V_GEN) sed \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@ -t && \
mv $@ -t $@
2017-11-02 16:41:53 +03:00
install-data-local : install -init install -systemd install -nss \
install-bash-completion
2010-08-25 16:07:26 +04:00
2017-11-02 16:41:53 +03:00
uninstall-local : uninstall -init uninstall -systemd uninstall -nss \
uninstall-bash-completion
2010-08-25 16:07:26 +04:00
2011-07-07 17:45:07 +04:00
install-sysconfig :
build: follow directory install conventions
Commit 4d9e51f6 fixed a 'make uninstall' failure, but failed
to follow other conventions already present in src/Makefile.am.
In particular, we prefer MKDIR_P over mkdir -p, and should
have a matching rmdir during uninstall for every directory
created during install (the idea being that uninstall in a
DESTDIR should be clean, while installation in the final
system should not fail with non-empty directories left behind).
* tools/Makefile.am (install-sysconfig, install-initscript)
(install-systemd): Use MKDIR_P.
(uninstall-sysconfig, uninstall-initscript, uninstall-systemd):
Also remove directories.
* daemon/Makefile.am (install-data-local, install-data-polkit)
(install-logrotate, install-sysconfig, install-sysctl)
(install-init-redhat, install-init-upstart, install-init-systemd)
(install-data-sasl): Use MKDIR_P.
(uninstall-data-polkit, uninstall-sysconfig, uninstall-sysctl)
(uninstall-init-redhat, uninstall-init-upstart)
(uninstall-init-systemd): Also remove directory.
(uninstall-logrotate): New rule.
(uninstall-local): Add uninstall-logrotate.
2011-12-09 22:06:19 +04:00
$( MKDIR_P) $( DESTDIR) $( sysconfdir) /sysconfig
2011-07-07 17:45:07 +04:00
$( INSTALL_DATA) $( srcdir) /libvirt-guests.sysconf \
$( DESTDIR) $( sysconfdir) /sysconfig/libvirt-guests
uninstall-sysconfig :
rm -f $( DESTDIR) $( sysconfdir) /sysconfig/libvirt-guests
build: follow directory install conventions
Commit 4d9e51f6 fixed a 'make uninstall' failure, but failed
to follow other conventions already present in src/Makefile.am.
In particular, we prefer MKDIR_P over mkdir -p, and should
have a matching rmdir during uninstall for every directory
created during install (the idea being that uninstall in a
DESTDIR should be clean, while installation in the final
system should not fail with non-empty directories left behind).
* tools/Makefile.am (install-sysconfig, install-initscript)
(install-systemd): Use MKDIR_P.
(uninstall-sysconfig, uninstall-initscript, uninstall-systemd):
Also remove directories.
* daemon/Makefile.am (install-data-local, install-data-polkit)
(install-logrotate, install-sysconfig, install-sysctl)
(install-init-redhat, install-init-upstart, install-init-systemd)
(install-data-sasl): Use MKDIR_P.
(uninstall-data-polkit, uninstall-sysconfig, uninstall-sysctl)
(uninstall-init-redhat, uninstall-init-upstart)
(uninstall-init-systemd): Also remove directory.
(uninstall-logrotate): New rule.
(uninstall-local): Add uninstall-logrotate.
2011-12-09 22:06:19 +04:00
rmdir $( DESTDIR) $( sysconfdir) /sysconfig || :
2011-07-07 17:45:07 +04:00
2012-10-21 06:29:51 +04:00
EXTRA_DIST += libvirt-guests.sh.in libvirt-guests.init.in
2011-07-07 17:45:07 +04:00
2011-12-08 17:30:24 +04:00
install-initscript : libvirt -guests .init
build: follow directory install conventions
Commit 4d9e51f6 fixed a 'make uninstall' failure, but failed
to follow other conventions already present in src/Makefile.am.
In particular, we prefer MKDIR_P over mkdir -p, and should
have a matching rmdir during uninstall for every directory
created during install (the idea being that uninstall in a
DESTDIR should be clean, while installation in the final
system should not fail with non-empty directories left behind).
* tools/Makefile.am (install-sysconfig, install-initscript)
(install-systemd): Use MKDIR_P.
(uninstall-sysconfig, uninstall-initscript, uninstall-systemd):
Also remove directories.
* daemon/Makefile.am (install-data-local, install-data-polkit)
(install-logrotate, install-sysconfig, install-sysctl)
(install-init-redhat, install-init-upstart, install-init-systemd)
(install-data-sasl): Use MKDIR_P.
(uninstall-data-polkit, uninstall-sysconfig, uninstall-sysctl)
(uninstall-init-redhat, uninstall-init-upstart)
(uninstall-init-systemd): Also remove directory.
(uninstall-logrotate): New rule.
(uninstall-local): Add uninstall-logrotate.
2011-12-09 22:06:19 +04:00
$( MKDIR_P) $( DESTDIR) $( sysconfdir) /rc.d/init.d
2010-08-25 16:07:26 +04:00
$( INSTALL_SCRIPT) libvirt-guests.init \
$( DESTDIR) $( sysconfdir) /rc.d/init.d/libvirt-guests
2011-12-08 17:30:24 +04:00
uninstall-initscript :
2011-07-07 17:45:07 +04:00
rm -f $( DESTDIR) $( sysconfdir) /rc.d/init.d/libvirt-guests
build: follow directory install conventions
Commit 4d9e51f6 fixed a 'make uninstall' failure, but failed
to follow other conventions already present in src/Makefile.am.
In particular, we prefer MKDIR_P over mkdir -p, and should
have a matching rmdir during uninstall for every directory
created during install (the idea being that uninstall in a
DESTDIR should be clean, while installation in the final
system should not fail with non-empty directories left behind).
* tools/Makefile.am (install-sysconfig, install-initscript)
(install-systemd): Use MKDIR_P.
(uninstall-sysconfig, uninstall-initscript, uninstall-systemd):
Also remove directories.
* daemon/Makefile.am (install-data-local, install-data-polkit)
(install-logrotate, install-sysconfig, install-sysctl)
(install-init-redhat, install-init-upstart, install-init-systemd)
(install-data-sasl): Use MKDIR_P.
(uninstall-data-polkit, uninstall-sysconfig, uninstall-sysctl)
(uninstall-init-redhat, uninstall-init-upstart)
(uninstall-init-systemd): Also remove directory.
(uninstall-logrotate): New rule.
(uninstall-local): Add uninstall-logrotate.
2011-12-09 22:06:19 +04:00
rmdir $( DESTDIR) $( sysconfdir) /rc.d/init.d || :
2010-08-25 16:07:26 +04:00
2011-12-08 17:30:24 +04:00
i f L I B V I R T _ I N I T _ S C R I P T _ R E D _ H A T
BUILT_SOURCES += libvirt-guests.init
install-init : install -sysconfig install -initscript
uninstall-init : uninstall -sysconfig uninstall -initscript
2013-09-04 06:39:16 +04:00
e l s e ! L I B V I R T _ I N I T _ S C R I P T _ R E D _ H A T
2011-07-07 17:45:07 +04:00
install-init :
uninstall-init :
2013-09-04 06:39:16 +04:00
e n d i f ! L I B V I R T _ I N I T _ S C R I P T _ R E D _ H A T
2011-07-07 17:45:07 +04:00
2012-10-21 06:29:51 +04:00
libvirt-guests.sh : libvirt -guests .sh .in $( top_builddir ) /config .status
2017-11-03 15:09:47 +03:00
$( AM_V_GEN) sed \
-e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \
-e 's|[@]bindir[@]|$(bindir)|g' \
-e 's|[@]localedir[@]|$(localedir)|g' \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's|[@]sbindir[@]|$(sbindir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@ -t && \
chmod a+x $@ -t && \
2010-08-25 16:07:26 +04:00
mv $@ -t $@
2012-10-21 06:29:51 +04:00
BUILT_SOURCES += libvirt-guests.sh
2011-07-07 17:45:07 +04:00
2012-10-21 06:29:51 +04:00
libvirt-guests.init : libvirt -guests .init .in libvirt -guests .sh
$( AM_V_GEN) sed \
build: use common .in replacement mechanism
We had several different styles of .in conversion in our Makefiles:
ALLCAPS, @ALLCAPS@, @lower@, ::lower::
Canonicalize on one form, to make it easier to copy and paste
between .in files.
Also, we were using some non-portable sed constructs: \@ is an
undefined escape sequence (it happens to be @ itself in GNU sed,
but POSIX allows it to mean something else), as well as risky
behavior (failure to consistently quote things means a space
in $(sysconfdir) could throw things off; also, Autoconf recommends
using | rather than , or ! in the s||| operator, because | has to
be quoted in shell and is therefore less likely to appear in file
names than , or !).
Fix all of these uses to follow the same syntax.
* daemon/libvirtd.8.in: Switch to @var@.
* tools/virt-xml-validate.in: Likewise.
* tools/virt-pki-validate.in: Likewise.
* src/locking/virtlockd.init.in: Likewise.
* daemon/Makefile.am: Prefer | over ! in sed.
(libvirtd.8): Prefer consistent substitution.
(libvirtd.init, libvirtd.service): Avoid non-portable sed.
* tools/Makefile.am (libvirt-guests.sh, libvirt-guests.init)
(libvirt-guests.service): Likewise.
(virt-xml-validate, virt-pki-validate, virt-sanlock-cleanup):
Prefer consistent capitalization.
* src/Makefile.am (virtlockd.init, virtlockd.service)
(virtlockd.socket): Prefer consistent substitution.
2013-01-05 00:35:04 +04:00
-e 's|[@]libexecdir[@]|$(libexecdir)|g' \
2012-10-21 06:29:51 +04:00
< $< > $@ -t && \
chmod a+x $@ -t && \
mv $@ -t $@
2011-07-07 17:45:07 +04:00
EXTRA_DIST += libvirt-guests.service.in
2014-01-17 16:11:58 +04:00
SYSTEMD_UNIT_DIR = $( prefix) /lib/systemd/system
2011-12-08 17:30:24 +04:00
2011-07-07 17:45:07 +04:00
i f L I B V I R T _ I N I T _ S C R I P T _ S Y S T E M D
2012-10-21 06:29:51 +04:00
install-systemd : libvirt -guests .service install -sysconfig libvirt -guests .sh
build: follow directory install conventions
Commit 4d9e51f6 fixed a 'make uninstall' failure, but failed
to follow other conventions already present in src/Makefile.am.
In particular, we prefer MKDIR_P over mkdir -p, and should
have a matching rmdir during uninstall for every directory
created during install (the idea being that uninstall in a
DESTDIR should be clean, while installation in the final
system should not fail with non-empty directories left behind).
* tools/Makefile.am (install-sysconfig, install-initscript)
(install-systemd): Use MKDIR_P.
(uninstall-sysconfig, uninstall-initscript, uninstall-systemd):
Also remove directories.
* daemon/Makefile.am (install-data-local, install-data-polkit)
(install-logrotate, install-sysconfig, install-sysctl)
(install-init-redhat, install-init-upstart, install-init-systemd)
(install-data-sasl): Use MKDIR_P.
(uninstall-data-polkit, uninstall-sysconfig, uninstall-sysctl)
(uninstall-init-redhat, uninstall-init-upstart)
(uninstall-init-systemd): Also remove directory.
(uninstall-logrotate): New rule.
(uninstall-local): Add uninstall-logrotate.
2011-12-09 22:06:19 +04:00
$( MKDIR_P) $( DESTDIR) $( SYSTEMD_UNIT_DIR)
2012-06-26 11:53:33 +04:00
$( INSTALL_DATA) libvirt-guests.service \
2011-12-08 17:30:24 +04:00
$( DESTDIR) $( SYSTEMD_UNIT_DIR) /libvirt-guests.service
2011-07-07 17:45:07 +04:00
2012-10-21 06:29:51 +04:00
uninstall-systemd : uninstall -sysconfig
2011-12-08 17:30:24 +04:00
rm -f $( DESTDIR) $( SYSTEMD_UNIT_DIR) /libvirt-guests.service
build: follow directory install conventions
Commit 4d9e51f6 fixed a 'make uninstall' failure, but failed
to follow other conventions already present in src/Makefile.am.
In particular, we prefer MKDIR_P over mkdir -p, and should
have a matching rmdir during uninstall for every directory
created during install (the idea being that uninstall in a
DESTDIR should be clean, while installation in the final
system should not fail with non-empty directories left behind).
* tools/Makefile.am (install-sysconfig, install-initscript)
(install-systemd): Use MKDIR_P.
(uninstall-sysconfig, uninstall-initscript, uninstall-systemd):
Also remove directories.
* daemon/Makefile.am (install-data-local, install-data-polkit)
(install-logrotate, install-sysconfig, install-sysctl)
(install-init-redhat, install-init-upstart, install-init-systemd)
(install-data-sasl): Use MKDIR_P.
(uninstall-data-polkit, uninstall-sysconfig, uninstall-sysctl)
(uninstall-init-redhat, uninstall-init-upstart)
(uninstall-init-systemd): Also remove directory.
(uninstall-logrotate): New rule.
(uninstall-local): Add uninstall-logrotate.
2011-12-09 22:06:19 +04:00
rmdir $( DESTDIR) $( SYSTEMD_UNIT_DIR) || :
2011-07-07 17:45:07 +04:00
BUILT_SOURCES += libvirt-guests.service
2013-09-04 06:39:16 +04:00
e l s e ! L I B V I R T _ I N I T _ S C R I P T _ S Y S T E M D
2011-07-07 17:45:07 +04:00
install-systemd :
uninstall-systemd :
2013-09-04 06:39:16 +04:00
e n d i f ! L I B V I R T _ I N I T _ S C R I P T _ S Y S T E M D
2011-07-07 17:45:07 +04:00
libvirt-guests.service : libvirt -guests .service .in $( top_builddir ) /config .status
2017-11-03 15:09:47 +03:00
$( AM_V_GEN) sed \
-e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \
-e 's|[@]bindir[@]|$(bindir)|g' \
-e 's|[@]localedir[@]|$(localedir)|g' \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's|[@]sbindir[@]|$(sbindir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
-e 's|[@]libexecdir[@]|$(libexecdir)|g' \
< $< > $@ -t && \
2011-07-07 17:45:07 +04:00
mv $@ -t $@
2010-08-25 16:07:26 +04:00
2009-04-19 19:10:45 +04:00
2017-11-02 16:41:53 +03:00
i f W I T H _ B A S H _ C O M P L E T I O N
install-bash-completion :
$( MKDIR_P) " $( DESTDIR) $( BASH_COMPLETIONS_DIR) "
$( INSTALL_SCRIPT) $( srcdir) /bash-completion/vsh \
" $( DESTDIR) $( BASH_COMPLETIONS_DIR) /vsh "
2018-01-24 18:42:00 +03:00
( cd $( DESTDIR) $( BASH_COMPLETIONS_DIR) && \
2018-01-31 20:30:55 +03:00
rm -f virsh virt-admin && \
2018-01-24 18:42:00 +03:00
$( LN_S) vsh virsh && \
$( LN_S) vsh virt-admin )
2017-11-02 16:41:53 +03:00
uninstall-bash-completion :
2018-01-24 18:42:00 +03:00
rm -f $( DESTDIR) $( BASH_COMPLETIONS_DIR) /vsh \
$( DESTDIR) $( BASH_COMPLETIONS_DIR) /virsh \
$( DESTDIR) $( BASH_COMPLETIONS_DIR) /virt-admin
2017-11-02 16:41:53 +03:00
rmdir $( DESTDIR) $( BASH_COMPLETIONS_DIR) || :
e l s e ! W I T H _ B A S H _ C O M P L E T I O N
install-bash-completion :
uninstall-bash-completion :
e n d i f ! W I T H _ B A S H _ C O M P L E T I O N
2016-01-10 23:35:36 +03:00
EXTRA_DIST += \
wireshark/util/genxdrstub.pl \
wireshark/util/make-dissector-reg
i f W I T H _ W I R E S H A R K _ D I S S E C T O R
ws_plugin_LTLIBRARIES = wireshark/src/libvirt.la
2017-11-16 16:34:31 +03:00
wireshark_src_libvirt_la_CFLAGS = \
2017-11-16 16:24:45 +03:00
-I wireshark/src $( WIRESHARK_DISSECTOR_CFLAGS) $( XDR_CFLAGS)
2016-01-10 23:35:36 +03:00
wireshark_src_libvirt_la_LDFLAGS = -avoid-version -module
2016-01-12 23:56:42 +03:00
nodist_wireshark_src_libvirt_la_SOURCES = wireshark/src/plugin.c
2016-01-10 23:35:36 +03:00
wireshark_src_libvirt_la_SOURCES = \
wireshark/src/packet-libvirt.h \
2016-01-12 23:56:42 +03:00
wireshark/src/packet-libvirt.c
2016-01-10 23:35:36 +03:00
wireshark/src/packet-libvirt.c : wireshark /src /packet -libvirt .h \
wireshark/src/libvirt/protocol.h
wireshark/src/plugin.c : wireshark /src /packet -libvirt .c
2017-08-04 20:12:13 +03:00
$( AM_V_GEN) cd wireshark/src && \
2016-01-10 23:35:36 +03:00
$( abs_top_srcdir) /tools/wireshark/util/make-dissector-reg \
. plugin packet-libvirt.c
WS_DISSECTOR_PROTO_FILES = \
$( abs_top_srcdir) /src/remote/remote_protocol.x \
$( abs_top_srcdir) /src/remote/qemu_protocol.x \
$( abs_top_srcdir) /src/remote/lxc_protocol.x \
$( abs_top_srcdir) /src/rpc/virkeepaliveprotocol.x
wireshark/src/libvirt/protocol.h : wireshark /util /genxdrstub .pl \
$( WS_DISSECTOR_PROTO_FILES)
2017-08-04 20:12:13 +03:00
$( AM_V_GEN) $( MKDIR_P) wireshark/src/libvirt && \
2016-01-10 23:35:36 +03:00
cd wireshark/src && \
LIBVIRT_VERSION = $( LIBVIRT_VERSION) \
$( PERL) $( abs_top_srcdir) /tools/wireshark/util/genxdrstub.pl \
$( WS_DISSECTOR_PROTO_FILES)
CLEANFILES += wireshark/src/plugin.c
e n d i f W I T H _ W I R E S H A R K _ D I S S E C T O R
2016-03-27 21:07:10 +03:00
i f W I T H _ B S D _ N S S
LIBVIRT_NSS_SYMBOL_FILE = \
$( srcdir) /nss/libvirt_nss_bsd.syms
2016-11-29 15:48:53 +03:00
LIBVIRT_GUEST_NSS_SYMBOL_FILE = \
$( LIBVIRT_NSS_SYMBOL_FILE)
2016-03-27 21:07:10 +03:00
NSS_SO_VER = 1
2016-04-20 11:14:23 +03:00
install-nss :
2016-04-20 20:24:22 +03:00
( cd $( DESTDIR) $( libdir) && \
2016-04-21 14:16:56 +03:00
rm -f nss_libvirt.so.$( NSS_SO_VER) && \
2016-11-29 15:48:53 +03:00
$( LN_S) libnss_libvirt.so.$( NSS_SO_VER) nss_libvirt.so.$( NSS_SO_VER) && \
rm -f nss_libvirt_guest.so.$( NSS_SO_VER) && \
$( LN_S) libnss_libvirt_guest.so.$( NSS_SO_VER) \
nss_libvirt_guest.so.$( NSS_SO_VER) )
2016-03-27 21:07:10 +03:00
2016-04-20 11:14:23 +03:00
uninstall-nss :
2016-04-19 12:08:48 +03:00
-rm -f $( DESTDIR) $( libdir) /nss_libvirt.so.$( NSS_SO_VER)
2016-11-29 15:48:53 +03:00
-rm -f $( DESTDIR) $( libdir) /nss_libvirt_guest.so.$( NSS_SO_VER)
2016-03-27 21:07:10 +03:00
e l s e ! W I T H _ B S D _ N S S
2016-02-13 11:27:50 +03:00
LIBVIRT_NSS_SYMBOL_FILE = \
$( srcdir) /nss/libvirt_nss.syms
2016-11-29 15:48:53 +03:00
LIBVIRT_GUEST_NSS_SYMBOL_FILE = \
$( srcdir) /nss/libvirt_guest_nss.syms
2016-03-27 21:07:10 +03:00
NSS_SO_VER = 2
2016-04-20 11:14:23 +03:00
install-nss :
uninstall-nss :
2016-03-27 21:07:10 +03:00
e n d i f ! W I T H _ B S D _ N S S
2016-02-13 11:27:50 +03:00
LIBVIRT_NSS_SOURCES = \
2017-11-03 15:09:47 +03:00
nss/libvirt_nss.c \
2016-02-13 11:27:50 +03:00
nss/libvirt_nss.h
2016-03-19 19:56:02 +03:00
i f W I T H _ N S S
2016-02-13 11:27:50 +03:00
noinst_LTLIBRARIES += nss/libnss_libvirt_impl.la
nss_libnss_libvirt_impl_la_SOURCES = \
$( LIBVIRT_NSS_SOURCES)
nss_libnss_libvirt_impl_la_CFLAGS = \
2017-11-03 15:09:47 +03:00
-DLIBVIRT_NSS \
$( AM_CFLAGS) \
2017-11-16 16:35:12 +03:00
$( NULL)
2016-02-14 13:38:37 +03:00
nss_libnss_libvirt_impl_la_LIBADD = \
2017-11-03 15:09:47 +03:00
../gnulib/lib/libgnu.la \
2018-08-13 14:38:28 +03:00
../src/libvirt-nss.la
2016-02-13 11:27:50 +03:00
nss_libnss_libvirt_la_SOURCES =
nss_libnss_libvirt_la_LDFLAGS = \
2017-11-03 15:09:47 +03:00
$( VERSION_SCRIPT_FLAGS) $( LIBVIRT_NSS_SYMBOL_FILE) \
2016-02-13 11:27:50 +03:00
$( AM_LDFLAGS) \
-module \
-export-dynamic \
-avoid-version \
-shared \
2016-03-27 21:07:10 +03:00
-shrext .so.$( NSS_SO_VER)
2016-02-13 11:27:50 +03:00
2017-11-03 15:09:47 +03:00
nss_libnss_libvirt_la_LIBADD = \
2016-02-13 11:27:50 +03:00
nss/libnss_libvirt_impl.la
2016-11-29 15:48:53 +03:00
noinst_LTLIBRARIES += nss/libnss_libvirt_guest_impl.la
nss_libnss_libvirt_guest_impl_la_SOURCES = \
$( LIBVIRT_NSS_SOURCES)
nss_libnss_libvirt_guest_impl_la_CFLAGS = \
2017-11-03 15:09:47 +03:00
-DLIBVIRT_NSS \
-DLIBVIRT_NSS_GUEST \
$( AM_CFLAGS) \
2017-11-16 16:35:12 +03:00
$( NULL)
2016-11-29 15:48:53 +03:00
nss_libnss_libvirt_guest_impl_la_LIBADD = \
2017-11-03 15:09:47 +03:00
../gnulib/lib/libgnu.la \
2018-08-13 14:38:28 +03:00
../src/libvirt-nss.la
2016-11-29 15:48:53 +03:00
nss_libnss_libvirt_guest_la_SOURCES =
nss_libnss_libvirt_guest_la_LDFLAGS = \
2017-11-03 15:09:47 +03:00
$( VERSION_SCRIPT_FLAGS) $( LIBVIRT_GUEST_NSS_SYMBOL_FILE) \
2016-11-29 15:48:53 +03:00
$( AM_LDFLAGS) \
-module \
-export-dynamic \
-avoid-version \
-shared \
-shrext .so.$( NSS_SO_VER)
2017-11-03 15:09:47 +03:00
nss_libnss_libvirt_guest_la_LIBADD = \
2016-11-29 15:48:53 +03:00
nss/libnss_libvirt_guest_impl.la
2016-02-13 11:27:50 +03:00
lib_LTLIBRARIES = \
2016-11-29 15:48:53 +03:00
nss/libnss_libvirt.la \
nss/libnss_libvirt_guest.la
2016-02-13 11:27:50 +03:00
e n d i f W I T H _ N S S
2016-04-09 08:17:14 +03:00
EXTRA_DIST += $( LIBVIRT_NSS_SOURCES) \
$( srcdir) /nss/libvirt_nss.syms \
2017-11-03 15:09:47 +03:00
$( srcdir) /nss/libvirt_nss_bsd.syms \
2016-11-29 15:48:53 +03:00
$( srcdir) /nss/libvirt_guest_nss.syms
2016-01-10 23:35:36 +03:00
clean-local :
-rm -rf wireshark/src/libvirt
CLEANFILES += $( bin_SCRIPTS)
2010-11-17 20:38:59 +03:00
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
2016-04-12 23:05:15 +03:00
CLEANFILES += $( man1_MANS) $( man8_MANS)
2009-04-19 19:10:45 +04:00
2011-10-12 01:10:17 +04:00
DISTCLEANFILES += $( BUILT_SOURCES)
2016-04-13 18:12:24 +03:00
MAINTAINERCLEANFILES += $( MANINFILES)