+ if (strcmp (argv[i], OPTION_LIB_PATH) == 0)
+ {
+ addSet(&libPathsSet, Safe_strdup(getStringArg(OPTION_LIB_PATH, argv, &i, argc)));
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_VERSION) == 0)
+ {
+ printVersionInfo (stdout);
+ exit (EXIT_SUCCESS);
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_CALLEE_SAVES) == 0)
+ {
+ setParseWithComma(&options.calleeSavesSet, getStringArg(OPTION_CALLEE_SAVES, argv, &i, argc));
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_XSTACK_LOC) == 0)
+ {
+ options.xstack_loc = getIntArg(OPTION_XSTACK_LOC, argv, &i, argc);
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_STACK_LOC) == 0)
+ {
+ options.stack_loc = getIntArg(OPTION_STACK_LOC, argv, &i, argc);
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_STACK_SIZE) == 0)
+ {
+ options.stack_size = getIntArg(OPTION_STACK_SIZE, argv, &i, argc);
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_XRAM_LOC) == 0)
+ {
+ options.xdata_loc = getIntArg(OPTION_XRAM_LOC, argv, &i, argc);
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_IRAM_SIZE) == 0)
+ {
+ options.iram_size = getIntArg(OPTION_IRAM_SIZE, argv, &i, argc);
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_XRAM_SIZE) == 0)
+ {
+ options.xram_size = getIntArg(OPTION_XRAM_SIZE, argv, &i, argc);
+ options.xram_size_set = TRUE;
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_CODE_SIZE) == 0)
+ {
+ options.code_size = getIntArg(OPTION_CODE_SIZE, argv, &i, argc);
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_DATA_LOC) == 0)
+ {
+ options.data_loc = getIntArg(OPTION_DATA_LOC, argv, &i, argc);
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_IDATA_LOC) == 0)
+ {
+ options.idata_loc = getIntArg(OPTION_IDATA_LOC, argv, &i, argc);
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_CODE_LOC) == 0)
+ {
+ options.code_loc = getIntArg(OPTION_CODE_LOC, argv, &i, argc);
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_NO_GCSE) == 0)
+ {
+ optimize.global_cse = 0;
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_NO_LOOP_INV) == 0)
+ {
+ optimize.loopInvariant = 0;
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_NO_LABEL_OPT) == 0)
+ {
+ optimize.label4 = 0;
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_NO_LOOP_IND) == 0)
+ {
+ optimize.loopInduction = 0;
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_OPT_CODE_SPEED) == 0)
+ {
+ optimize.codeSpeed = 1;
+ optimize.codeSize = 0;
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_OPT_CODE_SIZE) == 0)
+ {
+ optimize.codeSpeed = 0;
+ optimize.codeSize = 1;
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_LESS_PEDANTIC) == 0)
+ {
+ options.lessPedantic = 1;
+ setErrorLogLevel(ERROR_LEVEL_WARNING);
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_DISABLE_WARNING) == 0)
+ {
+ int w = getIntArg(OPTION_DISABLE_WARNING, argv, &i, argc);
+ if (w < MAX_ERROR_WARNING)
+ {
+ setWarningDisabled(w);
+ }
+ continue;
+ }
+
+ if (strcmp (&argv[i][1], OPTION_SHORT_IS_8BITS) == 0)
+ {
+ options.shortis8bits=1;
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_TINI_LIBID) == 0)
+ {
+ options.tini_libid = getIntArg(OPTION_TINI_LIBID, argv, &i, argc);
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_STD_C89) == 0)
+ {
+ options.std_c99 = 0;
+ options.std_sdcc = 0;
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_STD_C99) == 0)
+ {
+ options.std_c99 = 1;
+ options.std_sdcc = 0;
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_STD_SDCC89) == 0)
+ {
+ options.std_c99 = 0;
+ options.std_sdcc = 1;
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_STD_SDCC99) == 0)
+ {
+ options.std_c99 = 1;
+ options.std_sdcc = 1;
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_CODE_SEG) == 0)
+ {
+ struct dbuf_s segname;
+
+ dbuf_init (&segname, 16);
+ dbuf_printf (&segname, "%-8s(CODE)", getStringArg (OPTION_CODE_SEG, argv, &i, argc));
+ options.code_seg = dbuf_detach (&segname);
+ continue;
+ }
+
+ if (strcmp (argv[i], OPTION_CONST_SEG) == 0)
+ {
+ struct dbuf_s segname;
+
+ dbuf_init (&segname, 16);
+ dbuf_printf (&segname, "%-8s(CODE)", getStringArg (OPTION_CONST_SEG, argv, &i, argc));
+ options.const_seg = dbuf_detach (&segname);
+ continue;
+ }
+
+ if (!port->parseOption (&argc, argv, &i))
+ {
+ werror (W_UNKNOWN_OPTION, argv[i]);
+ continue;
+ }
+ else
+ {
+ continue;
+ }
+ }
+
+ /* if preceded by '-' then option */
+ if (*argv[i] == '-')
+ {
+ switch (argv[i][1])
+ {
+ case 'h':
+ verifyShortOption(argv[i]);
+
+ printUsage ();
+ exit (EXIT_SUCCESS);
+ break;
+
+ case 'm':
+ /* Used to select the port. But this has already been done. */
+ break;
+
+ case 'p':
+ /* Used to select the processor in port. But this has
+ * already been done. */
+ break;
+
+ case 'c':
+ verifyShortOption(argv[i]);
+
+ options.cc_only = 1;
+ break;
+
+ case 'L':
+ addSet(&libPathsSet, Safe_strdup(getStringArg("-L", argv, &i, argc)));
+ break;
+
+ case 'l':
+ addSet(&libFilesSet, Safe_strdup(getStringArg("-l", argv, &i, argc)));
+ break;
+
+ case 'o':
+ {
+ char *outName = getStringArg("-o", argv, &i, argc);
+ size_t len = strlen(outName);
+
+ /* point to last character */
+ if (IS_DIR_SEPARATOR(outName[len - 1]))