From: Han-Wen Nienhuys <hanwen@xs4all.nl>
To: git@vger.kernel.org
Subject: Re: bug: git-sh-setup should not be in $PATH
Date: Wed, 06 Dec 2006 15:16:43 +0100 [thread overview]
Message-ID: <4576D0CB.7090408@xs4all.nl> (raw)
In-Reply-To: <el6eh6$vg7$2@sea.gmane.org>
Jakub Narebski escreveu:
> Han-Wen Nienhuys wrote:
>
>> Subject: [PATCH] Install git-sh-setup.sh into $(prefix)/share/git-core. Call with explicit path.
>
> 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?
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 insists
make -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/configure
Signed-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-FILE
uname_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-cmdlist.sh > $@+
+common-cmds.h: $(wildcard $(srcdir)/Documentation/git-*.txt)
+ $(srcdir)/generate-cmdlist.sh $(srcdir)/Documentation/ > $@+
mv $@+ $@
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
@@ -609,7 +612,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-e 's!@@GIT_datadir@@!$(GIT_datadir)!g' \
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
- $@.sh >$@+
+ $^ >$@+
chmod +x $@+
mv $@+ $@
@@ -630,7 +633,7 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
-e '}' \
-e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
- $@.perl >$@+
+ $^ >$@+
chmod +x $@+
mv $@+ $@
@@ -674,7 +677,7 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
-e '/@@GITWEB_CGI@@/d' \
-e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
-e '/@@GITWEB_CSS@@/d' \
- $@.sh > $@+
+ $< > $@+
chmod +x $@+
mv $@+ $@
@@ -821,7 +824,7 @@ install: all
fi
$(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(GIT_datadir_SQ)'
- $(INSTALL) -m755 git-sh-setup.sh '$(DESTDIR_SQ)$(GIT_datadir_SQ)'
+ $(INSTALL) -m755 $(srcdir)/git-sh-setup.sh '$(DESTDIR_SQ)$(GIT_datadir_SQ)'
install-doc:
$(MAKE) -C Documentation install
diff --git a/config.mak.in b/config.mak.in
index 9a57840..902a392 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -2,7 +2,7 @@
# @configure_input@
CC = @CC@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -I.
AR = @AR@
TAR = @TAR@
#INSTALL = @INSTALL@ # needs install-sh or install.sh in sources
@@ -10,9 +10,6 @@ TAR = @TAR@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
-#gitexecdir = @libexecdir@/git-core/
-datarootdir = @datarootdir@
-template_dir = @datadir@/git-core/templates/
mandir=@mandir@
diff --git a/configure.ac b/configure.ac
index 34e3478..ccf9374 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,11 +5,13 @@ AC_PREREQ(2.59)
AC_INIT([git], [@@GIT_VERSION@@], [git@vger.kernel.org])
AC_CONFIG_SRCDIR([git.c])
-
+srcdir=`cd $srcdir && pwd`
config_file=config.mak.autogen
config_append=config.mak.append
config_in=config.mak.in
+
+
echo "# ${config_append}. Generated by configure." > "${config_append}"
@@ -330,10 +332,37 @@ GIT_PARSE_WITH(iconv))
# change being considered an inode change from the update-cache perspective.
+
+
+
## Output files
AC_CONFIG_FILES(["${config_file}":"${config_in}":"${config_append}"])
AC_OUTPUT
+
+## generate subdirectories and sub Makefiles.
+for d in `cd $srcdir && find . -type d -print | grep -v '\.git'` ;
+do
+ if test ! -d $d ; then
+ echo creating $d
+ mkdir $d
+ fi
+
+ if test -f $srcdir/$d/Makefile ; then
+
+ dnl [[]] is to keep m4 happy
+ depth=`echo $d/ | sed -e 's!^\./!!g' -e 's![[^/]]*/!../!g'`
+ echo creating $d/Makefile
+ cat << EOF > $d/Makefile
+include ${depth}config.mak.autogen
+here-srcdir=\$(srcdir)/$d/
+VPATH=\$(here-srcdir)
+include \$(here-srcdir)/Makefile
+EOF
+
+ fi
+done
+exit 1
## Cleanup
rm -f "${config_append}"
diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh
index 5450918..e744fbb 100755
--- a/generate-cmdlist.sh
+++ b/generate-cmdlist.sh
@@ -47,6 +47,6 @@ do
x
s/.*git-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
p
- }' "Documentation/git-$cmd.txt"
+ }' "$1/git-$cmd.txt"
done
echo "};"
diff --git a/perl/Makefile b/perl/Makefile
index bd483b0..5706095 100644
--- a/perl/Makefile
+++ b/perl/Makefile
@@ -29,7 +29,7 @@ $(makfile): ../GIT-CFLAGS Makefile
echo ' echo $(instdir_SQ)' >> $@
else
$(makfile): Makefile.PL ../GIT-CFLAGS
- '$(PERL_PATH_SQ)' $< FIRST_MAKEFILE='$@' PREFIX='$(prefix_SQ)'
+ '$(PERL_PATH_SQ)' -I$(srcdir)/perl $< FIRST_MAKEFILE='$@' PREFIX='$(prefix_SQ)'
endif
# this is just added comfort for calling make directly in perl dir
--
1.4.4.1.gc9922-dirty
--
Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen
next prev parent reply other threads:[~2006-12-06 14:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-06 12:14 bug: git-sh-setup should not be in $PATH Han-Wen Nienhuys
2006-12-06 12:23 ` Johannes Schindelin
2006-12-06 12:34 ` Han-Wen Nienhuys
2006-12-06 12:56 ` Jakub Narebski
2006-12-06 14:16 ` Han-Wen Nienhuys [this message]
2006-12-06 14:51 ` Jakub Narebski
2006-12-06 15:03 ` Han-Wen Nienhuys
2006-12-06 15:27 ` Jakub Narebski
2006-12-06 15:36 ` Han-Wen Nienhuys
2006-12-06 15:56 ` Jakub Narebski
2006-12-06 16:03 ` Han-Wen Nienhuys
2006-12-06 16:27 ` Jakub Narebski
2006-12-06 16:40 ` Han-Wen Nienhuys
2006-12-06 16:52 ` Jakub Narebski
2006-12-06 16:56 ` Han-Wen Nienhuys
2006-12-06 17:11 ` Jakub Narebski
2006-12-07 13:36 ` Andreas Ericsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4576D0CB.7090408@xs4all.nl \
--to=hanwen@xs4all.nl \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.