add Sun Studio support when parsing edc files. Technically,
it means that e17 can run on OpenSolaris using Sun Studio or gcc. It actually runs if temperature and battery modules are disabled as they don't compile yet. Also, the problem on Mac OS X problem with C++ comments can be fixed (I think). See FIXME in that patch SVN revision: 44519
This commit is contained in:
parent
b785c6bdc6
commit
c7c66a652a
|
@ -687,7 +687,34 @@ compile(void)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Run the input through the C pre-processor.
|
* Run the input through the C pre-processor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* On OpenSolaris, the default cpp is located in different places.
|
||||||
|
* Alan Coppersmith told me to do what xorg does: using /usr/ccs/lib/cpp
|
||||||
*
|
*
|
||||||
|
* Also, that preprocessor is not managing C++ comments, so pass the
|
||||||
|
* sun cc preprocessor just after.
|
||||||
|
*/
|
||||||
|
snprintf(buf, sizeof(buf), "/usr/ccs/lib/cpp -I%s %s %s %s",
|
||||||
|
inc, def, file_in, tmpn);
|
||||||
|
ret = system(buf);
|
||||||
|
if (ret == 0)
|
||||||
|
{
|
||||||
|
static char tmpn2[4096];
|
||||||
|
|
||||||
|
snprintf (tmpn2, PATH_MAX, "%s/edje_cc.edc-tmp-XXXXXX", tmp_dir);
|
||||||
|
fd = mkstemp(tmpn2);
|
||||||
|
if (fd >= 0)
|
||||||
|
{
|
||||||
|
close(fd);
|
||||||
|
snprintf (buf, 4096, "cc -E -I%s %s -o %s %s",
|
||||||
|
inc, def, tmpn2, tmpn);
|
||||||
|
ret = system(buf);
|
||||||
|
snprintf(tmpn, 4096, "%s", tmpn2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
* On some BSD based systems (MacOS, OpenBSD), the default cpp
|
* On some BSD based systems (MacOS, OpenBSD), the default cpp
|
||||||
* in the path is a wrapper script that chokes on the -o option.
|
* in the path is a wrapper script that chokes on the -o option.
|
||||||
* If the preprocessor is invoked via gcc -E, it will treat
|
* If the preprocessor is invoked via gcc -E, it will treat
|
||||||
|
@ -696,10 +723,17 @@ compile(void)
|
||||||
*
|
*
|
||||||
* Redirecting the output is required for MacOS 10.3, and works fine
|
* Redirecting the output is required for MacOS 10.3, and works fine
|
||||||
* on other systems.
|
* on other systems.
|
||||||
|
*
|
||||||
|
* FIXME: if C++ comments are still there, maybe doing like on
|
||||||
|
* OpenSolaris: using gcc -E to remove them after using cpp.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s > %s",
|
if (ret < 0)
|
||||||
file_in, inc, def, tmpn);
|
{
|
||||||
ret = system(buf);
|
snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s > %s",
|
||||||
|
file_in, inc, def, tmpn);
|
||||||
|
ret = system(buf);
|
||||||
|
}
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "gcc -I%s %s -E -o %s %s",
|
snprintf(buf, sizeof(buf), "gcc -I%s %s -E -o %s %s",
|
||||||
|
|
Loading…
Reference in New Issue