z88dk forums

z80 Development Kit

You are not logged in.

#1 2014-04-01 21:14:04

Dominic Morris
Guest

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

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

Modified Files:
zcc.c
Log Message:
Have the config options use DESTDIR rather than PREFIX, this way they can
be expanded out at runtime relative to $ZCCCFG - and we can get rid of
more stuff from the .cfg files (which can be just left with: CRT0 and OPTIONS)


Index: zcc.c
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/zcc/zcc.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -C2 -d -r1.62 -r1.63
*** zcc.c    1 Apr 2014 19:52:34 -0000    1.62
--- zcc.c    1 Apr 2014 20:14:02 -0000    1.63
***************
*** 68,72 ****
static void            BuildOptions_start(char **, char *);
static void            copy_output_files_to_destdir(char *suffix);
! static void            parse_config_file(char *config_line);
static void            KillEOL(char *line);

--- 68,72 ----
static void            BuildOptions_start(char **, char *);
static void            copy_output_files_to_destdir(char *suffix);
! static void            parse_configfile_line(char *config_line);
static void            KillEOL(char *line);

***************
*** 87,91 ****
static void            add_zccopt(char *fmt,...);
static char           *replace_str(const char *str, const char *old, const char *new);
!


--- 87,91 ----
static void            add_zccopt(char *fmt,...);
static char           *replace_str(const char *str, const char *old, const char *new);
! static void            setup_default_configuration();


***************
*** 158,161 ****
--- 158,162 ----
void  *data;
char  *help;
+     char  *defvalue;
};

***************
*** 192,202 ****
#endif
static char  *c_extension_config = "o";
! static char  *c_incpath = "-I" PREFIX "/include";
! static char  *c_coptrules1 = PREFIX "/lib/z80rules.1";
! static char  *c_coptrules2 = PREFIX "/lib/z80rules.2";
! static char  *c_coptrules3 = PREFIX "/lib/z80rules.0";
static char  *c_crt0 = NULL;
! static char  *c_linkopts = "-a -m -Mo -L" PREFIX "/lib/clibs -I" PREFIX "/lib";
! static char  *c_asmopts = "";
static char  *c_z88mathlib = NULL;
static char  *c_z88mathflg = "-math-z88 -D__NATIVE_MATH__";
--- 193,203 ----
#endif
static char  *c_extension_config = "o";
! static char  *c_incpath = NULL;
! static char  *c_coptrules1 = NULL;
! static char  *c_coptrules2 = NULL;
! static char  *c_coptrules3 = NULL;
static char  *c_crt0 = NULL;
! static char  *c_linkopts = NULL;
! static char  *c_asmopts = NULL;
static char  *c_z88mathlib = NULL;
static char  *c_z88mathflg = "-math-z88 -D__NATIVE_MATH__";
***************
*** 204,209 ****
static char  *c_genmathlib = "gen_math";
static int    c_stylecpp = outspecified;
! static char  *c_vasmopts = "-quiet -Fvobj -I" PREFIX "/lib";
! static char  *c_vlinkopts = "-L"PREFIX"/lib/vlink/";
static char  *c_asz80opts = "";
static char  *c_aslinkopts = "";
--- 205,210 ----
static char  *c_genmathlib = "gen_math";
static int    c_stylecpp = outspecified;
! static char  *c_vasmopts = NULL;
! static char  *c_vlinkopts = NULL;
static char  *c_asz80opts = "";
static char  *c_aslinkopts = "";
***************
*** 221,236 ****
{"MPMEXE", 0, SetStringConfig, &c_mpm_exe, "Name of the mpm binary"},

!     {"VASMEXE", 0, SetStringConfig, &c_vasm_exe, "Name of the vasm binary"},
!     {"VLINKEXE", 0, SetStringConfig, &c_vlink_exe, "Name of the vlink binary"},
!     {"VASMOPTS", 0, SetStringConfig, &c_vasmopts, ""},
!     {"VLINKOPTS", 0, SetStringConfig, &c_vlinkopts, ""},

!     {"GNUASEXE", 0, SetStringConfig, &c_gnuas_exe, "Name of the GNU as binary"},
!     {"GNULDEXE", 0, SetStringConfig, &c_gnuld_exe, "Name of the GNU ld binary"},
{"GNUASOPTS", 0, SetStringConfig, &c_gnuasopts, ""},
{"GNULINKOPTS", 0, SetStringConfig, &c_gnulinkopts, ""},

