Menu

#12 [PATCH] Please make the build system respect variables CC, CXX, LDFLAGS

1.0
closed
nobody
None
2021-07-30
2021-07-03
No

Hi Barry,

in Gentoo packaging I need to support environment variables CC, CXX, and LDFLAGS during the build. I currently need to patch those in (https://github.com/gentoo/gentoo/blob/50cd663733598e3c53c2918ed4f4690740d65b60/dev-python/pysvn/files/pysvn-1.9.13-respect-flags.patch) and then forward-port that patch for every release manually downstream, e.g. the patch against 1.9.11 did not apply against 1.9.13 unmodified. If you'd be willing to accept that patch or some flavor of it upstream, that would be great. What do you think?

Best, Sebastian

Discussion

  • Barry Alan Scott

    That is a reasonable change.

    I'll need to design it so that I only use the overrides if defined.

     
  • Sebastian Pipping

    Cool! This is what comes to mind with regard to "only if defined":

    • Python: os.environ.setdefault('CC', 'gcc')
    • Makefile a: CC ?= gcc (shy)
    • Makefile b: CC = gcc with make CC=[..] (rather than CC=[..] make, order matters)
     
  • Barry Alan Scott

    I have made the change and commited as r2066
    "add support for CC, CCC, CFLAGS amd LDFLAGS in the unix builds

    • CC defaults to gcc, CCC defaults to g++.
    • CFLAGS and LDFLAGS are added to the appropiates commands if defined."

    Try this source kit and let me know if it what you need: https://pysvn.barrys-emacs.org/source_kits/pysvn-1.9.15.tar.gz

    I have tested this with the Fedora pysvn packaging and it seems to work.

     
  • Sebastian Pipping

    Hi Barry,
    thanks for your work in this direction. To respect the rules of packaging for Gentoo myself, I would still need to patch the nine or so places with -g away because the end user (where the compiling happens) is expected full control. (For a workaround in packaging, I'm unsure if present -g can be fully negated by appending, but it doesn't seem very robust). Would you be up for making addition of -g suppressible some way? PS: What are your thoughts on the part for Patches/test_proplist.mak in the Gentoo patch?
    Best, Sebastian

     

    Last edit: Sebastian Pipping 2021-07-12
  • Barry Alan Scott

    The -g is controlled by the --enable-debug option. SInce you do not use that option I'm not sure what the problem could be?

    I did leave -g on the generate_svn_error_codes build tool, but you do not install that so I'm assuming that you do not care about that.

    I used CCC to match what the code was already using for names not CXX.
    I see that you set that on the emake line so you can use CCC right?
    So you would have CCC=$(tc-getCXX) on the emake line.

    Also you can remove the fake_svnversion command as I fixed the tooling to look for
    an svn revision in a file in the tarball. It is only builds from a svn checkout that use svnversion.

    I'm not sure what else you need that is in your test_proplist.mak that I have not done?

    Barry

     
    • Sebastian Pipping

      Hi Barry,

      The -g is controlled by the --enable-debug option. SInce you do not use that option I'm not sure what the problem could be?

      There are more places in there that add -g — that made me bring it up. It seems like none of these cases affect Linux though, not even the one in UnixCompilerGCC.setupUtilities while expected. So the fix probably already works for Linux (but not for macOS if that matters).

      I did leave -g on the generate_svn_error_codes build tool, but you do not install that so I'm assuming that you do not care about that.

      I see, thanks for the clarifaction. I guess I do not care for packaging, as you assumed, yes.

      I used CCC to match what the code was already using for names not CXX.
      I see that you set that on the emake line so you can use CCC right?
      So you would have CCC=$(tc-getCXX) on the emake line.

      CXX would have been more standard I guess but CCC will work, yes.

      Also you can remove the fake_svnversion command as I fixed the tooling to look for
      an svn revision in a file in the tarball. It is only builds from a svn checkout that use svnversion.

      Seen that, thanks for the fix. How official is https://pysvn.barrys-emacs.org/source_kits/pysvn-1.9.15.tar.gz for a release — is that something I can/should use for packaging in a Linux distro?

      I'm not sure what else you need that is in your test_proplist.mak that I have not done?

      When building tool test_proplist using makefile Patches/test_proplist.mak, variables CFLAGS and LDFLAGS are not yet respected. I figured now it will not matter to my cases.

      Best, Sebastian

       
  • Barry Alan Scott

    I need to tag in svn the release and make sure the release notes are correct.
    Then its official.

    I have a busy few days ahead, so it may be the start of next week.
    If possible I'll do this weekend.

     
    • Sebastian Pipping

      Okay great, thanks for sharing your time constraints. See you.

       
  • Barry Alan Scott

    • status: open --> closed
     
  • Barry Alan Scott

    I have release 1.9.15 officially.
    Its taged and updated on the web sites.

     
  • Sebastian Pipping

     

Log in to post a comment.

MongoDB Logo MongoDB