I like it... but could you check if you don't need to change
config.mak.in accordingly for ./configure script to generate proper
config.mak.autogen?
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git-
I couldn't see anything, but while I was looking at it, I also added
support for non-srcdir builds. Can someone with a perl clue look over
the braindamaged messing-around with perl/perl.mak and figure out why
perl insistsmake -C perl PERL_PATH='/usr/bin/perl' prefix='/tmp/test' perl.mak
make[1]: Entering directory `/home/lilydev/vc/go2/perl'
'/usr/bin/perl' -I/home/lilydev/vc/g2/perl /home/lilydev/vc/g2/perl/Makefile.PL FIRST_MAKEFILE='perl.mak' PREFIX='/tmp/test'
Could not open 'Git.pm': No such file or directory at /usr/lib/perl5/5.8.8/ExtUtils/MM_Unix.pm line 2649.despite the -I option?
From 7bbd698891d9102fa26ae53848c9812f6d1b665e Mon Sep 17 00:00:00 2001
From: Han-Wen Nienhuys <hanwen@lilypond.org>
Date: Wed, 6 Dec 2006 15:14:08 +0100
Subject: [PATCH] Allow non-srcdir builds using cd $builddir && $srcdir/configureSigned-off-by: Han-Wen Nienhuys <hanwen@xs4all.nl>
---
Makefile | 19 +++++++++++--------
config.mak.in | 5 +----
configure.ac | 31 ++++++++++++++++++++++++++++++-
generate-cmdlist.sh | 2 +-
perl/Makefile | 2 +-
5 files changed, 44 insertions(+), 15 deletions(-)diff --git a/Makefile b/Makefile
index cb9b745..d64a5bd 100644
--- a/Makefile
+++ b/Makefile
@@ -97,7 +97,7 @@ all:
#GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
- @$(SHELL_PATH) ./GIT-VERSION-GEN
+ @$(SHELL_PATH) $(srcdir)/GIT-VERSION-GEN
-include GIT-VERSION-FILEuname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
@@ -120,7 +120,10 @@ datadir = $(prefix)/share
GIT_datadir = $(datadir)/git-core
gitexecdir = $(bindir)
template_dir = $(GIT_datadir)/templates/
-# DESTDIR=
+srcdir = .
+
+# this is usually set on the make command line.
+DESTDIR=# default configuration for gitweb
GITWEB_CONFIG = gitweb_config.perl
@@ -598,8 +601,8 @@ git-merge-recur$X: git-merge-recursive$X
$(BUILT_INS): git$X
rm -f $@ && ln git$X $@-common-cmds.h: Documentation/git-*.txt
- ./generate-...
Why have you removed setting datarootdir and template_dir? I would
have thought that you would rather change it to#gitexecdir = @libexecdir@/git-core/
datarootdir = @datarootdir@
GIT_datadir = @datadir@/git-core/
template_dir= @datadir@/git-core/templates/in config.mak.in
I have been told that setting 'datarootdir' is required to avoid
What is this for? The ./configure script, generated by autoconf from
configure.ac (by "make configure"), generates config.mak.autogen file
from config.mak.in, which is included in main (top) Makefile.The variables defined in config.mak.autogen are of course visible in
make in subdirectories (make invoked from main makefile). Why the change?
What about user-generated config.mak?This part IMHO has no sense, and has no place here.
--
Jakub Narebski
Poland
-
The Makefile already has this code, so adding it here is duplication of work
and code.If you think putting code in the generated file is a good idea, I
propose we just generate the entire Makefile, as is the standard usagein some cases, the files can also be called stand alone, eg.
[lilydev@haring perl]$ pwd
/home/lilydev/vc/git/perl[lilydev@haring perl]$ make
make -f perl.mak all
make[1]: Entering directory `/home/lilydev/vc/git/perl'
make[1]: Leaving directory `/home/lilydev/vc/git/perl'The above Makefile generation makes sure that this behavior is
mirrored in the builddir. Also, I'm not sure if the vpath settings get
exported automatically.Having multiple Makefiles in the builddir is the standard behavior for
--
Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen
-
More detailed description what "Allow non-srcdir builds using cd
$builddir && $srcdir/configure" mean and why we might want to do that.For example:
We might want to build git from outside source directory. For this we
need...By the way, I think this patch is about _two_ changes. Allow to build
outside source directory, by providing srcdir AND separate change to
allow builds of separate parts of git, with separate Makefile, to
include user-generated configuration file config.mak and ./configure
generated config.mak.autogen configuration file.Good call. Well, at least now, when ./configure script doesn't provide
means to change template_dir etc. from command line, via options.Still I think that at least
datarootdir = @datarootdir@
The stance on autoconf is that it has to be _optional_ part of
Git is not autotool'ed package. Autoconf is used only for _optional_
If you want to create or modify Makefiles, do that. Not generate
"minimal" Makefiles in every and each subdirectory.You would be able to compile git fully only from top directory. So what?
--
Jakub Narebski
Poland
-
Look more closely at the patch. It only generates Makefiles in
directories that have makefiles in the source dir. The makefiles are
short because that is the easiest to do.I'm happy to amend the patch, bUt I can't properly test
it until the perl problem gets sorted out.--
Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen-
make -D doesn't exist.
This is about
mkdir git-build
cd git-build
$my_git_source/configure
makethis _was_ actually documented in that one-line commit message, that
you found to be too short.Since git does recursive makes, among others in
perl/
Documentation/
templates/
contrib/there should be Makefiles in said directories. Otherwise, every rule
in the toplevel Makefile saying$(MAKE) -C subdir/
will fail because $builddir/ does not have a Makefile in
$builddir/subdir.The part you don't understand is a generic way of duplicating the
Makefiles from the git sources, while making sure that they work when
$srcdir != $builddirYes, if builddir != srcdir , then configure is about more than
generating config.mak.autogen--
Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen
-
This part should have been in the commit message, possibly without the
"among others ... (examples)" and possibly with an added "This patch
makes it so by letting fnurg create them through smurfing the frotz".--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
-
that doesn't work.
make -C foo bla
just does
(cd foo && make bla)
If you did this, part of the object files would end up in the source dir;
The idea of separate srcdir builds,is to keep the srcdir completely clean
of generated files. That can't really be done without aid of a script,
to setup the builddir. In this case that is the configure script.I did forget to add a check
if "$srcdir" != "." ; then
..
fiaround the messy stuff.
--
Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen-
Thanks for an explanation. At least some of it should be in commit
message, to explain what you want the patch to do.I don't know autotools enough to check if autotools (autoconf) doesn't
have it's own way to do this, some autoconf macro, to not need to write
this script creating redirect Makefiles.I'm still not sure if this has place in git. Is it really common to
support building outside source directory? If git didn't support this,
so what?
--
Jakub Narebski
Poland
-
lots of serious tools support it, as it this comes automatically
when using automake. Eg. emacs, gcc, make, pango, lilypond, etc etc.It's a quite standard feature ; you should be asking why git
shouldn't support it.Another option is to make a special solution based on makefiles, so
make is run inside the srcdir, but output shunted output to a
separate objects/ subdirectory. However, it's more work, and less
standardized.--
Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen-
| Amit K. Arora | [RFC] Heads up on sys_fallocate() |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Linus Torvalds | Linux 2.6.25-rc4 |
| Greg KH | Linux 2.6.25.10 |
git: | |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Ilpo Järvinen | Re: Strange Application bug, race in MSG_PEEK complaints (was: Bug#513695: fetchma... |
