How to determine OS_CLASS from EPICS_HOST_ARCH

Bug #1259691 reported by Andrew Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Fix Released
Wishlist
mdavidsaver

Bug Description

We don't currently provide a way for external build systems to work out what include/os/* directory to search based on the EPICS_HOST_ARCH. This would be very useful, even essential.

Tags: build

Related branches

Revision history for this message
mdavidsaver (mdavidsaver) wrote : Re: [Bug 1259691] [NEW] How to determine OS_CLASS from EPICS_HOST_ARCH

With 3.15 and include/compiler/ the situation is actually worse. While
the OS names are lexically similar and fixed (linux -> Linux, win32 ->
WIN32), the compiler names are neither (linux is gcc, except when its
clang).

I think a look up table is the only way to deal with this. Perhaps
generate text files "configure/os/OS.<targetname>" and
"configure/os/COMPILER.<targetname>" with the relevant strings?

On 12/10/2013 03:53 PM, Andrew Johnson wrote:
> Public bug reported:
>
> We don't currently provide a way for external build systems to work out
> what include/os/* directory to search based on the EPICS_HOST_ARCH. This
> would be very useful, even essential.
>
> ** Affects: epics-base
> Importance: Wishlist
> Status: New
>
>
> ** Tags: build
>

Revision history for this message
Andrew Johnson (anj) wrote :

Good idea. I can imagine two separate scenarios: For build systems that use Makefiles we can provide a single file that they can include to get the variables for each target, but other build systems maybe an individual file for each variable like you're suggesting would be more useful, to save it having to parse anything.

Base/configure/Makefile should generate the files for each target architecture. Which variables do we need?
    OS_CLASS for include/os
    CMPLR_CLASS for include/compiler (3.15 only)
Are there any other variables?

Base already has an install location $(TOP)/cfg for build-related files and knows how to install things there. Any files named $(TOP)/cfg/CONFIG* and $(TOP)/cfg/RULES* in a module mentioned in the RELEASE file will get included by our build system, but (with one minor change) using other names in that directory should be safe (we don't want our build system to pull in the variable-value files since they're not valid Makefile syntax).

As to the filenames for these files, I think they should match our variable names, and have a prefix so they can be distinguished. I'll attach a patch with a working implementation, although I haven't tested it on Windows yet.

Should I add this to 3.14.12.4? The final release is due on Monday and it's a bit late to be adding new functionality now.

Revision history for this message
Andrew Johnson (anj) wrote :

This patch implements my discussion in the previous comment. Not tested on Windows though, and it might need changing to work there.

Revision history for this message
mdavidsaver (mdavidsaver) wrote :

This need has been partially addressed with the lp:~epics-core/epics-base/gen-pkg-config branch. The pkg-config files include a mapping from target to OS_CLASS and CMPLR_CLASS.

Changed in epics-base:
assignee: nobody → mdavidsaver (mdavidsaver)
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.