nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] some build stuff


From: Eitan Adler
Subject: Re: [Nano-devel] some build stuff
Date: Mon, 16 Jun 2014 10:59:57 -0700

On 16 June 2014 10:33, Mike Frysinger <address@hidden> wrote:
> On Mon 16 Jun 2014 08:27:35 Eitan Adler wrote:
>> On 16 June 2014 07:54, Benno Schulenberg wrote:
>> > On Mon, Jun 16, 2014, at 9:03, Mike Frysinger wrote:
>> >> On Thu 05 Jun 2014 22:43:00 Benno Schulenberg wrote:
>> >> > In the man pages and in the info document there a few references to
>> >> > SYSCONFDIR/nanorc.  I find this ugly -- SYSCONFDIR is not something
>> >> > that the user should know.  Ideally it would get replaced at build
>> >> > time by /etc (or whatever $sysconfdir has been set to at that time).
>> >> > How to go about this?
>> >>
>> >> well, here's the fun part ... those paths (by design) aren't known until
>> >> `make` time.  you can't sanely expand them at configure time.
>> >>
>> >> your best bet probably would be to add an install hook that'd run sed on
>> >> the files and replace SYSCONFDIR with $(sysconfdir) (or whatever the
>> >> variable is named).
>> >
>> > Oww... what a complication, having to do this separately for
>> > $(man1dir), $(man5dir), $(htmldir), $(infodir)...  Isn't there
>> > a way to tell install to filter each file before installation?
>> >
>> > Hmmm...  It seems there is!  After adding these two lines to
>> > doc/man/Makefile.am:
>> >
>> > INSTALL = install -s --strip-program=../sedscript
>> > export SISSICONF=$(sysconfdir)
>> >
>> > and putting in a doc/sedscript file this:
>> >
>> > #!/bin/sh
>> > sed -i "s:SYSCONFDIR:${SISSICONF}:" $1
>> >
>> > doing an installation works beautifully.
>> >
>> > Now the question... is this sane?  Portable?  Acceptable?
>>
>> Very much not portable.
>
> to be clear, the current sed invocation is not portable, but it is feasible to
> make it so.

There are some things which are not portable:
(a) install may not have a --strip-program option
(b) -i requires an argument
and not for portability:
(c) $1 should be quoted





-- 
Eitan Adler



reply via email to

[Prev in Thread] Current Thread [Next in Thread]