yangtse: curl-www/scratch Makefile.msvc.head,1.7,1.8
[email protected] Tue, 17 Mar 2009 13:53:19 +0000
| Newsgroups | gmane.comp.web.curl.www.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/curl/curl-www/scratch In directory labb:/tmp/cvs-serv13240 Modified Files: Makefile.msvc.head Log Message: SAFETYNET option controls whether highly discouraged build option combinations will be handled as fatal build errors or warnings. Index: Makefile.msvc.head =================================================================== RCS file: /cvsroot/curl/curl-www/scratch/Makefile.msvc.head,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.msvc.head 16 Mar 2009 19:08:05 -0000 1.7 +++ Makefile.msvc.head 17 Mar 2009 13:53:16 -0000 1.8 @@ -25,6 +25,16 @@ # curl and libcurl MSVC makefile # -------------------------------------------------------------------------- # +# All makefile options use default values when not specified. Options that +# are documented below these lines can be used to highly customize how the +# curl tool and the libcurl library are built. Options can be specified in +# any order. +# +# To build curl and libcurl with default options run the following command: +# +# nmake -f Makefile.msvc +# +# # Makefile options: # ----------------- # @@ -145,6 +155,28 @@ # nmake -f Makefile.msvc WITH_CRT=LIB # # +# ENABLE_SAFETYNET = YES|NO|1|0 +# DISABLE_SAFETYNET = YES|NO|1|0 +# +# Whether highly discouraged build option combinations will be handled as +# fatal build errors or warnings when building libcurl library, and curl, can +# be specified using one of the above two options with a valid value. If none +# of these options are given, default behaviour is to have build safety net +# enabled wich results in fatal build errors when option combinations which +# are highly discouraged are detected. +# +# Any of the following three commands builds libcurl with safety build checks: +# +# nmake -f Makefile.msvc +# nmake -f Makefile.msvc ENABLE_SAFETYNET=YES +# nmake -f Makefile.msvc DISABLE_SAFETYNET=NO +# +# The following two commands builds libcurl without safety build checks: +# +# nmake -f Makefile.msvc DISABLE_SAFETYNET=YES +# nmake -f Makefile.msvc ENABLE_SAFETYNET=NO +# +# # ------------------------------------------------------- @@ -225,6 +257,53 @@ !ENDIF # ------------------------------------------------------------------------------ +# Build time safety net selection. Default is to build with saftey net enabled +# ------------------------------------------------------------------------------ + +OPT_SAFETYNET = +OPT_SAFETYNET_SET = + +!IF "$(ENABLE_SAFETYNET)" == "YES" || \ + "$(ENABLE_SAFETYNET)" == "yes" || \ + "$(ENABLE_SAFETYNET)" == "1" +OPT_SAFETYNET = yes +OPT_SAFETYNET_SET = X$(OPT_SAFETYNET_SET) +!ELSEIF "$(ENABLE_SAFETYNET)" == "NO" || \ + "$(ENABLE_SAFETYNET)" == "no" || \ + "$(ENABLE_SAFETYNET)" == "0" +OPT_SAFETYNET = no +OPT_SAFETYNET_SET = X$(OPT_SAFETYNET_SET) +!ELSEIF "$(ENABLE_SAFETYNET)" != "" +! MESSAGE Invalid ENABLE_SAFETYNET option value. It must be: YES, NO, 1 or 0. +! ERROR See previous message. +!ENDIF + +!IF "$(DISABLE_SAFETYNET)" == "YES" || \ + "$(DISABLE_SAFETYNET)" == "yes" || \ + "$(DISABLE_SAFETYNET)" == "1" +OPT_SAFETYNET = no +OPT_SAFETYNET_SET = X$(OPT_SAFETYNET_SET) +!ELSEIF "$(DISABLE_SAFETYNET)" == "NO" || \ + "$(DISABLE_SAFETYNET)" == "no" || \ + "$(DISABLE_SAFETYNET)" == "0" +OPT_SAFETYNET = yes +OPT_SAFETYNET_SET = X$(OPT_SAFETYNET_SET) +!ELSEIF "$(DISABLE_SAFETYNET)" != "" +! MESSAGE Invalid DISABLE_SAFETYNET option value. It must be: YES, NO, 1 or 0. +! ERROR See previous message. +!ENDIF + +!IF "$(OPT_SAFETYNET_SET)" == "" +OPT_SAFETYNET = yes +!ELSEIF "$(OPT_SAFETYNET_SET)" != "X" +! MESSAGE Mutually exclusive options detected. +! MESSAGE To specify whether highly discouraged build option combinations or +! MESSAGE conditions should be handled as fatal build errors or warnings when +! MESSAGE building libcurl library, only a single option among ENABLE_SAFETYNET +! MESSAGE or DISABLE_SAFETYNET is allowed at a given time. +!ENDIF + +# ------------------------------------------------------------------------------ # libcurl library type selection. Default is libcurl shared library (.dll) # ------------------------------------------------------------------------------ @@ -514,16 +593,24 @@ !ENDIF !IF "$(OPT_LIBTYPE)" == "dll" && "$(OPT_CRT)" == "static" -! MESSAGE +-------------------------------------------------------------------+ -! MESSAGE | WARNING WARNING WARNING WARNING WARNING WARNING WARNING | -! MESSAGE +-------------------------------------------------------------------+ -! MESSAGE | Building a dynamic (.dll) libcurl library with a static or | -! MESSAGE | private C run-time is highly discouraged. Don't cry later. | -! MESSAGE +-------------------------------------------------------------------+ -! MESSAGE | WARNING WARNING WARNING WARNING WARNING WARNING WARNING | -! MESSAGE +-------------------------------------------------------------------+ +! IF "$(OPT_SAFETYNET)" == "yes" +! MESSAGE +-----------------------------------------------------------------+ +! MESSAGE | ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR | +! MESSAGE +-----------------------------------------------------------------+ +! MESSAGE | Building a dynamic (.dll) libcurl library with a static or | +! MESSAGE | private C run-time is highly discouraged and avoided here. | +! MESSAGE +-----------------------------------------------------------------+ +! MESSAGE | ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR | +! MESSAGE +-----------------------------------------------------------------+ +! MESSAGE | Option DISABLE_SAFETYNET=YES converts this error into a warning | +! MESSAGE +-----------------------------------------------------------------+ +! ERROR See previous message. +! ELSE +WARN_STATIC_CRT_DLL = yes +! ENDIF !ENDIF + # ------------------------------------------------------------------ # Show some variables and values that will be used further onwards # ------------------------------------------------------------------ @@ -541,3 +628,17 @@ !ENDIF +# ---------------------------------------------------------------- +# Show critical warnings when build safety net has been disabled +# ---------------------------------------------------------------- + +!IF "$(WARN_STATIC_CRT_DLL)" == "yes" +! MESSAGE +-------------------------------------------------------------------+ +! MESSAGE | WARNING WARNING WARNING WARNING WARNING WARNING WARNING | +! MESSAGE +-------------------------------------------------------------------+ +! MESSAGE | Building a dynamic (.dll) libcurl library with a static or | +! MESSAGE | private C run-time is highly discouraged. Don't cry later. | +! MESSAGE +-------------------------------------------------------------------+ +! MESSAGE | WARNING WARNING WARNING WARNING WARNING WARNING WARNING | +! MESSAGE +-------------------------------------------------------------------+ +!ENDIF