Enlightenment CVS committal Author : raster Project : e17 Module : libs/edje
Dir : e17/libs/edje/src/bin Modified Files: edje_cc_parse.c Log Message: different cpp invokation attempt =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc_parse.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -3 -r1.37 -r1.38 --- edje_cc_parse.c 30 Oct 2005 07:42:48 -0000 1.37 +++ edje_cc_parse.c 21 Dec 2005 04:29:16 -0000 1.38 @@ -653,6 +653,29 @@ strcat(def, " "); } } + + /* + * Run the input through the C pre-processor. + * + * On some BSD based systems (MacOS, OpenBSD), the default cpp + * in the path is a wrapper script that chokes on the -o option. + * If the preprocessor is invoked via gcc -E, it will treat + * file_in as a linker file. The safest route seems to be to + * run cpp with the output as the second non-option argument. + */ + snprintf(buf, sizeof(buf), "cpp -I%s %s %s %s", + inc, def, file_in, tmpn); + ret = system(buf); + if (ret < 0) + { + snprintf(buf, sizeof(buf), "gcc -I%s %s -E -o %s %s", + inc, def, tmpn, file_in); + ret = system(buf); + } + if (ret == EXIT_SUCCESS) + file_in = tmpn; + free(def); +/* OLD CODE snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s -E -o %s", file_in, inc, def, tmpn); ret = system(buf); @@ -664,6 +687,7 @@ } if (ret >= 0) file_in = tmpn; free(def); + */ } fd = open(file_in, O_RDONLY); if (fd < 0) ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs