mailing list of musl libc
 help / color / mirror / code / Atom feed
* configure script for musl (?!)
@ 2012-05-01 22:54 Rich Felker
  2012-05-01 23:39 ` Rich Felker
  0 siblings, 1 reply; 8+ messages in thread
From: Rich Felker @ 2012-05-01 22:54 UTC (permalink / raw)
  To: musl

OK before anybody flips out, no, there's no autoconf. :-)

Partly as an exercise in learning the details of how users/systems
integrators expect "./configure" to work, and partly in the interest
of simplifying build/installation of musl, I've been playing around
with writing a configure script. It's a flat shell script written in
portable (POSIX) sh, and depending on no external programs except the
compiler whose characteristics are being tested.

What does this buy us?

1. Automatic selection of ARCH as long as the compiler supports the
   GCC -dumpmachine option. This works even if $CC is set to a
   cross-compiler.

2. Automatic selection of compiler options that can fix standards
   conformance issues, like -ffloat-store or
   -fexcess-precision=standard. I believe the latter is default with
   -std=c99 for all compilers that support it, but testing for it
   allows us to fallback to (better than nothing) -ffloat-store on
   ones that don't. We could also add things like -frounding-math if
   they're helpful without worrying about breaking build on compilers
   that don't support them.

3. Automatic enabling of preferred warning options without breaking
   build on older compilers that don't support them all, or becoming
   spamming on newer compilers that need -Wno-* options to disable
   some bogus ones.

4. Automatic enabling of debloating options when supported/possible
   (like omitting DWARF2 stuff when debugging is disabled).

I'm going to start by committing some changes to Makefile with the
minimum invasiveness to support configure-like semantics in
config.mak. The key change needed is that we have to split up CFLAGS
so that overriding CFLAGS from the make command line does not remove
the essential options (like -std=c99, -ffreestanding,
-D_XOPEN_SOURCE=700, etc.) and break things horribly. I'm also making
some changes that make it easier to disable shared OR STATIC libs from
the build process if desired, and some general cleanup. My intent is
that these changes not break existing manually-written config.mak
usage at all.

After that, I'll post a draft configure script here, and if all goes
well, it can be committed and can serve as an alternative to the
manual configuration method (which will continue to work).

Rich


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

end of thread, other threads:[~2012-05-02 16:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-01 22:54 configure script for musl (?!) Rich Felker
2012-05-01 23:39 ` Rich Felker
2012-05-02 14:00   ` Solar Designer
2012-05-02 14:31     ` Rich Felker
2012-05-02 15:05       ` Solar Designer
2012-05-02 15:39         ` Rich Felker
2012-05-02 15:41           ` Solar Designer
2012-05-02 16:26             ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).