]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/tools/build/src/tools/libjpeg.jam
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / tools / build / src / tools / libjpeg.jam
index 309b59df61037bfd78aa462d16abdfca536e978f..f267ecb73db2b913535ebafbd21a3f8f498af077 100644 (file)
 import project ;
 import ac ;
 import errors ;
+import feature ;
 import "class" : new ;
 import targets ; 
 import path ;
 import modules ;
-import errors ;
 import indirect ;
 import property ;
 import property-set ;
 
 header = jpeglib.h ;
 
+# jpeglib.h requires stdio.h to be included first.
+header-test = "#include <stdio.h>\n#include <jpeglib.h>\n" ;
+
 names = jpeg ;
 
 sources =   jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c
@@ -99,7 +102,10 @@ rule init (
 
     : is-default ?
     # Default configurations are only used when libjpeg
-    # has not yet been configured.
+    # has not yet been configured.  This option is
+    # deprecated.  A configuration will be treated
+    # as a default when none of <include>, <search>,
+    # <name>, and <source> are present.
     )
 {
     local caller = [ project.current ] ;
@@ -113,24 +119,22 @@ rule init (
         project libjpeg ;
     }
 
-    local library-path = [ property.select <search> : $(options) ] ;
-    library-path = $(library-path:G=) ;
-    local include-path = [ property.select <include> : $(options) ] ;
-    include-path = $(include-path:G=) ;
-    local source-path = [ property.select <source> : $(options) ] ;
-    source-path = $(source-path:G=) ;
-    local library-name = [ property.select <name> : $(options) ] ;
-    library-name = $(library-name:G=) ;
-    local tag = [ property.select <tag> : $(options) ] ;
-    tag = $(tag:G=) ;
-    local build-name = [ property.select <build-name> : $(options) ] ;
-    build-name = $(build-name:G=) ;
+    local library-path = [ feature.get-values <search> : $(options) ] ;
+    local include-path = [ feature.get-values <include> : $(options) ] ;
+    local source-path = [ feature.get-values <source> : $(options) ] ;
+    local library-name = [ feature.get-values <name> : $(options) ] ;
+    local tag = [ feature.get-values <tag> : $(options) ] ;
+    local build-name = [ feature.get-values <build-name> : $(options) ] ;
 
     condition = [ property-set.create $(requirements) ] ;
     condition = [ property-set.create [ $(condition).base ] ] ;
 
-    local no-build-from-source ;
-    # Ignore environmental ZLIB_SOURCE if this initialization
+    if ! $(library-path) && ! $(include-path) && ! $(source-path) && ! $(library-name)
+    {
+        is-default = true ;
+    }
+
+    # Ignore environmental LIBJPEG_SOURCE if this initialization
     # requested to search for a specific pre-built library.
     if $(library-path) || $(include-path) || $(library-name)
     {
@@ -140,13 +144,11 @@ rule init (
                 [ property.select <search> <include> <name> : $(options) ] "and"
                 [ property.select <source> <tag> <build-name> : $(options) ] ;
         }
-        else
-        {
-            no-build-from-source = true ;
-        }
     }
-
-    source-path ?= [ modules.peek : ZLIB_SOURCE ] ;
+    else
+    {
+        source-path ?= [ modules.peek : LIBJPEG_SOURCE ] ;
+    }
 
     if $(.configured.$(condition))
     {
@@ -163,12 +165,12 @@ rule init (
         }
         return ;
     }
-    else if $(source-path) && ! $(no-build-from-source)
+    else if $(source-path)
     {
         build-name ?= jpeg ;
         library-id = [ CALC $(library-id) + 1 ] ;
         tag = [ MATCH ^@?(.*)$ : $(tag) ] ;
-        if $(tag) && ! [ MATCH ^([^%]*)%([^%]+)$ : $(tag) ]
+        if $(tag)
         {
             tag = [ indirect.make $(tag) : [ $(caller).project-module ] ] ;
         }
@@ -199,7 +201,6 @@ rule init (
                 <include>$(source-path)
                 <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
                 <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
-                <link>shared:<define>ZLIB_DLL
               :
               : <include>$(source-path) ] ;
         }
@@ -225,6 +226,7 @@ rule init (
         local mt = [ new ac-library libjpeg : $(.project) : $(condition) :
             $(include-path) : $(library-path) : $(library-name) : $(root) ] ;
         $(mt).set-header $(header) ;
+        $(mt).set-header-test $(header-test) ;
         $(mt).set-default-names $(names) ;
         targets.main-target-alternative $(mt) ;
     }