2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL)". You may
4 # only use this file in accordance with the terms of the CDDL.
6 # A full copy of the text of the CDDL should have accompanied this
7 # source. A copy of the CDDL is also available via the Internet at
8 # http://www.illumos.org/license/CDDL.
12 # Copyright 2015 Aurelien Larcher
17 USE_COMMON_TEST_MASTER
= no
18 include ..
/..
/..
/make-rules
/shared-macros.mk
20 COMPONENT_NAME
= libjpeg-turbo
21 COMPONENT_VERSION
= 3.1.0
22 COMPONENT_SUMMARY
= libjpeg
-JPEG Turbo libraries
23 COMPONENT_PROJECT_URL
= https
://www.libjpeg-turbo.org
/
24 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
25 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.gz
26 COMPONENT_ARCHIVE_HASH
= sha256
:9564c72b1dfd1d6fe6274c5f95a8d989b59854575d4bbee44ade7bc17aa9bc93
27 COMPONENT_ARCHIVE_URL
= https
://github.com
/libjpeg-turbo
/libjpeg-turbo
/releases
/download
/$(COMPONENT_VERSION
)/$(COMPONENT_ARCHIVE
)
28 COMPONENT_FMRI
= image
/library
/libjpeg-turbo
29 COMPONENT_CLASSIFICATION
= System
/Multimedia Libraries
30 COMPONENT_LICENSE
= IJG
,BSD
,zlib
31 COMPONENT_LICENSE_FILE
= LICENSE.md
33 COMPONENT_FMRI.libjpeg6-turbo
= image
/library
/libjpeg6-turbo
35 COMPONENT_FMRI.libjpeg6-turbo-32
= $(COMPONENT_FMRI.libjpeg6-turbo
)/32
36 COMPONENT_SUMMARY.libjpeg6-turbo-32
= $(COMPONENT_SUMMARY
) (32-bit
)
38 COMPONENT_FMRI.libjpeg7-turbo
= image
/library
/libjpeg7-turbo
40 COMPONENT_FMRI.libjpeg7-turbo-32
= $(COMPONENT_FMRI.libjpeg7-turbo
)/32
41 COMPONENT_SUMMARY.libjpeg7-turbo-32
= $(COMPONENT_SUMMARY
) (32-bit
)
43 COMPONENT_FMRI.libjpeg8-turbo
= image
/library
/libjpeg8-turbo
45 COMPONENT_FMRI.libjpeg8-turbo-32
= $(COMPONENT_FMRI.libjpeg8-turbo
)/32
46 COMPONENT_SUMMARY.libjpeg8-turbo-32
= $(COMPONENT_SUMMARY
) (32-bit
)
48 JPEG_API_VERSIONS
= 6 7 8
50 # Custom BUILD_*, INSTALL_*, and TEST_* variables needs to be defined before
51 # the common.mk include.
53 $(eval BUILD_
$(b
) = $(foreach v
,$(JPEG_API_VERSIONS
),$(BUILD_DIR
)/$(MACH
$(b
))/$(v
)/.built
)) \
54 $(eval INSTALL_
$(b
) = $(foreach v
,$(JPEG_API_VERSIONS
),$(BUILD_DIR
)/$(MACH
$(b
))/$(v
)/.installed
)) \
55 $(if
$(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR
)/results-
*.master
)), \
56 $(eval TEST_
$(b
) = $(foreach v
,$(JPEG_API_VERSIONS
),$(BUILD_DIR
)/$(MACH
$(b
))/$(v
)/.tested-and-compared
)) \
58 $(eval TEST_
$(b
) = $(foreach v
,$(JPEG_API_VERSIONS
),$(BUILD_DIR
)/$(MACH
$(b
))/$(v
)/.tested
)) \
62 include $(WS_MAKE_RULES
)/common.mk
64 # Set BITS and JPEG_API_VERSION for all targets
65 $(foreach t
,configured built installed tested tested-and-compared
, \
67 $(eval
$(BUILD_DIR_
$(b
))/%/.
$(t
): BITS
=$(b
)) \
69 $(foreach v
,$(JPEG_API_VERSIONS
), \
70 $(eval
$(BUILD_DIR
)/%/$(v
)/.
$(t
): JPEG_API_VERSION
=$(v
)) \
74 # Settings to build the desired libjpeg API
76 CMAKE_OPTIONS.JPEG7
= -DWITH_JPEG7
=ON
77 CMAKE_OPTIONS.JPEG8
= -DWITH_JPEG8
=ON
79 # TurboAPI does not depend on libjpeg API version so it is enough to build it
81 CMAKE_OPTIONS.JPEG6
+= -DWITH_TURBOJPEG
=FALSE
82 CMAKE_OPTIONS.JPEG7
+= -DWITH_TURBOJPEG
=FALSE
84 # Include files for old libjpeg API versions goes to separate directory
85 CMAKE_OPTIONS.JPEG6
+= -DCMAKE_INSTALL_INCLUDEDIR
=$(USRINCDIR
)/libjpeg
$(JPEG_API_VERSION
)-turbo
86 CMAKE_OPTIONS.JPEG7
+= -DCMAKE_INSTALL_INCLUDEDIR
=$(USRINCDIR
)/libjpeg
$(JPEG_API_VERSION
)-turbo
88 # Libraries for old libjpeg API versions goes to separate directory
89 CMAKE_OPTIONS.JPEG6
+= -DCMAKE_INSTALL_LIBDIR
=$(USRLIBDIR
)/libjpeg
$(JPEG_API_VERSION
)-turbo
/$(CMAKE_LIBDIR.
$(BITS
))
90 CMAKE_OPTIONS.JPEG7
+= -DCMAKE_INSTALL_LIBDIR
=$(USRLIBDIR
)/libjpeg
$(JPEG_API_VERSION
)-turbo
/$(CMAKE_LIBDIR.
$(BITS
))
93 CMAKE_OPTIONS
+= -DENABLE_STATIC
=FALSE
95 # Allow for build with different API compliance
96 CMAKE_OPTIONS
+= $(CMAKE_OPTIONS.JPEG
$(JPEG_API_VERSION
))
98 # We need to install just a subset of files for various combinations of libjpeg
99 # API version and bitness
100 CMAKE_COMPONENTS.JPEG6
+= lib
101 CMAKE_COMPONENTS.JPEG6.64
+= include
102 CMAKE_COMPONENTS.JPEG7
+= lib
103 CMAKE_COMPONENTS.JPEG7.64
+= include
104 CMAKE_COMPONENTS.JPEG8.32
+= lib
105 CMAKE_COMPONENTS
+= $(CMAKE_COMPONENTS.JPEG
$(JPEG_API_VERSION
))
106 CMAKE_COMPONENTS
+= $(CMAKE_COMPONENTS.JPEG
$(JPEG_API_VERSION
).
$(BITS
))
108 # Create library symlinks at standard locations
109 COMPONENT_POST_INSTALL_ACTION
+= $(call create-symlinks
,$(USRLIBDIR
)/libjpeg
$(JPEG_API_VERSION
)-turbo
/$(CMAKE_LIBDIR.
$(BITS
))/*.so.
*,$(USRLIBDIR.
$(BITS
))) ;
111 # Per libjpeg API version test directory
112 COMPONENT_TEST_BUILD_DIR
= $(BUILD_DIR
)/test/$(MACH
$(BITS
))/$(JPEG_API_VERSION
)
113 # Per libjpeg API version master test results file
114 COMPONENT_TEST_MASTER
= $(COMPONENT_TEST_RESULTS_DIR
)/results-
$(BITS
)-$(JPEG_API_VERSION
).master
116 # Normalize test results
117 COMPONENT_TEST_TRANSFORMS
+= "-e 's/ *[0-9]\{1,\}\.[0-9]\{1,\} sec\$$//'" # timing
118 COMPONENT_TEST_TRANSFORMS
+= "-e '/^Total Test time/d'" # timing
119 COMPONENT_TEST_TRANSFORMS
+= "-e '/^ *Start/d'" # drop Start lines
120 COMPONENT_TEST_TRANSFORMS
+= "-e 's/^ *[0-9]\{1,\}\/[0-9]\{1,\} Test *\#[0-9]\{1,\}:/Test/'" # drop test numbers
122 # Auto-generated dependencies
123 REQUIRED_PACKAGES
+= system
/library
124 REQUIRED_PACKAGES
+= system
/library
/math