This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix $Config{ccflags} for Win32 perls built with dmake
authorSteve Hay <SteveHay@planit.com>
Wed, 5 Oct 2005 15:34:18 +0000 (15:34 +0000)
committerSteve Hay <SteveHay@planit.com>
Wed, 5 Oct 2005 15:34:18 +0000 (15:34 +0000)
The nmake makefile (win32/Makefile) currently adds -nologo, $(STRPOOL)
and -W3 to the ccflags in CFG_VARS, but the dmake makefile
(win32/makefile.mk) doesn't.  This means that extensions built with
perls built with VC++ and dmake spit out damn M$ logo messages and use
a lower warning level.

The reason for the difference is probably that the dmake makefile
supports multiple compilers.  Therefore, put the extra ccflags into a
new macro, and set it appropriately for each compiler.  Add the new
macro to the nmake makefile too for orthogonality.

p4raw-id: //depot/perl@25694

win32/Makefile
win32/makefile.mk

index e66ef74..c4c41d8 100644 (file)
@@ -443,7 +443,8 @@ LIBBASEFILES        = $(LIBBASEFILES) odbc32.lib odbccp32.lib
 # we add LIBC here, since we may be using PerlCRT.dll
 LIBFILES       = $(LIBBASEFILES) $(LIBC)
 
-CFLAGS         = -nologo $(STRPOOL) -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
+EXTRACFLAGS    = -nologo $(STRPOOL) -W3
+CFLAGS         = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) \
                $(PCHFLAGS) $(OPTIMIZE)
 LINK_FLAGS     = -nologo -nodefaultlib $(LINK_DBG) \
                -libpath:"$(INST_COREDIR)" \
@@ -864,7 +865,7 @@ CFG_VARS    =                                       \
                "archname=$(ARCHNAME)"                  \
                "cc=$(CC)"                              \
                "ld=$(LINK32)"                          \
-               "ccflags=-nologo $(STRPOOL) -W3 $(OPTIMIZE:"=\") $(DEFINES) $(BUILDOPT)"        \
+               "ccflags=$(EXTRACFLAGS) $(OPTIMIZE:"=\") $(DEFINES) $(BUILDOPT)"        \
                "cf_email=$(EMAIL)"                     \
                "d_crypt=$(D_CRYPT)"                    \
                "d_mymalloc=$(PERL_MALLOC)"             \
index a08afe1..c05b4a1 100644 (file)
@@ -404,6 +404,7 @@ OPTIMIZE    = -O2 -D_RTLDLL
 LINK_DBG       =
 .ENDIF
 
+EXTRACFLAGS    =
 CFLAGS         = -w -g0 -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) \
                $(PCHFLAGS) $(OPTIMIZE)
 LINK_FLAGS     = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)" \
@@ -460,6 +461,7 @@ OPTIMIZE    = -s -O2
 LINK_DBG       = -s
 .ENDIF
 
+EXTRACFLAGS    =
 CFLAGS         = $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
 LINK_FLAGS     = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
 OBJOUT_FLAG    = -o
@@ -552,7 +554,8 @@ LIBBASEFILES        += odbc32.lib odbccp32.lib
 # we add LIBC here, since we may be using PerlCRT.dll
 LIBFILES       = $(LIBBASEFILES) $(LIBC)
 
-CFLAGS         = -nologo $(STRPOOL) -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
+EXTRACFLAGS    = -nologo $(STRPOOL) -W3
+CFLAGS         = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) \
                $(PCHFLAGS) $(OPTIMIZE)
 LINK_FLAGS     = -nologo -nodefaultlib $(LINK_DBG) \
                -libpath:"$(INST_COREDIR)" \
@@ -903,7 +906,7 @@ CFG_VARS    =                                       \
                archname=$(ARCHNAME)            ~       \
                cc=$(CC)                        ~       \
                ld=$(LINK32)                    ~       \
-               ccflags=$(OPTIMIZE) $(DEFINES) $(BUILDOPT)      ~       \
+               ccflags=$(EXTRACFLAGS) $(OPTIMIZE) $(DEFINES) $(BUILDOPT)       ~       \
                cf_email=$(EMAIL)               ~       \
                d_crypt=$(D_CRYPT)              ~       \
                d_mymalloc=$(PERL_MALLOC)       ~       \