[csw-maintainers] OpenCSW distribution specific pre-processor macro

Peter FELECAN pfelecan at opencsw.org
Tue Dec 13 18:43:27 CET 2011


Joerg.Schilling at fokus.fraunhofer.de (Joerg Schilling) writes:

> Peter FELECAN <pfelecan at opencsw.org> wrote:
>
>> In many cases I'm interested in supplying a package which have build
>> dependencies on the presence or absence of OpenCSW packages on a Solaris
>> system.
>>
>> This is easy to provide for the GCC suite by adding to the predefined
>> macros one such as __opencsw__.
>
>
> Why do you like to do this?
>
> The Schily makefile system auto-adds -DSCHILY_BUILD and it could be configured to 
> add more specific things for specific projects. Could this approach work for 
> you?

In this case, I can write a makefile which takes advantage of using
smake, which is a very good thing. It could also add -D__opencsw__ which
satisfies my needs (knowing the build system vs. knowing the
distribution environment on which I build).

Delegating the definition of the __opencsw__ symbol to the pre-processor
is even more generic that to have it in the build tool.

This is exactly what I wish to extend for full auto-configuration,
compile-time detection, &c.

For example, I can determine if I'm on an Unix system and then know if
I'm on a GNU/Linux or on a Solaris or AIX. But how can I determine in the
aforementioned cases that I'm building in a OpenCSW environment?

A concrete example, which I gave in the original post, is the compile
time determination of the default values for a strategy to guess the
shell used to spawn scripts. There are certainly other useful cases.
-- 
Peter


More information about the maintainers mailing list