Add a New Comment (Rich Markup)
Comment Type & Canned Response: None None
Doing some testing, I see that's not going to work. GNU sed requires no space between -i and the argument, while BSD sed requires a space if it's the empty string. A portable solution that does work with both seds is to just specify a backup suffix, e.g. "-i.bak" works.
The argument to the -i flag is the suffix to use on the backup file. In GNU sed the argument is optional, and if not specified, no backup is made. In BSD sed the argument is mandatory, and if you don't want a backup, specify the empty string.
All uses of -i have filenames as argument. Do you mean rearranging the arguments so that the filenames come after -i? Would that address that issue?
Right, using $(SED) will ensure the sed that configure found gets used, but that won't fix the build failure if configure found a BSD sed.
Disabling documentation building is one idea, but is it really that hard to support BSD sed as well? For example, as I mentioned, always supply an argument to the -i flag: -i '' would be the portable equivalent to the GNU-specific -i you're currently using.
Hello, I've done the replacement of sed with $(SED) in makefile.am, but I'm not sure whether that this change would be sufficient to build documentation in any system without the gnu tools. Would it make sense to use "--disable-doc" and ship only the included documentation?
I found that gnutls 3.3.5 fails to build on OS X, and presumably other BSD-derived systems like FreeBSD and OpenBSD whose "sed" program is BSD sed instead of GNU sed, if I make a change to the sources that causes the documentation to be regenerated, such as patching gnutls.h.in which I was doing to resolve issue #108614. The error I encountered was:
sed -i 's/\@anchor{.*//g' functions/* sed: 1: "functions/dane_cert_typ ...": invalid command code f make[4]: *** [stamp_functions] Error 1
The doc Makefile uses GNU-specific sed features, such as assuming that the argument to the "-i" flag is optional. (In BSD sed, it is required.)
I do actually have GNU sed installed as well, but under the name "gsed" (as provided by the MacPorts "gsed" port). However, although your configure script correctly finds this gsed, your Makefile does not make use of the $SED variable which would have expanded to that program, but instead just uses the program name "sed".
Ideally, your complete build system, including the documentation regeneration, should support both BSD sed and GNU sed. Either stick with just the capabilities that both flavors provide (e.g. always use an argument to "-i", since GNU sed should be happy with that as well), or detect which flavor of BSD is present and change your invocations accordingly at build time.
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only logged-in users can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 4 latest changes.
Copyright © 2022 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.9