summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5f9cb51)
This patch allows you to do:
mkdir build
cd build
../configure ...
make
This will output all generated files to the build directory. Given that
autogen automatically runs configure, you can also do:
BUILDDIR=./build ./autogen.sh
which will do the right thing.
Also:
* Fix a dependency bug which means that guestfs_protocol.h
isn't automatically rebuilt.
* Re-running autogen.sh with no arguments won't blow away your previous
configure arguments.
22 files changed:
noinst_DATA = $(debirf_symlinks:%=debian/modules/%)
$(debirf_symlinks:%=debian/modules/%): stamp-debirf-modules
stamp-debirf-modules:
noinst_DATA = $(debirf_symlinks:%=debian/modules/%)
$(debirf_symlinks:%=debian/modules/%): stamp-debirf-modules
stamp-debirf-modules:
+ mkdir -p debian/modules
for f in $(debirf_symlinks); do \
ln -sf /usr/share/debirf/modules/$$f debian/modules/$$f; \
done
for f in $(debirf_symlinks); do \
ln -sf /usr/share/debirf/modules/$$f debian/modules/$$f; \
done
if [ "@DIST@" = "REDHAT" ]; then
cd @top_builddir@
if [ "@DIST@" = "REDHAT" ]; then
cd @top_builddir@
# Don't need any keyboard maps.
@FEBOOTSTRAP_RUN@ initramfs -- rm -rf /lib/kbd
# Don't need any keyboard maps.
@FEBOOTSTRAP_RUN@ initramfs -- rm -rf /lib/kbd
- # Remove anything in home directory. Because this is potentially
- # liable to monstrous fuck-ups, we don't put a slash before 'home'.
+ # Remove anything in home directory. Because of the potential for disaster
+ # we don't put a slash before 'home'.
(cd initramfs && echo home/*) |
xargs @FEBOOTSTRAP_RUN@ initramfs -- rm -rf
(cd initramfs && echo home/*) |
xargs @FEBOOTSTRAP_RUN@ initramfs -- rm -rf
output=appliance/initramfs.@REPO@.@host_cpu@.img
# Create the init script.
output=appliance/initramfs.@REPO@.@host_cpu@.img
# Create the init script.
- @FEBOOTSTRAP_INSTALL@ initramfs appliance/init /init 0755 root.root
+ @FEBOOTSTRAP_INSTALL@ initramfs appliance/@top_srcdir@/appliance/init /init 0755 root.root
# Copy the daemon into the filesystem.
@FEBOOTSTRAP_INSTALL@ initramfs daemon/guestfsd /sbin/guestfsd 0755 root.root
# Copy the daemon into the filesystem.
@FEBOOTSTRAP_INSTALL@ initramfs daemon/guestfsd /sbin/guestfsd 0755 root.root
-export AUTOMAKE='automake --foreign'
-aclocal
-libtoolize
-autoreconf -i
-pushd daemon
+
+CONFIGUREDIR=.
+
+# Run configure in BUILDDIR if it's set
+if [ ! -z "$BUILDDIR" ]; then
+ mkdir -p $BUILDDIR
+ cd $BUILDDIR
+
+ CONFIGUREDIR=..
+fi
+
+# If no arguments were specified and configure has run before, use the previous
+# arguments
+if [ $# == 0 -a -x ./config.status ]; then
+ ./config.status --recheck
+else
+ $CONFIGUREDIR/configure "$@"
+fi
check_PROGRAMS = tests test-command
tests_SOURCES = tests.c
check_PROGRAMS = tests test-command
tests_SOURCES = tests.c
-tests_CFLAGS = \
- -I$(top_builddir)/src -Wall
+tests_CFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src -Wall
tests_LDADD = $(top_builddir)/src/libguestfs.la
TESTS = tests
tests_LDADD = $(top_builddir)/src/libguestfs.la
TESTS = tests
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
AC_INIT([libguestfs],[1.0.55])
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
AC_INIT([libguestfs],[1.0.55])
+AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_MACRO_DIR([m4])
wc.c \
zero.c \
zerofree.c \
wc.c \
zero.c \
zerofree.c \
- ../src/guestfs_protocol.h \
- ../src/guestfs_protocol.c
+ $(top_builddir)/../src/guestfs_protocol.h \
+ $(top_builddir)/../src/guestfs_protocol.c
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
AC_INIT([libguestfs-daemon],[1.0.0])
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
AC_INIT([libguestfs-daemon],[1.0.0])
+AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_MACRO_DIR([m4])
noinst_PROGRAMS = hello to-xml
hello_SOURCES = hello.c
noinst_PROGRAMS = hello to-xml
hello_SOURCES = hello.c
-hello_CFLAGS = -I$(top_builddir)/src -Wall
+hello_CFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src -Wall
hello_LDADD = $(top_builddir)/src/libguestfs.la
to_xml_SOURCES = to-xml.c
hello_LDADD = $(top_builddir)/src/libguestfs.la
to_xml_SOURCES = to-xml.c
-to_xml_CFLAGS = -I$(top_builddir)/src -Wall
+to_xml_CFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src -Wall
to_xml_LDADD = $(top_builddir)/src/libguestfs.la
CLEANFILES = $(noinst_PROGRAMS)
to_xml_LDADD = $(top_builddir)/src/libguestfs.la
CLEANFILES = $(noinst_PROGRAMS)
time.c
guestfish_CFLAGS = \
time.c
guestfish_CFLAGS = \
- -I$(top_builddir)/src -Wall \
+ -I$(top_srcdir)/src -I$(top_builddir)/src -Wall \
-DGUESTFS_DEFAULT_PATH='"$(libdir)/guestfs"'
guestfish_LDADD = $(top_builddir)/src/libguestfs.la $(LIBREADLINE)
-DGUESTFS_DEFAULT_PATH='"$(libdir)/guestfs"'
guestfish_LDADD = $(top_builddir)/src/libguestfs.la $(LIBREADLINE)
-GHCFLAGS = -I$(abs_top_builddir)/src -L$(abs_top_builddir)/src/.libs
+GHCFLAGS = -I$(top_builddir)/src -L$(top_builddir)/src/.libs
Bindtests: Bindtests.hs Guestfs.hs
$(GHC) $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs
Bindtests: Bindtests.hs Guestfs.hs
$(GHC) $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs
Guestfs050LVCreate: Guestfs050LVCreate.hs Guestfs.hs
$(GHC) $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs
Guestfs050LVCreate: Guestfs050LVCreate.hs Guestfs.hs
$(GHC) $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs
-endif
\ No newline at end of file
100kallzeroes 100kallnewlines 100kallspaces 100krandom 10klines \
initrd
100kallzeroes 100kallnewlines 100kallspaces 100krandom 10klines \
initrd
-squash_files = helloworld.tar helloworld.tar.gz empty known-1 known-2 known-3 \
- 100kallzeroes 100kallnewlines 100kallspaces 100krandom 10klines \
- initrd
+squash_files_src = \
+ $(srcdir)/helloworld.tar \
+ $(srcdir)/helloworld.tar.gz \
+ $(srcdir)/empty \
+ $(srcdir)/known-1 \
+ $(srcdir)/known-2 \
+ $(srcdir)/known-3
+
+squash_files_build = \
+ $(builddir)/100kallzeroes \
+ $(builddir)/100kallnewlines \
+ $(builddir)/100kallspaces \
+ $(builddir)/100krandom \
+ $(builddir)/10klines \
+ $(builddir)/initrd
+
+squash_files = $(squash_files_src) $(squash_files_build)
test.sqsh: $(squash_files)
rm -f $@
test.sqsh: $(squash_files)
rm -f $@
man_MANS = virt-inspector.1
man_MANS = virt-inspector.1
-noinst_DATA = ../html/virt-inspector.1.html
+noinst_DATA = @top_builddir@/html/virt-inspector.1.html
virt-inspector.1: virt-inspector.pl
$(POD2MAN) \
virt-inspector.1: virt-inspector.pl
$(POD2MAN) \
--release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
$< > $@
--release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
$< > $@
-../html/virt-inspector.1.html: virt-inspector.pl
- cd .. && pod2html \
+@top_builddir@/html/virt-inspector.1.html: virt-inspector.pl
+ mkdir -p @top_builddir@/html
+ cd @top_builddir@ && pod2html \
--css 'pod.css' \
--title 'virt-inspector, display OS version, kernel, drivers, mount points, applications, etc. in a virtual machine' \
--htmldir html \
--css 'pod.css' \
--title 'virt-inspector, display OS version, kernel, drivers, mount points, applications, etc. in a virtual machine' \
--htmldir html \
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-CPTH = com/redhat/et/libguestfs
+java_prefix = com/redhat/et/libguestfs
- $(CPTH)/LibGuestFSException.java \
- $(CPTH)/IntBool.java \
- $(CPTH)/PV.java \
- $(CPTH)/VG.java \
- $(CPTH)/LV.java \
- $(CPTH)/Stat.java \
- $(CPTH)/StatVFS.java \
- $(CPTH)/Dirent.java \
- $(CPTH)/GuestFS.java
+ $(java_prefix)/LibGuestFSException.java \
+ $(java_prefix)/IntBool.java \
+ $(java_prefix)/PV.java \
+ $(java_prefix)/VG.java \
+ $(java_prefix)/LV.java \
+ $(java_prefix)/Stat.java \
+ $(java_prefix)/StatVFS.java \
+ $(java_prefix)/Dirent.java \
+ $(java_prefix)/GuestFS.java
java_tests = \
Bindtests.java \
java_tests = \
Bindtests.java \
libguestfs_jar_DATA = libguestfs-${VERSION}.jar
libguestfs_jar_class_files = $(java_sources:.java=.class)
$(libguestfs_jar_class_files): %.class: %.java
libguestfs_jar_DATA = libguestfs-${VERSION}.jar
libguestfs_jar_class_files = $(java_sources:.java=.class)
$(libguestfs_jar_class_files): %.class: %.java
- $(JAVAC) $(JAVAC_FLAGS) -classpath $(CPTH) $(java_sources)
+ $(JAVAC) $(JAVAC_FLAGS) -d @builddir@ -classpath @srcdir@:@builddir@ -sourcepath @srcdir@:@builddir@ $<
libguestfs-${VERSION}.jar: $(libguestfs_jar_class_files)
$(JAR) cf $@ $^
libguestfs-${VERSION}.jar: $(libguestfs_jar_class_files)
$(JAR) cf $@ $^
libguestfs_jni_la_LIBADD = $(top_builddir)/src/libguestfs.la
libguestfs_jni_la_LDFLAGS = -version-info $(JNI_VERSION_INFO)
libguestfs_jni_la_LIBADD = $(top_builddir)/src/libguestfs.la
libguestfs_jni_la_LDFLAGS = -version-info $(JNI_VERSION_INFO)
-libguestfs_jni_la_CFLAGS = -Wall -I$(top_builddir)/src $(JNI_CFLAGS)
+libguestfs_jni_la_CFLAGS = -Wall -I$(top_srcdir)/src -I$(top_builddir)/src $(JNI_CFLAGS)
BUILT_SOURCES = com_redhat_et_libguestfs_GuestFS.h
BUILT_SOURCES = com_redhat_et_libguestfs_GuestFS.h
-com_redhat_et_libguestfs_GuestFS.h: $(CPTH)/GuestFS.class
- $(JAVAH) -classpath .:$(CPTH) com.redhat.et.libguestfs.GuestFS
+com_redhat_et_libguestfs_GuestFS.h: $(java_prefix)/GuestFS.class
+ $(JAVAH) -classpath @srcdir@:@builddir@ com.redhat.et.libguestfs.GuestFS
$(OCAMLMKLIB) -o mlguestfs $^ -L$(top_builddir)/src/.libs -lguestfs
guestfs_c.o: guestfs_c.c
$(OCAMLMKLIB) -o mlguestfs $^ -L$(top_builddir)/src/.libs -lguestfs
guestfs_c.o: guestfs_c.c
- $(CC) $(CFLAGS) -I$(OCAMLLIB) -I$(top_builddir)/src -fPIC -Wall -c $<
+ $(CC) $(CFLAGS) -I$(OCAMLLIB) -I$(top_srcdir)/ocaml -I$(top_srcdir)/src -I$(top_builddir)/src -fPIC -Wall -c $<
guestfs_c_actions.o: guestfs_c_actions.c
guestfs_c_actions.o: guestfs_c_actions.c
- $(CC) $(CFLAGS) -I$(OCAMLLIB) -I$(top_builddir)/src -fPIC -Wall -c $<
+ $(CC) $(CFLAGS) -I$(OCAMLLIB) -I$(top_srcdir)/ocaml -I$(top_srcdir)/src -I$(top_builddir)/src -fPIC -Wall -c $<
TESTS_ENVIRONMENT = \
LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
TESTS_ENVIRONMENT = \
LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
$(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . unix.cmxa mlguestfs.cmxa $< -o $@
t/guestfs_005_load: t/guestfs_005_load.ml mlguestfs.cmxa
$(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . unix.cmxa mlguestfs.cmxa $< -o $@
t/guestfs_005_load: t/guestfs_005_load.ml mlguestfs.cmxa
$(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . unix.cmxa mlguestfs.cmxa $< -o $@
t/guestfs_010_launch: t/guestfs_010_launch.ml mlguestfs.cmxa
$(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . unix.cmxa mlguestfs.cmxa $< -o $@
t/guestfs_010_launch: t/guestfs_010_launch.ml mlguestfs.cmxa
$(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . unix.cmxa mlguestfs.cmxa $< -o $@
t/guestfs_050_lvcreate: t/guestfs_050_lvcreate.ml mlguestfs.cmxa
$(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . unix.cmxa mlguestfs.cmxa $< -o $@
t/guestfs_050_lvcreate: t/guestfs_050_lvcreate.ml mlguestfs.cmxa
$(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . unix.cmxa mlguestfs.cmxa $< -o $@
t/guestfs_060_readdir: t/guestfs_060_readdir.ml mlguestfs.cmxa
$(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . unix.cmxa mlguestfs.cmxa $< -o $@
t/guestfs_060_readdir: t/guestfs_060_readdir.ml mlguestfs.cmxa
$(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . unix.cmxa mlguestfs.cmxa $< -o $@
.mli.cmi:
$(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . unix.cmxa mlguestfs.cmxa $< -o $@
.mli.cmi:
NAME => 'Sys::Guestfs',
VERSION => '@PACKAGE_VERSION@',
NAME => 'Sys::Guestfs',
VERSION => '@PACKAGE_VERSION@',
- LIBS => '-L@abs_top_builddir@/src/.libs -lguestfs',
- INC => '-I@abs_top_builddir@/src',
+ LIBS => '-L@top_builddir@/src/.libs -lguestfs',
+ INC => '-I@top_builddir@/src -I@top_srcdir@/src',
+ TYPEMAPS => [ '@srcdir@/typemap' ],
CCFLAGS => '@CFLAGS@',
);
CCFLAGS => '@CFLAGS@',
);
TESTS = run-bindtests run-perl-tests
TESTS_ENVIRONMENT = \
TESTS = run-bindtests run-perl-tests
TESTS_ENVIRONMENT = \
- LD_LIBRARY_PATH=../src/.libs \
- LIBGUESTFS_PATH=../appliance
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LIBGUESTFS_PATH=$(top_builddir)/appliance
python_LTLIBRARIES = libguestfsmod.la
libguestfsmod_la_SOURCES = guestfs-py.c
python_LTLIBRARIES = libguestfsmod.la
libguestfsmod_la_SOURCES = guestfs-py.c
-libguestfsmod_la_CFLAGS = -Wall -I$(PYTHON_INCLUDEDIR) -I$(top_builddir)/src
+libguestfsmod_la_CFLAGS = -Wall -I$(PYTHON_INCLUDEDIR) \
+ -I$(top_srcdir)/src -I$(top_builddir)/src
libguestfsmod_la_LIBADD = $(top_builddir)/src/libguestfs.la
TESTS_ENVIRONMENT = \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
libguestfsmod_la_LIBADD = $(top_builddir)/src/libguestfs.la
TESTS_ENVIRONMENT = \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
- PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs
+ PYTHONPATH=$(builddir):$(builddir)/.libs
TESTS = run-bindtests run-python-tests
TESTS = run-bindtests run-python-tests
TESTS = run-bindtests run-ruby-tests
TESTS_ENVIRONMENT = \
TESTS = run-bindtests run-ruby-tests
TESTS_ENVIRONMENT = \
- LD_LIBRARY_PATH=../src/.libs \
- LIBGUESTFS_PATH=../appliance
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LIBGUESTFS_PATH=$(top_builddir)/appliance
-endif
\ No newline at end of file
PKG_NAME='@PACKAGE_NAME@'
PKG_VERSION='@PACKAGE_VERSION@'
PKG_NAME='@PACKAGE_NAME@'
PKG_VERSION='@PACKAGE_VERSION@'
-EXT_CONF='ext/guestfs/extconf.rb'
-MAKEFILE='ext/guestfs/Makefile'
-GUESTFS_MODULE='ext/guestfs/_guestfs.so'
-GUESTFS_SRC='ext/guestfs/_guestfs.c'
+EXT_CONF='@srcdir@/ext/guestfs/extconf.rb'
+MAKEFILE='@builddir@/ext/guestfs/Makefile'
+GUESTFS_MODULE='@builddir@/ext/guestfs/_guestfs.so'
+GUESTFS_SRC='@builddir@/ext/guestfs/_guestfs.c'
-CLEAN.include [ "ext/**/*.o", GUESTFS_MODULE,
- "ext/**/depend" ]
+CLEAN.include [ "@builddir@/ext/**/*.o", GUESTFS_MODULE,
+ "@builddir@/ext/**/depend" ]
-CLOBBER.include [ "config.save", "ext/**/mkmf.log",
+CLOBBER.include [ "@builddir@/config.save", "@builddir@/ext/**/mkmf.log",
MAKEFILE ]
# Build locally
file MAKEFILE => EXT_CONF do |t|
MAKEFILE ]
# Build locally
file MAKEFILE => EXT_CONF do |t|
- Dir::chdir(File::dirname(EXT_CONF)) do
- unless sh "ruby #{File::basename(EXT_CONF)} --with-_guestfs-include=../../../src --with-_guestfs-lib=../../../src/.libs"
- $stderr.puts "Failed to run extconf"
- break
- end
- end
+ unless sh "top_srcdir=$(pwd)/@top_srcdir@; top_builddir=$(pwd)/@top_builddir@; cd #{File::dirname(EXT_CONF)}; ruby #{File::basename(EXT_CONF)} --with-_guestfs-include=$top_srcdir --with-_guestfs-lib=$top_builddir/src/.libs"
+ $stderr.puts "Failed to run extconf"
+ break
+ end
end
file GUESTFS_MODULE => [ MAKEFILE, GUESTFS_SRC ] do |t|
Dir::chdir(File::dirname(EXT_CONF)) do
end
file GUESTFS_MODULE => [ MAKEFILE, GUESTFS_SRC ] do |t|
Dir::chdir(File::dirname(EXT_CONF)) do
noinst_DATA = stamp-generator
stamp-generator: generator.ml
noinst_DATA = stamp-generator
stamp-generator: generator.ml
- mkdir -p $(top_srcdir)/perl/lib/Sys
- cd .. && ocaml -warn-error A $(srcdir)/src/$<
+ mkdir -p $(top_builddir)/perl/lib/Sys
+ mkdir -p $(top_builddir)/ruby/ext/guestfs
+ mkdir -p $(top_builddir)/java/com/redhat/et/libguestfs
+ cd $(top_builddir) && ocaml -warn-error A ./src/$<
guestfs_protocol.x: stamp-generator
guestfs_protocol.x: stamp-generator
BUILT_SOURCES = \
guestfs_protocol.x \
BUILT_SOURCES = \
guestfs_protocol.x \
+ guestfs_protocol.c \
+ guestfs_protocol.h \
guestfs-structs.h \
guestfs-actions.h \
guestfs-actions.c \
guestfs-structs.h \
guestfs-actions.h \
guestfs-actions.c \
let () =
check_functions ();
let () =
check_functions ();
- if not (Sys.file_exists "configure.ac") then (
+ if not (Sys.file_exists "config.status") then (
eprintf "\
You are probably running this from the wrong directory.
Run it from the top source directory using the command
eprintf "\
You are probably running this from the wrong directory.
Run it from the top source directory using the command