hane 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/README.md +32 -32
  2. package/binding.gyp +77 -50
  3. package/deps/win-nodeapi/node_api.def +158 -0
  4. package/deps/win-nodeapi/node_api.lib +0 -0
  5. package/dist/index.js +1 -1
  6. package/package.json +34 -33
  7. package/src/native/addon.cc +247 -207
  8. package/src/native/zsign_driver.cc +87 -87
  9. package/src/native/zsign_driver.h +38 -38
  10. package/vendor/zlib/.cmake-format.yaml +245 -245
  11. package/vendor/zlib/.github/workflows/c-std.yml +230 -230
  12. package/vendor/zlib/.github/workflows/cmake.yml +112 -112
  13. package/vendor/zlib/.github/workflows/configure.yml +136 -136
  14. package/vendor/zlib/.github/workflows/fuzz.yml +25 -25
  15. package/vendor/zlib/.github/workflows/msys-cygwin.yml +77 -77
  16. package/vendor/zlib/BUILD.bazel +134 -134
  17. package/vendor/zlib/CMakeLists.txt +330 -330
  18. package/vendor/zlib/ChangeLog +1621 -1621
  19. package/vendor/zlib/FAQ +367 -367
  20. package/vendor/zlib/INDEX +68 -68
  21. package/vendor/zlib/LICENSE +22 -22
  22. package/vendor/zlib/MODULE.bazel +9 -9
  23. package/vendor/zlib/Makefile.in +419 -419
  24. package/vendor/zlib/README +115 -115
  25. package/vendor/zlib/README-cmake.md +83 -83
  26. package/vendor/zlib/adler32.c +164 -164
  27. package/vendor/zlib/amiga/Makefile.pup +69 -69
  28. package/vendor/zlib/amiga/Makefile.sas +68 -68
  29. package/vendor/zlib/compress.c +75 -75
  30. package/vendor/zlib/configure +966 -966
  31. package/vendor/zlib/contrib/README.contrib +57 -57
  32. package/vendor/zlib/contrib/ada/buffer_demo.adb +106 -106
  33. package/vendor/zlib/contrib/ada/mtest.adb +156 -156
  34. package/vendor/zlib/contrib/ada/read.adb +156 -156
  35. package/vendor/zlib/contrib/ada/readme.txt +65 -65
  36. package/vendor/zlib/contrib/ada/test.adb +463 -463
  37. package/vendor/zlib/contrib/ada/zlib-streams.adb +225 -225
  38. package/vendor/zlib/contrib/ada/zlib-streams.ads +114 -114
  39. package/vendor/zlib/contrib/ada/zlib-thin.adb +142 -142
  40. package/vendor/zlib/contrib/ada/zlib-thin.ads +450 -450
  41. package/vendor/zlib/contrib/ada/zlib.adb +701 -701
  42. package/vendor/zlib/contrib/ada/zlib.ads +328 -328
  43. package/vendor/zlib/contrib/ada/zlib.gpr +20 -20
  44. package/vendor/zlib/contrib/blast/Makefile +8 -8
  45. package/vendor/zlib/contrib/blast/README +4 -4
  46. package/vendor/zlib/contrib/blast/blast.c +466 -466
  47. package/vendor/zlib/contrib/blast/blast.h +83 -83
  48. package/vendor/zlib/contrib/delphi/ZLib.pas +557 -557
  49. package/vendor/zlib/contrib/delphi/ZLibConst.pas +11 -11
  50. package/vendor/zlib/contrib/delphi/readme.txt +76 -76
  51. package/vendor/zlib/contrib/delphi/zlibd32.mak +99 -99
  52. package/vendor/zlib/contrib/gcc_gvmat64/gvmat64.S +574 -574
  53. package/vendor/zlib/contrib/infback9/README +1 -1
  54. package/vendor/zlib/contrib/infback9/infback9.c +603 -603
  55. package/vendor/zlib/contrib/infback9/infback9.h +37 -37
  56. package/vendor/zlib/contrib/infback9/inffix9.h +107 -107
  57. package/vendor/zlib/contrib/infback9/inflate9.h +47 -47
  58. package/vendor/zlib/contrib/infback9/inftree9.c +319 -319
  59. package/vendor/zlib/contrib/infback9/inftree9.h +61 -61
  60. package/vendor/zlib/contrib/iostream/test.cpp +24 -24
  61. package/vendor/zlib/contrib/iostream/zfstream.cpp +329 -329
  62. package/vendor/zlib/contrib/iostream/zfstream.h +128 -128
  63. package/vendor/zlib/contrib/iostream2/zstream.h +307 -307
  64. package/vendor/zlib/contrib/iostream2/zstream_test.cpp +25 -25
  65. package/vendor/zlib/contrib/iostream3/README +35 -35
  66. package/vendor/zlib/contrib/iostream3/TODO +17 -17
  67. package/vendor/zlib/contrib/iostream3/test.cc +50 -50
  68. package/vendor/zlib/contrib/iostream3/zfstream.cc +479 -479
  69. package/vendor/zlib/contrib/iostream3/zfstream.h +466 -466
  70. package/vendor/zlib/contrib/minizip/CMakeLists.txt +380 -380
  71. package/vendor/zlib/contrib/minizip/Makefile +37 -37
  72. package/vendor/zlib/contrib/minizip/Makefile.am +45 -45
  73. package/vendor/zlib/contrib/minizip/MiniZip64_Changes.txt +6 -6
  74. package/vendor/zlib/contrib/minizip/MiniZip64_info.txt +74 -74
  75. package/vendor/zlib/contrib/minizip/configure.ac +32 -32
  76. package/vendor/zlib/contrib/minizip/crypt.h +128 -128
  77. package/vendor/zlib/contrib/minizip/ints.h +57 -57
  78. package/vendor/zlib/contrib/minizip/ioapi.c +231 -231
  79. package/vendor/zlib/contrib/minizip/ioapi.h +183 -183
  80. package/vendor/zlib/contrib/minizip/iowin32.c +448 -448
  81. package/vendor/zlib/contrib/minizip/iowin32.h +28 -28
  82. package/vendor/zlib/contrib/minizip/make_vms.com +25 -25
  83. package/vendor/zlib/contrib/minizip/miniunz.c +647 -647
  84. package/vendor/zlib/contrib/minizip/miniunzip.1 +63 -63
  85. package/vendor/zlib/contrib/minizip/minizip.1 +46 -46
  86. package/vendor/zlib/contrib/minizip/minizip.c +512 -512
  87. package/vendor/zlib/contrib/minizip/minizip.pc.in +12 -12
  88. package/vendor/zlib/contrib/minizip/minizip.pc.txt +13 -13
  89. package/vendor/zlib/contrib/minizip/minizipConfig.cmake.in +35 -35
  90. package/vendor/zlib/contrib/minizip/mztools.c +288 -288
  91. package/vendor/zlib/contrib/minizip/mztools.h +37 -37
  92. package/vendor/zlib/contrib/minizip/skipset.h +361 -361
  93. package/vendor/zlib/contrib/minizip/test/CMakeLists.txt +121 -121
  94. package/vendor/zlib/contrib/minizip/test/add_subdirectory_exclude_test.cmake.in +29 -29
  95. package/vendor/zlib/contrib/minizip/test/add_subdirectory_test.cmake.in +28 -28
  96. package/vendor/zlib/contrib/minizip/test/find_package_test.cmake.in +25 -25
  97. package/vendor/zlib/contrib/minizip/test/test_helper.cm +32 -32
  98. package/vendor/zlib/contrib/minizip/unzip.c +1981 -1981
  99. package/vendor/zlib/contrib/minizip/unzip.h +441 -441
  100. package/vendor/zlib/contrib/minizip/zip.c +2199 -2199
  101. package/vendor/zlib/contrib/minizip/zip.h +370 -370
  102. package/vendor/zlib/contrib/nuget/nuget.csproj +43 -43
  103. package/vendor/zlib/contrib/nuget/nuget.sln +22 -22
  104. package/vendor/zlib/contrib/pascal/example.pas +599 -599
  105. package/vendor/zlib/contrib/pascal/readme.txt +76 -76
  106. package/vendor/zlib/contrib/pascal/zlibd32.mak +99 -99
  107. package/vendor/zlib/contrib/pascal/zlibpas.pas +276 -276
  108. package/vendor/zlib/contrib/puff/Makefile +42 -42
  109. package/vendor/zlib/contrib/puff/README +63 -63
  110. package/vendor/zlib/contrib/puff/puff.c +840 -840
  111. package/vendor/zlib/contrib/puff/puff.h +35 -35
  112. package/vendor/zlib/contrib/puff/pufftest.c +169 -169
  113. package/vendor/zlib/contrib/untgz/Makefile +14 -14
  114. package/vendor/zlib/contrib/untgz/Makefile.msc +17 -17
  115. package/vendor/zlib/contrib/untgz/untgz.c +667 -667
  116. package/vendor/zlib/contrib/vstudio/readme.txt +81 -81
  117. package/vendor/zlib/contrib/vstudio/vc12/miniunz.vcxproj +315 -315
  118. package/vendor/zlib/contrib/vstudio/vc12/minizip.vcxproj +312 -312
  119. package/vendor/zlib/contrib/vstudio/vc12/testzlib.vcxproj +421 -421
  120. package/vendor/zlib/contrib/vstudio/vc12/testzlibdll.vcxproj +315 -315
  121. package/vendor/zlib/contrib/vstudio/vc12/zlib.rc +32 -32
  122. package/vendor/zlib/contrib/vstudio/vc12/zlibstat.vcxproj +458 -458
  123. package/vendor/zlib/contrib/vstudio/vc12/zlibvc.sln +119 -119
  124. package/vendor/zlib/contrib/vstudio/vc12/zlibvc.vcxproj +667 -667
  125. package/vendor/zlib/contrib/vstudio/vc14/miniunz.vcxproj +315 -315
  126. package/vendor/zlib/contrib/vstudio/vc14/minizip.vcxproj +312 -312
  127. package/vendor/zlib/contrib/vstudio/vc14/testzlib.vcxproj +421 -421
  128. package/vendor/zlib/contrib/vstudio/vc14/testzlibdll.vcxproj +315 -315
  129. package/vendor/zlib/contrib/vstudio/vc14/zlib.rc +32 -32
  130. package/vendor/zlib/contrib/vstudio/vc14/zlibstat.vcxproj +458 -458
  131. package/vendor/zlib/contrib/vstudio/vc14/zlibvc.sln +119 -119
  132. package/vendor/zlib/contrib/vstudio/vc14/zlibvc.vcxproj +667 -667
  133. package/vendor/zlib/contrib/vstudio/vc17/miniunz.vcxproj +408 -408
  134. package/vendor/zlib/contrib/vstudio/vc17/minizip.vcxproj +404 -404
  135. package/vendor/zlib/contrib/vstudio/vc17/testzlib.vcxproj +472 -472
  136. package/vendor/zlib/contrib/vstudio/vc17/testzlibdll.vcxproj +408 -408
  137. package/vendor/zlib/contrib/vstudio/vc17/zlib.rc +32 -32
  138. package/vendor/zlib/contrib/vstudio/vc17/zlibstat.vcxproj +601 -601
  139. package/vendor/zlib/contrib/vstudio/vc17/zlibvc.sln +179 -179
  140. package/vendor/zlib/contrib/vstudio/vc17/zlibvc.vcxproj +874 -874
  141. package/vendor/zlib/crc32.c +1049 -1049
  142. package/vendor/zlib/crc32.h +9446 -9446
  143. package/vendor/zlib/deflate.c +2152 -2152
  144. package/vendor/zlib/deflate.h +380 -380
  145. package/vendor/zlib/doc/algorithm.txt +209 -209
  146. package/vendor/zlib/doc/rfc1950.txt +619 -619
  147. package/vendor/zlib/doc/rfc1951.txt +955 -955
  148. package/vendor/zlib/doc/rfc1952.txt +675 -675
  149. package/vendor/zlib/doc/txtvsbin.txt +107 -107
  150. package/vendor/zlib/examples/README.examples +54 -54
  151. package/vendor/zlib/examples/enough.c +597 -597
  152. package/vendor/zlib/examples/fitblk.c +233 -233
  153. package/vendor/zlib/examples/gun.c +702 -702
  154. package/vendor/zlib/examples/gzappend.c +504 -504
  155. package/vendor/zlib/examples/gzjoin.c +449 -449
  156. package/vendor/zlib/examples/gzlog.c +1061 -1061
  157. package/vendor/zlib/examples/gzlog.h +91 -91
  158. package/vendor/zlib/examples/gznorm.c +474 -474
  159. package/vendor/zlib/examples/zlib_how.html +549 -549
  160. package/vendor/zlib/examples/zpipe.c +209 -209
  161. package/vendor/zlib/examples/zran.c +550 -550
  162. package/vendor/zlib/examples/zran.h +53 -53
  163. package/vendor/zlib/gzclose.c +23 -23
  164. package/vendor/zlib/gzguts.h +215 -215
  165. package/vendor/zlib/gzlib.c +585 -585
  166. package/vendor/zlib/gzread.c +603 -603
  167. package/vendor/zlib/gzwrite.c +631 -631
  168. package/vendor/zlib/infback.c +628 -628
  169. package/vendor/zlib/inffast.c +320 -320
  170. package/vendor/zlib/inffast.h +11 -11
  171. package/vendor/zlib/inffixed.h +94 -94
  172. package/vendor/zlib/inflate.c +1526 -1526
  173. package/vendor/zlib/inflate.h +126 -126
  174. package/vendor/zlib/inftrees.c +299 -299
  175. package/vendor/zlib/inftrees.h +62 -62
  176. package/vendor/zlib/make_vms.com +867 -867
  177. package/vendor/zlib/msdos/Makefile.bor +115 -115
  178. package/vendor/zlib/msdos/Makefile.dj2 +104 -104
  179. package/vendor/zlib/msdos/Makefile.emx +69 -69
  180. package/vendor/zlib/msdos/Makefile.msc +112 -112
  181. package/vendor/zlib/msdos/Makefile.tc +100 -100
  182. package/vendor/zlib/nintendods/Makefile +126 -126
  183. package/vendor/zlib/nintendods/README +5 -5
  184. package/vendor/zlib/old/Makefile.emx +69 -69
  185. package/vendor/zlib/old/Makefile.riscos +151 -151
  186. package/vendor/zlib/old/README +3 -3
  187. package/vendor/zlib/old/descrip.mms +48 -48
  188. package/vendor/zlib/old/os2/Makefile.os2 +136 -136
  189. package/vendor/zlib/old/os2/zlib.def +51 -51
  190. package/vendor/zlib/old/visual-basic.txt +160 -160
  191. package/vendor/zlib/os400/README400 +48 -48
  192. package/vendor/zlib/os400/bndsrc +133 -133
  193. package/vendor/zlib/os400/make.sh +366 -366
  194. package/vendor/zlib/os400/zlib.inc +531 -531
  195. package/vendor/zlib/qnx/package.qpg +141 -141
  196. package/vendor/zlib/test/CMakeLists.txt +265 -265
  197. package/vendor/zlib/test/add_subdirectory_exclude_test.cmake.in +29 -29
  198. package/vendor/zlib/test/add_subdirectory_test.cmake.in +28 -28
  199. package/vendor/zlib/test/example.c +552 -552
  200. package/vendor/zlib/test/find_package_test.cmake.in +26 -26
  201. package/vendor/zlib/test/infcover.c +672 -672
  202. package/vendor/zlib/test/minigzip.c +590 -590
  203. package/vendor/zlib/treebuild.xml +116 -116
  204. package/vendor/zlib/trees.c +1119 -1119
  205. package/vendor/zlib/trees.h +128 -128
  206. package/vendor/zlib/uncompr.c +85 -85
  207. package/vendor/zlib/watcom/watcom_f.mak +43 -43
  208. package/vendor/zlib/watcom/watcom_l.mak +43 -43
  209. package/vendor/zlib/win32/DLL_FAQ.txt +381 -381
  210. package/vendor/zlib/win32/Makefile.bor +109 -109
  211. package/vendor/zlib/win32/Makefile.gcc +177 -177
  212. package/vendor/zlib/win32/Makefile.msc +159 -159
  213. package/vendor/zlib/win32/README-WIN32.txt +103 -103
  214. package/vendor/zlib/win32/VisualC.txt +3 -3
  215. package/vendor/zlib/win32/zlib1.rc +37 -37
  216. package/vendor/zlib/zconf.h.in +544 -544
  217. package/vendor/zlib/zlib.3 +149 -149
  218. package/vendor/zlib/zlib.h +1957 -1957
  219. package/vendor/zlib/zlib.map +103 -103
  220. package/vendor/zlib/zlib.pc.cmakein +13 -13
  221. package/vendor/zlib/zlib.pc.in +13 -13
  222. package/vendor/zlib/zlibConfig.cmake.in +26 -26
  223. package/vendor/zlib/zutil.c +299 -299
  224. package/vendor/zlib/zutil.h +257 -257
  225. package/vendor/zsign/.gitattributes +3 -3
  226. package/vendor/zsign/LICENSE +20 -20
  227. package/vendor/zsign/README.md +142 -142
  228. package/vendor/zsign/build/linux/Makefile +43 -43
  229. package/vendor/zsign/build/macos/Makefile +43 -43
  230. package/vendor/zsign/build/windows/vs2022/include/minizip/crypt.h +128 -128
  231. package/vendor/zsign/build/windows/vs2022/include/minizip/ioapi.h +216 -216
  232. package/vendor/zsign/build/windows/vs2022/include/minizip/iowin32.h +28 -28
  233. package/vendor/zsign/build/windows/vs2022/include/minizip/mztools.h +37 -37
  234. package/vendor/zsign/build/windows/vs2022/include/minizip/unzip.h +437 -437
  235. package/vendor/zsign/build/windows/vs2022/include/minizip/zip.h +364 -364
  236. package/vendor/zsign/build/windows/vs2022/include/openssl/__DECC_INCLUDE_EPILOGUE.H +22 -22
  237. package/vendor/zsign/build/windows/vs2022/include/openssl/__DECC_INCLUDE_PROLOGUE.H +26 -26
  238. package/vendor/zsign/build/windows/vs2022/include/openssl/aes.h +111 -111
  239. package/vendor/zsign/build/windows/vs2022/include/openssl/applink.c +153 -153
  240. package/vendor/zsign/build/windows/vs2022/include/openssl/asn1_mac.h +10 -10
  241. package/vendor/zsign/build/windows/vs2022/include/openssl/asn1err.h +142 -142
  242. package/vendor/zsign/build/windows/vs2022/include/openssl/async.h +104 -104
  243. package/vendor/zsign/build/windows/vs2022/include/openssl/asyncerr.h +29 -29
  244. package/vendor/zsign/build/windows/vs2022/include/openssl/bioerr.h +72 -72
  245. package/vendor/zsign/build/windows/vs2022/include/openssl/blowfish.h +78 -78
  246. package/vendor/zsign/build/windows/vs2022/include/openssl/bn.h +590 -590
  247. package/vendor/zsign/build/windows/vs2022/include/openssl/bnerr.h +47 -47
  248. package/vendor/zsign/build/windows/vs2022/include/openssl/buffer.h +62 -62
  249. package/vendor/zsign/build/windows/vs2022/include/openssl/buffererr.h +25 -25
  250. package/vendor/zsign/build/windows/vs2022/include/openssl/camellia.h +117 -117
  251. package/vendor/zsign/build/windows/vs2022/include/openssl/cast.h +71 -71
  252. package/vendor/zsign/build/windows/vs2022/include/openssl/cmac.h +52 -52
  253. package/vendor/zsign/build/windows/vs2022/include/openssl/cmp_util.h +56 -56
  254. package/vendor/zsign/build/windows/vs2022/include/openssl/cmperr.h +131 -131
  255. package/vendor/zsign/build/windows/vs2022/include/openssl/cmserr.h +125 -125
  256. package/vendor/zsign/build/windows/vs2022/include/openssl/comperr.h +38 -38
  257. package/vendor/zsign/build/windows/vs2022/include/openssl/conf_api.h +46 -46
  258. package/vendor/zsign/build/windows/vs2022/include/openssl/conferr.h +52 -52
  259. package/vendor/zsign/build/windows/vs2022/include/openssl/conftypes.h +44 -44
  260. package/vendor/zsign/build/windows/vs2022/include/openssl/core.h +236 -236
  261. package/vendor/zsign/build/windows/vs2022/include/openssl/core_dispatch.h +1022 -1022
  262. package/vendor/zsign/build/windows/vs2022/include/openssl/core_object.h +41 -41
  263. package/vendor/zsign/build/windows/vs2022/include/openssl/crmferr.h +50 -50
  264. package/vendor/zsign/build/windows/vs2022/include/openssl/cryptoerr.h +56 -56
  265. package/vendor/zsign/build/windows/vs2022/include/openssl/cryptoerr_legacy.h +1466 -1466
  266. package/vendor/zsign/build/windows/vs2022/include/openssl/cterr.h +45 -45
  267. package/vendor/zsign/build/windows/vs2022/include/openssl/decoder.h +133 -133
  268. package/vendor/zsign/build/windows/vs2022/include/openssl/decodererr.h +28 -28
  269. package/vendor/zsign/build/windows/vs2022/include/openssl/des.h +211 -211
  270. package/vendor/zsign/build/windows/vs2022/include/openssl/dh.h +339 -339
  271. package/vendor/zsign/build/windows/vs2022/include/openssl/dherr.h +59 -59
  272. package/vendor/zsign/build/windows/vs2022/include/openssl/dsa.h +280 -280
  273. package/vendor/zsign/build/windows/vs2022/include/openssl/dsaerr.h +44 -44
  274. package/vendor/zsign/build/windows/vs2022/include/openssl/dtls1.h +57 -57
  275. package/vendor/zsign/build/windows/vs2022/include/openssl/e_os2.h +310 -310
  276. package/vendor/zsign/build/windows/vs2022/include/openssl/e_ostime.h +38 -38
  277. package/vendor/zsign/build/windows/vs2022/include/openssl/ebcdic.h +39 -39
  278. package/vendor/zsign/build/windows/vs2022/include/openssl/ec.h +1588 -1588
  279. package/vendor/zsign/build/windows/vs2022/include/openssl/ecdh.h +10 -10
  280. package/vendor/zsign/build/windows/vs2022/include/openssl/ecdsa.h +10 -10
  281. package/vendor/zsign/build/windows/vs2022/include/openssl/ecerr.h +104 -104
  282. package/vendor/zsign/build/windows/vs2022/include/openssl/encoder.h +124 -124
  283. package/vendor/zsign/build/windows/vs2022/include/openssl/encodererr.h +28 -28
  284. package/vendor/zsign/build/windows/vs2022/include/openssl/engine.h +833 -833
  285. package/vendor/zsign/build/windows/vs2022/include/openssl/engineerr.h +63 -63
  286. package/vendor/zsign/build/windows/vs2022/include/openssl/esserr.h +32 -32
  287. package/vendor/zsign/build/windows/vs2022/include/openssl/evp.h +2231 -2231
  288. package/vendor/zsign/build/windows/vs2022/include/openssl/evperr.h +140 -140
  289. package/vendor/zsign/build/windows/vs2022/include/openssl/fips_names.h +50 -50
  290. package/vendor/zsign/build/windows/vs2022/include/openssl/hmac.h +62 -62
  291. package/vendor/zsign/build/windows/vs2022/include/openssl/hpke.h +169 -169
  292. package/vendor/zsign/build/windows/vs2022/include/openssl/http.h +118 -118
  293. package/vendor/zsign/build/windows/vs2022/include/openssl/httperr.h +56 -56
  294. package/vendor/zsign/build/windows/vs2022/include/openssl/idea.h +82 -82
  295. package/vendor/zsign/build/windows/vs2022/include/openssl/indicator.h +31 -31
  296. package/vendor/zsign/build/windows/vs2022/include/openssl/kdf.h +138 -138
  297. package/vendor/zsign/build/windows/vs2022/include/openssl/kdferr.h +16 -16
  298. package/vendor/zsign/build/windows/vs2022/include/openssl/macros.h +338 -338
  299. package/vendor/zsign/build/windows/vs2022/include/openssl/md2.h +56 -56
  300. package/vendor/zsign/build/windows/vs2022/include/openssl/md4.h +63 -63
  301. package/vendor/zsign/build/windows/vs2022/include/openssl/md5.h +62 -62
  302. package/vendor/zsign/build/windows/vs2022/include/openssl/mdc2.h +55 -55
  303. package/vendor/zsign/build/windows/vs2022/include/openssl/modes.h +219 -219
  304. package/vendor/zsign/build/windows/vs2022/include/openssl/obj_mac.h +5820 -5820
  305. package/vendor/zsign/build/windows/vs2022/include/openssl/objects.h +184 -184
  306. package/vendor/zsign/build/windows/vs2022/include/openssl/objectserr.h +28 -28
  307. package/vendor/zsign/build/windows/vs2022/include/openssl/ocsperr.h +53 -53
  308. package/vendor/zsign/build/windows/vs2022/include/openssl/opensslconf.h +17 -17
  309. package/vendor/zsign/build/windows/vs2022/include/openssl/ossl_typ.h +16 -16
  310. package/vendor/zsign/build/windows/vs2022/include/openssl/param_build.h +63 -63
  311. package/vendor/zsign/build/windows/vs2022/include/openssl/params.h +160 -160
  312. package/vendor/zsign/build/windows/vs2022/include/openssl/pem.h +543 -543
  313. package/vendor/zsign/build/windows/vs2022/include/openssl/pem2.h +19 -19
  314. package/vendor/zsign/build/windows/vs2022/include/openssl/pemerr.h +58 -58
  315. package/vendor/zsign/build/windows/vs2022/include/openssl/pkcs12err.h +46 -46
  316. package/vendor/zsign/build/windows/vs2022/include/openssl/pkcs7err.h +63 -63
  317. package/vendor/zsign/build/windows/vs2022/include/openssl/prov_ssl.h +38 -38
  318. package/vendor/zsign/build/windows/vs2022/include/openssl/proverr.h +162 -162
  319. package/vendor/zsign/build/windows/vs2022/include/openssl/provider.h +66 -66
  320. package/vendor/zsign/build/windows/vs2022/include/openssl/quic.h +70 -70
  321. package/vendor/zsign/build/windows/vs2022/include/openssl/rand.h +125 -125
  322. package/vendor/zsign/build/windows/vs2022/include/openssl/randerr.h +69 -69
  323. package/vendor/zsign/build/windows/vs2022/include/openssl/rc2.h +68 -68
  324. package/vendor/zsign/build/windows/vs2022/include/openssl/rc4.h +47 -47
  325. package/vendor/zsign/build/windows/vs2022/include/openssl/rc5.h +79 -79
  326. package/vendor/zsign/build/windows/vs2022/include/openssl/ripemd.h +59 -59
  327. package/vendor/zsign/build/windows/vs2022/include/openssl/rsa.h +615 -615
  328. package/vendor/zsign/build/windows/vs2022/include/openssl/rsaerr.h +107 -107
  329. package/vendor/zsign/build/windows/vs2022/include/openssl/seed.h +113 -113
  330. package/vendor/zsign/build/windows/vs2022/include/openssl/self_test.h +98 -98
  331. package/vendor/zsign/build/windows/vs2022/include/openssl/sha.h +139 -139
  332. package/vendor/zsign/build/windows/vs2022/include/openssl/srtp.h +68 -68
  333. package/vendor/zsign/build/windows/vs2022/include/openssl/ssl2.h +30 -30
  334. package/vendor/zsign/build/windows/vs2022/include/openssl/ssl3.h +357 -357
  335. package/vendor/zsign/build/windows/vs2022/include/openssl/sslerr.h +379 -379
  336. package/vendor/zsign/build/windows/vs2022/include/openssl/sslerr_legacy.h +467 -467
  337. package/vendor/zsign/build/windows/vs2022/include/openssl/stack.h +90 -90
  338. package/vendor/zsign/build/windows/vs2022/include/openssl/store.h +377 -377
  339. package/vendor/zsign/build/windows/vs2022/include/openssl/storeerr.h +49 -49
  340. package/vendor/zsign/build/windows/vs2022/include/openssl/symhacks.h +39 -39
  341. package/vendor/zsign/build/windows/vs2022/include/openssl/thread.h +31 -31
  342. package/vendor/zsign/build/windows/vs2022/include/openssl/tls1.h +1220 -1220
  343. package/vendor/zsign/build/windows/vs2022/include/openssl/trace.h +320 -320
  344. package/vendor/zsign/build/windows/vs2022/include/openssl/ts.h +522 -522
  345. package/vendor/zsign/build/windows/vs2022/include/openssl/tserr.h +67 -67
  346. package/vendor/zsign/build/windows/vs2022/include/openssl/txt_db.h +63 -63
  347. package/vendor/zsign/build/windows/vs2022/include/openssl/types.h +245 -245
  348. package/vendor/zsign/build/windows/vs2022/include/openssl/uierr.h +38 -38
  349. package/vendor/zsign/build/windows/vs2022/include/openssl/whrlpool.h +62 -62
  350. package/vendor/zsign/build/windows/vs2022/include/openssl/x509err.h +70 -70
  351. package/vendor/zsign/build/windows/vs2022/include/openssl/x509v3err.h +96 -96
  352. package/vendor/zsign/src/archo.cpp +742 -742
  353. package/vendor/zsign/src/archo.h +61 -61
  354. package/vendor/zsign/src/bundle.cpp +589 -589
  355. package/vendor/zsign/src/bundle.h +46 -46
  356. package/vendor/zsign/src/common/archive.cpp +246 -246
  357. package/vendor/zsign/src/common/archive.h +22 -22
  358. package/vendor/zsign/src/common/common.h +56 -56
  359. package/vendor/zsign/src/common/fs.cpp +573 -573
  360. package/vendor/zsign/src/common/fs.h +50 -50
  361. package/vendor/zsign/src/common/log.cpp +145 -145
  362. package/vendor/zsign/src/common/log.h +37 -37
  363. package/vendor/zsign/src/common/mach-o.h +585 -585
  364. package/vendor/zsign/src/common/sha.cpp +133 -133
  365. package/vendor/zsign/src/common/sha.h +24 -24
  366. package/vendor/zsign/src/common/timer.cpp +28 -28
  367. package/vendor/zsign/src/common/timer.h +17 -17
  368. package/vendor/zsign/src/common/util.cpp +185 -185
  369. package/vendor/zsign/src/common/util.h +25 -25
  370. package/vendor/zsign/src/macho.cpp +273 -273
  371. package/vendor/zsign/src/macho.h +38 -38
  372. package/vendor/zsign/src/openssl.cpp +698 -698
  373. package/vendor/zsign/src/openssl.h +71 -71
  374. package/vendor/zsign/src/signing.cpp +745 -745
  375. package/vendor/zsign/src/signing.h +59 -59
  376. package/vendor/zsign/src/zsign.cpp +317 -317
  377. package/vendor/zsign/test/dylib/demo/Makefile +12 -12
  378. package/vendor/zsign/test/dylib/demo/control +9 -9
  379. package/vendor/zsign/test/dylib/demo/demo.m +21 -21
  380. package/vendor/zsign/test/linux/test.sh +19 -19
  381. package/vendor/zsign/test/macos/test.sh +19 -19
