autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with bringing mozilla's configury up to date


From: Raja R Harinath
Subject: Re: Problems with bringing mozilla's configury up to date
Date: Fri, 16 May 2003 14:23:30 -0500
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux)

Hi,

Philipp Thomas <address@hidden> writes:

> I'm trying to adapt Mozilla's autoconf stuff to current autoconf in order to
> be able to make configure regenerable and adaptable. Now mozilla does things
> in its own special way.
>
> aclocal.m4:
> --------------- cut --------------------
>
> define(MOZ_TOPSRCDIR,.)dnl MOZ_TOPSRCDIR is used in altoptions.m4
> builtin(include, build/autoconf/altoptions.m4)dnl
>
> -----------------------------

  m4_include([build/autoconf/altoptions.m4])

> And the relevant part from altoptions.m4:
>
> ---------- cut -------------
>
> dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
> AC_DEFUN(MOZ_READ_MOZCONFIG,
> [AC_REQUIRE([AC_INIT_BINSH])dnl
> # Read in '.mozconfig' script to set the initial options.
> # See the mozconfig2configure script for more details.
> _AUTOCONF_TOOLS_DIR=`dirname [$]0`/[$1]/build/autoconf
> . $_AUTOCONF_TOOLS_DIR/mozconfig2configure])
>
> dnl This gets inserted at the top of the configure script
> MOZ_READ_MOZCONFIG(MOZ_TOPSRCDIR)

aclocal.m4 can only have definitions.  Not executable code: at least
not code that expands autoconf macros.

> -----------------------------
>
> This all is done to get MOZ_READ_MOZCONFIG expanded at the very top of
> configure:
>
> ------------- cut --------------
> #! /bin/sh
>
> # Read in '.mozconfig' script to set the initial options.
> # See the mozconfig2configure script for more details.
> _AUTOCONF_TOOLS_DIR=`dirname $0`/./build/autoconf
> . $_AUTOCONF_TOOLS_DIR/mozconfig2configure
>
> --------------------------------

Don't barf, but ...

  AC_DEFUN([MOZ_AC_READ_MOZCONFIG],
  [m4_divert_push([PARSE_ARGS])dnl
m4_divert_text(m4_eval(m4_divnum - 1),
[_AUTOCONF_TOOLS_DIR=`dirname $[0]`/$1/build/autoconf
. $_AUTOCONF_TOOLS_DIR/mozconfig2configure])dnl
m4_divert_pop([PARSE_ARGS])])

And call MOZ_AC_READ_MOZCONFIG([.]) directly in your 'configure.ac'.
No need for MOZ_TOPSRCDIR.

Of course all this is highly undocumented and brittle.  However, since
you want to subvert the option processing of autoconf, you pretty much
have to tinker with the plumbing.

- Hari
-- 
Raja R Harinath ------------------------------ address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]