Skip to content
Back to formatted view

Raw Message

Message-ID: <25987.17326.224163.689337@rob.eddelbuettel.com>
Date: 2023-12-20T19:42:38Z
From: Dirk Eddelbuettel
Subject: [R-pkg-devel] portability question
In-Reply-To: <CAJqTW461njEgL6GQDAVk1qckH54tsLf542KzczLcY_WwUtBGeA@mail.gmail.com>

On 20 December 2023 at 11:10, Steven Scott wrote:
| The Boom package builds a library against which other packages link.  The
| library is built using the Makevars mechanism using the line
| 
| ${AR} rc $@ $^
| 
| A user has asked me to change 'rc' to 'rcs' so that 'ranlib' will be run on
| the archive.  This is apparently needed for certain flavors of macs.  I'm
| hoping someone on this list can comment on the portability of that change
| and whether it would negatively affect other platforms.  Thank you.

Just branch for macOS.  Here is a line I 'borrowed' years ago from data.table
and still use for packages needed to call install_name_tool on macOS.  You
could have a simple 'true' branch of the test use 'rcs' and the 'false'
branch do what you have always done.  Without any portability concerns.

>From https://github.com/Rdatatable/data.table/blob/master/src/Makevars.in#L14
and indented here for clarity

        if [ "$(OS)" != "Windows_NT" ] && [ `uname -s` = 'Darwin' ]; then \
           install_name_tool -id data_table$(SHLIB_EXT) data_table$(SHLIB_EXT); \
        fi

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org