!     {"ASZ80EXE", 0, SetStringConfig, &c_asz80_exe, "Name of the asz80 binary"},
!     {"ASLINKEXE", 0, SetStringConfig, &c_aslink_exe, "Name of the aslink binary"},
{"ASZ80OPTS", 0, SetStringConfig, &c_asz80opts, ""},
{"ASLINKOPTS", 0, SetStringConfig, &c_aslinkopts, ""},
--- 222,237 ----
{"MPMEXE", 0, SetStringConfig, &c_mpm_exe, "Name of the mpm binary"},

!     {"VASMEXE", 0, SetStringConfig, &c_vasm_exe, "Name of the vasm binary" },
!     {"VLINKEXE", 0, SetStringConfig, &c_vlink_exe, "Name of the vlink binary" },
!     {"VASMOPTS", 0, SetStringConfig, &c_vasmopts, "Options for VASM", "-quiet -Fvobj -IDESTDIR/lib" },
!     {"VLINKOPTS", 0, SetStringConfig, &c_vlinkopts, "", "-LDESTDIR/lib/vlink/" },

!     {"GNUASEXE", 0, SetStringConfig, &c_gnuas_exe, "Name of the GNU as binary" },
!     {"GNULDEXE", 0, SetStringConfig, &c_gnuld_exe, "Name of the GNU ld binary" },
{"GNUASOPTS", 0, SetStringConfig, &c_gnuasopts, ""},
{"GNULINKOPTS", 0, SetStringConfig, &c_gnulinkopts, ""},

!     {"ASZ80EXE", 0, SetStringConfig, &c_asz80_exe, "Name of the asz80 binary" },
!     {"ASLINKEXE", 0, SetStringConfig, &c_aslink_exe, "Name of the aslink binary" },
{"ASZ80OPTS", 0, SetStringConfig, &c_asz80opts, ""},
{"ASLINKOPTS", 0, SetStringConfig, &c_aslinkopts, ""},
***************
*** 242,247 ****
{"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"},
!     {"ASMOPTS", 0, SetStringConfig, &c_asmopts, "Options for z80asm as assembler"},

{"COMPILER", AF_DEPRECATED, SetStringConfig, &c_compiler, "Name of sccz80 binary (use SCCZ80EXE)"},
--- 243,248 ----
{"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)"},
***************
*** 256,263 ****
{"COPYCMD", 0, SetStringConfig, &c_copycmd, ""},

!     {"INCPATH", 0, SetStringConfig, &c_incpath, ""},
!     {"COPTRULES1", 0, SetStringConfig, &c_coptrules1, ""},
!     {"COPTRULES2", 0, SetStringConfig, &c_coptrules2, ""},
!     {"COPTRULES3", 0, SetStringConfig, &c_coptrules3, ""},
{"CRT0", 0, SetStringConfig, &c_crt0, ""},

--- 257,264 ----
{"COPYCMD", 0, SetStringConfig, &c_copycmd, ""},

!     {"INCPATH", 0, SetStringConfig, &c_incpath, "", "-IDESTDIR/include" },
!     {"COPTRULES1", 0, SetStringConfig, &c_coptrules1, "", "DESTDIR/lib/z80rules.1" },
!     {"COPTRULES2", 0, SetStringConfig, &c_coptrules2, "", "DESTDIR/lib/z80rules.2"},
!     {"COPTRULES3", 0, SetStringConfig, &c_coptrules3, "", "DESTDIR/lib/z80rules.0"},
{"CRT0", 0, SetStringConfig, &c_crt0, ""},

***************
*** 535,538 ****
--- 536,540 ----
}

+     setup_default_configuration();

gc = find_zcc_config_fileFile(argv[gc], gc, config_filename, sizeof(config_filename));
***************
*** 545,549 ****
if (!isupper(buffer[0]))
continue;
!         parse_config_file(buffer);
}
fclose(fp);
--- 547,551 ----
if (!isupper(buffer[0]))
continue;
!         parse_configfile_line(buffer);
}
fclose(fp);
***************
*** 1064,1068 ****
}

! void parse_config_file(char *arg)
{
arg_t          *pargs = config;
--- 1066,1070 ----
}

! void parse_configfile_line(char *arg)
{
arg_t          *pargs = config;
***************
*** 1604,1607 ****
--- 1606,1623 ----
}

+ static void setup_default_configuration()
+ {
+     char    buf[1024];
+     arg_t  *pargs = config;
+
+     while ( pargs->setfunc ) {
+         if ( pargs->defvalue ) {
+             snprintf(buf,sizeof(buf),"%s %s",pargs->name, pargs->defvalue);
+             parse_configfile_line(buf);
+         }
+         pargs++;
+     }
+ }
+
/*
* Local Variables:


------------------------------------------------------------------------------

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson