meson options vs AC options:

Alan Coopersmith alan.coopersmith at oracle.com
Sun Mar 3 20:39:12 UTC 2024


On 3/3/24 12:06, tlaronde at kergis.com wrote:
> [I'm back to working on Xorg stuff].
> 
> When writing a meson.build, I realize that all the options settable
> with GNU AC are not available in meson built-ins. This does mean
> that one has to add a meson_options.txt for everything used that is
> not a built-in options in meson?
> 
> I take the example of xorg-sgml-doctools. I think there are two bugs:
> 
> 1) meson.build defines:
> 
> datarootdir = get_option('prefix') / get_option('datadir')
> sgmlrootdir = datarootdir / 'sgml'
> 
> and generates the pkgconfig file from the template with:
> 
> pc_conf = configuration_data({
>      'prefix': get_option('prefix'),
>      'datarootdir': '${prefix}/share',
>      'sgmlrootdir': '${datarootdir}/sgml',
>      'PACKAGE_VERSION': meson.project_version()
> })
> configure_file(input: 'xorg-sgml-doctools.pc.in',
>                 output: 'xorg-sgml-doctools.pc',
>                 install_dir: get_option('datadir') / 'pkgconfig',
>                 configuration: pc_conf)
> 
> Above, for the pkgconfig file, datarootdir is reset with something
> that can be different from the first definition if 'datadir' (a meson
> built-in option) is something else than the default 'share'.

That seems like a mistake - I don't remember any reason that the datadir &
sgmlrootdir variables weren't used for the values in pc_conf.

> 2) In the pkgconfig template, there are:
> 
> prefix=@prefix@
> datarootdir=@datarootdir@
> sgmlrootdir=@sgmlrootdir@
> 
> These can all be set, if I'm not mistaken, with AC, independantly. But
> with the meson file, since there are no meson_options.txt, not exactly
> the same thing can be achieved (for example, sgmlrootdir can not be
> set independantly).

I don't see any way in the autoconf to set sgmlrootdir - it appears to be
hardcoded in configure.ac to:

AC_SUBST([sgmlrootdir],['${datarootdir}/sgml'])

and there's no flag to set it listed by configure --help nor do I see any flags
defined in that configure.ac to check with AC_ARG_WITH or similar.

-- 
         -Alan Coopersmith-                 alan.coopersmith at oracle.com
          Oracle Solaris Engineering - https://blogs.oracle.com/solaris



More information about the xorg-devel mailing list