rbnacl-libsodium 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/lib/rbnacl/libsodium/version.rb +1 -1
- data/vendor/libsodium/AUTHORS +3 -0
- data/vendor/libsodium/ChangeLog +21 -0
- data/vendor/libsodium/Makefile.in +9 -0
- data/vendor/libsodium/THANKS +3 -0
- data/vendor/libsodium/aclocal.m4 +1 -0
- data/vendor/libsodium/autom4te.cache/output.1 +919 -85
- data/vendor/libsodium/autom4te.cache/output.5 +18351 -0
- data/vendor/libsodium/autom4te.cache/requests +960 -725
- data/vendor/libsodium/autom4te.cache/traces.1 +289 -247
- data/vendor/libsodium/autom4te.cache/traces.5 +3032 -0
- data/vendor/libsodium/build-aux/ltmain.sh +70 -11
- data/vendor/libsodium/builds/msvc/properties/ARM.props +20 -0
- data/vendor/libsodium/builds/msvc/properties/ReleaseDEXE.props +1 -1
- data/vendor/libsodium/builds/msvc/version.h +2 -2
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +3 -1
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +13 -1
- data/vendor/libsodium/builds/msvc/vs2010/test/test.vcxproj +244 -241
- data/vendor/libsodium/builds/msvc/vs2010/test/test.vcxproj.filters +192 -189
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +2 -0
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +13 -1
- data/vendor/libsodium/builds/msvc/vs2012/test/test.vcxproj +244 -241
- data/vendor/libsodium/builds/msvc/vs2012/test/test.vcxproj.filters +192 -189
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +3 -1
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +13 -1
- data/vendor/libsodium/builds/msvc/vs2013/test/test.vcxproj +244 -241
- data/vendor/libsodium/builds/msvc/vs2013/test/test.vcxproj.filters +192 -189
- data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +3 -1
- data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +13 -1
- data/vendor/libsodium/builds/msvc/vs2015/test/test.vcxproj +244 -241
- data/vendor/libsodium/builds/msvc/vs2015/test/test.vcxproj.filters +192 -189
- data/vendor/libsodium/configure +918 -84
- data/vendor/libsodium/configure.ac +89 -15
- data/vendor/libsodium/dist-build/Makefile.am +6 -2
- data/vendor/libsodium/dist-build/Makefile.in +15 -2
- data/vendor/libsodium/dist-build/android-armv8-a.sh +4 -0
- data/vendor/libsodium/dist-build/android-build.sh +9 -9
- data/vendor/libsodium/dist-build/android-mips64.sh +4 -0
- data/vendor/libsodium/dist-build/android-x86-64.sh +4 -0
- data/vendor/libsodium/dist-build/emscripten.sh +3 -3
- data/vendor/libsodium/dist-build/ios.sh +5 -5
- data/vendor/libsodium/dist-build/nativeclient.sh +28 -0
- data/vendor/libsodium/examples/Makefile +21 -0
- data/vendor/libsodium/examples/auth.c +68 -0
- data/vendor/libsodium/examples/box.c +133 -0
- data/vendor/libsodium/examples/box_detached.c +132 -0
- data/vendor/libsodium/examples/generichash.c +80 -0
- data/vendor/libsodium/examples/generichash_stream.c +58 -0
- data/vendor/libsodium/examples/shorthash.c +58 -0
- data/vendor/libsodium/examples/sign.c +78 -0
- data/vendor/libsodium/examples/utils.h +106 -0
- data/vendor/libsodium/libsodium-uninstalled.pc.in +1 -1
- data/vendor/libsodium/libsodium.vcxproj +2 -0
- data/vendor/libsodium/libsodium.vcxproj.filters +6 -0
- data/vendor/libsodium/m4/ax_check_compile_flag.m4 +2 -2
- data/vendor/libsodium/m4/ax_check_define.m4 +92 -0
- data/vendor/libsodium/m4/ax_check_link_flag.m4 +3 -2
- data/vendor/libsodium/m4/libtool.m4 +111 -60
- data/vendor/libsodium/m4/ltoptions.m4 +1 -1
- data/vendor/libsodium/m4/ltsugar.m4 +1 -1
- data/vendor/libsodium/m4/ltversion.m4 +6 -6
- data/vendor/libsodium/m4/lt~obsolete.m4 +1 -1
- data/vendor/libsodium/msvc-scripts/Makefile.in +9 -0
- data/vendor/libsodium/msvc-scripts/process.bat +2 -2
- data/vendor/libsodium/src/Makefile.in +9 -0
- data/vendor/libsodium/src/libsodium/Makefile.am +27 -3
- data/vendor/libsodium/src/libsodium/Makefile.in +170 -63
- data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +852 -0
- data/vendor/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c +137 -17
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c +1 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c +1 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +10 -6
- data/vendor/libsodium/src/libsodium/crypto_generichash/crypto_generichash.c +1 -1
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c +29 -23
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512.c +9 -10
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c +4 -2
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h +1 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c +4 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c +3 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c +2 -1
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_frombytes_curve25519_ref10.c +10 -10
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/api.h +10 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.c +51 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20_api.c +29 -0
- data/vendor/libsodium/src/libsodium/include/Makefile.am +6 -0
- data/vendor/libsodium/src/libsodium/include/Makefile.in +67 -40
- data/vendor/libsodium/src/libsodium/include/sodium.h +4 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_aes256gcm.h +88 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h +28 -2
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h +0 -6
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash_sha256.h +1 -1
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_chacha20.h +23 -0
- data/vendor/libsodium/src/libsodium/include/sodium/export.h +8 -0
- data/vendor/libsodium/src/libsodium/include/sodium/randombytes_nativeclient.h +37 -0
- data/vendor/libsodium/src/libsodium/include/sodium/randombytes_salsa20_random.h +3 -2
- data/vendor/libsodium/src/libsodium/include/sodium/runtime.h +6 -0
- data/vendor/libsodium/src/libsodium/include/sodium/utils.h +15 -1
- data/vendor/libsodium/src/libsodium/randombytes/nativeclient/randombytes_nativeclient.c +49 -0
- data/vendor/libsodium/src/libsodium/randombytes/randombytes.c +11 -1
- data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +71 -45
- data/vendor/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +12 -2
- data/vendor/libsodium/src/libsodium/sodium/runtime.c +26 -3
- data/vendor/libsodium/src/libsodium/sodium/utils.c +86 -13
- data/vendor/libsodium/test/Makefile.in +9 -0
- data/vendor/libsodium/test/default/Makefile.am +130 -0
- data/vendor/libsodium/test/default/Makefile.in +197 -50
- data/vendor/libsodium/test/default/aead_aes256gcm.c +3197 -0
- data/vendor/libsodium/test/default/aead_aes256gcm.exp +1 -0
- data/vendor/libsodium/test/default/aead_chacha20poly1305.c +150 -17
- data/vendor/libsodium/test/default/aead_chacha20poly1305.exp +51 -0
- data/vendor/libsodium/test/default/chacha20.c +80 -5
- data/vendor/libsodium/test/default/chacha20.exp +11 -0
- data/vendor/libsodium/test/default/generichash.c +1332 -1
- data/vendor/libsodium/test/default/generichash.exp +1 -1
- data/vendor/libsodium/test/default/generichash2.c +3 -2
- data/vendor/libsodium/test/default/generichash3.c +2 -1
- data/vendor/libsodium/test/default/nacl-test-wrapper.sh +26 -0
- data/vendor/libsodium/test/default/randombytes.c +4 -0
- data/vendor/libsodium/test/default/scalarmult.c +33 -14
- data/vendor/libsodium/test/default/scalarmult.exp +4 -4
- data/vendor/libsodium/test/default/secretbox.c +9 -0
- data/vendor/libsodium/test/default/secretbox.exp +19 -0
- data/vendor/libsodium/test/default/secretbox_easy.c +40 -4
- data/vendor/libsodium/test/default/secretbox_easy.exp +58 -1
- data/vendor/libsodium/test/default/sodium_core.c +2 -0
- data/vendor/libsodium/test/default/sodium_utils.c +46 -7
- data/vendor/libsodium/test/default/sodium_utils.exp +5 -0
- data/vendor/libsodium/test/default/stream.c +1 -0
- metadata +28 -3
@@ -0,0 +1,78 @@
|
|
1
|
+
/*
|
2
|
+
* GraxRabble
|
3
|
+
* example programs for libsodium.
|
4
|
+
*/
|
5
|
+
|
6
|
+
#include <sodium.h> /* library header */
|
7
|
+
|
8
|
+
#include "utils.h" /* utility functions shared by examples */
|
9
|
+
|
10
|
+
/*
|
11
|
+
* Signs a message with secret key which will authenticate a message.
|
12
|
+
* Everybody else can use the public key to ensure that the message is both
|
13
|
+
* valid and untampered.
|
14
|
+
*
|
15
|
+
* Note that the signed message will have 16 bytes of signature prepended.
|
16
|
+
* Ensure that the signed buffer is at least crypto_sign_BYTES longer then
|
17
|
+
* the actual message.
|
18
|
+
*/
|
19
|
+
static int
|
20
|
+
sign(void)
|
21
|
+
{
|
22
|
+
unsigned char pk[crypto_sign_PUBLICKEYBYTES]; /* Bob's public key */
|
23
|
+
unsigned char sk[crypto_sign_SECRETKEYBYTES]; /* Bob's secret key */
|
24
|
+
unsigned char message[MAX_INPUT_LEN];
|
25
|
+
unsigned char message_signed[crypto_sign_BYTES + MAX_INPUT_LEN];
|
26
|
+
unsigned long long message_len;
|
27
|
+
unsigned long long message_signed_len;
|
28
|
+
int ret;
|
29
|
+
|
30
|
+
puts("Example: crypto_sign\n");
|
31
|
+
|
32
|
+
puts("Generating keypair...");
|
33
|
+
crypto_sign_keypair(pk, sk); /* generate Bob's keys */
|
34
|
+
|
35
|
+
printf("Public key: ");
|
36
|
+
print_hex(pk, sizeof pk);
|
37
|
+
printf("Secret key: ");
|
38
|
+
print_hex(sk, sizeof sk);
|
39
|
+
puts("The secret key, as returned by crypto_sign_keypair(), actually includes "
|
40
|
+
"a copy of the public key, in order to avoid a scalar multiplication "
|
41
|
+
"when signing messages.");
|
42
|
+
|
43
|
+
message_len = prompt_input("a message", (char*)message, sizeof message, 1);
|
44
|
+
|
45
|
+
printf("Signing message with %s...\n", crypto_sign_primitive());
|
46
|
+
crypto_sign(message_signed, &message_signed_len, message, message_len, sk);
|
47
|
+
|
48
|
+
printf("Signed message:");
|
49
|
+
print_hex(message_signed, message_signed_len);
|
50
|
+
printf("A %u bytes signature was prepended to the message\n",
|
51
|
+
crypto_sign_BYTES);
|
52
|
+
|
53
|
+
printf("Signature: ");
|
54
|
+
print_hex(message_signed, crypto_sign_BYTES);
|
55
|
+
printf("Message: ");
|
56
|
+
fwrite(message_signed + crypto_sign_BYTES, 1U,
|
57
|
+
message_signed_len - crypto_sign_BYTES, stdout);
|
58
|
+
putchar('\n');
|
59
|
+
|
60
|
+
puts("Validating message...");
|
61
|
+
ret = crypto_sign_open(message, &message_len, message_signed,
|
62
|
+
message_signed_len, pk);
|
63
|
+
print_verification(ret);
|
64
|
+
if (ret == 0)
|
65
|
+
printf("Message: %s\n", message);
|
66
|
+
|
67
|
+
sodium_memzero(sk, sizeof sk); /* wipe sensitive data */
|
68
|
+
|
69
|
+
return ret;
|
70
|
+
}
|
71
|
+
|
72
|
+
int
|
73
|
+
main(void)
|
74
|
+
{
|
75
|
+
init();
|
76
|
+
|
77
|
+
return sign() != 0;
|
78
|
+
}
|
@@ -0,0 +1,106 @@
|
|
1
|
+
/*
|
2
|
+
* Utility functions shared by all the demo programs.
|
3
|
+
*/
|
4
|
+
#ifndef UTILS_H
|
5
|
+
#define UTILS_H
|
6
|
+
|
7
|
+
#include <limits.h>
|
8
|
+
#include <stdio.h>
|
9
|
+
#include <stdlib.h>
|
10
|
+
#include <string.h>
|
11
|
+
|
12
|
+
#include <sodium.h>
|
13
|
+
|
14
|
+
#define MAX_INPUT_LEN 4096
|
15
|
+
|
16
|
+
/*
|
17
|
+
* print_hex() is a wrapper around sodium_bin2hex() which allocates
|
18
|
+
* temporary memory then immediately prints the result followed by \n
|
19
|
+
*/
|
20
|
+
static void
|
21
|
+
print_hex(const void *bin, const size_t bin_len)
|
22
|
+
{
|
23
|
+
char *hex;
|
24
|
+
size_t hex_size;
|
25
|
+
|
26
|
+
if (bin_len >= SIZE_MAX / 2) {
|
27
|
+
abort();
|
28
|
+
}
|
29
|
+
hex_size = bin_len * 2 + 1;
|
30
|
+
if ((hex = malloc(hex_size)) == NULL) {
|
31
|
+
abort();
|
32
|
+
}
|
33
|
+
/* the library supplies a few utility functions like the one below */
|
34
|
+
if (sodium_bin2hex(hex, hex_size, bin, bin_len) == NULL) {
|
35
|
+
abort();
|
36
|
+
}
|
37
|
+
puts(hex);
|
38
|
+
free(hex);
|
39
|
+
}
|
40
|
+
|
41
|
+
/*
|
42
|
+
* Display a prompt for input by user. It will save the input into a buffer
|
43
|
+
* of a specific size with room for the null terminator while removing
|
44
|
+
* trailing newline characters.
|
45
|
+
*/
|
46
|
+
static size_t
|
47
|
+
prompt_input(const char *prompt, char *input, const size_t max_input_len,
|
48
|
+
int variable_length)
|
49
|
+
{
|
50
|
+
char input_tmp[MAX_INPUT_LEN + 1U];
|
51
|
+
size_t actual_input_len;
|
52
|
+
|
53
|
+
if (variable_length != 0) {
|
54
|
+
printf("\nEnter %s (%zu bytes max) > ", prompt, max_input_len);
|
55
|
+
} else {
|
56
|
+
printf("\nEnter %s (%zu bytes) > ", prompt, max_input_len);
|
57
|
+
}
|
58
|
+
fflush(stdout);
|
59
|
+
fgets(input_tmp, sizeof input_tmp, stdin);
|
60
|
+
actual_input_len = strlen(input_tmp);
|
61
|
+
|
62
|
+
/* trim \n */
|
63
|
+
if (actual_input_len > 0 && input_tmp[actual_input_len - 1] == '\n') {
|
64
|
+
input_tmp[actual_input_len - 1] = '\0';
|
65
|
+
--actual_input_len;
|
66
|
+
}
|
67
|
+
|
68
|
+
if (actual_input_len > max_input_len) {
|
69
|
+
printf("Warning: truncating input to %zu bytes\n\n", max_input_len);
|
70
|
+
actual_input_len = max_input_len;
|
71
|
+
} else if (actual_input_len < max_input_len && variable_length == 0) {
|
72
|
+
printf("Warning: %zu bytes expected, %zu bytes given: padding with zeros\n\n",
|
73
|
+
max_input_len, actual_input_len);
|
74
|
+
memset(input, 0, max_input_len);
|
75
|
+
} else {
|
76
|
+
printf("Length: %zu bytes\n\n", actual_input_len);
|
77
|
+
}
|
78
|
+
|
79
|
+
memcpy(input, input_tmp, actual_input_len);
|
80
|
+
if (variable_length == 0) {
|
81
|
+
return max_input_len;
|
82
|
+
} else {
|
83
|
+
return actual_input_len;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
/*
|
88
|
+
* Display whether the function was sucessful or failed.
|
89
|
+
*/
|
90
|
+
static void
|
91
|
+
print_verification(int ret)
|
92
|
+
{
|
93
|
+
if (ret == 0)
|
94
|
+
puts("Success!\n");
|
95
|
+
else
|
96
|
+
puts("Failure.\n");
|
97
|
+
}
|
98
|
+
|
99
|
+
static void
|
100
|
+
init(void)
|
101
|
+
{
|
102
|
+
sodium_init();
|
103
|
+
printf("Using libsodium %s\n", sodium_version_string());
|
104
|
+
}
|
105
|
+
|
106
|
+
#endif /* UTILS_H */
|
@@ -3,4 +3,4 @@ Version: @PACKAGE_VERSION@
|
|
3
3
|
Description: A portable, cross-compilable, installable, packageable fork of NaCl, with a compatible API.
|
4
4
|
|
5
5
|
Libs: -L${pcfiledir}/src/libsodium -lsodium
|
6
|
-
Cflags: -I${pcfiledir}/src/libsodium/include
|
6
|
+
Cflags: -I${pcfiledir}/src/libsodium/include -I@top_srcdir@/src/libsodium/include -I@top_srcdir@/src/libsodium/include/sodium
|
@@ -317,6 +317,7 @@
|
|
317
317
|
<ItemGroup>
|
318
318
|
<ClInclude Include="src\libsodium\include\sodium.h" />
|
319
319
|
<ClInclude Include="src\libsodium\include\sodium\core.h" />
|
320
|
+
<ClInclude Include="src\libsodium\include\sodium\crypto_aead_aes256gcm.h" />
|
320
321
|
<ClInclude Include="src\libsodium\include\sodium\crypto_aead_chacha20poly1305.h" />
|
321
322
|
<ClInclude Include="src\libsodium\include\sodium\crypto_auth.h" />
|
322
323
|
<ClInclude Include="src\libsodium\include\sodium\crypto_auth_hmacsha256.h" />
|
@@ -370,6 +371,7 @@
|
|
370
371
|
<ClInclude Include="src\libsodium\include\sodium\version.h" />
|
371
372
|
</ItemGroup>
|
372
373
|
<ItemGroup>
|
374
|
+
<ClCompile Include="src\libsodium\crypto_aead\aes256gcm\aesni\aead_aes256gcm_aesni.c" />
|
373
375
|
<ClCompile Include="src\libsodium\crypto_aead\chacha20poly1305\sodium\aead_chacha20poly1305.c" />
|
374
376
|
<ClCompile Include="src\libsodium\crypto_auth\crypto_auth.c" />
|
375
377
|
<ClCompile Include="src\libsodium\crypto_auth\hmacsha256\auth_hmacsha256_api.c" />
|
@@ -168,6 +168,9 @@
|
|
168
168
|
<ClInclude Include="src\libsodium\include\sodium\crypto_stream_chacha20.h">
|
169
169
|
<Filter>Header Files</Filter>
|
170
170
|
</ClInclude>
|
171
|
+
<ClInclude Include="src\libsodium\include\sodium\crypto_aead_aes256gcm.h">
|
172
|
+
<Filter>Header Files</Filter>
|
173
|
+
</ClInclude>
|
171
174
|
<ClInclude Include="src\libsodium\include\sodium\crypto_aead_chacha20poly1305.h">
|
172
175
|
<Filter>Header Files</Filter>
|
173
176
|
</ClInclude>
|
@@ -638,6 +641,9 @@
|
|
638
641
|
<ClCompile Include="src\libsodium\crypto_box\curve25519xsalsa20poly1305\ref\before_curve25519xsalsa20poly1305.c">
|
639
642
|
<Filter>Source Files</Filter>
|
640
643
|
</ClCompile>
|
644
|
+
<ClCompile Include="src\libsodium\crypto_aead\aes256gcm\aesni\aead_aes256gcm_aesni.c">
|
645
|
+
<Filter>Source Files</Filter>
|
646
|
+
</ClCompile>
|
641
647
|
<ClCompile Include="src\libsodium\crypto_aead\chacha20poly1305\sodium\aead_chacha20poly1305.c">
|
642
648
|
<Filter>Source Files</Filter>
|
643
649
|
</ClCompile>
|
@@ -56,7 +56,7 @@
|
|
56
56
|
#serial 2
|
57
57
|
|
58
58
|
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
59
|
-
[AC_PREREQ(2.
|
59
|
+
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
|
60
60
|
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
|
61
61
|
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
62
62
|
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
@@ -66,7 +66,7 @@ AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
|
66
66
|
[AS_VAR_SET(CACHEVAR,[yes])],
|
67
67
|
[AS_VAR_SET(CACHEVAR,[no])])
|
68
68
|
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
|
69
|
-
|
69
|
+
AS_VAR_IF(CACHEVAR,yes,
|
70
70
|
[m4_default([$2], :)],
|
71
71
|
[m4_default([$3], :)])
|
72
72
|
AS_VAR_POPDEF([CACHEVAR])dnl
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# ===========================================================================
|
2
|
+
# http://www.gnu.org/software/autoconf-archive/ax_check_define.html
|
3
|
+
# ===========================================================================
|
4
|
+
#
|
5
|
+
# SYNOPSIS
|
6
|
+
#
|
7
|
+
# AC_CHECK_DEFINE([symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
|
8
|
+
# AX_CHECK_DEFINE([includes],[symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
|
9
|
+
#
|
10
|
+
# DESCRIPTION
|
11
|
+
#
|
12
|
+
# Complements AC_CHECK_FUNC but it does not check for a function but for a
|
13
|
+
# define to exist. Consider a usage like:
|
14
|
+
#
|
15
|
+
# AC_CHECK_DEFINE(__STRICT_ANSI__, CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500")
|
16
|
+
#
|
17
|
+
# LICENSE
|
18
|
+
#
|
19
|
+
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
20
|
+
#
|
21
|
+
# This program is free software; you can redistribute it and/or modify it
|
22
|
+
# under the terms of the GNU General Public License as published by the
|
23
|
+
# Free Software Foundation; either version 3 of the License, or (at your
|
24
|
+
# option) any later version.
|
25
|
+
#
|
26
|
+
# This program is distributed in the hope that it will be useful, but
|
27
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
28
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
29
|
+
# Public License for more details.
|
30
|
+
#
|
31
|
+
# You should have received a copy of the GNU General Public License along
|
32
|
+
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
33
|
+
#
|
34
|
+
# As a special exception, the respective Autoconf Macro's copyright owner
|
35
|
+
# gives unlimited permission to copy, distribute and modify the configure
|
36
|
+
# scripts that are the output of Autoconf when processing the Macro. You
|
37
|
+
# need not follow the terms of the GNU General Public License when using
|
38
|
+
# or distributing such scripts, even though portions of the text of the
|
39
|
+
# Macro appear in them. The GNU General Public License (GPL) does govern
|
40
|
+
# all other use of the material that constitutes the Autoconf Macro.
|
41
|
+
#
|
42
|
+
# This special exception to the GPL applies to versions of the Autoconf
|
43
|
+
# Macro released by the Autoconf Archive. When you make and distribute a
|
44
|
+
# modified version of the Autoconf Macro, you may extend this special
|
45
|
+
# exception to the GPL to apply to your modified version as well.
|
46
|
+
|
47
|
+
#serial 8
|
48
|
+
|
49
|
+
AU_ALIAS([AC_CHECK_DEFINED], [AC_CHECK_DEFINE])
|
50
|
+
AC_DEFUN([AC_CHECK_DEFINE],[
|
51
|
+
AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$1])dnl
|
52
|
+
AC_CACHE_CHECK([for $1 defined], ac_var,
|
53
|
+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
|
54
|
+
#ifdef $1
|
55
|
+
int ok;
|
56
|
+
#else
|
57
|
+
choke me
|
58
|
+
#endif
|
59
|
+
]])],[AS_VAR_SET(ac_var, yes)],[AS_VAR_SET(ac_var, no)]))
|
60
|
+
AS_IF([test AS_VAR_GET(ac_var) != "no"], [$2], [$3])dnl
|
61
|
+
AS_VAR_POPDEF([ac_var])dnl
|
62
|
+
])
|
63
|
+
|
64
|
+
AU_ALIAS([AX_CHECK_DEFINED], [AX_CHECK_DEFINE])
|
65
|
+
AC_DEFUN([AX_CHECK_DEFINE],[
|
66
|
+
AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$2_$1])dnl
|
67
|
+
AC_CACHE_CHECK([for $2 defined in $1], ac_var,
|
68
|
+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <$1>]], [[
|
69
|
+
#ifdef $2
|
70
|
+
int ok;
|
71
|
+
#else
|
72
|
+
choke me
|
73
|
+
#endif
|
74
|
+
]])],[AS_VAR_SET(ac_var, yes)],[AS_VAR_SET(ac_var, no)]))
|
75
|
+
AS_IF([test AS_VAR_GET(ac_var) != "no"], [$3], [$4])dnl
|
76
|
+
AS_VAR_POPDEF([ac_var])dnl
|
77
|
+
])
|
78
|
+
|
79
|
+
AC_DEFUN([AX_CHECK_FUNC],
|
80
|
+
[AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$2])dnl
|
81
|
+
AC_CACHE_CHECK([for $2], ac_var,
|
82
|
+
dnl AC_LANG_FUNC_LINK_TRY
|
83
|
+
[AC_LINK_IFELSE([AC_LANG_PROGRAM([$1
|
84
|
+
#undef $2
|
85
|
+
char $2 ();],[
|
86
|
+
char (*f) () = $2;
|
87
|
+
return f != $2; ])],
|
88
|
+
[AS_VAR_SET(ac_var, yes)],
|
89
|
+
[AS_VAR_SET(ac_var, no)])])
|
90
|
+
AS_IF([test AS_VAR_GET(ac_var) = yes], [$3], [$4])dnl
|
91
|
+
AS_VAR_POPDEF([ac_var])dnl
|
92
|
+
])# AC_CHECK_FUNC
|
@@ -56,7 +56,8 @@
|
|
56
56
|
#serial 2
|
57
57
|
|
58
58
|
AC_DEFUN([AX_CHECK_LINK_FLAG],
|
59
|
-
[
|
59
|
+
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
|
60
|
+
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
|
60
61
|
AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
|
61
62
|
ax_check_save_flags=$LDFLAGS
|
62
63
|
LDFLAGS="$LDFLAGS $4 $1"
|
@@ -65,7 +66,7 @@ AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
|
|
65
66
|
[AS_VAR_SET(CACHEVAR,[yes])],
|
66
67
|
[AS_VAR_SET(CACHEVAR,[no])])
|
67
68
|
LDFLAGS=$ax_check_save_flags])
|
68
|
-
|
69
|
+
AS_VAR_IF(CACHEVAR,yes,
|
69
70
|
[m4_default([$2], :)],
|
70
71
|
[m4_default([$3], :)])
|
71
72
|
AS_VAR_POPDEF([CACHEVAR])dnl
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
|
2
2
|
#
|
3
|
-
# Copyright (C) 1996-2001, 2003-
|
3
|
+
# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
|
4
4
|
# Written by Gordon Matzigkeit, 1996
|
5
5
|
#
|
6
6
|
# This file is free software; the Free Software Foundation gives
|
@@ -103,19 +103,36 @@ dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
|
|
103
103
|
dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
|
104
104
|
|
105
105
|
|
106
|
+
# _LT_PREPARE_CC_BASENAME
|
107
|
+
# -----------------------
|
108
|
+
m4_defun([_LT_PREPARE_CC_BASENAME], [
|
109
|
+
# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
|
110
|
+
func_cc_basename ()
|
111
|
+
{
|
112
|
+
for cc_temp in @S|@*""; do
|
113
|
+
case $cc_temp in
|
114
|
+
compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
|
115
|
+
distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
|
116
|
+
\-*) ;;
|
117
|
+
*) break;;
|
118
|
+
esac
|
119
|
+
done
|
120
|
+
func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
|
121
|
+
}
|
122
|
+
])# _LT_PREPARE_CC_BASENAME
|
123
|
+
|
124
|
+
|
106
125
|
# _LT_CC_BASENAME(CC)
|
107
126
|
# -------------------
|
108
|
-
#
|
127
|
+
# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
|
128
|
+
# but that macro is also expanded into generated libtool script, which
|
129
|
+
# arranges for $SED and $ECHO to be set by different means.
|
109
130
|
m4_defun([_LT_CC_BASENAME],
|
110
|
-
[
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
*) break;;
|
116
|
-
esac
|
117
|
-
done
|
118
|
-
cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
|
131
|
+
[m4_require([_LT_PREPARE_CC_BASENAME])dnl
|
132
|
+
AC_REQUIRE([_LT_DECL_SED])dnl
|
133
|
+
AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
|
134
|
+
func_cc_basename $1
|
135
|
+
cc_basename=$func_cc_basename_result
|
119
136
|
])
|
120
137
|
|
121
138
|
|
@@ -720,11 +737,25 @@ _LT_CONFIG_SAVE_COMMANDS([
|
|
720
737
|
_LT_COPYING
|
721
738
|
_LT_LIBTOOL_TAGS
|
722
739
|
|
740
|
+
# Configured defaults for sys_lib_dlsearch_path munging.
|
741
|
+
: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
|
742
|
+
|
723
743
|
# ### BEGIN LIBTOOL CONFIG
|
724
744
|
_LT_LIBTOOL_CONFIG_VARS
|
725
745
|
_LT_LIBTOOL_TAG_VARS
|
726
746
|
# ### END LIBTOOL CONFIG
|
727
747
|
|
748
|
+
_LT_EOF
|
749
|
+
|
750
|
+
cat <<'_LT_EOF' >> "$cfgfile"
|
751
|
+
|
752
|
+
# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
|
753
|
+
|
754
|
+
_LT_PREPARE_MUNGE_PATH_LIST
|
755
|
+
_LT_PREPARE_CC_BASENAME
|
756
|
+
|
757
|
+
# ### END FUNCTIONS SHARED WITH CONFIGURE
|
758
|
+
|
728
759
|
_LT_EOF
|
729
760
|
|
730
761
|
case $host_os in
|
@@ -2202,6 +2233,47 @@ _LT_DECL([], [striplib], [1])
|
|
2202
2233
|
])# _LT_CMD_STRIPLIB
|
2203
2234
|
|
2204
2235
|
|
2236
|
+
# _LT_PREPARE_MUNGE_PATH_LIST
|
2237
|
+
# ---------------------------
|
2238
|
+
# Make sure func_munge_path_list() is defined correctly.
|
2239
|
+
m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
|
2240
|
+
[[# func_munge_path_list VARIABLE PATH
|
2241
|
+
# -----------------------------------
|
2242
|
+
# VARIABLE is name of variable containing _space_ separated list of
|
2243
|
+
# directories to be munged by the contents of PATH, which is string
|
2244
|
+
# having a format:
|
2245
|
+
# "DIR[:DIR]:"
|
2246
|
+
# string "DIR[ DIR]" will be prepended to VARIABLE
|
2247
|
+
# ":DIR[:DIR]"
|
2248
|
+
# string "DIR[ DIR]" will be appended to VARIABLE
|
2249
|
+
# "DIRP[:DIRP]::[DIRA:]DIRA"
|
2250
|
+
# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
|
2251
|
+
# "DIRA[ DIRA]" will be appended to VARIABLE
|
2252
|
+
# "DIR[:DIR]"
|
2253
|
+
# VARIABLE will be replaced by "DIR[ DIR]"
|
2254
|
+
func_munge_path_list ()
|
2255
|
+
{
|
2256
|
+
case x@S|@2 in
|
2257
|
+
x)
|
2258
|
+
;;
|
2259
|
+
*:)
|
2260
|
+
eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
|
2261
|
+
;;
|
2262
|
+
x:*)
|
2263
|
+
eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
|
2264
|
+
;;
|
2265
|
+
*::*)
|
2266
|
+
eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
|
2267
|
+
eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
|
2268
|
+
;;
|
2269
|
+
*)
|
2270
|
+
eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
|
2271
|
+
;;
|
2272
|
+
esac
|
2273
|
+
}
|
2274
|
+
]])# _LT_PREPARE_PATH_LIST
|
2275
|
+
|
2276
|
+
|
2205
2277
|
# _LT_SYS_DYNAMIC_LINKER([TAG])
|
2206
2278
|
# -----------------------------
|
2207
2279
|
# PORTME Fill in your ld.so characteristics
|
@@ -2212,6 +2284,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
|
|
2212
2284
|
m4_require([_LT_DECL_OBJDUMP])dnl
|
2213
2285
|
m4_require([_LT_DECL_SED])dnl
|
2214
2286
|
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
|
2287
|
+
m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
|
2215
2288
|
AC_MSG_CHECKING([dynamic linker characteristics])
|
2216
2289
|
m4_if([$1],
|
2217
2290
|
[], [
|
@@ -2306,6 +2379,9 @@ hardcode_into_libs=no
|
|
2306
2379
|
# flags to be left without arguments
|
2307
2380
|
need_version=unknown
|
2308
2381
|
|
2382
|
+
AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
|
2383
|
+
[User-defined run-time library search path.])
|
2384
|
+
|
2309
2385
|
case $host_os in
|
2310
2386
|
aix3*)
|
2311
2387
|
version_type=linux # correct to gnu/linux during the next big refactor
|
@@ -2594,6 +2670,7 @@ freebsd* | dragonfly*)
|
|
2594
2670
|
case $version_type in
|
2595
2671
|
freebsd-elf*)
|
2596
2672
|
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
|
2673
|
+
soname_spec='$libname$release$shared_ext$major'
|
2597
2674
|
need_version=no
|
2598
2675
|
need_lib_prefix=no
|
2599
2676
|
;;
|
@@ -2653,10 +2730,11 @@ hpux9* | hpux10* | hpux11*)
|
|
2653
2730
|
soname_spec='$libname$release$shared_ext$major'
|
2654
2731
|
if test 32 = "$HPUX_IA64_MODE"; then
|
2655
2732
|
sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
|
2733
|
+
sys_lib_dlsearch_path_spec=/usr/lib/hpux32
|
2656
2734
|
else
|
2657
2735
|
sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
|
2736
|
+
sys_lib_dlsearch_path_spec=/usr/lib/hpux64
|
2658
2737
|
fi
|
2659
|
-
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
|
2660
2738
|
;;
|
2661
2739
|
hppa*64*)
|
2662
2740
|
shrext_cmds='.sl'
|
@@ -2789,7 +2867,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
|
|
2789
2867
|
# before this can be enabled.
|
2790
2868
|
hardcode_into_libs=yes
|
2791
2869
|
|
2792
|
-
#
|
2870
|
+
# Ideally, we could use ldconfig to report *all* directores which are
|
2871
|
+
# searched for libraries, however this is still not possible. Aside from not
|
2872
|
+
# being certain /sbin/ldconfig is available, command
|
2873
|
+
# 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
|
2874
|
+
# even though it is searched at run-time. Try to do the best guess by
|
2875
|
+
# appending ld.so.conf contents (and includes) to the search path.
|
2793
2876
|
if test -f /etc/ld.so.conf; then
|
2794
2877
|
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
|
2795
2878
|
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
|
@@ -3013,10 +3096,20 @@ fi
|
|
3013
3096
|
if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
|
3014
3097
|
sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
|
3015
3098
|
fi
|
3099
|
+
|
3016
3100
|
if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
|
3017
3101
|
sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
|
3018
3102
|
fi
|
3019
3103
|
|
3104
|
+
# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
|
3105
|
+
configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
|
3106
|
+
|
3107
|
+
# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
|
3108
|
+
func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
|
3109
|
+
|
3110
|
+
# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
|
3111
|
+
configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
|
3112
|
+
|
3020
3113
|
_LT_DECL([], [variables_saved_for_relink], [1],
|
3021
3114
|
[Variables whose values should be saved in libtool wrapper scripts and
|
3022
3115
|
restored at link time])
|
@@ -3049,8 +3142,10 @@ _LT_DECL([], [hardcode_into_libs], [0],
|
|
3049
3142
|
[Whether we should hardcode library paths into libraries])
|
3050
3143
|
_LT_DECL([], [sys_lib_search_path_spec], [2],
|
3051
3144
|
[Compile-time system search path for libraries])
|
3052
|
-
_LT_DECL([], [
|
3053
|
-
[
|
3145
|
+
_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
|
3146
|
+
[Detected run-time system search path for libraries])
|
3147
|
+
_LT_DECL([], [configure_time_lt_sys_library_path], [2],
|
3148
|
+
[Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
|
3054
3149
|
])# _LT_SYS_DYNAMIC_LINKER
|
3055
3150
|
|
3056
3151
|
|
@@ -7350,6 +7445,7 @@ func_stripname_cnf ()
|
|
7350
7445
|
} # func_stripname_cnf
|
7351
7446
|
])# _LT_FUNC_STRIPNAME_CNF
|
7352
7447
|
|
7448
|
+
|
7353
7449
|
# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
|
7354
7450
|
# ---------------------------------
|
7355
7451
|
# Figure out "hidden" library dependencies from verbose
|
@@ -7528,51 +7624,6 @@ interix[[3-9]]*)
|
|
7528
7624
|
_LT_TAGVAR(postdep_objects,$1)=
|
7529
7625
|
_LT_TAGVAR(postdeps,$1)=
|
7530
7626
|
;;
|
7531
|
-
|
7532
|
-
linux*)
|
7533
|
-
case `$CC -V 2>&1 | sed 5q` in
|
7534
|
-
*Sun\ C*)
|
7535
|
-
# Sun C++ 5.9
|
7536
|
-
|
7537
|
-
# The more standards-conforming stlport4 library is
|
7538
|
-
# incompatible with the Cstd library. Avoid specifying
|
7539
|
-
# it if it's in CXXFLAGS. Ignore libCrun as
|
7540
|
-
# -library=stlport4 depends on it.
|
7541
|
-
case " $CXX $CXXFLAGS " in
|
7542
|
-
*" -library=stlport4 "*)
|
7543
|
-
solaris_use_stlport4=yes
|
7544
|
-
;;
|
7545
|
-
esac
|
7546
|
-
|
7547
|
-
if test yes != "$solaris_use_stlport4"; then
|
7548
|
-
_LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
|
7549
|
-
fi
|
7550
|
-
;;
|
7551
|
-
esac
|
7552
|
-
;;
|
7553
|
-
|
7554
|
-
solaris*)
|
7555
|
-
case $cc_basename in
|
7556
|
-
CC* | sunCC*)
|
7557
|
-
# The more standards-conforming stlport4 library is
|
7558
|
-
# incompatible with the Cstd library. Avoid specifying
|
7559
|
-
# it if it's in CXXFLAGS. Ignore libCrun as
|
7560
|
-
# -library=stlport4 depends on it.
|
7561
|
-
case " $CXX $CXXFLAGS " in
|
7562
|
-
*" -library=stlport4 "*)
|
7563
|
-
solaris_use_stlport4=yes
|
7564
|
-
;;
|
7565
|
-
esac
|
7566
|
-
|
7567
|
-
# Adding this requires a known-good setup of shared libraries for
|
7568
|
-
# Sun compiler versions before 5.6, else PIC objects from an old
|
7569
|
-
# archive will be linked into the output, leading to subtle bugs.
|
7570
|
-
if test yes != "$solaris_use_stlport4"; then
|
7571
|
-
_LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
|
7572
|
-
fi
|
7573
|
-
;;
|
7574
|
-
esac
|
7575
|
-
;;
|
7576
7627
|
esac
|
7577
7628
|
])
|
7578
7629
|
|