diff --git a/ChangeLog b/ChangeLog index 79b1ab4e73805d25fa2625e84295652437def0b2..4c14c587eb8f74a651f22c7390f25c9acab1e5a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Thu Nov 29 17:40:00 GMT 2007 Richard W.M. Jones + + * configure.in: Added CYGWIN_EXTRA_LDFLAGS, CYGWIN_EXTRA_LIBADD, + CYGWIN_EXTRA_PYTHON_LIBADD, CYGWIN automake conditional. + * src/Makefile.am: Extra flags required to build DLL of libvirt + for Cygwin. + * python/Makefile.am: Extra flags and rule required to build + Python module for Cygwin. + Thu Nov 29 17:38:00 GMT 2007 Richard W.M. Jones * configure.in: Check for C compiler first before checking for diff --git a/configure.in b/configure.in index eab69b308bfa18bfc8fb7b80e9ca651088c16d09..3beb06da53683f273f0286f2fede6ea9126f9322 100644 --- a/configure.in +++ b/configure.in @@ -536,6 +536,28 @@ else ALL_LINGUAS="af am ar as be bg bn_IN bn ca cs cy da de el en_GB es et eu_ES fa fi fr gl gu he hi hr hu hy id is it ja ka kn ko ku lo lt lv mk ml mr ms my nb nl nn no nso or pa pl pt_BR pt ro ru si sk sl sq sr@Latn sr sv ta te th tr uk ur vi zh_CN zh_TW zu" fi +dnl Extra link-time flags for Cygwin. +dnl Copied from libxml2 configure.in, but I removed mingw changes +dnl for now since I'm not supporting mingw at present. - RWMJ +cygwin= +CYGWIN_EXTRA_LDFLAGS= +CYGWIN_EXTRA_LIBADD= +CYGWIN_EXTRA_PYTHON_LIBADD= +case "$host" in + *-*-cygwin*) + cygwin=yes + CYGWIN_EXTRA_LDFLAGS="-no-undefined" + CYGWIN_EXTRA_LIBADD="${INTLLIBS}" + if test "x$PYTHON_VERSION" != "x"; then + CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}" + fi + ;; +esac +AC_SUBST(CYGWIN_EXTRA_LDFLAGS) +AC_SUBST(CYGWIN_EXTRA_LIBADD) +AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD) +AM_CONDITIONAL(CYGWIN,[test "x$cygwin" = "xyes"]) + # very annoying rm -f COPYING cp COPYING.LIB COPYING diff --git a/python/Makefile.am b/python/Makefile.am index 1fe60ff42110f79489ddde81d037dfba6383a996..d02156702db4536f128e2570178524618acbfea7 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -23,8 +23,6 @@ EXTRA_DIST = \ libvirt-python-api.xml \ $(DOCS) -libvirtmod_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/src/.libs - if WITH_PYTHON mylibs = $(top_builddir)/src/libvirt.la @@ -33,10 +31,14 @@ all-local: libvirt.py python_LTLIBRARIES = libvirtmod.la libvirtmod_la_SOURCES = libvir.c types.c libvirt-py.c libvirt-py.h -libvirtmod_la_LIBADD = $(mylibs) # Python header files contain a redundant decl, hence: libvirtmod_la_CFLAGS = -Wno-redundant-decls +libvirtmod_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/src/.libs \ + @CYGWIN_EXTRA_LDFLAGS@ +libvirtmod_la_LIBADD = $(mylibs) \ + @CYGWIN_EXTRA_LIBADD@ @CYGWIN_EXTRA_PYTHON_LIBADD@ + GENERATE = generator.py API_DESC = $(top_srcdir)/docs/libvirt-api.xml $(srcdir)/libvirt-python-api.xml GENERATED= libvirt-export.c \ @@ -61,6 +63,13 @@ install-data-local: @(for doc in $(DOCS) ; \ do @INSTALL@ -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done) +if CYGWIN +install-data-hook: + cd $(DESTDIR)$(pythondir) && \ + rm -f libvirtmod.dll && \ + ln -s cygvirtmod.dll libvirtmod.dll +endif + uninstall-local: rm -f $(DESTDIR)$(pythondir)/libvirt.py diff --git a/src/Makefile.am b/src/Makefile.am index 5eeddac2e9a99d5ea5d5c09388c1a312e7a60d1c..52ffbaf67a7c6d9106e2c44841f59fc607dd98b3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,11 +24,6 @@ conf_DATA = qemu.conf EXTRA_DIST = libvirt_sym.version $(conf_DATA) lib_LTLIBRARIES = libvirt.la -libvirt_la_LIBADD = $(LIBXML_LIBS) $(GNUTLS_LIBS) -libvirt_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libvirt_sym.version \ - -version-info @LIBVIRT_VERSION_INFO@ \ - $(COVERAGE_CFLAGS:-f%=-Wc,-f%) -libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) CLIENT_SOURCES = \ libvirt.c internal.h \ @@ -64,6 +59,13 @@ SERVER_SOURCES = \ ../qemud/remote_protocol.c ../qemud/remote_protocol.h libvirt_la_SOURCES = $(CLIENT_SOURCES) $(SERVER_SOURCES) +libvirt_la_LIBADD = $(LIBXML_LIBS) $(GNUTLS_LIBS) $(LTLIBOBJS) \ + @CYGWIN_EXTRA_LIBADD@ +libvirt_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libvirt_sym.version \ + -version-info @LIBVIRT_VERSION_INFO@ \ + $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \ + @CYGWIN_EXTRA_LDFLAGS@ +libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) bin_PROGRAMS = virsh