bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Gawk 4.1.2 released!


From: Aharon Robbins
Subject: Re: [bug-gawk] Gawk 4.1.2 released!
Date: Thu, 30 Apr 2015 09:58:25 +0300
User-agent: Heirloom mailx 12.5 6/20/10

Hi.

Thanks for the note.

> Date: Wed, 29 Apr 2015 11:44:14 +0200
> From: Steffen Nurpmeso <address@hidden>
> To: Aharon Robbins <address@hidden>
> Cc: address@hidden
> Subject: Re: Gawk 4.1.2 released!
>
> Aharon Robbins <address@hidden> wrote:
>  |Greetings all.
>  |
>  |This note announces the next release of GNU Awk: version 4.1.2.
>
> Hello.
>
>   address@hidden gawk.tar_bomb_git]$ ./configure \
>     --prefix=$HOME/usr --program-prefix=g                                     
>                     
>   ...
>   \
>   address@hidden bin]$ ll *awk*
>   -rwxr-xr-x  1 steffen  staff  200288  7 Nov 14:42 mawk*
>   -rwxrwxr-x  1 steffen  staff  183908 21 Jan 11:09 nawk*
>   -rwxr-xr-x  1 steffen  staff    3189 29 Apr 11:38 gigawk*
>   -rwxr-xr-x  1 steffen  staff  690896 29 Apr 11:38 ggawk*
>   lrwxrwxr-x  1 steffen  staff       4 29 Apr 11:38 awk@ -> gawk
>   address@hidden bin]$ ll -L awk
>   lrwxrwxr-x  1 steffen  staff  4 29 Apr 11:38 awk@ -> gawk
>   ls: awk: No such file or directory
>
> Ciao (thanks for gawk(1), of course :)),
>
> --steffen

So, the symlink stuff doesn't take --program-prefix into account.
That's something of a corner case; I've been doing the symlinking
for many years. :-)

Fixing this is a little bit of a pain, since the prefix isn't
available as a simple variable in the Makefile. But this
patch seems to accomplish it.

Thanks,

Arnold
----------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
index 2d8357d..c646fc3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -154,17 +154,21 @@ RM = rm -f
 # For GNU systems where gawk is awk, add a link to awk.
 # (This is done universally, which may not always be right, but
 # there's no easy way to distinguish GNU from non-GNU systems.)
+#
+# Use the transform, in case --program-prefix=XXX
 install-exec-hook:
        (cd $(DESTDIR)$(bindir); \
-       $(LN) gawk$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
+       name=`echo gawk | sed '$(transform)'` ; \
+       $(LN) $${name}$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
        if [ ! -f awk$(EXEEXT) ]; \
-       then    $(LN_S) gawk$(EXEEXT) awk$(EXEEXT); \
+       then    $(LN_S) $${name}$(EXEEXT) awk$(EXEEXT); \
        fi; exit 0)
 
 # Undo the above when uninstalling
 uninstall-links:
        (cd $(DESTDIR)$(bindir); \
-       if [ -f awk$(EXEEXT) ] && cmp awk$(EXEEXT) gawk$(EXEEXT) > /dev/null; 
then rm -f awk$(EXEEXT); fi ; \
+       name=`echo gawk | sed '$(transform)'` ; \
+       if [ -f awk$(EXEEXT) ] && cmp awk$(EXEEXT) $${name}$(EXEEXT) > 
/dev/null; then rm -f awk$(EXEEXT); fi ; \
        rm -f gawk-$(VERSION)$(EXEEXT); exit 0)
 
 uninstall-recursive: uninstall-links
diff --git a/Makefile.in b/Makefile.in
index 79a5a2a..183d71c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1172,17 +1172,21 @@ uninstall-am: uninstall-binPROGRAMS 
uninstall-includeHEADERS
 # For GNU systems where gawk is awk, add a link to awk.
 # (This is done universally, which may not always be right, but
 # there's no easy way to distinguish GNU from non-GNU systems.)
+#
+# Use the transform, in case --program-prefix=XXX
 install-exec-hook:
        (cd $(DESTDIR)$(bindir); \
-       $(LN) gawk$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
+       name=`echo gawk | sed '$(transform)'` ; \
+       $(LN) $${name}$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
        if [ ! -f awk$(EXEEXT) ]; \
-       then    $(LN_S) gawk$(EXEEXT) awk$(EXEEXT); \
+       then    $(LN_S) $${name}$(EXEEXT) awk$(EXEEXT); \
        fi; exit 0)
 
 # Undo the above when uninstalling
 uninstall-links:
        (cd $(DESTDIR)$(bindir); \
-       if [ -f awk$(EXEEXT) ] && cmp awk$(EXEEXT) gawk$(EXEEXT) > /dev/null; 
then rm -f awk$(EXEEXT); fi ; \
+       name=`echo gawk | sed '$(transform)'` ; \
+       if [ -f awk$(EXEEXT) ] && cmp awk$(EXEEXT) $${name}$(EXEEXT) > 
/dev/null; then rm -f awk$(EXEEXT); fi ; \
        rm -f gawk-$(VERSION)$(EXEEXT); exit 0)
 
 uninstall-recursive: uninstall-links



reply via email to

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