@@ -1,966 +1,966 @@
1
- #!/bin/sh
2
- # configure script for zlib.
3
- #
4
- # Normally configure builds both a static and a shared library.
5
- # If you want to build just a static library, use: ./configure --static
6
- #
7
- # To impose specific compiler or flags or install directory, use for example:
8
- # prefix=$HOME CC=cc CFLAGS="-O4" ./configure
9
- # or for csh/tcsh users:
10
- # (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
11
-
12
- # Incorrect settings of CC or CFLAGS may prevent creating a shared library.
13
- # If you have problems, try without defining CC and CFLAGS before reporting
14
- # an error.
15
-
16
- # start off configure.log
17
- echo -------------------- >> configure.log
18
- echo $0 $* >> configure.log
19
- date >> configure.log
20
-
21
- # get source directory
22
- SRCDIR=`dirname $0`
23
- if test $SRCDIR = "."; then
24
- ZINC=""
25
- ZINCOUT="-I."
26
- SRCDIR=""
27
- else
28
- ZINC='-I. -include zconf.h'
29
- ZINCOUT='-I. -I$(SRCDIR)'
30
- SRCDIR="$SRCDIR/"
31
- fi
32
-
33
- # set command prefix for cross-compilation
34
- if [ -n "${CHOST}" ]; then
35
- uname=${CHOST}
36
- mname=${CHOST}
37
- CROSS_PREFIX="${CHOST}-"
38
- else
39
- mname=`(uname -a || echo unknown) 2>/dev/null`
40
- fi
41
-
42
- # destination name for static library
43
- STATICLIB=libz.a
44
-
45
- # extract zlib version numbers from zlib.h
46
- VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}zlib.h`
47
- VER3=`echo ${VER}|sed -n -e 's/\([0-9]\{1,\}\(\\.[0-9]\{1,\}\)\{1,2\}\).*/\1/p'`
48
- VER1=`echo ${VER}|sed -n -e 's/\([0-9]\{1,\}\)\\..*/\1/p'`
49
-
50
- # establish commands for library building
51
- if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
52
- AR=${AR-"${CROSS_PREFIX}ar"}
53
- test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
54
- else
55
- AR=${AR-"ar"}
56
- test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
57
- fi
58
- ARFLAGS=${ARFLAGS-"rc"}
59
- if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
60
- RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
61
- test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log
62
- else
63
- RANLIB=${RANLIB-"ranlib"}
64
- fi
65
- if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then
66
- NM=${NM-"${CROSS_PREFIX}nm"}
67
- test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log
68
- else
69
- NM=${NM-"nm"}
70
- fi
71
-
72
- # set defaults before processing command line options
73
- LDCONFIG=${LDCONFIG-"ldconfig"}
74
- LDSHAREDLIBC="${LDSHAREDLIBC--lc}"
75
- ARCHS=
76
- prefix=${prefix-/usr/local}
77
- exec_prefix=${exec_prefix-'${prefix}'}
78
- libdir=${libdir-'${exec_prefix}/lib'}
79
- sharedlibdir=${sharedlibdir-'${libdir}'}
80
- includedir=${includedir-'${prefix}/include'}
81
- mandir=${mandir-'${prefix}/share/man'}
82
- shared_ext='.so'
83
- shared=1
84
- solo=0
85
- cover=0
86
- zprefix=0
87
- zconst=0
88
- build64=0
89
- gcc=0
90
- clang=0
91
- warn=0
92
- debug=0
93
- address=0
94
- memory=0
95
- unknown=0
96
- old_cc="$CC"
97
- old_cflags="$CFLAGS"
98
- OBJC='$(OBJZ) $(OBJG)'
99
- PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
100
-
101
- # leave this script, optionally in a bad way
102
- leave()
103
- {
104
- if test "$*" != "0"; then
105
- echo "** $0 aborting." | tee -a configure.log
106
- fi
107
- rm -rf $test.[co] $test $test$shared_ext $test.gcno $test.dSYM ./--version
108
- echo -------------------- >> configure.log
109
- echo >> configure.log
110
- echo >> configure.log
111
- exit $1
112
- }
113
-
114
- # process command line options
115
- while test $# -ge 1
116
- do
117
- case "$1" in
118
- -h* | --help)
119
- echo 'usage:' | tee -a configure.log
120
- echo ' configure [--const] [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]' | tee -a configure.log
121
- echo ' [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
122
- echo ' [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a configure.log
123
- exit 0 ;;
124
- -p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
125
- -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;;
126
- -l*=* | --libdir=*) libdir=`echo $1 | sed 's/.*=//'`; shift ;;
127
- --sharedlibdir=*) sharedlibdir=`echo $1 | sed 's/.*=//'`; shift ;;
128
- -i*=* | --includedir=*) includedir=`echo $1 | sed 's/.*=//'`;shift ;;
129
- -u*=* | --uname=*) uname=`echo $1 | sed 's/.*=//'`;shift ;;
130
- -p* | --prefix) prefix="$2"; shift; shift ;;
131
- -e* | --eprefix) exec_prefix="$2"; shift; shift ;;
132
- -l* | --libdir) libdir="$2"; shift; shift ;;
133
- -i* | --includedir) includedir="$2"; shift; shift ;;
134
- -s* | --shared | --enable-shared) shared=1; shift ;;
135
- -t | --static) shared=0; shift ;;
136
- --solo) solo=1; shift ;;
137
- --cover) cover=1; shift ;;
138
- -z* | --zprefix) zprefix=1; shift ;;
139
- -6* | --64) build64=1; shift ;;
140
- -a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
141
- --sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
142
- --localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
143
- -c* | --const) zconst=1; shift ;;
144
- -w* | --warn) warn=1; shift ;;
145
- -d* | --debug) debug=1; shift ;;
146
- --sanitize) address=1; shift ;;
147
- --address) address=1; shift ;;
148
- --memory) memory=1; shift ;;
149
- *) unknown=1; echo "unknown option ignored: $1" | tee -a configure.log; shift;;
150
- esac
151
- done
152
- if test $unknown -eq 1; then
153
- echo "$0 --help for help" | tee -a configure.log
154
- fi
155
-
156
- # temporary file name
157
- test=ztest$$
158
-
159
- # put arguments in log, also put test file in log if used in arguments
160
- show()
161
- {
162
- case "$*" in
163
- *$test.c*)
164
- echo === $test.c === >> configure.log
165
- cat $test.c >> configure.log
166
- echo === >> configure.log;;
167
- esac
168
- echo $* >> configure.log
169
- }
170
-
171
- # check for gcc vs. cc and set compile and link flags based on the system identified by uname
172
- cat > $test.c <<EOF
173
- extern int getchar();
174
- int hello() {return getchar();}
175
- EOF
176
-
177
- if test -z "$CC"; then
178
- echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
179
- if ${CROSS_PREFIX}gcc -v >/dev/null 2>&1; then
180
- cc=${CROSS_PREFIX}gcc
181
- else
182
- cc=${CROSS_PREFIX}cc
183
- fi
184
- else
185
- cc=${CC}
186
- fi
187
-
188
- case "$cc" in
189
- *gcc*) gcc=1
190
- GCOV="gcov" ;;
191
- *clang*) gcc=1
192
- clang=1 ;;
193
- esac
194
- case `$cc -v 2>&1` in
195
- *gcc*) gcc=1
196
- GCOV="gcov" ;;
197
- *clang*) gcc=1
198
- clang=1 ;;
199
- esac
200
-
201
- if test "$clang" -eq 1; then
202
- if test "$cc" = "clang"; then
203
- if which -s llvm-cov; then
204
- GCOV="llvm-cov"
205
- LLVM_GCOV_FLAG="gcov"
206
- GCOV="llvm-cov"
207
- LLVM_GCOV_FLAG="gcov"
208
- echo "Using ${GCOV} for coverage"
209
- else
210
- cover=0
211
- GCOV=""
212
- LLVM_GCOV_FLAG=""
213
- echo "Deactivating cover as no suitable gcov can be found"
214
- fi
215
- else
216
- clangV=`echo "$cc" | sed -e 's/^.*-//'`
217
- if which -s llvm-cov-${clangV}; then
218
- GCOV="llvm-cov-${clangV}"
219
- LLVM_GCOV_FLAG="gcov"
220
- echo "Using ${GCOV} for coverage"
221
- else
222
- cover=0
223
- GCOV=""
224
- LLVM_GCOV_FLAG=""
225
- echo "Deactivating cover as no suitable gcov can be found"
226
- fi
227
- fi
228
- fi
229
-
230
- show $cc -c $test.c
231
- if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
232
- echo ... using gcc >> configure.log
233
- CC="$cc"
234
- CFLAGS="${CFLAGS--O3} -fPIC"
235
- SFLAGS="${CFLAGS--O3}"
236
- if test "$ARCHS"; then
237
- CFLAGS="${CFLAGS} ${ARCHS}"
238
- LDFLAGS="${LDFLAGS} ${ARCHS}"
239
- fi
240
- if test $build64 -eq 1; then
241
- CFLAGS="${CFLAGS} -m64"
242
- SFLAGS="${SFLAGS} -m64"
243
- fi
244
- if test "$warn" -eq 1; then
245
- if test "$zconst" -eq 1; then
246
- CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -DZLIB_CONST"
247
- else
248
- CFLAGS="${CFLAGS} -Wall -Wextra"
249
- fi
250
- fi
251
- if test $address -eq 1; then
252
- CFLAGS="${CFLAGS} -g -fsanitize=address -fno-omit-frame-pointer"
253
- fi
254
- if test $memory -eq 1; then
255
- CFLAGS="${CFLAGS} -g -fsanitize=memory -fno-omit-frame-pointer"
256
- fi
257
- if test $debug -eq 1; then
258
- CFLAGS="${CFLAGS} -DZLIB_DEBUG"
259
- SFLAGS="${SFLAGS} -DZLIB_DEBUG"
260
- fi
261
- if test -z "$uname"; then
262
- uname=`(uname -s || echo unknown) 2>/dev/null`
263
- fi
264
- case "$uname" in
265
- Linux* | linux* | *-linux* | GNU | GNU/* | solaris* | Haiku)
266
- case "$mname" in
267
- *sparc*)
268
- LDFLAGS="${LDFLAGS} -Wl,--no-warn-rwx-segments" ;;
269
- esac
270
- LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} ;;
271
- *BSD | *bsd* | DragonFly)
272
- LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"}
273
- LDCONFIG="ldconfig -m" ;;
274
- CYGWIN* | Cygwin* | cygwin* | *-cygwin* | OS/2*)
275
- EXE='.exe' ;;
276
- MINGW* | mingw* | *-mingw*)
277
- rm -f $test.[co] $test $test$shared_ext
278
- echo "If this doesn't work for you, try win32/Makefile.gcc." | tee -a configure.log
279
- LDSHARED=${LDSHARED-"$cc -shared"}
280
- LDSHAREDLIBC=""
281
- EXE='.exe' ;;
282
- QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
283
- # (alain.bonnefoy@icbt.com)
284
- LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;;
285
- HP-UX*)
286
- LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
287
- case `(uname -m || echo unknown) 2>/dev/null` in
288
- ia64)
289
- shared_ext='.so'
290
- SHAREDLIB='libz.so' ;;
291
- *)
292
- shared_ext='.sl'
293
- SHAREDLIB='libz.sl' ;;
294
- esac ;;
295
- AIX*)
296
- LDSHARED=${LDSHARED-"$cc -shared"}
297
- LDFLAGS="${LDFLAGS} -Wl,-brtl" ;;
298
- Darwin* | darwin* | *-darwin*)
299
- shared_ext='.dylib'
300
- SHAREDLIB=libz$shared_ext
301
- SHAREDLIBV=libz.$VER$shared_ext
302
- SHAREDLIBM=libz.$VER1$shared_ext
303
- LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
304
- if "${CROSS_PREFIX}libtool" -V 2>&1 | grep Apple > /dev/null; then
305
- AR="${CROSS_PREFIX}libtool"
306
- elif libtool -V 2>&1 | grep Apple > /dev/null; then
307
- AR="libtool"
308
- else
309
- AR="/usr/bin/libtool"
310
- fi
311
- ARFLAGS="-o" ;;
312
- *)
313
- LDSHARED=${LDSHARED-"$cc -shared"} ;;
314
- esac
315
- else
316
- # find system name and corresponding cc options
317
- CC=${CC-cc}
318
- gcc=0
319
- echo ... using $CC >> configure.log
320
- if test -z "$uname"; then
321
- uname=`(uname -sr || echo unknown) 2>/dev/null`
322
- fi
323
- case "$uname" in
324
- HP-UX*) SFLAGS=${CFLAGS-"-O +z"}
325
- CFLAGS=${CFLAGS-"-O"}
326
- # LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
327
- LDSHARED=${LDSHARED-"ld -b"}
328
- case `(uname -m || echo unknown) 2>/dev/null` in
329
- ia64)
330
- shared_ext='.so'
331
- SHAREDLIB='libz.so' ;;
332
- *)
333
- shared_ext='.sl'
334
- SHAREDLIB='libz.sl' ;;
335
- esac ;;
336
- IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
337
- CFLAGS=${CFLAGS-"-ansi -O2"}
338
- LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
339
- OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
340
- CFLAGS=${CFLAGS-"-O -std1"}
341
- LDFLAGS="${LDFLAGS} -Wl,-rpath,."
342
- LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"} ;;
343
- OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
344
- CFLAGS=${CFLAGS-"-O -std1"}
345
- LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
346
- QNX*) SFLAGS=${CFLAGS-"-4 -O"}
347
- CFLAGS=${CFLAGS-"-4 -O"}
348
- LDSHARED=${LDSHARED-"cc"}
349
- RANLIB=${RANLIB-"true"}
350
- AR="cc"
351
- ARFLAGS="-A" ;;
352
- SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
353
- CFLAGS=${CFLAGS-"-O3"}
354
- LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;;
355
- SunOS\ 5* | solaris*)
356
- LDSHARED=${LDSHARED-"cc -G -h libz$shared_ext.$VER1"}
357
- SFLAGS=${CFLAGS-"-fast -KPIC"}
358
- CFLAGS=${CFLAGS-"-fast"}
359
- if test $build64 -eq 1; then
360
- # old versions of SunPRO/Workshop/Studio don't support -m64,
361
- # but newer ones do. Check for it.
362
- flag64=`$CC -flags | egrep -- '^-m64'`
363
- if test x"$flag64" != x"" ; then
364
- CFLAGS="${CFLAGS} -m64"
365
- SFLAGS="${SFLAGS} -m64"
366
- else
367
- case `(uname -m || echo unknown) 2>/dev/null` in
368
- i86*)
369
- SFLAGS="$SFLAGS -xarch=amd64"
370
- CFLAGS="$CFLAGS -xarch=amd64" ;;
371
- *)
372
- SFLAGS="$SFLAGS -xarch=v9"
373
- CFLAGS="$CFLAGS -xarch=v9" ;;
374
- esac
375
- fi
376
- fi
377
- if test -n "$ZINC"; then
378
- ZINC='-I- -I. -I$(SRCDIR)'
379
- fi
380
- ;;
381
- SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
382
- CFLAGS=${CFLAGS-"-O2"}
383
- LDSHARED=${LDSHARED-"ld"} ;;
384
- SunStudio\ 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
385
- CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"}
386
- LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;;
387
- UNIX_System_V\ 4.2.0)
388
- SFLAGS=${CFLAGS-"-KPIC -O"}
389
- CFLAGS=${CFLAGS-"-O"}
390
- LDSHARED=${LDSHARED-"cc -G"} ;;
391
- UNIX_SV\ 4.2MP)
392
- SFLAGS=${CFLAGS-"-Kconform_pic -O"}
393
- CFLAGS=${CFLAGS-"-O"}
394
- LDSHARED=${LDSHARED-"cc -G"} ;;
395
- OpenUNIX\ 5)
396
- SFLAGS=${CFLAGS-"-KPIC -O"}
397
- CFLAGS=${CFLAGS-"-O"}
398
- LDSHARED=${LDSHARED-"cc -G"} ;;
399
- AIX*) # Courtesy of dbakker@arrayasolutions.com
400
- SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
401
- CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
402
- LDSHARED=${LDSHARED-"xlc -G"} ;;
403
- # send working options for other systems to zlib@gzip.org
404
- *) SFLAGS=${CFLAGS-"-O"}
405
- CFLAGS=${CFLAGS-"-O"}
406
- LDSHARED=${LDSHARED-"cc -shared"} ;;
407
- esac
408
- fi
409
-
410
- # destination names for shared library if not defined above
411
- SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
412
- SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
413
- SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
414
-
415
- echo >> configure.log
416
-
417
- # define functions for testing compiler and library characteristics and logging the results
418
-
419
- cat > $test.c <<EOF
420
- #error error
421
- EOF
422
- if ($CC -c $CFLAGS $test.c) 2>/dev/null; then
423
- try()
424
- {
425
- show $*
426
- test "`( $* ) 2>&1 | tee -a configure.log`" = ""
427
- }
428
- echo - using any output from compiler to indicate an error >> configure.log
429
- else
430
- try()
431
- {
432
- show $*
433
- got=`( $* ) 2>&1`
434
- ret=$?
435
- if test "$got" != ""; then
436
- printf "%s\n" "$got" >> configure.log
437
- fi
438
- if test $ret -ne 0; then
439
- echo "(exit code "$ret")" >> configure.log
440
- fi
441
- return $ret
442
- }
443
- fi
444
-
445
- tryboth()
446
- {
447
- show $*
448
- got=`( $* ) 2>&1`
449
- ret=$?
450
- if test "$got" != ""; then
451
- printf "%s\n" "$got" >> configure.log
452
- fi
453
- if test $ret -ne 0; then
454
- echo "(exit code "$ret")" >> configure.log
455
- return $ret
456
- fi
457
- test "$got" = ""
458
- }
459
-
460
- cat > $test.c << EOF
461
- int foo() { return 0; }
462
- EOF
463
- echo "Checking for obsessive-compulsive compiler options..." >> configure.log
464
- if try $CC -c $CFLAGS $test.c; then
465
- :
466
- else
467
- echo "Compiler error reporting is too harsh for $0 (perhaps remove -Werror)." | tee -a configure.log
468
- leave 1
469
- fi
470
-
471
- echo >> configure.log
472
-
473
- # see if shared library build supported
474
- cat > $test.c <<EOF
475
- extern int getchar();
476
- int hello() {return getchar();}
477
- EOF
478
- if test $shared -eq 1; then
479
- echo Checking for shared library support... | tee -a configure.log
480
- # we must test in two steps (cc then ld), required at least on SunOS 4.x
481
- if try $CC -c $SFLAGS $test.c &&
482
- try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
483
- echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
484
- elif test -z "$old_cc" -a -z "$old_cflags"; then
485
- echo No shared library support. | tee -a configure.log
486
- shared=0;
487
- else
488
- echo 'No shared library support; try without defining CC and CFLAGS' | tee -a configure.log
489
- shared=0;
490
- fi
491
- fi
492
- if test $shared -eq 0; then
493
- LDSHARED="$CC"
494
- ALL="static"
495
- TEST="all teststatic"
496
- SHAREDLIB=""
497
- SHAREDLIBV=""
498
- SHAREDLIBM=""
499
- echo Building static library $STATICLIB version $VER with $CC. | tee -a configure.log
500
- else
501
- ALL="static shared"
502
- TEST="all teststatic testshared"
503
- fi
504
-
505
- echo >> configure.log
506
-
507
- # check for size_t
508
- cat > $test.c <<EOF
509
- #include <stdio.h>
510
- #include <stdlib.h>
511
- size_t dummy = 0;
512
- EOF
513
- if try $CC -c $CFLAGS $test.c; then
514
- echo "Checking for size_t... Yes." | tee -a configure.log
515
- else
516
- echo "Checking for size_t... No." | tee -a configure.log
517
- # find a size_t integer type
518
- # check for long long
519
- cat > $test.c << EOF
520
- long long dummy = 0;
521
- EOF
522
- if try $CC -c $CFLAGS $test.c; then
523
- echo "Checking for long long... Yes." | tee -a configure.log
524
- cat > $test.c <<EOF
525
- #include <stdio.h>
526
- int main(void) {
527
- if (sizeof(void *) <= sizeof(int)) puts("int");
528
- else if (sizeof(void *) <= sizeof(long)) puts("long");
529
- else puts("z_longlong");
530
- return 0;
531
- }
532
- EOF
533
- else
534
- echo "Checking for long long... No." | tee -a configure.log
535
- cat > $test.c <<EOF
536
- #include <stdio.h>
537
- int main(void) {
538
- if (sizeof(void *) <= sizeof(int)) puts("int");
539
- else puts("long");
540
- return 0;
541
- }
542
- EOF
543
- fi
544
- if try $CC $CFLAGS -o $test $test.c; then
545
- sizet=`./$test`
546
- echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
547
- CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
548
- SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
549
- else
550
- echo "Checking for a pointer-size integer type... not found." | tee -a configure.log
551
- fi
552
- fi
553
-
554
- echo >> configure.log
555
-
556
- # check for large file support, and if none, check for fseeko()
557
- cat > $test.c <<EOF
558
- #include <sys/types.h>
559
- off64_t dummy = 0;
560
- EOF
561
- if try $CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c; then
562
- CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
563
- SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
564
- ALL="${ALL} all64"
565
- TEST="${TEST} test64"
566
- echo "Checking for off64_t... Yes." | tee -a configure.log
567
- echo "Checking for fseeko... Yes." | tee -a configure.log
568
- else
569
- echo "Checking for off64_t... No." | tee -a configure.log
570
- echo >> configure.log
571
- cat > $test.c <<EOF
572
- #include <stdio.h>
573
- int main(void) {
574
- fseeko(NULL, 0, 0);
575
- return 0;
576
- }
577
- EOF
578
- if try $CC $CFLAGS -o $test $test.c; then
579
- echo "Checking for fseeko... Yes." | tee -a configure.log
580
- else
581
- CFLAGS="${CFLAGS} -DNO_FSEEKO"
582
- SFLAGS="${SFLAGS} -DNO_FSEEKO"
583
- echo "Checking for fseeko... No." | tee -a configure.log
584
- fi
585
- fi
586
-
587
- echo >> configure.log
588
-
589
- # check for strerror() for use by gz* functions
590
- cat > $test.c <<EOF
591
- #include <string.h>
592
- #include <errno.h>
593
- int main() { return strlen(strerror(errno)); }
594
- EOF
595
- if try $CC $CFLAGS -o $test $test.c; then
596
- echo "Checking for strerror... Yes." | tee -a configure.log
597
- else
598
- CFLAGS="${CFLAGS} -DNO_STRERROR"
599
- SFLAGS="${SFLAGS} -DNO_STRERROR"
600
- echo "Checking for strerror... No." | tee -a configure.log
601
- fi
602
-
603
- # copy clean zconf.h for subsequent edits
604
- cp -p ${SRCDIR}zconf.h.in zconf.h
605
-
606
- echo >> configure.log
607
-
608
- # check for unistd.h and save result in zconf.h
609
- cat > $test.c <<EOF
610
- #include <unistd.h>
611
- int main() { return 0; }
612
- EOF
613
- if try $CC -c $CFLAGS $test.c; then
614
- sed < zconf.h "/^#if HAVE_UNISTD_H-0.* may be/s/ HAVE_UNISTD_H-0\(.*\) may be/ 1\1 was/" > zconf.temp.h
615
- mv zconf.temp.h zconf.h
616
- echo "Checking for unistd.h... Yes." | tee -a configure.log
617
- else
618
- echo "Checking for unistd.h... No." | tee -a configure.log
619
- fi
620
-
621
- echo >> configure.log
622
-
623
- # check for stdarg.h and save result in zconf.h
624
- cat > $test.c <<EOF
625
- #include <stdarg.h>
626
- int main() { return 0; }
627
- EOF
628
- if try $CC -c $CFLAGS $test.c; then
629
- sed < zconf.h "/^#if HAVE_STDARG_H-0.* may be/s/ HAVE_STDARG_H-0\(.*\) may be/ 1\1 was/" > zconf.temp.h
630
- mv zconf.temp.h zconf.h
631
- echo "Checking for stdarg.h... Yes." | tee -a configure.log
632
- else
633
- echo "Checking for stdarg.h... No." | tee -a configure.log
634
- fi
635
-
636
- # if the z_ prefix was requested, save that in zconf.h
637
- if test $zprefix -eq 1; then
638
- sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h
639
- mv zconf.temp.h zconf.h
640
- echo >> configure.log
641
- echo "Using z_ prefix on all symbols." | tee -a configure.log
642
- fi
643
-
644
- # if --solo compilation was requested, save that in zconf.h and remove gz stuff from object lists
645
- if test $solo -eq 1; then
646
- sed '/#define ZCONF_H/a\
647
- #define Z_SOLO
648
-
649
- ' < zconf.h > zconf.temp.h
650
- mv zconf.temp.h zconf.h
651
- OBJC='$(OBJZ)'
652
- PIC_OBJC='$(PIC_OBJZ)'
653
- fi
654
-
655
- # if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X
656
- if test $cover -eq 1; then
657
- if test -n "$GCC_CLASSIC"; then
658
- CC=$GCC_CLASSIC
659
- fi
660
- fi
661
-
662
- echo >> configure.log
663
-
664
- # conduct a series of tests to resolve eight possible cases of using "vs" or "s" printf functions
665
- # (using stdarg or not), with or without "n" (proving size of buffer), and with or without a
666
- # return value. The most secure result is vsnprintf() with a return value. snprintf() with a
667
- # return value is secure as well, but then gzprintf() will be limited to 20 arguments.
668
- cat > $test.c <<EOF
669
- #include <stdio.h>
670
- #include <stdarg.h>
671
- #include "zconf.h"
672
- int main()
673
- {
674
- #ifndef STDC
675
- choke me
676
- #endif
677
- return 0;
678
- }
679
- EOF
680
- if try $CC -c $CFLAGS $test.c; then
681
- echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log
682
-
683
- echo >> configure.log
684
- cat > $test.c <<EOF
685
- #include <stdio.h>
686
- #include <stdarg.h>
687
- int mytest(const char *fmt, ...)
688
- {
689
- char buf[20];
690
- va_list ap;
691
- va_start(ap, fmt);
692
- vsnprintf(buf, sizeof(buf), fmt, ap);
693
- va_end(ap);
694
- return 0;
695
- }
696
- int main()
697
- {
698
- return (mytest("Hello%d\n", 1));
699
- }
700
- EOF
701
- if try $CC $CFLAGS -o $test $test.c; then
702
- echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
703
-
704
- echo >> configure.log
705
- cat >$test.c <<EOF
706
- #include <stdio.h>
707
- #include <stdarg.h>
708
- int mytest(const char *fmt, ...)
709
- {
710
- int n;
711
- char buf[20];
712
- va_list ap;
713
- va_start(ap, fmt);
714
- n = vsnprintf(buf, sizeof(buf), fmt, ap);
715
- va_end(ap);
716
- return n;
717
- }
718
- int main()
719
- {
720
- return (mytest("Hello%d\n", 1));
721
- }
722
- EOF
723
-
724
- if try $CC -c $CFLAGS $test.c; then
725
- echo "Checking for return value of vsnprintf()... Yes." | tee -a configure.log
726
- else
727
- CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
728
- SFLAGS="$SFLAGS -DHAS_vsnprintf_void"
729
- echo "Checking for return value of vsnprintf()... No." | tee -a configure.log
730
- echo " WARNING: apparently vsnprintf() does not return a value. zlib" | tee -a configure.log
731
- echo " can build but will be open to possible string-format security" | tee -a configure.log
732
- echo " vulnerabilities." | tee -a configure.log
733
- fi
734
- else
735
- CFLAGS="$CFLAGS -DNO_vsnprintf"
736
- SFLAGS="$SFLAGS -DNO_vsnprintf"
737
- echo "Checking for vsnprintf() in stdio.h... No." | tee -a configure.log
738
- echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | tee -a configure.log
739
- echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
740
- echo " vulnerabilities." | tee -a configure.log
741
-
742
- echo >> configure.log
743
- cat >$test.c <<EOF
744
- #include <stdio.h>
745
- #include <stdarg.h>
746
- int mytest(const char *fmt, ...)
747
- {
748
- int n;
749
- char buf[20];
750
- va_list ap;
751
- va_start(ap, fmt);
752
- n = vsprintf(buf, fmt, ap);
753
- va_end(ap);
754
- return n;
755
- }
756
- int main()
757
- {
758
- return (mytest("Hello%d\n", 1));
759
- }
760
- EOF
761
-
762
- if try $CC -c $CFLAGS $test.c; then
763
- echo "Checking for return value of vsprintf()... Yes." | tee -a configure.log
764
- else
765
- CFLAGS="$CFLAGS -DHAS_vsprintf_void"
766
- SFLAGS="$SFLAGS -DHAS_vsprintf_void"
767
- echo "Checking for return value of vsprintf()... No." | tee -a configure.log
768
- echo " WARNING: apparently vsprintf() does not return a value. zlib" | tee -a configure.log
769
- echo " can build but will be open to possible string-format security" | tee -a configure.log
770
- echo " vulnerabilities." | tee -a configure.log
771
- fi
772
- fi
773
- else
774
- echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()." | tee -a configure.log
775
-
776
- echo >> configure.log
777
- cat >$test.c <<EOF
778
- #include <stdio.h>
779
- int mytest()
780
- {
781
- char buf[20];
782
- snprintf(buf, sizeof(buf), "%s", "foo");
783
- return 0;
784
- }
785
- int main()
786
- {
787
- return (mytest());
788
- }
789
- EOF
790
-
791
- if try $CC $CFLAGS -o $test $test.c; then
792
- echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
793
-
794
- echo >> configure.log
795
- cat >$test.c <<EOF
796
- #include <stdio.h>
797
- int mytest()
798
- {
799
- char buf[20];
800
- return snprintf(buf, sizeof(buf), "%s", "foo");
801
- }
802
- int main()
803
- {
804
- return (mytest());
805
- }
806
- EOF
807
-
808
- if try $CC -c $CFLAGS $test.c; then
809
- echo "Checking for return value of snprintf()... Yes." | tee -a configure.log
810
- else
811
- CFLAGS="$CFLAGS -DHAS_snprintf_void"
812
- SFLAGS="$SFLAGS -DHAS_snprintf_void"
813
- echo "Checking for return value of snprintf()... No." | tee -a configure.log
814
- echo " WARNING: apparently snprintf() does not return a value. zlib" | tee -a configure.log
815
- echo " can build but will be open to possible string-format security" | tee -a configure.log
816
- echo " vulnerabilities." | tee -a configure.log
817
- fi
818
- else
819
- CFLAGS="$CFLAGS -DNO_snprintf"
820
- SFLAGS="$SFLAGS -DNO_snprintf"
821
- echo "Checking for snprintf() in stdio.h... No." | tee -a configure.log
822
- echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" | tee -a configure.log
823
- echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
824
- echo " vulnerabilities." | tee -a configure.log
825
-
826
- echo >> configure.log
827
- cat >$test.c <<EOF
828
- #include <stdio.h>
829
- int mytest()
830
- {
831
- char buf[20];
832
- return sprintf(buf, "%s", "foo");
833
- }
834
- int main()
835
- {
836
- return (mytest());
837
- }
838
- EOF
839
-
840
- if try $CC -c $CFLAGS $test.c; then
841
- echo "Checking for return value of sprintf()... Yes." | tee -a configure.log
842
- else
843
- CFLAGS="$CFLAGS -DHAS_sprintf_void"
844
- SFLAGS="$SFLAGS -DHAS_sprintf_void"
845
- echo "Checking for return value of sprintf()... No." | tee -a configure.log
846
- echo " WARNING: apparently sprintf() does not return a value. zlib" | tee -a configure.log
847
- echo " can build but will be open to possible string-format security" | tee -a configure.log
848
- echo " vulnerabilities." | tee -a configure.log
849
- fi
850
- fi
851
- fi
852
-
853
- # see if we can hide zlib internal symbols that are linked between separate source files
854
- if test "$gcc" -eq 1; then
855
- echo >> configure.log
856
- cat > $test.c <<EOF
857
- #define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
858
- int ZLIB_INTERNAL foo;
859
- int main()
860
- {
861
- return 0;
862
- }
863
- EOF
864
- if tryboth $CC -c $CFLAGS $test.c; then
865
- CFLAGS="$CFLAGS -DHAVE_HIDDEN"
866
- SFLAGS="$SFLAGS -DHAVE_HIDDEN"
867
- echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log
868
- else
869
- echo "Checking for attribute(visibility) support... No." | tee -a configure.log
870
- fi
871
- fi
872
-
873
- # show the results in the log
874
- echo >> configure.log
875
- echo ALL = $ALL >> configure.log
876
- echo AR = $AR >> configure.log
877
- echo ARFLAGS = $ARFLAGS >> configure.log
878
- echo CC = $CC >> configure.log
879
- echo CFLAGS = $CFLAGS >> configure.log
880
- echo CPP = $CPP >> configure.log
881
- echo EXE = $EXE >> configure.log
882
- echo LDCONFIG = $LDCONFIG >> configure.log
883
- echo LDFLAGS = $LDFLAGS >> configure.log
884
- echo LDSHARED = $LDSHARED >> configure.log
885
- echo LDSHAREDLIBC = $LDSHAREDLIBC >> configure.log
886
- echo OBJC = $OBJC >> configure.log
887
- echo PIC_OBJC = $PIC_OBJC >> configure.log
888
- echo RANLIB = $RANLIB >> configure.log
889
- echo SFLAGS = $SFLAGS >> configure.log
890
- echo SHAREDLIB = $SHAREDLIB >> configure.log
891
- echo SHAREDLIBM = $SHAREDLIBM >> configure.log
892
- echo SHAREDLIBV = $SHAREDLIBV >> configure.log
893
- echo STATICLIB = $STATICLIB >> configure.log
894
- echo TEST = $TEST >> configure.log
895
- echo VER = $VER >> configure.log
896
- echo SRCDIR = $SRCDIR >> configure.log
897
- echo exec_prefix = $exec_prefix >> configure.log
898
- echo includedir = $includedir >> configure.log
899
- echo libdir = $libdir >> configure.log
900
- echo mandir = $mandir >> configure.log
901
- echo prefix = $prefix >> configure.log
902
- echo sharedlibdir = $sharedlibdir >> configure.log
903
- echo uname = $uname >> configure.log
904
-
905
- # update Makefile with the configure results
906
- sed < ${SRCDIR}Makefile.in "
907
- /^CC *=/s#=.*#=$CC#
908
- /^GCOV *=/s#=.*#=$GCOV#
909
- /^LLVM_GCOV_FLAG *=/s#=.*#=$LLVM_GCOV_FLAG#
910
- /^CFLAGS *=/s#=.*#=$CFLAGS#
911
- /^SFLAGS *=/s#=.*#=$SFLAGS#
912
- /^LDFLAGS *=/s#=.*#=$LDFLAGS#
913
- /^LDSHARED *=/s#=.*#=$LDSHARED#
914
- /^CPP *=/s#=.*#=$CPP#
915
- /^STATICLIB *=/s#=.*#=$STATICLIB#
916
- /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
917
- /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
918
- /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
919
- /^AR *=/s#=.*#=$AR#
920
- /^ARFLAGS *=/s#=.*#=$ARFLAGS#
921
- /^RANLIB *=/s#=.*#=$RANLIB#
922
- /^LDCONFIG *=/s#=.*#=$LDCONFIG#
923
- /^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC#
924
- /^EXE *=/s#=.*#=$EXE#
925
- /^SRCDIR *=/s#=.*#=$SRCDIR#
926
- /^ZINC *=/s#=.*#=$ZINC#
927
- /^ZINCOUT *=/s#=.*#=$ZINCOUT#
928
- /^prefix *=/s#=.*#=$prefix#
929
- /^exec_prefix *=/s#=.*#=$exec_prefix#
930
- /^libdir *=/s#=.*#=$libdir#
931
- /^sharedlibdir *=/s#=.*#=$sharedlibdir#
932
- /^includedir *=/s#=.*#=$includedir#
933
- /^mandir *=/s#=.*#=$mandir#
934
- /^OBJC *=/s#=.*#= $OBJC#
935
- /^PIC_OBJC *=/s#=.*#= $PIC_OBJC#
936
- /^all: */s#:.*#: $ALL#
937
- /^test: */s#:.*#: $TEST#
938
- " > Makefile
939
-
940
- # create zlib.pc with the configure results
941
- sed < ${SRCDIR}zlib.pc.in "
942
- /^CC *=/s#=.*#=$CC#
943
- /^CFLAGS *=/s#=.*#=$CFLAGS#
944
- /^CPP *=/s#=.*#=$CPP#
945
- /^LDSHARED *=/s#=.*#=$LDSHARED#
946
- /^STATICLIB *=/s#=.*#=$STATICLIB#
947
- /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
948
- /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
949
- /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
950
- /^AR *=/s#=.*#=$AR#
951
- /^ARFLAGS *=/s#=.*#=$ARFLAGS#
952
- /^RANLIB *=/s#=.*#=$RANLIB#
953
- /^EXE *=/s#=.*#=$EXE#
954
- /^prefix *=/s#=.*#=$prefix#
955
- /^exec_prefix *=/s#=.*#=$exec_prefix#
956
- /^libdir *=/s#=.*#=$libdir#
957
- /^sharedlibdir *=/s#=.*#=$sharedlibdir#
958
- /^includedir *=/s#=.*#=$includedir#
959
- /^mandir *=/s#=.*#=$mandir#
960
- /^LDFLAGS *=/s#=.*#=$LDFLAGS#
961
- " | sed -e "
962
- s/\@VERSION\@/$VER/g;
963
- " > zlib.pc
964
-
965
- # done
966
- leave 0
1
+ #!/bin/sh
2
+ # configure script for zlib.
3
+ #
4
+ # Normally configure builds both a static and a shared library.
5
+ # If you want to build just a static library, use: ./configure --static
6
+ #
7
+ # To impose specific compiler or flags or install directory, use for example:
8
+ # prefix=$HOME CC=cc CFLAGS="-O4" ./configure
9
+ # or for csh/tcsh users:
10
+ # (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
11
+
12
+ # Incorrect settings of CC or CFLAGS may prevent creating a shared library.
13
+ # If you have problems, try without defining CC and CFLAGS before reporting
14
+ # an error.
15
+
16
+ # start off configure.log
17
+ echo -------------------- >> configure.log
18
+ echo $0 $* >> configure.log
19
+ date >> configure.log
20
+
21
+ # get source directory
22
+ SRCDIR=`dirname $0`
23
+ if test $SRCDIR = "."; then
24
+ ZINC=""
25
+ ZINCOUT="-I."
26
+ SRCDIR=""
27
+ else
28
+ ZINC='-I. -include zconf.h'
29
+ ZINCOUT='-I. -I$(SRCDIR)'
30
+ SRCDIR="$SRCDIR/"
31
+ fi
32
+
33
+ # set command prefix for cross-compilation
34
+ if [ -n "${CHOST}" ]; then
35
+ uname=${CHOST}
36
+ mname=${CHOST}
37
+ CROSS_PREFIX="${CHOST}-"
38
+ else
39
+ mname=`(uname -a || echo unknown) 2>/dev/null`
40
+ fi
41
+
42
+ # destination name for static library
43
+ STATICLIB=libz.a
44
+
45
+ # extract zlib version numbers from zlib.h
46
+ VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}zlib.h`
47
+ VER3=`echo ${VER}|sed -n -e 's/\([0-9]\{1,\}\(\\.[0-9]\{1,\}\)\{1,2\}\).*/\1/p'`
48
+ VER1=`echo ${VER}|sed -n -e 's/\([0-9]\{1,\}\)\\..*/\1/p'`
49
+
50
+ # establish commands for library building
51
+ if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
52
+ AR=${AR-"${CROSS_PREFIX}ar"}
53
+ test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
54
+ else
55
+ AR=${AR-"ar"}
56
+ test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
57
+ fi
58
+ ARFLAGS=${ARFLAGS-"rc"}
59
+ if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
60
+ RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
61
+ test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log
62
+ else
63
+ RANLIB=${RANLIB-"ranlib"}
64
+ fi
65
+ if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then
66
+ NM=${NM-"${CROSS_PREFIX}nm"}
67
+ test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log
68
+ else
69
+ NM=${NM-"nm"}
70
+ fi
71
+
72
+ # set defaults before processing command line options
73
+ LDCONFIG=${LDCONFIG-"ldconfig"}
74
+ LDSHAREDLIBC="${LDSHAREDLIBC--lc}"
75
+ ARCHS=
76
+ prefix=${prefix-/usr/local}
77
+ exec_prefix=${exec_prefix-'${prefix}'}
78
+ libdir=${libdir-'${exec_prefix}/lib'}
79
+ sharedlibdir=${sharedlibdir-'${libdir}'}
80
+ includedir=${includedir-'${prefix}/include'}
81
+ mandir=${mandir-'${prefix}/share/man'}
82
+ shared_ext='.so'
83
+ shared=1
84
+ solo=0
85
+ cover=0
86
+ zprefix=0
87
+ zconst=0
88
+ build64=0
89
+ gcc=0
90
+ clang=0
91
+ warn=0
92
+ debug=0
93
+ address=0
94
+ memory=0
95
+ unknown=0
96
+ old_cc="$CC"
97
+ old_cflags="$CFLAGS"
98
+ OBJC='$(OBJZ) $(OBJG)'
99
+ PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
100
+
101
+ # leave this script, optionally in a bad way
102
+ leave()
103
+ {
104
+ if test "$*" != "0"; then
105
+ echo "** $0 aborting." | tee -a configure.log
106
+ fi
107
+ rm -rf $test.[co] $test $test$shared_ext $test.gcno $test.dSYM ./--version
108
+ echo -------------------- >> configure.log
109
+ echo >> configure.log
110
+ echo >> configure.log
111
+ exit $1
112
+ }
113
+
114
+ # process command line options
115
+ while test $# -ge 1
116
+ do
117
+ case "$1" in
118
+ -h* | --help)
119
+ echo 'usage:' | tee -a configure.log
120
+ echo ' configure [--const] [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]' | tee -a configure.log
121
+ echo ' [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
122
+ echo ' [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a configure.log
123
+ exit 0 ;;
124
+ -p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
125
+ -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;;
126
+ -l*=* | --libdir=*) libdir=`echo $1 | sed 's/.*=//'`; shift ;;
127
+ --sharedlibdir=*) sharedlibdir=`echo $1 | sed 's/.*=//'`; shift ;;
128
+ -i*=* | --includedir=*) includedir=`echo $1 | sed 's/.*=//'`;shift ;;
129
+ -u*=* | --uname=*) uname=`echo $1 | sed 's/.*=//'`;shift ;;
130
+ -p* | --prefix) prefix="$2"; shift; shift ;;
131
+ -e* | --eprefix) exec_prefix="$2"; shift; shift ;;
132
+ -l* | --libdir) libdir="$2"; shift; shift ;;
133
+ -i* | --includedir) includedir="$2"; shift; shift ;;
134
+ -s* | --shared | --enable-shared) shared=1; shift ;;
135
+ -t | --static) shared=0; shift ;;
136
+ --solo) solo=1; shift ;;
137
+ --cover) cover=1; shift ;;
138
+ -z* | --zprefix) zprefix=1; shift ;;
139
+ -6* | --64) build64=1; shift ;;
140
+ -a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
141
+ --sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
142
+ --localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
143
+ -c* | --const) zconst=1; shift ;;
144
+ -w* | --warn) warn=1; shift ;;
145
+ -d* | --debug) debug=1; shift ;;
146
+ --sanitize) address=1; shift ;;
147
+ --address) address=1; shift ;;
148
+ --memory) memory=1; shift ;;
149
+ *) unknown=1; echo "unknown option ignored: $1" | tee -a configure.log; shift;;
150
+ esac
151
+ done
152
+ if test $unknown -eq 1; then
153
+ echo "$0 --help for help" | tee -a configure.log
154
+ fi
155
+
156
+ # temporary file name
157
+ test=ztest$$
158
+
159
+ # put arguments in log, also put test file in log if used in arguments
160
+ show()
161
+ {
162
+ case "$*" in
163
+ *$test.c*)
164
+ echo === $test.c === >> configure.log
165
+ cat $test.c >> configure.log
166
+ echo === >> configure.log;;
167
+ esac
168
+ echo $* >> configure.log
169
+ }
170
+
171
+ # check for gcc vs. cc and set compile and link flags based on the system identified by uname
172
+ cat > $test.c <<EOF
173
+ extern int getchar();
174
+ int hello() {return getchar();}
175
+ EOF
176
+
177
+ if test -z "$CC"; then
178
+ echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
179
+ if ${CROSS_PREFIX}gcc -v >/dev/null 2>&1; then
180
+ cc=${CROSS_PREFIX}gcc
181
+ else
182
+ cc=${CROSS_PREFIX}cc
183
+ fi
184
+ else
185
+ cc=${CC}
186
+ fi
187
+
188
+ case "$cc" in
189
+ *gcc*) gcc=1
190
+ GCOV="gcov" ;;
191
+ *clang*) gcc=1
192
+ clang=1 ;;
193
+ esac
194
+ case `$cc -v 2>&1` in
195
+ *gcc*) gcc=1
196
+ GCOV="gcov" ;;
197
+ *clang*) gcc=1
198
+ clang=1 ;;
199
+ esac
200
+
201
+ if test "$clang" -eq 1; then
202
+ if test "$cc" = "clang"; then
203
+ if which -s llvm-cov; then
204
+ GCOV="llvm-cov"
205
+ LLVM_GCOV_FLAG="gcov"
206
+ GCOV="llvm-cov"
207
+ LLVM_GCOV_FLAG="gcov"
208
+ echo "Using ${GCOV} for coverage"
209
+ else
210
+ cover=0
211
+ GCOV=""
212
+ LLVM_GCOV_FLAG=""
213
+ echo "Deactivating cover as no suitable gcov can be found"
214
+ fi
215
+ else
216
+ clangV=`echo "$cc" | sed -e 's/^.*-//'`
217
+ if which -s llvm-cov-${clangV}; then
218
+ GCOV="llvm-cov-${clangV}"
219
+ LLVM_GCOV_FLAG="gcov"
220
+ echo "Using ${GCOV} for coverage"
221
+ else
222
+ cover=0
223
+ GCOV=""
224
+ LLVM_GCOV_FLAG=""
225
+ echo "Deactivating cover as no suitable gcov can be found"
226
+ fi
227
+ fi
228
+ fi
229
+
230
+ show $cc -c $test.c
231
+ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
232
+ echo ... using gcc >> configure.log
233
+ CC="$cc"
234
+ CFLAGS="${CFLAGS--O3} -fPIC"
235
+ SFLAGS="${CFLAGS--O3}"
236
+ if test "$ARCHS"; then
237
+ CFLAGS="${CFLAGS} ${ARCHS}"
238
+ LDFLAGS="${LDFLAGS} ${ARCHS}"
239
+ fi
240
+ if test $build64 -eq 1; then
241
+ CFLAGS="${CFLAGS} -m64"
242
+ SFLAGS="${SFLAGS} -m64"
243
+ fi
244
+ if test "$warn" -eq 1; then
245
+ if test "$zconst" -eq 1; then
246
+ CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -DZLIB_CONST"
247
+ else
248
+ CFLAGS="${CFLAGS} -Wall -Wextra"
249
+ fi
250
+ fi
251
+ if test $address -eq 1; then
252
+ CFLAGS="${CFLAGS} -g -fsanitize=address -fno-omit-frame-pointer"
253
+ fi
254
+ if test $memory -eq 1; then
255
+ CFLAGS="${CFLAGS} -g -fsanitize=memory -fno-omit-frame-pointer"
256
+ fi
257
+ if test $debug -eq 1; then
258
+ CFLAGS="${CFLAGS} -DZLIB_DEBUG"
259
+ SFLAGS="${SFLAGS} -DZLIB_DEBUG"
260
+ fi
261
+ if test -z "$uname"; then
262
+ uname=`(uname -s || echo unknown) 2>/dev/null`
263
+ fi
264
+ case "$uname" in
265
+ Linux* | linux* | *-linux* | GNU | GNU/* | solaris* | Haiku)
266
+ case "$mname" in
267
+ *sparc*)
268
+ LDFLAGS="${LDFLAGS} -Wl,--no-warn-rwx-segments" ;;
269
+ esac
270
+ LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} ;;
271
+ *BSD | *bsd* | DragonFly)
272
+ LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"}
273
+ LDCONFIG="ldconfig -m" ;;
274
+ CYGWIN* | Cygwin* | cygwin* | *-cygwin* | OS/2*)
275
+ EXE='.exe' ;;
276
+ MINGW* | mingw* | *-mingw*)
277
+ rm -f $test.[co] $test $test$shared_ext
278
+ echo "If this doesn't work for you, try win32/Makefile.gcc." | tee -a configure.log
279
+ LDSHARED=${LDSHARED-"$cc -shared"}
280
+ LDSHAREDLIBC=""
281
+ EXE='.exe' ;;
282
+ QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
283
+ # (alain.bonnefoy@icbt.com)
284
+ LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;;
285
+ HP-UX*)
286
+ LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
287
+ case `(uname -m || echo unknown) 2>/dev/null` in
288
+ ia64)
289
+ shared_ext='.so'
290
+ SHAREDLIB='libz.so' ;;
291
+ *)
292
+ shared_ext='.sl'
293
+ SHAREDLIB='libz.sl' ;;
294
+ esac ;;
295
+ AIX*)
296
+ LDSHARED=${LDSHARED-"$cc -shared"}
297
+ LDFLAGS="${LDFLAGS} -Wl,-brtl" ;;
298
+ Darwin* | darwin* | *-darwin*)
299
+ shared_ext='.dylib'
300
+ SHAREDLIB=libz$shared_ext
301
+ SHAREDLIBV=libz.$VER$shared_ext
302
+ SHAREDLIBM=libz.$VER1$shared_ext
303
+ LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
304
+ if "${CROSS_PREFIX}libtool" -V 2>&1 | grep Apple > /dev/null; then
305
+ AR="${CROSS_PREFIX}libtool"
306
+ elif libtool -V 2>&1 | grep Apple > /dev/null; then
307
+ AR="libtool"
308
+ else
309
+ AR="/usr/bin/libtool"
310
+ fi
311
+ ARFLAGS="-o" ;;
312
+ *)
313
+ LDSHARED=${LDSHARED-"$cc -shared"} ;;
314
+ esac
315
+ else
316
+ # find system name and corresponding cc options
317
+ CC=${CC-cc}
318
+ gcc=0
319
+ echo ... using $CC >> configure.log
320
+ if test -z "$uname"; then
321
+ uname=`(uname -sr || echo unknown) 2>/dev/null`
322
+ fi
323
+ case "$uname" in
324
+ HP-UX*) SFLAGS=${CFLAGS-"-O +z"}
325
+ CFLAGS=${CFLAGS-"-O"}
326
+ # LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
327
+ LDSHARED=${LDSHARED-"ld -b"}
328
+ case `(uname -m || echo unknown) 2>/dev/null` in
329
+ ia64)
330
+ shared_ext='.so'
331
+ SHAREDLIB='libz.so' ;;
332
+ *)
333
+ shared_ext='.sl'
334
+ SHAREDLIB='libz.sl' ;;
335
+ esac ;;
336
+ IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
337
+ CFLAGS=${CFLAGS-"-ansi -O2"}
338
+ LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
339
+ OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
340
+ CFLAGS=${CFLAGS-"-O -std1"}
341
+ LDFLAGS="${LDFLAGS} -Wl,-rpath,."
342
+ LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"} ;;
343
+ OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
344
+ CFLAGS=${CFLAGS-"-O -std1"}
345
+ LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
346
+ QNX*) SFLAGS=${CFLAGS-"-4 -O"}
347
+ CFLAGS=${CFLAGS-"-4 -O"}
348
+ LDSHARED=${LDSHARED-"cc"}
349
+ RANLIB=${RANLIB-"true"}
350
+ AR="cc"
351
+ ARFLAGS="-A" ;;
352
+ SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
353
+ CFLAGS=${CFLAGS-"-O3"}
354
+ LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;;
355
+ SunOS\ 5* | solaris*)
356
+ LDSHARED=${LDSHARED-"cc -G -h libz$shared_ext.$VER1"}
357
+ SFLAGS=${CFLAGS-"-fast -KPIC"}
358
+ CFLAGS=${CFLAGS-"-fast"}
359
+ if test $build64 -eq 1; then
360
+ # old versions of SunPRO/Workshop/Studio don't support -m64,
361
+ # but newer ones do. Check for it.
362
+ flag64=`$CC -flags | egrep -- '^-m64'`
363
+ if test x"$flag64" != x"" ; then
364
+ CFLAGS="${CFLAGS} -m64"
365
+ SFLAGS="${SFLAGS} -m64"
366
+ else
367
+ case `(uname -m || echo unknown) 2>/dev/null` in
368
+ i86*)
369
+ SFLAGS="$SFLAGS -xarch=amd64"
370
+ CFLAGS="$CFLAGS -xarch=amd64" ;;
371
+ *)
372
+ SFLAGS="$SFLAGS -xarch=v9"
373
+ CFLAGS="$CFLAGS -xarch=v9" ;;
374
+ esac
375
+ fi
376
+ fi
377
+ if test -n "$ZINC"; then
378
+ ZINC='-I- -I. -I$(SRCDIR)'
379
+ fi
380
+ ;;
381
+ SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
382
+ CFLAGS=${CFLAGS-"-O2"}
383
+ LDSHARED=${LDSHARED-"ld"} ;;
384
+ SunStudio\ 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
385
+ CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"}
386
+ LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;;
387
+ UNIX_System_V\ 4.2.0)
388
+ SFLAGS=${CFLAGS-"-KPIC -O"}
389
+ CFLAGS=${CFLAGS-"-O"}
390
+ LDSHARED=${LDSHARED-"cc -G"} ;;
391
+ UNIX_SV\ 4.2MP)
392
+ SFLAGS=${CFLAGS-"-Kconform_pic -O"}
393
+ CFLAGS=${CFLAGS-"-O"}
394
+ LDSHARED=${LDSHARED-"cc -G"} ;;
395
+ OpenUNIX\ 5)
396
+ SFLAGS=${CFLAGS-"-KPIC -O"}
397
+ CFLAGS=${CFLAGS-"-O"}
398
+ LDSHARED=${LDSHARED-"cc -G"} ;;
399
+ AIX*) # Courtesy of dbakker@arrayasolutions.com
400
+ SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
401
+ CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
402
+ LDSHARED=${LDSHARED-"xlc -G"} ;;
403
+ # send working options for other systems to zlib@gzip.org
404
+ *) SFLAGS=${CFLAGS-"-O"}
405
+ CFLAGS=${CFLAGS-"-O"}
406
+ LDSHARED=${LDSHARED-"cc -shared"} ;;
407
+ esac
408
+ fi
409
+
410
+ # destination names for shared library if not defined above
411
+ SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
412
+ SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
413
+ SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
414
+
415
+ echo >> configure.log
416
+
417
+ # define functions for testing compiler and library characteristics and logging the results
418
+
419
+ cat > $test.c <<EOF
420
+ #error error
421
+ EOF
422
+ if ($CC -c $CFLAGS $test.c) 2>/dev/null; then
423
+ try()
424
+ {
425
+ show $*
426
+ test "`( $* ) 2>&1 | tee -a configure.log`" = ""
427
+ }
428
+ echo - using any output from compiler to indicate an error >> configure.log
429
+ else
430
+ try()
431
+ {
432
+ show $*
433
+ got=`( $* ) 2>&1`
434
+ ret=$?
435
+ if test "$got" != ""; then
436
+ printf "%s\n" "$got" >> configure.log
437
+ fi
438
+ if test $ret -ne 0; then
439
+ echo "(exit code "$ret")" >> configure.log
440
+ fi
441
+ return $ret
442
+ }
443
+ fi
444
+
445
+ tryboth()
446
+ {
447
+ show $*
448
+ got=`( $* ) 2>&1`
449
+ ret=$?
450
+ if test "$got" != ""; then
451
+ printf "%s\n" "$got" >> configure.log
452
+ fi
453
+ if test $ret -ne 0; then
454
+ echo "(exit code "$ret")" >> configure.log
455
+ return $ret
456
+ fi
457
+ test "$got" = ""
458
+ }
459
+
460
+ cat > $test.c << EOF
461
+ int foo() { return 0; }
462
+ EOF
463
+ echo "Checking for obsessive-compulsive compiler options..." >> configure.log
464
+ if try $CC -c $CFLAGS $test.c; then
465
+ :
466
+ else
467
+ echo "Compiler error reporting is too harsh for $0 (perhaps remove -Werror)." | tee -a configure.log
468
+ leave 1
469
+ fi
470
+
471
+ echo >> configure.log
472
+
473
+ # see if shared library build supported
474
+ cat > $test.c <<EOF
475
+ extern int getchar();
476
+ int hello() {return getchar();}
477
+ EOF
478
+ if test $shared -eq 1; then
479
+ echo Checking for shared library support... | tee -a configure.log
480
+ # we must test in two steps (cc then ld), required at least on SunOS 4.x
481
+ if try $CC -c $SFLAGS $test.c &&
482
+ try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
483
+ echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
484
+ elif test -z "$old_cc" -a -z "$old_cflags"; then
485
+ echo No shared library support. | tee -a configure.log
486
+ shared=0;
487
+ else
488
+ echo 'No shared library support; try without defining CC and CFLAGS' | tee -a configure.log
489
+ shared=0;
490
+ fi
491
+ fi
492
+ if test $shared -eq 0; then
493
+ LDSHARED="$CC"
494
+ ALL="static"
495
+ TEST="all teststatic"
496
+ SHAREDLIB=""
497
+ SHAREDLIBV=""
498
+ SHAREDLIBM=""
499
+ echo Building static library $STATICLIB version $VER with $CC. | tee -a configure.log
500
+ else
501
+ ALL="static shared"
502
+ TEST="all teststatic testshared"
503
+ fi
504
+
505
+ echo >> configure.log
506
+
507
+ # check for size_t
508
+ cat > $test.c <<EOF
509
+ #include <stdio.h>
510
+ #include <stdlib.h>
511
+ size_t dummy = 0;
512
+ EOF
513
+ if try $CC -c $CFLAGS $test.c; then
514
+ echo "Checking for size_t... Yes." | tee -a configure.log
515
+ else
516
+ echo "Checking for size_t... No." | tee -a configure.log
517
+ # find a size_t integer type
518
+ # check for long long
519
+ cat > $test.c << EOF
520
+ long long dummy = 0;
521
+ EOF
522
+ if try $CC -c $CFLAGS $test.c; then
523
+ echo "Checking for long long... Yes." | tee -a configure.log
524
+ cat > $test.c <<EOF
525
+ #include <stdio.h>
526
+ int main(void) {
527
+ if (sizeof(void *) <= sizeof(int)) puts("int");
528
+ else if (sizeof(void *) <= sizeof(long)) puts("long");
529
+ else puts("z_longlong");
530
+ return 0;
531
+ }
532
+ EOF
533
+ else
534
+ echo "Checking for long long... No." | tee -a configure.log
535
+ cat > $test.c <<EOF
536
+ #include <stdio.h>
537
+ int main(void) {
538
+ if (sizeof(void *) <= sizeof(int)) puts("int");
539
+ else puts("long");
540
+ return 0;
541
+ }
542
+ EOF
543
+ fi
544
+ if try $CC $CFLAGS -o $test $test.c; then
545
+ sizet=`./$test`
546
+ echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
547
+ CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
548
+ SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
549
+ else
550
+ echo "Checking for a pointer-size integer type... not found." | tee -a configure.log
551
+ fi
552
+ fi
553
+
554
+ echo >> configure.log
555
+
556
+ # check for large file support, and if none, check for fseeko()
557
+ cat > $test.c <<EOF
558
+ #include <sys/types.h>
559
+ off64_t dummy = 0;
560
+ EOF
561
+ if try $CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c; then
562
+ CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
563
+ SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
564
+ ALL="${ALL} all64"
565
+ TEST="${TEST} test64"
566
+ echo "Checking for off64_t... Yes." | tee -a configure.log
567
+ echo "Checking for fseeko... Yes." | tee -a configure.log
568
+ else
569
+ echo "Checking for off64_t... No." | tee -a configure.log
570
+ echo >> configure.log
571
+ cat > $test.c <<EOF
572
+ #include <stdio.h>
573
+ int main(void) {
574
+ fseeko(NULL, 0, 0);
575
+ return 0;
576
+ }
577
+ EOF
578
+ if try $CC $CFLAGS -o $test $test.c; then
579
+ echo "Checking for fseeko... Yes." | tee -a configure.log
580
+ else
581
+ CFLAGS="${CFLAGS} -DNO_FSEEKO"
582
+ SFLAGS="${SFLAGS} -DNO_FSEEKO"
583
+ echo "Checking for fseeko... No." | tee -a configure.log
584
+ fi
585
+ fi
586
+
587
+ echo >> configure.log
588
+
589
+ # check for strerror() for use by gz* functions
590
+ cat > $test.c <<EOF
591
+ #include <string.h>
592
+ #include <errno.h>
593
+ int main() { return strlen(strerror(errno)); }
594
+ EOF
595
+ if try $CC $CFLAGS -o $test $test.c; then
596
+ echo "Checking for strerror... Yes." | tee -a configure.log
597
+ else
598
+ CFLAGS="${CFLAGS} -DNO_STRERROR"
599
+ SFLAGS="${SFLAGS} -DNO_STRERROR"
600
+ echo "Checking for strerror... No." | tee -a configure.log
601
+ fi
602
+
603
+ # copy clean zconf.h for subsequent edits
604
+ cp -p ${SRCDIR}zconf.h.in zconf.h
605
+
606
+ echo >> configure.log
607
+
608
+ # check for unistd.h and save result in zconf.h
609
+ cat > $test.c <<EOF
610
+ #include <unistd.h>
611
+ int main() { return 0; }
612
+ EOF
613
+ if try $CC -c $CFLAGS $test.c; then
614
+ sed < zconf.h "/^#if HAVE_UNISTD_H-0.* may be/s/ HAVE_UNISTD_H-0\(.*\) may be/ 1\1 was/" > zconf.temp.h
615
+ mv zconf.temp.h zconf.h
616
+ echo "Checking for unistd.h... Yes." | tee -a configure.log
617
+ else
618
+ echo "Checking for unistd.h... No." | tee -a configure.log
619
+ fi
620
+
621
+ echo >> configure.log
622
+
623
+ # check for stdarg.h and save result in zconf.h
624
+ cat > $test.c <<EOF
625
+ #include <stdarg.h>
626
+ int main() { return 0; }
627
+ EOF
628
+ if try $CC -c $CFLAGS $test.c; then
629
+ sed < zconf.h "/^#if HAVE_STDARG_H-0.* may be/s/ HAVE_STDARG_H-0\(.*\) may be/ 1\1 was/" > zconf.temp.h
630
+ mv zconf.temp.h zconf.h
631
+ echo "Checking for stdarg.h... Yes." | tee -a configure.log
632
+ else
633
+ echo "Checking for stdarg.h... No." | tee -a configure.log
634
+ fi
635
+
636
+ # if the z_ prefix was requested, save that in zconf.h
637
+ if test $zprefix -eq 1; then
638
+ sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h
639
+ mv zconf.temp.h zconf.h
640
+ echo >> configure.log
641
+ echo "Using z_ prefix on all symbols." | tee -a configure.log
642
+ fi
643
+
644
+ # if --solo compilation was requested, save that in zconf.h and remove gz stuff from object lists
645
+ if test $solo -eq 1; then
646
+ sed '/#define ZCONF_H/a\
647
+ #define Z_SOLO
648
+
649
+ ' < zconf.h > zconf.temp.h
650
+ mv zconf.temp.h zconf.h
651
+ OBJC='$(OBJZ)'
652
+ PIC_OBJC='$(PIC_OBJZ)'
653
+ fi
654
+
655
+ # if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X
656
+ if test $cover -eq 1; then
657
+ if test -n "$GCC_CLASSIC"; then
658
+ CC=$GCC_CLASSIC
659
+ fi
660
+ fi
661
+
662
+ echo >> configure.log
663
+
664
+ # conduct a series of tests to resolve eight possible cases of using "vs" or "s" printf functions
665
+ # (using stdarg or not), with or without "n" (proving size of buffer), and with or without a
666
+ # return value. The most secure result is vsnprintf() with a return value. snprintf() with a
667
+ # return value is secure as well, but then gzprintf() will be limited to 20 arguments.
668
+ cat > $test.c <<EOF
669
+ #include <stdio.h>
670
+ #include <stdarg.h>
671
+ #include "zconf.h"
672
+ int main()
673
+ {
674
+ #ifndef STDC
675
+ choke me
676
+ #endif
677
+ return 0;
678
+ }
679
+ EOF
680
+ if try $CC -c $CFLAGS $test.c; then
681
+ echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log
682
+
683
+ echo >> configure.log
684
+ cat > $test.c <<EOF
685
+ #include <stdio.h>
686
+ #include <stdarg.h>
687
+ int mytest(const char *fmt, ...)
688
+ {
689
+ char buf[20];
690
+ va_list ap;
691
+ va_start(ap, fmt);
692
+ vsnprintf(buf, sizeof(buf), fmt, ap);
693
+ va_end(ap);
694
+ return 0;
695
+ }
696
+ int main()
697
+ {
698
+ return (mytest("Hello%d\n", 1));
699
+ }
700
+ EOF
701
+ if try $CC $CFLAGS -o $test $test.c; then
702
+ echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
703
+
704
+ echo >> configure.log
705
+ cat >$test.c <<EOF
706
+ #include <stdio.h>
707
+ #include <stdarg.h>
708
+ int mytest(const char *fmt, ...)
709
+ {
710
+ int n;
711
+ char buf[20];
712
+ va_list ap;
713
+ va_start(ap, fmt);
714
+ n = vsnprintf(buf, sizeof(buf), fmt, ap);
715
+ va_end(ap);
716
+ return n;
717
+ }
718
+ int main()
719
+ {
720
+ return (mytest("Hello%d\n", 1));
721
+ }
722
+ EOF
723
+
724
+ if try $CC -c $CFLAGS $test.c; then
725
+ echo "Checking for return value of vsnprintf()... Yes." | tee -a configure.log
726
+ else
727
+ CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
728
+ SFLAGS="$SFLAGS -DHAS_vsnprintf_void"
729
+ echo "Checking for return value of vsnprintf()... No." | tee -a configure.log
730
+ echo " WARNING: apparently vsnprintf() does not return a value. zlib" | tee -a configure.log
731
+ echo " can build but will be open to possible string-format security" | tee -a configure.log
732
+ echo " vulnerabilities." | tee -a configure.log
733
+ fi
734
+ else
735
+ CFLAGS="$CFLAGS -DNO_vsnprintf"
736
+ SFLAGS="$SFLAGS -DNO_vsnprintf"
737
+ echo "Checking for vsnprintf() in stdio.h... No." | tee -a configure.log
738
+ echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | tee -a configure.log
739
+ echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
740
+ echo " vulnerabilities." | tee -a configure.log
741
+
742
+ echo >> configure.log
743
+ cat >$test.c <<EOF
744
+ #include <stdio.h>
745
+ #include <stdarg.h>
746
+ int mytest(const char *fmt, ...)
747
+ {
748
+ int n;
749
+ char buf[20];
750
+ va_list ap;
751
+ va_start(ap, fmt);
752
+ n = vsprintf(buf, fmt, ap);
753
+ va_end(ap);
754
+ return n;
755
+ }
756
+ int main()
757
+ {
758
+ return (mytest("Hello%d\n", 1));
759
+ }
760
+ EOF
761
+
762
+ if try $CC -c $CFLAGS $test.c; then
763
+ echo "Checking for return value of vsprintf()... Yes." | tee -a configure.log
764
+ else
765
+ CFLAGS="$CFLAGS -DHAS_vsprintf_void"
766
+ SFLAGS="$SFLAGS -DHAS_vsprintf_void"
767
+ echo "Checking for return value of vsprintf()... No." | tee -a configure.log
768
+ echo " WARNING: apparently vsprintf() does not return a value. zlib" | tee -a configure.log
769
+ echo " can build but will be open to possible string-format security" | tee -a configure.log
770
+ echo " vulnerabilities." | tee -a configure.log
771
+ fi
772
+ fi
773
+ else
774
+ echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()." | tee -a configure.log
775
+
776
+ echo >> configure.log
777
+ cat >$test.c <<EOF
778
+ #include <stdio.h>
779
+ int mytest()
780
+ {
781
+ char buf[20];
782
+ snprintf(buf, sizeof(buf), "%s", "foo");
783
+ return 0;
784
+ }
785
+ int main()
786
+ {
787
+ return (mytest());
788
+ }
789
+ EOF
790
+
791
+ if try $CC $CFLAGS -o $test $test.c; then
792
+ echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
793
+
794
+ echo >> configure.log
795
+ cat >$test.c <<EOF
796
+ #include <stdio.h>
797
+ int mytest()
798
+ {
799
+ char buf[20];
800
+ return snprintf(buf, sizeof(buf), "%s", "foo");
801
+ }
802
+ int main()
803
+ {
804
+ return (mytest());
805
+ }
806
+ EOF
807
+
808
+ if try $CC -c $CFLAGS $test.c; then
809
+ echo "Checking for return value of snprintf()... Yes." | tee -a configure.log
810
+ else
811
+ CFLAGS="$CFLAGS -DHAS_snprintf_void"
812
+ SFLAGS="$SFLAGS -DHAS_snprintf_void"
813
+ echo "Checking for return value of snprintf()... No." | tee -a configure.log
814
+ echo " WARNING: apparently snprintf() does not return a value. zlib" | tee -a configure.log
815
+ echo " can build but will be open to possible string-format security" | tee -a configure.log
816
+ echo " vulnerabilities." | tee -a configure.log
817
+ fi
818
+ else
819
+ CFLAGS="$CFLAGS -DNO_snprintf"
820
+ SFLAGS="$SFLAGS -DNO_snprintf"
821
+ echo "Checking for snprintf() in stdio.h... No." | tee -a configure.log
822
+ echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" | tee -a configure.log
823
+ echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
824
+ echo " vulnerabilities." | tee -a configure.log
825
+
826
+ echo >> configure.log
827
+ cat >$test.c <<EOF
828
+ #include <stdio.h>
829
+ int mytest()
830
+ {
831
+ char buf[20];
832
+ return sprintf(buf, "%s", "foo");
833
+ }
834
+ int main()
835
+ {
836
+ return (mytest());
837
+ }
838
+ EOF
839
+
840
+ if try $CC -c $CFLAGS $test.c; then
841
+ echo "Checking for return value of sprintf()... Yes." | tee -a configure.log
842
+ else
843
+ CFLAGS="$CFLAGS -DHAS_sprintf_void"
844
+ SFLAGS="$SFLAGS -DHAS_sprintf_void"
845
+ echo "Checking for return value of sprintf()... No." | tee -a configure.log
846
+ echo " WARNING: apparently sprintf() does not return a value. zlib" | tee -a configure.log
847
+ echo " can build but will be open to possible string-format security" | tee -a configure.log
848
+ echo " vulnerabilities." | tee -a configure.log
849
+ fi
850
+ fi
851
+ fi
852
+
853
+ # see if we can hide zlib internal symbols that are linked between separate source files
854
+ if test "$gcc" -eq 1; then
855
+ echo >> configure.log
856
+ cat > $test.c <<EOF
857
+ #define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
858
+ int ZLIB_INTERNAL foo;
859
+ int main()
860
+ {
861
+ return 0;
862
+ }
863
+ EOF
864
+ if tryboth $CC -c $CFLAGS $test.c; then
865
+ CFLAGS="$CFLAGS -DHAVE_HIDDEN"
866
+ SFLAGS="$SFLAGS -DHAVE_HIDDEN"
867
+ echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log
868
+ else
869
+ echo "Checking for attribute(visibility) support... No." | tee -a configure.log
870
+ fi
871
+ fi
872
+
873
+ # show the results in the log
874
+ echo >> configure.log
875
+ echo ALL = $ALL >> configure.log
876
+ echo AR = $AR >> configure.log
877
+ echo ARFLAGS = $ARFLAGS >> configure.log
878
+ echo CC = $CC >> configure.log
879
+ echo CFLAGS = $CFLAGS >> configure.log
880
+ echo CPP = $CPP >> configure.log
881
+ echo EXE = $EXE >> configure.log
882
+ echo LDCONFIG = $LDCONFIG >> configure.log
883
+ echo LDFLAGS = $LDFLAGS >> configure.log
884
+ echo LDSHARED = $LDSHARED >> configure.log
885
+ echo LDSHAREDLIBC = $LDSHAREDLIBC >> configure.log
886
+ echo OBJC = $OBJC >> configure.log
887
+ echo PIC_OBJC = $PIC_OBJC >> configure.log
888
+ echo RANLIB = $RANLIB >> configure.log
889
+ echo SFLAGS = $SFLAGS >> configure.log
890
+ echo SHAREDLIB = $SHAREDLIB >> configure.log
891
+ echo SHAREDLIBM = $SHAREDLIBM >> configure.log
892
+ echo SHAREDLIBV = $SHAREDLIBV >> configure.log
893
+ echo STATICLIB = $STATICLIB >> configure.log
894
+ echo TEST = $TEST >> configure.log
895
+ echo VER = $VER >> configure.log
896
+ echo SRCDIR = $SRCDIR >> configure.log
897
+ echo exec_prefix = $exec_prefix >> configure.log
898
+ echo includedir = $includedir >> configure.log
899
+ echo libdir = $libdir >> configure.log
900
+ echo mandir = $mandir >> configure.log
901
+ echo prefix = $prefix >> configure.log
902
+ echo sharedlibdir = $sharedlibdir >> configure.log
903
+ echo uname = $uname >> configure.log
904
+
905
+ # update Makefile with the configure results
906
+ sed < ${SRCDIR}Makefile.in "
907
+ /^CC *=/s#=.*#=$CC#
908
+ /^GCOV *=/s#=.*#=$GCOV#
909
+ /^LLVM_GCOV_FLAG *=/s#=.*#=$LLVM_GCOV_FLAG#
910
+ /^CFLAGS *=/s#=.*#=$CFLAGS#
911
+ /^SFLAGS *=/s#=.*#=$SFLAGS#
912
+ /^LDFLAGS *=/s#=.*#=$LDFLAGS#
913
+ /^LDSHARED *=/s#=.*#=$LDSHARED#
914
+ /^CPP *=/s#=.*#=$CPP#
915
+ /^STATICLIB *=/s#=.*#=$STATICLIB#
916
+ /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
917
+ /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
918
+ /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
919
+ /^AR *=/s#=.*#=$AR#
920
+ /^ARFLAGS *=/s#=.*#=$ARFLAGS#
921
+ /^RANLIB *=/s#=.*#=$RANLIB#
922
+ /^LDCONFIG *=/s#=.*#=$LDCONFIG#
923
+ /^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC#
924
+ /^EXE *=/s#=.*#=$EXE#
925
+ /^SRCDIR *=/s#=.*#=$SRCDIR#
926
+ /^ZINC *=/s#=.*#=$ZINC#
927
+ /^ZINCOUT *=/s#=.*#=$ZINCOUT#
928
+ /^prefix *=/s#=.*#=$prefix#
929
+ /^exec_prefix *=/s#=.*#=$exec_prefix#
930
+ /^libdir *=/s#=.*#=$libdir#
931
+ /^sharedlibdir *=/s#=.*#=$sharedlibdir#
932
+ /^includedir *=/s#=.*#=$includedir#
933
+ /^mandir *=/s#=.*#=$mandir#
934
+ /^OBJC *=/s#=.*#= $OBJC#
935
+ /^PIC_OBJC *=/s#=.*#= $PIC_OBJC#
936
+ /^all: */s#:.*#: $ALL#
937
+ /^test: */s#:.*#: $TEST#
938
+ " > Makefile
939
+
940
+ # create zlib.pc with the configure results
941
+ sed < ${SRCDIR}zlib.pc.in "
942
+ /^CC *=/s#=.*#=$CC#
943
+ /^CFLAGS *=/s#=.*#=$CFLAGS#
944
+ /^CPP *=/s#=.*#=$CPP#
945
+ /^LDSHARED *=/s#=.*#=$LDSHARED#
946
+ /^STATICLIB *=/s#=.*#=$STATICLIB#
947
+ /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
948
+ /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
949
+ /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
950
+ /^AR *=/s#=.*#=$AR#
951
+ /^ARFLAGS *=/s#=.*#=$ARFLAGS#
952
+ /^RANLIB *=/s#=.*#=$RANLIB#
953
+ /^EXE *=/s#=.*#=$EXE#
954
+ /^prefix *=/s#=.*#=$prefix#
955
+ /^exec_prefix *=/s#=.*#=$exec_prefix#
956
+ /^libdir *=/s#=.*#=$libdir#
957
+ /^sharedlibdir *=/s#=.*#=$sharedlibdir#
958
+ /^includedir *=/s#=.*#=$includedir#
959
+ /^mandir *=/s#=.*#=$mandir#
960
+ /^LDFLAGS *=/s#=.*#=$LDFLAGS#
961
+ " | sed -e "
962
+ s/\@VERSION\@/$VER/g;
963
+ " > zlib.pc
964
+
965
+ # done
966
+ leave 0