Commit Graph

8 Commits

Author SHA1 Message Date
Peter Wang
544f3bf095 Use musl getopt implementation.
LICENSE:
    Mention files derived from musl library.

runtime/process_getopt:
    Process files from ../getopt/*.[ch] to produce
    mercury_getopt.h, mercury_getopt.c, mercury_getopt_long.c.

runtime/mercury_getopt.h:
runtime/mercury_getopt.c:
runtime/mercury_getopt_long.c:
    Add files generated by process_getopt.

runtime/Mmakefile:
    Update list of source files.

util/Mmakefile:
    Use musl getopt if the system C library does not have getopt().

tests/debugger/browser_test.exp:
tests/debugger/browser_test.exp2:
tests/debugger/browser_test.exp3:
tests/hard_coded/runtime_opt.exp:
    Update expected error messages to match new getopt() output.

changed exp output
2019-06-10 13:30:49 +10:00
Peter Wang
3162997f14 Delete GNU getopt implementation.
runtime/GETOPT/getopt.c:
runtime/GETOPT/getopt.h:
runtime/GETOPT/getopt1.c:
runtime/mercury_getopt.c:
runtime/mercury_getopt.h:
runtime/mercury_getopt1.c:
    Delete files.

runtime/RESERVED_MACRO_NAMES:
    Delete __GNU_LIBRARY__ macro.
2019-06-10 13:30:43 +10:00
Fergus Henderson
0a95ede8eb Delete extraneous `MR_' prefixes in comments,
Estimated hours taken: 0.5
Branches: main

runtime/mercury_getopt.h:
runtime/mercury_getopt.c:
runtime/mercury_getopt1.c:
	Delete extraneous `MR_' prefixes in comments,
	that were apparently added by an overzealous sed script.
2002-02-05 10:19:06 +00:00
Fergus Henderson
779b47f4f2 Various bug fixes and cleanups for the code in the runtime directory.
Estimated hours taken: 2

Various bug fixes and cleanups for the code in the runtime directory.

runtime/mercury_bootstrap.h:
runtime/mercury_regs.h:
runtime/mercury_stacks.h:
runtime/mercury_type_info.h:
	Move #defines that are there just for backwards compatibility
	into mercury_bootstrap.h.

runtime/process_getopt:
	Add MR_ prefixes to the names `_GETOPT_H', `no_arguments',
	and `required_argument' which are defined by mercury_getopt.h,
	to make mercury_getopt.h macro-namespace-clean.

runtime/mercury_getopt.h:
	Apply the new version of the process_getopt script.

runtime/mercury_imp.h:
	Make mercury_bootstrap the first header file that is #included,
	in case some of the macros defined in it are used in declarations
	in other header files.

runtime/mercury_memory.h:
	Delete duplicate definitions of MAX_REAL_REG, NUM_SPECIAL_REG,
	and MAX_VIRTUAL_REG -- these are all already defined in
	mercury_memory_zones.h.

runtime/mercury_memory_zones.h:
	Delete definition of NUM_SPECIAL_REG, since mercury_regorder.h
	already defines MR_NUM_SPECIAL_REG, which should be used instead
	of NUM_SPECIAL_REG.  The value of NUM_SPECIAL_REG was long
	obsolete.

runtime/mercury_regorder.h:
	Fix some bugs in the definition of MR_min_sol_hp_rec -- it was
	using `mr40', which is undefined, instead of `mr(40)'.
	Also add some comments.

runtime/mercury_regs.h:
	Fix a bug: use MR_NUM_SPECIAL_REGS instead of NUM_SPECIAL_REGS.
	Note that this bug fix unfortunately breaks backwards compatibility,
	at least for procedures with more than 32 arguments, since it
	affects the mapping from r(N) to the fake_reg array.
	However, there was no alternative, since the old mapping was
	broken: for example, the old mapping used the same fake_reg
	slot for both r(41) and MR_global_hp.

runtime/mercury_bootstrap.h:
	Change MR_GRADE_PART_0 from `redofr' to `v1', and document that
	that part of the grade is a binary compatibility version number.
	The reason for changing the grade is to ensure that the change
	in binary backwards compatibility resulting from the changes
	to runtime/mercury_regs.h will cause link errors rather
	than just random behaviour for procedures with >32 arguments.

runtime/mercury_agc_debug.c:
	Use MR_NUM_SPECIAL_REGS instead of NUM_SPECIAL_REGS.
	Also add some XXX comments, since all of the places where
	NUM_SPECIAL_REGS was used are broken anyway -- they should be
	using MAX_FAKE_REG instead of MAX_REAL_REG + NUM_SPECIAL_REG.
	But I think the current definition is put there for efficiency,
	even though it's known to be broken for procedures with >32
	arguments, so I didn't change the code to use MAX_FAKE_REG.
1998-11-09 14:35:40 +00:00
Zoltan Somogyi
45bdceb363 Add the files as produced by process_getopt.
Estimated hours taken: 1

runtime/mercury_getopt.c:
runtime/mercury_getopt1.c:
	Add the files as produced by process_getopt.

runtime/process_getopt:
runtime/mercury_getopt.h:
	Avoid a warning if the environment already defines __GNU_LIBRARY__,
	and prevent this from omitting the entire bodies of the source files
	:-(.

util/getopt.h:
	A copy of the old mercury_getopt.h for mkinit.c

util/mkinit.c:
	Include getopt.h instead of mercury_getopt.h, since we want getopt(),
	not MR_getopt().
1998-08-11 06:23:29 +00:00
Zoltan Somogyi
137ce69e7a Bring the handling of MERCURY_OPTION into the 90s (a bit late :-).
Estimated hours taken: 5

Bring the handling of MERCURY_OPTION into the 90s (a bit late :-).

Get rid of lack-of-prototype warnings from getopt.h.

runtime/getopt.[ch]:
runtime/getopt1.c:
runtime/GETOPT:
runtime/GETOPT/getopt.[ch]:
runtime/GETOPT/getopt1.c:
	Move these files to a new subdirectory, GETOPT. This should avoid
	the nuisance warnings one gets when stdlib.h picks up the getopt.h
	in the runtime directory by accident. (The GETOPT directory should
	never need to be included in -I search paths.)

runtime/mercury_getopt.[ch]:
runtime/mercury_getopt1.c:
	Copies of the files in GETOPT, slightly modified to make sure that
	(1) every external symbol they define starts with MR_, and (2)
	we get a minimal number of compilation errors (as of now, 3 warnings
	about casting away const).

	These files are not to be modified by humans.

runtime/process_getopt:
	This is the script that creates mercury_getopt{.h,.c,1.c} from the
	files in GETOPT.

runtime/mercury_wrapper.c:
	Get rid of the -s<area><size> notation, which can hard to remember,
	and replace it with long options such as --heap-size=1024.

	Print an error message and stop if MERCURY_OPTIONS contains anything
	other than options.

	Refer to everything from mercury_getopt.h with a name that starts with
	MR_.

runtime/Mmakefile:
	Mention the new source files.

doc/user_guide.texi:
	Document the new options.

NEWS:
	Mention the new options.
1998-08-10 07:18:25 +00:00
Tyson Dowd
bd19208eb9 Remove old .h files.
Estimated hours taken: 1

runtime/*.h:
runtime/*.c:
runtime/mercury_conf.h.in:
	Remove old .h files.
	Update #includes to refer to mercury_*.h
	Update #ifdef MODULE_H to be #ifdef MERCURY_MODULE_H
1997-11-23 07:21:53 +00:00
Tyson Dowd
7ce7d489a2 Cleaned up runtime directory.
Estimated hours taken: 2

Cleaned up runtime directory.

runtime/*.c:
	- Renamed all .c files as mercury_*.c
	  Some have been renamed to make their purpose clearer.
	  	call.mod -> mercury_ho_call.c

runtime/*.h:
	- Moved contents of .h files to mercury_*.h
	- *.h now contain #include mercury_*.h. They be removed later.
	- Updated references to conf.h -> mercury_conf.h

runtime/conf.h.in:
	- Renamed conf.h.in as mercury_conf.h.in.
	  Didn't leave a forwarding header for this one, as conf.h was
	  never part of the repository anyway.

runtime/Mmakefile:
	- Convert lists to one-per-line lists.
	- Add mercury_accurate_gc.h to HDRS.
	- Remove all .mod files
	- Make sure runtime.init uses the ORIG_CS not MOD_CS.
	- Fix the rules for "clean_o" and "clean_mod_c", which used
	  wildcards like "*.o" to remove files.  The one that removed
	  all .c files corresponding with *.mod, instead of using MOD_CS
	  was particularly vicious.
	- Cope with the file renamings.

configure.in:
	- Cope with the file renamings.
1997-11-20 02:04:40 +00:00