tech-pkg archive

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

Re: All packages that use Meson are built with -O0



Can sommeone explain (and document unless it's there...) the grand plan?

It seems CFLAGS exists heavily in pkgsrc/mk and obviously (dangerous I
know) is intended to collect a bunch of things which should then be used
in the build.

People do things like
  CFLAGS+= -ggdb
and expect that to work.

mk/wrappers and pkgtools/cwrappers (which should be functionally
equivalent) both lack documentation.

I just did, in devel/m4:

  make CFLAGS=-DCFLAGTEST package

and found that configure added it, and it shows up in .work.log.
(Yes, I realize this overwrites the -O2.)
But I don't find this in .cwrapper/config/cc, even though I do find:

  append=-I/usr/pkg/include
  prepend=-fcommon
  prepend=-fstack-protector-strong
  prepend=-D_FORTIFY_SOURCE=2
  prepend=-Wl,-zrelro
  prepend=-fPIC
  unwrap=/tmp/work/devel/m4/work/.buildlink:/usr/pkg
  append_executable=-pie

So it looks like the bug is that meson doesn't respect CFLAGS from the
environment.

See mk/configure/cmake.mk which mentions

    # CMAKE_PKGSRC_BUILD_FLAGS
    #       If set to yes, disable compiler optimization flags associated
    #       with the CMAKE_BUILD_TYPE setting (for pkgsrc these come in from
    #       the user via variables like CFLAGS).  The default is yes, but you can
    #       set it to no for pkgsrc packages that do not use a compiler to avoid
    #       cmake "Manually-specified variables were not used by the project"
    #       warnings associated with this variable.


It seems like meson aims to replace both autoconf and make, but isn't
yet doing it right, not respecting environment CFLAGS.


So, how does one get meson to use CFLAGS from the environment.


Home | Main Index | Thread Index | Old Index