[dev] Re: mksh build system

From: Thorsten Glaser <tg_AT_mirbsd.de>
Date: Sat, 1 Jun 2013 15:12:10 +0000 (UTC)

Cc’ing the mksh list. Feel free to keep it, redirect there,
or remove it again.

Christoph Lohmann dixit:

>At least autoconf allows to specify a prefix, LDFLAGS or CFLAGS and some

A prefix is only needed when the Makefile installs; Build.sh accepts
the environment variables CC, CPPFLAGS, CFLAGS, LDFLAGS, LIBS, LDSTATIC
as usual.

>options like to clean the build directory.

Just build in a separate tree… sh /path/to/mksh/Build.sh -r

>This Build.sh is pure magic

Oh come on… you’re either envious or don’t understand it.

>which should be a sign of the past.

It *is*. Running an autoconfigury is needed for portability
to operating systems, especially older ones, that do not
provide all required functionality in the currently used
way. I try to keep it down to the minimum, and let it make
sense too (e.g. if there’s three choices for something, and
the first choice is found, the other two aren’t even probed,
unlike GNU autoconf; and nothing that’s not used is probed,
e.g. not whether sizeof(char)==1 or there’s an f77 compiler).

I’ll be adding “mirtoconf” to paxmirabilis (MirBSD paxtar
and cpio) too shortly – although I expect it to require
*much* less… checks for some headers for the tape functions
and for sizeof(off_t); I think that’s all. The idea behind
this is to replace stuff like this…
#if !defined(__INTERIX) && (!defined(__GLIBC__) || __GLIBC_PREREQ(2, 3))
#if !defined(__INTERIX) && !defined(__APPLE__)
#if defined(__GLIBC__)
… with proper checks. An ifdeffery depending on the target
OS is imake(1) style instead, and *that* is a thing of the
past which should rather be abolished. Your request for it
to just build from a Makefile, with maybe a few user-adju‐
stable flags¹, would necessitate regressing to this.

① I never liked those user-adjustable flags anyway. Does a
  user know e.g. whether their off_t is long or long long?
  If they select the wrong one, they get a broken binary².
  I’d rather have some autoconfigury detect it.

② So happened in paxmirabilis – Linux/x32 is the only sane
  one to default to a 64 bit off_t, with a 32 bit long.

bye,
//mirabilos
-- 
Solange man keine schmutzigen Tricks macht, und ich meine *wirklich*
schmutzige Tricks, wie bei einer doppelt verketteten Liste beide
Pointer XORen und in nur einem Word speichern, funktioniert Boehm ganz
hervorragend.		-- Andreas Bogk über boehm-gc in d.a.s.r
Received on Sat Jun 01 2013 - 17:12:10 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 01 2013 - 17:24:05 CEST