[PATCH libXaw v2 1/2] Makefile: use $(LN_S) for better code portability

Alan Coopersmith alan.coopersmith at oracle.com
Sat Dec 14 09:50:53 PST 2013


On 09/22/13 05:07 PM, Gaetan Nadon wrote:
> Autoconf recommends using LN_S to safeguard against actual or future
> portability issues. Being open source, X can be ported on platforms we are
> not aware of today.
>
> Autoconf:
>    "Symbolic links are not available on old systems; use ‘$(LN_S)’
>    as a portable substitute".
>
> AC_PROG_LN_S is brought in by AC_PROG_LIBTOOL
>
> Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
> ---
>   src/Makefile.am |    8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 951dc26..49b3ddb 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -84,10 +84,10 @@ if !PLATFORM_WIN32
>   install-exec-hook::
>   if PLATFORM_DARWIN
>   	-rm -f $(DESTDIR)$(libdir)/libXaw.6. at LIBEXT@
> -	(cd $(DESTDIR)$(libdir) && ln -s libXaw6.6. at LIBEXT@ libXaw.6. at LIBEXT@)
> +	(cd $(DESTDIR)$(libdir) && $(LN_S) libXaw6.6. at LIBEXT@ libXaw.6. at LIBEXT@)
>   else
>   	-rm -f $(DESTDIR)$(libdir)/libXaw. at LIBEXT@.6
> -	(cd $(DESTDIR)$(libdir) && ln -s libXaw6. at LIBEXT@.6 libXaw. at LIBEXT@.6)
> +	(cd $(DESTDIR)$(libdir) && $(LN_S) libXaw6. at LIBEXT@.6 libXaw. at LIBEXT@.6)
>   endif
>
>   uninstall-local::
> @@ -123,10 +123,10 @@ if !PLATFORM_WIN32
>   install-exec-hook::
>   if PLATFORM_DARWIN
>   	-rm -f $(DESTDIR)$(libdir)/libXaw.7. at LIBEXT@
> -	(cd $(DESTDIR)$(libdir) && ln -s libXaw7.7. at LIBEXT@ libXaw.7. at LIBEXT@)
> +	(cd $(DESTDIR)$(libdir) $(LN_S) libXaw7.7. at LIBEXT@ libXaw.7. at LIBEXT@)
>   else
>   	-rm -f $(DESTDIR)$(libdir)/libXaw. at LIBEXT@.7
> -	(cd $(DESTDIR)$(libdir) && ln -s libXaw7. at LIBEXT@.7 libXaw. at LIBEXT@.7)
> +	(cd $(DESTDIR)$(libdir) $(LN_S) libXaw7. at LIBEXT@.7 libXaw. at LIBEXT@.7)

Looks like you lost the && in the last two bits there, so they become extra
arguments to cd, not a second command to run.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list