git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1] autoconf: Use autoconf to write installation directories to config.mak.autogen
@ 2006-07-02 23:56 Jakub Narebski
  2006-07-03  0:02 ` [PATCH 2] autoconf: Use ./configure script in git *.spec file Jakub Narebski
                   ` (3 more replies)
  0 siblings, 4 replies; 34+ messages in thread
From: Jakub Narebski @ 2006-07-02 23:56 UTC (permalink / raw)
  To: git

This is beginning of patch series introducing installation configuration
using autoconf (and no other autotools) to git. The idea is to generate
config.mak.autogen using ./configure (generated from configure.ac by running
autoconf) from config.mak.in, so one can use autoconf as an _alternative_ to
ordinary Makefile, and creating one's own config.mak. Local settings in
config.mak override generated settings in config.mak.autogen

This patch includes minimal configure.ac and config.mak.in, so one can set
installation directories using autoconf generated ./configure script
e.g. ./configure --prefix=/usr

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch is to be applied on top of 'next', because to work as intended
(especially for --mandir=<path> option to ./configure) it needs
  Allow INSTALL, bindir, mandir to be set in main Makefile
  e14421b9aa85f11853a0dacae09498515daab7b8
patch (commit) to be present.

For now the following options do actually something:
	$ ./configure 
           --prefix=<prefix>         # [/usr/local]
           --exec_prefix=<prefix>    # [PREFIX]
           --bindir=<bindir>         # [EPREFIX/bin]
           --datadir=<datadir>       # [PREFIX/share]
           --mandir=<mandir>         # [PREFIX/man]

	$ ./configure --help         # hardcoded version 1.4.1

QUESTION: how to make autoconf _generate_ correct version string?


Next patch will show how this infrastructure can be used.

 .gitignore    |    6 ++++++
 INSTALL       |    9 +++++++++
 Makefile      |    1 +
 config.mak.in |   18 ++++++++++++++++++
 configure.ac  |   14 ++++++++++++++
 5 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index 2bcc604..616aa98 100644
--- a/.gitignore
+++ b/.gitignore
@@ -136,4 +136,10 @@ git-core.spec
 *.[ao]
 *.py[co]
 config.mak
+autom4te.cache
+config.log
+config.status
+config.mak.in
+config.mak.autogen
+configure
 git-blame
diff --git a/INSTALL b/INSTALL
index f8337e2..28245b3 100644
--- a/INSTALL
+++ b/INSTALL
@@ -13,6 +13,15 @@ that uses $prefix, the built results hav
 which are derived from $prefix, so "make all; make prefix=/usr
 install" would not work.
 
+Alternatively you can use autoconf generated ./configure script to
+set up install paths (via config.mak.autogen), so you can write instead
+
+	$ autoconf ;# as yourself if ./configure doesn't exist yet
+	$ ./configure --prefix=/usr ;# as yourself
+	$ make all doc ;# as yourself
+	# make install install-doc ;# as root
+
+
 Issues of note:
 
  - git normally installs a helper script wrapper called "git", which
diff --git a/Makefile b/Makefile
index 7dbb883..3c2c257 100644
--- a/Makefile
+++ b/Makefile
@@ -333,6 +333,7 @@ ifneq (,$(findstring arm,$(uname_M)))
 	ARM_SHA1 = YesPlease
 endif
 
+-include config.mak.autogen
 -include config.mak
 
 ifdef WITH_OWN_SUBPROCESS_PY
diff --git a/config.mak.in b/config.mak.in
new file mode 100644
index 0000000..82c9781
--- /dev/null
+++ b/config.mak.in
@@ -0,0 +1,18 @@
+# git Makefile configuration, included in main Makefile
+# @configure_input@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+#gitexecdir = @libexecdir@/git-core/
+template_dir = @datadir@/git-core/templates/
+GIT_PYTHON_DIR = @datadir@/git-core/python
+
+mandir=@mandir@
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+export exec_prefix mandir
+export srcdir VPATH
+
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..a54b164
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,14 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.59)
+AC_INIT([git], [1.4.1], [git@vger.kernel.org])
+
+AC_CONFIG_SRCDIR([git.c])
+
+config_file=config.mak.autogen
+config_in=config.mak.in
+
+# Output files
+AC_CONFIG_FILES(["${config_file}":"${config_in}"]) 
+AC_OUTPUT
-- 
1.4.0

^ permalink raw reply related	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2006-07-09 20:43 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-02 23:56 [PATCH 1] autoconf: Use autoconf to write installation directories to config.mak.autogen Jakub Narebski
2006-07-03  0:02 ` [PATCH 2] autoconf: Use ./configure script in git *.spec file Jakub Narebski
2006-07-03  0:13   ` Junio C Hamano
2006-07-03  0:29     ` Jakub Narebski
2006-07-03  2:09       ` Junio C Hamano
2006-07-03  2:13         ` contrib/ status Junio C Hamano
2006-07-03  8:06           ` Eric Wong
2006-07-03 21:04             ` Junio C Hamano
2006-07-04 21:56               ` Eric Wong
2006-07-06  7:14                 ` [RFC/PATCH] git-svn: migrate out of contrib Eric Wong
2006-07-07  0:20                   ` Junio C Hamano
2006-07-07 10:03                     ` [PATCH] " Eric Wong
2006-07-04 11:26           ` contrib/ status Jakub Narebski
2006-07-04 11:43             ` Johannes Schindelin
2006-07-03 11:05         ` [PATCH 2] autoconf: Use ./configure script in git *.spec file Jakub Narebski
2006-07-03 20:08           ` Junio C Hamano
2006-07-03 20:43             ` Jakub Narebski
2006-07-03  0:13 ` [PATCH 1] autoconf: Use autoconf to write installation directories to config.mak.autogen Junio C Hamano
2006-07-04 14:09 ` [PATCH 2, proof of concept] autoconf: Use %configure in git.spec, autoconf dependency only in rpm target Jakub Narebski
2006-07-06  4:16   ` Pavel Roskin
2006-07-07 20:06     ` Jakub Narebski
2006-07-08 21:07 ` [PATCH 2] Teach make clean about configure and autoconf Jakub Narebski
2006-07-08 21:07   ` [RFC/PATCH 3] Copy description of build configuration variables to configure.ac Jakub Narebski
2006-07-08 21:07     ` [RFC/PATCH 4] autoconf: Preparing the way for autodetection Jakub Narebski
2006-07-08 21:07       ` [PATCH 5] autoconf: Checks for typedefs, structures, and compiler characteristics Jakub Narebski
2006-07-08 21:07         ` [RFC/PATCH 6] autoconf: Checks for some library functions Jakub Narebski
2006-07-08 21:07           ` [RFC/PATCH 7] autoconf: Checks for libraries Jakub Narebski
2006-07-08 21:07             ` [RFC/PATCH 8] autoconf: Checks for some programs Jakub Narebski
2006-07-08 21:07               ` [PATCH 9] configure.ac vertical whitespace usage cleanup Jakub Narebski
2006-07-08 21:07                 ` Comment on this series of patches (PATCH 2-9) Jakub Narebski
2006-07-08 21:20                   ` Junio C Hamano
2006-07-09  8:21     ` [RFC/PATCH 3] Copy description of build configuration variables to configure.ac Junio C Hamano
2006-07-09 16:47       ` Jakub Narebski
2006-07-09 20:43         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).