Comment 13 for bug 1553304

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

@Ralph: That's what I've done, the ARCH environment variable will be set when the C++ constructor in the ioc_registerRecordDeviceDriver.cpp file gets executed. For the Unix-like OSs that is sufficient to allow the iocBoot/ioc directory to be independent of the run-time architecture (except for the #! line in st.cmd). That is also true for Windows iff the ioc.exe was built statically, but for it to find DLLs we build the iocBoot/ioc/dllPath.bat file that sets PATH, so the build system must be told the IOC's target architecture in the Makefile.

I don't see any point in setting OS_CLASS and CMPLR_CLASS as environment variables in the IOC, but I have made those build variable values available as envParam default values like I did for the just-renamed EPICS_BUILD_TARGET_ARCH.

@Michael, can you explain more what you mean by "Base version number components in numeric form"? Are you asking for the Base version number to be provided as an environment variable for use in the IOC's st.cmd file? If not I don't see why your C code can't #include "epicsVersion.h" directly.

For saving all the build variables like Python's sysconfig or Perl's Config modules I would want to generate a different source file for libCom than envData.c so the embedded IOCs can exclude all that stuff from their link. This wouldn't actually be useful for cross-compiling though, since the host builds don't know what the variable values are for their cross-targets (you have to be building the cross-target to get those values out of GNUMake, and by then the host build has already finished). I'd want to see a more specific requirement before working on this.