[Pkg-libvirt-commits] [libguestfs] 79/384: resize: Use automake to build the binary.
Hilko Bengen
bengen at moszumanska.debian.org
Sun Mar 29 16:55:46 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch experimental
in repository libguestfs.
commit bd74c6f09a5b5a0211accd689c88471589fec0f4
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Fri Dec 12 09:43:52 2014 +0000
resize: Use automake to build the binary.
---
.gitignore | 1 +
configure.ac | 2 +
resize/Makefile.am | 110 +++++++++++++++++++++++++----------------------------
resize/link.sh.in | 22 +++++++++++
4 files changed, 76 insertions(+), 59 deletions(-)
diff --git a/.gitignore b/.gitignore
index 3e8e7cf..d90ef8f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -415,6 +415,7 @@ Makefile.in
/rescue/virt-rescue
/rescue/virt-rescue.1
/resize/.depend
+/resize/link.sh
/resize/stamp-virt-resize.pod
/resize/virt-resize
/resize/virt-resize.1
diff --git a/configure.ac b/configure.ac
index acf7579..67f8d84 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1677,6 +1677,8 @@ AC_CONFIG_FILES([pick-guests.pl],
[chmod +x,-w pick-guests.pl])
AC_CONFIG_FILES([podwrapper.pl],
[chmod +x,-w podwrapper.pl])
+AC_CONFIG_FILES([resize/link.sh],
+ [chmod +x,-w resize/link.sh])
AC_CONFIG_FILES([run],
[chmod +x,-w run])
AC_CONFIG_FILES([sparsify/link.sh],
diff --git a/resize/Makefile.am b/resize/Makefile.am
index 234b904..46402c1 100644
--- a/resize/Makefile.am
+++ b/resize/Makefile.am
@@ -18,40 +18,49 @@
include $(top_srcdir)/subdir-rules.mk
EXTRA_DIST = \
- $(SOURCES) \
+ $(SOURCES_MLI) $(SOURCES_ML) $(SOURCES_C) \
virt-resize.pod \
test-virt-resize.pl
CLEANFILES = *~ *.annot *.cmi *.cmo *.cmx *.cmxa *.o virt-resize
-# Alphabetical order.
-SOURCES = \
+SOURCES_MLI =
+
+SOURCES_ML = \
resize.ml
-if HAVE_OCAML
+SOURCES_C = \
+ $(top_srcdir)/mllib/fsync-c.c \
+ $(top_srcdir)/fish/progress.c \
+ $(top_srcdir)/mllib/progress-c.c \
+ $(top_srcdir)/fish/uri.c \
+ $(top_srcdir)/mllib/uri-c.c
-# Note this list must be in dependency order.
-deps = \
- $(top_builddir)/mllib/fsync-c.o \
- $(top_builddir)/mllib/fsync.cmx \
- $(top_builddir)/fish/guestfish-progress.o \
- $(top_builddir)/mllib/progress-c.o \
- $(top_builddir)/mllib/progress.cmx \
- $(top_builddir)/fish/guestfish-uri.o \
- $(top_builddir)/mllib/uri-c.o \
- $(top_builddir)/mllib/uRI.cmx \
- $(top_builddir)/mllib/common_gettext.cmx \
- $(top_builddir)/mllib/common_utils.cmx \
- $(top_builddir)/mllib/config.cmx \
- resize.cmx
+if HAVE_OCAML
-if HAVE_OCAMLOPT
-OBJECTS = $(deps)
-else
-OBJECTS = $(patsubst %.cmx,%.cmo,$(deps))
-endif
+bin_PROGRAMS = virt-resize
-bin_SCRIPTS = virt-resize
+virt_resize_SOURCES = $(SOURCES_C)
+virt_resize_CPPFLAGS = \
+ -I. \
+ -I$(top_builddir) \
+ -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(shell $(OCAMLC) -where) \
+ -I$(top_srcdir)/src \
+ -I$(top_srcdir)/fish
+virt_resize_CFLAGS = \
+ $(WARN_CFLAGS) $(WERROR_CFLAGS) \
+ $(LIBXML2_CFLAGS)
+
+BOBJECTS = \
+ $(top_builddir)/mllib/fsync.cmo \
+ $(top_builddir)/mllib/progress.cmo \
+ $(top_builddir)/mllib/uRI.cmo \
+ $(top_builddir)/mllib/common_gettext.cmo \
+ $(top_builddir)/mllib/common_utils.cmo \
+ $(top_builddir)/mllib/config.cmo \
+ $(SOURCES_ML:.ml=.cmo)
+XOBJECTS = $(BOBJECTS:.cmo=.cmx)
# -I $(top_builddir)/src/.libs is a hack which forces corresponding -L
# option to be passed to gcc, so we don't try linking against an
@@ -59,57 +68,40 @@ bin_SCRIPTS = virt-resize
OCAMLPACKAGES = \
-package str,unix \
-I $(top_builddir)/src/.libs \
+ -I $(top_builddir)/gnulib/lib/.libs \
-I $(top_builddir)/ocaml \
-I $(top_builddir)/mllib
if HAVE_OCAML_PKG_GETTEXT
OCAMLPACKAGES += -package gettext-stub
endif
-OCAMLCFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) $(OCAMLPACKAGES)
-OCAMLOPTFLAGS = $(OCAMLCFLAGS)
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
-OCAMLCLIBS = \
- $(LIBXML2_LIBS) $(LIBINTL) $(LIBTINFO_LIBS) \
- -L../src/.libs -lutils \
- -L../gnulib/lib/.libs -lgnu
-
-if HAVE_OCAMLOPT
-virt-resize: $(OBJECTS)
- $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
- mlguestfs.cmxa -linkpkg $^ \
- -cclib '$(OCAMLCLIBS)' \
- -o $@
+if !HAVE_OCAMLOPT
+OBJECTS = $(BOBJECTS)
+BEST = c
+OCAMLLINKFLAGS = mlguestfs.cma -custom
else
-virt-resize: $(OBJECTS)
- $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) \
- mlguestfs.cma -linkpkg $^ \
- -cclib '$(OCAMLCLIBS)' \
- -custom \
- -o $@
+OBJECTS = $(XOBJECTS)
+BEST = opt
+OCAMLLINKFLAGS = mlguestfs.cmxa
endif
+virt_resize_DEPENDENCIES = $(OBJECTS)
+virt_resize_LINK = \
+ ./link.sh \
+ $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) $(OCAMLLINKFLAGS) \
+ $(OBJECTS) -o $@
+
.mli.cmi:
- $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
+ $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
.ml.cmo:
- $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
+ $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
if HAVE_OCAMLOPT
.ml.cmx:
- $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@
+ $(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
endif
-# automake will decide we don't need C support in this file. Really
-# we do, so we have to provide it ourselves.
-
-DEFAULT_INCLUDES = \
- -I. \
- -I$(top_builddir) \
- -I$(shell $(OCAMLC) -where) \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/fish
-
-.c.o:
- $(CC) $(CFLAGS) $(PROF_CFLAGS) $(DEFAULT_INCLUDES) -c $< -o $@
-
# Manual pages and HTML files for the website.
man_MANS = virt-resize.1
diff --git a/resize/link.sh.in b/resize/link.sh.in
new file mode 100644
index 0000000..2835f0e
--- /dev/null
+++ b/resize/link.sh.in
@@ -0,0 +1,22 @@
+# libguestfs Makefile.am
+# @configure_input@
+# (C) Copyright 2014 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Hack automake to link binary properly. There is no other way to add
+# the -cclib parameter to the end of the command line.
+
+exec "$@" -linkpkg -cclib '-lutils @LIBTINFO_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu'
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list