#include <sys/stat.h>\r
#endif\r
\r
+#ifdef __GNUC__\r
+#include <unistd.h>\r
+#endif\r
+\r
#include <stdio.h>\r
#include <stdlib.h>\r
#include <string.h>\r
128K,256K,512K,1M,2M,4M,8M,16M\n");\r
fprintf (stdout, " -i SectionFile, --sectionfile SectionFile\n\\r
Section file will be contained in this FFS file.\n");\r
+ fprintf (stdout, " -oi SectionFile, --optionalsectionfile SectionFile\n\\r
+ If the Section file exists, it will be contained in this FFS file, otherwise, it will be ignored.\n");\r
fprintf (stdout, " -n SectionAlign, --sectionalign SectionAlign\n\\r
SectionAlign points to section alignment, which support\n\\r
the alignment scope 0~16M. If SectionAlign is specified\n\\r
continue;\r
}\r
\r
- if ((stricmp (argv[0], "-i") == 0) || (stricmp (argv[0], "--sectionfile") == 0)) {\r
+ if ((stricmp (argv[0], "-oi") == 0) || (stricmp (argv[0], "--optionalsectionfile") == 0) || (stricmp (argv[0], "-i") == 0) || (stricmp (argv[0], "--sectionfile") == 0)) {\r
//\r
// Get Input file name and its alignment\r
//\r
Error (NULL, 0, 1003, "Invalid option value", "input section file is missing for -i option");\r
goto Finish;\r
}\r
-\r
+ if ((stricmp (argv[0], "-oi") == 0) || (stricmp (argv[0], "--optionalsectionfile") == 0) ){\r
+ if (-1 == access(argv[1] , 0)){\r
+ Warning(NULL, 0, 0001, "File is not found.", argv[1]);\r
+ argc -= 2;\r
+ argv += 2;\r
+ continue;\r
+ }\r
+ }\r
//\r
// Allocate Input file name buffer and its alignment buffer.\r
//\r