1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
# libguestfs Lua bindings
# Copyright (C) 2012 Red Hat Inc.
#
# 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 2 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
include $(top_srcdir)/subdir-rules.mk
lualibdir = $(libdir)/lua/$(LUA_VERSION)
generator_built = \
bindtests.lua \
lua-guestfs.c
EXTRA_DIST = \
$(generator_built) \
run-bindtests
CLEANFILES += \
guestfs.so
if HAVE_LUA
# Libtool forces us to use 'libluaguestfs.so' instead of the desired
# name 'guestfs.so'. However we'll rename it in the install hook.
# Cannot use 'noinst' here as that prevents the shared library from
# being built at all.
lualib_LTLIBRARIES = libluaguestfs.la
libluaguestfs_la_SOURCES = lua-guestfs.c
libluaguestfs_la_CPPFLAGS = \
-DGUESTFS_PRIVATE=1 \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
-I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/lib -I$(top_builddir)/lib
libluaguestfs_la_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
$(LUA_CFLAGS)
libluaguestfs_la_LIBADD = \
$(top_builddir)/common/utils/libutils.la \
$(top_builddir)/lib/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
../gnulib/lib/libgnu.la
libluaguestfs_la_LDFLAGS = -avoid-version -shared
# Hack so we can run without installing.
noinst_DATA = guestfs.so
guestfs.so: libluaguestfs.la
ln -sf .libs/libluaguestfs.so $@
# Tests.
TESTS_ENVIRONMENT = LC_ALL=C $(top_builddir)/run --test
TESTS = \
run-bindtests \
tests/010-load.lua \
tests/015-globals.lua \
tests/020-create.lua \
tests/025-create-flags.lua \
tests/027-create-multiple.lua \
tests/030-config.lua \
tests/070-optargs.lua \
tests/400-events.lua \
tests/900-errors.lua
if ENABLE_APPLIANCE
TESTS += \
tests/050-lvcreate.lua \
tests/060-readdir.lua \
tests/400-progress.lua
endif
EXTRA_DIST += \
tests/010-load.lua \
tests/015-globals.lua \
tests/020-create.lua \
tests/025-create-flags.lua \
tests/027-create-multiple.lua \
tests/030-config.lua \
tests/050-lvcreate.lua \
tests/060-readdir.lua \
tests/070-optargs.lua \
tests/400-events.lua \
tests/400-progress.lua \
tests/900-errors.lua
# Run the tests under valgrind.
# This doesn't work. Because Lua dlcloses the library on exit, the
# stack traces contain no useful information. The only way to make
# this work would be to patch Lua or fix valgrind.
# https://bugs.kde.org/show_bug.cgi?id=79362
# http://valgrind.org/docs/manual/faq.html#faq.unhelpful
#check-valgrind:
# $(MAKE) VG="@VG@" check
# Custom install rule.
install-data-hook:
mkdir -p $(DESTDIR)$(lualibdir)
mv $(DESTDIR)$(lualibdir)/libluaguestfs.so $(DESTDIR)$(lualibdir)/guestfs.so
endif
|