Skip to contentSkip to conversation

Add a custom ./configure script

PATCH In review Petr Baudis 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add a custom ./configure script

This patch adds a custom hand-made and supposedly easy to debug ./configure script. It is originally based on mplayer's ./configure script but heavily modified and of course stripped of all the mplayer-specific tests, as well as many other tests we won't probably need (but we might reintroduce some of them later). I kept the CPU checks since they might come handy to decide which assembler SHA1 implementation to choose.

Also, I'm an autogeneration freak so compared to the mplayer's script this one has a bit different design wrt. the configuration variables; instead of adding random bits of code at various places you just insert one function call near the top and your test near the bottom, everything else is taken care of automagically. Also, the heavy machinery is split to a separate library config-lib.sh.

It's a shame that we have to carry something like this around. Wouldn't the world be much happier place if there would be something like autoconf but instead of mucking with M4 you would just write a shell script while calling various predefined functions? :/

The patch is on top of pu, that is Jakub Narebski's autoconf patch, because it reuses most of its infrastructure and just replaces the configure script.

---

 .gitignore    |    6 -
 INSTALL       |    1 
 config-lib.sh |  449 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 config.mak.in |   18 --
 configure     |   78 ++++++++++
 configure.ac  |   14 --
 6 files changed, 528 insertions(+), 38 deletions(-)
.gitignore +1 -5
index 616aa98..8950a9e 100644
@@ -136,10 +136,6 @@ git-core.spec
 *.[ao]
 *.py[co]
 config.mak
-autom4te.cache
-config.log
-config.status
-config.mak.in
 config.mak.autogen
-configure
+config.log
 git-blame
INSTALL +0 -1
index 6c8fd09..bff6aa6 100644
@@ -16,7 +16,6 @@ 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
config-lib.sh new file +449 -0

449 lines not on this page · raw message

config.mak.in deleted +0 -18
deleted file mode 100644
index 82c9781..0000000
@@ -1,18 +0,0 @@
-# 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
-
configure new file +78 -0

78 lines not on this page · raw message

configure.ac deleted +0 -14
deleted file mode 100644
index a0374d4..0000000
@@ -1,14 +0,0 @@
-#                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ(2.59)
-AC_INIT([git], [1.4.1], [[email protected]])
-
-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 lore raw
Quoted 2 lines · Petr Baudis

The patch is on top of pu, that is Jakub Narebski's autoconf patch, because it reuses most of its infrastructure and just replaces the configure script.

If you named it for example configure.sh, then autoconf generated version, and your by hand created version could coexist.

For now I think it would be best to move autoconf related files (configure.ac, config.mak.in) to the contrib/autoconf/ area. Then one would be able to compare config.mak.autogen generated by ./configure from autoconf, and your ./configure script.

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#2 lore raw

Dear diary, on Tue, Jul 04, 2006 at 03:50:16PM CEST, I got a letter where Jakub Narebski <[email protected]> said that...

Quoted 7 lines
Quoted 2 lines · Petr Baudis

The patch is on top of pu, that is Jakub Narebski's autoconf patch, because it reuses most of its infrastructure and just replaces the configure script.

If you named it for example configure.sh, then autoconf generated version, and your by hand created version could coexist.

I'm not opposed to it per se, but I'm just not sure if it makes any sense to support them both in parallel, since then you have parallel infrastructure doing the exactly same thing, or worse yet - performing a subtly different set of tests. The benefit is unclear to me.

Another thing is that it's named *everywhere* ./configure and if I use a different name now then it will be hard to rename.

Signature · 4 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam
#3 lore raw
Quoted 8 lines · Petr Baudis
Quoted 3 lines

If you named it for example configure.sh, then autoconf generated version, and your by hand created version could coexist.

I'm not opposed to it per se, but I'm just not sure if it makes any sense to support them both in parallel, since then you have parallel infrastructure doing the exactly same thing, or worse yet - performing a subtly different set of tests. The benefit is unclear to me.

The benefit is on user side: he'll take what works for him, without waiting for you or Jakub to fix it for him.

Quoted 2 lines

Another thing is that it's named *everywhere* ./configure and if I use a different name now then it will be hard to rename.

but it not the same configure as "everywhere". It's your very own script.

That said, I like your script better than the autoconf thing.