fix edje_cc on Mac OS X: c++ comments were not removed, so pass

gcc -E on the edc file a second time. As Linux gcc does not like
it, compile that part only on Mac OS X.


SVN revision: 47280
This commit is contained in:
Vincent Torri 2010-03-16 05:49:13 +00:00
parent 82fabb0f16
commit a8e1557dbc
1 changed files with 20 additions and 2 deletions

View File

@ -730,8 +730,9 @@ compile(void)
* Redirecting the output is required for MacOS 10.3, and works fine
* on other systems.
*
* FIXME: if C++ comments are still there, maybe doing like on
* OpenSolaris: using gcc -E to remove them after using cpp.
* Also, the MacOS preprocessor is not managing C++ comments, so pass gcc
* preprocessor just after. Linux gcc seems to not like it, so guard the
* code so that it is compiled only on MacOS
*
*/
if (ret != 0)
@ -739,6 +740,23 @@ compile(void)
snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s > %s",
file_in, inc, def, tmpn);
ret = system(buf);
#if defined (__MacOSX__) || ( defined (__MACH__) && defined (__APPLE__))
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, "gcc -I%s %s -E -o %s %s",
inc, def, tmpn2, tmpn);
ret = system(buf);
snprintf(tmpn, 4096, "%s", tmpn2);
}
}
#endif
}
if (ret != 0)
{