1// vim:ft=javascript 2 3ARG_WITH('mhash', 'mhash support (BC via hash)', 'no'); 4 5if (PHP_MHASH != 'no') { 6 AC_DEFINE('PHP_MHASH_BC', 1); 7} 8 9// Defined for BC. 10AC_DEFINE('HAVE_HASH_EXT', 1); 11 12PHP_HASH = 'yes'; 13 14EXTENSION('hash', 'hash.c hash_md.c hash_sha.c hash_ripemd.c hash_haval.c ' + 15 'hash_tiger.c hash_gost.c hash_snefru.c hash_whirlpool.c ' + 16 'hash_adler32.c hash_crc32.c hash_joaat.c hash_fnv.c ' + 17 'hash_sha3.c', false); 18 19var hash_sha3_dir = 'ext/hash/sha3/generic' + (X64 ? '64' : '32') + 'lc'; 20 21if(X64) { 22 ADD_SOURCES(hash_sha3_dir, 'KeccakHash.c KeccakSponge.c KeccakP-1600-opt64.c', 'hash'); 23} else { 24 ADD_SOURCES(hash_sha3_dir, 'KeccakHash.c KeccakSponge.c KeccakP-1600-inplace32BI.c', 'hash'); 25} 26 27if (!CHECK_HEADER_ADD_INCLUDE('KeccakHash.h', 'CFLAGS_HASH', hash_sha3_dir)) { 28 // Should NEVER happen 29 ERROR('Unable to locate SHA3 headers'); 30} 31 32ADD_FLAG('CFLAGS_HASH', '/DKeccakP200_excluded /DKeccakP400_excluded /DKeccakP800_excluded /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1'); 33 34PHP_INSTALL_HEADERS('ext/hash/', 'php_hash.h php_hash_md.h php_hash_sha.h ' + 35 'php_hash_ripemd.h php_hash_haval.h php_hash_tiger.h ' + 36 'php_hash_gost.h php_hash_snefru.h php_hash_whirlpool.h ' + 37 'php_hash_adler32.h php_hash_crc32.h php_hash_sha3.h'); 38