From: Jeff King <firstname.lastname@example.org> To: "Daniel Richard G." <skunk@iSKUNK.ORG> Cc: email@example.com Subject: Re: Minor portability issues + fixes Date: Fri, 22 May 2020 16:03:00 -0400 Message-ID: <20200522200300.GA2160187@coredump.intra.peff.net> (raw) In-Reply-To: <firstname.lastname@example.org> On Thu, May 21, 2020 at 12:29:18AM -0400, Daniel Richard G. wrote: > > So probably we'd want something like (in this order): > > > > - NEEDS_EXPLICIT_STDINT gets passed from the Makefile into the > > compiler via -D, which then triggers stdint.h being included > > unconditionally in git-compat-util.h > > > > - optionally set that in config.mak.uname for AIX (checking uname_R > > since it sounds like only old versions need it) > > > > - add an autoconf rule that sets it, either strictly (when a > > test-program decides it's needed) or loosely (when we see that it's > > available at all) > > > > Even just the first one would let you build by setting the knob > > manually; the rest is gravy on top, if you or somebody else chooses to > > do it. > > Hmm... that's a fairly specific knob, which I would think is less than > ideal. The rest is reasonable, but would have to be written in terms > of the knob. Yeah, it is. I do wonder if just setting the existing NO_INTTYPES_H is a simpler solution for your case (since it sounds like that works). If you want to tweak the knob for older AIX in config.mak.uname, that would be fine (or if you think other people aren't likely to be building on the platform, maybe tweak your own "make" invocation and let this conversation serve to document for anybody else). > > but it would be nice if the Makefile handled this correctly. It looks > > like CC_LD_DYNPATH gets used in a lot of places, so I suspect we'd > > want a Makefile function to help out. Something like: > > > > # usage: $(call linker_lib,PATH) > > # Create linker args for looking for libraries in PATH at both link-time > > # and run-time. > > linker_lib = -L$1 $(if $(CC_LD_DYNPATH),$(CC_LD_DYNPATH)$1) > > > > which would allow: > > > > EXTLIBS += $(call linker_lib,$(LIBPCREDIR)/$(lib)) > > > > etc. This would be our first foray into Makefile functions, but I think > > we've determined that most platforms have a recent enough GNU make for > > it to be OK (and we already require GNU make). > > Why not just a variable to wrap the conditional? Something like > > CC_LD_DYNPATH_flag = $(if $(CC_LD_DYNPATH),$(CC_LD_DYNPATH),-L) > > ... > > EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH_flag)$(ZLIB_PATH)/$(lib) I was trying to actually remove the argument, rather than turn it into a duplicate "-L". But you're probably right that it's not worth the effort. I think we could just normalize an empty CC_LD_DYNPATH to "-L" in the same variable, and then we wouldn't even have to change the sites which reference it. -Peff
next prev parent reply index Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-19 1:15 Daniel Richard G. 2020-05-19 2:49 ` Jeff King 2020-05-19 4:22 ` Daniel Richard G. 2020-05-20 4:28 ` Jeff King 2020-05-21 4:29 ` Daniel Richard G. 2020-05-22 20:03 ` Jeff King [this message] 2020-05-19 3:04 ` Carlo Marcelo Arenas Belón 2020-05-19 4:26 ` Daniel Richard G.
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200522200300.GA2160187@coredump.intra.peff.net \ --email@example.com \ --firstname.lastname@example.org \ --cc=skunk@iSKUNK.ORG \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Mailing List Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/git/0 git/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 git git/ https://lore.kernel.org/git \ email@example.com public-inbox-index git Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernel.vger.git AGPL code for this site: git clone https://public-inbox.org/public-inbox.git