diff --git a/Mmakefile b/Mmakefile index 1595be8c2..5fe2537ff 100644 --- a/Mmakefile +++ b/Mmakefile @@ -425,8 +425,8 @@ install_grades: scripts # runs the newly installed compiler, rather than using the # bootstrap compiler. # - +for grade in x $(LIBGRADES); do \ - if [ "$$grade" != "x" ]; then \ + +for grade in $(LIBGRADES); do \ + if [ "$$grade" != "$(GRADE)" ]; then \ gc_grade=`scripts/ml --grade $$grade --print-gc-grade`; \ ( cd boehm_gc && \ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade GC_GRADE=$$gc_grade \ @@ -485,7 +485,7 @@ install_split_library: scripts dep_library done || true && \ { mv -f $(deps_subdir)*.dep $(deps_subdir)*.dv *.$O Mercury/os/*.$O \ *.$A *.so tmp_dir || true; } && \ - for grade in $(GRADE) $(LIBGRADES); do \ + for grade in $(LIBGRADES); do \ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade depend && \ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade install_split_library || \ { scripts/mercury_cleanup_install; exit 1; }; \ diff --git a/compiler/make.program_target.m b/compiler/make.program_target.m index 6f7f825c7..6ace24b5a 100644 --- a/compiler/make.program_target.m +++ b/compiler/make.program_target.m @@ -493,8 +493,9 @@ install_library(MainModuleName, Succeeded, Info0, Info) --> { GradeSucceeded = yes } -> % XXX With Mmake, LIBGRADES is target-specific. - globals__io_lookup_accumulating_option(libgrades, LibGrades), + globals__io_lookup_accumulating_option(libgrades, LibGrades0), globals__io_lookup_bool_option(keep_going, KeepGoing), + { LibGrades = list__delete_all(LibGrades0, Grade) }, foldl2_maybe_stop_at_error(KeepGoing, install_library_grade(LinkSucceeded, MainModuleName, AllModules), diff --git a/configure.in b/configure.in index 6736b007a..64a1d8e36 100644 --- a/configure.in +++ b/configure.in @@ -2299,17 +2299,6 @@ fi MERCURY_MSG("using \`$LIBGRADES' as the set of library grades to install") -# Remove GRADE from LIBGRADES. This is done because `mmake install_main' -# will have already installed the libraries for grade GRADE. -# We can only do this if GRADE is the same as DEFAULT_GRADE, -# because LIBGRADES is used both for installing the compiler, which -# gets build in grade GRADE, and also for installing user libraries, -# which (presumably) get built in in DEFAULT_GRADE. -if test $GRADE = $DEFAULT_GRADE; then - LIBGRADES=` echo " $LIBGRADES " | sed "s/ $GRADE / /" ` -fi - - LIBGRADE_OPTS= for libgrade in $LIBGRADES do diff --git a/scripts/Mmake.rules b/scripts/Mmake.rules index 92918c3ec..3dfbfa06a 100644 --- a/scripts/Mmake.rules +++ b/scripts/Mmake.rules @@ -494,8 +494,8 @@ lib%.install_grades: done && \ { mv -f $(deps_subdir)$*.dep $(deps_subdir)$*.dv \ *.a *.so tmp_dir || true; } && \ - for grade in x $(ALL_LIBGRADES); do \ - if [ "$$grade" != "x" ]; then \ + for grade in $(ALL_LIBGRADES); do \ + if [ "$$grade" != "$(GRADE)" ]; then \ $(MMAKE) GRADE=$$grade $*.depend || \ exit 1; \ $(MMAKE) GRADE=$$grade lib$*.install_library || \ @@ -523,8 +523,8 @@ lib%.install_split_grades: mkdir tmp_dir && \ { mv -f $(deps_subdir)$*.dep $(deps_subdir)$*.dv $($*.mihs) \ $($*.dirs) *.a *.so tmp_dir || true; } && \ - for grade in x $(ALL_LIBGRADES); do \ - if [ "$$grade" != "x" ]; then \ + for grade in $(ALL_LIBGRADES); do \ + if [ "$$grade" != "$(GRADE)" ]; then \ $(MMAKE) GRADE=$$grade $*.depend || \ exit 1; \ $(MMAKE) GRADE=$$grade lib$*.install_split_library || \ diff --git a/scripts/Mmake.vars.in b/scripts/Mmake.vars.in index 72b2c9471..9c6d84439 100644 --- a/scripts/Mmake.vars.in +++ b/scripts/Mmake.vars.in @@ -343,7 +343,6 @@ EXTRA_RANLIBFLAGS = # List of grades to install for a library ALL_LIBGRADES = $(TARGET_LIBGRADES) $(EXTRA_TARGET_LIBGRADES) -LIBGRADES = EXTRA_LIBGRADES = # $(CFLAGS_FOR_PIC) is passed to the C compiler when creating `.pic_o' files @@ -706,7 +705,8 @@ FINAL_INSTALL_MERC_LIB_DIR = \ #-----------------------------------------------------------------------------# -# Specify the additional compilation models to install by default +# Specify the compilation models to install by default. +# This list will include the default grade. LIBGRADES = @LIBGRADES@ #-----------------------------------------------------------------------------#