[m-rev.] diff: fix compilation problems in util dir with Visual C
Julien Fischer
juliensf at csse.unimelb.edu.au
Fri Jul 15 17:33:30 AEST 2011
Branches: main, 11.07
util/Mmakefile:
Don't use -O0 with Visual C.
Use -Fe instead of -o with Visual C.
Julien.
Index: Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/util/Mmakefile,v
retrieving revision 1.23
diff -u -r1.23 Mmakefile
--- Mmakefile 7 Dec 2010 07:50:29 -0000 1.23
+++ Mmakefile 15 Jul 2011 07:29:58 -0000
@@ -15,9 +15,14 @@
#-----------------------------------------------------------------------------#
-CFLAGS = -I$(RUNTIME_DIR) -O0
-# we need -I ../runtime for "mercury_std.h", etc.
-# the -O0 is to get around a stupid compiler bug in gcc 2.7.2.3 on cyclone
+# We need -I$(RUNTIME_DIR) for "mercury_std.h", etc.
+# The -O0 is to get around a stupid compiler bug in gcc 2.7.2.3.
+# Visual C does not have a -O0 option (it uses -Od instead).
+ifeq ($(USING_MICROSOFT_CL_COMPILER),yes)
+ CFLAGS = -I$(RUNTIME_DIR)
+else
+ CFLAGS = -I$(RUNTIME_DIR) -O0
+endif
PROGS=mkinit mkinit_erl mdemangle mfiltercc info_to_mdb
PROGFILENAMES=$(PROGS:%=%$(EXT_FOR_EXE))
@@ -43,6 +48,21 @@
all: $(PROGS) $(TAGS_FILE_EXISTS)
+ifeq ($(USING_MICROSOFT_CL_COMPILER),yes)
+.c:
+ $(MGNUC) --no-mercury-stdlib-dir \
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -Fe$@ $< $(GETOPT_SRC)
+
+mkinit: mkinit.c mkinit_common.c mkinit_common.h
+ $(MGNUC) --no-mercury-stdlib-dir \
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -Fe$@ \
+ mkinit.c mkinit_common.c $(GETOPT_SRC)
+
+mkinit_erl: mkinit_erl.c mkinit_common.c mkinit_common.h
+ $(MGNUC) --no-mercury-stdlib-dir \
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -Fe$@ \
+ mkinit_erl.c mkinit_common.c $(GETOPT_SRC)
+else
.c:
$(MGNUC) --no-mercury-stdlib-dir \
$(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ $< $(GETOPT_SRC)
@@ -57,6 +77,9 @@
$(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ \
mkinit_erl.c mkinit_common.c $(GETOPT_SRC)
+endif
+
tags:
ctags $(SRC)
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list