[Z88dk-commits] CVS: z88dk/src/zcc zcc.c,1.63,1.64

Bridge to the z88dk-commits mailing list
Post Reply
Dominic Morris

[Z88dk-commits] CVS: z88dk/src/zcc zcc.c,1.63,1.64

Post by Dominic Morris »

Update of /cvsroot/z88dk/z88dk/src/zcc
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16271

Modified Files:
zcc.c
Log Message:
Add a -specs option to zcc to print out the values of the options being
used.

Remove some unused/unclear definitions


Index: zcc.c
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/zcc/zcc.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -d -r1.63 -r1.64
*** zcc.c 1 Apr 2014 20:14:02 -0000 1.63
--- zcc.c 1 Apr 2014 21:00:58 -0000 1.64
***************
*** 88,92 ****
static char *replace_str(const char *str, const char *old, const char *new);
static void setup_default_configuration();
!


--- 88,92 ----
static char *replace_str(const char *str, const char *old, const char *new);
static void setup_default_configuration();
! static void print_specs();


***************
*** 109,112 ****
--- 109,113 ----
static int relocate = 0;
static int crtcopied = 0; /* Copied the crt0 code over? */
+ static int c_print_specs = 0;
static int max_argc;
static int gargc;
***************
*** 174,178 ****
static char *c_z80asm_exe = "z80asm";
static char *c_mpm_exe = "mpm";
! static char *c_vasm_exe = "vasm";
static char *c_vlink_exe = "vlink";
static char *c_gnuas_exe = "z80-unknown-coff-as";
--- 175,179 ----
static char *c_z80asm_exe = "z80asm";
static char *c_mpm_exe = "mpm";
! static char *c_vasm_exe = "vasmz80";
static char *c_vlink_exe = "vlink";
static char *c_gnuas_exe = "z80-unknown-coff-as";
***************
*** 201,205 ****
static char *c_asmopts = NULL;
static char *c_z88mathlib = NULL;
! static char *c_z88mathflg = "-math-z88 -D__NATIVE_MATH__";
static char *c_startuplib = "z80_crt0";
static char *c_genmathlib = "gen_math";
--- 202,206 ----
static char *c_asmopts = NULL;
static char *c_z88mathlib = NULL;
! static char *c_z88mathflg = NULL; // "-math-z88 -D__NATIVE_MATH__";
static char *c_startuplib = "z80_crt0";
static char *c_genmathlib = "gen_math";
***************
*** 242,251 ****

{"Z80EXE", 0, SetStringConfig, &c_z80asm_exe, "Name of the z80asm binary"},
- {"LINKER", 0, SetStringConfig, &c_linker, "Name of the z80asm linker binary"},
{"LINKOPTS", 0, SetStringConfig, &c_linkopts, "Options for z80asm as linker", "-a -m -Mo -LDESTDIR/lib/clibs -IDESTDIR/lib" },
{"ASMOPTS", 0, SetStringConfig, &c_asmopts, "Options for z80asm as assembler", "-Mo -IDESTDIR/lib"},

{"COMPILER", AF_DEPRECATED, SetStringConfig, &c_compiler, "Name of sccz80 binary (use SCCZ80EXE)"},
! {"SCCZ80EXE", 0, SetStringConfig, &c_compiler, "Name of sccz80 binary"},
{"SDCCEXE", 0, SetStringConfig, &c_sdcc_exe, "Name of the sdcc binary"},

--- 243,251 ----

{"Z80EXE", 0, SetStringConfig, &c_z80asm_exe, "Name of the z80asm binary"},
{"LINKOPTS", 0, SetStringConfig, &c_linkopts, "Options for z80asm as linker", "-a -m -Mo -LDESTDIR/lib/clibs -IDESTDIR/lib" },
{"ASMOPTS", 0, SetStringConfig, &c_asmopts, "Options for z80asm as assembler", "-Mo -IDESTDIR/lib"},

{"COMPILER", AF_DEPRECATED, SetStringConfig, &c_compiler, "Name of sccz80 binary (use SCCZ80EXE)"},
! {"SCCZ80EXE", 0, SetStringConfig, &c_sccz80_exe, "Name of sccz80 binary"},
{"SDCCEXE", 0, SetStringConfig, &c_sdcc_exe, "Name of the sdcc binary"},

***************
*** 264,268 ****

{"Z88MATHLIB", 0, SetStringConfig, &c_z88mathlib, ""},
! {"Z88MATHFLG", 0, SetStringConfig, &c_z88mathflg, ""},
{"STARTUPLIB", 0, SetStringConfig, &c_startuplib, ""},
{"GENMATHLIB", 0, SetStringConfig, &c_genmathlib, ""},
--- 264,268 ----

{"Z88MATHLIB", 0, SetStringConfig, &c_z88mathlib, ""},
! {"Z88MATHFLG", 0, SetStringConfig, &c_z88mathflg, "Additional options for non-generic maths"},
{"STARTUPLIB", 0, SetStringConfig, &c_startuplib, ""},
{"GENMATHLIB", 0, SetStringConfig, &c_genmathlib, ""},
***************
*** 287,290 ****
--- 287,291 ----
{"usetemp", AF_BOOL_TRUE, SetBoolean, &usetemp, "(default) Use the temporary directory for intermediate files"},
{"notemp", AF_BOOL_FALSE, SetBoolean, &usetemp, "Don't use the temporary directory for intermediate files"},
+ {"specs", AF_BOOL_TRUE, SetBoolean, &c_print_specs, "Print out compiler specs" },
{"asm", AF_MORE, SetString, &c_assembler_type, "Set the assembler type from the command line (z80asm, mpm, asxx, vasm, binutils)"},
{"compiler", AF_MORE, SetString, &c_compiler_type, "Set the compiler type from the command line (sccz80, sdcc)"},
***************
*** 563,567 ****
/* Now, parse the default options list */
if (c_options != NULL) {
! parse_option(c_options);
}

--- 564,568 ----
/* Now, parse the default options list */
if (c_options != NULL) {
! parse_option(strdup(c_options));
}

***************
*** 578,581 ****
--- 579,587 ----
}

+ if ( c_print_specs ) {
+ print_specs();
+ exit(0);
+ }
+
configure_assembler();
configure_compiler();
***************
*** 912,915 ****
--- 918,925 ----
if (strcmp(arg, "-lmz") == 0) {
parse_option(c_z88mathflg);
+ if ( c_z88mathlib == NULL ) {
+ fprintf(stderr, "No Z88MATHLIB defined in configuration file - cannot use -lmz option\n");
+ exit(1);
+ }
snprintf(buffer, sizeof(buffer), "-l%s ", c_z88mathlib);
BuildOptions_start(&linkargs, buffer);
***************
*** 1620,1623 ****
--- 1630,1650 ----
}

+ static void print_specs()
+ {
+ arg_t *pargs = config;
+
+ while ( pargs->setfunc ) {
+ if ( (pargs->flags & AF_DEPRECATED) == 0 && pargs->setfunc == SetStringConfig ) {
+ if ( *(char **)pargs->data != NULL && strlen(*(char **)pargs->data)) {
+ printf("%-20s\t%s\n",pargs->name, *(char **)pargs->data);
+ } else {
+ printf("%-20s\t[undefined]\n",pargs->name);
+ }
+ }
+ pargs++;
+ }
+
+ }
+
/*
* Local Variables:


------------------------------------------------------------------------------
Post Reply