1a70cba95SGlen BarberPACKAGE=lib${LIB} 281ad8388SMartin MatuskaLIB= lzma 361d32473SEnji CooperLZMADIR= ${SRCTOP}/contrib/xz/src/liblzma 481ad8388SMartin Matuska 561d32473SEnji Cooper.PATH: ${LZMADIR:H}/common 653200025SRui PauloSRCS+= tuklib_physmem.c tuklib_cpucores.c 781ad8388SMartin Matuska 881ad8388SMartin Matuska.PATH: ${LZMADIR}/api/lzma 981ad8388SMartin Matuska 1081ad8388SMartin MatuskaMAININCS= ../lzma.h 1181ad8388SMartin MatuskaMAININCSDIR= ${INCLUDEDIR} 1281ad8388SMartin Matuska 1381ad8388SMartin MatuskaLZMAINCS+= base.h \ 1481ad8388SMartin Matuska bcj.h \ 1581ad8388SMartin Matuska block.h \ 1681ad8388SMartin Matuska check.h \ 1781ad8388SMartin Matuska container.h \ 1881ad8388SMartin Matuska delta.h \ 1981ad8388SMartin Matuska filter.h \ 2098be8199SMartin Matuska hardware.h \ 2198be8199SMartin Matuska index.h \ 2281ad8388SMartin Matuska index_hash.h \ 2353200025SRui Paulo lzma12.h \ 2481ad8388SMartin Matuska stream_flags.h \ 2581ad8388SMartin Matuska version.h \ 2681ad8388SMartin Matuska vli.h 2781ad8388SMartin Matuska 2881ad8388SMartin MatuskaLZMAINCSDIR= ${INCLUDEDIR}/lzma 2981ad8388SMartin Matuska 3081ad8388SMartin MatuskaINCSGROUPS= MAININCS LZMAINCS 3181ad8388SMartin Matuska 3281ad8388SMartin Matuska.PATH: ${LZMADIR}/common 3381ad8388SMartin MatuskaSRCS+= common.c \ 3481ad8388SMartin Matuska block_util.c \ 3581ad8388SMartin Matuska easy_preset.c \ 3681ad8388SMartin Matuska filter_common.c \ 3781ad8388SMartin Matuska hardware_physmem.c \ 3853200025SRui Paulo hardware_cputhreads.c \ 3981ad8388SMartin Matuska index.c \ 4081ad8388SMartin Matuska stream_flags_common.c \ 4173ed8e77SXin LI string_conversion.c \ 4281ad8388SMartin Matuska vli_size.c \ 4381ad8388SMartin Matuska alone_encoder.c \ 4481ad8388SMartin Matuska block_buffer_encoder.c \ 4581ad8388SMartin Matuska block_encoder.c \ 4681ad8388SMartin Matuska block_header_encoder.c \ 4781ad8388SMartin Matuska easy_buffer_encoder.c \ 4881ad8388SMartin Matuska easy_encoder.c \ 4981ad8388SMartin Matuska easy_encoder_memusage.c \ 5081ad8388SMartin Matuska filter_buffer_encoder.c \ 5181ad8388SMartin Matuska filter_encoder.c \ 5281ad8388SMartin Matuska filter_flags_encoder.c \ 5381ad8388SMartin Matuska index_encoder.c \ 5473ed8e77SXin LI lzip_decoder.c \ 5573ed8e77SXin LI microlzma_encoder.c \ 5673ed8e77SXin LI microlzma_decoder.c \ 5781ad8388SMartin Matuska stream_buffer_encoder.c \ 5881ad8388SMartin Matuska stream_encoder.c \ 5981ad8388SMartin Matuska stream_flags_encoder.c \ 6081ad8388SMartin Matuska vli_encoder.c \ 6181ad8388SMartin Matuska alone_decoder.c \ 6281ad8388SMartin Matuska auto_decoder.c \ 6381ad8388SMartin Matuska block_buffer_decoder.c \ 6481ad8388SMartin Matuska block_decoder.c \ 6581ad8388SMartin Matuska block_header_decoder.c \ 6681ad8388SMartin Matuska easy_decoder_memusage.c \ 6773ed8e77SXin LI file_info.c \ 6881ad8388SMartin Matuska filter_buffer_decoder.c \ 6981ad8388SMartin Matuska filter_decoder.c \ 7081ad8388SMartin Matuska filter_flags_decoder.c \ 7181ad8388SMartin Matuska index_decoder.c \ 7281ad8388SMartin Matuska index_hash.c \ 7381ad8388SMartin Matuska stream_buffer_decoder.c \ 7481ad8388SMartin Matuska stream_decoder.c \ 7573ed8e77SXin LI stream_decoder_mt.c \ 7681ad8388SMartin Matuska stream_flags_decoder.c \ 7753200025SRui Paulo stream_encoder_mt.c \ 7853200025SRui Paulo vli_decoder.c \ 7953200025SRui Paulo outqueue.c 8053200025SRui Paulo 8181ad8388SMartin Matuska 8281ad8388SMartin Matuska.PATH: ${LZMADIR}/check 8381ad8388SMartin MatuskaSRCS+= check.c \ 8481ad8388SMartin Matuska crc32_table.c \ 8565422c96SXin LI crc64_table.c 8681ad8388SMartin Matuska.if defined(MACHINE_ARCH) && ${MACHINE_ARCH} == "i386" 8781ad8388SMartin MatuskaSRCS+= crc32_x86.S \ 8881ad8388SMartin Matuska crc64_x86.S 89152e60f2SDimitry AndricACFLAGS+= -Wa,--noexecstack 9081ad8388SMartin Matuska.else 9181ad8388SMartin MatuskaSRCS+= crc32_fast.c \ 9281ad8388SMartin Matuska crc64_fast.c 9381ad8388SMartin Matuska.endif 9481ad8388SMartin Matuska 9581ad8388SMartin Matuska.PATH: ${LZMADIR}/lz 9681ad8388SMartin MatuskaSRCS+= lz_encoder.c \ 9781ad8388SMartin Matuska lz_encoder_mf.c \ 9881ad8388SMartin Matuska lz_decoder.c 9981ad8388SMartin Matuska 10081ad8388SMartin Matuska.PATH: ${LZMADIR}/lzma 10181ad8388SMartin MatuskaSRCS+= lzma_encoder.c \ 10281ad8388SMartin Matuska lzma_encoder_presets.c \ 10381ad8388SMartin Matuska lzma_encoder_optimum_fast.c \ 10481ad8388SMartin Matuska lzma_encoder_optimum_normal.c \ 10581ad8388SMartin Matuska fastpos_table.c \ 10681ad8388SMartin Matuska lzma_decoder.c \ 10781ad8388SMartin Matuska lzma2_encoder.c \ 10881ad8388SMartin Matuska lzma2_decoder.c 10981ad8388SMartin Matuska 11081ad8388SMartin Matuska.PATH: ${LZMADIR}/rangecoder 11181ad8388SMartin MatuskaSRCS+= price_table.c 11281ad8388SMartin Matuska 11381ad8388SMartin Matuska.PATH: ${LZMADIR}/delta 11481ad8388SMartin MatuskaSRCS+= delta_common.c \ 11581ad8388SMartin Matuska delta_encoder.c \ 11681ad8388SMartin Matuska delta_decoder.c 11781ad8388SMartin Matuska 11881ad8388SMartin Matuska.PATH: ${LZMADIR}/simple 11981ad8388SMartin MatuskaSRCS+= simple_coder.c \ 12081ad8388SMartin Matuska simple_encoder.c \ 12181ad8388SMartin Matuska simple_decoder.c \ 12281ad8388SMartin Matuska x86.c \ 12381ad8388SMartin Matuska powerpc.c \ 12481ad8388SMartin Matuska ia64.c \ 12581ad8388SMartin Matuska arm.c \ 12673ed8e77SXin LI arm64.c \ 12781ad8388SMartin Matuska armthumb.c \ 128*3b35e7eeSXin LI riscv.c \ 12981ad8388SMartin Matuska sparc.c 13081ad8388SMartin Matuska 1318606363bSBaptiste Daroussin.PATH: ${LZMADIR} 1328606363bSBaptiste Daroussin 13365422c96SXin LIVERSION_MAJOR!= sed -n '/define.*LZMA_VERSION_MAJOR/{s,[^0-9.],,gp;q;}' \ 1348606363bSBaptiste Daroussin ${LZMADIR}/api/lzma/version.h 13565422c96SXin LIVERSION_MINOR!= sed -n '/define.*LZMA_VERSION_MINOR/{s,[^0-9.],,gp;q;}' \ 1368606363bSBaptiste Daroussin ${LZMADIR}/api/lzma/version.h 13765422c96SXin LIVERSION_PATCH!= sed -n '/define.*LZMA_VERSION_PATCH/{s,[^0-9.],,gp;q;}' \ 1388606363bSBaptiste Daroussin ${LZMADIR}/api/lzma/version.h 1398606363bSBaptiste Daroussin 14081ad8388SMartin MatuskaWARNS?= 3 14181ad8388SMartin Matuska 14281ad8388SMartin MatuskaCFLAGS+= -DHAVE_CONFIG_H \ 143881bfb74SXin LI -DTUKLIB_SYMBOL_PREFIX=lzma_ \ 14481ad8388SMartin Matuska -I${.CURDIR} \ 14581ad8388SMartin Matuska -I${LZMADIR}/api \ 14681ad8388SMartin Matuska -I${LZMADIR}/common \ 14781ad8388SMartin Matuska -I${LZMADIR}/check \ 14881ad8388SMartin Matuska -I${LZMADIR}/lz \ 14981ad8388SMartin Matuska -I${LZMADIR}/rangecoder \ 15081ad8388SMartin Matuska -I${LZMADIR}/lzma \ 15181ad8388SMartin Matuska -I${LZMADIR}/delta \ 15281ad8388SMartin Matuska -I${LZMADIR}/simple \ 15361d32473SEnji Cooper -I${LZMADIR:H}/common 15481ad8388SMartin Matuska 15565422c96SXin LILIBADD+= md pthread 15653200025SRui Paulo 157881bfb74SXin LIVERSION_DEF= ${.CURDIR}/Versions.def 158881bfb74SXin LISYMBOL_MAPS= ${.CURDIR}/Symbol.map 159881bfb74SXin LI 1608606363bSBaptiste DaroussinCLEANFILES+= liblzma.pc 1618606363bSBaptiste Daroussin 162500f4659SEmmanuel VadotPCFILES= liblzma.pc 163de0e3997SBryan Drewery 1648606363bSBaptiste Daroussinliblzma.pc: liblzma.pc.in 165de0e3997SBryan Drewery sed -e 's,@prefix@,/usr,g ; \ 1668606363bSBaptiste Daroussin s,@exec_prefix@,/usr,g ; \ 167ac175bd3SAlex Richardson s,@libdir@,${LIBDIR},g ; \ 168ac175bd3SAlex Richardson s,@sharedlibdir@,${SHLIBDIR},g ; \ 169ac175bd3SAlex Richardson s,@includedir@,${INCLUDEDIR},g ; \ 17065422c96SXin LI s,@LIBS@,-pthread -lmd,g ; \ 17165422c96SXin LI s,@PACKAGE_URL@,https://tukaani.org/xz/,g ; \ 1728606363bSBaptiste Daroussin s,@PACKAGE_VERSION@,${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH},g ; \ 1738606363bSBaptiste Daroussin s,@PTHREAD_CFLAGS@,,g ; \ 1748606363bSBaptiste Daroussin s,@PTHREAD_LIBS@,,g' ${.ALLSRC} > ${.TARGET} 1758606363bSBaptiste Daroussin 17681ad8388SMartin Matuska.include <bsd.lib.mk> 177