commit c25b20238647677c77beb2c3febd0c5afc8882ad Author: Eric Wheeler Date: Mon Jun 13 08:27:43 2016 -0700 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ede4292 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +mysqlexamples +old/ + +.idea/ +app/3rdparty +composer.lock +.*~ +*~ +composer.phar + +mp3/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9a5a6f7 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,18 @@ +[submodule "3rdparty/json"] + path = 3rdparty/json + url = https://github.com/nlohmann/json +[submodule "3rdparty/openwall-bcrypt"] + path = 3rdparty/openwall-bcrypt + url = https://github.com/gigamonkey/openwall-bcrypt +[submodule "3rdparty/bcrypt"] + path = 3rdparty/bcrypt + url = https://github.com/rg3/bcrypt +[submodule "3rdparty/appserver"] + path = 3rdparty/appserver + url = https://github.com/appserver-io/appserver +[submodule "3rdparty/runtime"] + path = 3rdparty/runtime + url = https://github.com/appserver-io-php/runtime.git +[submodule "3rdparty/freebsd"] + path = 3rdparty/freebsd + url = https://github.com/lattera/freebsd diff --git a/3rdparty/crypt_blowfish.c b/3rdparty/crypt_blowfish.c new file mode 100644 index 0000000..c486f85 --- /dev/null +++ b/3rdparty/crypt_blowfish.c @@ -0,0 +1,914 @@ +/* $Id$ */ +/* + * The crypt_blowfish homepage is: + * + * http://www.openwall.com/crypt/ + * + * This code comes from John the Ripper password cracker, with reentrant + * and crypt(3) interfaces added, but optimizations specific to password + * cracking removed. + * + * Written by Solar Designer in 1998-2011. + * No copyright is claimed, and the software is hereby placed in the public + * domain. In case this attempt to disclaim copyright and place the software + * in the public domain is deemed null and void, then the software is + * Copyright (c) 1998-2011 Solar Designer and it is hereby released to the + * general public under the following terms: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted. + * + * There's ABSOLUTELY NO WARRANTY, express or implied. + * + * It is my intent that you should be able to use this on your system, + * as part of a software package, or anywhere else to improve security, + * ensure compatibility, or for any other purpose. I would appreciate + * it if you give credit where it is due and keep your modifications in + * the public domain as well, but I don't require that in order to let + * you place this code and any modifications you make under a license + * of your choice. + * + * This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix + * "$2a$") by Niels Provos , and uses some of his + * ideas. The password hashing algorithm was designed by David Mazieres + * . For more information on the level of compatibility, + * please refer to the comments in BF_set_key() below and to the crypt(3) + * man page included in the crypt_blowfish tarball. + * + * There's a paper on the algorithm that explains its design decisions: + * + * http://www.usenix.org/events/usenix99/provos.html + * + * Some of the tricks in BF_ROUND might be inspired by Eric Young's + * Blowfish library (I can't be sure if I would think of something if I + * hadn't seen his code). + */ +#ifdef __cplusplus +extern "C" { +#endif +#include + +#include +#ifndef __set_errno +#define __set_errno(val) errno = (val) +#endif + +/* Just to make sure the prototypes match the actual definitions */ +#include "crypt_blowfish.h" + +#ifdef __i386__ +#define BF_ASM 0 +#define BF_SCALE 1 +#elif defined(__x86_64__) || defined(__alpha__) || defined(__hppa__) +#define BF_ASM 0 +#define BF_SCALE 1 +#else +#define BF_ASM 0 +#define BF_SCALE 0 +#endif + +typedef unsigned int BF_word; +typedef signed int BF_word_signed; + +/* Number of Blowfish rounds, this is also hardcoded into a few places */ +#define BF_N 16 + +typedef BF_word BF_key[BF_N + 2]; + +typedef struct { + BF_word S[4][0x100]; + BF_key P; +} BF_ctx; + +/* + * Magic IV for 64 Blowfish encryptions that we do at the end. + * The string is "OrpheanBeholderScryDoubt" on big-endian. + */ +static BF_word BF_magic_w[6] = { + 0x4F727068, 0x65616E42, 0x65686F6C, + 0x64657253, 0x63727944, 0x6F756274 +}; + +/* + * P-box and S-box tables initialized with digits of Pi. + */ +static BF_ctx BF_init_state = { + { + { + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, + 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, + 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, + 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, + 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, + 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, + 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, + 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, + 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, + 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, + 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, + 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, + 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, + 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, + 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, + 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, + 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, + 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a + }, { + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, + 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, + 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, + 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, + 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, + 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, + 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, + 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, + 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, + 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, + 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, + 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, + 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, + 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, + 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, + 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, + 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, + 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 + }, { + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 + }, { + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, + 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, + 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, + 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, + 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, + 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, + 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, + 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, + 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, + 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, + 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, + 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, + 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, + 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, + 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, + 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, + 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, + 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, + 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, + 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 + } + }, { + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, + 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b + } +}; + +static unsigned char BF_itoa64[64 + 1] = + "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + +static unsigned char BF_atoi64[0x60] = { + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 1, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 64, 64, 64, 64, 64, + 64, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 64, 64, 64, 64, 64, + 64, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 64, 64, 64, 64, 64 +}; + +#define BF_safe_atoi64(dst, src) \ +{ \ + tmp = (unsigned char)(src); \ + if (tmp == '$') break; /* PHP hack */ \ + if ((unsigned int)(tmp -= 0x20) >= 0x60) return -1; \ + tmp = BF_atoi64[tmp]; \ + if (tmp > 63) return -1; \ + (dst) = tmp; \ +} + +static int BF_decode(BF_word *dst, const char *src, int size) +{ + unsigned char *dptr = (unsigned char *)dst; + unsigned char *end = dptr + size; + const unsigned char *sptr = (const unsigned char *)src; + unsigned int tmp, c1, c2, c3, c4; + + do { + BF_safe_atoi64(c1, *sptr++); + BF_safe_atoi64(c2, *sptr++); + *dptr++ = (c1 << 2) | ((c2 & 0x30) >> 4); + if (dptr >= end) break; + + BF_safe_atoi64(c3, *sptr++); + *dptr++ = ((c2 & 0x0F) << 4) | ((c3 & 0x3C) >> 2); + if (dptr >= end) break; + + BF_safe_atoi64(c4, *sptr++); + *dptr++ = ((c3 & 0x03) << 6) | c4; + } while (dptr < end); + + while (dptr < end) /* PHP hack */ + *dptr++ = 0; + + return 0; +} + +static void BF_encode(char *dst, const BF_word *src, int size) +{ + const unsigned char *sptr = (const unsigned char *)src; + const unsigned char *end = sptr + size; + unsigned char *dptr = (unsigned char *)dst; + unsigned int c1, c2; + + do { + c1 = *sptr++; + *dptr++ = BF_itoa64[c1 >> 2]; + c1 = (c1 & 0x03) << 4; + if (sptr >= end) { + *dptr++ = BF_itoa64[c1]; + break; + } + + c2 = *sptr++; + c1 |= c2 >> 4; + *dptr++ = BF_itoa64[c1]; + c1 = (c2 & 0x0f) << 2; + if (sptr >= end) { + *dptr++ = BF_itoa64[c1]; + break; + } + + c2 = *sptr++; + c1 |= c2 >> 6; + *dptr++ = BF_itoa64[c1]; + *dptr++ = BF_itoa64[c2 & 0x3f]; + } while (sptr < end); +} + +static void BF_swap(BF_word *x, int count) +{ + static int endianness_check = 1; + char *is_little_endian = (char *)&endianness_check; + BF_word tmp; + + if (*is_little_endian) + do { + tmp = *x; + tmp = (tmp << 16) | (tmp >> 16); + *x++ = ((tmp & 0x00FF00FF) << 8) | ((tmp >> 8) & 0x00FF00FF); + } while (--count); +} + +#if BF_SCALE +/* Architectures which can shift addresses left by 2 bits with no extra cost */ +#define BF_ROUND(L, R, N) \ + tmp1 = L & 0xFF; \ + tmp2 = L >> 8; \ + tmp2 &= 0xFF; \ + tmp3 = L >> 16; \ + tmp3 &= 0xFF; \ + tmp4 = L >> 24; \ + tmp1 = data.ctx.S[3][tmp1]; \ + tmp2 = data.ctx.S[2][tmp2]; \ + tmp3 = data.ctx.S[1][tmp3]; \ + tmp3 += data.ctx.S[0][tmp4]; \ + tmp3 ^= tmp2; \ + R ^= data.ctx.P[N + 1]; \ + tmp3 += tmp1; \ + R ^= tmp3; +#else +/* Architectures with no complicated addressing modes supported */ +#define BF_INDEX(S, i) \ + (*((BF_word *)(((unsigned char *)S) + (i)))) +#define BF_ROUND(L, R, N) \ + tmp1 = L & 0xFF; \ + tmp1 <<= 2; \ + tmp2 = L >> 6; \ + tmp2 &= 0x3FC; \ + tmp3 = L >> 14; \ + tmp3 &= 0x3FC; \ + tmp4 = L >> 22; \ + tmp4 &= 0x3FC; \ + tmp1 = BF_INDEX(data.ctx.S[3], tmp1); \ + tmp2 = BF_INDEX(data.ctx.S[2], tmp2); \ + tmp3 = BF_INDEX(data.ctx.S[1], tmp3); \ + tmp3 += BF_INDEX(data.ctx.S[0], tmp4); \ + tmp3 ^= tmp2; \ + R ^= data.ctx.P[N + 1]; \ + tmp3 += tmp1; \ + R ^= tmp3; +#endif + +/* + * Encrypt one block, BF_N is hardcoded here. + */ +#define BF_ENCRYPT \ + L ^= data.ctx.P[0]; \ + BF_ROUND(L, R, 0); \ + BF_ROUND(R, L, 1); \ + BF_ROUND(L, R, 2); \ + BF_ROUND(R, L, 3); \ + BF_ROUND(L, R, 4); \ + BF_ROUND(R, L, 5); \ + BF_ROUND(L, R, 6); \ + BF_ROUND(R, L, 7); \ + BF_ROUND(L, R, 8); \ + BF_ROUND(R, L, 9); \ + BF_ROUND(L, R, 10); \ + BF_ROUND(R, L, 11); \ + BF_ROUND(L, R, 12); \ + BF_ROUND(R, L, 13); \ + BF_ROUND(L, R, 14); \ + BF_ROUND(R, L, 15); \ + tmp4 = R; \ + R = L; \ + L = tmp4 ^ data.ctx.P[BF_N + 1]; + +#if BF_ASM +#define BF_body() \ + _BF_body_r(&data.ctx); +#else +#define BF_body() \ + L = R = 0; \ + ptr = data.ctx.P; \ + do { \ + ptr += 2; \ + BF_ENCRYPT; \ + *(ptr - 2) = L; \ + *(ptr - 1) = R; \ + } while (ptr < &data.ctx.P[BF_N + 2]); \ +\ + ptr = data.ctx.S[0]; \ + do { \ + ptr += 2; \ + BF_ENCRYPT; \ + *(ptr - 2) = L; \ + *(ptr - 1) = R; \ + } while (ptr < &data.ctx.S[3][0xFF]); +#endif + +static void BF_set_key(const char *key, BF_key expanded, BF_key initial, + unsigned char flags) +{ + const char *ptr = key; + unsigned int bug, i, j; + BF_word safety, sign, diff, tmp[2]; + +/* + * There was a sign extension bug in older revisions of this function. While + * we would have liked to simply fix the bug and move on, we have to provide + * a backwards compatibility feature (essentially the bug) for some systems and + * a safety measure for some others. The latter is needed because for certain + * multiple inputs to the buggy algorithm there exist easily found inputs to + * the correct algorithm that produce the same hash. Thus, we optionally + * deviate from the correct algorithm just enough to avoid such collisions. + * While the bug itself affected the majority of passwords containing + * characters with the 8th bit set (although only a percentage of those in a + * collision-producing way), the anti-collision safety measure affects + * only a subset of passwords containing the '\xff' character (not even all of + * those passwords, just some of them). This character is not found in valid + * UTF-8 sequences and is rarely used in popular 8-bit character encodings. + * Thus, the safety measure is unlikely to cause much annoyance, and is a + * reasonable tradeoff to use when authenticating against existing hashes that + * are not reliably known to have been computed with the correct algorithm. + * + * We use an approach that tries to minimize side-channel leaks of password + * information - that is, we mostly use fixed-cost bitwise operations instead + * of branches or table lookups. (One conditional branch based on password + * length remains. It is not part of the bug aftermath, though, and is + * difficult and possibly unreasonable to avoid given the use of C strings by + * the caller, which results in similar timing leaks anyway.) + * + * For actual implementation, we set an array index in the variable "bug" + * (0 means no bug, 1 means sign extension bug emulation) and a flag in the + * variable "safety" (bit 16 is set when the safety measure is requested). + * Valid combinations of settings are: + * + * Prefix "$2a$": bug = 0, safety = 0x10000 + * Prefix "$2x$": bug = 1, safety = 0 + * Prefix "$2y$": bug = 0, safety = 0 + */ + bug = (unsigned int)flags & 1; + safety = ((BF_word)flags & 2) << 15; + + sign = diff = 0; + + for (i = 0; i < BF_N + 2; i++) { + tmp[0] = tmp[1] = 0; + for (j = 0; j < 4; j++) { + tmp[0] <<= 8; + tmp[0] |= (unsigned char)*ptr; /* correct */ + tmp[1] <<= 8; + tmp[1] |= (BF_word_signed)(signed char)*ptr; /* bug */ +/* + * Sign extension in the first char has no effect - nothing to overwrite yet, + * and those extra 24 bits will be fully shifted out of the 32-bit word. For + * chars 2, 3, 4 in each four-char block, we set bit 7 of "sign" if sign + * extension in tmp[1] occurs. Once this flag is set, it remains set. + */ + if (j) + sign |= tmp[1] & 0x80; + if (!*ptr) + ptr = key; + else + ptr++; + } + diff |= tmp[0] ^ tmp[1]; /* Non-zero on any differences */ + + expanded[i] = tmp[bug]; + initial[i] = BF_init_state.P[i] ^ tmp[bug]; + } + +/* + * At this point, "diff" is zero iff the correct and buggy algorithms produced + * exactly the same result. If so and if "sign" is non-zero, which indicates + * that there was a non-benign sign extension, this means that we have a + * collision between the correctly computed hash for this password and a set of + * passwords that could be supplied to the buggy algorithm. Our safety measure + * is meant to protect from such many-buggy to one-correct collisions, by + * deviating from the correct algorithm in such cases. Let's check for this. + */ + diff |= diff >> 16; /* still zero iff exact match */ + diff &= 0xffff; /* ditto */ + diff += 0xffff; /* bit 16 set iff "diff" was non-zero (on non-match) */ + sign <<= 9; /* move the non-benign sign extension flag to bit 16 */ + sign &= ~diff & safety; /* action needed? */ + +/* + * If we have determined that we need to deviate from the correct algorithm, + * flip bit 16 in initial expanded key. (The choice of 16 is arbitrary, but + * let's stick to it now. It came out of the approach we used above, and it's + * not any worse than any other choice we could make.) + * + * It is crucial that we don't do the same to the expanded key used in the main + * Eksblowfish loop. By doing it to only one of these two, we deviate from a + * state that could be directly specified by a password to the buggy algorithm + * (and to the fully correct one as well, but that's a side-effect). + */ + initial[0] ^= sign; +} + +static char *BF_crypt(const char *key, const char *setting, + char *output, int size, + BF_word min) +{ +#if BF_ASM + extern void _BF_body_r(BF_ctx *ctx); +#endif + static const unsigned char flags_by_subtype[26] = + {2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0}; + struct { + BF_ctx ctx; + BF_key expanded_key; + union { + BF_word salt[4]; + BF_word output[6]; + } binary; + } data; + BF_word L, R; + BF_word tmp1, tmp2, tmp3, tmp4; + BF_word *ptr; + BF_word count; + int i; + + if (size < 7 + 22 + 31 + 1) { + __set_errno(ERANGE); + return NULL; + } + + if (setting[0] != '$' || + setting[1] != '2' || + setting[2] < 'a' || setting[2] > 'z' || + !flags_by_subtype[(unsigned int)(unsigned char)setting[2] - 'a'] || + setting[3] != '$' || + setting[4] < '0' || setting[4] > '3' || + setting[5] < '0' || setting[5] > '9' || + (setting[4] == '3' && setting[5] > '1') || + setting[6] != '$') { + __set_errno(EINVAL); + return NULL; + } + + count = (BF_word)1 << ((setting[4] - '0') * 10 + (setting[5] - '0')); + if (count < min || BF_decode(data.binary.salt, &setting[7], 16)) { + __set_errno(EINVAL); + return NULL; + } + BF_swap(data.binary.salt, 4); + + BF_set_key(key, data.expanded_key, data.ctx.P, + flags_by_subtype[(unsigned int)(unsigned char)setting[2] - 'a']); + + memcpy(data.ctx.S, BF_init_state.S, sizeof(data.ctx.S)); + + L = R = 0; + for (i = 0; i < BF_N + 2; i += 2) { + L ^= data.binary.salt[i & 2]; + R ^= data.binary.salt[(i & 2) + 1]; + BF_ENCRYPT; + data.ctx.P[i] = L; + data.ctx.P[i + 1] = R; + } + + ptr = data.ctx.S[0]; + do { + ptr += 4; + L ^= data.binary.salt[(BF_N + 2) & 3]; + R ^= data.binary.salt[(BF_N + 3) & 3]; + BF_ENCRYPT; + *(ptr - 4) = L; + *(ptr - 3) = R; + + L ^= data.binary.salt[(BF_N + 4) & 3]; + R ^= data.binary.salt[(BF_N + 5) & 3]; + BF_ENCRYPT; + *(ptr - 2) = L; + *(ptr - 1) = R; + } while (ptr < &data.ctx.S[3][0xFF]); + + do { + int done; + + for (i = 0; i < BF_N + 2; i += 2) { + data.ctx.P[i] ^= data.expanded_key[i]; + data.ctx.P[i + 1] ^= data.expanded_key[i + 1]; + } + + done = 0; + do { + BF_body(); + if (done) + break; + done = 1; + + tmp1 = data.binary.salt[0]; + tmp2 = data.binary.salt[1]; + tmp3 = data.binary.salt[2]; + tmp4 = data.binary.salt[3]; + for (i = 0; i < BF_N; i += 4) { + data.ctx.P[i] ^= tmp1; + data.ctx.P[i + 1] ^= tmp2; + data.ctx.P[i + 2] ^= tmp3; + data.ctx.P[i + 3] ^= tmp4; + } + data.ctx.P[16] ^= tmp1; + data.ctx.P[17] ^= tmp2; + } while (1); + } while (--count); + + for (i = 0; i < 6; i += 2) { + L = BF_magic_w[i]; + R = BF_magic_w[i + 1]; + + count = 64; + do { + BF_ENCRYPT; + } while (--count); + + data.binary.output[i] = L; + data.binary.output[i + 1] = R; + } + + memcpy(output, setting, 7 + 22 - 1); + output[7 + 22 - 1] = BF_itoa64[(int) + BF_atoi64[(int)setting[7 + 22 - 1] - 0x20] & 0x30]; + +/* This has to be bug-compatible with the original implementation, so + * only encode 23 of the 24 bytes. :-) */ + BF_swap(data.binary.output, 6); + BF_encode(&output[7 + 22], data.binary.output, 23); + output[7 + 22 + 31] = '\0'; + + return output; +} + +static int _crypt_output_magic(const char *setting, char *output, int size) +{ + if (size < 3) + return -1; + + output[0] = '*'; + output[1] = '0'; + output[2] = '\0'; + + if (setting[0] == '*' && setting[1] == '0') + output[1] = '1'; + + return 0; +} + +/* + * Please preserve the runtime self-test. It serves two purposes at once: + * + * 1. We really can't afford the risk of producing incompatible hashes e.g. + * when there's something like gcc bug 26587 again, whereas an application or + * library integrating this code might not also integrate our external tests or + * it might not run them after every build. Even if it does, the miscompile + * might only occur on the production build, but not on a testing build (such + * as because of different optimization settings). It is painful to recover + * from incorrectly-computed hashes - merely fixing whatever broke is not + * enough. Thus, a proactive measure like this self-test is needed. + * + * 2. We don't want to leave sensitive data from our actual password hash + * computation on the stack or in registers. Previous revisions of the code + * would do explicit cleanups, but simply running the self-test after hash + * computation is more reliable. + * + * The performance cost of this quick self-test is around 0.6% at the "$2a$08" + * setting. + */ +char *php_crypt_blowfish_rn(const char *key, const char *setting, + char *output, int size) +{ + const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8"; + const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu"; + static const char * const test_hash[2] = + {"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */ + "i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */ + char *retval; + const char *p; + int save_errno, ok; + struct { + char s[7 + 22 + 1]; + char o[7 + 22 + 31 + 1 + 1 + 1]; + } buf; + +/* Hash the supplied password */ + _crypt_output_magic(setting, output, size); + retval = BF_crypt(key, setting, output, size, 16); + save_errno = errno; + +/* + * Do a quick self-test. It is important that we make both calls to BF_crypt() + * from the same scope such that they likely use the same stack locations, + * which makes the second call overwrite the first call's sensitive data on the + * stack and makes it more likely that any alignment related issues would be + * detected by the self-test. + */ + memcpy(buf.s, test_setting, sizeof(buf.s)); + if (retval) + buf.s[2] = setting[2]; + memset(buf.o, 0x55, sizeof(buf.o)); + buf.o[sizeof(buf.o) - 1] = 0; + p = BF_crypt(test_key, buf.s, buf.o, sizeof(buf.o) - (1 + 1), 1); + + ok = (p == buf.o && + !memcmp(p, buf.s, 7 + 22) && + !memcmp(p + (7 + 22), + test_hash[(unsigned int)(unsigned char)buf.s[2] & 1], + 31 + 1 + 1 + 1)); + + { + const char *k = "\xff\xa3" "34" "\xff\xff\xff\xa3" "345"; + BF_key ae, ai, ye, yi; + BF_set_key(k, ae, ai, 2); /* $2a$ */ + BF_set_key(k, ye, yi, 4); /* $2y$ */ + ai[0] ^= 0x10000; /* undo the safety (for comparison) */ + ok = ok && ai[0] == 0xdb9c59bc && ye[17] == 0x33343500 && + !memcmp(ae, ye, sizeof(ae)) && + !memcmp(ai, yi, sizeof(ai)); + } + + __set_errno(save_errno); + if (ok) + return retval; + +/* Should not happen */ + _crypt_output_magic(setting, output, size); + __set_errno(EINVAL); /* pretend we don't support this hash type */ + return NULL; +} + +//#if 0 +char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count, + const char *input, int size, char *output, int output_size) +{ + if (size < 16 || output_size < 7 + 22 + 1 || + (count && (count < 4 || count > 31)) || + prefix[0] != '$' || prefix[1] != '2' || + (prefix[2] != 'a' && prefix[2] != 'y')) { + if (output_size > 0) output[0] = '\0'; + __set_errno((output_size < 7 + 22 + 1) ? ERANGE : EINVAL); + return NULL; + } + + if (!count) count = 5; + + output[0] = '$'; + output[1] = '2'; + output[2] = prefix[2]; + output[3] = '$'; + output[4] = '0' + count / 10; + output[5] = '0' + count % 10; + output[6] = '$'; + + BF_encode(&output[7], (const BF_word *)input, 16); + output[7 + 22] = '\0'; + + return output; +} +//#endif +#ifdef __cplusplus +} +#endif diff --git a/3rdparty/crypt_blowfish.h b/3rdparty/crypt_blowfish.h new file mode 100644 index 0000000..bd122b2 --- /dev/null +++ b/3rdparty/crypt_blowfish.h @@ -0,0 +1,34 @@ +/* $Id$ */ +/* + * Written by Solar Designer in 2000-2011. + * No copyright is claimed, and the software is hereby placed in the public + * domain. In case this attempt to disclaim copyright and place the software + * in the public domain is deemed null and void, then the software is + * Copyright (c) 2000-2011 Solar Designer and it is hereby released to the + * general public under the following terms: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted. + * + * There's ABSOLUTELY NO WARRANTY, express or implied. + * + * See crypt_blowfish.c for more information. + */ + +#ifndef _CRYPT_BLOWFISH_H +#define _CRYPT_BLOWFISH_H + + +#ifdef __cplusplus +extern "C" { +#endif +unsigned char *php_base64_encode(const unsigned char *str, int length, int *ret_length); +int password_hash(const char *pass, int cost, char *crpt); +extern char *php_crypt_blowfish_rn(const char *key, const char *setting, char *output, int size); +char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count, + const char *input, int size, char *output, int output_size); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/3rdparty/crypto.cc b/3rdparty/crypto.cc new file mode 100644 index 0000000..dc516c1 --- /dev/null +++ b/3rdparty/crypto.cc @@ -0,0 +1,82 @@ +#include +#include +#include +#include + +#include +#include + +using namespace std; +int calcDecodeLength(const char *b64input, const size_t length) { + int padding = 0; + + // Check for trailing '=''s as padding + if(b64input[length-1] == '=' && b64input[length-2] == '=') + padding = 2; + else if (b64input[length-1] == '=') + padding = 1; + + return (int)length*0.75 - padding; +} + +char* base64_encode(const char *message, const size_t length) { + + BIO *bio; + BIO *b64; + FILE* stream; + + int encodedSize = 4*ceil((double)length/3); + char *buffer = (char*)malloc(encodedSize+1); + if(buffer == NULL) { + fprintf(stderr, "Failed to allocate memory\n"); + exit(1); + } + + stream = fmemopen(buffer, encodedSize+1, "w"); + b64 = BIO_new(BIO_f_base64()); + bio = BIO_new_fp(stream, BIO_NOCLOSE); + bio = BIO_push(b64, bio); + BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL); + BIO_write(bio, message, length); + (void)BIO_flush(bio); + BIO_free_all(bio); + fclose(stream); + + return buffer; +} +int base64_decode(const char *b64message, const size_t length, unsigned char **buffer) { + BIO *bio; + BIO *b64; + int decodedLength = calcDecodeLength(b64message, length); + + *buffer = (unsigned char*)malloc(decodedLength+1); + if(*buffer == NULL) { + fprintf(stderr, "Failed to allocate memory\n"); + exit(1); + } + FILE* stream = fmemopen((char*)b64message, length, "r"); + + b64 = BIO_new(BIO_f_base64()); + bio = BIO_new_fp(stream, BIO_NOCLOSE); + bio = BIO_push(b64, bio); + BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL); + decodedLength = BIO_read(bio, *buffer, length); + (*buffer)[decodedLength] = '\0'; + + BIO_free_all(bio); + fclose(stream); + + return decodedLength; +} + +int main(int argc, char * argv[]) { + + const char *message; + if(argc > 1) { + message = argv[1]; + } else { + message = "This isjlakjsdflkjalsfjasdlfjasdldjf a message."; +} + cout << base64_encode(message, strlen(message)) << endl; + return 0; +} diff --git a/3rdparty/hash.cc b/3rdparty/hash.cc new file mode 100644 index 0000000..c281676 --- /dev/null +++ b/3rdparty/hash.cc @@ -0,0 +1,185 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "crypt_blowfish.h" + +#define BF_MAX_SALT_LEN 60 +#define RANDBYTES 16 +static const char base64_table[] = + { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '\0' + }; + +static const char base64_pad = '='; + +unsigned char *php_base64_encode(const unsigned char *str, int length, int *ret_length) +{ + const unsigned char *current = str; + unsigned char *p; + unsigned char *result; + + if ((length + 2) < 0 || ((length + 2) / 3) >= (1 << (sizeof(int) * 8 - 2))) { + if (ret_length != NULL) { + *ret_length = 0; + } + return NULL; + } + + result = (unsigned char *)malloc(((length + 2) / 3) * 4); + p = result; + + while (length > 2) { /* keep going until we have less than 24 bits */ + *p++ = base64_table[current[0] >> 2]; + *p++ = base64_table[((current[0] & 0x03) << 4) + (current[1] >> 4)]; + *p++ = base64_table[((current[1] & 0x0f) << 2) + (current[2] >> 6)]; + *p++ = base64_table[current[2] & 0x3f]; + + current += 3; + length -= 3; /* we just handle 3 octets of data */ + } + + /* now deal with the tail end of things */ + if (length != 0) { + *p++ = base64_table[current[0] >> 2]; + if (length > 1) { + *p++ = base64_table[((current[0] & 0x03) << 4) + (current[1] >> 4)]; + *p++ = base64_table[(current[1] & 0x0f) << 2]; + *p++ = base64_pad; + } else { + *p++ = base64_table[(current[0] & 0x03) << 4]; + *p++ = base64_pad; + *p++ = base64_pad; + } + } + if (ret_length != NULL) { + *ret_length = (int)(p - result); + } + *p = '\0'; + return result; +} +static int php_password_salt_to64(const char *str, const size_t str_len, const size_t out_len, char *ret) +{ + size_t pos = 0; + size_t ret_len = 0; + unsigned char *buffer; + if ((int) str_len < 0) { + return 1; + } + buffer = php_base64_encode((unsigned char*) str, (int) str_len, (int*) &ret_len); + if (ret_len < out_len) { + /* Too short of an encoded string generated */ + free(buffer); + return 1; + } + for (pos = 0; pos < out_len; pos++) { + if (buffer[pos] == '+') { + ret[pos] = '.'; + } else if (buffer[pos] == '=') { + free(buffer); + return 1; + } else { + ret[pos] = buffer[pos]; + } + } + free(buffer); + return 0; +} +static int blowfish_make_salt(size_t length, char *ret) +{ + int buffer_valid = 0; + size_t i, raw_length; + char *buffer; + char *result; + + if (length > (INT_MAX / 3)) { + perror("Length is too large to safely generate"); + return 1; + } + + raw_length = length * 3 / 4 + 1; + + buffer = (char*)malloc(raw_length); + + { + int fd, n; + size_t read_bytes = 0; + fd = open("/dev/urandom", O_RDONLY); + if (fd >= 0) { + while (read_bytes < raw_length) { + n = read(fd, buffer + read_bytes, raw_length - read_bytes); + if (n < 0) { + break; + } + read_bytes += (size_t) n; + } + close(fd); + } + if (read_bytes >= raw_length) { + buffer_valid = 1; + } + } + if (!buffer_valid) { + for (i = 0; i < raw_length; i++) { + buffer[i] ^= (char) (255.0 * rand() / RAND_MAX); + } + } + + result = (char*)malloc(length); + + if (php_password_salt_to64(buffer, raw_length, length, result) == 1) { + perror("Generated salt too short"); + free(buffer); + free(result); + return 1; + } + memcpy(ret, result, length); + free(result); + free(buffer); + ret[length] = 0; + return 0; +} +int password_hash(const char *pass, int cost, char *crpt) +{ + static long required_salt_len = 22; + char *newsalt,*output, *final; + char crypted[BF_MAX_SALT_LEN +1]; + char salt[required_salt_len]; + + output = (char*)malloc(32); + memset(crypted, 0, BF_MAX_SALT_LEN + 1); + blowfish_make_salt(required_salt_len, salt); + newsalt = _crypt_gensalt_blowfish_rn("$2y$", cost, salt, required_salt_len, output, 30); + + final = php_crypt_blowfish_rn(pass, newsalt, crypted, sizeof(crypted)); + + free(output); + strcpy(crpt,final); + + return 0; +} +#ifdef BCRYPT_TEST +int main(int argc, char * argv[]) { + char * hash; + const char * pass = "testpassword"; + int ret; + hash = (char*)malloc(BF_MAX_SALT_LEN +1); + if(argc > 1) { + ret = password_hash(argv[1], 10, hash); + + } else { + ret = password_hash(pass,10, hash); + } + + printf("hash : %s\n",hash); + free(hash); + return 0; +} +#endif diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt.so b/3rdparty/libbcrypt-1.0/bin/bcrypt.so new file mode 100755 index 0000000..721ff71 Binary files /dev/null and b/3rdparty/libbcrypt-1.0/bin/bcrypt.so differ diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_bcrypt.d b/3rdparty/libbcrypt-1.0/bin/bcrypt_bcrypt.d new file mode 100644 index 0000000..0df3e64 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/bin/bcrypt_bcrypt.d @@ -0,0 +1,5 @@ +../../bin/bcrypt_bcrypt.o: ../../source/src/bcrypt.c \ + ../../source/include/bcrypt.h ../../source/include/includes.h \ + ../../source/include/defines.h ../../source/include/functions.h \ + ../../source/include/includes.h ../../source/include/blowfish.h \ + ../../source/include/config.h diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_bcrypt.o b/3rdparty/libbcrypt-1.0/bin/bcrypt_bcrypt.o new file mode 100644 index 0000000..b880876 Binary files /dev/null and b/3rdparty/libbcrypt-1.0/bin/bcrypt_bcrypt.o differ diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_blowfish.d b/3rdparty/libbcrypt-1.0/bin/bcrypt_blowfish.d new file mode 100644 index 0000000..73ca94d --- /dev/null +++ b/3rdparty/libbcrypt-1.0/bin/bcrypt_blowfish.d @@ -0,0 +1,3 @@ +../../bin/bcrypt_blowfish.o: ../../source/src/blowfish.c \ + ../../source/include/includes.h ../../source/include/defines.h \ + ../../source/include/blowfish.h diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_blowfish.o b/3rdparty/libbcrypt-1.0/bin/bcrypt_blowfish.o new file mode 100644 index 0000000..9170c27 Binary files /dev/null and b/3rdparty/libbcrypt-1.0/bin/bcrypt_blowfish.o differ diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_endian.d b/3rdparty/libbcrypt-1.0/bin/bcrypt_endian.d new file mode 100644 index 0000000..8cdd9bb --- /dev/null +++ b/3rdparty/libbcrypt-1.0/bin/bcrypt_endian.d @@ -0,0 +1,4 @@ +../../bin/bcrypt_endian.o: ../../source/src/endian.c \ + ../../source/include/includes.h ../../source/include/defines.h \ + ../../source/include/functions.h ../../source/include/includes.h \ + ../../source/include/blowfish.h diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_endian.o b/3rdparty/libbcrypt-1.0/bin/bcrypt_endian.o new file mode 100644 index 0000000..b8d925a Binary files /dev/null and b/3rdparty/libbcrypt-1.0/bin/bcrypt_endian.o differ diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_keys.d b/3rdparty/libbcrypt-1.0/bin/bcrypt_keys.d new file mode 100644 index 0000000..e2d36b8 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/bin/bcrypt_keys.d @@ -0,0 +1,4 @@ +../../bin/bcrypt_keys.o: ../../source/src/keys.c \ + ../../source/include/includes.h ../../source/include/defines.h \ + ../../source/include/functions.h ../../source/include/includes.h \ + ../../source/include/blowfish.h diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_keys.o b/3rdparty/libbcrypt-1.0/bin/bcrypt_keys.o new file mode 100644 index 0000000..b808f0c Binary files /dev/null and b/3rdparty/libbcrypt-1.0/bin/bcrypt_keys.o differ diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_rwfile.d b/3rdparty/libbcrypt-1.0/bin/bcrypt_rwfile.d new file mode 100644 index 0000000..ffb6d7f --- /dev/null +++ b/3rdparty/libbcrypt-1.0/bin/bcrypt_rwfile.d @@ -0,0 +1,4 @@ +../../bin/bcrypt_rwfile.o: ../../source/src/rwfile.c \ + ../../source/include/includes.h ../../source/include/defines.h \ + ../../source/include/functions.h ../../source/include/includes.h \ + ../../source/include/blowfish.h diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_rwfile.o b/3rdparty/libbcrypt-1.0/bin/bcrypt_rwfile.o new file mode 100644 index 0000000..d9acdf6 Binary files /dev/null and b/3rdparty/libbcrypt-1.0/bin/bcrypt_rwfile.o differ diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_wrapbf.d b/3rdparty/libbcrypt-1.0/bin/bcrypt_wrapbf.d new file mode 100644 index 0000000..1c4d5f6 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/bin/bcrypt_wrapbf.d @@ -0,0 +1,4 @@ +../../bin/bcrypt_wrapbf.o: ../../source/src/wrapbf.c \ + ../../source/include/includes.h ../../source/include/defines.h \ + ../../source/include/functions.h ../../source/include/includes.h \ + ../../source/include/blowfish.h diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_wrapbf.o b/3rdparty/libbcrypt-1.0/bin/bcrypt_wrapbf.o new file mode 100644 index 0000000..ab8b606 Binary files /dev/null and b/3rdparty/libbcrypt-1.0/bin/bcrypt_wrapbf.o differ diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_wrapzl.d b/3rdparty/libbcrypt-1.0/bin/bcrypt_wrapzl.d new file mode 100644 index 0000000..98c37b7 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/bin/bcrypt_wrapzl.d @@ -0,0 +1,4 @@ +../../bin/bcrypt_wrapzl.o: ../../source/src/wrapzl.c \ + ../../source/include/includes.h ../../source/include/defines.h \ + ../../source/include/functions.h ../../source/include/includes.h \ + ../../source/include/blowfish.h diff --git a/3rdparty/libbcrypt-1.0/bin/bcrypt_wrapzl.o b/3rdparty/libbcrypt-1.0/bin/bcrypt_wrapzl.o new file mode 100644 index 0000000..2d9cd2f Binary files /dev/null and b/3rdparty/libbcrypt-1.0/bin/bcrypt_wrapzl.o differ diff --git a/3rdparty/libbcrypt-1.0/build/unix/INSTALL b/3rdparty/libbcrypt-1.0/build/unix/INSTALL new file mode 100644 index 0000000..b42a17a --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/INSTALL @@ -0,0 +1,182 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/3rdparty/libbcrypt-1.0/build/unix/Makefile b/3rdparty/libbcrypt-1.0/build/unix/Makefile new file mode 100644 index 0000000..19e583f --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/Makefile @@ -0,0 +1,99 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.2 (http://bakefile.sourceforge.net) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + + + +prefix = /usr/local +exec_prefix = ${prefix} +INSTALL = /usr/bin/install -c +SHARED_LD_MODULE_CC = $(CC) -shared -fPIC -o +SO_SUFFIX_MODULE = so +PIC_FLAG = -fPIC -DPIC +STRIP = strip +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DIR = $(INSTALL) -d +BK_DEPS = /home/eric/code/hathor/3rdparty/libbcrypt-1.0/build/unix/bk-deps +DLLPREFIX_MODULE = +LIBS = +CC = gcc +CFLAGS = -g -O2 +CPPFLAGS = +LDFLAGS = + +### Variables: ### + +DESTDIR = +BCRYPT_CFLAGS = -I../../source/include $(PIC_FLAG) $(CPPFLAGS) $(CFLAGS) +BCRYPT_OBJECTS = \ + ../../bin/bcrypt_bcrypt.o \ + ../../bin/bcrypt_blowfish.o \ + ../../bin/bcrypt_endian.o \ + ../../bin/bcrypt_keys.o \ + ../../bin/bcrypt_rwfile.o \ + ../../bin/bcrypt_wrapbf.o \ + ../../bin/bcrypt_wrapzl.o + +### Conditionally set variables: ### + +CCC = $(BK_DEPS) $(CC) +#CCC = $(CC) + +### Targets: ### + +all: ../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE) + +install: all install_bcrypt + +uninstall: uninstall_bcrypt + +install-strip: install + $(STRIP) $(DESTDIR)/usr/local/lib/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE) + +clean: + rm -rf ../../bin/.deps ../../bin/.pch + rm -f ../../bin/*.o + rm -f ../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE) + +distclean: clean + rm -f config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile + +../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE): $(BCRYPT_OBJECTS) + $(SHARED_LD_MODULE_CC) $@ $(BCRYPT_OBJECTS) $(LDFLAGS) $(LIBS) + +install_bcrypt: + $(INSTALL_DIR) $(DESTDIR)/usr/local/lib + $(INSTALL_PROGRAM) ../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE) $(DESTDIR)/usr/local/lib + +uninstall_bcrypt: + rm -f $(DESTDIR)/usr/local/lib/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE) + +../../bin/bcrypt_bcrypt.o: ../../source/src/bcrypt.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/bcrypt.c + +../../bin/bcrypt_blowfish.o: ../../source/src/blowfish.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/blowfish.c + +../../bin/bcrypt_endian.o: ../../source/src/endian.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/endian.c + +../../bin/bcrypt_keys.o: ../../source/src/keys.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/keys.c + +../../bin/bcrypt_rwfile.o: ../../source/src/rwfile.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/rwfile.c + +../../bin/bcrypt_wrapbf.o: ../../source/src/wrapbf.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/wrapbf.c + +../../bin/bcrypt_wrapzl.o: ../../source/src/wrapzl.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/wrapzl.c + + +# Include dependency info, if present: +-include .deps/*.d + +.PHONY: all install uninstall clean distclean install_bcrypt uninstall_bcrypt diff --git a/3rdparty/libbcrypt-1.0/build/unix/Makefile.in b/3rdparty/libbcrypt-1.0/build/unix/Makefile.in new file mode 100644 index 0000000..6f9ce72 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/Makefile.in @@ -0,0 +1,99 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.2 (http://bakefile.sourceforge.net) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + +@MAKE_SET@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +INSTALL = @INSTALL@ +SHARED_LD_MODULE_CC = @SHARED_LD_MODULE_CC@ +SO_SUFFIX_MODULE = @SO_SUFFIX_MODULE@ +PIC_FLAG = @PIC_FLAG@ +STRIP = @STRIP@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DIR = @INSTALL_DIR@ +BK_DEPS = @BK_DEPS@ +DLLPREFIX_MODULE = @DLLPREFIX_MODULE@ +LIBS = @LIBS@ +CC = @CC@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ + +### Variables: ### + +DESTDIR = +BCRYPT_CFLAGS = -I../../source/include $(PIC_FLAG) $(CPPFLAGS) $(CFLAGS) +BCRYPT_OBJECTS = \ + ../../bin/bcrypt_bcrypt.o \ + ../../bin/bcrypt_blowfish.o \ + ../../bin/bcrypt_endian.o \ + ../../bin/bcrypt_keys.o \ + ../../bin/bcrypt_rwfile.o \ + ../../bin/bcrypt_wrapbf.o \ + ../../bin/bcrypt_wrapzl.o + +### Conditionally set variables: ### + +@COND_DEPS_TRACKING_1@CCC = $(BK_DEPS) $(CC) +@COND_DEPS_TRACKING_0@CCC = $(CC) + +### Targets: ### + +all: ../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE) + +install: all install_bcrypt + +uninstall: uninstall_bcrypt + +install-strip: install + $(STRIP) $(DESTDIR)/usr/local/lib/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE) + +clean: + rm -rf ../../bin/.deps ../../bin/.pch + rm -f ../../bin/*.o + rm -f ../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE) + +distclean: clean + rm -f config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile + +../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE): $(BCRYPT_OBJECTS) + $(SHARED_LD_MODULE_CC) $@ $(BCRYPT_OBJECTS) $(LDFLAGS) $(LIBS) + +install_bcrypt: + $(INSTALL_DIR) $(DESTDIR)/usr/local/lib + $(INSTALL_PROGRAM) ../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE) $(DESTDIR)/usr/local/lib + +uninstall_bcrypt: + rm -f $(DESTDIR)/usr/local/lib/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE) + +../../bin/bcrypt_bcrypt.o: ../../source/src/bcrypt.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/bcrypt.c + +../../bin/bcrypt_blowfish.o: ../../source/src/blowfish.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/blowfish.c + +../../bin/bcrypt_endian.o: ../../source/src/endian.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/endian.c + +../../bin/bcrypt_keys.o: ../../source/src/keys.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/keys.c + +../../bin/bcrypt_rwfile.o: ../../source/src/rwfile.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/rwfile.c + +../../bin/bcrypt_wrapbf.o: ../../source/src/wrapbf.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/wrapbf.c + +../../bin/bcrypt_wrapzl.o: ../../source/src/wrapzl.c + $(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/wrapzl.c + + +# Include dependency info, if present: +@IF_GNU_MAKE@-include .deps/*.d + +.PHONY: all install uninstall clean distclean install_bcrypt uninstall_bcrypt diff --git a/3rdparty/libbcrypt-1.0/build/unix/aclocal.m4 b/3rdparty/libbcrypt-1.0/build/unix/aclocal.m4 new file mode 100644 index 0000000..5605408 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/aclocal.m4 @@ -0,0 +1,1625 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +AC_DEFUN([AC_BAKEFILE_CREATE_FILE_DLLAR_SH], +[ +dnl ===================== dllar.sh begins here ===================== +dnl (Created by merge-scripts.py from dllar.sh +dnl file do not edit here!) +D='$' +cat <dllar.sh +#!/bin/sh +# +# dllar - a tool to build both a .dll and an .a file +# from a set of object (.o) files for EMX/OS2. +# +# Written by Andrew Zabolotny, bit@freya.etu.ru +# Ported to Unix like shell by Stefan Neis, Stefan.Neis@t-online.de +# +# This script will accept a set of files on the command line. +# All the public symbols from the .o files will be exported into +# a .DEF file, then linker will be run (through gcc) against them to +# build a shared library consisting of all given .o files. All libraries +# (.a) will be first decompressed into component .o files then act as +# described above. You can optionally give a description (-d "description") +# which will be put into .DLL. To see the list of accepted options (as well +# as command-line format) simply run this program without options. The .DLL +# is built to be imported by name (there is no guarantee that new versions +# of the library you build will have same ordinals for same symbols). +# +# dllar is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# dllar is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dllar; see the file COPYING. If not, write to the Free +# Software Foundation, 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# To successfuly run this program you will need: +# - Current drive should have LFN support (HPFS, ext2, network, etc) +# (Sometimes dllar generates filenames which won't fit 8.3 scheme) +# - gcc +# (used to build the .dll) +# - emxexp +# (used to create .def file from .o files) +# - emximp +# (used to create .a file from .def file) +# - GNU text utilites (cat, sort, uniq) +# used to process emxexp output +# - GNU file utilities (mv, rm) +# - GNU sed +# - lxlite (optional, see flag below) +# (used for general .dll cleanup) +# + +flag_USE_LXLITE=1; + +# +# helper functions +# basnam, variant of basename, which does _not_ remove the path, _iff_ +# second argument (suffix to remove) is given +basnam(){ + case ${D}# in + 1) + echo ${D}1 | sed 's/.*\\///' | sed 's/.*\\\\//' + ;; + 2) + echo ${D}1 | sed 's/'${D}2'${D}//' + ;; + *) + echo "error in basnam ${D}*" + exit 8 + ;; + esac +} + +# Cleanup temporary files and output +CleanUp() { + cd ${D}curDir + for i in ${D}inputFiles ; do + case ${D}i in + *!) + rm -rf \`basnam ${D}i !\` + ;; + *) + ;; + esac + done + + # Kill result in case of failure as there is just to many stupid make/nmake + # things out there which doesn't do this. + if @<:@ ${D}# -eq 0 @:>@; then + rm -f ${D}arcFile ${D}arcFile2 ${D}defFile ${D}dllFile + fi +} + +# Print usage and exit script with rc=1. +PrintHelp() { + echo 'Usage: dllar.sh @<:@-o@<:@utput@:>@ output_file@:>@ @<:@-i@<:@mport@:>@ importlib_name@:>@' + echo ' @<:@-name-mangler-script script.sh@:>@' + echo ' @<:@-d@<:@escription@:>@ "dll descrption"@:>@ @<:@-cc "CC"@:>@ @<:@-f@<:@lags@:>@ "CFLAGS"@:>@' + echo ' @<:@-ord@<:@inals@:>@@:>@ -ex@<:@clude@:>@ "symbol(s)"' + echo ' @<:@-libf@<:@lags@:>@ "{INIT|TERM}{GLOBAL|INSTANCE}"@:>@ @<:@-nocrt@<:@dll@:>@@:>@ @<:@-nolxl@<:@ite@:>@@:>@' + echo ' @<:@*.o@:>@ @<:@*.a@:>@' + echo '*> "output_file" should have no extension.' + echo ' If it has the .o, .a or .dll extension, it is automatically removed.' + echo ' The import library name is derived from this and is set to "name".a,' + echo ' unless overridden by -import' + echo '*> "importlib_name" should have no extension.' + echo ' If it has the .o, or .a extension, it is automatically removed.' + echo ' This name is used as the import library name and may be longer and' + echo ' more descriptive than the DLL name which has to follow the old ' + echo ' 8.3 convention of FAT.' + echo '*> "script.sh may be given to override the output_file name by a' + echo ' different name. It is mainly useful if the regular make process' + echo ' of some package does not take into account OS/2 restriction of' + echo ' DLL name lengths. It takes the importlib name as input and is' + echo ' supposed to procude a shorter name as output. The script should' + echo ' expect to get importlib_name without extension and should produce' + echo ' a (max.) 8 letter name without extension.' + echo '*> "cc" is used to use another GCC executable. (default: gcc.exe)' + echo '*> "flags" should be any set of valid GCC flags. (default: -s -Zcrtdll)' + echo ' These flags will be put at the start of GCC command line.' + echo '*> -ord@<:@inals@:>@ tells dllar to export entries by ordinals. Be careful.' + echo '*> -ex@<:@clude@:>@ defines symbols which will not be exported. You can define' + echo ' multiple symbols, for example -ex "myfunc yourfunc _GLOBAL*".' + echo ' If the last character of a symbol is "*", all symbols beginning' + echo ' with the prefix before "*" will be exclude, (see _GLOBAL* above).' + echo '*> -libf@<:@lags@:>@ can be used to add INITGLOBAL/INITINSTANCE and/or' + echo ' TERMGLOBAL/TERMINSTANCE flags to the dynamically-linked library.' + echo '*> -nocrt@<:@dll@:>@ switch will disable linking the library against emx''s' + echo ' C runtime DLLs.' + echo '*> -nolxl@<:@ite@:>@ switch will disable running lxlite on the resulting DLL.' + echo '*> All other switches (for example -L./ or -lmylib) will be passed' + echo ' unchanged to GCC at the end of command line.' + echo '*> If you create a DLL from a library and you do not specify -o,' + echo ' the basename for DLL and import library will be set to library name,' + echo ' the initial library will be renamed to 'name'_s.a (_s for static)' + echo ' i.e. "dllar gcc.a" will create gcc.dll and gcc.a, and the initial' + echo ' library will be renamed into gcc_s.a.' + echo '--------' + echo 'Example:' + echo ' dllar -o gcc290.dll libgcc.a -d "GNU C runtime library" -ord' + echo ' -ex "__main __ctordtor*" -libf "INITINSTANCE TERMINSTANCE"' + CleanUp + exit 1 +} + +# Execute a command. +# If exit code of the commnad <> 0 CleanUp() is called and we'll exit the script. +# @Uses Whatever CleanUp() uses. +doCommand() { + echo "${D}*" + eval ${D}* + rcCmd=${D}? + + if @<:@ ${D}rcCmd -ne 0 @:>@; then + echo "command failed, exit code="${D}rcCmd + CleanUp + exit ${D}rcCmd + fi +} + +# main routine +# setup globals +cmdLine=${D}* +outFile="" +outimpFile="" +inputFiles="" +renameScript="" +description="" +CC=gcc.exe +CFLAGS="-s -Zcrtdll" +EXTRA_CFLAGS="" +EXPORT_BY_ORDINALS=0 +exclude_symbols="" +library_flags="" +curDir=\`pwd\` +curDirS=curDir +case ${D}curDirS in +*/) + ;; +*) + curDirS=${D}{curDirS}"/" + ;; +esac +# Parse commandline +libsToLink=0 +omfLinking=0 +while @<:@ ${D}1 @:>@; do + case ${D}1 in + -ord*) + EXPORT_BY_ORDINALS=1; + ;; + -o*) + shift + outFile=${D}1 + ;; + -i*) + shift + outimpFile=${D}1 + ;; + -name-mangler-script) + shift + renameScript=${D}1 + ;; + -d*) + shift + description=${D}1 + ;; + -f*) + shift + CFLAGS=${D}1 + ;; + -c*) + shift + CC=${D}1 + ;; + -h*) + PrintHelp + ;; + -ex*) + shift + exclude_symbols=${D}{exclude_symbols}${D}1" " + ;; + -libf*) + shift + library_flags=${D}{library_flags}${D}1" " + ;; + -nocrt*) + CFLAGS="-s" + ;; + -nolxl*) + flag_USE_LXLITE=0 + ;; + -* | /*) + case ${D}1 in + -L* | -l*) + libsToLink=1 + ;; + -Zomf) + omfLinking=1 + ;; + *) + ;; + esac + EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1 + ;; + *.dll) + EXTRA_CFLAGS="${D}{EXTRA_CFLAGS} \`basnam ${D}1 .dll\`" + if @<:@ ${D}omfLinking -eq 1 @:>@; then + EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.lib" + else + EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.a" + fi + ;; + *) + found=0; + if @<:@ ${D}libsToLink -ne 0 @:>@; then + EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1 + else + for file in ${D}1 ; do + if @<:@ -f ${D}file @:>@; then + inputFiles="${D}{inputFiles} ${D}file" + found=1 + fi + done + if @<:@ ${D}found -eq 0 @:>@; then + echo "ERROR: No file(s) found: "${D}1 + exit 8 + fi + fi + ;; + esac + shift +done # iterate cmdline words + +# +if @<:@ -z "${D}inputFiles" @:>@; then + echo "dllar: no input files" + PrintHelp +fi + +# Now extract all .o files from .a files +newInputFiles="" +for file in ${D}inputFiles ; do + case ${D}file in + *.a | *.lib) + case ${D}file in + *.a) + suffix=".a" + AR="ar" + ;; + *.lib) + suffix=".lib" + AR="emxomfar" + EXTRA_CFLAGS="${D}EXTRA_CFLAGS -Zomf" + ;; + *) + ;; + esac + dirname=\`basnam ${D}file ${D}suffix\`"_%" + mkdir ${D}dirname + if @<:@ ${D}? -ne 0 @:>@; then + echo "Failed to create subdirectory ./${D}dirname" + CleanUp + exit 8; + fi + # Append '!' to indicate archive + newInputFiles="${D}newInputFiles ${D}{dirname}!" + doCommand "cd ${D}dirname; ${D}AR x ../${D}file" + cd ${D}curDir + found=0; + for subfile in ${D}dirname/*.o* ; do + if @<:@ -f ${D}subfile @:>@; then + found=1 + if @<:@ -s ${D}subfile @:>@; then + # FIXME: This should be: is file size > 32 byte, _not_ > 0! + newInputFiles="${D}newInputFiles ${D}subfile" + fi + fi + done + if @<:@ ${D}found -eq 0 @:>@; then + echo "WARNING: there are no files in archive \\'${D}file\\'" + fi + ;; + *) + newInputFiles="${D}{newInputFiles} ${D}file" + ;; + esac +done +inputFiles="${D}newInputFiles" + +# Output filename(s). +do_backup=0; +if @<:@ -z ${D}outFile @:>@; then + do_backup=1; + set outFile ${D}inputFiles; outFile=${D}2 +fi + +# If it is an archive, remove the '!' and the '_%' suffixes +case ${D}outFile in +*_%!) + outFile=\`basnam ${D}outFile _%!\` + ;; +*) + ;; +esac +case ${D}outFile in +*.dll) + outFile=\`basnam ${D}outFile .dll\` + ;; +*.DLL) + outFile=\`basnam ${D}outFile .DLL\` + ;; +*.o) + outFile=\`basnam ${D}outFile .o\` + ;; +*.obj) + outFile=\`basnam ${D}outFile .obj\` + ;; +*.a) + outFile=\`basnam ${D}outFile .a\` + ;; +*.lib) + outFile=\`basnam ${D}outFile .lib\` + ;; +*) + ;; +esac +case ${D}outimpFile in +*.a) + outimpFile=\`basnam ${D}outimpFile .a\` + ;; +*.lib) + outimpFile=\`basnam ${D}outimpFile .lib\` + ;; +*) + ;; +esac +if @<:@ -z ${D}outimpFile @:>@; then + outimpFile=${D}outFile +fi +defFile="${D}{outFile}.def" +arcFile="${D}{outimpFile}.a" +arcFile2="${D}{outimpFile}.lib" + +#create ${D}dllFile as something matching 8.3 restrictions, +if @<:@ -z ${D}renameScript @:>@ ; then + dllFile="${D}outFile" +else + dllFile=\`${D}renameScript ${D}outimpFile\` +fi + +if @<:@ ${D}do_backup -ne 0 @:>@ ; then + if @<:@ -f ${D}arcFile @:>@ ; then + doCommand "mv ${D}arcFile ${D}{outFile}_s.a" + fi + if @<:@ -f ${D}arcFile2 @:>@ ; then + doCommand "mv ${D}arcFile2 ${D}{outFile}_s.lib" + fi +fi + +# Extract public symbols from all the object files. +tmpdefFile=${D}{defFile}_% +rm -f ${D}tmpdefFile +for file in ${D}inputFiles ; do + case ${D}file in + *!) + ;; + *) + doCommand "emxexp -u ${D}file >> ${D}tmpdefFile" + ;; + esac +done + +# Create the def file. +rm -f ${D}defFile +echo "LIBRARY \`basnam ${D}dllFile\` ${D}library_flags" >> ${D}defFile +dllFile="${D}{dllFile}.dll" +if @<:@ ! -z ${D}description @:>@; then + echo "DESCRIPTION \\"${D}{description}\\"" >> ${D}defFile +fi +echo "EXPORTS" >> ${D}defFile + +doCommand "cat ${D}tmpdefFile | sort.exe | uniq.exe > ${D}{tmpdefFile}%" +grep -v "^ *;" < ${D}{tmpdefFile}% | grep -v "^ *${D}" >${D}tmpdefFile + +# Checks if the export is ok or not. +for word in ${D}exclude_symbols; do + grep -v ${D}word < ${D}tmpdefFile >${D}{tmpdefFile}% + mv ${D}{tmpdefFile}% ${D}tmpdefFile +done + + +if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then + sed "=" < ${D}tmpdefFile | \\ + sed ' + N + : loop + s/^\\(@<:@0-9@:>@\\+\\)\\(@<:@^;@:>@*\\)\\(;.*\\)\\?/\\2 @\\1 NONAME/ + t loop + ' > ${D}{tmpdefFile}% + grep -v "^ *${D}" < ${D}{tmpdefFile}% > ${D}tmpdefFile +else + rm -f ${D}{tmpdefFile}% +fi +cat ${D}tmpdefFile >> ${D}defFile +rm -f ${D}tmpdefFile + +# Do linking, create implib, and apply lxlite. +gccCmdl=""; +for file in ${D}inputFiles ; do + case ${D}file in + *!) + ;; + *) + gccCmdl="${D}gccCmdl ${D}file" + ;; + esac +done +doCommand "${D}CC ${D}CFLAGS -Zdll -o ${D}dllFile ${D}defFile ${D}gccCmdl ${D}EXTRA_CFLAGS" +touch "${D}{outFile}.dll" + +doCommand "emximp -o ${D}arcFile ${D}defFile" +if @<:@ ${D}flag_USE_LXLITE -ne 0 @:>@; then + add_flags=""; + if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then + add_flags="-ynd" + fi + doCommand "lxlite -cs -t: -mrn -mln ${D}add_flags ${D}dllFile" +fi +doCommand "emxomf -s -l ${D}arcFile" + +# Successful exit. +CleanUp 1 +exit 0 +EOF +dnl ===================== dllar.sh ends here ===================== +]) + +dnl +dnl This file is part of Bakefile (http://bakefile.sourceforge.net) +dnl +dnl Copyright (C) 2003-2007 Vaclav Slavik and others +dnl +dnl Permission is hereby granted, free of charge, to any person obtaining a +dnl copy of this software and associated documentation files (the "Software"), +dnl to deal in the Software without restriction, including without limitation +dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, +dnl and/or sell copies of the Software, and to permit persons to whom the +dnl Software is furnished to do so, subject to the following conditions: +dnl +dnl The above copyright notice and this permission notice shall be included in +dnl all copies or substantial portions of the Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +dnl DEALINGS IN THE SOFTWARE. +dnl +dnl $Id: bakefile.m4 1007 2007-02-03 16:26:30Z vaclavslavik $ +dnl +dnl Support macros for makefiles generated by BAKEFILE. +dnl + + +dnl --------------------------------------------------------------------------- +dnl Lots of compiler & linker detection code contained here was taken from +dnl wxWidgets configure.in script (see http://www.wxwidgets.org) +dnl --------------------------------------------------------------------------- + + + +dnl --------------------------------------------------------------------------- +dnl AC_BAKEFILE_GNUMAKE +dnl +dnl Detects GNU make +dnl --------------------------------------------------------------------------- + +AC_DEFUN([AC_BAKEFILE_GNUMAKE], +[ + dnl does make support "-include" (only GNU make does AFAIK)? + AC_CACHE_CHECK([if make is GNU make], bakefile_cv_prog_makeisgnu, + [ + if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null | + egrep -s GNU > /dev/null); then + bakefile_cv_prog_makeisgnu="yes" + else + bakefile_cv_prog_makeisgnu="no" + fi + ]) + + if test "x$bakefile_cv_prog_makeisgnu" = "xyes"; then + IF_GNU_MAKE="" + else + IF_GNU_MAKE="#" + fi + AC_SUBST(IF_GNU_MAKE) +]) + +dnl --------------------------------------------------------------------------- +dnl AC_BAKEFILE_PLATFORM +dnl +dnl Detects platform and sets PLATFORM_XXX variables accordingly +dnl --------------------------------------------------------------------------- + +AC_DEFUN([AC_BAKEFILE_PLATFORM], +[ + PLATFORM_UNIX=0 + PLATFORM_WIN32=0 + PLATFORM_MSDOS=0 + PLATFORM_MAC=0 + PLATFORM_MACOS=0 + PLATFORM_MACOSX=0 + PLATFORM_OS2=0 + PLATFORM_BEOS=0 + + if test "x$BAKEFILE_FORCE_PLATFORM" = "x"; then + case "${BAKEFILE_HOST}" in + *-*-mingw32* ) + PLATFORM_WIN32=1 + ;; + *-pc-msdosdjgpp ) + PLATFORM_MSDOS=1 + ;; + *-pc-os2_emx | *-pc-os2-emx ) + PLATFORM_OS2=1 + ;; + *-*-darwin* ) + PLATFORM_MAC=1 + PLATFORM_MACOSX=1 + ;; + *-*-beos* ) + PLATFORM_BEOS=1 + ;; + powerpc-apple-macos* ) + PLATFORM_MAC=1 + PLATFORM_MACOS=1 + ;; + * ) + PLATFORM_UNIX=1 + ;; + esac + else + case "$BAKEFILE_FORCE_PLATFORM" in + win32 ) + PLATFORM_WIN32=1 + ;; + msdos ) + PLATFORM_MSDOS=1 + ;; + os2 ) + PLATFORM_OS2=1 + ;; + darwin ) + PLATFORM_MAC=1 + PLATFORM_MACOSX=1 + ;; + unix ) + PLATFORM_UNIX=1 + ;; + beos ) + PLATFORM_BEOS=1 + ;; + * ) + AC_MSG_ERROR([Unknown platform: $BAKEFILE_FORCE_PLATFORM]) + ;; + esac + fi + + AC_SUBST(PLATFORM_UNIX) + AC_SUBST(PLATFORM_WIN32) + AC_SUBST(PLATFORM_MSDOS) + AC_SUBST(PLATFORM_MAC) + AC_SUBST(PLATFORM_MACOS) + AC_SUBST(PLATFORM_MACOSX) + AC_SUBST(PLATFORM_OS2) + AC_SUBST(PLATFORM_BEOS) +]) + + +dnl --------------------------------------------------------------------------- +dnl AC_BAKEFILE_PLATFORM_SPECIFICS +dnl +dnl Sets misc platform-specific settings +dnl --------------------------------------------------------------------------- + +AC_DEFUN([AC_BAKEFILE_PLATFORM_SPECIFICS], +[ + AC_ARG_ENABLE([omf], AS_HELP_STRING([--enable-omf], + [use OMF object format (OS/2)]), + [bk_os2_use_omf="$enableval"]) + + case "${BAKEFILE_HOST}" in + *-*-darwin* ) + dnl For Unix to MacOS X porting instructions, see: + dnl http://fink.sourceforge.net/doc/porting/porting.html + if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -fno-common" + CXXFLAGS="$CXXFLAGS -fno-common" + fi + if test "x$XLCC" = "xyes"; then + CFLAGS="$CFLAGS -qnocommon" + CXXFLAGS="$CXXFLAGS -qnocommon" + fi + ;; + + *-pc-os2_emx | *-pc-os2-emx ) + if test "x$bk_os2_use_omf" = "xyes" ; then + AR=emxomfar + RANLIB=: + LDFLAGS="-Zomf $LDFLAGS" + CFLAGS="-Zomf $CFLAGS" + CXXFLAGS="-Zomf $CXXFLAGS" + OS2_LIBEXT="lib" + else + OS2_LIBEXT="a" + fi + ;; + + i*86-*-beos* ) + LDFLAGS="-L/boot/develop/lib/x86 $LDFLAGS" + ;; + esac +]) + +dnl --------------------------------------------------------------------------- +dnl AC_BAKEFILE_SUFFIXES +dnl +dnl Detects shared various suffixes for shared libraries, libraries, programs, +dnl plugins etc. +dnl --------------------------------------------------------------------------- + +AC_DEFUN([AC_BAKEFILE_SUFFIXES], +[ + SO_SUFFIX="so" + SO_SUFFIX_MODULE="so" + EXEEXT="" + LIBPREFIX="lib" + LIBEXT=".a" + DLLPREFIX="lib" + DLLPREFIX_MODULE="" + DLLIMP_SUFFIX="" + dlldir="$libdir" + + case "${BAKEFILE_HOST}" in + *-hp-hpux* ) + SO_SUFFIX="sl" + SO_SUFFIX_MODULE="sl" + ;; + *-*-aix* ) + dnl quoting from + dnl http://www-1.ibm.com/servers/esdd/articles/gnu.html: + dnl Both archive libraries and shared libraries on AIX have an + dnl .a extension. This will explain why you can't link with an + dnl .so and why it works with the name changed to .a. + SO_SUFFIX="a" + SO_SUFFIX_MODULE="a" + ;; + *-*-cygwin* ) + SO_SUFFIX="dll" + SO_SUFFIX_MODULE="dll" + DLLIMP_SUFFIX="dll.a" + EXEEXT=".exe" + DLLPREFIX="cyg" + dlldir="$bindir" + ;; + *-*-mingw32* ) + SO_SUFFIX="dll" + SO_SUFFIX_MODULE="dll" + DLLIMP_SUFFIX="dll.a" + EXEEXT=".exe" + DLLPREFIX="" + dlldir="$bindir" + ;; + *-pc-msdosdjgpp ) + EXEEXT=".exe" + DLLPREFIX="" + dlldir="$bindir" + ;; + *-pc-os2_emx | *-pc-os2-emx ) + SO_SUFFIX="dll" + SO_SUFFIX_MODULE="dll" + DLLIMP_SUFFIX=$OS2_LIBEXT + EXEEXT=".exe" + DLLPREFIX="" + LIBPREFIX="" + LIBEXT=".$OS2_LIBEXT" + dlldir="$bindir" + ;; + *-*-darwin* ) + SO_SUFFIX="dylib" + SO_SUFFIX_MODULE="bundle" + ;; + esac + + if test "x$DLLIMP_SUFFIX" = "x" ; then + DLLIMP_SUFFIX="$SO_SUFFIX" + fi + + AC_SUBST(SO_SUFFIX) + AC_SUBST(SO_SUFFIX_MODULE) + AC_SUBST(DLLIMP_SUFFIX) + AC_SUBST(EXEEXT) + AC_SUBST(LIBPREFIX) + AC_SUBST(LIBEXT) + AC_SUBST(DLLPREFIX) + AC_SUBST(DLLPREFIX_MODULE) + AC_SUBST(dlldir) +]) + + +dnl --------------------------------------------------------------------------- +dnl AC_BAKEFILE_SHARED_LD +dnl +dnl Detects command for making shared libraries, substitutes SHARED_LD_CC +dnl and SHARED_LD_CXX. +dnl --------------------------------------------------------------------------- + +AC_DEFUN([AC_BAKEFILE_SHARED_LD], +[ + dnl the extra compiler flags needed for compilation of shared library + PIC_FLAG="" + if test "x$GCC" = "xyes"; then + dnl the switch for gcc is the same under all platforms + PIC_FLAG="-fPIC" + fi + + dnl Defaults for GCC and ELF .so shared libs: + SHARED_LD_CC="\$(CC) -shared ${PIC_FLAG} -o" + SHARED_LD_CXX="\$(CXX) -shared ${PIC_FLAG} -o" + WINDOWS_IMPLIB=0 + + case "${BAKEFILE_HOST}" in + *-hp-hpux* ) + dnl default settings are good for gcc but not for the native HP-UX + if test "x$GCC" != "xyes"; then + dnl no idea why it wants it, but it does + LDFLAGS="$LDFLAGS -L/usr/lib" + + SHARED_LD_CC="${CC} -b -o" + SHARED_LD_CXX="${CXX} -b -o" + PIC_FLAG="+Z" + fi + ;; + + *-*-linux* ) + if test "x$GCC" != "xyes"; then + AC_CACHE_CHECK([for Intel compiler], bakefile_cv_prog_icc, + [ + AC_TRY_COMPILE([], + [ + #ifndef __INTEL_COMPILER + This is not ICC + #endif + ], + bakefile_cv_prog_icc=yes, + bakefile_cv_prog_icc=no + ) + ]) + if test "$bakefile_cv_prog_icc" = "yes"; then + PIC_FLAG="-KPIC" + fi + fi + ;; + + *-*-solaris2* ) + if test "x$GCC" != xyes ; then + SHARED_LD_CC="${CC} -G -o" + SHARED_LD_CXX="${CXX} -G -o" + PIC_FLAG="-KPIC" + fi + ;; + + *-*-darwin* ) + AC_BAKEFILE_CREATE_FILE_SHARED_LD_SH + chmod +x shared-ld-sh + + SHARED_LD_MODULE_CC="`pwd`/shared-ld-sh -bundle -headerpad_max_install_names -o" + SHARED_LD_MODULE_CXX="$SHARED_LD_MODULE_CC" + + dnl Most apps benefit from being fully binded (its faster and static + dnl variables initialized at startup work). + dnl This can be done either with the exe linker flag -Wl,-bind_at_load + dnl or with a double stage link in order to create a single module + dnl "-init _wxWindowsDylibInit" not useful with lazy linking solved + + dnl If using newer dev tools then there is a -single_module flag that + dnl we can use to do this for dylibs, otherwise we'll need to use a helper + dnl script. Check the version of gcc to see which way we can go: + AC_CACHE_CHECK([for gcc 3.1 or later], bakefile_cv_gcc31, [ + AC_TRY_COMPILE([], + [ + #if (__GNUC__ < 3) || \ + ((__GNUC__ == 3) && (__GNUC_MINOR__ < 1)) + This is old gcc + #endif + ], + [ + bakefile_cv_gcc31=yes + ], + [ + bakefile_cv_gcc31=no + ] + ) + ]) + if test "$bakefile_cv_gcc31" = "no"; then + dnl Use the shared-ld-sh helper script + SHARED_LD_CC="`pwd`/shared-ld-sh -dynamiclib -headerpad_max_install_names -o" + SHARED_LD_CXX="$SHARED_LD_CC" + else + dnl Use the -single_module flag and let the linker do it for us + SHARED_LD_CC="\${CC} -dynamiclib -single_module -headerpad_max_install_names -o" + SHARED_LD_CXX="\${CXX} -dynamiclib -single_module -headerpad_max_install_names -o" + fi + + if test "x$GCC" == "xyes"; then + PIC_FLAG="-dynamic -fPIC" + fi + if test "x$XLCC" = "xyes"; then + PIC_FLAG="-dynamic -DPIC" + fi + ;; + + *-*-aix* ) + if test "x$GCC" = "xyes"; then + dnl at least gcc 2.95 warns that -fPIC is ignored when + dnl compiling each and every file under AIX which is annoying, + dnl so don't use it there (it's useless as AIX runs on + dnl position-independent architectures only anyhow) + PIC_FLAG="" + + dnl -bexpfull is needed by AIX linker to export all symbols (by + dnl default it doesn't export any and even with -bexpall it + dnl doesn't export all C++ support symbols, e.g. vtable + dnl pointers) but it's only available starting from 5.1 (with + dnl maintenance pack 2, whatever this is), see + dnl http://www-128.ibm.com/developerworks/eserver/articles/gnu.html + case "${BAKEFILE_HOST}" in + *-*-aix5* ) + LD_EXPFULL="-Wl,-bexpfull" + ;; + esac + + SHARED_LD_CC="\$(CC) -shared $LD_EXPFULL -o" + SHARED_LD_CXX="\$(CXX) -shared $LD_EXPFULL -o" + else + dnl FIXME: makeC++SharedLib is obsolete, what should we do for + dnl recent AIX versions? + AC_CHECK_PROG(AIX_CXX_LD, makeC++SharedLib, + makeC++SharedLib, /usr/lpp/xlC/bin/makeC++SharedLib) + SHARED_LD_CC="$AIX_CC_LD -p 0 -o" + SHARED_LD_CXX="$AIX_CXX_LD -p 0 -o" + fi + ;; + + *-*-beos* ) + dnl can't use gcc under BeOS for shared library creation because it + dnl complains about missing 'main' + SHARED_LD_CC="${LD} -nostart -o" + SHARED_LD_CXX="${LD} -nostart -o" + ;; + + *-*-irix* ) + dnl default settings are ok for gcc + if test "x$GCC" != "xyes"; then + PIC_FLAG="-KPIC" + fi + ;; + + *-*-cygwin* | *-*-mingw32* ) + PIC_FLAG="" + SHARED_LD_CC="\$(CC) -shared -o" + SHARED_LD_CXX="\$(CXX) -shared -o" + WINDOWS_IMPLIB=1 + ;; + + *-pc-os2_emx | *-pc-os2-emx ) + SHARED_LD_CC="`pwd`/dllar.sh -libf INITINSTANCE -libf TERMINSTANCE -o" + SHARED_LD_CXX="`pwd`/dllar.sh -libf INITINSTANCE -libf TERMINSTANCE -o" + PIC_FLAG="" + AC_BAKEFILE_CREATE_FILE_DLLAR_SH + chmod +x dllar.sh + ;; + + powerpc-apple-macos* | \ + *-*-freebsd* | *-*-openbsd* | *-*-netbsd* | *-*-k*bsd*-gnu | \ + *-*-mirbsd* | \ + *-*-sunos4* | \ + *-*-osf* | \ + *-*-dgux5* | \ + *-*-sysv5* | \ + *-pc-msdosdjgpp ) + dnl defaults are ok + ;; + + *) + AC_MSG_ERROR(unknown system type $BAKEFILE_HOST.) + esac + + if test "x$PIC_FLAG" != "x" ; then + PIC_FLAG="$PIC_FLAG -DPIC" + fi + + if test "x$SHARED_LD_MODULE_CC" = "x" ; then + SHARED_LD_MODULE_CC="$SHARED_LD_CC" + fi + if test "x$SHARED_LD_MODULE_CXX" = "x" ; then + SHARED_LD_MODULE_CXX="$SHARED_LD_CXX" + fi + + AC_SUBST(SHARED_LD_CC) + AC_SUBST(SHARED_LD_CXX) + AC_SUBST(SHARED_LD_MODULE_CC) + AC_SUBST(SHARED_LD_MODULE_CXX) + AC_SUBST(PIC_FLAG) + AC_SUBST(WINDOWS_IMPLIB) +]) + + +dnl --------------------------------------------------------------------------- +dnl AC_BAKEFILE_SHARED_VERSIONS +dnl +dnl Detects linker options for attaching versions (sonames) to shared libs. +dnl --------------------------------------------------------------------------- + +AC_DEFUN([AC_BAKEFILE_SHARED_VERSIONS], +[ + USE_SOVERSION=0 + USE_SOVERLINUX=0 + USE_SOVERSOLARIS=0 + USE_SOVERCYGWIN=0 + USE_SOSYMLINKS=0 + USE_MACVERSION=0 + SONAME_FLAG= + + case "${BAKEFILE_HOST}" in + *-*-linux* | *-*-freebsd* | *-*-k*bsd*-gnu ) + SONAME_FLAG="-Wl,-soname," + USE_SOVERSION=1 + USE_SOVERLINUX=1 + USE_SOSYMLINKS=1 + ;; + + *-*-solaris2* ) + SONAME_FLAG="-h " + USE_SOVERSION=1 + USE_SOVERSOLARIS=1 + USE_SOSYMLINKS=1 + ;; + + *-*-darwin* ) + USE_MACVERSION=1 + USE_SOVERSION=1 + USE_SOSYMLINKS=1 + ;; + + *-*-cygwin* ) + USE_SOVERSION=1 + USE_SOVERCYGWIN=1 + ;; + esac + + AC_SUBST(USE_SOVERSION) + AC_SUBST(USE_SOVERLINUX) + AC_SUBST(USE_SOVERSOLARIS) + AC_SUBST(USE_SOVERCYGWIN) + AC_SUBST(USE_MACVERSION) + AC_SUBST(USE_SOSYMLINKS) + AC_SUBST(SONAME_FLAG) +]) + + +dnl --------------------------------------------------------------------------- +dnl AC_BAKEFILE_DEPS +dnl +dnl Detects available C/C++ dependency tracking options +dnl --------------------------------------------------------------------------- + +AC_DEFUN([AC_BAKEFILE_DEPS], +[ + AC_ARG_ENABLE([dependency-tracking], + AS_HELP_STRING([--disable-dependency-tracking], + [don't use dependency tracking even if the compiler can]), + [bk_use_trackdeps="$enableval"]) + + AC_MSG_CHECKING([for dependency tracking method]) + + BK_DEPS="" + if test "x$bk_use_trackdeps" = "xno" ; then + DEPS_TRACKING=0 + AC_MSG_RESULT([disabled]) + else + DEPS_TRACKING=1 + + if test "x$GCC" = "xyes"; then + DEPSMODE=gcc + case "${BAKEFILE_HOST}" in + *-*-darwin* ) + dnl -cpp-precomp (the default) conflicts with -MMD option + dnl used by bk-deps (see also http://developer.apple.com/documentation/Darwin/Conceptual/PortingUnix/compiling/chapter_4_section_3.html) + DEPSFLAG="-no-cpp-precomp -MMD" + ;; + * ) + DEPSFLAG="-MMD" + ;; + esac + AC_MSG_RESULT([gcc]) + elif test "x$MWCC" = "xyes"; then + DEPSMODE=mwcc + DEPSFLAG="-MM" + AC_MSG_RESULT([mwcc]) + elif test "x$SUNCC" = "xyes"; then + DEPSMODE=unixcc + DEPSFLAG="-xM1" + AC_MSG_RESULT([Sun cc]) + elif test "x$SGICC" = "xyes"; then + DEPSMODE=unixcc + DEPSFLAG="-M" + AC_MSG_RESULT([SGI cc]) + elif test "x$HPCC" = "xyes"; then + DEPSMODE=unixcc + DEPSFLAG="+make" + AC_MSG_RESULT([HP cc]) + elif test "x$COMPAQCC" = "xyes"; then + DEPSMODE=gcc + DEPSFLAG="-MD" + AC_MSG_RESULT([Compaq cc]) + else + DEPS_TRACKING=0 + AC_MSG_RESULT([none]) + fi + + if test $DEPS_TRACKING = 1 ; then + AC_BAKEFILE_CREATE_FILE_BK_DEPS + chmod +x bk-deps + dnl FIXME: make this $(top_builddir)/bk-deps once autoconf-2.60 + dnl is required (and so top_builddir is never empty): + BK_DEPS="`pwd`/bk-deps" + fi + fi + + AC_SUBST(DEPS_TRACKING) + AC_SUBST(BK_DEPS) +]) + +dnl --------------------------------------------------------------------------- +dnl AC_BAKEFILE_CHECK_BASIC_STUFF +dnl +dnl Checks for presence of basic programs, such as C and C++ compiler, "ranlib" +dnl or "install" +dnl --------------------------------------------------------------------------- + +AC_DEFUN([AC_BAKEFILE_CHECK_BASIC_STUFF], +[ + AC_PROG_RANLIB + AC_PROG_INSTALL + AC_PROG_LN_S + + AC_PROG_MAKE_SET + AC_SUBST(MAKE_SET) + + if test "x$SUNCXX" = "xyes"; then + dnl Sun C++ compiler requires special way of creating static libs; + dnl see here for more details: + dnl https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1229751&group_id=9863 + AR=$CXX + AROPTIONS="-xar -o" + AC_SUBST(AR) + elif test "x$SGICC" = "xyes"; then + dnl Almost the same as above for SGI mipsPro compiler + AR=$CXX + AROPTIONS="-ar -o" + AC_SUBST(AR) + else + AC_CHECK_TOOL(AR, ar, ar) + AROPTIONS=rcu + fi + AC_SUBST(AROPTIONS) + + AC_CHECK_TOOL(STRIP, strip, :) + AC_CHECK_TOOL(NM, nm, :) + + case ${BAKEFILE_HOST} in + *-hp-hpux* ) + dnl HP-UX install doesn't handle the "-d" switch so don't + dnl use it there + INSTALL_DIR="mkdir -p" + ;; + * ) + dnl we must refer to makefile's $(INSTALL) variable and not + dnl current value of shell variable, hence the single quoting: + INSTALL_DIR='$(INSTALL) -d' + ;; + esac + AC_SUBST(INSTALL_DIR) + + LDFLAGS_GUI= + case ${BAKEFILE_HOST} in + *-*-cygwin* | *-*-mingw32* ) + LDFLAGS_GUI="-mwindows" + esac + AC_SUBST(LDFLAGS_GUI) +]) + + +dnl --------------------------------------------------------------------------- +dnl AC_BAKEFILE_RES_COMPILERS +dnl +dnl Checks for presence of resource compilers for win32 or mac +dnl --------------------------------------------------------------------------- + +AC_DEFUN([AC_BAKEFILE_RES_COMPILERS], +[ + case ${BAKEFILE_HOST} in + *-*-cygwin* | *-*-mingw32* ) + dnl Check for win32 resources compiler: + AC_CHECK_TOOL(WINDRES, windres) + ;; + + *-*-darwin* | powerpc-apple-macos* ) + AC_CHECK_PROG(REZ, Rez, Rez, /Developer/Tools/Rez) + AC_CHECK_PROG(SETFILE, SetFile, SetFile, /Developer/Tools/SetFile) + ;; + esac + + AC_SUBST(WINDRES) + AC_SUBST(REZ) + AC_SUBST(SETFILE) +]) + +dnl --------------------------------------------------------------------------- +dnl AC_BAKEFILE_PRECOMP_HEADERS +dnl +dnl Check for precompiled headers support (GCC >= 3.4) +dnl --------------------------------------------------------------------------- + +AC_DEFUN([AC_BAKEFILE_PRECOMP_HEADERS], +[ + + AC_ARG_ENABLE([precomp-headers], + AS_HELP_STRING([--disable-precomp-headers], + [don't use precompiled headers even if compiler can]), + [bk_use_pch="$enableval"]) + + GCC_PCH=0 + ICC_PCH=0 + USE_PCH=0 + BK_MAKE_PCH="" + + case ${BAKEFILE_HOST} in + *-*-cygwin* ) + dnl PCH support is broken in cygwin gcc because of unportable + dnl assumptions about mmap() in gcc code which make PCH generation + dnl fail erratically; disable PCH completely until this is fixed + bk_use_pch="no" + ;; + esac + + if test "x$bk_use_pch" = "x" -o "x$bk_use_pch" = "xyes" ; then + if test "x$GCC" = "xyes"; then + dnl test if we have gcc-3.4: + AC_MSG_CHECKING([if the compiler supports precompiled headers]) + AC_TRY_COMPILE([], + [ + #if !defined(__GNUC__) || !defined(__GNUC_MINOR__) + There is no PCH support + #endif + #if (__GNUC__ < 3) + There is no PCH support + #endif + #if (__GNUC__ == 3) && \ + ((!defined(__APPLE_CC__) && (__GNUC_MINOR__ < 4)) || \ + ( defined(__APPLE_CC__) && (__GNUC_MINOR__ < 3))) || \ + ( defined(__INTEL_COMPILER) ) + There is no PCH support + #endif + ], + [ + AC_MSG_RESULT([yes]) + GCC_PCH=1 + ], + [ + AC_TRY_COMPILE([], + [ + #if !defined(__INTEL_COMPILER) || \ + (__INTEL_COMPILER < 800) + There is no PCH support + #endif + ], + [ + AC_MSG_RESULT([yes]) + ICC_PCH=1 + ], + [ + AC_MSG_RESULT([no]) + ]) + ]) + if test $GCC_PCH = 1 -o $ICC_PCH = 1 ; then + USE_PCH=1 + AC_BAKEFILE_CREATE_FILE_BK_MAKE_PCH + chmod +x bk-make-pch + dnl FIXME: make this $(top_builddir)/bk-make-pch once + dnl autoconf-2.60 is required (and so top_builddir is + dnl never empty): + BK_MAKE_PCH="`pwd`/bk-make-pch" + fi + fi + fi + + AC_SUBST(GCC_PCH) + AC_SUBST(ICC_PCH) + AC_SUBST(BK_MAKE_PCH) +]) + + + +dnl --------------------------------------------------------------------------- +dnl AC_BAKEFILE([autoconf_inc.m4 inclusion]) +dnl +dnl To be used in configure.in of any project using Bakefile-generated mks +dnl +dnl Behaviour can be modified by setting following variables: +dnl BAKEFILE_CHECK_BASICS set to "no" if you don't want bakefile to +dnl to perform check for basic tools like ranlib +dnl BAKEFILE_HOST set this to override host detection, defaults +dnl to ${host} +dnl BAKEFILE_FORCE_PLATFORM set to override platform detection +dnl +dnl Example usage: +dnl +dnl AC_BAKEFILE([FOO(autoconf_inc.m4)]) +dnl +dnl (replace FOO with m4_include above, aclocal would die otherwise) +dnl (yes, it's ugly, but thanks to a bug in aclocal, it's the only thing +dnl we can do...) +dnl --------------------------------------------------------------------------- + +AC_DEFUN([AC_BAKEFILE], +[ + AC_PREREQ([2.58]) + + if test "x$BAKEFILE_HOST" = "x"; then + if test "x${host}" = "x" ; then + AC_MSG_ERROR([You must call the autoconf "CANONICAL_HOST" macro in your configure.ac (or .in) file.]) + fi + + BAKEFILE_HOST="${host}" + fi + + if test "x$BAKEFILE_CHECK_BASICS" != "xno"; then + AC_BAKEFILE_CHECK_BASIC_STUFF + fi + AC_BAKEFILE_GNUMAKE + AC_BAKEFILE_PLATFORM + AC_BAKEFILE_PLATFORM_SPECIFICS + AC_BAKEFILE_SUFFIXES + AC_BAKEFILE_SHARED_LD + AC_BAKEFILE_SHARED_VERSIONS + AC_BAKEFILE_DEPS + AC_BAKEFILE_RES_COMPILERS + + BAKEFILE_BAKEFILE_M4_VERSION="0.2.2" + + dnl includes autoconf_inc.m4: + $1 + + if test "$BAKEFILE_AUTOCONF_INC_M4_VERSION" = "" ; then + AC_MSG_ERROR([No version found in autoconf_inc.m4 - bakefile macro was changed to take additional argument, perhaps configure.in wasn't updated (see the documentation)?]) + fi + + if test "$BAKEFILE_BAKEFILE_M4_VERSION" != "$BAKEFILE_AUTOCONF_INC_M4_VERSION" ; then + AC_MSG_ERROR([Versions of Bakefile used to generate makefiles ($BAKEFILE_AUTOCONF_INC_M4_VERSION) and configure ($BAKEFILE_BAKEFILE_M4_VERSION) do not match.]) + fi +]) + + +dnl --------------------------------------------------------------------------- +dnl Embedded copies of helper scripts follow: +dnl --------------------------------------------------------------------------- + +AC_DEFUN([AC_BAKEFILE_CREATE_FILE_BK_DEPS], +[ +dnl ===================== bk-deps begins here ===================== +dnl (Created by merge-scripts.py from bk-deps +dnl file do not edit here!) +D='$' +cat <bk-deps +#!/bin/sh + +# This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf +# script. It is used to track C/C++ files dependencies in portable way. +# +# Permission is given to use this file in any way. + +DEPSMODE=${DEPSMODE} +DEPSDIR=.deps +DEPSFLAG="${DEPSFLAG}" + +mkdir -p ${D}DEPSDIR + +if test ${D}DEPSMODE = gcc ; then + ${D}* ${D}{DEPSFLAG} + status=${D}? + if test ${D}{status} != 0 ; then + exit ${D}{status} + fi + # move created file to the location we want it in: + while test ${D}# -gt 0; do + case "${D}1" in + -o ) + shift + objfile=${D}1 + ;; + -* ) + ;; + * ) + srcfile=${D}1 + ;; + esac + shift + done + depfile=\`basename ${D}srcfile | sed -e 's/\\..*${D}/.d/g'\` + depobjname=\`echo ${D}depfile |sed -e 's/\\.d/.o/g'\` + if test -f ${D}depfile ; then + sed -e "s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{DEPSDIR}/${D}{objfile}.d + rm -f ${D}depfile + else + # "g++ -MMD -o fooobj.o foosrc.cpp" produces fooobj.d + depfile=\`basename ${D}objfile | sed -e 's/\\..*${D}/.d/g'\` + if test ! -f ${D}depfile ; then + # "cxx -MD -o fooobj.o foosrc.cpp" creates fooobj.o.d (Compaq C++) + depfile="${D}objfile.d" + fi + if test -f ${D}depfile ; then + sed -e "/^${D}objfile/!s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{DEPSDIR}/${D}{objfile}.d + rm -f ${D}depfile + fi + fi + exit 0 +elif test ${D}DEPSMODE = mwcc ; then + ${D}* || exit ${D}? + # Run mwcc again with -MM and redirect into the dep file we want + # NOTE: We can't use shift here because we need ${D}* to be valid + prevarg= + for arg in ${D}* ; do + if test "${D}prevarg" = "-o"; then + objfile=${D}arg + else + case "${D}arg" in + -* ) + ;; + * ) + srcfile=${D}arg + ;; + esac + fi + prevarg="${D}arg" + done + ${D}* ${D}DEPSFLAG >${D}{DEPSDIR}/${D}{objfile}.d + exit 0 +elif test ${D}DEPSMODE = unixcc; then + ${D}* || exit ${D}? + # Run compiler again with deps flag and redirect into the dep file. + # It doesn't work if the '-o FILE' option is used, but without it the + # dependency file will contain the wrong name for the object. So it is + # removed from the command line, and the dep file is fixed with sed. + cmd="" + while test ${D}# -gt 0; do + case "${D}1" in + -o ) + shift + objfile=${D}1 + ;; + * ) + eval arg${D}#=\\${D}1 + cmd="${D}cmd \\${D}arg${D}#" + ;; + esac + shift + done + eval "${D}cmd ${D}DEPSFLAG" | sed "s|.*:|${D}objfile:|" >${D}{DEPSDIR}/${D}{objfile}.d + exit 0 +else + ${D}* + exit ${D}? +fi +EOF +dnl ===================== bk-deps ends here ===================== +]) + +AC_DEFUN([AC_BAKEFILE_CREATE_FILE_SHARED_LD_SH], +[ +dnl ===================== shared-ld-sh begins here ===================== +dnl (Created by merge-scripts.py from shared-ld-sh +dnl file do not edit here!) +D='$' +cat <shared-ld-sh +#!/bin/sh +#----------------------------------------------------------------------------- +#-- Name: distrib/mac/shared-ld-sh +#-- Purpose: Link a mach-o dynamic shared library for Darwin / Mac OS X +#-- Author: Gilles Depeyrot +#-- Copyright: (c) 2002 Gilles Depeyrot +#-- Licence: any use permitted +#----------------------------------------------------------------------------- + +verbose=0 +args="" +objects="" +linking_flag="-dynamiclib" +ldargs="-r -keep_private_externs -nostdlib" + +while test ${D}# -gt 0; do + case ${D}1 in + + -v) + verbose=1 + ;; + + -o|-compatibility_version|-current_version|-framework|-undefined|-install_name) + # collect these options and values + args="${D}{args} ${D}1 ${D}2" + shift + ;; + + -s|-Wl,*) + # collect these load args + ldargs="${D}{ldargs} ${D}1" + ;; + + -l*|-L*|-flat_namespace|-headerpad_max_install_names) + # collect these options + args="${D}{args} ${D}1" + ;; + + -dynamiclib|-bundle) + linking_flag="${D}1" + ;; + + -*) + echo "shared-ld: unhandled option '${D}1'" + exit 1 + ;; + + *.o | *.a | *.dylib) + # collect object files + objects="${D}{objects} ${D}1" + ;; + + *) + echo "shared-ld: unhandled argument '${D}1'" + exit 1 + ;; + + esac + shift +done + +status=0 + +# +# Link one module containing all the others +# +if test ${D}{verbose} = 1; then + echo "c++ ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o" +fi +c++ ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o +status=${D}? + +# +# Link the shared library from the single module created, but only if the +# previous command didn't fail: +# +if test ${D}{status} = 0; then + if test ${D}{verbose} = 1; then + echo "c++ ${D}{linking_flag} master.${D}${D}.o ${D}{args}" + fi + c++ ${D}{linking_flag} master.${D}${D}.o ${D}{args} + status=${D}? +fi + +# +# Remove intermediate module +# +rm -f master.${D}${D}.o + +exit ${D}status +EOF +dnl ===================== shared-ld-sh ends here ===================== +]) + +AC_DEFUN([AC_BAKEFILE_CREATE_FILE_BK_MAKE_PCH], +[ +dnl ===================== bk-make-pch begins here ===================== +dnl (Created by merge-scripts.py from bk-make-pch +dnl file do not edit here!) +D='$' +cat <bk-make-pch +#!/bin/sh + +# This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf +# script. It is used to generated precompiled headers. +# +# Permission is given to use this file in any way. + +outfile="${D}{1}" +header="${D}{2}" +shift +shift + +compiler="" +headerfile="" + +while test ${D}{#} -gt 0; do + add_to_cmdline=1 + case "${D}{1}" in + -I* ) + incdir=\`echo ${D}{1} | sed -e 's/-I\\(.*\\)/\\1/g'\` + if test "x${D}{headerfile}" = "x" -a -f "${D}{incdir}/${D}{header}" ; then + headerfile="${D}{incdir}/${D}{header}" + fi + ;; + -use-pch|-use_pch ) + shift + add_to_cmdline=0 + ;; + esac + if test ${D}add_to_cmdline = 1 ; then + compiler="${D}{compiler} ${D}{1}" + fi + shift +done + +if test "x${D}{headerfile}" = "x" ; then + echo "error: can't find header ${D}{header} in include paths" >&2 +else + if test -f ${D}{outfile} ; then + rm -f ${D}{outfile} + else + mkdir -p \`dirname ${D}{outfile}\` + fi + depsfile=".deps/\`echo ${D}{outfile} | tr '/.' '__'\`.d" + mkdir -p .deps + if test "x${GCC_PCH}" = "x1" ; then + # can do this because gcc is >= 3.4: + ${D}{compiler} -o ${D}{outfile} -MMD -MF "${D}{depsfile}" "${D}{headerfile}" + elif test "x${ICC_PCH}" = "x1" ; then + filename=pch_gen-${D}${D} + file=${D}{filename}.c + dfile=${D}{filename}.d + cat > ${D}file < ${D}depsfile && \\ + rm -f ${D}file ${D}dfile ${D}{filename}.o + fi + exit ${D}{?} +fi +EOF +dnl ===================== bk-make-pch ends here ===================== +]) + diff --git a/3rdparty/libbcrypt-1.0/build/unix/autoconf_inc.m4 b/3rdparty/libbcrypt-1.0/build/unix/autoconf_inc.m4 new file mode 100644 index 0000000..69dc225 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/autoconf_inc.m4 @@ -0,0 +1,20 @@ +dnl ### begin block 00_header[bakefile.bkl] ### +dnl +dnl This macro was generated by +dnl Bakefile 0.2.2 (http://bakefile.sourceforge.net) +dnl Do not modify, all changes will be overwritten! + +BAKEFILE_AUTOCONF_INC_M4_VERSION="0.2.2" + +dnl ### begin block 20_COND_DEPS_TRACKING_0[bakefile.bkl] ### + COND_DEPS_TRACKING_0="#" + if test "x$DEPS_TRACKING" = "x0" ; then + COND_DEPS_TRACKING_0="" + fi + AC_SUBST(COND_DEPS_TRACKING_0) +dnl ### begin block 20_COND_DEPS_TRACKING_1[bakefile.bkl] ### + COND_DEPS_TRACKING_1="#" + if test "x$DEPS_TRACKING" = "x1" ; then + COND_DEPS_TRACKING_1="" + fi + AC_SUBST(COND_DEPS_TRACKING_1) diff --git a/3rdparty/libbcrypt-1.0/build/unix/autogen.sh b/3rdparty/libbcrypt-1.0/build/unix/autogen.sh new file mode 100755 index 0000000..999ef8c --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/autogen.sh @@ -0,0 +1,5 @@ +#!/bin/bash +bakefile -f autoconf bakefile.bkl +bakefilize --copy +aclocal -I /usr/local/share/aclocal +autoconf diff --git a/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/output.0 b/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/output.0 new file mode 100644 index 0000000..41dda10 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/output.0 @@ -0,0 +1,2979 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.69. +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="aclocal.m4" +ac_subst_vars='LTLIBOBJS +LIB@&t@OBJS +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +' + ac_precious_vars='build_alias +host_alias +target_alias' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + @<:@PREFIX@:>@ + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/PACKAGE@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +DEBUG=0 +AC_BAKEFILE(m4_include(autoconf_inc.m4)) +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + diff --git a/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/output.1 b/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/output.1 new file mode 100644 index 0000000..a3c3bcf --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/output.1 @@ -0,0 +1,5895 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.69. +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="aclocal.m4" +ac_subst_vars='LTLIBOBJS +LIB@&t@OBJS +COND_DEPS_TRACKING_1 +COND_DEPS_TRACKING_0 +SETFILE +REZ +WINDRES +BK_DEPS +DEPS_TRACKING +SONAME_FLAG +USE_SOSYMLINKS +USE_MACVERSION +USE_SOVERCYGWIN +USE_SOVERSOLARIS +USE_SOVERLINUX +USE_SOVERSION +WINDOWS_IMPLIB +PIC_FLAG +SHARED_LD_MODULE_CXX +SHARED_LD_MODULE_CC +SHARED_LD_CXX +SHARED_LD_CC +AIX_CXX_LD +OBJEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +dlldir +DLLPREFIX_MODULE +DLLPREFIX +LIBEXT +LIBPREFIX +EXEEXT +DLLIMP_SUFFIX +SO_SUFFIX_MODULE +SO_SUFFIX +PLATFORM_BEOS +PLATFORM_OS2 +PLATFORM_MACOSX +PLATFORM_MACOS +PLATFORM_MAC +PLATFORM_MSDOS +PLATFORM_WIN32 +PLATFORM_UNIX +IF_GNU_MAKE +LDFLAGS_GUI +INSTALL_DIR +NM +STRIP +AROPTIONS +AR +MAKE_SET +SET_MAKE +LN_S +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +RANLIB +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_omf +enable_dependency_tracking +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + @<:@PREFIX@:>@ + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/PACKAGE@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-omf use OMF object format (OS/2) + --disable-dependency-tracking + don't use dependency tracking even if the compiler + can + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +DEBUG=0 +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in @%:@(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $@%:@ != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + if test "x$BAKEFILE_HOST" = "x"; then + if test "x${host}" = "x" ; then + as_fn_error $? "You must call the autoconf \"CANONICAL_HOST\" macro in your configure.ac (or .in) file." "$LINENO" 5 + fi + + BAKEFILE_HOST="${host}" + fi + + if test "x$BAKEFILE_CHECK_BASICS" != "xno"; then + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + + + if test "x$SUNCXX" = "xyes"; then + AR=$CXX + AROPTIONS="-xar -o" + + elif test "x$SGICC" = "xyes"; then + AR=$CXX + AROPTIONS="-ar -o" + + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="ar" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + AROPTIONS=rcu + fi + + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. +set dummy ${ac_tool_prefix}nm; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + ac_cv_prog_NM="$NM" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NM="${ac_tool_prefix}nm" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NM=$ac_cv_prog_NM +if test -n "$NM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 +$as_echo "$NM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NM"; then + ac_ct_NM=$NM + # Extract the first word of "nm", so it can be a program name with args. +set dummy nm; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NM"; then + ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NM="nm" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NM=$ac_cv_prog_ac_ct_NM +if test -n "$ac_ct_NM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5 +$as_echo "$ac_ct_NM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NM" = x; then + NM=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NM=$ac_ct_NM + fi +else + NM="$ac_cv_prog_NM" +fi + + + case ${BAKEFILE_HOST} in + *-hp-hpux* ) + INSTALL_DIR="mkdir -p" + ;; + * ) + INSTALL_DIR='$(INSTALL) -d' + ;; + esac + + + LDFLAGS_GUI= + case ${BAKEFILE_HOST} in + *-*-cygwin* | *-*-mingw32* ) + LDFLAGS_GUI="-mwindows" + esac + + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if make is GNU make" >&5 +$as_echo_n "checking if make is GNU make... " >&6; } +if ${bakefile_cv_prog_makeisgnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null | + egrep -s GNU > /dev/null); then + bakefile_cv_prog_makeisgnu="yes" + else + bakefile_cv_prog_makeisgnu="no" + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_prog_makeisgnu" >&5 +$as_echo "$bakefile_cv_prog_makeisgnu" >&6; } + + if test "x$bakefile_cv_prog_makeisgnu" = "xyes"; then + IF_GNU_MAKE="" + else + IF_GNU_MAKE="#" + fi + + + + PLATFORM_UNIX=0 + PLATFORM_WIN32=0 + PLATFORM_MSDOS=0 + PLATFORM_MAC=0 + PLATFORM_MACOS=0 + PLATFORM_MACOSX=0 + PLATFORM_OS2=0 + PLATFORM_BEOS=0 + + if test "x$BAKEFILE_FORCE_PLATFORM" = "x"; then + case "${BAKEFILE_HOST}" in + *-*-mingw32* ) + PLATFORM_WIN32=1 + ;; + *-pc-msdosdjgpp ) + PLATFORM_MSDOS=1 + ;; + *-pc-os2_emx | *-pc-os2-emx ) + PLATFORM_OS2=1 + ;; + *-*-darwin* ) + PLATFORM_MAC=1 + PLATFORM_MACOSX=1 + ;; + *-*-beos* ) + PLATFORM_BEOS=1 + ;; + powerpc-apple-macos* ) + PLATFORM_MAC=1 + PLATFORM_MACOS=1 + ;; + * ) + PLATFORM_UNIX=1 + ;; + esac + else + case "$BAKEFILE_FORCE_PLATFORM" in + win32 ) + PLATFORM_WIN32=1 + ;; + msdos ) + PLATFORM_MSDOS=1 + ;; + os2 ) + PLATFORM_OS2=1 + ;; + darwin ) + PLATFORM_MAC=1 + PLATFORM_MACOSX=1 + ;; + unix ) + PLATFORM_UNIX=1 + ;; + beos ) + PLATFORM_BEOS=1 + ;; + * ) + as_fn_error $? "Unknown platform: $BAKEFILE_FORCE_PLATFORM" "$LINENO" 5 + ;; + esac + fi + + + + + + + + + + + + @%:@ Check whether --enable-omf was given. +if test "${enable_omf+set}" = set; then : + enableval=$enable_omf; bk_os2_use_omf="$enableval" +fi + + + case "${BAKEFILE_HOST}" in + *-*-darwin* ) + if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -fno-common" + CXXFLAGS="$CXXFLAGS -fno-common" + fi + if test "x$XLCC" = "xyes"; then + CFLAGS="$CFLAGS -qnocommon" + CXXFLAGS="$CXXFLAGS -qnocommon" + fi + ;; + + *-pc-os2_emx | *-pc-os2-emx ) + if test "x$bk_os2_use_omf" = "xyes" ; then + AR=emxomfar + RANLIB=: + LDFLAGS="-Zomf $LDFLAGS" + CFLAGS="-Zomf $CFLAGS" + CXXFLAGS="-Zomf $CXXFLAGS" + OS2_LIBEXT="lib" + else + OS2_LIBEXT="a" + fi + ;; + + i*86-*-beos* ) + LDFLAGS="-L/boot/develop/lib/x86 $LDFLAGS" + ;; + esac + + + SO_SUFFIX="so" + SO_SUFFIX_MODULE="so" + EXEEXT="" + LIBPREFIX="lib" + LIBEXT=".a" + DLLPREFIX="lib" + DLLPREFIX_MODULE="" + DLLIMP_SUFFIX="" + dlldir="$libdir" + + case "${BAKEFILE_HOST}" in + *-hp-hpux* ) + SO_SUFFIX="sl" + SO_SUFFIX_MODULE="sl" + ;; + *-*-aix* ) + SO_SUFFIX="a" + SO_SUFFIX_MODULE="a" + ;; + *-*-cygwin* ) + SO_SUFFIX="dll" + SO_SUFFIX_MODULE="dll" + DLLIMP_SUFFIX="dll.a" + EXEEXT=".exe" + DLLPREFIX="cyg" + dlldir="$bindir" + ;; + *-*-mingw32* ) + SO_SUFFIX="dll" + SO_SUFFIX_MODULE="dll" + DLLIMP_SUFFIX="dll.a" + EXEEXT=".exe" + DLLPREFIX="" + dlldir="$bindir" + ;; + *-pc-msdosdjgpp ) + EXEEXT=".exe" + DLLPREFIX="" + dlldir="$bindir" + ;; + *-pc-os2_emx | *-pc-os2-emx ) + SO_SUFFIX="dll" + SO_SUFFIX_MODULE="dll" + DLLIMP_SUFFIX=$OS2_LIBEXT + EXEEXT=".exe" + DLLPREFIX="" + LIBPREFIX="" + LIBEXT=".$OS2_LIBEXT" + dlldir="$bindir" + ;; + *-*-darwin* ) + SO_SUFFIX="dylib" + SO_SUFFIX_MODULE="bundle" + ;; + esac + + if test "x$DLLIMP_SUFFIX" = "x" ; then + DLLIMP_SUFFIX="$SO_SUFFIX" + fi + + + + + + + + + + + + + PIC_FLAG="" + if test "x$GCC" = "xyes"; then + PIC_FLAG="-fPIC" + fi + + SHARED_LD_CC="\$(CC) -shared ${PIC_FLAG} -o" + SHARED_LD_CXX="\$(CXX) -shared ${PIC_FLAG} -o" + WINDOWS_IMPLIB=0 + + case "${BAKEFILE_HOST}" in + *-hp-hpux* ) + if test "x$GCC" != "xyes"; then + LDFLAGS="$LDFLAGS -L/usr/lib" + + SHARED_LD_CC="${CC} -b -o" + SHARED_LD_CXX="${CXX} -b -o" + PIC_FLAG="+Z" + fi + ;; + + *-*-linux* ) + if test "x$GCC" != "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Intel compiler" >&5 +$as_echo_n "checking for Intel compiler... " >&6; } +if ${bakefile_cv_prog_icc+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + #ifndef __INTEL_COMPILER + This is not ICC + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bakefile_cv_prog_icc=yes +else + bakefile_cv_prog_icc=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_prog_icc" >&5 +$as_echo "$bakefile_cv_prog_icc" >&6; } + if test "$bakefile_cv_prog_icc" = "yes"; then + PIC_FLAG="-KPIC" + fi + fi + ;; + + *-*-solaris2* ) + if test "x$GCC" != xyes ; then + SHARED_LD_CC="${CC} -G -o" + SHARED_LD_CXX="${CXX} -G -o" + PIC_FLAG="-KPIC" + fi + ;; + + *-*-darwin* ) + +D='$' +cat <shared-ld-sh +#!/bin/sh +#----------------------------------------------------------------------------- +#-- Name: distrib/mac/shared-ld-sh +#-- Purpose: Link a mach-o dynamic shared library for Darwin / Mac OS X +#-- Author: Gilles Depeyrot +#-- Copyright: (c) 2002 Gilles Depeyrot +#-- Licence: any use permitted +#----------------------------------------------------------------------------- + +verbose=0 +args="" +objects="" +linking_flag="-dynamiclib" +ldargs="-r -keep_private_externs -nostdlib" + +while test ${D}# -gt 0; do + case ${D}1 in + + -v) + verbose=1 + ;; + + -o|-compatibility_version|-current_version|-framework|-undefined|-install_name) + # collect these options and values + args="${D}{args} ${D}1 ${D}2" + shift + ;; + + -s|-Wl,*) + # collect these load args + ldargs="${D}{ldargs} ${D}1" + ;; + + -l*|-L*|-flat_namespace|-headerpad_max_install_names) + # collect these options + args="${D}{args} ${D}1" + ;; + + -dynamiclib|-bundle) + linking_flag="${D}1" + ;; + + -*) + echo "shared-ld: unhandled option '${D}1'" + exit 1 + ;; + + *.o | *.a | *.dylib) + # collect object files + objects="${D}{objects} ${D}1" + ;; + + *) + echo "shared-ld: unhandled argument '${D}1'" + exit 1 + ;; + + esac + shift +done + +status=0 + +# +# Link one module containing all the others +# +if test ${D}{verbose} = 1; then + echo "c++ ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o" +fi +c++ ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o +status=${D}? + +# +# Link the shared library from the single module created, but only if the +# previous command didn't fail: +# +if test ${D}{status} = 0; then + if test ${D}{verbose} = 1; then + echo "c++ ${D}{linking_flag} master.${D}${D}.o ${D}{args}" + fi + c++ ${D}{linking_flag} master.${D}${D}.o ${D}{args} + status=${D}? +fi + +# +# Remove intermediate module +# +rm -f master.${D}${D}.o + +exit ${D}status +EOF + + chmod +x shared-ld-sh + + SHARED_LD_MODULE_CC="`pwd`/shared-ld-sh -bundle -headerpad_max_install_names -o" + SHARED_LD_MODULE_CXX="$SHARED_LD_MODULE_CC" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc 3.1 or later" >&5 +$as_echo_n "checking for gcc 3.1 or later... " >&6; } +if ${bakefile_cv_gcc31+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + #if (__GNUC__ < 3) || \ + ((__GNUC__ == 3) && (__GNUC_MINOR__ < 1)) + This is old gcc + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + bakefile_cv_gcc31=yes + +else + + bakefile_cv_gcc31=no + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_gcc31" >&5 +$as_echo "$bakefile_cv_gcc31" >&6; } + if test "$bakefile_cv_gcc31" = "no"; then + SHARED_LD_CC="`pwd`/shared-ld-sh -dynamiclib -headerpad_max_install_names -o" + SHARED_LD_CXX="$SHARED_LD_CC" + else + SHARED_LD_CC="\${CC} -dynamiclib -single_module -headerpad_max_install_names -o" + SHARED_LD_CXX="\${CXX} -dynamiclib -single_module -headerpad_max_install_names -o" + fi + + if test "x$GCC" == "xyes"; then + PIC_FLAG="-dynamic -fPIC" + fi + if test "x$XLCC" = "xyes"; then + PIC_FLAG="-dynamic -DPIC" + fi + ;; + + *-*-aix* ) + if test "x$GCC" = "xyes"; then + PIC_FLAG="" + + case "${BAKEFILE_HOST}" in + *-*-aix5* ) + LD_EXPFULL="-Wl,-bexpfull" + ;; + esac + + SHARED_LD_CC="\$(CC) -shared $LD_EXPFULL -o" + SHARED_LD_CXX="\$(CXX) -shared $LD_EXPFULL -o" + else + # Extract the first word of "makeC++SharedLib", so it can be a program name with args. +set dummy makeC++SharedLib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AIX_CXX_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AIX_CXX_LD"; then + ac_cv_prog_AIX_CXX_LD="$AIX_CXX_LD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AIX_CXX_LD="makeC++SharedLib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_AIX_CXX_LD" && ac_cv_prog_AIX_CXX_LD="/usr/lpp/xlC/bin/makeC++SharedLib" +fi +fi +AIX_CXX_LD=$ac_cv_prog_AIX_CXX_LD +if test -n "$AIX_CXX_LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AIX_CXX_LD" >&5 +$as_echo "$AIX_CXX_LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + SHARED_LD_CC="$AIX_CC_LD -p 0 -o" + SHARED_LD_CXX="$AIX_CXX_LD -p 0 -o" + fi + ;; + + *-*-beos* ) + SHARED_LD_CC="${LD} -nostart -o" + SHARED_LD_CXX="${LD} -nostart -o" + ;; + + *-*-irix* ) + if test "x$GCC" != "xyes"; then + PIC_FLAG="-KPIC" + fi + ;; + + *-*-cygwin* | *-*-mingw32* ) + PIC_FLAG="" + SHARED_LD_CC="\$(CC) -shared -o" + SHARED_LD_CXX="\$(CXX) -shared -o" + WINDOWS_IMPLIB=1 + ;; + + *-pc-os2_emx | *-pc-os2-emx ) + SHARED_LD_CC="`pwd`/dllar.sh -libf INITINSTANCE -libf TERMINSTANCE -o" + SHARED_LD_CXX="`pwd`/dllar.sh -libf INITINSTANCE -libf TERMINSTANCE -o" + PIC_FLAG="" + +D='$' +cat <dllar.sh +#!/bin/sh +# +# dllar - a tool to build both a .dll and an .a file +# from a set of object (.o) files for EMX/OS2. +# +# Written by Andrew Zabolotny, bit@freya.etu.ru +# Ported to Unix like shell by Stefan Neis, Stefan.Neis@t-online.de +# +# This script will accept a set of files on the command line. +# All the public symbols from the .o files will be exported into +# a .DEF file, then linker will be run (through gcc) against them to +# build a shared library consisting of all given .o files. All libraries +# (.a) will be first decompressed into component .o files then act as +# described above. You can optionally give a description (-d "description") +# which will be put into .DLL. To see the list of accepted options (as well +# as command-line format) simply run this program without options. The .DLL +# is built to be imported by name (there is no guarantee that new versions +# of the library you build will have same ordinals for same symbols). +# +# dllar is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# dllar is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dllar; see the file COPYING. If not, write to the Free +# Software Foundation, 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# To successfuly run this program you will need: +# - Current drive should have LFN support (HPFS, ext2, network, etc) +# (Sometimes dllar generates filenames which won't fit 8.3 scheme) +# - gcc +# (used to build the .dll) +# - emxexp +# (used to create .def file from .o files) +# - emximp +# (used to create .a file from .def file) +# - GNU text utilites (cat, sort, uniq) +# used to process emxexp output +# - GNU file utilities (mv, rm) +# - GNU sed +# - lxlite (optional, see flag below) +# (used for general .dll cleanup) +# + +flag_USE_LXLITE=1; + +# +# helper functions +# basnam, variant of basename, which does _not_ remove the path, _iff_ +# second argument (suffix to remove) is given +basnam(){ + case ${D}# in + 1) + echo ${D}1 | sed 's/.*\\///' | sed 's/.*\\\\//' + ;; + 2) + echo ${D}1 | sed 's/'${D}2'${D}//' + ;; + *) + echo "error in basnam ${D}*" + exit 8 + ;; + esac +} + +# Cleanup temporary files and output +CleanUp() { + cd ${D}curDir + for i in ${D}inputFiles ; do + case ${D}i in + *!) + rm -rf \`basnam ${D}i !\` + ;; + *) + ;; + esac + done + + # Kill result in case of failure as there is just to many stupid make/nmake + # things out there which doesn't do this. + if @<:@ ${D}# -eq 0 @:>@; then + rm -f ${D}arcFile ${D}arcFile2 ${D}defFile ${D}dllFile + fi +} + +# Print usage and exit script with rc=1. +PrintHelp() { + echo 'Usage: dllar.sh @<:@-o@<:@utput@:>@ output_file@:>@ @<:@-i@<:@mport@:>@ importlib_name@:>@' + echo ' @<:@-name-mangler-script script.sh@:>@' + echo ' @<:@-d@<:@escription@:>@ "dll descrption"@:>@ @<:@-cc "CC"@:>@ @<:@-f@<:@lags@:>@ "CFLAGS"@:>@' + echo ' @<:@-ord@<:@inals@:>@@:>@ -ex@<:@clude@:>@ "symbol(s)"' + echo ' @<:@-libf@<:@lags@:>@ "{INIT|TERM}{GLOBAL|INSTANCE}"@:>@ @<:@-nocrt@<:@dll@:>@@:>@ @<:@-nolxl@<:@ite@:>@@:>@' + echo ' @<:@*.o@:>@ @<:@*.a@:>@' + echo '*> "output_file" should have no extension.' + echo ' If it has the .o, .a or .dll extension, it is automatically removed.' + echo ' The import library name is derived from this and is set to "name".a,' + echo ' unless overridden by -import' + echo '*> "importlib_name" should have no extension.' + echo ' If it has the .o, or .a extension, it is automatically removed.' + echo ' This name is used as the import library name and may be longer and' + echo ' more descriptive than the DLL name which has to follow the old ' + echo ' 8.3 convention of FAT.' + echo '*> "script.sh may be given to override the output_file name by a' + echo ' different name. It is mainly useful if the regular make process' + echo ' of some package does not take into account OS/2 restriction of' + echo ' DLL name lengths. It takes the importlib name as input and is' + echo ' supposed to procude a shorter name as output. The script should' + echo ' expect to get importlib_name without extension and should produce' + echo ' a (max.) 8 letter name without extension.' + echo '*> "cc" is used to use another GCC executable. (default: gcc.exe)' + echo '*> "flags" should be any set of valid GCC flags. (default: -s -Zcrtdll)' + echo ' These flags will be put at the start of GCC command line.' + echo '*> -ord@<:@inals@:>@ tells dllar to export entries by ordinals. Be careful.' + echo '*> -ex@<:@clude@:>@ defines symbols which will not be exported. You can define' + echo ' multiple symbols, for example -ex "myfunc yourfunc _GLOBAL*".' + echo ' If the last character of a symbol is "*", all symbols beginning' + echo ' with the prefix before "*" will be exclude, (see _GLOBAL* above).' + echo '*> -libf@<:@lags@:>@ can be used to add INITGLOBAL/INITINSTANCE and/or' + echo ' TERMGLOBAL/TERMINSTANCE flags to the dynamically-linked library.' + echo '*> -nocrt@<:@dll@:>@ switch will disable linking the library against emx''s' + echo ' C runtime DLLs.' + echo '*> -nolxl@<:@ite@:>@ switch will disable running lxlite on the resulting DLL.' + echo '*> All other switches (for example -L./ or -lmylib) will be passed' + echo ' unchanged to GCC at the end of command line.' + echo '*> If you create a DLL from a library and you do not specify -o,' + echo ' the basename for DLL and import library will be set to library name,' + echo ' the initial library will be renamed to 'name'_s.a (_s for static)' + echo ' i.e. "dllar gcc.a" will create gcc.dll and gcc.a, and the initial' + echo ' library will be renamed into gcc_s.a.' + echo '--------' + echo 'Example:' + echo ' dllar -o gcc290.dll libgcc.a -d "GNU C runtime library" -ord' + echo ' -ex "__main __ctordtor*" -libf "INITINSTANCE TERMINSTANCE"' + CleanUp + exit 1 +} + +# Execute a command. +# If exit code of the commnad <> 0 CleanUp() is called and we'll exit the script. +# @Uses Whatever CleanUp() uses. +doCommand() { + echo "${D}*" + eval ${D}* + rcCmd=${D}? + + if @<:@ ${D}rcCmd -ne 0 @:>@; then + echo "command failed, exit code="${D}rcCmd + CleanUp + exit ${D}rcCmd + fi +} + +# main routine +# setup globals +cmdLine=${D}* +outFile="" +outimpFile="" +inputFiles="" +renameScript="" +description="" +CC=gcc.exe +CFLAGS="-s -Zcrtdll" +EXTRA_CFLAGS="" +EXPORT_BY_ORDINALS=0 +exclude_symbols="" +library_flags="" +curDir=\`pwd\` +curDirS=curDir +case ${D}curDirS in +*/) + ;; +*) + curDirS=${D}{curDirS}"/" + ;; +esac +# Parse commandline +libsToLink=0 +omfLinking=0 +while @<:@ ${D}1 @:>@; do + case ${D}1 in + -ord*) + EXPORT_BY_ORDINALS=1; + ;; + -o*) + shift + outFile=${D}1 + ;; + -i*) + shift + outimpFile=${D}1 + ;; + -name-mangler-script) + shift + renameScript=${D}1 + ;; + -d*) + shift + description=${D}1 + ;; + -f*) + shift + CFLAGS=${D}1 + ;; + -c*) + shift + CC=${D}1 + ;; + -h*) + PrintHelp + ;; + -ex*) + shift + exclude_symbols=${D}{exclude_symbols}${D}1" " + ;; + -libf*) + shift + library_flags=${D}{library_flags}${D}1" " + ;; + -nocrt*) + CFLAGS="-s" + ;; + -nolxl*) + flag_USE_LXLITE=0 + ;; + -* | /*) + case ${D}1 in + -L* | -l*) + libsToLink=1 + ;; + -Zomf) + omfLinking=1 + ;; + *) + ;; + esac + EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1 + ;; + *.dll) + EXTRA_CFLAGS="${D}{EXTRA_CFLAGS} \`basnam ${D}1 .dll\`" + if @<:@ ${D}omfLinking -eq 1 @:>@; then + EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.lib" + else + EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.a" + fi + ;; + *) + found=0; + if @<:@ ${D}libsToLink -ne 0 @:>@; then + EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1 + else + for file in ${D}1 ; do + if @<:@ -f ${D}file @:>@; then + inputFiles="${D}{inputFiles} ${D}file" + found=1 + fi + done + if @<:@ ${D}found -eq 0 @:>@; then + echo "ERROR: No file(s) found: "${D}1 + exit 8 + fi + fi + ;; + esac + shift +done # iterate cmdline words + +# +if @<:@ -z "${D}inputFiles" @:>@; then + echo "dllar: no input files" + PrintHelp +fi + +# Now extract all .o files from .a files +newInputFiles="" +for file in ${D}inputFiles ; do + case ${D}file in + *.a | *.lib) + case ${D}file in + *.a) + suffix=".a" + AR="ar" + ;; + *.lib) + suffix=".lib" + AR="emxomfar" + EXTRA_CFLAGS="${D}EXTRA_CFLAGS -Zomf" + ;; + *) + ;; + esac + dirname=\`basnam ${D}file ${D}suffix\`"_%" + mkdir ${D}dirname + if @<:@ ${D}? -ne 0 @:>@; then + echo "Failed to create subdirectory ./${D}dirname" + CleanUp + exit 8; + fi + # Append '!' to indicate archive + newInputFiles="${D}newInputFiles ${D}{dirname}!" + doCommand "cd ${D}dirname; ${D}AR x ../${D}file" + cd ${D}curDir + found=0; + for subfile in ${D}dirname/*.o* ; do + if @<:@ -f ${D}subfile @:>@; then + found=1 + if @<:@ -s ${D}subfile @:>@; then + # FIXME: This should be: is file size > 32 byte, _not_ > 0! + newInputFiles="${D}newInputFiles ${D}subfile" + fi + fi + done + if @<:@ ${D}found -eq 0 @:>@; then + echo "WARNING: there are no files in archive \\'${D}file\\'" + fi + ;; + *) + newInputFiles="${D}{newInputFiles} ${D}file" + ;; + esac +done +inputFiles="${D}newInputFiles" + +# Output filename(s). +do_backup=0; +if @<:@ -z ${D}outFile @:>@; then + do_backup=1; + set outFile ${D}inputFiles; outFile=${D}2 +fi + +# If it is an archive, remove the '!' and the '_%' suffixes +case ${D}outFile in +*_%!) + outFile=\`basnam ${D}outFile _%!\` + ;; +*) + ;; +esac +case ${D}outFile in +*.dll) + outFile=\`basnam ${D}outFile .dll\` + ;; +*.DLL) + outFile=\`basnam ${D}outFile .DLL\` + ;; +*.o) + outFile=\`basnam ${D}outFile .o\` + ;; +*.obj) + outFile=\`basnam ${D}outFile .obj\` + ;; +*.a) + outFile=\`basnam ${D}outFile .a\` + ;; +*.lib) + outFile=\`basnam ${D}outFile .lib\` + ;; +*) + ;; +esac +case ${D}outimpFile in +*.a) + outimpFile=\`basnam ${D}outimpFile .a\` + ;; +*.lib) + outimpFile=\`basnam ${D}outimpFile .lib\` + ;; +*) + ;; +esac +if @<:@ -z ${D}outimpFile @:>@; then + outimpFile=${D}outFile +fi +defFile="${D}{outFile}.def" +arcFile="${D}{outimpFile}.a" +arcFile2="${D}{outimpFile}.lib" + +#create ${D}dllFile as something matching 8.3 restrictions, +if @<:@ -z ${D}renameScript @:>@ ; then + dllFile="${D}outFile" +else + dllFile=\`${D}renameScript ${D}outimpFile\` +fi + +if @<:@ ${D}do_backup -ne 0 @:>@ ; then + if @<:@ -f ${D}arcFile @:>@ ; then + doCommand "mv ${D}arcFile ${D}{outFile}_s.a" + fi + if @<:@ -f ${D}arcFile2 @:>@ ; then + doCommand "mv ${D}arcFile2 ${D}{outFile}_s.lib" + fi +fi + +# Extract public symbols from all the object files. +tmpdefFile=${D}{defFile}_% +rm -f ${D}tmpdefFile +for file in ${D}inputFiles ; do + case ${D}file in + *!) + ;; + *) + doCommand "emxexp -u ${D}file >> ${D}tmpdefFile" + ;; + esac +done + +# Create the def file. +rm -f ${D}defFile +echo "LIBRARY \`basnam ${D}dllFile\` ${D}library_flags" >> ${D}defFile +dllFile="${D}{dllFile}.dll" +if @<:@ ! -z ${D}description @:>@; then + echo "DESCRIPTION \\"${D}{description}\\"" >> ${D}defFile +fi +echo "EXPORTS" >> ${D}defFile + +doCommand "cat ${D}tmpdefFile | sort.exe | uniq.exe > ${D}{tmpdefFile}%" +grep -v "^ *;" < ${D}{tmpdefFile}% | grep -v "^ *${D}" >${D}tmpdefFile + +# Checks if the export is ok or not. +for word in ${D}exclude_symbols; do + grep -v ${D}word < ${D}tmpdefFile >${D}{tmpdefFile}% + mv ${D}{tmpdefFile}% ${D}tmpdefFile +done + + +if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then + sed "=" < ${D}tmpdefFile | \\ + sed ' + N + : loop + s/^\\(@<:@0-9@:>@\\+\\)\\(@<:@^;@:>@*\\)\\(;.*\\)\\?/\\2 @\\1 NONAME/ + t loop + ' > ${D}{tmpdefFile}% + grep -v "^ *${D}" < ${D}{tmpdefFile}% > ${D}tmpdefFile +else + rm -f ${D}{tmpdefFile}% +fi +cat ${D}tmpdefFile >> ${D}defFile +rm -f ${D}tmpdefFile + +# Do linking, create implib, and apply lxlite. +gccCmdl=""; +for file in ${D}inputFiles ; do + case ${D}file in + *!) + ;; + *) + gccCmdl="${D}gccCmdl ${D}file" + ;; + esac +done +doCommand "${D}CC ${D}CFLAGS -Zdll -o ${D}dllFile ${D}defFile ${D}gccCmdl ${D}EXTRA_CFLAGS" +touch "${D}{outFile}.dll" + +doCommand "emximp -o ${D}arcFile ${D}defFile" +if @<:@ ${D}flag_USE_LXLITE -ne 0 @:>@; then + add_flags=""; + if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then + add_flags="-ynd" + fi + doCommand "lxlite -cs -t: -mrn -mln ${D}add_flags ${D}dllFile" +fi +doCommand "emxomf -s -l ${D}arcFile" + +# Successful exit. +CleanUp 1 +exit 0 +EOF + + chmod +x dllar.sh + ;; + + powerpc-apple-macos* | \ + *-*-freebsd* | *-*-openbsd* | *-*-netbsd* | *-*-k*bsd*-gnu | \ + *-*-mirbsd* | \ + *-*-sunos4* | \ + *-*-osf* | \ + *-*-dgux5* | \ + *-*-sysv5* | \ + *-pc-msdosdjgpp ) + ;; + + *) + as_fn_error $? "unknown system type $BAKEFILE_HOST." "$LINENO" 5 + esac + + if test "x$PIC_FLAG" != "x" ; then + PIC_FLAG="$PIC_FLAG -DPIC" + fi + + if test "x$SHARED_LD_MODULE_CC" = "x" ; then + SHARED_LD_MODULE_CC="$SHARED_LD_CC" + fi + if test "x$SHARED_LD_MODULE_CXX" = "x" ; then + SHARED_LD_MODULE_CXX="$SHARED_LD_CXX" + fi + + + + + + + + + + USE_SOVERSION=0 + USE_SOVERLINUX=0 + USE_SOVERSOLARIS=0 + USE_SOVERCYGWIN=0 + USE_SOSYMLINKS=0 + USE_MACVERSION=0 + SONAME_FLAG= + + case "${BAKEFILE_HOST}" in + *-*-linux* | *-*-freebsd* | *-*-k*bsd*-gnu ) + SONAME_FLAG="-Wl,-soname," + USE_SOVERSION=1 + USE_SOVERLINUX=1 + USE_SOSYMLINKS=1 + ;; + + *-*-solaris2* ) + SONAME_FLAG="-h " + USE_SOVERSION=1 + USE_SOVERSOLARIS=1 + USE_SOSYMLINKS=1 + ;; + + *-*-darwin* ) + USE_MACVERSION=1 + USE_SOVERSION=1 + USE_SOSYMLINKS=1 + ;; + + *-*-cygwin* ) + USE_SOVERSION=1 + USE_SOVERCYGWIN=1 + ;; + esac + + + + + + + + + + + @%:@ Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; bk_use_trackdeps="$enableval" +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dependency tracking method" >&5 +$as_echo_n "checking for dependency tracking method... " >&6; } + + BK_DEPS="" + if test "x$bk_use_trackdeps" = "xno" ; then + DEPS_TRACKING=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } + else + DEPS_TRACKING=1 + + if test "x$GCC" = "xyes"; then + DEPSMODE=gcc + case "${BAKEFILE_HOST}" in + *-*-darwin* ) + DEPSFLAG="-no-cpp-precomp -MMD" + ;; + * ) + DEPSFLAG="-MMD" + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: gcc" >&5 +$as_echo "gcc" >&6; } + elif test "x$MWCC" = "xyes"; then + DEPSMODE=mwcc + DEPSFLAG="-MM" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: mwcc" >&5 +$as_echo "mwcc" >&6; } + elif test "x$SUNCC" = "xyes"; then + DEPSMODE=unixcc + DEPSFLAG="-xM1" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Sun cc" >&5 +$as_echo "Sun cc" >&6; } + elif test "x$SGICC" = "xyes"; then + DEPSMODE=unixcc + DEPSFLAG="-M" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: SGI cc" >&5 +$as_echo "SGI cc" >&6; } + elif test "x$HPCC" = "xyes"; then + DEPSMODE=unixcc + DEPSFLAG="+make" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: HP cc" >&5 +$as_echo "HP cc" >&6; } + elif test "x$COMPAQCC" = "xyes"; then + DEPSMODE=gcc + DEPSFLAG="-MD" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Compaq cc" >&5 +$as_echo "Compaq cc" >&6; } + else + DEPS_TRACKING=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } + fi + + if test $DEPS_TRACKING = 1 ; then + +D='$' +cat <bk-deps +#!/bin/sh + +# This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf +# script. It is used to track C/C++ files dependencies in portable way. +# +# Permission is given to use this file in any way. + +DEPSMODE=${DEPSMODE} +DEPSDIR=.deps +DEPSFLAG="${DEPSFLAG}" + +mkdir -p ${D}DEPSDIR + +if test ${D}DEPSMODE = gcc ; then + ${D}* ${D}{DEPSFLAG} + status=${D}? + if test ${D}{status} != 0 ; then + exit ${D}{status} + fi + # move created file to the location we want it in: + while test ${D}# -gt 0; do + case "${D}1" in + -o ) + shift + objfile=${D}1 + ;; + -* ) + ;; + * ) + srcfile=${D}1 + ;; + esac + shift + done + depfile=\`basename ${D}srcfile | sed -e 's/\\..*${D}/.d/g'\` + depobjname=\`echo ${D}depfile |sed -e 's/\\.d/.o/g'\` + if test -f ${D}depfile ; then + sed -e "s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{DEPSDIR}/${D}{objfile}.d + rm -f ${D}depfile + else + # "g++ -MMD -o fooobj.o foosrc.cpp" produces fooobj.d + depfile=\`basename ${D}objfile | sed -e 's/\\..*${D}/.d/g'\` + if test ! -f ${D}depfile ; then + # "cxx -MD -o fooobj.o foosrc.cpp" creates fooobj.o.d (Compaq C++) + depfile="${D}objfile.d" + fi + if test -f ${D}depfile ; then + sed -e "/^${D}objfile/!s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{DEPSDIR}/${D}{objfile}.d + rm -f ${D}depfile + fi + fi + exit 0 +elif test ${D}DEPSMODE = mwcc ; then + ${D}* || exit ${D}? + # Run mwcc again with -MM and redirect into the dep file we want + # NOTE: We can't use shift here because we need ${D}* to be valid + prevarg= + for arg in ${D}* ; do + if test "${D}prevarg" = "-o"; then + objfile=${D}arg + else + case "${D}arg" in + -* ) + ;; + * ) + srcfile=${D}arg + ;; + esac + fi + prevarg="${D}arg" + done + ${D}* ${D}DEPSFLAG >${D}{DEPSDIR}/${D}{objfile}.d + exit 0 +elif test ${D}DEPSMODE = unixcc; then + ${D}* || exit ${D}? + # Run compiler again with deps flag and redirect into the dep file. + # It doesn't work if the '-o FILE' option is used, but without it the + # dependency file will contain the wrong name for the object. So it is + # removed from the command line, and the dep file is fixed with sed. + cmd="" + while test ${D}# -gt 0; do + case "${D}1" in + -o ) + shift + objfile=${D}1 + ;; + * ) + eval arg${D}#=\\${D}1 + cmd="${D}cmd \\${D}arg${D}#" + ;; + esac + shift + done + eval "${D}cmd ${D}DEPSFLAG" | sed "s|.*:|${D}objfile:|" >${D}{DEPSDIR}/${D}{objfile}.d + exit 0 +else + ${D}* + exit ${D}? +fi +EOF + + chmod +x bk-deps + BK_DEPS="`pwd`/bk-deps" + fi + fi + + + + + + case ${BAKEFILE_HOST} in + *-*-cygwin* | *-*-mingw32* ) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. +set dummy ${ac_tool_prefix}windres; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_WINDRES+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$WINDRES"; then + ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_WINDRES="${ac_tool_prefix}windres" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +WINDRES=$ac_cv_prog_WINDRES +if test -n "$WINDRES"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5 +$as_echo "$WINDRES" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_WINDRES"; then + ac_ct_WINDRES=$WINDRES + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_WINDRES+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_WINDRES"; then + ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_WINDRES="windres" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES +if test -n "$ac_ct_WINDRES"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5 +$as_echo "$ac_ct_WINDRES" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_WINDRES" = x; then + WINDRES="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + WINDRES=$ac_ct_WINDRES + fi +else + WINDRES="$ac_cv_prog_WINDRES" +fi + + ;; + + *-*-darwin* | powerpc-apple-macos* ) + # Extract the first word of "Rez", so it can be a program name with args. +set dummy Rez; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_REZ+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$REZ"; then + ac_cv_prog_REZ="$REZ" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_REZ="Rez" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_REZ" && ac_cv_prog_REZ="/Developer/Tools/Rez" +fi +fi +REZ=$ac_cv_prog_REZ +if test -n "$REZ"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $REZ" >&5 +$as_echo "$REZ" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "SetFile", so it can be a program name with args. +set dummy SetFile; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_SETFILE+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$SETFILE"; then + ac_cv_prog_SETFILE="$SETFILE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_SETFILE="SetFile" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_SETFILE" && ac_cv_prog_SETFILE="/Developer/Tools/SetFile" +fi +fi +SETFILE=$ac_cv_prog_SETFILE +if test -n "$SETFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SETFILE" >&5 +$as_echo "$SETFILE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + ;; + esac + + + + + + + BAKEFILE_BAKEFILE_M4_VERSION="0.2.2" + + +BAKEFILE_AUTOCONF_INC_M4_VERSION="0.2.2" + + COND_DEPS_TRACKING_0="#" + if test "x$DEPS_TRACKING" = "x0" ; then + COND_DEPS_TRACKING_0="" + fi + + COND_DEPS_TRACKING_1="#" + if test "x$DEPS_TRACKING" = "x1" ; then + COND_DEPS_TRACKING_1="" + fi + + + + if test "$BAKEFILE_AUTOCONF_INC_M4_VERSION" = "" ; then + as_fn_error $? "No version found in autoconf_inc.m4 - bakefile macro was changed to take additional argument, perhaps configure.in wasn't updated (see the documentation)?" "$LINENO" 5 + fi + + if test "$BAKEFILE_BAKEFILE_M4_VERSION" != "$BAKEFILE_AUTOCONF_INC_M4_VERSION" ; then + as_fn_error $? "Versions of Bakefile used to generate makefiles ($BAKEFILE_AUTOCONF_INC_M4_VERSION) and configure ($BAKEFILE_BAKEFILE_M4_VERSION) do not match." "$LINENO" 5 + fi + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + diff --git a/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/requests b/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/requests new file mode 100644 index 0000000..a4291b5 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/requests @@ -0,0 +1,106 @@ +# This file was generated by Autom4te Sun Sep 7 11:40:11 UTC 2014. +# It contains the lists of macros which have been traced. +# It can be safely removed. + +@request = ( + bless( [ + '0', + 1, + [ + '/usr/share/autoconf' + ], + [ + '/usr/share/autoconf/autoconf/autoconf.m4f', + '-', + '/usr/share/aclocal-1.14/internal/ac-config-macro-dirs.m4', + 'configure.ac' + ], + { + 'AC_CONFIG_MACRO_DIR' => 1, + 'include' => 1, + 'm4_include' => 1, + 'AC_DEFUN' => 1, + 'm4_pattern_allow' => 1, + 'AU_DEFUN' => 1, + '_m4_warn' => 1, + '_AM_AUTOCONF_VERSION' => 1, + '_AM_CONFIG_MACRO_DIRS' => 1, + 'AC_DEFUN_ONCE' => 1, + 'AC_CONFIG_MACRO_DIR_TRACE' => 1, + 'm4_pattern_forbid' => 1 + } + ], 'Autom4te::Request' ), + bless( [ + '1', + 1, + [ + '/usr/share/autoconf' + ], + [ + '/usr/share/autoconf/autoconf/autoconf.m4f', + 'aclocal.m4', + 'configure.ac' + ], + { + '_AM_COND_ELSE' => 1, + 'AC_FC_FREEFORM' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AM_NLS' => 1, + 'm4_pattern_forbid' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AC_LIBSOURCE' => 1, + 'AM_GNU_GETTEXT' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'include' => 1, + '_AM_MAKEFILE_INCLUDE' => 1, + 'AC_PROG_LIBTOOL' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'AC_CONFIG_FILES' => 1, + 'AM_PROG_MOC' => 1, + 'AC_CONFIG_LINKS' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'm4_pattern_allow' => 1, + '_AM_COND_ENDIF' => 1, + 'AC_CANONICAL_HOST' => 1, + 'AM_PROG_F77_C_O' => 1, + 'sinclude' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AM_XGETTEXT_OPTION' => 1, + 'AM_POT_TOOLS' => 1, + 'AM_PROG_CXX_C_O' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_PROG_LIBTOOL' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + 'm4_sinclude' => 1, + 'AC_FC_PP_SRCEXT' => 1, + 'AC_SUBST_TRACE' => 1, + '_AM_COND_IF' => 1, + 'AC_FC_PP_DEFINE' => 1, + '_m4_warn' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AC_INIT' => 1, + 'AM_CONDITIONAL' => 1, + 'AC_SUBST' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, + 'AM_PROG_AR' => 1, + 'm4_include' => 1, + 'AM_MAKEFILE_INCLUDE' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_SILENT_RULES' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'AM_PROG_FC_C_O' => 1, + 'AM_PATH_GUILE' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'AC_CANONICAL_BUILD' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AC_CANONICAL_TARGET' => 1, + 'AH_OUTPUT' => 1, + 'AC_FC_SRCEXT' => 1, + 'AM_PROG_CC_C_O' => 1, + 'LT_INIT' => 1 + } + ], 'Autom4te::Request' ) + ); + diff --git a/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/traces.0 b/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/traces.0 new file mode 100644 index 0000000..ebae358 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/traces.0 @@ -0,0 +1,70 @@ +m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:2: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:2: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:2: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:2: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:3: -1- _m4_warn([obsolete], [The macro `AC_CANONICAL_SYSTEM' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:1857: AC_CANONICAL_SYSTEM is expanded from... +configure.ac:3: the top level]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^build$]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^host$]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^host_cpu$]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^host_vendor$]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^host_os$]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^target$]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^target_cpu$]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^target_vendor$]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^target_os$]) +m4trace:configure.ac:6: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.ac:6: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^LTLIBOBJS$]) diff --git a/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/traces.1 b/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/traces.1 new file mode 100644 index 0000000..8a6289f --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/autom4te.cache/traces.1 @@ -0,0 +1,437 @@ +m4trace:configure.ac:2: -1- AC_INIT([aclocal.m4]) +m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:2: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:2: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:2: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:2: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:2: -1- AC_SUBST([SHELL]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([SHELL]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:2: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_NAME]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_STRING]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_URL]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:2: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([exec_prefix]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:2: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([prefix]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:2: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([program_transform_name]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:2: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([bindir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:2: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([sbindir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:2: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([libexecdir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:2: -1- AC_SUBST([datarootdir], ['${prefix}/share']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:2: -1- AC_SUBST([datadir], ['${datarootdir}']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([datadir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:2: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([sysconfdir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:2: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([sharedstatedir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:2: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([localstatedir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:2: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([includedir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:2: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([oldincludedir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:2: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:2: -1- AC_SUBST([infodir], ['${datarootdir}/info']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([infodir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:2: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:2: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:2: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:2: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:2: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([libdir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:2: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:2: -1- AC_SUBST([mandir], ['${datarootdir}/man']) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([mandir]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +@%:@undef PACKAGE_NAME]) +m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +@%:@undef PACKAGE_TARNAME]) +m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +@%:@undef PACKAGE_VERSION]) +m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +@%:@undef PACKAGE_STRING]) +m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +@%:@undef PACKAGE_BUGREPORT]) +m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ +@%:@undef PACKAGE_URL]) +m4trace:configure.ac:2: -1- AC_SUBST([DEFS]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([DEFS]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:2: -1- AC_SUBST([ECHO_C]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([ECHO_C]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:2: -1- AC_SUBST([ECHO_N]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([ECHO_N]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:2: -1- AC_SUBST([ECHO_T]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([ECHO_T]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:2: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:2: -1- AC_SUBST([build_alias]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([build_alias]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:2: -1- AC_SUBST([host_alias]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([host_alias]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:2: -1- AC_SUBST([target_alias]) +m4trace:configure.ac:2: -1- AC_SUBST_TRACE([target_alias]) +m4trace:configure.ac:2: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:3: -1- AC_CANONICAL_SYSTEM +m4trace:configure.ac:3: -1- _m4_warn([obsolete], [The macro `AC_CANONICAL_SYSTEM' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:1857: AC_CANONICAL_SYSTEM is expanded from... +configure.ac:3: the top level]) +m4trace:configure.ac:3: -1- AC_CANONICAL_TARGET +m4trace:configure.ac:3: -1- AC_CANONICAL_HOST +m4trace:configure.ac:3: -1- AC_CANONICAL_BUILD +m4trace:configure.ac:3: -1- AC_REQUIRE_AUX_FILE([config.sub]) +m4trace:configure.ac:3: -1- AC_REQUIRE_AUX_FILE([config.guess]) +m4trace:configure.ac:3: -1- AC_SUBST([build], [$ac_cv_build]) +m4trace:configure.ac:3: -1- AC_SUBST_TRACE([build]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^build$]) +m4trace:configure.ac:3: -1- AC_SUBST([build_cpu], [$[1]]) +m4trace:configure.ac:3: -1- AC_SUBST_TRACE([build_cpu]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.ac:3: -1- AC_SUBST([build_vendor], [$[2]]) +m4trace:configure.ac:3: -1- AC_SUBST_TRACE([build_vendor]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.ac:3: -1- AC_SUBST([build_os]) +m4trace:configure.ac:3: -1- AC_SUBST_TRACE([build_os]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.ac:3: -1- AC_SUBST([host], [$ac_cv_host]) +m4trace:configure.ac:3: -1- AC_SUBST_TRACE([host]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^host$]) +m4trace:configure.ac:3: -1- AC_SUBST([host_cpu], [$[1]]) +m4trace:configure.ac:3: -1- AC_SUBST_TRACE([host_cpu]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^host_cpu$]) +m4trace:configure.ac:3: -1- AC_SUBST([host_vendor], [$[2]]) +m4trace:configure.ac:3: -1- AC_SUBST_TRACE([host_vendor]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^host_vendor$]) +m4trace:configure.ac:3: -1- AC_SUBST([host_os]) +m4trace:configure.ac:3: -1- AC_SUBST_TRACE([host_os]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^host_os$]) +m4trace:configure.ac:3: -1- AC_SUBST([target], [$ac_cv_target]) +m4trace:configure.ac:3: -1- AC_SUBST_TRACE([target]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^target$]) +m4trace:configure.ac:3: -1- AC_SUBST([target_cpu], [$[1]]) +m4trace:configure.ac:3: -1- AC_SUBST_TRACE([target_cpu]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^target_cpu$]) +m4trace:configure.ac:3: -1- AC_SUBST([target_vendor], [$[2]]) +m4trace:configure.ac:3: -1- AC_SUBST_TRACE([target_vendor]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^target_vendor$]) +m4trace:configure.ac:3: -1- AC_SUBST([target_os]) +m4trace:configure.ac:3: -1- AC_SUBST_TRACE([target_os]) +m4trace:configure.ac:3: -1- m4_pattern_allow([^target_os$]) +m4trace:configure.ac:5: -1- AC_SUBST([RANLIB]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([RANLIB]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.ac:5: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:5: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:5: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:5: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:5: -1- AC_SUBST([LN_S], [$as_ln_s]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([LN_S]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^LN_S$]) +m4trace:configure.ac:5: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SET_MAKE]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:5: -1- AC_SUBST([MAKE_SET]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([MAKE_SET]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^MAKE_SET$]) +m4trace:configure.ac:5: -1- AC_SUBST([AR]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^AR$]) +m4trace:configure.ac:5: -1- AC_SUBST([AR]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^AR$]) +m4trace:configure.ac:5: -1- AC_SUBST([AR]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^AR$]) +m4trace:configure.ac:5: -1- AC_SUBST([AROPTIONS]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([AROPTIONS]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^AROPTIONS$]) +m4trace:configure.ac:5: -1- AC_SUBST([STRIP]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:5: -1- AC_SUBST([NM]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([NM]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^NM$]) +m4trace:configure.ac:5: -1- AC_SUBST([INSTALL_DIR]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([INSTALL_DIR]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^INSTALL_DIR$]) +m4trace:configure.ac:5: -1- AC_SUBST([LDFLAGS_GUI]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([LDFLAGS_GUI]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^LDFLAGS_GUI$]) +m4trace:configure.ac:5: -1- AC_SUBST([IF_GNU_MAKE]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([IF_GNU_MAKE]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^IF_GNU_MAKE$]) +m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_UNIX]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_UNIX]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_UNIX$]) +m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_WIN32]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_WIN32]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_WIN32$]) +m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_MSDOS]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_MSDOS]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_MSDOS$]) +m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_MAC]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_MAC]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_MAC$]) +m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_MACOS]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_MACOS]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_MACOS$]) +m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_MACOSX]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_MACOSX]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_MACOSX$]) +m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_OS2]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_OS2]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_OS2$]) +m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_BEOS]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_BEOS]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_BEOS$]) +m4trace:configure.ac:5: -1- AC_SUBST([SO_SUFFIX]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SO_SUFFIX]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^SO_SUFFIX$]) +m4trace:configure.ac:5: -1- AC_SUBST([SO_SUFFIX_MODULE]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SO_SUFFIX_MODULE]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^SO_SUFFIX_MODULE$]) +m4trace:configure.ac:5: -1- AC_SUBST([DLLIMP_SUFFIX]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([DLLIMP_SUFFIX]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^DLLIMP_SUFFIX$]) +m4trace:configure.ac:5: -1- AC_SUBST([EXEEXT]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:5: -1- AC_SUBST([LIBPREFIX]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([LIBPREFIX]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^LIBPREFIX$]) +m4trace:configure.ac:5: -1- AC_SUBST([LIBEXT]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([LIBEXT]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^LIBEXT$]) +m4trace:configure.ac:5: -1- AC_SUBST([DLLPREFIX]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([DLLPREFIX]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^DLLPREFIX$]) +m4trace:configure.ac:5: -1- AC_SUBST([DLLPREFIX_MODULE]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([DLLPREFIX_MODULE]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^DLLPREFIX_MODULE$]) +m4trace:configure.ac:5: -1- AC_SUBST([dlldir]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([dlldir]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^dlldir$]) +m4trace:configure.ac:5: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from... +../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from... +../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from... +aclocal.m4:780: AC_BAKEFILE_SHARED_LD is expanded from... +aclocal.m4:1299: AC_BAKEFILE is expanded from... +configure.ac:5: the top level]) +m4trace:configure.ac:5: -1- AC_SUBST([CC]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:5: -1- AC_SUBST([CFLAGS]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CFLAGS]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:5: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:5: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:5: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:5: -1- AC_SUBST([CC]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:5: -1- AC_SUBST([CC]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:5: -1- AC_SUBST([CC]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:5: -1- AC_SUBST([CC]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:5: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([ac_ct_CC]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:5: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:5: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([OBJEXT]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:5: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from... +../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from... +../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from... +aclocal.m4:780: AC_BAKEFILE_SHARED_LD is expanded from... +aclocal.m4:1299: AC_BAKEFILE is expanded from... +configure.ac:5: the top level]) +m4trace:configure.ac:5: -1- AC_SUBST([AIX_CXX_LD]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([AIX_CXX_LD]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^AIX_CXX_LD$]) +m4trace:configure.ac:5: -1- AC_SUBST([SHARED_LD_CC]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SHARED_LD_CC]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^SHARED_LD_CC$]) +m4trace:configure.ac:5: -1- AC_SUBST([SHARED_LD_CXX]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SHARED_LD_CXX]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^SHARED_LD_CXX$]) +m4trace:configure.ac:5: -1- AC_SUBST([SHARED_LD_MODULE_CC]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SHARED_LD_MODULE_CC]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^SHARED_LD_MODULE_CC$]) +m4trace:configure.ac:5: -1- AC_SUBST([SHARED_LD_MODULE_CXX]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SHARED_LD_MODULE_CXX]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^SHARED_LD_MODULE_CXX$]) +m4trace:configure.ac:5: -1- AC_SUBST([PIC_FLAG]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PIC_FLAG]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^PIC_FLAG$]) +m4trace:configure.ac:5: -1- AC_SUBST([WINDOWS_IMPLIB]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([WINDOWS_IMPLIB]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^WINDOWS_IMPLIB$]) +m4trace:configure.ac:5: -1- AC_SUBST([USE_SOVERSION]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([USE_SOVERSION]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^USE_SOVERSION$]) +m4trace:configure.ac:5: -1- AC_SUBST([USE_SOVERLINUX]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([USE_SOVERLINUX]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^USE_SOVERLINUX$]) +m4trace:configure.ac:5: -1- AC_SUBST([USE_SOVERSOLARIS]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([USE_SOVERSOLARIS]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^USE_SOVERSOLARIS$]) +m4trace:configure.ac:5: -1- AC_SUBST([USE_SOVERCYGWIN]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([USE_SOVERCYGWIN]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^USE_SOVERCYGWIN$]) +m4trace:configure.ac:5: -1- AC_SUBST([USE_MACVERSION]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([USE_MACVERSION]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^USE_MACVERSION$]) +m4trace:configure.ac:5: -1- AC_SUBST([USE_SOSYMLINKS]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([USE_SOSYMLINKS]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^USE_SOSYMLINKS$]) +m4trace:configure.ac:5: -1- AC_SUBST([SONAME_FLAG]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SONAME_FLAG]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^SONAME_FLAG$]) +m4trace:configure.ac:5: -1- AC_SUBST([DEPS_TRACKING]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([DEPS_TRACKING]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^DEPS_TRACKING$]) +m4trace:configure.ac:5: -1- AC_SUBST([BK_DEPS]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([BK_DEPS]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^BK_DEPS$]) +m4trace:configure.ac:5: -1- AC_SUBST([WINDRES]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([WINDRES]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^WINDRES$]) +m4trace:configure.ac:5: -1- AC_SUBST([REZ]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([REZ]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^REZ$]) +m4trace:configure.ac:5: -1- AC_SUBST([SETFILE]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SETFILE]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^SETFILE$]) +m4trace:configure.ac:5: -1- AC_SUBST([WINDRES]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([WINDRES]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^WINDRES$]) +m4trace:configure.ac:5: -1- AC_SUBST([REZ]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([REZ]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^REZ$]) +m4trace:configure.ac:5: -1- AC_SUBST([SETFILE]) +m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SETFILE]) +m4trace:configure.ac:5: -1- m4_pattern_allow([^SETFILE$]) +m4trace:configure.ac:5: -1- m4_include([autoconf_inc.m4]) +m4trace:autoconf_inc.m4:14: -1- AC_SUBST([COND_DEPS_TRACKING_0]) +m4trace:autoconf_inc.m4:14: -1- AC_SUBST_TRACE([COND_DEPS_TRACKING_0]) +m4trace:autoconf_inc.m4:14: -1- m4_pattern_allow([^COND_DEPS_TRACKING_0$]) +m4trace:autoconf_inc.m4:20: -1- AC_SUBST([COND_DEPS_TRACKING_1]) +m4trace:autoconf_inc.m4:20: -1- AC_SUBST_TRACE([COND_DEPS_TRACKING_1]) +m4trace:autoconf_inc.m4:20: -1- m4_pattern_allow([^COND_DEPS_TRACKING_1$]) +m4trace:configure.ac:6: -1- AC_CONFIG_FILES([Makefile]) +m4trace:configure.ac:6: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.ac:6: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:6: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([top_build_prefix]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([INSTALL]) diff --git a/3rdparty/libbcrypt-1.0/build/unix/bakefile.bkl b/3rdparty/libbcrypt-1.0/build/unix/bakefile.bkl new file mode 100644 index 0000000..1180ac2 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/bakefile.bkl @@ -0,0 +1,25 @@ + + + ../../source + ../../bin + gcc + + + ../../source/include + + include/bcrypt.h + + + src/bcrypt.c + src/blowfish.c + src/endian.c + src/keys.c + src/rwfile.c + src/wrapbf.c + src/wrapzl.c + + /usr/local/lib + /usr/local/include/bcrypt + + + diff --git a/3rdparty/libbcrypt-1.0/build/unix/bk-deps b/3rdparty/libbcrypt-1.0/build/unix/bk-deps new file mode 100755 index 0000000..fecc253 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/bk-deps @@ -0,0 +1,99 @@ +#!/bin/sh + +# This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf +# script. It is used to track C/C++ files dependencies in portable way. +# +# Permission is given to use this file in any way. + +DEPSMODE=gcc +DEPSDIR=.deps +DEPSFLAG="-MMD" + +mkdir -p $DEPSDIR + +if test $DEPSMODE = gcc ; then + $* ${DEPSFLAG} + status=$? + if test ${status} != 0 ; then + exit ${status} + fi + # move created file to the location we want it in: + while test $# -gt 0; do + case "$1" in + -o ) + shift + objfile=$1 + ;; + -* ) + ;; + * ) + srcfile=$1 + ;; + esac + shift + done + depfile=`basename $srcfile | sed -e 's/\..*$/.d/g'` + depobjname=`echo $depfile |sed -e 's/\.d/.o/g'` + if test -f $depfile ; then + sed -e "s,$depobjname:,$objfile:,g" $depfile >${DEPSDIR}/${objfile}.d + rm -f $depfile + else + # "g++ -MMD -o fooobj.o foosrc.cpp" produces fooobj.d + depfile=`basename $objfile | sed -e 's/\..*$/.d/g'` + if test ! -f $depfile ; then + # "cxx -MD -o fooobj.o foosrc.cpp" creates fooobj.o.d (Compaq C++) + depfile="$objfile.d" + fi + if test -f $depfile ; then + sed -e "/^$objfile/!s,$depobjname:,$objfile:,g" $depfile >${DEPSDIR}/${objfile}.d + rm -f $depfile + fi + fi + exit 0 +elif test $DEPSMODE = mwcc ; then + $* || exit $? + # Run mwcc again with -MM and redirect into the dep file we want + # NOTE: We can't use shift here because we need $* to be valid + prevarg= + for arg in $* ; do + if test "$prevarg" = "-o"; then + objfile=$arg + else + case "$arg" in + -* ) + ;; + * ) + srcfile=$arg + ;; + esac + fi + prevarg="$arg" + done + $* $DEPSFLAG >${DEPSDIR}/${objfile}.d + exit 0 +elif test $DEPSMODE = unixcc; then + $* || exit $? + # Run compiler again with deps flag and redirect into the dep file. + # It doesn't work if the '-o FILE' option is used, but without it the + # dependency file will contain the wrong name for the object. So it is + # removed from the command line, and the dep file is fixed with sed. + cmd="" + while test $# -gt 0; do + case "$1" in + -o ) + shift + objfile=$1 + ;; + * ) + eval arg$#=\$1 + cmd="$cmd \$arg$#" + ;; + esac + shift + done + eval "$cmd $DEPSFLAG" | sed "s|.*:|$objfile:|" >${DEPSDIR}/${objfile}.d + exit 0 +else + $* + exit $? +fi diff --git a/3rdparty/libbcrypt-1.0/build/unix/config.guess b/3rdparty/libbcrypt-1.0/build/unix/config.guess new file mode 100755 index 0000000..c38553d --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/config.guess @@ -0,0 +1,1497 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2006-02-23' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS_NT-*:*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + x86:Interix*:[345]*) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T:Interix*:[345]*) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__sun) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/3rdparty/libbcrypt-1.0/build/unix/config.log b/3rdparty/libbcrypt-1.0/build/unix/config.log new file mode 100644 index 0000000..65abea4 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/config.log @@ -0,0 +1,321 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by configure, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ ./configure + +## --------- ## +## Platform. ## +## --------- ## + +hostname = agalloch +uname -m = x86_64 +uname -r = 3.19.0-26-generic +uname -s = Linux +uname -v = #28-Ubuntu SMP Tue Aug 11 14:16:32 UTC 2015 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = unknown +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +/usr/bin/hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: /home/eric/bin +PATH: /usr/local/sbin +PATH: /usr/local/bin +PATH: /usr/sbin +PATH: /usr/bin +PATH: /sbin +PATH: /bin +PATH: /usr/games +PATH: /usr/local/games +PATH: /usr/lib/jvm/java-7-openjdk-amd64/jre//bin +PATH: /usr/lib/jvm/java-7-openjdk-amd64/jre//bin +PATH: /usr/local/lib +PATH: /home/eric/android-studio/bin + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:1837: checking build system type +configure:1851: result: x86_64-unknown-linux-gnu +configure:1871: checking host system type +configure:1884: result: x86_64-unknown-linux-gnu +configure:1904: checking target system type +configure:1917: result: x86_64-unknown-linux-gnu +configure:1959: checking for a BSD-compatible install +configure:2027: result: /usr/bin/install -c +configure:2086: checking for gcc +configure:2102: found /usr/bin/gcc +configure:2113: result: gcc +configure:2342: checking for C compiler version +configure:2351: gcc --version >&5 +gcc-4.9.real (Ubuntu 4.9.2-10ubuntu13) 4.9.2 +Copyright (C) 2014 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +configure:2362: $? = 0 +configure:2351: gcc -v >&5 +Using built-in specs. +COLLECT_GCC=/usr/bin/gcc-4.9.real +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9.2-10ubuntu13' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13) +configure:2362: $? = 0 +configure:2351: gcc -V >&5 +gcc-4.9.real: error: unrecognized command line option '-V' +gcc-4.9.real: fatal error: no input files +compilation terminated. +configure:2362: $? = 4 +configure:2351: gcc -qversion >&5 +gcc-4.9.real: error: unrecognized command line option '-qversion' +gcc-4.9.real: fatal error: no input files +compilation terminated. +configure:2362: $? = 4 +configure:2382: checking whether the C compiler works +configure:2404: gcc conftest.c >&5 +configure:2408: $? = 0 +configure:2456: result: yes +configure:2459: checking for C compiler default output file name +configure:2461: result: a.out +configure:2467: checking for suffix of executables +configure:2474: gcc -o conftest conftest.c >&5 +configure:2478: $? = 0 +configure:2500: result: +configure:2522: checking whether we are cross compiling +configure:2530: gcc -o conftest conftest.c >&5 +configure:2534: $? = 0 +configure:2541: ./conftest +configure:2545: $? = 0 +configure:2560: result: no +configure:2565: checking for suffix of object files +configure:2587: gcc -c conftest.c >&5 +configure:2591: $? = 0 +configure:2612: result: o +configure:2616: checking whether we are using the GNU C compiler +configure:2635: gcc -c conftest.c >&5 +configure:2635: $? = 0 +configure:2644: result: yes +configure:2653: checking whether gcc accepts -g +configure:2673: gcc -c -g conftest.c >&5 +configure:2673: $? = 0 +configure:2714: result: yes +configure:2731: checking for gcc option to accept ISO C89 +configure:2794: gcc -c -g -O2 conftest.c >&5 +configure:2794: $? = 0 +configure:2807: result: none needed +configure:2884: checking for ranlib +configure:2900: found /usr/bin/ranlib +configure:2911: result: ranlib +configure:2934: checking whether ln -s works +configure:2938: result: yes +configure:2946: checking whether make sets $(MAKE) +configure:2968: result: yes +configure:3031: checking for ar +configure:3047: found /usr/bin/ar +configure:3058: result: ar +configure:3127: checking for strip +configure:3143: found /usr/bin/strip +configure:3154: result: strip +configure:3219: checking for nm +configure:3235: found /usr/bin/nm +configure:3246: result: nm +configure:3288: checking if make is GNU make +configure:3302: result: yes +configure:4358: checking for dependency tracking method +configure:4379: result: gcc +configure:4884: creating ./config.status + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by config.status, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on agalloch + +config.status:782: creating Makefile + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_build=x86_64-unknown-linux-gnu +ac_cv_c_compiler_gnu=yes +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_LIBS_set= +ac_cv_env_LIBS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_host=x86_64-unknown-linux-gnu +ac_cv_objext=o +ac_cv_path_install='/usr/bin/install -c' +ac_cv_prog_ac_ct_AR=ar +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_ac_ct_NM=nm +ac_cv_prog_ac_ct_RANLIB=ranlib +ac_cv_prog_ac_ct_STRIP=strip +ac_cv_prog_cc_c89= +ac_cv_prog_cc_g=yes +ac_cv_prog_make_make_set=yes +ac_cv_target=x86_64-unknown-linux-gnu +bakefile_cv_prog_makeisgnu=yes + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +AIX_CXX_LD='' +AR='ar' +AROPTIONS='rcu' +BK_DEPS='/home/eric/code/hathor/3rdparty/libbcrypt-1.0/build/unix/bk-deps' +CC='gcc' +CFLAGS='-g -O2' +COND_DEPS_TRACKING_0='#' +COND_DEPS_TRACKING_1='' +CPPFLAGS='' +DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\"' +DEPS_TRACKING='1' +DLLIMP_SUFFIX='so' +DLLPREFIX='lib' +DLLPREFIX_MODULE='' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EXEEXT='' +IF_GNU_MAKE='' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_DIR='$(INSTALL) -d' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +LDFLAGS='' +LDFLAGS_GUI='' +LIBEXT='.a' +LIBOBJS='' +LIBPREFIX='lib' +LIBS='' +LN_S='ln -s' +LTLIBOBJS='' +MAKE_SET='' +NM='nm' +OBJEXT='o' +PACKAGE_BUGREPORT='' +PACKAGE_NAME='' +PACKAGE_STRING='' +PACKAGE_TARNAME='' +PACKAGE_URL='' +PACKAGE_VERSION='' +PATH_SEPARATOR=':' +PIC_FLAG='-fPIC -DPIC' +PLATFORM_BEOS='0' +PLATFORM_MAC='0' +PLATFORM_MACOS='0' +PLATFORM_MACOSX='0' +PLATFORM_MSDOS='0' +PLATFORM_OS2='0' +PLATFORM_UNIX='1' +PLATFORM_WIN32='0' +RANLIB='ranlib' +REZ='' +SETFILE='' +SET_MAKE='' +SHARED_LD_CC='$(CC) -shared -fPIC -o' +SHARED_LD_CXX='$(CXX) -shared -fPIC -o' +SHARED_LD_MODULE_CC='$(CC) -shared -fPIC -o' +SHARED_LD_MODULE_CXX='$(CXX) -shared -fPIC -o' +SHELL='/bin/bash' +SONAME_FLAG='-Wl,-soname,' +SO_SUFFIX='so' +SO_SUFFIX_MODULE='so' +STRIP='strip' +USE_MACVERSION='0' +USE_SOSYMLINKS='1' +USE_SOVERCYGWIN='0' +USE_SOVERLINUX='1' +USE_SOVERSION='1' +USE_SOVERSOLARIS='0' +WINDOWS_IMPLIB='0' +WINDRES='' +ac_ct_CC='gcc' +bindir='${exec_prefix}/bin' +build='x86_64-unknown-linux-gnu' +build_alias='' +build_cpu='x86_64' +build_os='linux-gnu' +build_vendor='unknown' +datadir='${datarootdir}' +datarootdir='${prefix}/share' +dlldir='${exec_prefix}/lib' +docdir='${datarootdir}/doc/${PACKAGE}' +dvidir='${docdir}' +exec_prefix='${prefix}' +host='x86_64-unknown-linux-gnu' +host_alias='' +host_cpu='x86_64' +host_os='linux-gnu' +host_vendor='unknown' +htmldir='${docdir}' +includedir='${prefix}/include' +infodir='${datarootdir}/info' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localedir='${datarootdir}/locale' +localstatedir='${prefix}/var' +mandir='${datarootdir}/man' +oldincludedir='/usr/include' +pdfdir='${docdir}' +prefix='/usr/local' +program_transform_name='s,x,x,' +psdir='${docdir}' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target='x86_64-unknown-linux-gnu' +target_alias='' +target_cpu='x86_64' +target_os='linux-gnu' +target_vendor='unknown' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +/* confdefs.h */ +#define PACKAGE_NAME "" +#define PACKAGE_TARNAME "" +#define PACKAGE_VERSION "" +#define PACKAGE_STRING "" +#define PACKAGE_BUGREPORT "" +#define PACKAGE_URL "" + +configure: exit 0 diff --git a/3rdparty/libbcrypt-1.0/build/unix/config.status b/3rdparty/libbcrypt-1.0/build/unix/config.status new file mode 100755 index 0000000..1c022d0 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/config.status @@ -0,0 +1,954 @@ +#! /bin/bash +# Generated by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=${CONFIG_SHELL-/bin/bash} +export SHELL +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +# Files that config.status was made for. +config_files=" Makefile" + +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to the package provider." + +ac_cs_config="" +ac_cs_version="\ +config.status +configured by ./configure, generated by GNU Autoconf 2.69, + with options \"$ac_cs_config\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='/home/eric/code/hathor/3rdparty/libbcrypt-1.0/build/unix' +srcdir='.' +INSTALL='/usr/bin/install -c' +test -n "$AWK" || AWK=awk +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +if $ac_cs_recheck; then + set X /bin/bash './configure' $ac_configure_extra_args --no-create --no-recursion + shift + $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 + CONFIG_SHELL='/bin/bash' + export CONFIG_SHELL + exec "$@" +fi + +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +cat >>"$ac_tmp/subs1.awk" <<\_ACAWK && +S["LTLIBOBJS"]="" +S["LIBOBJS"]="" +S["COND_DEPS_TRACKING_1"]="" +S["COND_DEPS_TRACKING_0"]="#" +S["SETFILE"]="" +S["REZ"]="" +S["WINDRES"]="" +S["BK_DEPS"]="/home/eric/code/hathor/3rdparty/libbcrypt-1.0/build/unix/bk-deps" +S["DEPS_TRACKING"]="1" +S["SONAME_FLAG"]="-Wl,-soname," +S["USE_SOSYMLINKS"]="1" +S["USE_MACVERSION"]="0" +S["USE_SOVERCYGWIN"]="0" +S["USE_SOVERSOLARIS"]="0" +S["USE_SOVERLINUX"]="1" +S["USE_SOVERSION"]="1" +S["WINDOWS_IMPLIB"]="0" +S["PIC_FLAG"]="-fPIC -DPIC" +S["SHARED_LD_MODULE_CXX"]="$(CXX) -shared -fPIC -o" +S["SHARED_LD_MODULE_CC"]="$(CC) -shared -fPIC -o" +S["SHARED_LD_CXX"]="$(CXX) -shared -fPIC -o" +S["SHARED_LD_CC"]="$(CC) -shared -fPIC -o" +S["AIX_CXX_LD"]="" +S["OBJEXT"]="o" +S["ac_ct_CC"]="gcc" +S["CPPFLAGS"]="" +S["LDFLAGS"]="" +S["CFLAGS"]="-g -O2" +S["CC"]="gcc" +S["dlldir"]="${exec_prefix}/lib" +S["DLLPREFIX_MODULE"]="" +S["DLLPREFIX"]="lib" +S["LIBEXT"]=".a" +S["LIBPREFIX"]="lib" +S["EXEEXT"]="" +S["DLLIMP_SUFFIX"]="so" +S["SO_SUFFIX_MODULE"]="so" +S["SO_SUFFIX"]="so" +S["PLATFORM_BEOS"]="0" +S["PLATFORM_OS2"]="0" +S["PLATFORM_MACOSX"]="0" +S["PLATFORM_MACOS"]="0" +S["PLATFORM_MAC"]="0" +S["PLATFORM_MSDOS"]="0" +S["PLATFORM_WIN32"]="0" +S["PLATFORM_UNIX"]="1" +S["IF_GNU_MAKE"]="" +S["LDFLAGS_GUI"]="" +S["INSTALL_DIR"]="$(INSTALL) -d" +S["NM"]="nm" +S["STRIP"]="strip" +S["AROPTIONS"]="rcu" +S["AR"]="ar" +S["MAKE_SET"]="" +S["SET_MAKE"]="" +S["LN_S"]="ln -s" +S["INSTALL_DATA"]="${INSTALL} -m 644" +S["INSTALL_SCRIPT"]="${INSTALL}" +S["INSTALL_PROGRAM"]="${INSTALL}" +S["RANLIB"]="ranlib" +S["target_os"]="linux-gnu" +S["target_vendor"]="unknown" +S["target_cpu"]="x86_64" +S["target"]="x86_64-unknown-linux-gnu" +S["host_os"]="linux-gnu" +S["host_vendor"]="unknown" +S["host_cpu"]="x86_64" +S["host"]="x86_64-unknown-linux-gnu" +S["build_os"]="linux-gnu" +S["build_vendor"]="unknown" +S["build_cpu"]="x86_64" +S["build"]="x86_64-unknown-linux-gnu" +S["target_alias"]="" +S["host_alias"]="" +S["build_alias"]="" +S["LIBS"]="" +S["ECHO_T"]="" +S["ECHO_N"]="-n" +S["ECHO_C"]="" +S["DEFS"]="-DPACKAGE_NAME=\\\"\\\" -DPACKAGE_TARNAME=\\\"\\\" -DPACKAGE_VERSION=\\\"\\\" -DPACKAGE_STRING=\\\"\\\" -DPACKAGE_BUGREPORT=\\\"\\\" -DPACKAGE_URL=\\\"\\\"" +S["mandir"]="${datarootdir}/man" +S["localedir"]="${datarootdir}/locale" +S["libdir"]="${exec_prefix}/lib" +S["psdir"]="${docdir}" +S["pdfdir"]="${docdir}" +S["dvidir"]="${docdir}" +S["htmldir"]="${docdir}" +S["infodir"]="${datarootdir}/info" +S["docdir"]="${datarootdir}/doc/${PACKAGE}" +S["oldincludedir"]="/usr/include" +S["includedir"]="${prefix}/include" +S["localstatedir"]="${prefix}/var" +S["sharedstatedir"]="${prefix}/com" +S["sysconfdir"]="${prefix}/etc" +S["datadir"]="${datarootdir}" +S["datarootdir"]="${prefix}/share" +S["libexecdir"]="${exec_prefix}/libexec" +S["sbindir"]="${exec_prefix}/sbin" +S["bindir"]="${exec_prefix}/bin" +S["program_transform_name"]="s,x,x," +S["prefix"]="/usr/local" +S["exec_prefix"]="${prefix}" +S["PACKAGE_URL"]="" +S["PACKAGE_BUGREPORT"]="" +S["PACKAGE_STRING"]="" +S["PACKAGE_VERSION"]="" +S["PACKAGE_TARNAME"]="" +S["PACKAGE_NAME"]="" +S["PATH_SEPARATOR"]=":" +S["SHELL"]="/bin/bash" +_ACAWK +cat >>"$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + ac_datarootdir_hack=' + s&@datadir@&${datarootdir}&g + s&@docdir@&${datarootdir}/doc/${PACKAGE}&g + s&@infodir@&${datarootdir}/info&g + s&@localedir@&${datarootdir}/locale&g + s&@mandir@&${datarootdir}/man&g + s&\${datarootdir}&${prefix}/share&g' ;; +esac +ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +} + +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + + esac + +done # for ac_tag + + +as_fn_exit 0 diff --git a/3rdparty/libbcrypt-1.0/build/unix/config.sub b/3rdparty/libbcrypt-1.0/build/unix/config.sub new file mode 100755 index 0000000..ad9f395 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/config.sub @@ -0,0 +1,1608 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2006-02-23' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m32c) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + m32c-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/3rdparty/libbcrypt-1.0/build/unix/configure b/3rdparty/libbcrypt-1.0/build/unix/configure new file mode 100755 index 0000000..d8251c1 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/configure @@ -0,0 +1,5895 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="aclocal.m4" +ac_subst_vars='LTLIBOBJS +LIBOBJS +COND_DEPS_TRACKING_1 +COND_DEPS_TRACKING_0 +SETFILE +REZ +WINDRES +BK_DEPS +DEPS_TRACKING +SONAME_FLAG +USE_SOSYMLINKS +USE_MACVERSION +USE_SOVERCYGWIN +USE_SOVERSOLARIS +USE_SOVERLINUX +USE_SOVERSION +WINDOWS_IMPLIB +PIC_FLAG +SHARED_LD_MODULE_CXX +SHARED_LD_MODULE_CC +SHARED_LD_CXX +SHARED_LD_CC +AIX_CXX_LD +OBJEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +dlldir +DLLPREFIX_MODULE +DLLPREFIX +LIBEXT +LIBPREFIX +EXEEXT +DLLIMP_SUFFIX +SO_SUFFIX_MODULE +SO_SUFFIX +PLATFORM_BEOS +PLATFORM_OS2 +PLATFORM_MACOSX +PLATFORM_MACOS +PLATFORM_MAC +PLATFORM_MSDOS +PLATFORM_WIN32 +PLATFORM_UNIX +IF_GNU_MAKE +LDFLAGS_GUI +INSTALL_DIR +NM +STRIP +AROPTIONS +AR +MAKE_SET +SET_MAKE +LN_S +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +RANLIB +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_omf +enable_dependency_tracking +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-omf use OMF object format (OS/2) + --disable-dependency-tracking + don't use dependency tracking even if the compiler + can + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +DEBUG=0 +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + if test "x$BAKEFILE_HOST" = "x"; then + if test "x${host}" = "x" ; then + as_fn_error $? "You must call the autoconf \"CANONICAL_HOST\" macro in your configure.ac (or .in) file." "$LINENO" 5 + fi + + BAKEFILE_HOST="${host}" + fi + + if test "x$BAKEFILE_CHECK_BASICS" != "xno"; then + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + + + if test "x$SUNCXX" = "xyes"; then + AR=$CXX + AROPTIONS="-xar -o" + + elif test "x$SGICC" = "xyes"; then + AR=$CXX + AROPTIONS="-ar -o" + + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="ar" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + AROPTIONS=rcu + fi + + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. +set dummy ${ac_tool_prefix}nm; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + ac_cv_prog_NM="$NM" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NM="${ac_tool_prefix}nm" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NM=$ac_cv_prog_NM +if test -n "$NM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 +$as_echo "$NM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NM"; then + ac_ct_NM=$NM + # Extract the first word of "nm", so it can be a program name with args. +set dummy nm; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NM"; then + ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NM="nm" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NM=$ac_cv_prog_ac_ct_NM +if test -n "$ac_ct_NM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5 +$as_echo "$ac_ct_NM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NM" = x; then + NM=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NM=$ac_ct_NM + fi +else + NM="$ac_cv_prog_NM" +fi + + + case ${BAKEFILE_HOST} in + *-hp-hpux* ) + INSTALL_DIR="mkdir -p" + ;; + * ) + INSTALL_DIR='$(INSTALL) -d' + ;; + esac + + + LDFLAGS_GUI= + case ${BAKEFILE_HOST} in + *-*-cygwin* | *-*-mingw32* ) + LDFLAGS_GUI="-mwindows" + esac + + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if make is GNU make" >&5 +$as_echo_n "checking if make is GNU make... " >&6; } +if ${bakefile_cv_prog_makeisgnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null | + egrep -s GNU > /dev/null); then + bakefile_cv_prog_makeisgnu="yes" + else + bakefile_cv_prog_makeisgnu="no" + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_prog_makeisgnu" >&5 +$as_echo "$bakefile_cv_prog_makeisgnu" >&6; } + + if test "x$bakefile_cv_prog_makeisgnu" = "xyes"; then + IF_GNU_MAKE="" + else + IF_GNU_MAKE="#" + fi + + + + PLATFORM_UNIX=0 + PLATFORM_WIN32=0 + PLATFORM_MSDOS=0 + PLATFORM_MAC=0 + PLATFORM_MACOS=0 + PLATFORM_MACOSX=0 + PLATFORM_OS2=0 + PLATFORM_BEOS=0 + + if test "x$BAKEFILE_FORCE_PLATFORM" = "x"; then + case "${BAKEFILE_HOST}" in + *-*-mingw32* ) + PLATFORM_WIN32=1 + ;; + *-pc-msdosdjgpp ) + PLATFORM_MSDOS=1 + ;; + *-pc-os2_emx | *-pc-os2-emx ) + PLATFORM_OS2=1 + ;; + *-*-darwin* ) + PLATFORM_MAC=1 + PLATFORM_MACOSX=1 + ;; + *-*-beos* ) + PLATFORM_BEOS=1 + ;; + powerpc-apple-macos* ) + PLATFORM_MAC=1 + PLATFORM_MACOS=1 + ;; + * ) + PLATFORM_UNIX=1 + ;; + esac + else + case "$BAKEFILE_FORCE_PLATFORM" in + win32 ) + PLATFORM_WIN32=1 + ;; + msdos ) + PLATFORM_MSDOS=1 + ;; + os2 ) + PLATFORM_OS2=1 + ;; + darwin ) + PLATFORM_MAC=1 + PLATFORM_MACOSX=1 + ;; + unix ) + PLATFORM_UNIX=1 + ;; + beos ) + PLATFORM_BEOS=1 + ;; + * ) + as_fn_error $? "Unknown platform: $BAKEFILE_FORCE_PLATFORM" "$LINENO" 5 + ;; + esac + fi + + + + + + + + + + + + # Check whether --enable-omf was given. +if test "${enable_omf+set}" = set; then : + enableval=$enable_omf; bk_os2_use_omf="$enableval" +fi + + + case "${BAKEFILE_HOST}" in + *-*-darwin* ) + if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -fno-common" + CXXFLAGS="$CXXFLAGS -fno-common" + fi + if test "x$XLCC" = "xyes"; then + CFLAGS="$CFLAGS -qnocommon" + CXXFLAGS="$CXXFLAGS -qnocommon" + fi + ;; + + *-pc-os2_emx | *-pc-os2-emx ) + if test "x$bk_os2_use_omf" = "xyes" ; then + AR=emxomfar + RANLIB=: + LDFLAGS="-Zomf $LDFLAGS" + CFLAGS="-Zomf $CFLAGS" + CXXFLAGS="-Zomf $CXXFLAGS" + OS2_LIBEXT="lib" + else + OS2_LIBEXT="a" + fi + ;; + + i*86-*-beos* ) + LDFLAGS="-L/boot/develop/lib/x86 $LDFLAGS" + ;; + esac + + + SO_SUFFIX="so" + SO_SUFFIX_MODULE="so" + EXEEXT="" + LIBPREFIX="lib" + LIBEXT=".a" + DLLPREFIX="lib" + DLLPREFIX_MODULE="" + DLLIMP_SUFFIX="" + dlldir="$libdir" + + case "${BAKEFILE_HOST}" in + *-hp-hpux* ) + SO_SUFFIX="sl" + SO_SUFFIX_MODULE="sl" + ;; + *-*-aix* ) + SO_SUFFIX="a" + SO_SUFFIX_MODULE="a" + ;; + *-*-cygwin* ) + SO_SUFFIX="dll" + SO_SUFFIX_MODULE="dll" + DLLIMP_SUFFIX="dll.a" + EXEEXT=".exe" + DLLPREFIX="cyg" + dlldir="$bindir" + ;; + *-*-mingw32* ) + SO_SUFFIX="dll" + SO_SUFFIX_MODULE="dll" + DLLIMP_SUFFIX="dll.a" + EXEEXT=".exe" + DLLPREFIX="" + dlldir="$bindir" + ;; + *-pc-msdosdjgpp ) + EXEEXT=".exe" + DLLPREFIX="" + dlldir="$bindir" + ;; + *-pc-os2_emx | *-pc-os2-emx ) + SO_SUFFIX="dll" + SO_SUFFIX_MODULE="dll" + DLLIMP_SUFFIX=$OS2_LIBEXT + EXEEXT=".exe" + DLLPREFIX="" + LIBPREFIX="" + LIBEXT=".$OS2_LIBEXT" + dlldir="$bindir" + ;; + *-*-darwin* ) + SO_SUFFIX="dylib" + SO_SUFFIX_MODULE="bundle" + ;; + esac + + if test "x$DLLIMP_SUFFIX" = "x" ; then + DLLIMP_SUFFIX="$SO_SUFFIX" + fi + + + + + + + + + + + + + PIC_FLAG="" + if test "x$GCC" = "xyes"; then + PIC_FLAG="-fPIC" + fi + + SHARED_LD_CC="\$(CC) -shared ${PIC_FLAG} -o" + SHARED_LD_CXX="\$(CXX) -shared ${PIC_FLAG} -o" + WINDOWS_IMPLIB=0 + + case "${BAKEFILE_HOST}" in + *-hp-hpux* ) + if test "x$GCC" != "xyes"; then + LDFLAGS="$LDFLAGS -L/usr/lib" + + SHARED_LD_CC="${CC} -b -o" + SHARED_LD_CXX="${CXX} -b -o" + PIC_FLAG="+Z" + fi + ;; + + *-*-linux* ) + if test "x$GCC" != "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Intel compiler" >&5 +$as_echo_n "checking for Intel compiler... " >&6; } +if ${bakefile_cv_prog_icc+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + #ifndef __INTEL_COMPILER + This is not ICC + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bakefile_cv_prog_icc=yes +else + bakefile_cv_prog_icc=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_prog_icc" >&5 +$as_echo "$bakefile_cv_prog_icc" >&6; } + if test "$bakefile_cv_prog_icc" = "yes"; then + PIC_FLAG="-KPIC" + fi + fi + ;; + + *-*-solaris2* ) + if test "x$GCC" != xyes ; then + SHARED_LD_CC="${CC} -G -o" + SHARED_LD_CXX="${CXX} -G -o" + PIC_FLAG="-KPIC" + fi + ;; + + *-*-darwin* ) + +D='$' +cat <shared-ld-sh +#!/bin/sh +#----------------------------------------------------------------------------- +#-- Name: distrib/mac/shared-ld-sh +#-- Purpose: Link a mach-o dynamic shared library for Darwin / Mac OS X +#-- Author: Gilles Depeyrot +#-- Copyright: (c) 2002 Gilles Depeyrot +#-- Licence: any use permitted +#----------------------------------------------------------------------------- + +verbose=0 +args="" +objects="" +linking_flag="-dynamiclib" +ldargs="-r -keep_private_externs -nostdlib" + +while test ${D}# -gt 0; do + case ${D}1 in + + -v) + verbose=1 + ;; + + -o|-compatibility_version|-current_version|-framework|-undefined|-install_name) + # collect these options and values + args="${D}{args} ${D}1 ${D}2" + shift + ;; + + -s|-Wl,*) + # collect these load args + ldargs="${D}{ldargs} ${D}1" + ;; + + -l*|-L*|-flat_namespace|-headerpad_max_install_names) + # collect these options + args="${D}{args} ${D}1" + ;; + + -dynamiclib|-bundle) + linking_flag="${D}1" + ;; + + -*) + echo "shared-ld: unhandled option '${D}1'" + exit 1 + ;; + + *.o | *.a | *.dylib) + # collect object files + objects="${D}{objects} ${D}1" + ;; + + *) + echo "shared-ld: unhandled argument '${D}1'" + exit 1 + ;; + + esac + shift +done + +status=0 + +# +# Link one module containing all the others +# +if test ${D}{verbose} = 1; then + echo "c++ ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o" +fi +c++ ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o +status=${D}? + +# +# Link the shared library from the single module created, but only if the +# previous command didn't fail: +# +if test ${D}{status} = 0; then + if test ${D}{verbose} = 1; then + echo "c++ ${D}{linking_flag} master.${D}${D}.o ${D}{args}" + fi + c++ ${D}{linking_flag} master.${D}${D}.o ${D}{args} + status=${D}? +fi + +# +# Remove intermediate module +# +rm -f master.${D}${D}.o + +exit ${D}status +EOF + + chmod +x shared-ld-sh + + SHARED_LD_MODULE_CC="`pwd`/shared-ld-sh -bundle -headerpad_max_install_names -o" + SHARED_LD_MODULE_CXX="$SHARED_LD_MODULE_CC" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc 3.1 or later" >&5 +$as_echo_n "checking for gcc 3.1 or later... " >&6; } +if ${bakefile_cv_gcc31+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + #if (__GNUC__ < 3) || \ + ((__GNUC__ == 3) && (__GNUC_MINOR__ < 1)) + This is old gcc + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + bakefile_cv_gcc31=yes + +else + + bakefile_cv_gcc31=no + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_gcc31" >&5 +$as_echo "$bakefile_cv_gcc31" >&6; } + if test "$bakefile_cv_gcc31" = "no"; then + SHARED_LD_CC="`pwd`/shared-ld-sh -dynamiclib -headerpad_max_install_names -o" + SHARED_LD_CXX="$SHARED_LD_CC" + else + SHARED_LD_CC="\${CC} -dynamiclib -single_module -headerpad_max_install_names -o" + SHARED_LD_CXX="\${CXX} -dynamiclib -single_module -headerpad_max_install_names -o" + fi + + if test "x$GCC" == "xyes"; then + PIC_FLAG="-dynamic -fPIC" + fi + if test "x$XLCC" = "xyes"; then + PIC_FLAG="-dynamic -DPIC" + fi + ;; + + *-*-aix* ) + if test "x$GCC" = "xyes"; then + PIC_FLAG="" + + case "${BAKEFILE_HOST}" in + *-*-aix5* ) + LD_EXPFULL="-Wl,-bexpfull" + ;; + esac + + SHARED_LD_CC="\$(CC) -shared $LD_EXPFULL -o" + SHARED_LD_CXX="\$(CXX) -shared $LD_EXPFULL -o" + else + # Extract the first word of "makeC++SharedLib", so it can be a program name with args. +set dummy makeC++SharedLib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AIX_CXX_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AIX_CXX_LD"; then + ac_cv_prog_AIX_CXX_LD="$AIX_CXX_LD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AIX_CXX_LD="makeC++SharedLib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_AIX_CXX_LD" && ac_cv_prog_AIX_CXX_LD="/usr/lpp/xlC/bin/makeC++SharedLib" +fi +fi +AIX_CXX_LD=$ac_cv_prog_AIX_CXX_LD +if test -n "$AIX_CXX_LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AIX_CXX_LD" >&5 +$as_echo "$AIX_CXX_LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + SHARED_LD_CC="$AIX_CC_LD -p 0 -o" + SHARED_LD_CXX="$AIX_CXX_LD -p 0 -o" + fi + ;; + + *-*-beos* ) + SHARED_LD_CC="${LD} -nostart -o" + SHARED_LD_CXX="${LD} -nostart -o" + ;; + + *-*-irix* ) + if test "x$GCC" != "xyes"; then + PIC_FLAG="-KPIC" + fi + ;; + + *-*-cygwin* | *-*-mingw32* ) + PIC_FLAG="" + SHARED_LD_CC="\$(CC) -shared -o" + SHARED_LD_CXX="\$(CXX) -shared -o" + WINDOWS_IMPLIB=1 + ;; + + *-pc-os2_emx | *-pc-os2-emx ) + SHARED_LD_CC="`pwd`/dllar.sh -libf INITINSTANCE -libf TERMINSTANCE -o" + SHARED_LD_CXX="`pwd`/dllar.sh -libf INITINSTANCE -libf TERMINSTANCE -o" + PIC_FLAG="" + +D='$' +cat <dllar.sh +#!/bin/sh +# +# dllar - a tool to build both a .dll and an .a file +# from a set of object (.o) files for EMX/OS2. +# +# Written by Andrew Zabolotny, bit@freya.etu.ru +# Ported to Unix like shell by Stefan Neis, Stefan.Neis@t-online.de +# +# This script will accept a set of files on the command line. +# All the public symbols from the .o files will be exported into +# a .DEF file, then linker will be run (through gcc) against them to +# build a shared library consisting of all given .o files. All libraries +# (.a) will be first decompressed into component .o files then act as +# described above. You can optionally give a description (-d "description") +# which will be put into .DLL. To see the list of accepted options (as well +# as command-line format) simply run this program without options. The .DLL +# is built to be imported by name (there is no guarantee that new versions +# of the library you build will have same ordinals for same symbols). +# +# dllar is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# dllar is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dllar; see the file COPYING. If not, write to the Free +# Software Foundation, 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# To successfuly run this program you will need: +# - Current drive should have LFN support (HPFS, ext2, network, etc) +# (Sometimes dllar generates filenames which won't fit 8.3 scheme) +# - gcc +# (used to build the .dll) +# - emxexp +# (used to create .def file from .o files) +# - emximp +# (used to create .a file from .def file) +# - GNU text utilites (cat, sort, uniq) +# used to process emxexp output +# - GNU file utilities (mv, rm) +# - GNU sed +# - lxlite (optional, see flag below) +# (used for general .dll cleanup) +# + +flag_USE_LXLITE=1; + +# +# helper functions +# basnam, variant of basename, which does _not_ remove the path, _iff_ +# second argument (suffix to remove) is given +basnam(){ + case ${D}# in + 1) + echo ${D}1 | sed 's/.*\\///' | sed 's/.*\\\\//' + ;; + 2) + echo ${D}1 | sed 's/'${D}2'${D}//' + ;; + *) + echo "error in basnam ${D}*" + exit 8 + ;; + esac +} + +# Cleanup temporary files and output +CleanUp() { + cd ${D}curDir + for i in ${D}inputFiles ; do + case ${D}i in + *!) + rm -rf \`basnam ${D}i !\` + ;; + *) + ;; + esac + done + + # Kill result in case of failure as there is just to many stupid make/nmake + # things out there which doesn't do this. + if [ ${D}# -eq 0 ]; then + rm -f ${D}arcFile ${D}arcFile2 ${D}defFile ${D}dllFile + fi +} + +# Print usage and exit script with rc=1. +PrintHelp() { + echo 'Usage: dllar.sh [-o[utput] output_file] [-i[mport] importlib_name]' + echo ' [-name-mangler-script script.sh]' + echo ' [-d[escription] "dll descrption"] [-cc "CC"] [-f[lags] "CFLAGS"]' + echo ' [-ord[inals]] -ex[clude] "symbol(s)"' + echo ' [-libf[lags] "{INIT|TERM}{GLOBAL|INSTANCE}"] [-nocrt[dll]] [-nolxl[ite]]' + echo ' [*.o] [*.a]' + echo '*> "output_file" should have no extension.' + echo ' If it has the .o, .a or .dll extension, it is automatically removed.' + echo ' The import library name is derived from this and is set to "name".a,' + echo ' unless overridden by -import' + echo '*> "importlib_name" should have no extension.' + echo ' If it has the .o, or .a extension, it is automatically removed.' + echo ' This name is used as the import library name and may be longer and' + echo ' more descriptive than the DLL name which has to follow the old ' + echo ' 8.3 convention of FAT.' + echo '*> "script.sh may be given to override the output_file name by a' + echo ' different name. It is mainly useful if the regular make process' + echo ' of some package does not take into account OS/2 restriction of' + echo ' DLL name lengths. It takes the importlib name as input and is' + echo ' supposed to procude a shorter name as output. The script should' + echo ' expect to get importlib_name without extension and should produce' + echo ' a (max.) 8 letter name without extension.' + echo '*> "cc" is used to use another GCC executable. (default: gcc.exe)' + echo '*> "flags" should be any set of valid GCC flags. (default: -s -Zcrtdll)' + echo ' These flags will be put at the start of GCC command line.' + echo '*> -ord[inals] tells dllar to export entries by ordinals. Be careful.' + echo '*> -ex[clude] defines symbols which will not be exported. You can define' + echo ' multiple symbols, for example -ex "myfunc yourfunc _GLOBAL*".' + echo ' If the last character of a symbol is "*", all symbols beginning' + echo ' with the prefix before "*" will be exclude, (see _GLOBAL* above).' + echo '*> -libf[lags] can be used to add INITGLOBAL/INITINSTANCE and/or' + echo ' TERMGLOBAL/TERMINSTANCE flags to the dynamically-linked library.' + echo '*> -nocrt[dll] switch will disable linking the library against emx''s' + echo ' C runtime DLLs.' + echo '*> -nolxl[ite] switch will disable running lxlite on the resulting DLL.' + echo '*> All other switches (for example -L./ or -lmylib) will be passed' + echo ' unchanged to GCC at the end of command line.' + echo '*> If you create a DLL from a library and you do not specify -o,' + echo ' the basename for DLL and import library will be set to library name,' + echo ' the initial library will be renamed to 'name'_s.a (_s for static)' + echo ' i.e. "dllar gcc.a" will create gcc.dll and gcc.a, and the initial' + echo ' library will be renamed into gcc_s.a.' + echo '--------' + echo 'Example:' + echo ' dllar -o gcc290.dll libgcc.a -d "GNU C runtime library" -ord' + echo ' -ex "__main __ctordtor*" -libf "INITINSTANCE TERMINSTANCE"' + CleanUp + exit 1 +} + +# Execute a command. +# If exit code of the commnad <> 0 CleanUp() is called and we'll exit the script. +# @Uses Whatever CleanUp() uses. +doCommand() { + echo "${D}*" + eval ${D}* + rcCmd=${D}? + + if [ ${D}rcCmd -ne 0 ]; then + echo "command failed, exit code="${D}rcCmd + CleanUp + exit ${D}rcCmd + fi +} + +# main routine +# setup globals +cmdLine=${D}* +outFile="" +outimpFile="" +inputFiles="" +renameScript="" +description="" +CC=gcc.exe +CFLAGS="-s -Zcrtdll" +EXTRA_CFLAGS="" +EXPORT_BY_ORDINALS=0 +exclude_symbols="" +library_flags="" +curDir=\`pwd\` +curDirS=curDir +case ${D}curDirS in +*/) + ;; +*) + curDirS=${D}{curDirS}"/" + ;; +esac +# Parse commandline +libsToLink=0 +omfLinking=0 +while [ ${D}1 ]; do + case ${D}1 in + -ord*) + EXPORT_BY_ORDINALS=1; + ;; + -o*) + shift + outFile=${D}1 + ;; + -i*) + shift + outimpFile=${D}1 + ;; + -name-mangler-script) + shift + renameScript=${D}1 + ;; + -d*) + shift + description=${D}1 + ;; + -f*) + shift + CFLAGS=${D}1 + ;; + -c*) + shift + CC=${D}1 + ;; + -h*) + PrintHelp + ;; + -ex*) + shift + exclude_symbols=${D}{exclude_symbols}${D}1" " + ;; + -libf*) + shift + library_flags=${D}{library_flags}${D}1" " + ;; + -nocrt*) + CFLAGS="-s" + ;; + -nolxl*) + flag_USE_LXLITE=0 + ;; + -* | /*) + case ${D}1 in + -L* | -l*) + libsToLink=1 + ;; + -Zomf) + omfLinking=1 + ;; + *) + ;; + esac + EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1 + ;; + *.dll) + EXTRA_CFLAGS="${D}{EXTRA_CFLAGS} \`basnam ${D}1 .dll\`" + if [ ${D}omfLinking -eq 1 ]; then + EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.lib" + else + EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.a" + fi + ;; + *) + found=0; + if [ ${D}libsToLink -ne 0 ]; then + EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1 + else + for file in ${D}1 ; do + if [ -f ${D}file ]; then + inputFiles="${D}{inputFiles} ${D}file" + found=1 + fi + done + if [ ${D}found -eq 0 ]; then + echo "ERROR: No file(s) found: "${D}1 + exit 8 + fi + fi + ;; + esac + shift +done # iterate cmdline words + +# +if [ -z "${D}inputFiles" ]; then + echo "dllar: no input files" + PrintHelp +fi + +# Now extract all .o files from .a files +newInputFiles="" +for file in ${D}inputFiles ; do + case ${D}file in + *.a | *.lib) + case ${D}file in + *.a) + suffix=".a" + AR="ar" + ;; + *.lib) + suffix=".lib" + AR="emxomfar" + EXTRA_CFLAGS="${D}EXTRA_CFLAGS -Zomf" + ;; + *) + ;; + esac + dirname=\`basnam ${D}file ${D}suffix\`"_%" + mkdir ${D}dirname + if [ ${D}? -ne 0 ]; then + echo "Failed to create subdirectory ./${D}dirname" + CleanUp + exit 8; + fi + # Append '!' to indicate archive + newInputFiles="${D}newInputFiles ${D}{dirname}!" + doCommand "cd ${D}dirname; ${D}AR x ../${D}file" + cd ${D}curDir + found=0; + for subfile in ${D}dirname/*.o* ; do + if [ -f ${D}subfile ]; then + found=1 + if [ -s ${D}subfile ]; then + # FIXME: This should be: is file size > 32 byte, _not_ > 0! + newInputFiles="${D}newInputFiles ${D}subfile" + fi + fi + done + if [ ${D}found -eq 0 ]; then + echo "WARNING: there are no files in archive \\'${D}file\\'" + fi + ;; + *) + newInputFiles="${D}{newInputFiles} ${D}file" + ;; + esac +done +inputFiles="${D}newInputFiles" + +# Output filename(s). +do_backup=0; +if [ -z ${D}outFile ]; then + do_backup=1; + set outFile ${D}inputFiles; outFile=${D}2 +fi + +# If it is an archive, remove the '!' and the '_%' suffixes +case ${D}outFile in +*_%!) + outFile=\`basnam ${D}outFile _%!\` + ;; +*) + ;; +esac +case ${D}outFile in +*.dll) + outFile=\`basnam ${D}outFile .dll\` + ;; +*.DLL) + outFile=\`basnam ${D}outFile .DLL\` + ;; +*.o) + outFile=\`basnam ${D}outFile .o\` + ;; +*.obj) + outFile=\`basnam ${D}outFile .obj\` + ;; +*.a) + outFile=\`basnam ${D}outFile .a\` + ;; +*.lib) + outFile=\`basnam ${D}outFile .lib\` + ;; +*) + ;; +esac +case ${D}outimpFile in +*.a) + outimpFile=\`basnam ${D}outimpFile .a\` + ;; +*.lib) + outimpFile=\`basnam ${D}outimpFile .lib\` + ;; +*) + ;; +esac +if [ -z ${D}outimpFile ]; then + outimpFile=${D}outFile +fi +defFile="${D}{outFile}.def" +arcFile="${D}{outimpFile}.a" +arcFile2="${D}{outimpFile}.lib" + +#create ${D}dllFile as something matching 8.3 restrictions, +if [ -z ${D}renameScript ] ; then + dllFile="${D}outFile" +else + dllFile=\`${D}renameScript ${D}outimpFile\` +fi + +if [ ${D}do_backup -ne 0 ] ; then + if [ -f ${D}arcFile ] ; then + doCommand "mv ${D}arcFile ${D}{outFile}_s.a" + fi + if [ -f ${D}arcFile2 ] ; then + doCommand "mv ${D}arcFile2 ${D}{outFile}_s.lib" + fi +fi + +# Extract public symbols from all the object files. +tmpdefFile=${D}{defFile}_% +rm -f ${D}tmpdefFile +for file in ${D}inputFiles ; do + case ${D}file in + *!) + ;; + *) + doCommand "emxexp -u ${D}file >> ${D}tmpdefFile" + ;; + esac +done + +# Create the def file. +rm -f ${D}defFile +echo "LIBRARY \`basnam ${D}dllFile\` ${D}library_flags" >> ${D}defFile +dllFile="${D}{dllFile}.dll" +if [ ! -z ${D}description ]; then + echo "DESCRIPTION \\"${D}{description}\\"" >> ${D}defFile +fi +echo "EXPORTS" >> ${D}defFile + +doCommand "cat ${D}tmpdefFile | sort.exe | uniq.exe > ${D}{tmpdefFile}%" +grep -v "^ *;" < ${D}{tmpdefFile}% | grep -v "^ *${D}" >${D}tmpdefFile + +# Checks if the export is ok or not. +for word in ${D}exclude_symbols; do + grep -v ${D}word < ${D}tmpdefFile >${D}{tmpdefFile}% + mv ${D}{tmpdefFile}% ${D}tmpdefFile +done + + +if [ ${D}EXPORT_BY_ORDINALS -ne 0 ]; then + sed "=" < ${D}tmpdefFile | \\ + sed ' + N + : loop + s/^\\([0-9]\\+\\)\\([^;]*\\)\\(;.*\\)\\?/\\2 @\\1 NONAME/ + t loop + ' > ${D}{tmpdefFile}% + grep -v "^ *${D}" < ${D}{tmpdefFile}% > ${D}tmpdefFile +else + rm -f ${D}{tmpdefFile}% +fi +cat ${D}tmpdefFile >> ${D}defFile +rm -f ${D}tmpdefFile + +# Do linking, create implib, and apply lxlite. +gccCmdl=""; +for file in ${D}inputFiles ; do + case ${D}file in + *!) + ;; + *) + gccCmdl="${D}gccCmdl ${D}file" + ;; + esac +done +doCommand "${D}CC ${D}CFLAGS -Zdll -o ${D}dllFile ${D}defFile ${D}gccCmdl ${D}EXTRA_CFLAGS" +touch "${D}{outFile}.dll" + +doCommand "emximp -o ${D}arcFile ${D}defFile" +if [ ${D}flag_USE_LXLITE -ne 0 ]; then + add_flags=""; + if [ ${D}EXPORT_BY_ORDINALS -ne 0 ]; then + add_flags="-ynd" + fi + doCommand "lxlite -cs -t: -mrn -mln ${D}add_flags ${D}dllFile" +fi +doCommand "emxomf -s -l ${D}arcFile" + +# Successful exit. +CleanUp 1 +exit 0 +EOF + + chmod +x dllar.sh + ;; + + powerpc-apple-macos* | \ + *-*-freebsd* | *-*-openbsd* | *-*-netbsd* | *-*-k*bsd*-gnu | \ + *-*-mirbsd* | \ + *-*-sunos4* | \ + *-*-osf* | \ + *-*-dgux5* | \ + *-*-sysv5* | \ + *-pc-msdosdjgpp ) + ;; + + *) + as_fn_error $? "unknown system type $BAKEFILE_HOST." "$LINENO" 5 + esac + + if test "x$PIC_FLAG" != "x" ; then + PIC_FLAG="$PIC_FLAG -DPIC" + fi + + if test "x$SHARED_LD_MODULE_CC" = "x" ; then + SHARED_LD_MODULE_CC="$SHARED_LD_CC" + fi + if test "x$SHARED_LD_MODULE_CXX" = "x" ; then + SHARED_LD_MODULE_CXX="$SHARED_LD_CXX" + fi + + + + + + + + + + USE_SOVERSION=0 + USE_SOVERLINUX=0 + USE_SOVERSOLARIS=0 + USE_SOVERCYGWIN=0 + USE_SOSYMLINKS=0 + USE_MACVERSION=0 + SONAME_FLAG= + + case "${BAKEFILE_HOST}" in + *-*-linux* | *-*-freebsd* | *-*-k*bsd*-gnu ) + SONAME_FLAG="-Wl,-soname," + USE_SOVERSION=1 + USE_SOVERLINUX=1 + USE_SOSYMLINKS=1 + ;; + + *-*-solaris2* ) + SONAME_FLAG="-h " + USE_SOVERSION=1 + USE_SOVERSOLARIS=1 + USE_SOSYMLINKS=1 + ;; + + *-*-darwin* ) + USE_MACVERSION=1 + USE_SOVERSION=1 + USE_SOSYMLINKS=1 + ;; + + *-*-cygwin* ) + USE_SOVERSION=1 + USE_SOVERCYGWIN=1 + ;; + esac + + + + + + + + + + + # Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; bk_use_trackdeps="$enableval" +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dependency tracking method" >&5 +$as_echo_n "checking for dependency tracking method... " >&6; } + + BK_DEPS="" + if test "x$bk_use_trackdeps" = "xno" ; then + DEPS_TRACKING=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } + else + DEPS_TRACKING=1 + + if test "x$GCC" = "xyes"; then + DEPSMODE=gcc + case "${BAKEFILE_HOST}" in + *-*-darwin* ) + DEPSFLAG="-no-cpp-precomp -MMD" + ;; + * ) + DEPSFLAG="-MMD" + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: gcc" >&5 +$as_echo "gcc" >&6; } + elif test "x$MWCC" = "xyes"; then + DEPSMODE=mwcc + DEPSFLAG="-MM" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: mwcc" >&5 +$as_echo "mwcc" >&6; } + elif test "x$SUNCC" = "xyes"; then + DEPSMODE=unixcc + DEPSFLAG="-xM1" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Sun cc" >&5 +$as_echo "Sun cc" >&6; } + elif test "x$SGICC" = "xyes"; then + DEPSMODE=unixcc + DEPSFLAG="-M" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: SGI cc" >&5 +$as_echo "SGI cc" >&6; } + elif test "x$HPCC" = "xyes"; then + DEPSMODE=unixcc + DEPSFLAG="+make" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: HP cc" >&5 +$as_echo "HP cc" >&6; } + elif test "x$COMPAQCC" = "xyes"; then + DEPSMODE=gcc + DEPSFLAG="-MD" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Compaq cc" >&5 +$as_echo "Compaq cc" >&6; } + else + DEPS_TRACKING=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } + fi + + if test $DEPS_TRACKING = 1 ; then + +D='$' +cat <bk-deps +#!/bin/sh + +# This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf +# script. It is used to track C/C++ files dependencies in portable way. +# +# Permission is given to use this file in any way. + +DEPSMODE=${DEPSMODE} +DEPSDIR=.deps +DEPSFLAG="${DEPSFLAG}" + +mkdir -p ${D}DEPSDIR + +if test ${D}DEPSMODE = gcc ; then + ${D}* ${D}{DEPSFLAG} + status=${D}? + if test ${D}{status} != 0 ; then + exit ${D}{status} + fi + # move created file to the location we want it in: + while test ${D}# -gt 0; do + case "${D}1" in + -o ) + shift + objfile=${D}1 + ;; + -* ) + ;; + * ) + srcfile=${D}1 + ;; + esac + shift + done + depfile=\`basename ${D}srcfile | sed -e 's/\\..*${D}/.d/g'\` + depobjname=\`echo ${D}depfile |sed -e 's/\\.d/.o/g'\` + if test -f ${D}depfile ; then + sed -e "s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{DEPSDIR}/${D}{objfile}.d + rm -f ${D}depfile + else + # "g++ -MMD -o fooobj.o foosrc.cpp" produces fooobj.d + depfile=\`basename ${D}objfile | sed -e 's/\\..*${D}/.d/g'\` + if test ! -f ${D}depfile ; then + # "cxx -MD -o fooobj.o foosrc.cpp" creates fooobj.o.d (Compaq C++) + depfile="${D}objfile.d" + fi + if test -f ${D}depfile ; then + sed -e "/^${D}objfile/!s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{DEPSDIR}/${D}{objfile}.d + rm -f ${D}depfile + fi + fi + exit 0 +elif test ${D}DEPSMODE = mwcc ; then + ${D}* || exit ${D}? + # Run mwcc again with -MM and redirect into the dep file we want + # NOTE: We can't use shift here because we need ${D}* to be valid + prevarg= + for arg in ${D}* ; do + if test "${D}prevarg" = "-o"; then + objfile=${D}arg + else + case "${D}arg" in + -* ) + ;; + * ) + srcfile=${D}arg + ;; + esac + fi + prevarg="${D}arg" + done + ${D}* ${D}DEPSFLAG >${D}{DEPSDIR}/${D}{objfile}.d + exit 0 +elif test ${D}DEPSMODE = unixcc; then + ${D}* || exit ${D}? + # Run compiler again with deps flag and redirect into the dep file. + # It doesn't work if the '-o FILE' option is used, but without it the + # dependency file will contain the wrong name for the object. So it is + # removed from the command line, and the dep file is fixed with sed. + cmd="" + while test ${D}# -gt 0; do + case "${D}1" in + -o ) + shift + objfile=${D}1 + ;; + * ) + eval arg${D}#=\\${D}1 + cmd="${D}cmd \\${D}arg${D}#" + ;; + esac + shift + done + eval "${D}cmd ${D}DEPSFLAG" | sed "s|.*:|${D}objfile:|" >${D}{DEPSDIR}/${D}{objfile}.d + exit 0 +else + ${D}* + exit ${D}? +fi +EOF + + chmod +x bk-deps + BK_DEPS="`pwd`/bk-deps" + fi + fi + + + + + + case ${BAKEFILE_HOST} in + *-*-cygwin* | *-*-mingw32* ) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. +set dummy ${ac_tool_prefix}windres; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_WINDRES+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$WINDRES"; then + ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_WINDRES="${ac_tool_prefix}windres" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +WINDRES=$ac_cv_prog_WINDRES +if test -n "$WINDRES"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5 +$as_echo "$WINDRES" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_WINDRES"; then + ac_ct_WINDRES=$WINDRES + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_WINDRES+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_WINDRES"; then + ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_WINDRES="windres" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES +if test -n "$ac_ct_WINDRES"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5 +$as_echo "$ac_ct_WINDRES" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_WINDRES" = x; then + WINDRES="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + WINDRES=$ac_ct_WINDRES + fi +else + WINDRES="$ac_cv_prog_WINDRES" +fi + + ;; + + *-*-darwin* | powerpc-apple-macos* ) + # Extract the first word of "Rez", so it can be a program name with args. +set dummy Rez; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_REZ+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$REZ"; then + ac_cv_prog_REZ="$REZ" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_REZ="Rez" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_REZ" && ac_cv_prog_REZ="/Developer/Tools/Rez" +fi +fi +REZ=$ac_cv_prog_REZ +if test -n "$REZ"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $REZ" >&5 +$as_echo "$REZ" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "SetFile", so it can be a program name with args. +set dummy SetFile; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_SETFILE+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$SETFILE"; then + ac_cv_prog_SETFILE="$SETFILE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_SETFILE="SetFile" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_SETFILE" && ac_cv_prog_SETFILE="/Developer/Tools/SetFile" +fi +fi +SETFILE=$ac_cv_prog_SETFILE +if test -n "$SETFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SETFILE" >&5 +$as_echo "$SETFILE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + ;; + esac + + + + + + + BAKEFILE_BAKEFILE_M4_VERSION="0.2.2" + + +BAKEFILE_AUTOCONF_INC_M4_VERSION="0.2.2" + + COND_DEPS_TRACKING_0="#" + if test "x$DEPS_TRACKING" = "x0" ; then + COND_DEPS_TRACKING_0="" + fi + + COND_DEPS_TRACKING_1="#" + if test "x$DEPS_TRACKING" = "x1" ; then + COND_DEPS_TRACKING_1="" + fi + + + + if test "$BAKEFILE_AUTOCONF_INC_M4_VERSION" = "" ; then + as_fn_error $? "No version found in autoconf_inc.m4 - bakefile macro was changed to take additional argument, perhaps configure.in wasn't updated (see the documentation)?" "$LINENO" 5 + fi + + if test "$BAKEFILE_BAKEFILE_M4_VERSION" != "$BAKEFILE_AUTOCONF_INC_M4_VERSION" ; then + as_fn_error $? "Versions of Bakefile used to generate makefiles ($BAKEFILE_AUTOCONF_INC_M4_VERSION) and configure ($BAKEFILE_BAKEFILE_M4_VERSION) do not match." "$LINENO" 5 + fi + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + diff --git a/3rdparty/libbcrypt-1.0/build/unix/configure.ac b/3rdparty/libbcrypt-1.0/build/unix/configure.ac new file mode 100644 index 0000000..64207ae --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/configure.ac @@ -0,0 +1,7 @@ +AC_PREREQ(2.53) +AC_INIT(aclocal.m4) +AC_CANONICAL_SYSTEM +DEBUG=0 +AC_BAKEFILE([m4_include(autoconf_inc.m4)]) +AC_OUTPUT([Makefile]) + diff --git a/3rdparty/libbcrypt-1.0/build/unix/install-sh b/3rdparty/libbcrypt-1.0/build/unix/install-sh new file mode 100755 index 0000000..d4744f0 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/install-sh @@ -0,0 +1,269 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/3rdparty/libbcrypt-1.0/build/unix/test.txt b/3rdparty/libbcrypt-1.0/build/unix/test.txt new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/3rdparty/libbcrypt-1.0/build/unix/test.txt @@ -0,0 +1 @@ +test diff --git a/3rdparty/libbcrypt-1.0/doc/bcrypt.readme b/3rdparty/libbcrypt-1.0/doc/bcrypt.readme new file mode 100644 index 0000000..610ab5e --- /dev/null +++ b/3rdparty/libbcrypt-1.0/doc/bcrypt.readme @@ -0,0 +1,112 @@ +ABOUT +-- +Bcrypt is a cross platform file encryption utility. Encrypted files are +portable across all supported operating systems and processors. Passphrases +are between 8 and 56 characters and are hashed internally to a 448 bit +key. However, all characters supplied are significant. The stronger your +passphrase, the more secure your data. + +Bcrypt uses the blowfish encryption algorithm published by Bruce Schneier +in 1993. More information on the algorithm can be found at: + http://www.counterpane.com/blowfish.html + +Specifically, bcrypt uses Paul Kocher's implementation of the algorithm. +The source distributed with bcrypt has been slightly altered from the +original. Original source code can be obtained from: + http://www.counterpane.com/bfsh-koc.zip + +SUPPORTED PLATFORMS +-- +Bcrypt has been successfully tested on the following platforms: + + x86 + FreeBSD, OpenBSD, Linux, Cygwin, Win32 + Sparc R220 + Solaris 2.7, 2.8 + Sparc Ultra60 + Linux 2.4 + Alpha + Linux 2.4 + PPC G4 + MacOS X 10.1 SERVER + PPC RS/6000 + Linux 2.4 + +No other operating systems have been tested, but most should work with +minimal modifications. If you get bcrypt to compile without errors on any +other platform / architecture, I'd like to know about it. If patches are +necessary to get bcrypt work on your OS, I will try to incorporate them +into the main distribution. + +If you have a machine not listed above that is incapable of compiling +bcrypt and are willing to give me access to the machine, I will make an +attempt to port it to your OS. + +SYSTEM REQUIREMENTS +-- +zlib - http://www.gzip.org/zlib/ + +INSTALLATION +-- +If you're so inclined, edit config.h and change the defaults to whatever +you think is appropriate for your needs. If you choose not to have +bcrypt remove input files after processing, or set SECUREDELETE to 0, +you are likely to have data on your hard drive that can be recovered +even after deletion. + +All of these options can be set on the command line as well. When you're +satisfied with the default settings, simply type: + make +then su and type: + make install + +It would be wise to test the installation on a few unimportant files +before encrypting anything you value and removing the only copy. + +USAGE +-- + bcrypt [-orc][-sN] file ... + +Encrypted files will be saved with an extension of .bfe. Any files ending +in .bfe will be assumed to be encrypted with bcrypt and will attempt to +decrypt them. Any other input files will be encrypted. If more than one +type of file is given, bcrypt will process all files which are the same as +the first filetype given. + +By default, bcrypt will compress input files before encryption, remove +input files after they are processed (assuming they are processed +successfully) and overwrite input files with random data to prevent data +recovery. + +Passphrases may be between 8 and 56 characters. Regardless of the +passphrase size, the key is hashed internally to 448 bits - the largest +keysize supported by the blowfish algorithm. However, it is still wise to +use a strong passphrase. + +OPTIONS + -o print output to standard out. Implies -r. + + -c DO NOT compress files before encryption. + + -r DO NOT remove input files after processing + + -sN How many times to overwrite input files with random + data before processing. The default number of + overwrites is 3. Use -s0 to disable this feature. + No effect if -r is supplied. + +The options o,c and r each have the opposite effects if the appropriate +settings are altered from the default in config.h. To determine what +effect each of these have, run bcrypt without any options. + +Encrypted files should be compatible between most systems. Binary +compatibility has been tested for all systems listed above. + +/* ==================================================================== + * Copyright (c) 2002 Johnny Shelley. All rights reserved. + * + * Bcrypt is licensed under the BSD software license. See the file + * called 'LICENSE' that you should have received with this software + * for details + * ==================================================================== + */ diff --git a/3rdparty/libbcrypt-1.0/doc/libbcrypt.license b/3rdparty/libbcrypt-1.0/doc/libbcrypt.license new file mode 100644 index 0000000..ea2d0fc --- /dev/null +++ b/3rdparty/libbcrypt-1.0/doc/libbcrypt.license @@ -0,0 +1,20 @@ +/* ==================================================================== + * Copyleft 2007 John Sennesael, donationcoder.com + * + * Permission is hereby granted to copy, modify and reproduce this work + * in binary or source form, and in commercial and non-commercial form, + * given that the following conditions are met: + * + * - Include the original bcrypt license (not libbcrypt) on which this + * library is based + * + * - Include this license text with your program our source code. + * + * - Do not claim you wrote this library. + * + * + * Please note that the original bcrypt license terms have priority over + * the libbcrypt license terms, therefore you should read that license as + * well. + * + */ diff --git a/3rdparty/libbcrypt-1.0/doc/libbcrypt.readme b/3rdparty/libbcrypt-1.0/doc/libbcrypt.readme new file mode 100644 index 0000000..b68ea66 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/doc/libbcrypt.readme @@ -0,0 +1,25 @@ +++++++++++++++++++++++++++++++++ +| libbcrypt version 1.0 readme | +++++++++++++++++++++++++++++++++ + +Please see bcrypt.h for how to use this library. +It only includes 2 functions, one to encrypt and one to decrypt. + +====================================================================== += = += *nix build instructions: = += = += cd build/unix = += ./configure = += make = += = += 'make install' is still a bit bugish, don't use it. = += copy bin/bcrypt.so to /usr/lib/libbcrypt.so = += and copy source/include/bcrypt.h to /usr/include/bcrypt/bcrypt.h = += manually for now. = += = += That's all. = += = +====================================================================== + +Mail comments to gothic@donationcoders.com diff --git a/3rdparty/libbcrypt-1.0/source/include/bcrypt.h b/3rdparty/libbcrypt-1.0/source/include/bcrypt.h new file mode 100644 index 0000000..077a10c --- /dev/null +++ b/3rdparty/libbcrypt-1.0/source/include/bcrypt.h @@ -0,0 +1,17 @@ +/* ==================================================================== + * Copyright (c) 2002 John Sennesael. All rights reserved. + * + * This header is part of a C library interface for bcrypt developed by + * donationcoder.com + * ==================================================================== + */ + +#ifndef BCRYPT_H_INCLUDE +#define BCRYPT_H_INCLUDE + + /// Encrypts a file. + int bcrypt(char* filename,char* key,char delOrig); + /// Decrypts a file. + int bdecrypt(char* filename,char* key,char delOrig); + +#endif diff --git a/3rdparty/libbcrypt-1.0/source/include/blowfish.h b/3rdparty/libbcrypt-1.0/source/include/blowfish.h new file mode 100644 index 0000000..d65b6f6 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/source/include/blowfish.h @@ -0,0 +1,21 @@ +/* + * Author : Paul Kocher + * E-mail : pck@netcom.com + * Date : 1997 + * Description: C implementation of the Blowfish algorithm. + */ + +#define MAXKEYBYTES 56 /* 448 bits */ + +typedef struct { + uInt32 P[16 + 2]; + uInt32 S[4][256]; +} BLOWFISH_CTX; + +void Blowfish_Init(BLOWFISH_CTX *ctx, unsigned char *key, int keyLen); + +void Blowfish_Encrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32 +*xr); + +void Blowfish_Decrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32 +*xr); diff --git a/3rdparty/libbcrypt-1.0/source/include/config.h b/3rdparty/libbcrypt-1.0/source/include/config.h new file mode 100644 index 0000000..e7f372e --- /dev/null +++ b/3rdparty/libbcrypt-1.0/source/include/config.h @@ -0,0 +1,22 @@ +/* ==================================================================== + * Copyright (c) 2002 Johnny Shelley. All rights reserved. + * + * Bcrypt is licensed under the BSD software license. See the file + * called 'LICENSE' that you should have received with this software + * for details + * ==================================================================== + */ + + +/* All options are either 1 for true or 0 for false w/ the exception */ +/* of SECUREDELETE which may be anything from 0 to 127. */ +/* All options may be overridden on the command line. */ + +/* whether or not to compress files */ +#define COMPRESS 1 +/* send output to stdout */ +#define STANDARDOUT 0 +/* remove input files after processing */ +#define REMOVE 1 +/* how many times to overwrite input files before deleting */ +#define SECUREDELETE 3 diff --git a/3rdparty/libbcrypt-1.0/source/include/defines.h b/3rdparty/libbcrypt-1.0/source/include/defines.h new file mode 100644 index 0000000..7e36ed0 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/source/include/defines.h @@ -0,0 +1,27 @@ +typedef struct _BCoptions { + unsigned char remove; + unsigned char standardout; + unsigned char compression; + unsigned char type; + uLong origsize; + unsigned char securedelete; +} BCoptions; + +#define ENCRYPT 0 +#define DECRYPT 1 + +#define endianBig ((unsigned char) 0x45) +#define endianLittle ((unsigned char) 0x54) + +typedef unsigned int uInt32; + +#ifdef WIN32 /* Win32 doesn't have random() or lstat */ +#define random() rand() +#define initstate(x,y,z) srand(x) +#define lstat(x,y) stat(x,y) +#endif + +#ifndef S_ISREG +#define S_ISREG(x) ( ((x)&S_IFMT)==S_IFREG ) +#endif + diff --git a/3rdparty/libbcrypt-1.0/source/include/functions.h b/3rdparty/libbcrypt-1.0/source/include/functions.h new file mode 100644 index 0000000..e7abb83 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/source/include/functions.h @@ -0,0 +1,51 @@ +/* ==================================================================== + * Copyright (c) 2002 Johnny Shelley. All rights reserved. + * + * Bcrypt is licensed under the BSD software license. See the file + * called 'LICENSE' that you should have received with this software + * for details + * ==================================================================== + */ + +#include "includes.h" +#include "blowfish.h" + +/* from wrapbf.c */ +uLong BFEncrypt(char **input, char *key, uLong sz, + BCoptions *options); +uLong BFDecrypt(char **input, char *key, char *key2, + uLong sz, BCoptions *options); + +/* from keys.c */ +char * getkey(int type, char* TheKey); +void mutateKey(char **key, char **key2); + +/* from rwfile.c */ +int getremain(uLong sz, int dv); +uLong padInput(char **input, uLong sz); +uLong attachKey(char **input, char *key, uLong sz); +uLong readfile(char *infile, char **input, int type, char *key, + struct stat statbuf); +uLong writefile(char *outfile, char *output, uLong sz, + BCoptions options, struct stat statbuf); +int deletefile(char *file, BCoptions options, char *key, struct stat statbuf); + +/* from wrapzl.c */ +uLong docompress(char **input, uLong sz); +uLong douncompress(char **input, uLong sz, BCoptions options); + +/* from main.c */ +BCoptions initoptions(BCoptions options); +int usage(char *name); +int memerror(); +int parseArgs(char delOrig, BCoptions *options); +int assignFiles(char *arg, char **infile, char **outfile, struct stat *statbuf, + BCoptions *options, char *key); +int main(int argc, char *argv[]); + +/* from endian.c */ +void getEndian(unsigned char **e); +uInt32 swapEndian(uInt32 value); +int testEndian(char *input); +int swapCompressed(char **input, uLong sz); + diff --git a/3rdparty/libbcrypt-1.0/source/include/includes.h b/3rdparty/libbcrypt-1.0/source/include/includes.h new file mode 100644 index 0000000..7ce860c --- /dev/null +++ b/3rdparty/libbcrypt-1.0/source/include/includes.h @@ -0,0 +1,23 @@ +/* ==================================================================== + * Copyright (c) 2002 Johnny Shelley. All rights reserved. + * + * Bcrypt is licensed under the BSD software license. See the file + * called 'LICENSE' that you should have received with this software + * for details + * ==================================================================== + */ + +#include +#include +#include + +#ifndef WIN32 /* These libraries don't exist on Win32 */ +#include +#include +#include +#endif + +#include +#include +#include + diff --git a/3rdparty/libbcrypt-1.0/source/src/bcrypt.c b/3rdparty/libbcrypt-1.0/source/src/bcrypt.c new file mode 100644 index 0000000..cbd1e08 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/source/src/bcrypt.c @@ -0,0 +1,192 @@ +/* ==================================================================== + * Copyright (c) 2002 John Sennesael. All rights reserved. + * + * This header is part of a C library interface for bcrypt developed by + * donationcoder.com + * ==================================================================== + */ + +#include "bcrypt.h" +/* ==================================================================== + * Copyright (c) 2002 Johnny Shelley. All rights reserved. + * + * Bcrypt is licensed under the BSD software license. See the file + * called 'LICENSE' that you should have received with this software + * for details + * ==================================================================== + */ + +#include "includes.h" +#include "defines.h" +#include "functions.h" +#include "config.h" + +extern char *optarg; +extern int optind, optreset, opterr; + +BCoptions initoptions(BCoptions options) { + options.remove = REMOVE; + options.standardout = STANDARDOUT; + options.compression = COMPRESS; /* leave this on by default */ + options.type = 127; + options.origsize = 0; + options.securedelete = SECUREDELETE; + return options; +} + +int usage(char *name) { + fprintf(stderr, "Usage is: %s -[orc][-sN] file1 file2..\n", name); + if (STANDARDOUT == 0) + fprintf(stderr, " -o Write output to standard out\n"); + else + fprintf(stderr, " -o Don't write output to standard out\n"); + if (REMOVE == 1) + fprintf(stderr, " -r Do NOT remove input files after processing\n"); + else + fprintf(stderr, " -r Remove input files after processing\n"); + if (COMPRESS == 1) + fprintf(stderr, " -c Do NOT compress files before encryption\n"); + else + fprintf(stderr, " -c Compress files before encryption\n"); + + fprintf(stderr, " -sN How many times to overwrite input files with random\ + data\n"); + + return 0; +} + +int memerror() { + fprintf(stderr, "Can't allocate enough memory. Bailing out\n"); + return -1; +} + +int parseArgs(char delOrig, BCoptions *options) + { + signed char ch; + char *progname; + + *options = initoptions(*options); + options->remove = delOrig; + options->standardout = 0; + options->compression = 1; + return 0; + } + +int assignFiles(char *arg, char **infile, char **outfile, struct stat *statbuf, BCoptions *options, char *key) + { + if (lstat(arg, statbuf) < 0) return(1); + if (!S_ISREG(statbuf->st_mode)) return(1); + if ((*infile = realloc(*infile, strlen(arg) + 1)) == NULL) memerror(); + memset(*infile, 0, strlen(arg) + 1); + strcpy(*infile, arg); + if ((*outfile = realloc(*outfile, strlen(arg) + 5)) == NULL) memerror(); + memset(*outfile, 0, strlen(arg) + 5); + strcpy(*outfile, *infile); + if (strlen(*infile) > 4) + { + if ((memcmp(*infile+(strlen(*infile) - 4), ".bfe", 4) == 0) && ((!key) || (options->type == DECRYPT))) + { + memset(*outfile+(strlen(*infile) - 4), 0, 4); + options->type = DECRYPT; + } + else if ((!key) || (options->type == ENCRYPT)) + { + if (memcmp(*infile+(strlen(*infile) - 4), ".bfe", 4) == 0) return -1 ; + strcat(*outfile, ".bfe"); + options->type = ENCRYPT; + } + else + { + return -1; + } + } + else if ((!key) || (options->type == ENCRYPT)) + { + strcat(*outfile, ".bfe"); + options->type = ENCRYPT; + } + else + { + return -1; + } + return 0; + } + +int docrypt(char encrypt,char* filename, char* TheKey, char delOrig) + { + uLong sz = 0; + char *input = NULL, *key = NULL, *key2 = NULL; + char *infile = NULL, *outfile = NULL; + struct stat statbuf; + BCoptions options; + parseArgs(delOrig, &options); + if (assignFiles(filename, &infile, &outfile, &statbuf, &options, key) != 0) + { + return -1; // file open error + } + if (!key) + { + key = getkey(options.type,TheKey); + mutateKey(&key, &key2); + } + if (!key) + { + return -2; // missing key error + } + sz = readfile(infile, &input, options.type, key, statbuf); + if ((options.type == DECRYPT) && (testEndian(input))) swapCompressed(&input, sz); + if ((options.compression == 1) && (options.type == ENCRYPT)) + { + options.origsize = sz; + sz = docompress(&input, sz); + } + if (options.type == ENCRYPT) + { + sz = attachKey(&input, key, sz); + sz = padInput(&input, sz); + } + if (options.type == ENCRYPT) + { + sz = BFEncrypt(&input, key, sz, &options); + } + else if (options.type == DECRYPT) + { + if ((sz = BFDecrypt(&input, key, key2, sz, &options)) == 0) + { + return -3; // wrong key error + } + } + if ((options.compression == 1) && (options.type == DECRYPT)) + { + sz = douncompress(&input, sz, options); + } + writefile(outfile, input, sz, options, statbuf); + if ((input = realloc(input, sizeof(char *))) == NULL) + { + return -4; // memory error + } + if (options.remove == 1) deletefile(infile, options, key, statbuf); + if (input != NULL) free(input); + if (!sz) + { + return -5; // no valid files found + } + return 0; // success. + } + +// Encrypts a file. +int bcrypt(char* filename,char* key,char delOrig) + { + int MyReturn = docrypt(1,filename,key,delOrig); + return MyReturn; + } + +// Decrypts a file. +int bdecrypt(char* filename,char* key,char delOrig) + { + int MyReturn = docrypt(0,filename,key,delOrig); + return MyReturn; + } + + + diff --git a/3rdparty/libbcrypt-1.0/source/src/blowfish.c b/3rdparty/libbcrypt-1.0/source/src/blowfish.c new file mode 100644 index 0000000..ee8c672 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/source/src/blowfish.c @@ -0,0 +1,399 @@ +/* + * Author : Paul Kocher + * E-mail : pck@netcom.com + * Date : 1997 + * Description: C implementation of the Blowfish algorithm. + */ + +#include "includes.h" +#include "defines.h" +#include "blowfish.h" +#define N 16 + +static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x); +static const uInt32 ORIG_P[16 + 2] = { + 0x243F6A88L, 0x85A308D3L, 0x13198A2EL, 0x03707344L, + 0xA4093822L, 0x299F31D0L, 0x082EFA98L, 0xEC4E6C89L, + 0x452821E6L, 0x38D01377L, 0xBE5466CFL, 0x34E90C6CL, + 0xC0AC29B7L, 0xC97C50DDL, 0x3F84D5B5L, 0xB5470917L, + 0x9216D5D9L, 0x8979FB1BL +}; + +static const uInt32 ORIG_S[4][256] = { + { 0xD1310BA6L, 0x98DFB5ACL, 0x2FFD72DBL, 0xD01ADFB7L, + 0xB8E1AFEDL, 0x6A267E96L, 0xBA7C9045L, 0xF12C7F99L, + 0x24A19947L, 0xB3916CF7L, 0x0801F2E2L, 0x858EFC16L, + 0x636920D8L, 0x71574E69L, 0xA458FEA3L, 0xF4933D7EL, + 0x0D95748FL, 0x728EB658L, 0x718BCD58L, 0x82154AEEL, + 0x7B54A41DL, 0xC25A59B5L, 0x9C30D539L, 0x2AF26013L, + 0xC5D1B023L, 0x286085F0L, 0xCA417918L, 0xB8DB38EFL, + 0x8E79DCB0L, 0x603A180EL, 0x6C9E0E8BL, 0xB01E8A3EL, + 0xD71577C1L, 0xBD314B27L, 0x78AF2FDAL, 0x55605C60L, + 0xE65525F3L, 0xAA55AB94L, 0x57489862L, 0x63E81440L, + 0x55CA396AL, 0x2AAB10B6L, 0xB4CC5C34L, 0x1141E8CEL, + 0xA15486AFL, 0x7C72E993L, 0xB3EE1411L, 0x636FBC2AL, + 0x2BA9C55DL, 0x741831F6L, 0xCE5C3E16L, 0x9B87931EL, + 0xAFD6BA33L, 0x6C24CF5CL, 0x7A325381L, 0x28958677L, + 0x3B8F4898L, 0x6B4BB9AFL, 0xC4BFE81BL, 0x66282193L, + 0x61D809CCL, 0xFB21A991L, 0x487CAC60L, 0x5DEC8032L, + 0xEF845D5DL, 0xE98575B1L, 0xDC262302L, 0xEB651B88L, + 0x23893E81L, 0xD396ACC5L, 0x0F6D6FF3L, 0x83F44239L, + 0x2E0B4482L, 0xA4842004L, 0x69C8F04AL, 0x9E1F9B5EL, + 0x21C66842L, 0xF6E96C9AL, 0x670C9C61L, 0xABD388F0L, + 0x6A51A0D2L, 0xD8542F68L, 0x960FA728L, 0xAB5133A3L, + 0x6EEF0B6CL, 0x137A3BE4L, 0xBA3BF050L, 0x7EFB2A98L, + 0xA1F1651DL, 0x39AF0176L, 0x66CA593EL, 0x82430E88L, + 0x8CEE8619L, 0x456F9FB4L, 0x7D84A5C3L, 0x3B8B5EBEL, + 0xE06F75D8L, 0x85C12073L, 0x401A449FL, 0x56C16AA6L, + 0x4ED3AA62L, 0x363F7706L, 0x1BFEDF72L, 0x429B023DL, + 0x37D0D724L, 0xD00A1248L, 0xDB0FEAD3L, 0x49F1C09BL, + 0x075372C9L, 0x80991B7BL, 0x25D479D8L, 0xF6E8DEF7L, + 0xE3FE501AL, 0xB6794C3BL, 0x976CE0BDL, 0x04C006BAL, + 0xC1A94FB6L, 0x409F60C4L, 0x5E5C9EC2L, 0x196A2463L, + 0x68FB6FAFL, 0x3E6C53B5L, 0x1339B2EBL, 0x3B52EC6FL, + 0x6DFC511FL, 0x9B30952CL, 0xCC814544L, 0xAF5EBD09L, + 0xBEE3D004L, 0xDE334AFDL, 0x660F2807L, 0x192E4BB3L, + 0xC0CBA857L, 0x45C8740FL, 0xD20B5F39L, 0xB9D3FBDBL, + 0x5579C0BDL, 0x1A60320AL, 0xD6A100C6L, 0x402C7279L, + 0x679F25FEL, 0xFB1FA3CCL, 0x8EA5E9F8L, 0xDB3222F8L, + 0x3C7516DFL, 0xFD616B15L, 0x2F501EC8L, 0xAD0552ABL, + 0x323DB5FAL, 0xFD238760L, 0x53317B48L, 0x3E00DF82L, + 0x9E5C57BBL, 0xCA6F8CA0L, 0x1A87562EL, 0xDF1769DBL, + 0xD542A8F6L, 0x287EFFC3L, 0xAC6732C6L, 0x8C4F5573L, + 0x695B27B0L, 0xBBCA58C8L, 0xE1FFA35DL, 0xB8F011A0L, + 0x10FA3D98L, 0xFD2183B8L, 0x4AFCB56CL, 0x2DD1D35BL, + 0x9A53E479L, 0xB6F84565L, 0xD28E49BCL, 0x4BFB9790L, + 0xE1DDF2DAL, 0xA4CB7E33L, 0x62FB1341L, 0xCEE4C6E8L, + 0xEF20CADAL, 0x36774C01L, 0xD07E9EFEL, 0x2BF11FB4L, + 0x95DBDA4DL, 0xAE909198L, 0xEAAD8E71L, 0x6B93D5A0L, + 0xD08ED1D0L, 0xAFC725E0L, 0x8E3C5B2FL, 0x8E7594B7L, + 0x8FF6E2FBL, 0xF2122B64L, 0x8888B812L, 0x900DF01CL, + 0x4FAD5EA0L, 0x688FC31CL, 0xD1CFF191L, 0xB3A8C1ADL, + 0x2F2F2218L, 0xBE0E1777L, 0xEA752DFEL, 0x8B021FA1L, + 0xE5A0CC0FL, 0xB56F74E8L, 0x18ACF3D6L, 0xCE89E299L, + 0xB4A84FE0L, 0xFD13E0B7L, 0x7CC43B81L, 0xD2ADA8D9L, + 0x165FA266L, 0x80957705L, 0x93CC7314L, 0x211A1477L, + 0xE6AD2065L, 0x77B5FA86L, 0xC75442F5L, 0xFB9D35CFL, + 0xEBCDAF0CL, 0x7B3E89A0L, 0xD6411BD3L, 0xAE1E7E49L, + 0x00250E2DL, 0x2071B35EL, 0x226800BBL, 0x57B8E0AFL, + 0x2464369BL, 0xF009B91EL, 0x5563911DL, 0x59DFA6AAL, + 0x78C14389L, 0xD95A537FL, 0x207D5BA2L, 0x02E5B9C5L, + 0x83260376L, 0x6295CFA9L, 0x11C81968L, 0x4E734A41L, + 0xB3472DCAL, 0x7B14A94AL, 0x1B510052L, 0x9A532915L, + 0xD60F573FL, 0xBC9BC6E4L, 0x2B60A476L, 0x81E67400L, + 0x08BA6FB5L, 0x571BE91FL, 0xF296EC6BL, 0x2A0DD915L, + 0xB6636521L, 0xE7B9F9B6L, 0xFF34052EL, 0xC5855664L, + 0x53B02D5DL, 0xA99F8FA1L, 0x08BA4799L, 0x6E85076AL }, + + { 0x4B7A70E9L, 0xB5B32944L, 0xDB75092EL, 0xC4192623L, + 0xAD6EA6B0L, 0x49A7DF7DL, 0x9CEE60B8L, 0x8FEDB266L, + 0xECAA8C71L, 0x699A17FFL, 0x5664526CL, 0xC2B19EE1L, + 0x193602A5L, 0x75094C29L, 0xA0591340L, 0xE4183A3EL, + 0x3F54989AL, 0x5B429D65L, 0x6B8FE4D6L, 0x99F73FD6L, + 0xA1D29C07L, 0xEFE830F5L, 0x4D2D38E6L, 0xF0255DC1L, + 0x4CDD2086L, 0x8470EB26L, 0x6382E9C6L, 0x021ECC5EL, + 0x09686B3FL, 0x3EBAEFC9L, 0x3C971814L, 0x6B6A70A1L, + 0x687F3584L, 0x52A0E286L, 0xB79C5305L, 0xAA500737L, + 0x3E07841CL, 0x7FDEAE5CL, 0x8E7D44ECL, 0x5716F2B8L, + 0xB03ADA37L, 0xF0500C0DL, 0xF01C1F04L, 0x0200B3FFL, + 0xAE0CF51AL, 0x3CB574B2L, 0x25837A58L, 0xDC0921BDL, + 0xD19113F9L, 0x7CA92FF6L, 0x94324773L, 0x22F54701L, + 0x3AE5E581L, 0x37C2DADCL, 0xC8B57634L, 0x9AF3DDA7L, + 0xA9446146L, 0x0FD0030EL, 0xECC8C73EL, 0xA4751E41L, + 0xE238CD99L, 0x3BEA0E2FL, 0x3280BBA1L, 0x183EB331L, + 0x4E548B38L, 0x4F6DB908L, 0x6F420D03L, 0xF60A04BFL, + 0x2CB81290L, 0x24977C79L, 0x5679B072L, 0xBCAF89AFL, + 0xDE9A771FL, 0xD9930810L, 0xB38BAE12L, 0xDCCF3F2EL, + 0x5512721FL, 0x2E6B7124L, 0x501ADDE6L, 0x9F84CD87L, + 0x7A584718L, 0x7408DA17L, 0xBC9F9ABCL, 0xE94B7D8CL, + 0xEC7AEC3AL, 0xDB851DFAL, 0x63094366L, 0xC464C3D2L, + 0xEF1C1847L, 0x3215D908L, 0xDD433B37L, 0x24C2BA16L, + 0x12A14D43L, 0x2A65C451L, 0x50940002L, 0x133AE4DDL, + 0x71DFF89EL, 0x10314E55L, 0x81AC77D6L, 0x5F11199BL, + 0x043556F1L, 0xD7A3C76BL, 0x3C11183BL, 0x5924A509L, + 0xF28FE6EDL, 0x97F1FBFAL, 0x9EBABF2CL, 0x1E153C6EL, + 0x86E34570L, 0xEAE96FB1L, 0x860E5E0AL, 0x5A3E2AB3L, + 0x771FE71CL, 0x4E3D06FAL, 0x2965DCB9L, 0x99E71D0FL, + 0x803E89D6L, 0x5266C825L, 0x2E4CC978L, 0x9C10B36AL, + 0xC6150EBAL, 0x94E2EA78L, 0xA5FC3C53L, 0x1E0A2DF4L, + 0xF2F74EA7L, 0x361D2B3DL, 0x1939260FL, 0x19C27960L, + 0x5223A708L, 0xF71312B6L, 0xEBADFE6EL, 0xEAC31F66L, + 0xE3BC4595L, 0xA67BC883L, 0xB17F37D1L, 0x018CFF28L, + 0xC332DDEFL, 0xBE6C5AA5L, 0x65582185L, 0x68AB9802L, + 0xEECEA50FL, 0xDB2F953BL, 0x2AEF7DADL, 0x5B6E2F84L, + 0x1521B628L, 0x29076170L, 0xECDD4775L, 0x619F1510L, + 0x13CCA830L, 0xEB61BD96L, 0x0334FE1EL, 0xAA0363CFL, + 0xB5735C90L, 0x4C70A239L, 0xD59E9E0BL, 0xCBAADE14L, + 0xEECC86BCL, 0x60622CA7L, 0x9CAB5CABL, 0xB2F3846EL, + 0x648B1EAFL, 0x19BDF0CAL, 0xA02369B9L, 0x655ABB50L, + 0x40685A32L, 0x3C2AB4B3L, 0x319EE9D5L, 0xC021B8F7L, + 0x9B540B19L, 0x875FA099L, 0x95F7997EL, 0x623D7DA8L, + 0xF837889AL, 0x97E32D77L, 0x11ED935FL, 0x16681281L, + 0x0E358829L, 0xC7E61FD6L, 0x96DEDFA1L, 0x7858BA99L, + 0x57F584A5L, 0x1B227263L, 0x9B83C3FFL, 0x1AC24696L, + 0xCDB30AEBL, 0x532E3054L, 0x8FD948E4L, 0x6DBC3128L, + 0x58EBF2EFL, 0x34C6FFEAL, 0xFE28ED61L, 0xEE7C3C73L, + 0x5D4A14D9L, 0xE864B7E3L, 0x42105D14L, 0x203E13E0L, + 0x45EEE2B6L, 0xA3AAABEAL, 0xDB6C4F15L, 0xFACB4FD0L, + 0xC742F442L, 0xEF6ABBB5L, 0x654F3B1DL, 0x41CD2105L, + 0xD81E799EL, 0x86854DC7L, 0xE44B476AL, 0x3D816250L, + 0xCF62A1F2L, 0x5B8D2646L, 0xFC8883A0L, 0xC1C7B6A3L, + 0x7F1524C3L, 0x69CB7492L, 0x47848A0BL, 0x5692B285L, + 0x095BBF00L, 0xAD19489DL, 0x1462B174L, 0x23820E00L, + 0x58428D2AL, 0x0C55F5EAL, 0x1DADF43EL, 0x233F7061L, + 0x3372F092L, 0x8D937E41L, 0xD65FECF1L, 0x6C223BDBL, + 0x7CDE3759L, 0xCBEE7460L, 0x4085F2A7L, 0xCE77326EL, + 0xA6078084L, 0x19F8509EL, 0xE8EFD855L, 0x61D99735L, + 0xA969A7AAL, 0xC50C06C2L, 0x5A04ABFCL, 0x800BCADCL, + 0x9E447A2EL, 0xC3453484L, 0xFDD56705L, 0x0E1E9EC9L, + 0xDB73DBD3L, 0x105588CDL, 0x675FDA79L, 0xE3674340L, + 0xC5C43465L, 0x713E38D8L, 0x3D28F89EL, 0xF16DFF20L, + 0x153E21E7L, 0x8FB03D4AL, 0xE6E39F2BL, 0xDB83ADF7L }, + + { 0xE93D5A68L, 0x948140F7L, 0xF64C261CL, 0x94692934L, + 0x411520F7L, 0x7602D4F7L, 0xBCF46B2EL, 0xD4A20068L, + 0xD4082471L, 0x3320F46AL, 0x43B7D4B7L, 0x500061AFL, + 0x1E39F62EL, 0x97244546L, 0x14214F74L, 0xBF8B8840L, + 0x4D95FC1DL, 0x96B591AFL, 0x70F4DDD3L, 0x66A02F45L, + 0xBFBC09ECL, 0x03BD9785L, 0x7FAC6DD0L, 0x31CB8504L, + 0x96EB27B3L, 0x55FD3941L, 0xDA2547E6L, 0xABCA0A9AL, + 0x28507825L, 0x530429F4L, 0x0A2C86DAL, 0xE9B66DFBL, + 0x68DC1462L, 0xD7486900L, 0x680EC0A4L, 0x27A18DEEL, + 0x4F3FFEA2L, 0xE887AD8CL, 0xB58CE006L, 0x7AF4D6B6L, + 0xAACE1E7CL, 0xD3375FECL, 0xCE78A399L, 0x406B2A42L, + 0x20FE9E35L, 0xD9F385B9L, 0xEE39D7ABL, 0x3B124E8BL, + 0x1DC9FAF7L, 0x4B6D1856L, 0x26A36631L, 0xEAE397B2L, + 0x3A6EFA74L, 0xDD5B4332L, 0x6841E7F7L, 0xCA7820FBL, + 0xFB0AF54EL, 0xD8FEB397L, 0x454056ACL, 0xBA489527L, + 0x55533A3AL, 0x20838D87L, 0xFE6BA9B7L, 0xD096954BL, + 0x55A867BCL, 0xA1159A58L, 0xCCA92963L, 0x99E1DB33L, + 0xA62A4A56L, 0x3F3125F9L, 0x5EF47E1CL, 0x9029317CL, + 0xFDF8E802L, 0x04272F70L, 0x80BB155CL, 0x05282CE3L, + 0x95C11548L, 0xE4C66D22L, 0x48C1133FL, 0xC70F86DCL, + 0x07F9C9EEL, 0x41041F0FL, 0x404779A4L, 0x5D886E17L, + 0x325F51EBL, 0xD59BC0D1L, 0xF2BCC18FL, 0x41113564L, + 0x257B7834L, 0x602A9C60L, 0xDFF8E8A3L, 0x1F636C1BL, + 0x0E12B4C2L, 0x02E1329EL, 0xAF664FD1L, 0xCAD18115L, + 0x6B2395E0L, 0x333E92E1L, 0x3B240B62L, 0xEEBEB922L, + 0x85B2A20EL, 0xE6BA0D99L, 0xDE720C8CL, 0x2DA2F728L, + 0xD0127845L, 0x95B794FDL, 0x647D0862L, 0xE7CCF5F0L, + 0x5449A36FL, 0x877D48FAL, 0xC39DFD27L, 0xF33E8D1EL, + 0x0A476341L, 0x992EFF74L, 0x3A6F6EABL, 0xF4F8FD37L, + 0xA812DC60L, 0xA1EBDDF8L, 0x991BE14CL, 0xDB6E6B0DL, + 0xC67B5510L, 0x6D672C37L, 0x2765D43BL, 0xDCD0E804L, + 0xF1290DC7L, 0xCC00FFA3L, 0xB5390F92L, 0x690FED0BL, + 0x667B9FFBL, 0xCEDB7D9CL, 0xA091CF0BL, 0xD9155EA3L, + 0xBB132F88L, 0x515BAD24L, 0x7B9479BFL, 0x763BD6EBL, + 0x37392EB3L, 0xCC115979L, 0x8026E297L, 0xF42E312DL, + 0x6842ADA7L, 0xC66A2B3BL, 0x12754CCCL, 0x782EF11CL, + 0x6A124237L, 0xB79251E7L, 0x06A1BBE6L, 0x4BFB6350L, + 0x1A6B1018L, 0x11CAEDFAL, 0x3D25BDD8L, 0xE2E1C3C9L, + 0x44421659L, 0x0A121386L, 0xD90CEC6EL, 0xD5ABEA2AL, + 0x64AF674EL, 0xDA86A85FL, 0xBEBFE988L, 0x64E4C3FEL, + 0x9DBC8057L, 0xF0F7C086L, 0x60787BF8L, 0x6003604DL, + 0xD1FD8346L, 0xF6381FB0L, 0x7745AE04L, 0xD736FCCCL, + 0x83426B33L, 0xF01EAB71L, 0xB0804187L, 0x3C005E5FL, + 0x77A057BEL, 0xBDE8AE24L, 0x55464299L, 0xBF582E61L, + 0x4E58F48FL, 0xF2DDFDA2L, 0xF474EF38L, 0x8789BDC2L, + 0x5366F9C3L, 0xC8B38E74L, 0xB475F255L, 0x46FCD9B9L, + 0x7AEB2661L, 0x8B1DDF84L, 0x846A0E79L, 0x915F95E2L, + 0x466E598EL, 0x20B45770L, 0x8CD55591L, 0xC902DE4CL, + 0xB90BACE1L, 0xBB8205D0L, 0x11A86248L, 0x7574A99EL, + 0xB77F19B6L, 0xE0A9DC09L, 0x662D09A1L, 0xC4324633L, + 0xE85A1F02L, 0x09F0BE8CL, 0x4A99A025L, 0x1D6EFE10L, + 0x1AB93D1DL, 0x0BA5A4DFL, 0xA186F20FL, 0x2868F169L, + 0xDCB7DA83L, 0x573906FEL, 0xA1E2CE9BL, 0x4FCD7F52L, + 0x50115E01L, 0xA70683FAL, 0xA002B5C4L, 0x0DE6D027L, + 0x9AF88C27L, 0x773F8641L, 0xC3604C06L, 0x61A806B5L, + 0xF0177A28L, 0xC0F586E0L, 0x006058AAL, 0x30DC7D62L, + 0x11E69ED7L, 0x2338EA63L, 0x53C2DD94L, 0xC2C21634L, + 0xBBCBEE56L, 0x90BCB6DEL, 0xEBFC7DA1L, 0xCE591D76L, + 0x6F05E409L, 0x4B7C0188L, 0x39720A3DL, 0x7C927C24L, + 0x86E3725FL, 0x724D9DB9L, 0x1AC15BB4L, 0xD39EB8FCL, + 0xED545578L, 0x08FCA5B5L, 0xD83D7CD3L, 0x4DAD0FC4L, + 0x1E50EF5EL, 0xB161E6F8L, 0xA28514D9L, 0x6C51133CL, + 0x6FD5C7E7L, 0x56E14EC4L, 0x362ABFCEL, 0xDDC6C837L, + 0xD79A3234L, 0x92638212L, 0x670EFA8EL, 0x406000E0L }, + + { 0x3A39CE37L, 0xD3FAF5CFL, 0xABC27737L, 0x5AC52D1BL, + 0x5CB0679EL, 0x4FA33742L, 0xD3822740L, 0x99BC9BBEL, + 0xD5118E9DL, 0xBF0F7315L, 0xD62D1C7EL, 0xC700C47BL, + 0xB78C1B6BL, 0x21A19045L, 0xB26EB1BEL, 0x6A366EB4L, + 0x5748AB2FL, 0xBC946E79L, 0xC6A376D2L, 0x6549C2C8L, + 0x530FF8EEL, 0x468DDE7DL, 0xD5730A1DL, 0x4CD04DC6L, + 0x2939BBDBL, 0xA9BA4650L, 0xAC9526E8L, 0xBE5EE304L, + 0xA1FAD5F0L, 0x6A2D519AL, 0x63EF8CE2L, 0x9A86EE22L, + 0xC089C2B8L, 0x43242EF6L, 0xA51E03AAL, 0x9CF2D0A4L, + 0x83C061BAL, 0x9BE96A4DL, 0x8FE51550L, 0xBA645BD6L, + 0x2826A2F9L, 0xA73A3AE1L, 0x4BA99586L, 0xEF5562E9L, + 0xC72FEFD3L, 0xF752F7DAL, 0x3F046F69L, 0x77FA0A59L, + 0x80E4A915L, 0x87B08601L, 0x9B09E6ADL, 0x3B3EE593L, + 0xE990FD5AL, 0x9E34D797L, 0x2CF0B7D9L, 0x022B8B51L, + 0x96D5AC3AL, 0x017DA67DL, 0xD1CF3ED6L, 0x7C7D2D28L, + 0x1F9F25CFL, 0xADF2B89BL, 0x5AD6B472L, 0x5A88F54CL, + 0xE029AC71L, 0xE019A5E6L, 0x47B0ACFDL, 0xED93FA9BL, + 0xE8D3C48DL, 0x283B57CCL, 0xF8D56629L, 0x79132E28L, + 0x785F0191L, 0xED756055L, 0xF7960E44L, 0xE3D35E8CL, + 0x15056DD4L, 0x88F46DBAL, 0x03A16125L, 0x0564F0BDL, + 0xC3EB9E15L, 0x3C9057A2L, 0x97271AECL, 0xA93A072AL, + 0x1B3F6D9BL, 0x1E6321F5L, 0xF59C66FBL, 0x26DCF319L, + 0x7533D928L, 0xB155FDF5L, 0x03563482L, 0x8ABA3CBBL, + 0x28517711L, 0xC20AD9F8L, 0xABCC5167L, 0xCCAD925FL, + 0x4DE81751L, 0x3830DC8EL, 0x379D5862L, 0x9320F991L, + 0xEA7A90C2L, 0xFB3E7BCEL, 0x5121CE64L, 0x774FBE32L, + 0xA8B6E37EL, 0xC3293D46L, 0x48DE5369L, 0x6413E680L, + 0xA2AE0810L, 0xDD6DB224L, 0x69852DFDL, 0x09072166L, + 0xB39A460AL, 0x6445C0DDL, 0x586CDECFL, 0x1C20C8AEL, + 0x5BBEF7DDL, 0x1B588D40L, 0xCCD2017FL, 0x6BB4E3BBL, + 0xDDA26A7EL, 0x3A59FF45L, 0x3E350A44L, 0xBCB4CDD5L, + 0x72EACEA8L, 0xFA6484BBL, 0x8D6612AEL, 0xBF3C6F47L, + 0xD29BE463L, 0x542F5D9EL, 0xAEC2771BL, 0xF64E6370L, + 0x740E0D8DL, 0xE75B1357L, 0xF8721671L, 0xAF537D5DL, + 0x4040CB08L, 0x4EB4E2CCL, 0x34D2466AL, 0x0115AF84L, + 0xE1B00428L, 0x95983A1DL, 0x06B89FB4L, 0xCE6EA048L, + 0x6F3F3B82L, 0x3520AB82L, 0x011A1D4BL, 0x277227F8L, + 0x611560B1L, 0xE7933FDCL, 0xBB3A792BL, 0x344525BDL, + 0xA08839E1L, 0x51CE794BL, 0x2F32C9B7L, 0xA01FBAC9L, + 0xE01CC87EL, 0xBCC7D1F6L, 0xCF0111C3L, 0xA1E8AAC7L, + 0x1A908749L, 0xD44FBD9AL, 0xD0DADECBL, 0xD50ADA38L, + 0x0339C32AL, 0xC6913667L, 0x8DF9317CL, 0xE0B12B4FL, + 0xF79E59B7L, 0x43F5BB3AL, 0xF2D519FFL, 0x27D9459CL, + 0xBF97222CL, 0x15E6FC2AL, 0x0F91FC71L, 0x9B941525L, + 0xFAE59361L, 0xCEB69CEBL, 0xC2A86459L, 0x12BAA8D1L, + 0xB6C1075EL, 0xE3056A0CL, 0x10D25065L, 0xCB03A442L, + 0xE0EC6E0EL, 0x1698DB3BL, 0x4C98A0BEL, 0x3278E964L, + 0x9F1F9532L, 0xE0D392DFL, 0xD3A0342BL, 0x8971F21EL, + 0x1B0A7441L, 0x4BA3348CL, 0xC5BE7120L, 0xC37632D8L, + 0xDF359F8DL, 0x9B992F2EL, 0xE60B6F47L, 0x0FE3F11DL, + 0xE54CDA54L, 0x1EDAD891L, 0xCE6279CFL, 0xCD3E7E6FL, + 0x1618B166L, 0xFD2C1D05L, 0x848FD2C5L, 0xF6FB2299L, + 0xF523F357L, 0xA6327623L, 0x93A83531L, 0x56CCCD02L, + 0xACF08162L, 0x5A75EBB5L, 0x6E163697L, 0x88D273CCL, + 0xDE966292L, 0x81B949D0L, 0x4C50901BL, 0x71C65614L, + 0xE6C6C7BDL, 0x327A140AL, 0x45E1D006L, 0xC3F27B9AL, + 0xC9AA53FDL, 0x62A80F00L, 0xBB25BFE2L, 0x35BDD2F6L, + 0x71126905L, 0xB2040222L, 0xB6CBCF7CL, 0xCD769C2BL, + 0x53113EC0L, 0x1640E3D3L, 0x38ABBD60L, 0x2547ADF0L, + 0xBA38209CL, 0xF746CE76L, 0x77AFA1C5L, 0x20756060L, + 0x85CBFE4EL, 0x8AE88DD8L, 0x7AAAF9B0L, 0x4CF9AA7EL, + 0x1948C25CL, 0x02FB8A8CL, 0x01C36AE4L, 0xD6EBE1F9L, + 0x90D4F869L, 0xA65CDEA0L, 0x3F09252DL, 0xC208E69FL, + 0xB74E6132L, 0xCE77E25BL, 0x578FDFE3L, 0x3AC372E6L } +}; +uInt32 F(BLOWFISH_CTX *ctx, uInt32 x) { + unsigned short a, b, c, d; + uInt32 y; + + d = x & 0x00FF; + x >>= 8; + c = x & 0x00FF; + x >>= 8; + b = x & 0x00FF; + x >>= 8; + a = x & 0x00FF; + + y = ctx->S[0][a] + ctx->S[1][b]; + y = y ^ ctx->S[2][c]; + y = y + ctx->S[3][d]; + return y; +} + +void Blowfish_Encrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32 +*xr) { + uInt32 Xl; + uInt32 Xr; + uInt32 temp; + short i; + + Xl = *xl; + Xr = *xr; + + for (i = 0; i < N; ++i) { + Xl = Xl ^ ctx->P[i]; + Xr = F(ctx, Xl) ^ Xr; + temp = Xl; + Xl = Xr; + Xr = temp; + } + + temp = Xl; + Xl = Xr; + Xr = temp; + Xr = Xr ^ ctx->P[N]; + Xl = Xl ^ ctx->P[N + 1]; + *xl = Xl; + *xr = Xr; +} + +void Blowfish_Decrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32 +*xr) { + uInt32 Xl; + uInt32 Xr; + uInt32 temp; + short i; + + Xl = *xl; + Xr = *xr; + + for (i = N + 1; i > 1; --i) { + Xl = Xl ^ ctx->P[i]; + Xr = F(ctx, Xl) ^ Xr; + /* Exchange Xl and Xr */ + temp = Xl; + Xl = Xr; + Xr = temp; + } + + /* Exchange Xl and Xr */ + temp = Xl; + Xl = Xr; + Xr = temp; + Xr = Xr ^ ctx->P[1]; + Xl = Xl ^ ctx->P[0]; + *xl = Xl; + *xr = Xr; +} + +void Blowfish_Init(BLOWFISH_CTX *ctx, unsigned char *key, int keyLen) { + int i, j, k; + uInt32 data, datal, datar; + + for (i = 0; i < 4; i++) { + + for (j = 0; j < 256; j++) + ctx->S[i][j] = ORIG_S[i][j]; + } + + j = 0; + + for (i = 0; i < N + 2; ++i) { + data = 0x00000000; + + for (k = 0; k < 4; ++k) { + data = (data << 8) | key[j]; + j = j + 1; + if (j >= keyLen) + j = 0; + } + + ctx->P[i] = ORIG_P[i] ^ data; + } + + datal = 0x00000000; + datar = 0x00000000; + + for (i = 0; i < N + 2; i += 2) { + Blowfish_Encrypt(ctx, &datal, &datar); + ctx->P[i] = datal; + ctx->P[i + 1] = datar; + } + + for (i = 0; i < 4; ++i) { + + for (j = 0; j < 256; j += 2) { + Blowfish_Encrypt(ctx, &datal, &datar); + ctx->S[i][j] = datal; + ctx->S[i][j + 1] = datar; + } + } +} diff --git a/3rdparty/libbcrypt-1.0/source/src/endian.c b/3rdparty/libbcrypt-1.0/source/src/endian.c new file mode 100644 index 0000000..df962ce --- /dev/null +++ b/3rdparty/libbcrypt-1.0/source/src/endian.c @@ -0,0 +1,74 @@ +/* ==================================================================== + * Copyright (c) 2002 Johnny Shelley. All rights reserved. + * + * Bcrypt is licensed under the BSD software license. See the file + * called 'LICENSE' that you should have received with this software + * for details + * ==================================================================== + */ + +#include "includes.h" +#include "defines.h" +#include "functions.h" + +void getEndian(unsigned char **e) { + short i = 0x4321; + int bigE = (*(char*) &i); + + if ((*e = realloc(*e, sizeof(char) + 1)) == NULL) + memerror(); + + memset(*e, 0, sizeof(char) + 1); + + if (bigE == 0x43) + memset(*e, endianBig, 1); + else if (bigE == 0x21) + memset(*e, endianLittle, 1); +} + +uInt32 swapEndian(uInt32 value) { + unsigned int b1, b2, b3, b4; + uInt32 swapped; + + b4 = (value>>24) & 0xff; + b3 = (value>>16) & 0xff; + b2 = (value>>8) & 0xff; + b1 = value & 0xff; + + swapped = (b1<<24) | (b2<<16) | (b3<<8) | b4; + return(swapped); +} + +int testEndian(char *input) { + unsigned char *myEndian = NULL, *yourEndian = NULL; + + getEndian(&myEndian); + if ((yourEndian = malloc(2)) == NULL) + memerror(); + + memset(yourEndian, 0, 2); + memcpy(yourEndian, input, 1); + + if (memcmp(myEndian, yourEndian, 1) == 0) + return(0); + + return(1); +} + +int swapCompressed(char **input, uLong sz) { + char c; + unsigned int j, swap; + + memcpy(&c, *input+1, 1); + + if (c == 0) + return(0); + + j = sizeof(uInt32); + + memcpy(&swap, *input+(sz - j), j); + swap = swapEndian(swap); + memcpy(*input+(sz - j), &swap, j); + + return(1); +} diff --git a/3rdparty/libbcrypt-1.0/source/src/keys.c b/3rdparty/libbcrypt-1.0/source/src/keys.c new file mode 100644 index 0000000..6eba0ed --- /dev/null +++ b/3rdparty/libbcrypt-1.0/source/src/keys.c @@ -0,0 +1,94 @@ +/* ==================================================================== + * Copyright (c) 2002 Johnny Shelley. All rights reserved. + * + * Bcrypt is licensed under the BSD software license. See the file + * called 'LICENSE' that you should have received with this software + * for details + * ==================================================================== + */ + +#include "includes.h" +#include "defines.h" +#include "functions.h" + +char * getkey(int type,char* TheKey) + { + char *key, *key2, overflow[2], *ch; + if ((key = malloc(MAXKEYBYTES + 2)) == NULL) memerror(); + memset(key, 0, MAXKEYBYTES + 2); + strcpy(key,TheKey); + /* blowfish requires 32 bits, I want 64. deal w/ it */ + if (strlen(key) < 9 && type == ENCRYPT) + { /* \n is still tacked on */ + fprintf(stderr, "Key must be at least 8 characters\n"); + memset(key, 0, MAXKEYBYTES + 2); + return ""; + } + if (type == ENCRYPT) + { + if ((key2 = malloc(MAXKEYBYTES + 2)) == NULL) memerror(); + memset(key2, 0, MAXKEYBYTES + 2); + strcpy(key2,TheKey); + if (strcmp(key, key2)) + { + fprintf(stderr, "\nKeys don't match!\n"); + return ""; + } + memset(key2, 0, strlen(key2)); + free(key2); + } + if ((ch = memchr(key, (char) 10, strlen(key))) != NULL) memset(ch, 0, 1); + return(key); + } + +void mutateKey(char **key, char **key2) { + uInt32 L, R, l, r; + BLOWFISH_CTX ctx; + char *newkey, *newkey2; + int i, j; + + j = sizeof(uInt32); + + Blowfish_Init(&ctx, *key, strlen(*key)); + + memcpy(&L, *key, j); + memcpy(&R, *key+j, j); + memset(*key, 0, MAXKEYBYTES + 1); + + l = L; + r = R; + + if ((*key2 = malloc(MAXKEYBYTES + 1)) == NULL) + memerror(); + if ((newkey = malloc(MAXKEYBYTES + 1)) == NULL) + memerror(); + if ((newkey2 = malloc(MAXKEYBYTES + 1)) == NULL) + memerror(); + + memset(*key2, 0, MAXKEYBYTES + 1); + memset(newkey, 0, MAXKEYBYTES + 1); + memset(newkey2, 0, MAXKEYBYTES + 1); + + for (i=0; i < MAXKEYBYTES; i+=(j*2)) { + Blowfish_Encrypt(&ctx, &L, &R); + memcpy(newkey+i, &L, j); + memcpy(newkey+i+j, &R, j); + } + + for (i=0; i < MAXKEYBYTES; i+=(j*2)) { + l = swapEndian(l); + r = swapEndian(r); + + Blowfish_Encrypt(&ctx, &l, &r); + + l = swapEndian(l); + r = swapEndian(r); + + memcpy(newkey2+i, &l, j); + memcpy(newkey2+i+j, &r, j); + } + + memcpy(*key, newkey, MAXKEYBYTES); + memcpy(*key2, newkey2, MAXKEYBYTES); + free(newkey); +} diff --git a/3rdparty/libbcrypt-1.0/source/src/rwfile.c b/3rdparty/libbcrypt-1.0/source/src/rwfile.c new file mode 100644 index 0000000..8c1f93c --- /dev/null +++ b/3rdparty/libbcrypt-1.0/source/src/rwfile.c @@ -0,0 +1,148 @@ +/* ==================================================================== + * Copyright (c) 2002 Johnny Shelley. All rights reserved. + * + * Bcrypt is licensed under the BSD software license. See the file + * called 'LICENSE' that you should have received with this software + * for details + * ==================================================================== + */ + +#include "includes.h" +#include "defines.h" +#include "functions.h" + +int getremain(uLong sz, int dv) { + int r; + + r = sz / dv; + r++; + r = r * dv; + r = r - sz; + return(r); +} + +uLong padInput(char **input, uLong sz) { + int r, j; + + j = sizeof(uInt32) * 2; + + if (sz >= j) + r = getremain(sz, j); + else + r = j - sz; + + if ( r < j) { + if ((*input = realloc(*input, sz + r + 1)) == NULL) + memerror(); + + memset(*input+sz, 0, r + 1); + sz+=r; + } + + return(sz); +} + +uLong attachKey(char **input, char *key, uLong sz) { + + /* +3 so we have room for info tags at the beginning of the file */ + if ((*input = realloc(*input, sz + MAXKEYBYTES + 3)) == NULL) + memerror(); + + memcpy(*input+sz, key, MAXKEYBYTES); + sz += MAXKEYBYTES; + + return(sz); +} + +uLong readfile(char *infile, char **input, int type, char *key, + struct stat statbuf) { + FILE *fd; + int readsize; + uLong sz = 0; + + readsize = statbuf.st_size + 1; + + fd = fopen(infile, "rb"); + if (!fd) { + fprintf(stderr, "Unable to open file %s\n", infile); + return(-1); + } + + if ((*input = malloc(readsize + sz + 1)) == NULL) + memerror(); + + memset(*input+sz, 0, readsize); + sz += fread(*input+sz, 1, readsize - 1, fd); + + fclose(fd); + + return(sz); +} + +uLong writefile(char *outfile, char *output, uLong sz, + BCoptions options, struct stat statbuf) { + FILE *fd; + + if (options.standardout == 1) + fd = stdout; + else + fd = fopen(outfile, "wb"); + + if (!fd) { + fprintf(stderr, "Unable to create file %s\n", outfile); + return 1; + } + + if (fwrite(output, 1, sz, fd) != sz) { + fprintf(stderr, "Out of space while writing file %s\n", outfile); + return 1; + } + + if (!options.standardout) { + fclose(fd); + chmod(outfile, statbuf.st_mode); + } + + return(0); +} + +int deletefile(char *file, BCoptions options, char *key, struct stat statbuf) { + int lsize; + long g; + uLong j = 0, k = 0; + signed char i; + char *state, *garbage; + FILE *fd; + + if (options.securedelete > 0) { + lsize = sizeof(long); + k = (statbuf.st_size / lsize) + 1; + if ((state = malloc(257)) == NULL) + memerror(); + + initstate((unsigned long) key, state, 256); + if ((garbage = malloc(lsize + 1)) == NULL) + memerror(); + + fd = fopen(file, "r+b"); + + + for (i = options.securedelete; i > 0; i--) { + fseek(fd, 0, SEEK_SET); + + for (j = 0; j < k; j += lsize) { + g = random(); + memcpy(garbage, &g, lsize); + fwrite(garbage, lsize, 1, fd); + } + fflush(fd); + } + fclose(fd); + } + + if (unlink(file)) { + fprintf(stderr, "Error deleting file %s\n", file); + return(1); + } + return(0); +} diff --git a/3rdparty/libbcrypt-1.0/source/src/wrapbf.c b/3rdparty/libbcrypt-1.0/source/src/wrapbf.c new file mode 100644 index 0000000..356d584 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/source/src/wrapbf.c @@ -0,0 +1,117 @@ +/* ==================================================================== + * Copyright (c) 2002 Johnny Shelley. All rights reserved. + * + * Bcrypt is licensed under the BSD software license. See the file + * called 'LICENSE' that you should have received with this software + * for details + * ==================================================================== + */ + +#include "includes.h" +#include "defines.h" +#include "functions.h" + +uLong BFEncrypt(char **input, char *key, uLong sz, BCoptions *options) { + uInt32 L, R; + uLong i; + BLOWFISH_CTX ctx; + int j; + unsigned char *myEndian = NULL; + j = sizeof(uInt32); + + getEndian(&myEndian); + + memmove(*input+2, *input, sz); + + memcpy(*input, myEndian, 1); + memcpy(*input+1, &options->compression, 1); + + sz += 2; /* add room for endian and compress flags */ + + Blowfish_Init (&ctx, key, MAXKEYBYTES); + + for (i = 2; i < sz; i+=(j*2)) { /* start just after tags */ + memcpy(&L, *input+i, j); + memcpy(&R, *input+i+j, j); + Blowfish_Encrypt(&ctx, &L, &R); + memcpy(*input+i, &L, j); + memcpy(*input+i+j, &R, j); + } + + if (options->compression == 1) { + if ((*input = realloc(*input, sz + j + 1)) == NULL) + memerror(); + + memset(*input+sz, 0, j + 1); + memcpy(*input+sz, &options->origsize, j); + sz += j; /* make room for the original size */ + } + + free(myEndian); + return(sz); +} + +uLong BFDecrypt(char **input, char *key, char *key2, uLong sz, + BCoptions *options) { + uInt32 L, R; + uLong i; + BLOWFISH_CTX ctx; + int j, swap = 0; + unsigned char *myEndian = NULL; + char *mykey = NULL; + + j = sizeof(uInt32); + + if ((mykey = malloc(MAXKEYBYTES + 1)) == NULL) + memerror(); + + memset(mykey, 0, MAXKEYBYTES + 1); + + if ((swap = testEndian(*input)) == 1) + memcpy(mykey, key2, MAXKEYBYTES); + else + memcpy(mykey, key, MAXKEYBYTES); + + memcpy(&options->compression, *input+1, 1); + + if (options->compression == 1) { + memcpy(&options->origsize, *input+(sz - j), j); + sz -= j; /* dump the size tag */ + } + + sz -= 2; /* now dump endian and compress flags */ + + Blowfish_Init (&ctx, mykey, MAXKEYBYTES); + + for (i = 0; i < sz; i+=(j*2)) { + memcpy(&L, *input+i+2, j); + memcpy(&R, *input+i+j+2, j); + + if (swap == 1) { + L = swapEndian(L); + R = swapEndian(R); + } + + Blowfish_Decrypt(&ctx, &L, &R); + + if (swap == 1) { + L = swapEndian(L); + R = swapEndian(R); + } + + memcpy(*input+i, &L, j); + memcpy(*input+i+j, &R, j); + } + + while (memcmp(*input+(sz-1), "\0", 1) == 0) /* strip excess nulls */ + sz--; /* from decrypted files */ + + sz -= MAXKEYBYTES; + + if (memcmp(*input+sz, mykey, MAXKEYBYTES) != 0) + return(0); + + free(mykey); + free(myEndian); + return(sz); +} diff --git a/3rdparty/libbcrypt-1.0/source/src/wrapzl.c b/3rdparty/libbcrypt-1.0/source/src/wrapzl.c new file mode 100644 index 0000000..d4f5936 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/source/src/wrapzl.c @@ -0,0 +1,57 @@ +/* ==================================================================== + * Copyright (c) 2002 Johnny Shelley. All rights reserved. + * + * Bcrypt is licensed under the BSD software license. See the file + * called 'LICENSE' that you should have received with this software + * for details + * ==================================================================== + */ + +#include "includes.h" +#include "defines.h" +#include "functions.h" + +uLong docompress(char **input, uLong sz) { + uLong newsz; + char *output; + + newsz = sz + (sz *.1) + 13; + if ((output = malloc(newsz + 1)) == NULL) + memerror(); + + memset(output, 0, newsz + 1); + + compress((Bytef *) output, &newsz, (const Bytef *) *input, sz); + + free(*input); + if ((*input = malloc(newsz)) == NULL) + memerror(); + + memcpy(*input, output, newsz); + + free(output); + + return(newsz); +} + +uLong douncompress(char **input, uLong sz, BCoptions options) { + char *output; + + if ((output = malloc(options.origsize + 1)) == NULL) + memerror(); + + memset(output, 0, options.origsize + 1); + + uncompress((Bytef *) output, (uLong *) &options.origsize, + (const Bytef *) *input, sz); + + free(*input); + if ((*input = malloc(options.origsize)) == NULL) + memerror(); + + memcpy(*input, output, options.origsize); + + free(output); + + return(options.origsize); +} diff --git a/3rdparty/libbcrypt-1.0/win32console/CVS/Entries b/3rdparty/libbcrypt-1.0/win32console/CVS/Entries new file mode 100644 index 0000000..1a62daa --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/CVS/Entries @@ -0,0 +1,9 @@ +/Script1.rc/1.1/Fri Sep 13 07:33:27 2002// +/bcrypt.dsp/1.1/Fri Sep 13 07:06:00 2002// +/bcrypt.dsw/1.1/Fri Sep 13 07:11:13 2002/-kb/ +/getopt.c/1.1/Fri Sep 13 07:08:05 2002// +/getopt.h/1.1/Fri Sep 13 07:08:05 2002// +/icon1.ico/1.1/Fri Sep 13 07:11:13 2002/-kb/ +/readme-win32.txt/1.1/Fri Sep 13 07:08:05 2002// +/resource.h/1.1/Fri Sep 13 07:08:05 2002// +D/DLLs//// diff --git a/3rdparty/libbcrypt-1.0/win32console/CVS/Repository b/3rdparty/libbcrypt-1.0/win32console/CVS/Repository new file mode 100644 index 0000000..6c0f355 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/CVS/Repository @@ -0,0 +1 @@ +bcrypt/win32console diff --git a/3rdparty/libbcrypt-1.0/win32console/CVS/Root b/3rdparty/libbcrypt-1.0/win32console/CVS/Root new file mode 100644 index 0000000..c42ba94 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/CVS/Root @@ -0,0 +1 @@ +/home/cvs diff --git a/3rdparty/libbcrypt-1.0/win32console/DLLs/CVS/Entries b/3rdparty/libbcrypt-1.0/win32console/DLLs/CVS/Entries new file mode 100644 index 0000000..3f76a54 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/DLLs/CVS/Entries @@ -0,0 +1,4 @@ +/libz.def/1.1/Fri Sep 13 07:08:10 2002// +/zconf.h/1.1/Fri Sep 13 07:08:10 2002// +/zlib.h/1.1/Fri Sep 13 07:08:10 2002// +D diff --git a/3rdparty/libbcrypt-1.0/win32console/DLLs/CVS/Repository b/3rdparty/libbcrypt-1.0/win32console/DLLs/CVS/Repository new file mode 100644 index 0000000..96d7b31 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/DLLs/CVS/Repository @@ -0,0 +1 @@ +bcrypt/win32console/DLLs diff --git a/3rdparty/libbcrypt-1.0/win32console/DLLs/CVS/Root b/3rdparty/libbcrypt-1.0/win32console/DLLs/CVS/Root new file mode 100644 index 0000000..c42ba94 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/DLLs/CVS/Root @@ -0,0 +1 @@ +/home/cvs diff --git a/3rdparty/libbcrypt-1.0/win32console/DLLs/libz.def b/3rdparty/libbcrypt-1.0/win32console/DLLs/libz.def new file mode 100644 index 0000000..afa83d2 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/DLLs/libz.def @@ -0,0 +1,70 @@ +; i:\MINGW\BIN\dlltool.exe -Cn -a -z libz.def --export-all-symbols adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o +EXPORTS + gzseek @ 1 ; + _length_code @ 2 DATA ; + _tr_align @ 3 ; + _tr_flush_block @ 4 ; + _tr_init @ 5 ; + _tr_stored_block @ 6 ; + _tr_tally @ 7 ; + adler32 @ 8 ; + compress @ 9 ; + compress2 @ 10 ; + crc32 @ 11 ; + deflate @ 12 ; + deflateCopy @ 13 ; + deflateEnd @ 14 ; + deflateInit2_ @ 15 ; + deflateInit_ @ 16 ; + deflateParams @ 17 ; + deflateReset @ 18 ; + deflateSetDictionary @ 19 ; + deflate_copyright @ 20 DATA ; + get_crc_table @ 21 ; + gzclose @ 22 ; + gzdopen @ 23 ; + gzeof @ 24 ; + gzerror @ 25 ; + gzflush @ 26 ; + gzgetc @ 27 ; + gzgets @ 28 ; + gzopen @ 29 ; + gzprintf @ 30 ; + gzputc @ 31 ; + gzputs @ 32 ; + gzread @ 33 ; + gzrewind @ 34 ; + _dist_code @ 35 DATA ; + gzsetparams @ 36 ; + gztell @ 37 ; + gzwrite @ 38 ; + inflate @ 39 ; + inflateEnd @ 40 ; + inflateInit2_ @ 41 ; + inflateInit_ @ 42 ; + inflateReset @ 43 ; + inflateSetDictionary @ 44 ; + inflateSync @ 45 ; + inflateSyncPoint @ 46 ; + inflate_blocks @ 47 ; + inflate_blocks_free @ 48 ; + inflate_blocks_new @ 49 ; + inflate_blocks_reset @ 50 ; + inflate_blocks_sync_point @ 51 ; + inflate_codes @ 52 ; + inflate_codes_free @ 53 ; + inflate_codes_new @ 54 ; + inflate_copyright @ 55 DATA ; + inflate_fast @ 56 ; + inflate_flush @ 57 ; + inflate_mask @ 58 DATA ; + inflate_set_dictionary @ 59 ; + inflate_trees_bits @ 60 ; + inflate_trees_dynamic @ 61 ; + inflate_trees_fixed @ 62 ; + uncompress @ 63 ; + zError @ 64 ; + z_errmsg @ 65 DATA ; + zcalloc @ 66 ; + zcfree @ 67 ; + zlibVersion @ 68 ; diff --git a/3rdparty/libbcrypt-1.0/win32console/DLLs/zconf.h b/3rdparty/libbcrypt-1.0/win32console/DLLs/zconf.h new file mode 100644 index 0000000..87b8536 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/DLLs/zconf.h @@ -0,0 +1,279 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id: zconf.h,v 1.1 2002/09/13 07:08:10 syntax Exp $ */ + +#ifndef _ZCONF_H +#define _ZCONF_H + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + */ +#ifdef Z_PREFIX +# define deflateInit_ z_deflateInit_ +# define deflate z_deflate +# define deflateEnd z_deflateEnd +# define inflateInit_ z_inflateInit_ +# define inflate z_inflate +# define inflateEnd z_inflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateSetDictionary z_deflateSetDictionary +# define deflateCopy z_deflateCopy +# define deflateReset z_deflateReset +# define deflateParams z_deflateParams +# define inflateInit2_ z_inflateInit2_ +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateReset z_inflateReset +# define compress z_compress +# define compress2 z_compress2 +# define uncompress z_uncompress +# define adler32 z_adler32 +# define crc32 z_crc32 +# define get_crc_table z_get_crc_table + +# define Byte z_Byte +# define uInt z_uInt +# define uLong z_uLong +# define Bytef z_Bytef +# define charf z_charf +# define intf z_intf +# define uIntf z_uIntf +# define uLongf z_uLongf +# define voidpf z_voidpf +# define voidp z_voidp +#endif + +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) +# define WIN32 +#endif +#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) +# ifndef __32BIT__ +# define __32BIT__ +# endif +#endif +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#if defined(MSDOS) && !defined(__32BIT__) +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) +# define STDC +#endif +#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__) +# ifndef STDC +# define STDC +# endif +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const +# endif +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Old Borland C incorrectly complains about missing returns: */ +#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) +# define NEED_DUMMY_RETURN +#endif + + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +#endif +#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__)) +# ifndef __32BIT__ +# define SMALL_MEDIUM +# define FAR _far +# endif +#endif + +/* Compile with -DZLIB_DLL for Windows DLL support */ +#if defined(ZLIB_DLL) +# if defined(_WINDOWS) || defined(WINDOWS) +# ifdef FAR +# undef FAR +# endif +# include +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR _cdecl _export +# endif +# endif +# if defined (__BORLANDC__) +# if (__BORLANDC__ >= 0x0500) && defined (WIN32) +# include +# define ZEXPORT __declspec(dllexport) WINAPI +# define ZEXPORTRVA __declspec(dllexport) WINAPIV +# else +# if defined (_Windows) && defined (__DLL__) +# define ZEXPORT _export +# define ZEXPORTVA _export +# endif +# endif +# endif +#endif + +#if defined (__BEOS__) +# if defined (ZLIB_DLL) +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +#endif + +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif +#ifndef ZEXTERN +# define ZEXTERN extern +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(MACOS) && !defined(TARGET_OS_MAC) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#ifdef HAVE_UNISTD_H +# include /* for off_t */ +# include /* for SEEK_* and off_t */ +# define z_off_t off_t +#endif +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif +#ifndef z_off_t +# define z_off_t long +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) +# pragma map(deflateInit_,"DEIN") +# pragma map(deflateInit2_,"DEIN2") +# pragma map(deflateEnd,"DEEND") +# pragma map(inflateInit_,"ININ") +# pragma map(inflateInit2_,"ININ2") +# pragma map(inflateEnd,"INEND") +# pragma map(inflateSync,"INSY") +# pragma map(inflateSetDictionary,"INSEDI") +# pragma map(inflate_blocks,"INBL") +# pragma map(inflate_blocks_new,"INBLNE") +# pragma map(inflate_blocks_free,"INBLFR") +# pragma map(inflate_blocks_reset,"INBLRE") +# pragma map(inflate_codes_free,"INCOFR") +# pragma map(inflate_codes,"INCO") +# pragma map(inflate_fast,"INFA") +# pragma map(inflate_flush,"INFLU") +# pragma map(inflate_mask,"INMA") +# pragma map(inflate_set_dictionary,"INSEDI2") +# pragma map(inflate_copyright,"INCOPY") +# pragma map(inflate_trees_bits,"INTRBI") +# pragma map(inflate_trees_dynamic,"INTRDY") +# pragma map(inflate_trees_fixed,"INTRFI") +# pragma map(inflate_trees_free,"INTRFR") +#endif + +#endif /* _ZCONF_H */ diff --git a/3rdparty/libbcrypt-1.0/win32console/DLLs/zlib.h b/3rdparty/libbcrypt-1.0/win32console/DLLs/zlib.h new file mode 100644 index 0000000..52cb529 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/DLLs/zlib.h @@ -0,0 +1,893 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.1.4, March 11th, 2002 + + Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +*/ + +#ifndef _ZLIB_H +#define _ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.1.4" + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total nb of input bytes read so far */ + + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total nb of bytes output so far */ + + char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: ascii or binary */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + The application must update next_in and avail_in when avail_in has + dropped to zero. It must update next_out and avail_out when avail_out + has dropped to zero. The application must initialize zalloc, zfree and + opaque before calling the init function. All other fields are set by the + compression library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this + if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, + pointers returned by zalloc for objects of exactly 65536 bytes *must* + have their offset normalized to zero. The default allocation function + provided by this library ensures this (see zutil.c). To reduce memory + requirements and avoid any allocation of 64K objects, at the expense of + compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or + progress reports. After compression, total_in holds the total size of + the uncompressed data and may be saved for use in the decompressor + (particularly if the decompressor wants to decompress everything in + a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +/* Allowed flush values; see deflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative + * values are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_ASCII 1 +#define Z_UNKNOWN 2 +/* Possible values of the data_type field */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + /* basic functions */ + +ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is + not compatible with the zlib.h header file used by the application. + This check is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. + If zalloc and zfree are set to Z_NULL, deflateInit updates them to + use default allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at + all (the input data is simply copied a block at a time). + Z_DEFAULT_COMPRESSION requests a default compromise between speed and + compression (currently equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if level is not a valid compression level, + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). + msg is set to null if there is no error message. deflateInit does not + perform any compression: this will be done by deflate(). +*/ + + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce some + output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). + Some output may be provided even if flush is not set. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating avail_in or avail_out accordingly; avail_out + should never be zero before the call. The application can consume the + compressed output when it wants, for example when the output buffer is full + (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK + and with zero avail_out, it must be called again after making room in the + output buffer because there might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In particular + avail_in is zero after the call if enough output space has been provided + before the call.) Flushing may degrade compression for some compression + algorithms and so it should be used only when necessary. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + the compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there + was enough output space; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the + stream are deflateReset or deflateEnd. + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least + 0.1% larger than avail_in plus 12 bytes. If deflate does not return + Z_STREAM_END, then it must be called again as described above. + + deflate() sets strm->adler to the adler32 checksum of all input read + so far (that is, total_in bytes). + + deflate() may update data_type if it can make a good guess about + the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered + binary. This field is only for information purposes and does not affect + the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). +*/ + + +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, + msg may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the exact + value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller. msg is set to null if there is no error + message. inflateInit does not perform any decompression apart from reading + the zlib header if present: this will be done by inflate(). (So next_in and + avail_in may be modified, but next_out and avail_out are unchanged.) +*/ + + +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may some + introduce some output latency (reading input without producing any output) + except when forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing + will resume at this point for the next call of inflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there + is no more input data or no more space in the output buffer (see below + about the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating the next_* and avail_* values accordingly. + The application can consume the uncompressed output when it wants, for + example when the output buffer is full (avail_out == 0), or after each + call of inflate(). If inflate returns Z_OK and with zero avail_out, it + must be called again after making room in the output buffer because there + might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much + output as possible to the output buffer. The flushing behavior of inflate is + not specified for values of the flush parameter other than Z_SYNC_FLUSH + and Z_FINISH, but the current implementation actually flushes as much output + as possible anyway. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step + (a single call of inflate), the parameter flush should be set to + Z_FINISH. In this case all pending input is processed and all pending + output is flushed; avail_out must be large enough to hold all the + uncompressed data. (The size of the uncompressed data may have been saved + by the compressor for this purpose.) The next operation on this stream must + be inflateEnd to deallocate the decompression state. The use of Z_FINISH + is never required, but can be used to inform inflate that a faster routine + may be used for the single inflate() call. + + If a preset dictionary is needed at this point (see inflateSetDictionary + below), inflate sets strm-adler to the adler32 checksum of the + dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise + it sets strm->adler to the adler32 checksum of all output produced + so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or + an error code as described below. At the end of the stream, inflate() + checks that its computed adler32 checksum is equal to that saved by the + compressor and returns Z_STREAM_END only if the checksum is correct. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect + adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent + (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if no progress is possible or if there was not + enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR + case, the application may then call inflateSync to look for a good + compression block. +*/ + + +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +*/ + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by + the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but + is slow and reduces compression ratio; memLevel=9 uses maximum memory + for optimal speed. The default value is 8. See zconf.h for total memory + usage as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match). Filtered data consists mostly of small values with a + somewhat random distribution. In this case, the compression algorithm is + tuned to compress them better. The effect of Z_FILTERED is to force more + Huffman coding and less string matching; it is somewhat intermediate + between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects + the compression ratio but not the correctness of the compressed output even + if it is not set appropriately. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid + method). msg is set to null if there is no error message. deflateInit2 does + not perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. This function must be called + immediately after deflateInit, deflateInit2 or deflateReset, before any + call of deflate. The compressor and decompressor must use exactly the same + dictionary (see inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size in + deflate or deflate2. Thus the strings most likely to be useful should be + put at the end of the dictionary, not at the front. + + Upon return of this function, strm->adler is set to the Adler32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if the compression method is bsort). deflateSetDictionary does not + perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and + can consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. + The stream will keep the same compression level and any other attributes + that may have been set by deflateInit2. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different + strategy. If the compression level is changed, the input available so far + is compressed with the old level (and may be flushed); the new level will + take effect only at the next call of deflate(). + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to + be compressed and flushed. In particular, strm->avail_out must be non-zero. + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR + if strm->avail_out was zero. +*/ + +/* +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. If a compressed stream with a larger window size is given as + input, inflate() will return with the error code Z_DATA_ERROR instead of + trying to allocate a larger window. + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative + memLevel). msg is set to null if there is no error message. inflateInit2 + does not perform any decompression apart from reading the zlib header if + present: this will be done by inflate(). (So next_in and avail_in may be + modified, but next_out and avail_out are unchanged.) +*/ + +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate + if this call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler32 value returned by this call of + inflate. The compressor and decompressor must use exactly the same + dictionary (see deflateSetDictionary). + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a full flush point (see above the + description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR + if no more input was provided, Z_DATA_ERROR if no flush point has been found, + or Z_STREAM_ERROR if the stream structure was inconsistent. In the success + case, the application may save the current current value of total_in which + indicates where valid compressed data was found. In the error case, the + application may repeatedly call inflateSync, providing more input each time, + until success or end of the input data. +*/ + +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. + The stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + + + /* utility functions */ + +/* + The following utility functions are implemented on top of the + basic stream-oriented functions. To simplify the interface, some + default options are assumed (compression level and memory usage, + standard memory allocation functions). The source code of these + utility functions can easily be modified if you need special options. +*/ + +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be at least 0.1% larger than + sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the + compressed buffer. + This function can be used to compress a whole file at once if the + input file is mmap'ed. + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least 0.1% larger than sourceLen plus + 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer. + This function can be used to decompress a whole file at once if the + input file is mmap'ed. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted. +*/ + + +typedef voidp gzFile; + +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); +/* + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb") but can also include a compression level + ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for + Huffman only compression as in "wb1h". (See the description + of deflateInit2 for more information about the strategy parameter.) + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. + + gzopen returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). */ + +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +/* + gzdopen() associates a gzFile with the file descriptor fd. File + descriptors are obtained from calls like open, dup, creat, pipe or + fileno (in the file has been previously opened with fopen). + The mode parameter is as in gzopen. + The next call of gzclose on the returned gzFile will also close the + file descriptor fd, just like fclose(fdopen(fd), mode) closes the file + descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). + gzdopen returns NULL if there was insufficient memory to allocate + the (de)compression state. +*/ + +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +*/ + +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Reads the given number of uncompressed bytes from the compressed file. + If the input file was not in gzip format, gzread copies the given number + of bytes into the buffer. + gzread returns the number of uncompressed bytes actually read (0 for + end of file, -1 for error). */ + +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, + const voidp buf, unsigned len)); +/* + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes actually written + (0 in case of error). +*/ + +ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); +/* + Converts, formats, and writes the args to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written (0 in case of error). +*/ + +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +/* + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + gzputs returns the number of characters written, or -1 in case of error. +*/ + +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +/* + Reads bytes from the compressed file until len-1 characters are read, or + a newline character is read and transferred to buf, or an end-of-file + condition is encountered. The string is then terminated with a null + character. + gzgets returns buf, or Z_NULL in case of error. +*/ + +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +/* + Writes c, converted to an unsigned char, into the compressed file. + gzputc returns the value that was written, or -1 in case of error. +*/ + +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +/* + Reads one byte from the compressed file. gzgetc returns this byte + or -1 in case of end of file or error. +*/ + +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +/* + Flushes all pending output into the compressed file. The parameter + flush is as in the deflate() function. The return value is the zlib + error number (see function gzerror below). gzflush returns Z_OK if + the flush parameter is Z_FINISH and all output could be flushed. + gzflush should be called only when strictly necessary because it can + degrade compression. +*/ + +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, + z_off_t offset, int whence)); +/* + Sets the starting position for the next gzread or gzwrite on the + given compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +/* + Rewinds the given file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +*/ + +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); +/* + Returns the starting position for the next gzread or gzwrite on the + given compressed file. This position represents a number of bytes in the + uncompressed data stream. + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +/* + Returns 1 when EOF has previously been detected reading the given + input stream, otherwise zero. +*/ + +ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +/* + Flushes all pending output if necessary, closes the compressed file + and deallocates all the (de)compression state. The return value is the zlib + error number (see function gzerror below). +*/ + +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +/* + Returns the error message for the last error which occurred on the + given compressed file. errnum is set to zlib error number. If an + error occurred in the file system and not in the compression library, + errnum is set to Z_ERRNO and the application may consult errno + to get the exact error code. +*/ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the + compression library. +*/ + +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); + +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is NULL, this function returns + the required initial value for the checksum. + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +/* + Update a running crc with the bytes buf[0..len-1] and return the updated + crc. If buf is NULL, this function returns the required initial value + for the crc. Pre- and post-conditioning (one's complement) is performed + within this function so it shouldn't be done by the application. + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + + +#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) + struct internal_state {int dummy;}; /* hack for buggy compilers */ +#endif + +ZEXTERN const char * ZEXPORT zError OF((int err)); +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); +ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); + +#ifdef __cplusplus +} +#endif + +#endif /* _ZLIB_H */ diff --git a/3rdparty/libbcrypt-1.0/win32console/Script1.rc b/3rdparty/libbcrypt-1.0/win32console/Script1.rc new file mode 100644 index 0000000..0ad5591 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/Script1.rc @@ -0,0 +1,72 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON DISCARDABLE "icon1.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/3rdparty/libbcrypt-1.0/win32console/bcrypt.dsp b/3rdparty/libbcrypt-1.0/win32console/bcrypt.dsp new file mode 100644 index 0000000..13009ac --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/bcrypt.dsp @@ -0,0 +1,178 @@ +# Microsoft Developer Studio Project File - Name="bcrypt" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=bcrypt - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "bcrypt.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "bcrypt.mak" CFG="bcrypt - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "bcrypt - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "bcrypt - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "bcrypt - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "..\\" /I ".\DLLs" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\\" /libpath:".\DLLs" + +!ELSEIF "$(CFG)" == "bcrypt - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\\" /I ".\DLLs" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\\" /libpath:".\DLLs" + +!ENDIF + +# Begin Target + +# Name "bcrypt - Win32 Release" +# Name "bcrypt - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\blowfish.c +# End Source File +# Begin Source File + +SOURCE=..\endian.c +# End Source File +# Begin Source File + +SOURCE=.\getopt.c +# End Source File +# Begin Source File + +SOURCE=..\keys.c +# End Source File +# Begin Source File + +SOURCE=..\main.c +# End Source File +# Begin Source File + +SOURCE=..\rwfile.c +# End Source File +# Begin Source File + +SOURCE=..\wrapbf.c +# End Source File +# Begin Source File + +SOURCE=..\wrapzl.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\blowfish.h +# End Source File +# Begin Source File + +SOURCE=..\config.h +# End Source File +# Begin Source File + +SOURCE=..\defines.h +# End Source File +# Begin Source File + +SOURCE=..\functions.h +# End Source File +# Begin Source File + +SOURCE=.\getopt.h +# End Source File +# Begin Source File + +SOURCE=..\includes.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\icon1.ico +# End Source File +# Begin Source File + +SOURCE=.\Script1.rc +# End Source File +# Begin Source File + +SOURCE=.\DLLs\libz.lib +# End Source File +# End Group +# Begin Source File + +SOURCE=..\License +# End Source File +# Begin Source File + +SOURCE=..\Readme +# End Source File +# Begin Source File + +SOURCE=".\readme-win32.txt" +# End Source File +# End Target +# End Project diff --git a/3rdparty/libbcrypt-1.0/win32console/bcrypt.dsw b/3rdparty/libbcrypt-1.0/win32console/bcrypt.dsw new file mode 100644 index 0000000..ecb166f --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/bcrypt.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "bcrypt"=.\bcrypt.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/3rdparty/libbcrypt-1.0/win32console/getopt.c b/3rdparty/libbcrypt-1.0/win32console/getopt.c new file mode 100644 index 0000000..38b4b43 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/getopt.c @@ -0,0 +1,177 @@ +//GETOPT.C +/***************************************************************************** +* +* MODULE NAME : GETOPT.C +* +* COPYRIGHTS: +* This module contains code made available by IBM +* Corporation on an AS IS basis. Any one receiving the +* module is considered to be licensed under IBM copyrights +* to use the IBM-provided source code in any way he or she +* deems fit, including copying it, compiling it, modifying +* it, and redistributing it, with or without +* modifications. No license under any IBM patents or +* patent applications is to be implied from this copyright +* license. +* +* A user of the module should understand that IBM cannot +* provide technical support for the module and will not be +* responsible for any consequences of use of the program. +* * Any notices, including this one, are not to be removed +* from the module without the prior written consent of +* IBM. +* +* AUTHOR: Original author: +* G. R. Blair (BOBBLAIR at AUSVM1) +* Internet: bobblair@bobblair.austin.ibm.com +* +* Extensively revised by: +* John Q. Walker II, Ph.D. (JOHHQ at RALVM6) +* Internet: johnq@ralvm6.vnet.ibm.com +* +*****************************************************************************/ + +/****************************************************************************** + * getopt() + * + * The getopt() function is a command line parser. It returns the next + * option character in argv that matches an option character in opstring. + * + * The argv argument points to an array of argc+1 elements containing argc + * pointers to character strings followed by a null pointer. + * + * The opstring argument points to a string of option characters; if an + * option character is followed by a colon, the option is expected to have + * an argument that may or may not be separated from it by white space. + * The external variable optarg is set to point to the start of the option + * argument on return from getopt(). + * + * The getopt() function places in optind the argv index of the next argument + * to be processed. The system initializes the external variable optind to + * 1 before the first call to getopt(). + * + * When all options have been processed (that is, up to the first nonoption + * argument), getopt() returns EOF. The special option "--" may be used to + * delimit the end of the options; EOF will be returned, and "--" will be + * skipped. + * + * The getopt() function returns a question mark (?) when it encounters an + * option character not included in opstring. This error message can be + * disabled by setting opterr to zero. Otherwise, it returns the option + * character that was detected. + * + * If the special option "--" is detected, or all options have been + * processed, EOF is returned. + * + * Options are marked by either a minus sign (-) or a slash (/). + * + * No errors are defined. + *****************************************************************************/ +#include /* for EOF */ +#include /* for strchr() */ + + +/* static (global) variables that are specified as exported by getopt() */ +char *optarg = NULL; /* pointer to the start of the option argument */ +int optind = 1; /* number of the next argv[] to be evaluated */ +int opterr = 1; /* non-zero if a question mark should be returned + when a non-valid option character is detected */ + +/* handle possible future character set concerns by putting this in a macro */ +#define _next_char(string) (char)(*(string+1)) + +int getopt(int argc, char *argv[], char *opstring) +{ + static char *pIndexPosition = NULL; /* place inside current argv string */ + char *pArgString = NULL; /* where to start from next */ + char *pOptString; /* the string in our program */ + + + if (pIndexPosition != NULL) { + /* we last left off inside an argv string */ + if (*(++pIndexPosition)) { + /* there is more to come in the most recent argv */ + pArgString = pIndexPosition; + } + } + + if (pArgString == NULL) { + /* we didn't leave off in the middle of an argv string */ + if (optind >= argc) { + /* more command-line arguments than the argument count */ + pIndexPosition = NULL; /* not in the middle of anything */ + return EOF; /* used up all command-line arguments */ + } + + /*--------------------------------------------------------------------- + * If the next argv[] is not an option, there can be no more options. + *-------------------------------------------------------------------*/ + pArgString = argv[optind++]; /* set this to the next argument ptr */ + + if (('/' != *pArgString) && /* doesn't start with a slash or a dash? */ + ('-' != *pArgString)) { + --optind; /* point to current arg once we're done */ + optarg = NULL; /* no argument follows the option */ + pIndexPosition = NULL; /* not in the middle of anything */ + return EOF; /* used up all the command-line flags */ + } + + /* check for special end-of-flags markers */ + if ((strcmp(pArgString, "-") == 0) || + (strcmp(pArgString, "--") == 0)) { + optarg = NULL; /* no argument follows the option */ + pIndexPosition = NULL; /* not in the middle of anything */ + return EOF; /* encountered the special flag */ + } + + pArgString++; /* look past the / or - */ + } + + if (':' == *pArgString) { /* is it a colon? */ + /*--------------------------------------------------------------------- + * Rare case: if opterr is non-zero, return a question mark; + * otherwise, just return the colon we're on. + *-------------------------------------------------------------------*/ + return (opterr ? (int)'?' : (int)':'); + } + else if ((pOptString = strchr(opstring, *pArgString)) == 0) { + /*--------------------------------------------------------------------- + * The letter on the command-line wasn't any good. + *-------------------------------------------------------------------*/ + optarg = NULL; /* no argument follows the option */ + pIndexPosition = NULL; /* not in the middle of anything */ + return (opterr ? (int)'?' : (int)*pArgString); + } + else { + /*--------------------------------------------------------------------- + * The letter on the command-line matches one we expect to see + *-------------------------------------------------------------------*/ + if (':' == _next_char(pOptString)) { /* is the next letter a colon? */ + /* It is a colon. Look for an argument string. */ + if ('\0' != _next_char(pArgString)) { /* argument in this argv? */ + optarg = &pArgString[1]; /* Yes, it is */ + } + else { + /*------------------------------------------------------------- + * The argument string must be in the next argv. + * But, what if there is none (bad input from the user)? + * In that case, return the letter, and optarg as NULL. + *-----------------------------------------------------------*/ + if (optind < argc) + optarg = argv[optind++]; + else { + optarg = NULL; + return (opterr ? (int)'?' : (int)*pArgString); + } + } + pIndexPosition = NULL; /* not in the middle of anything */ + } + else { + /* it's not a colon, so just return the letter */ + optarg = NULL; /* no argument follows the option */ + pIndexPosition = pArgString; /* point to the letter we're on */ + } + return (int)*pArgString; /* return the letter that matched */ + } +} + diff --git a/3rdparty/libbcrypt-1.0/win32console/getopt.h b/3rdparty/libbcrypt-1.0/win32console/getopt.h new file mode 100644 index 0000000..7aa3911 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/getopt.h @@ -0,0 +1,38 @@ +/***************************************************************************** + * + * MODULE NAME : GETOPT.H + * + * COPYRIGHTS: + * This module contains code made available by IBM + * Corporation on an AS IS basis. Any one receiving the + * module is considered to be licensed under IBM copyrights + * to use the IBM-provided source code in any way he or she + * deems fit, including copying it, compiling it, modifying + * it, and redistributing it, with or without + * modifications. No license under any IBM patents or + * patent applications is to be implied from this copyright + * license. + * + * A user of the module should understand that IBM cannot + * provide technical support for the module and will not be + * responsible for any consequences of use of the program. + * + * Any notices, including this one, are not to be removed + * from the module without the prior written consent of + * IBM. + * + * AUTHOR: Original author: + * G. R. Blair (BOBBLAIR at AUSVM1) + * Internet: bobblair@bobblair.austin.ibm.com + * + * Extensively revised by: + * John Q. Walker II, Ph.D. (JOHHQ at RALVM6) + * Internet: johnq@ralvm6.vnet.ibm.com + * + *****************************************************************************/ + +extern char * optarg; +extern int optind; + +int getopt ( int argc, char **argv, char *optstring); + diff --git a/3rdparty/libbcrypt-1.0/win32console/icon1.ico b/3rdparty/libbcrypt-1.0/win32console/icon1.ico new file mode 100644 index 0000000..04375ee Binary files /dev/null and b/3rdparty/libbcrypt-1.0/win32console/icon1.ico differ diff --git a/3rdparty/libbcrypt-1.0/win32console/readme-win32.txt b/3rdparty/libbcrypt-1.0/win32console/readme-win32.txt new file mode 100644 index 0000000..2583768 --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/readme-win32.txt @@ -0,0 +1,16 @@ +To run the program, make sure the bcrypt.exe and zlib.dll files are +in the same directory. It will also work if zlib.dll is located +elsewhere, but still in the path. The win32 native version behaves +slightly differently, in that it doesn't hide the passphrase as you +type it in. Otherwise, it's functionally identical to Un*x native +code. + +ZLib for Win32 obtained from the GnuWin32 project at: +http://sourceforge.net/project/showfiles.php?group_id=23617 +Download zlib-1.1.4-bin.zip to get the .dll. + +If you plan on compiling from source, download zlib-1.1.4-bin.zip to +get the .dll, and zlib-1.1.4-lib.zip to get the include files. Place +the .dll file in the win32console directory, and everything should +work perfectly from within the Visual Studio environment. + diff --git a/3rdparty/libbcrypt-1.0/win32console/resource.h b/3rdparty/libbcrypt-1.0/win32console/resource.h new file mode 100644 index 0000000..8562bcf --- /dev/null +++ b/3rdparty/libbcrypt-1.0/win32console/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by Script1.rc +// +#define IDI_ICON1 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/3rdparty/phptest.php b/3rdparty/phptest.php new file mode 100644 index 0000000..18097f8 --- /dev/null +++ b/3rdparty/phptest.php @@ -0,0 +1,6 @@ + 10) ) ); +print password_hash('password',PASSWORD_BCRYPT) . PHP_EOL; diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..db9d6e1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,48 @@ +cmake_minimum_required(VERSION 3.0) +project(hathor) +INCLUDE(CheckIncludeFiles) +INCLUDE(CheckLibraryExists) +include(CheckFunctionExists) + + check_include_files(libintl.h HAVE_LIBINTL_H) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") + +set(Boost_USE_STATIC_LIBS OFF) +set(Boost_USE_MULTITHREADED ON) +set(Boost_USE_STATIC_RUNTIME OFF) +find_package(Boost 1.58.0 COMPONENTS system filesystem) + +if(NOT Boost_FOUND) + message( SEND_ERROR "One or more boost libraries were not found. If you have boost installed check that it is version 1.58 or above." ) +endif() +find_package(PkgConfig) +pkg_check_modules(TAGLIB23 REQUIRED taglib) +#find_package(mysqlcppconn 1.0) +#pkg_check_modules(MYSQL QUIET libmysqlcppconn-1.0) +#pkg_check_modules(MYSQL REQUIRED mysqlcppconn-1.0) +#CHECK_LIBRARY_EXISTS(pipecolors pcprintf "/usr/lib" PIPE) +find_library(MYSQLCONNECTORCPP_LIBRARY + NAMES + mysqlcppconn + mysqlcppconn-static + HINTS + "/usr/lib" + PATH_SUFFIXES + lib) + +if(NOT MYSQLCONNECTORCPP_LIBRARY) + message( SEND_ERROR "Oracle's mysqlconnector lib is required.") +else() + message(STATUS "Found libmysqlcppconn") +endif() + +set(SOURCE_FILES + mysql.cc + config.cc + common.cc + scanner.cc + 3rdparty/crypt_blowfish.c + ) + +add_executable(scanner ${SOURCE_FILES}) +TARGET_LINK_LIBRARIES(scanner "-lboost_system -lboost_filesystem -ltag -lmysqlcppconn") diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8cdb845 --- /dev/null +++ b/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a60cdb2 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +all: + g++ -o scanner mysql.cc config.cc common.cc scanner.cc -lboost_system -lboost_filesystem -ltag -lcrypt -lssl -lcrypto -std=c++11 -lmysqlcppconn + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5943049 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# hathor +Local Music API diff --git a/app/core/api/.htaccess b/app/core/api/.htaccess new file mode 100644 index 0000000..a7b90e2 --- /dev/null +++ b/app/core/api/.htaccess @@ -0,0 +1,3 @@ +RewriteEngine On +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^ index.php [QSA,L] \ No newline at end of file diff --git a/app/core/api/Hathor.php b/app/core/api/Hathor.php new file mode 100644 index 0000000..ac9852b --- /dev/null +++ b/app/core/api/Hathor.php @@ -0,0 +1,186 @@ +] + */ + public function tomb( $size ) { + if( is_numeric($size) ): + return sprintf('%.02fmb', ($size / 1024) / 1024 ); + else: + throw new \InvalidArgumentException('Must be an int in function tomb( int $size)!'); + endif; + + } + + /** + * @param $size + * @return string + */ + public function togb( $size ) { + return sprintf('%.02fgb', ( ($size / 1024) / 1024 ) / 1024 ); + } + + /** + * @param array $array + * @param bool|false $jpp + * @return string + * @throws \InvalidArgumentException + */ + public static function tojson(array $array, $jpp = false) + { + if (!is_array ($array)): + throw new \InvalidArgumentException; + elseif (is_object ($array)): + $array = (array)$array; + endif; + if($jpp): + return json_encode ($array, JSON_NUMERIC_CHECK | JSON_PRESERVE_ZERO_FRACTION | JSON_PRETTY_PRINT ); + else: + return json_encode ($array, JSON_NUMERIC_CHECK | JSON_PRESERVE_ZERO_FRACTION ); + endif; + } +} + +/** + * Class Connection + * @package Hathor + * @description + * Small class to connect to the database + */ +use \Slim\PDO\Database; +class Connection extends Database { + + private $dsn; + /** + * @param none + * @description + * Get database information from configuration + * and setup the PDO connection + * @return \Slim\PDO\Database connection + */ + public function __construct() { + global $config; + $this->dsn = sprintf('mysql:host=%s;dbname=%s;charset=utf8', $config->db['host'], $config->db['db']); + return parent::__construct($this->dsn, $config->db['user'], $config->db['pass']); + } + public function __toString() { + return $this->dsn; + } + public function __destruct() { + unset($this); + } +} + + /** + * Class Log + * @package Hathor + */ +class Log extends Hathor { + + public function write($message) { + var_dump($message); + } +} +/** + * Class DefaultHeaders * + * @package Hathor + * @description + * Middleware to set default headers that + * we want on every request. + */ +use \Slim\Middleware; +class DefaultHeaders extends Middleware +{ + + private $strln; + + public function call() + { + global $config; + $defaults = [ + 'X-Powered-By' => 'SlimPHP/2, Hathor Music Api/1.0 (gentoo)', + 'X-Hathor-Version' => '1.0/gentoo', + 'Allow' => 'GET, HEAD, OPTIONS', + 'Content-Language' => 'en', + 'Content-Type' => 'application/json; charset=utf-8', + 'Server' => 'Hathor Music Api/1.0 (gentoo)', + 'X-XSS-Prottection' => '1; mode=block', + 'ETag' => md5(time()) + ]; + $env = $this->app->environment; + $env['slim.errors'] = fopen($config->logs['error'], 'w'); + + // Loop through default headers we want set on every response and set them. + foreach($defaults as $headerKey => $headerVal): + $this->app->response->headers->set($headerKey, $headerVal); + endforeach; + // Run inner middleware and application + $this->next->call(); + // Set the Content-Length + 1 + $this->strln = strlen($this->app->response->getBody()); + // Check if it is head. If it is we don't want any content length. + $this->strln = $this->app->request->isHead() ? 0 : $this->strln; + // Set the Content-Length header + $this->app->response->headers->set('Content-Length', $this->strln); + } +} + + + + + diff --git a/app/core/api/index.php b/app/core/api/index.php new file mode 100644 index 0000000..b7e389e --- /dev/null +++ b/app/core/api/index.php @@ -0,0 +1,221 @@ +response->setBody( \Hathor\Format::tojson($ret) ); + +} + +function hathor_get_error($type = HATHOR_NO_RESULTS) { + // print_r(json_decode('{"errors":[{"code":215,"message":"Bad Authentication data."}]}')); + + $error['errors'][] = [ + 'code' => 404, + 'message' => 'No results found.' + ]; + + return \Hathor\Format::tojson($error); +} +function hathor_years_get_options() { + + $return['GET'][] = + [ + 'int' => 'year', + 'description' => 'The year of the album' + ]; + + return \Hathor\Format::tojson($return, true); +} + +$app->get('/track/play/:tid', function($tid) use ($app) { + + $track = get_track($tid); + $app->response->headers->set('Content-Type', 'audio/mpeg'); + $app->response->setBody( file_get_contents( $track['uri'] ) ); + /*$content = base64_encode( file_get_contents( $track['uri'] ) ); + if( file_exists( dirname($track['uri']) . DIRECTORY_SEPARATOR . 'album.jpg' ) ): + $albumart = base64_encode( file_get_contents( dirname($track['uri']) . DIRECTORY_SEPARATOR . 'album.jpg' ) ); + else: + $albumart = base64_encode( file_get_contents( 'http://placekitten.com/120/121' ) ); + endif; + + print sprintf('', $albumart); + print sprintf('', $content); + */ + } +); +function get_track($tid) { + global $config; + $pdo = new Hathor\Connection(); + //get_connection($config['db']); + $selectStatement = $pdo->select() + ->from('tracks') + ->where('tid','=', $tid); + $stmt = $selectStatement->execute(); + $ret = $stmt->fetch(); + close_connection($pdo); + return $ret; +} + +function hathor_get_album($aid) { + $app = \Slim\Slim::getInstance(); + global $config; + + $album = get_album($aid); + $request = $app->request; + $res = $app->response; + + $res->headers->set('Content-Type', 'application/json'); + $res->setStatus(200); + + if($request->isOptions()): + $res->headers->set('Allow', 'GET, OPTIONS'); + $res->setBody("200 OK\nAllow: GET,OPTIONS\n"); + else: + $json['status'] = 200; + + foreach($config->defaults['cover_files'] as $cover): + if( file_exists( dirname($album[0]['uri']) . DIRECTORY_SEPARATOR . $cover ) ): + $albumcover = dirname($album[0]['uri']) . DIRECTORY_SEPARATOR . $cover; + break; + else: + continue; + endif; + endforeach; + if(isset($albumcover)): + $meta = getimagesize($albumcover, $info); + $meta = array( + 'width' => $meta[0], + 'height'=> $meta[1], + 'bits' => isset($meta['bits']) ? $meta['bits'] : null, + 'mime' => isset($meta['mime']) ? $meta['mime'] : null, + 'extra' => empty($info) ? null : $info + ); + $cover = array( + 'base64' => base64_encode( file_get_contents( $albumcover ) ), + 'uri' => $albumcover, + 'size' => \Hathor\Format::tokb( filesize($albumcover) ), + 'meta' => $meta + ); + + else: + $meta = getimagesize(__DIR__ . DIRECTORY_SEPARATOR . '../images/album.jpg', $info); + $meta = array( + 'width' => $meta[0], + 'height'=> $meta[1], + 'bits' => isset($meta['bits']) ? $meta['bits'] : null, + 'mime' => isset($meta['mime']) ? $meta['mime'] : null, + 'extra' => empty($info) ? null : $info + ); + $cover = array( + 'base64' => base64_encode( file_get_contents( __DIR__ . DIRECTORY_SEPARATOR . '../images/album.jpg' ) ), + 'uri' => $request->getResourceUri(), + 'size' => filesize(__DIR__ . DIRECTORY_SEPARATOR . '../images/album.jpg'), + 'meta' => $meta + ); + endif; + + foreach($album as $track): + $tr[ $track['track'] ] = array( + 'tid' => $track['tid'], + 'title' => $track['title'], + 'genre' => $track['genre'], + 'track' => $track['track'], + 'length' => $track['length'], + 'playtime' => sprintf('%d:%02d',$track['minutes'], $track['seconds']), + 'size' => sprintf('%.02f MB', ( filesize($track['uri']) / 1024 ) / 1024 ) + ); + endforeach; + + + $json['response'] = array( + 'artist' => $album[0]['artist'], + 'arid' => $album[0]['arid'], + 'album' => $album[0]['album'], + 'aid' => $album[0]['aid'], + 'cover' => $cover, + 'total' => count($tr), + 'tracks' => $tr + ); + + $res->setBody( json_encode($json) ); + endif; + + + } + +function get_album($aid) { + global $config; + $pdo = new Hathor\Connection();//get_connection($config['db']); + $selectStatement = $pdo->select( + array('tid','title','track','arid','artist','aid','album','year','genre','label','minutes','seconds','length','uri') + ) + ->distinct() + ->groupBy('tid') + ->orderBy('track', 'ASC') + ->from('tracks') + ->where('aid','=',$aid); + $stmt = $selectStatement->execute(); + $ret = $stmt->fetchAll(); + close_connection($pdo); + return $ret; + +} + + + +$app->get('/artist/:arid', function ($arid) use($app) { + $app->response->headers()->set('Content-Type','application/json'); + $app->response->setBody(json_encode(get_artist($arid))); + })->conditions( array('id' => '[\w\d]+') ); + + + +function get_artist($arid) { + global $config; + $pdo = new Hathor\Connection(); + $selectStatement = $pdo->select( + array('arid','artist') + ) + //->distinct() + ->groupby('arid') + ->from('artists') + ->where('arid','=',$arid); + $stmt = $selectStatement->execute(); + $ret = $stmt->fetchAll(); + close_connection($pdo); + return $ret; + +} + +function get_artists() { + global $config; + $test = new \Hathor\Connection(); + $pdo = new Hathor\Connection(); + $selectStatement = $pdo->select(array('name','arid')) + ->orderBy('name') + ->from('artists'); + $stmt = $selectStatement->execute(); + $ret = $stmt->fetchAll(); + close_connection($pdo); + return $ret; +} + +function get_years() { + +} + +function close_connection(\Slim\PDO\Database $db) { + $db = null; + return true; +} +$app->run(); + + + diff --git a/app/core/bootstrap.php b/app/core/bootstrap.php new file mode 100644 index 0000000..48a8a56 --- /dev/null +++ b/app/core/bootstrap.php @@ -0,0 +1,30 @@ + true, + 'mode' => 'development', + 'log.writer' => new Hathor\Log, + 'log.enabled' => true, + 'log.level' => \Slim\Log::DEBUG, +)); +$app->add(new \Hathor\DefaultHeaders()); +require __DIR__ . '/routes.php'; +$app->setName('hwt-thr'); +$app->container->singleton('format', function () { + return new \Hathor\Format(); +}); + + + diff --git a/app/core/config.php b/app/core/config.php new file mode 100644 index 0000000..552c866 --- /dev/null +++ b/app/core/config.php @@ -0,0 +1,52 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * + **/ + +require_once( __DIR__ . DIRECTORY_SEPARATOR . basename('bootstrap.php', '.php') . '.php'); + +if( isset( $_SERVER['HTTP_REFERER'] ) ): + header("Location: /", 401); +endif; + +$config = new stdClass(); + +$config->db = array( + 'host' => 'localhost', + 'db' => 'hathor_music', + 'port' => 3306, + 'user' => 'root', + 'pass' => '123' +); + +$config->defaults['cover_files'] = array( + 'folder.jpg', + 'folder.jpeg', + 'artist.jpg', + 'artist.jpeg', + 'album.jpg', + 'album.jpeg' +); +$config->logs = [ + 'error' => '/home/eric/code/hathor/app/hathor.err', + 'access' => '/home/eric/code/hathor/app/hathor.log' +]; diff --git a/app/core/images/album.jpg b/app/core/images/album.jpg new file mode 100644 index 0000000..6155353 Binary files /dev/null and b/app/core/images/album.jpg differ diff --git a/app/core/images/album.png b/app/core/images/album.png new file mode 100644 index 0000000..525e4b9 Binary files /dev/null and b/app/core/images/album.png differ diff --git a/app/core/newhathor.sql b/app/core/newhathor.sql new file mode 100644 index 0000000..cf46b60 --- /dev/null +++ b/app/core/newhathor.sql @@ -0,0 +1,74 @@ +-- MySQL dump 10.13 Distrib 5.6.26, for Linux (x86_64) +-- +-- Host: localhost Database: hathor +-- ------------------------------------------------------ +-- Server version 5.6.26-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Current Database: `hathor` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `hathor` /*!40100 DEFAULT CHARACTER SET utf8 */; + +USE `hathor`; + +-- +-- Table structure for table `tracks` +-- + +DROP TABLE IF EXISTS `tracks`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `tracks` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id of the song in the database', + `tid` varchar(64) NOT NULL COMMENT 'song id md5 hash', + `uri` varchar(1000) NOT NULL COMMENT 'full path of file', + `arid` varchar(64) NOT NULL COMMENT 'corresponding artist id from artist table in md5 hash', + `artist` varchar(255) NOT NULL COMMENT 'artist name', + `aid` varchar(64) NOT NULL COMMENT 'corresponding album id from album table in md5 hash', + `album` varchar(255) NOT NULL COMMENT 'album title', + `title` varchar(255) NOT NULL COMMENT 'title of song', + `track` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT 'track number of song', + `genre` varchar(45) DEFAULT NULL COMMENT 'genre of song', + `year` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'year of song', + `label` varchar(255) DEFAULT NULL COMMENT 'music label of song e.g. Columbia Records', + `lyrics` blob COMMENT 'lyrics if any', + `bitrate` mediumint(6) unsigned DEFAULT '0' COMMENT 'bitrate of song', + `sample` mediumint(6) unsigned DEFAULT '0' COMMENT 'sample rate of song', + `channels` smallint(2) unsigned DEFAULT '0' COMMENT 'channels of song i.e stereo = 2, mono = 1', + `length` int(10) unsigned DEFAULT '0' COMMENT 'length of song', + `minutes` tinyint(4) unsigned DEFAULT '0' COMMENT 'total length of song in minutes and seconds', + `seconds` tinyint(4) unsigned DEFAULT '0' COMMENT 'seconds of song', + `pls` blob COMMENT 'playlists this song is associated with', + `ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'timestamp of last update of song', + PRIMARY KEY (`id`), + UNIQUE KEY `tid_UNIQUE` (`tid`), + KEY `tid_idx` (`tid`), + KEY `uri_idx` (`uri`(255)), + KEY `arid_idx` (`arid`), + KEY `aid_idx` (`aid`), + KEY `track_idx` (`track`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2015-08-17 7:55:50 diff --git a/app/core/routes.php b/app/core/routes.php new file mode 100644 index 0000000..b5c3e80 --- /dev/null +++ b/app/core/routes.php @@ -0,0 +1,64 @@ +map('/', 'hathor_home')->via('GET','HEAD','OPTIONS'); + +//$app->get('/artists', 'hathor_get_artists')->via('GET', 'HEAD', 'OPTIONS'); +//$app->get('/artist/:arid', 'hathor_get_artist')->via('GET', 'HEAD', 'OPTIONS'); + +//$app->get('/albums', 'hathor_get_albums')->via('GET', 'HEAD', 'OPTIONS'); +$app->map('/album/:aid', 'hathor_get_album')->conditions( array('id' => '[\w\d]+') )->via('GET', 'HEAD', 'OPTIONS'); +$app->map('/album/cover/:cid', 'hathor_get_cover')->via('GET','HEAD','OPTIONS'); + + + +function hathor_get_cover() { + return true; +} +/** + * /artists + * /artists/{arid} + * /artists/{arid}/albums + * /artists/{arid}/albums/{aid} + * /artists/{arid}/albums/{aid}/tracks + * /artists/{arid}/albums/{arid}/tracks/{tid} + * /artists/{arid}/albums/{arid}/tracks/{tid}/play + * /artists/{arid}/albums/{arid}/tracks/{tid}/download + */ + +/** + * /albums + * /albums/{aid} + * /albums/{aid}/tracks + * /albums/{aid}/tracks/{tid} + * /albums/{aid}/tracks/{tid}/play + * /albums/{aid}/tracks/{tid}/download + */ + +/** + * /tracks + * /tracks/{tid} + * /tracks/{tid}/play + * /tracks/{tid}/download + */ + +/** + * /years + * /years/{year} + */ + +/** + * /users + * /users/{uid} + * /users/{uid}/playlists + * /users/{uid}/playlists/{plid} + */ + +/** + * /playlists + * /playlists/{plid} + */ \ No newline at end of file diff --git a/app/exception.php b/app/exception.php new file mode 100644 index 0000000..27df9db --- /dev/null +++ b/app/exception.php @@ -0,0 +1,10 @@ +setOption(array('encoding' => 'UTF-8')); +$file = $id3->analyze('/home/eric/code/hathor/tests/Bob Dylan.Bringing It All Back Home.01.Subterranean Homesick Blues.mp3'); +echo '
'. print_r($file, true) .'
'; diff --git a/app/index.html b/app/index.html new file mode 100644 index 0000000..e69de29 diff --git a/bcrypt.cc b/bcrypt.cc new file mode 100644 index 0000000..4a04d7d --- /dev/null +++ b/bcrypt.cc @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include +#define SIZE 64 + +int main() +{ + unsigned char* in = (unsigned char *)"TestData"; + unsigned char* out = (unsigned char*) calloc(SIZE+1, sizeof(char)); + unsigned char* out2 = (unsigned char*) calloc(SIZE+1, sizeof(char)); + //pData = (int*) calloc (i,sizeof(int)); + BF_KEY *key = (BF_KEY*) calloc(1, sizeof(BF_KEY)); + std::string result; + /* set up a test key */ + BF_set_key(key, SIZE, (const unsigned char*)"TestKey!" ); + + /* test out encryption */ + char buf[sizeof(BF_KEY)]; + BF_ecb_encrypt(in, out, key, BF_ENCRYPT); + + for(int i=0;i +#include +#include +#include +#include + +// Include boost +#include "boost/filesystem.hpp" +#include "boost/filesystem/operations.hpp" +#include "boost/filesystem/path.hpp" +#include "boost/progress.hpp" +#include "boost/lexical_cast.hpp" + +int getch(); +std::string getPass( const char * prompt, char h_ch); +inline bool is_empty_string(const std::string s); +bool is_hidden(const boost::filesystem::path &p); +void toLower( std::string &str ); + +#endif \ No newline at end of file diff --git a/components/jplayer/dist/jplayer/jquery.jplayer.js b/components/jplayer/dist/jplayer/jquery.jplayer.js new file mode 100644 index 0000000..842f31b --- /dev/null +++ b/components/jplayer/dist/jplayer/jquery.jplayer.js @@ -0,0 +1,3506 @@ +/* + * jPlayer Plugin for jQuery JavaScript Library + * http://www.jplayer.org + * + * Copyright (c) 2009 - 2014 Happyworm Ltd + * Licensed under the MIT license. + * http://opensource.org/licenses/MIT + * + * Author: Mark J Panaghiston + * Version: 2.9.2 + * Date: 14th December 2014 + */ + +/* Support for Zepto 1.0 compiled with optional data module. + * For AMD or NODE/CommonJS support, you will need to manually switch the related 2 lines in the code below. + * Search terms: "jQuery Switch" and "Zepto Switch" + */ + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); // jQuery Switch + // define(['zepto'], factory); // Zepto Switch + } else if (typeof exports === 'object') { + // Node/CommonJS + factory(require('jquery')); // jQuery Switch + //factory(require('zepto')); // Zepto Switch + } else { + // Browser globals + if(root.jQuery) { // Use jQuery if available + factory(root.jQuery); + } else { // Otherwise, use Zepto + factory(root.Zepto); + } + } +}(this, function ($, undefined) { + + // Adapted from jquery.ui.widget.js (1.8.7): $.widget.bridge - Tweaked $.data(this,XYZ) to $(this).data(XYZ) for Zepto + $.fn.jPlayer = function( options ) { + var name = "jPlayer"; + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.charAt( 0 ) === "_" ) { + return returnValue; + } + + if ( isMethodCall ) { + this.each(function() { + var instance = $(this).data( name ), + methodValue = instance && $.isFunction( instance[options] ) ? + instance[ options ].apply( instance, args ) : + instance; + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $(this).data( name ); + if ( instance ) { + // instance.option( options || {} )._init(); // Orig jquery.ui.widget.js code: Not recommend for jPlayer. ie., Applying new options to an existing instance (via the jPlayer constructor) and performing the _init(). The _init() is what concerns me. It would leave a lot of event handlers acting on jPlayer instance and the interface. + instance.option( options || {} ); // The new constructor only changes the options. Changing options only has basic support atm. + } else { + $(this).data( name, new $.jPlayer( options, this ) ); + } + }); + } + + return returnValue; + }; + + $.jPlayer = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this.element = $(element); + this.options = $.extend(true, {}, + this.options, + options + ); + var self = this; + this.element.bind( "remove.jPlayer", function() { + self.destroy(); + }); + this._init(); + } + }; + // End of: (Adapted from jquery.ui.widget.js (1.8.7)) + + // Zepto is missing one of the animation methods. + if(typeof $.fn.stop !== 'function') { + $.fn.stop = function() {}; + } + + // Emulated HTML5 methods and properties + $.jPlayer.emulateMethods = "load play pause"; + $.jPlayer.emulateStatus = "src readyState networkState currentTime duration paused ended playbackRate"; + $.jPlayer.emulateOptions = "muted volume"; + + // Reserved event names generated by jPlayer that are not part of the HTML5 Media element spec + $.jPlayer.reservedEvent = "ready flashreset resize repeat error warning"; + + // Events generated by jPlayer + $.jPlayer.event = {}; + $.each( + [ + 'ready', + 'setmedia', // Fires when the media is set + 'flashreset', // Similar to the ready event if the Flash solution is set to display:none and then shown again or if it's reloaded for another reason by the browser. For example, using CSS position:fixed on Firefox for the full screen feature. + 'resize', // Occurs when the size changes through a full/restore screen operation or if the size/sizeFull options are changed. + 'repeat', // Occurs when the repeat status changes. Usually through clicks on the repeat button of the interface. + 'click', // Occurs when the user clicks on one of the following: poster image, html video, flash video. + 'error', // Event error code in event.jPlayer.error.type. See $.jPlayer.error + 'warning', // Event warning code in event.jPlayer.warning.type. See $.jPlayer.warning + + // Other events match HTML5 spec. + 'loadstart', + 'progress', + 'suspend', + 'abort', + 'emptied', + 'stalled', + 'play', + 'pause', + 'loadedmetadata', + 'loadeddata', + 'waiting', + 'playing', + 'canplay', + 'canplaythrough', + 'seeking', + 'seeked', + 'timeupdate', + 'ended', + 'ratechange', + 'durationchange', + 'volumechange' + ], + function() { + $.jPlayer.event[ this ] = 'jPlayer_' + this; + } + ); + + $.jPlayer.htmlEvent = [ // These HTML events are bubbled through to the jPlayer event, without any internal action. + "loadstart", + // "progress", // jPlayer uses internally before bubbling. + // "suspend", // jPlayer uses internally before bubbling. + "abort", + // "error", // jPlayer uses internally before bubbling. + "emptied", + "stalled", + // "play", // jPlayer uses internally before bubbling. + // "pause", // jPlayer uses internally before bubbling. + "loadedmetadata", + // "loadeddata", // jPlayer uses internally before bubbling. + // "waiting", // jPlayer uses internally before bubbling. + // "playing", // jPlayer uses internally before bubbling. + "canplay", + "canplaythrough" + // "seeking", // jPlayer uses internally before bubbling. + // "seeked", // jPlayer uses internally before bubbling. + // "timeupdate", // jPlayer uses internally before bubbling. + // "ended", // jPlayer uses internally before bubbling. + // "ratechange" // jPlayer uses internally before bubbling. + // "durationchange" // jPlayer uses internally before bubbling. + // "volumechange" // jPlayer uses internally before bubbling. + ]; + + $.jPlayer.pause = function() { + $.jPlayer.prototype.destroyRemoved(); + $.each($.jPlayer.prototype.instances, function(i, element) { + if(element.data("jPlayer").status.srcSet) { // Check that media is set otherwise would cause error event. + element.jPlayer("pause"); + } + }); + }; + + // Default for jPlayer option.timeFormat + $.jPlayer.timeFormat = { + showHour: false, + showMin: true, + showSec: true, + padHour: false, + padMin: true, + padSec: true, + sepHour: ":", + sepMin: ":", + sepSec: "" + }; + var ConvertTime = function() { + this.init(); + }; + ConvertTime.prototype = { + init: function() { + this.options = { + timeFormat: $.jPlayer.timeFormat + }; + }, + time: function(s) { // function used on jPlayer.prototype._convertTime to enable per instance options. + s = (s && typeof s === 'number') ? s : 0; + + var myTime = new Date(s * 1000), + hour = myTime.getUTCHours(), + min = this.options.timeFormat.showHour ? myTime.getUTCMinutes() : myTime.getUTCMinutes() + hour * 60, + sec = this.options.timeFormat.showMin ? myTime.getUTCSeconds() : myTime.getUTCSeconds() + min * 60, + strHour = (this.options.timeFormat.padHour && hour < 10) ? "0" + hour : hour, + strMin = (this.options.timeFormat.padMin && min < 10) ? "0" + min : min, + strSec = (this.options.timeFormat.padSec && sec < 10) ? "0" + sec : sec, + strTime = ""; + + strTime += this.options.timeFormat.showHour ? strHour + this.options.timeFormat.sepHour : ""; + strTime += this.options.timeFormat.showMin ? strMin + this.options.timeFormat.sepMin : ""; + strTime += this.options.timeFormat.showSec ? strSec + this.options.timeFormat.sepSec : ""; + + return strTime; + } + }; + var myConvertTime = new ConvertTime(); + $.jPlayer.convertTime = function(s) { + return myConvertTime.time(s); + }; + + // Adapting jQuery 1.4.4 code for jQuery.browser. Required since jQuery 1.3.2 does not detect Chrome as webkit. + $.jPlayer.uaBrowser = function( userAgent ) { + var ua = userAgent.toLowerCase(); + + // Useragent RegExp + var rwebkit = /(webkit)[ \/]([\w.]+)/; + var ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/; + var rmsie = /(msie) ([\w.]+)/; + var rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/; + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }; + + // Platform sniffer for detecting mobile devices + $.jPlayer.uaPlatform = function( userAgent ) { + var ua = userAgent.toLowerCase(); + + // Useragent RegExp + var rplatform = /(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/; + var rtablet = /(ipad|playbook)/; + var randroid = /(android)/; + var rmobile = /(mobile)/; + + var platform = rplatform.exec( ua ) || []; + var tablet = rtablet.exec( ua ) || + !rmobile.exec( ua ) && randroid.exec( ua ) || + []; + + if(platform[1]) { + platform[1] = platform[1].replace(/\s/g, "_"); // Change whitespace to underscore. Enables dot notation. + } + + return { platform: platform[1] || "", tablet: tablet[1] || "" }; + }; + + $.jPlayer.browser = { + }; + $.jPlayer.platform = { + }; + + var browserMatch = $.jPlayer.uaBrowser(navigator.userAgent); + if ( browserMatch.browser ) { + $.jPlayer.browser[ browserMatch.browser ] = true; + $.jPlayer.browser.version = browserMatch.version; + } + var platformMatch = $.jPlayer.uaPlatform(navigator.userAgent); + if ( platformMatch.platform ) { + $.jPlayer.platform[ platformMatch.platform ] = true; + $.jPlayer.platform.mobile = !platformMatch.tablet; + $.jPlayer.platform.tablet = !!platformMatch.tablet; + } + + // Internet Explorer (IE) Browser Document Mode Sniffer. Based on code at: + // http://msdn.microsoft.com/en-us/library/cc288325%28v=vs.85%29.aspx#GetMode + $.jPlayer.getDocMode = function() { + var docMode; + if ($.jPlayer.browser.msie) { + if (document.documentMode) { // IE8 or later + docMode = document.documentMode; + } else { // IE 5-7 + docMode = 5; // Assume quirks mode unless proven otherwise + if (document.compatMode) { + if (document.compatMode === "CSS1Compat") { + docMode = 7; // standards mode + } + } + } + } + return docMode; + }; + $.jPlayer.browser.documentMode = $.jPlayer.getDocMode(); + + $.jPlayer.nativeFeatures = { + init: function() { + + /* Fullscreen function naming influenced by W3C naming. + * No support for: Mozilla Proposal: https://wiki.mozilla.org/Gecko:FullScreenAPI + */ + + var d = document, + v = d.createElement('video'), + spec = { + // http://www.w3.org/TR/fullscreen/ + w3c: [ + 'fullscreenEnabled', + 'fullscreenElement', + 'requestFullscreen', + 'exitFullscreen', + 'fullscreenchange', + 'fullscreenerror' + ], + // https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode + moz: [ + 'mozFullScreenEnabled', + 'mozFullScreenElement', + 'mozRequestFullScreen', + 'mozCancelFullScreen', + 'mozfullscreenchange', + 'mozfullscreenerror' + ], + // http://developer.apple.com/library/safari/#documentation/WebKit/Reference/ElementClassRef/Element/Element.html + // http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html + webkit: [ + '', + 'webkitCurrentFullScreenElement', + 'webkitRequestFullScreen', + 'webkitCancelFullScreen', + 'webkitfullscreenchange', + '' + ], + // http://developer.apple.com/library/safari/#documentation/AudioVideo/Reference/HTMLVideoElementClassReference/HTMLVideoElement/HTMLVideoElement.html + // https://developer.apple.com/library/safari/samplecode/HTML5VideoEventFlow/Listings/events_js.html#//apple_ref/doc/uid/DTS40010085-events_js-DontLinkElementID_5 + // Events: 'webkitbeginfullscreen' and 'webkitendfullscreen' + webkitVideo: [ + 'webkitSupportsFullscreen', + 'webkitDisplayingFullscreen', + 'webkitEnterFullscreen', + 'webkitExitFullscreen', + '', + '' + ], + ms: [ + '', + 'msFullscreenElement', + 'msRequestFullscreen', + 'msExitFullscreen', + 'MSFullscreenChange', + 'MSFullscreenError' + ] + }, + specOrder = [ + 'w3c', + 'moz', + 'webkit', + 'webkitVideo', + 'ms' + ], + fs, i, il; + + this.fullscreen = fs = { + support: { + w3c: !!d[spec.w3c[0]], + moz: !!d[spec.moz[0]], + webkit: typeof d[spec.webkit[3]] === 'function', + webkitVideo: typeof v[spec.webkitVideo[2]] === 'function', + ms: typeof v[spec.ms[2]] === 'function' + }, + used: {} + }; + + // Store the name of the spec being used and as a handy boolean. + for(i = 0, il = specOrder.length; i < il; i++) { + var n = specOrder[i]; + if(fs.support[n]) { + fs.spec = n; + fs.used[n] = true; + break; + } + } + + if(fs.spec) { + var s = spec[fs.spec]; + fs.api = { + fullscreenEnabled: true, + fullscreenElement: function(elem) { + elem = elem ? elem : d; // Video element required for webkitVideo + return elem[s[1]]; + }, + requestFullscreen: function(elem) { + return elem[s[2]](); // Chrome and Opera want parameter (Element.ALLOW_KEYBOARD_INPUT) but Safari fails if flag used. + }, + exitFullscreen: function(elem) { + elem = elem ? elem : d; // Video element required for webkitVideo + return elem[s[3]](); + } + }; + fs.event = { + fullscreenchange: s[4], + fullscreenerror: s[5] + }; + } else { + fs.api = { + fullscreenEnabled: false, + fullscreenElement: function() { + return null; + }, + requestFullscreen: function() {}, + exitFullscreen: function() {} + }; + fs.event = {}; + } + } + }; + $.jPlayer.nativeFeatures.init(); + + // The keyboard control system. + + // The current jPlayer instance in focus. + $.jPlayer.focus = null; + + // The list of element node names to ignore with key controls. + $.jPlayer.keyIgnoreElementNames = "A INPUT TEXTAREA SELECT BUTTON"; + + // The function that deals with key presses. + var keyBindings = function(event) { + var f = $.jPlayer.focus, + ignoreKey; + + // A jPlayer instance must be in focus. ie., keyEnabled and the last one played. + if(f) { + // What generated the key press? + $.each( $.jPlayer.keyIgnoreElementNames.split(/\s+/g), function(i, name) { + // The strings should already be uppercase. + if(event.target.nodeName.toUpperCase() === name.toUpperCase()) { + ignoreKey = true; + return false; // exit each. + } + }); + if(!ignoreKey) { + // See if the key pressed matches any of the bindings. + $.each(f.options.keyBindings, function(action, binding) { + // The binding could be a null when the default has been disabled. ie., 1st clause in if() + if( + (binding && $.isFunction(binding.fn)) && + ((typeof binding.key === 'number' && event.which === binding.key) || + (typeof binding.key === 'string' && event.key === binding.key)) + ) { + event.preventDefault(); // Key being used by jPlayer, so prevent default operation. + binding.fn(f); + return false; // exit each. + } + }); + } + } + }; + + $.jPlayer.keys = function(en) { + var event = "keydown.jPlayer"; + // Remove any binding, just in case enabled more than once. + $(document.documentElement).unbind(event); + if(en) { + $(document.documentElement).bind(event, keyBindings); + } + }; + + // Enable the global key control handler ready for any jPlayer instance with the keyEnabled option enabled. + $.jPlayer.keys(true); + + $.jPlayer.prototype = { + count: 0, // Static Variable: Change it via prototype. + version: { // Static Object + script: "2.9.2", + needFlash: "2.9.0", + flash: "unknown" + }, + options: { // Instanced in $.jPlayer() constructor + swfPath: "js", // Path to jquery.jplayer.swf. Can be relative, absolute or server root relative. + solution: "html, flash", // Valid solutions: html, flash, aurora. Order defines priority. 1st is highest, + supplied: "mp3", // Defines which formats jPlayer will try and support and the priority by the order. 1st is highest, + auroraFormats: "wav", // List the aurora.js codecs being loaded externally. Its core supports "wav". Specify format in jPlayer context. EG., The aac.js codec gives the "m4a" format. + preload: 'metadata', // HTML5 Spec values: none, metadata, auto. + volume: 0.8, // The volume. Number 0 to 1. + muted: false, + remainingDuration: false, // When true, the remaining time is shown in the duration GUI element. + toggleDuration: false, // When true, clicks on the duration toggle between the duration and remaining display. + captureDuration: true, // When true, clicks on the duration are captured and no longer propagate up the DOM. + playbackRate: 1, + defaultPlaybackRate: 1, + minPlaybackRate: 0.5, + maxPlaybackRate: 4, + wmode: "opaque", // Valid wmode: window, transparent, opaque, direct, gpu. + backgroundColor: "#000000", // To define the jPlayer div and Flash background color. + cssSelectorAncestor: "#jp_container_1", + cssSelector: { // * denotes properties that should only be required when video media type required. _cssSelector() would require changes to enable splitting these into Audio and Video defaults. + videoPlay: ".jp-video-play", // * + play: ".jp-play", + pause: ".jp-pause", + stop: ".jp-stop", + seekBar: ".jp-seek-bar", + playBar: ".jp-play-bar", + mute: ".jp-mute", + unmute: ".jp-unmute", + volumeBar: ".jp-volume-bar", + volumeBarValue: ".jp-volume-bar-value", + volumeMax: ".jp-volume-max", + playbackRateBar: ".jp-playback-rate-bar", + playbackRateBarValue: ".jp-playback-rate-bar-value", + currentTime: ".jp-current-time", + duration: ".jp-duration", + title: ".jp-title", + fullScreen: ".jp-full-screen", // * + restoreScreen: ".jp-restore-screen", // * + repeat: ".jp-repeat", + repeatOff: ".jp-repeat-off", + gui: ".jp-gui", // The interface used with autohide feature. + noSolution: ".jp-no-solution" // For error feedback when jPlayer cannot find a solution. + }, + stateClass: { // Classes added to the cssSelectorAncestor to indicate the state. + playing: "jp-state-playing", + seeking: "jp-state-seeking", + muted: "jp-state-muted", + looped: "jp-state-looped", + fullScreen: "jp-state-full-screen", + noVolume: "jp-state-no-volume" + }, + useStateClassSkin: false, // A state class skin relies on the state classes to change the visual appearance. The single control toggles the effect, for example: play then pause, mute then unmute. + autoBlur: true, // GUI control handlers will drop focus after clicks. + smoothPlayBar: false, // Smooths the play bar transitions, which affects clicks and short media with big changes per second. + fullScreen: false, // Native Full Screen + fullWindow: false, + autohide: { + restored: false, // Controls the interface autohide feature. + full: true, // Controls the interface autohide feature. + fadeIn: 200, // Milliseconds. The period of the fadeIn anim. + fadeOut: 600, // Milliseconds. The period of the fadeOut anim. + hold: 1000 // Milliseconds. The period of the pause before autohide beings. + }, + loop: false, + repeat: function(event) { // The default jPlayer repeat event handler + if(event.jPlayer.options.loop) { + $(this).unbind(".jPlayerRepeat").bind($.jPlayer.event.ended + ".jPlayer.jPlayerRepeat", function() { + $(this).jPlayer("play"); + }); + } else { + $(this).unbind(".jPlayerRepeat"); + } + }, + nativeVideoControls: { + // Works well on standard browsers. + // Phone and tablet browsers can have problems with the controls disappearing. + }, + noFullWindow: { + msie: /msie [0-6]\./, + ipad: /ipad.*?os [0-4]\./, + iphone: /iphone/, + ipod: /ipod/, + android_pad: /android [0-3]\.(?!.*?mobile)/, + android_phone: /(?=.*android)(?!.*chrome)(?=.*mobile)/, + blackberry: /blackberry/, + windows_ce: /windows ce/, + iemobile: /iemobile/, + webos: /webos/ + }, + noVolume: { + ipad: /ipad/, + iphone: /iphone/, + ipod: /ipod/, + android_pad: /android(?!.*?mobile)/, + android_phone: /android.*?mobile/, + blackberry: /blackberry/, + windows_ce: /windows ce/, + iemobile: /iemobile/, + webos: /webos/, + playbook: /playbook/ + }, + timeFormat: { + // Specific time format for this instance. The supported options are defined in $.jPlayer.timeFormat + // For the undefined options we use the default from $.jPlayer.timeFormat + }, + keyEnabled: false, // Enables keyboard controls. + audioFullScreen: false, // Enables keyboard controls to enter full screen with audio media. + keyBindings: { // The key control object, defining the key codes and the functions to execute. + // The parameter, f = $.jPlayer.focus, will be checked truethy before attempting to call any of these functions. + // Properties may be added to this object, in key/fn pairs, to enable other key controls. EG, for the playlist add-on. + play: { + key: 80, // p + fn: function(f) { + if(f.status.paused) { + f.play(); + } else { + f.pause(); + } + } + }, + fullScreen: { + key: 70, // f + fn: function(f) { + if(f.status.video || f.options.audioFullScreen) { + f._setOption("fullScreen", !f.options.fullScreen); + } + } + }, + muted: { + key: 77, // m + fn: function(f) { + f._muted(!f.options.muted); + } + }, + volumeUp: { + key: 190, // . + fn: function(f) { + f.volume(f.options.volume + 0.1); + } + }, + volumeDown: { + key: 188, // , + fn: function(f) { + f.volume(f.options.volume - 0.1); + } + }, + loop: { + key: 76, // l + fn: function(f) { + f._loop(!f.options.loop); + } + } + }, + verticalVolume: false, // Calculate volume from the bottom of the volume bar. Default is from the left. Also volume affects either width or height. + verticalPlaybackRate: false, + globalVolume: false, // Set to make volume and muted changes affect all jPlayer instances with this option enabled + idPrefix: "jp", // Prefix for the ids of html elements created by jPlayer. For flash, this must not include characters: . - + * / \ + noConflict: "jQuery", + emulateHtml: false, // Emulates the HTML5 Media element on the jPlayer element. + consoleAlerts: true, // Alerts are sent to the console.log() instead of alert(). + errorAlerts: false, + warningAlerts: false + }, + optionsAudio: { + size: { + width: "0px", + height: "0px", + cssClass: "" + }, + sizeFull: { + width: "0px", + height: "0px", + cssClass: "" + } + }, + optionsVideo: { + size: { + width: "480px", + height: "270px", + cssClass: "jp-video-270p" + }, + sizeFull: { + width: "100%", + height: "100%", + cssClass: "jp-video-full" + } + }, + instances: {}, // Static Object + status: { // Instanced in _init() + src: "", + media: {}, + paused: true, + format: {}, + formatType: "", + waitForPlay: true, // Same as waitForLoad except in case where preloading. + waitForLoad: true, + srcSet: false, + video: false, // True if playing a video + seekPercent: 0, + currentPercentRelative: 0, + currentPercentAbsolute: 0, + currentTime: 0, + duration: 0, + remaining: 0, + videoWidth: 0, // Intrinsic width of the video in pixels. + videoHeight: 0, // Intrinsic height of the video in pixels. + readyState: 0, + networkState: 0, + playbackRate: 1, // Warning - Now both an option and a status property + ended: 0 + +/* Persistant status properties created dynamically at _init(): + width + height + cssClass + nativeVideoControls + noFullWindow + noVolume + playbackRateEnabled // Warning - Technically, we can have both Flash and HTML, so this might not be correct if the Flash is active. That is a niche case. +*/ + }, + + internal: { // Instanced in _init() + ready: false + // instance: undefined + // domNode: undefined + // htmlDlyCmdId: undefined + // autohideId: undefined + // mouse: undefined + // cmdsIgnored + }, + solution: { // Static Object: Defines the solutions built in jPlayer. + html: true, + aurora: true, + flash: true + }, + // 'MPEG-4 support' : canPlayType('video/mp4; codecs="mp4v.20.8"') + format: { // Static Object + mp3: { + codec: 'audio/mpeg', + flashCanPlay: true, + media: 'audio' + }, + m4a: { // AAC / MP4 + codec: 'audio/mp4; codecs="mp4a.40.2"', + flashCanPlay: true, + media: 'audio' + }, + m3u8a: { // AAC / MP4 / Apple HLS + codec: 'application/vnd.apple.mpegurl; codecs="mp4a.40.2"', + flashCanPlay: false, + media: 'audio' + }, + m3ua: { // M3U + codec: 'audio/mpegurl', + flashCanPlay: false, + media: 'audio' + }, + oga: { // OGG + codec: 'audio/ogg; codecs="vorbis, opus"', + flashCanPlay: false, + media: 'audio' + }, + flac: { // FLAC + codec: 'audio/x-flac', + flashCanPlay: false, + media: 'audio' + }, + wav: { // PCM + codec: 'audio/wav; codecs="1"', + flashCanPlay: false, + media: 'audio' + }, + webma: { // WEBM + codec: 'audio/webm; codecs="vorbis"', + flashCanPlay: false, + media: 'audio' + }, + fla: { // FLV / F4A + codec: 'audio/x-flv', + flashCanPlay: true, + media: 'audio' + }, + rtmpa: { // RTMP AUDIO + codec: 'audio/rtmp; codecs="rtmp"', + flashCanPlay: true, + media: 'audio' + }, + m4v: { // H.264 / MP4 + codec: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"', + flashCanPlay: true, + media: 'video' + }, + m3u8v: { // H.264 / AAC / MP4 / Apple HLS + codec: 'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"', + flashCanPlay: false, + media: 'video' + }, + m3uv: { // M3U + codec: 'audio/mpegurl', + flashCanPlay: false, + media: 'video' + }, + ogv: { // OGG + codec: 'video/ogg; codecs="theora, vorbis"', + flashCanPlay: false, + media: 'video' + }, + webmv: { // WEBM + codec: 'video/webm; codecs="vorbis, vp8"', + flashCanPlay: false, + media: 'video' + }, + flv: { // FLV / F4V + codec: 'video/x-flv', + flashCanPlay: true, + media: 'video' + }, + rtmpv: { // RTMP VIDEO + codec: 'video/rtmp; codecs="rtmp"', + flashCanPlay: true, + media: 'video' + } + }, + _init: function() { + var self = this; + + this.element.empty(); + + this.status = $.extend({}, this.status); // Copy static to unique instance. + this.internal = $.extend({}, this.internal); // Copy static to unique instance. + + // Initialize the time format + this.options.timeFormat = $.extend({}, $.jPlayer.timeFormat, this.options.timeFormat); + + // On iOS, assume commands will be ignored before user initiates them. + this.internal.cmdsIgnored = $.jPlayer.platform.ipad || $.jPlayer.platform.iphone || $.jPlayer.platform.ipod; + + this.internal.domNode = this.element.get(0); + + // Add key bindings focus to 1st jPlayer instanced with key control enabled. + if(this.options.keyEnabled && !$.jPlayer.focus) { + $.jPlayer.focus = this; + } + + // A fix for Android where older (2.3) and even some 4.x devices fail to work when changing the *audio* SRC and then playing immediately. + this.androidFix = { + setMedia: false, // True when media set + play: false, // True when a progress event will instruct the media to play + pause: false, // True when a progress event will instruct the media to pause at a time. + time: NaN // The play(time) parameter + }; + if($.jPlayer.platform.android) { + this.options.preload = this.options.preload !== 'auto' ? 'metadata' : 'auto'; // Default to metadata, but allow auto. + } + + this.formats = []; // Array based on supplied string option. Order defines priority. + this.solutions = []; // Array based on solution string option. Order defines priority. + this.require = {}; // Which media types are required: video, audio. + + this.htmlElement = {}; // DOM elements created by jPlayer + this.html = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array. + this.html.audio = {}; + this.html.video = {}; + this.aurora = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array. + this.aurora.formats = []; + this.aurora.properties = []; + this.flash = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array. + + this.css = {}; + this.css.cs = {}; // Holds the css selector strings + this.css.jq = {}; // Holds jQuery selectors. ie., $(css.cs.method) + + this.ancestorJq = []; // Holds jQuery selector of cssSelectorAncestor. Init would use $() instead of [], but it is only 1.4+ + + this.options.volume = this._limitValue(this.options.volume, 0, 1); // Limit volume value's bounds. + + // Create the formats array, with prority based on the order of the supplied formats string + $.each(this.options.supplied.toLowerCase().split(","), function(index1, value1) { + var format = value1.replace(/^\s+|\s+$/g, ""); //trim + if(self.format[format]) { // Check format is valid. + var dupFound = false; + $.each(self.formats, function(index2, value2) { // Check for duplicates + if(format === value2) { + dupFound = true; + return false; + } + }); + if(!dupFound) { + self.formats.push(format); + } + } + }); + + // Create the solutions array, with prority based on the order of the solution string + $.each(this.options.solution.toLowerCase().split(","), function(index1, value1) { + var solution = value1.replace(/^\s+|\s+$/g, ""); //trim + if(self.solution[solution]) { // Check solution is valid. + var dupFound = false; + $.each(self.solutions, function(index2, value2) { // Check for duplicates + if(solution === value2) { + dupFound = true; + return false; + } + }); + if(!dupFound) { + self.solutions.push(solution); + } + } + }); + + // Create Aurora.js formats array + $.each(this.options.auroraFormats.toLowerCase().split(","), function(index1, value1) { + var format = value1.replace(/^\s+|\s+$/g, ""); //trim + if(self.format[format]) { // Check format is valid. + var dupFound = false; + $.each(self.aurora.formats, function(index2, value2) { // Check for duplicates + if(format === value2) { + dupFound = true; + return false; + } + }); + if(!dupFound) { + self.aurora.formats.push(format); + } + } + }); + + this.internal.instance = "jp_" + this.count; + this.instances[this.internal.instance] = this.element; + + // Check the jPlayer div has an id and create one if required. Important for Flash to know the unique id for comms. + if(!this.element.attr("id")) { + this.element.attr("id", this.options.idPrefix + "_jplayer_" + this.count); + } + + this.internal.self = $.extend({}, { + id: this.element.attr("id"), + jq: this.element + }); + this.internal.audio = $.extend({}, { + id: this.options.idPrefix + "_audio_" + this.count, + jq: undefined + }); + this.internal.video = $.extend({}, { + id: this.options.idPrefix + "_video_" + this.count, + jq: undefined + }); + this.internal.flash = $.extend({}, { + id: this.options.idPrefix + "_flash_" + this.count, + jq: undefined, + swf: this.options.swfPath + (this.options.swfPath.toLowerCase().slice(-4) !== ".swf" ? (this.options.swfPath && this.options.swfPath.slice(-1) !== "/" ? "/" : "") + "jquery.jplayer.swf" : "") + }); + this.internal.poster = $.extend({}, { + id: this.options.idPrefix + "_poster_" + this.count, + jq: undefined + }); + + // Register listeners defined in the constructor + $.each($.jPlayer.event, function(eventName,eventType) { + if(self.options[eventName] !== undefined) { + self.element.bind(eventType + ".jPlayer", self.options[eventName]); // With .jPlayer namespace. + self.options[eventName] = undefined; // Destroy the handler pointer copy on the options. Reason, events can be added/removed in other ways so this could be obsolete and misleading. + } + }); + + // Determine if we require solutions for audio, video or both media types. + this.require.audio = false; + this.require.video = false; + $.each(this.formats, function(priority, format) { + self.require[self.format[format].media] = true; + }); + + // Now required types are known, finish the options default settings. + if(this.require.video) { + this.options = $.extend(true, {}, + this.optionsVideo, + this.options + ); + } else { + this.options = $.extend(true, {}, + this.optionsAudio, + this.options + ); + } + this._setSize(); // update status and jPlayer element size + + // Determine the status for Blocklisted options. + this.status.nativeVideoControls = this._uaBlocklist(this.options.nativeVideoControls); + this.status.noFullWindow = this._uaBlocklist(this.options.noFullWindow); + this.status.noVolume = this._uaBlocklist(this.options.noVolume); + + // Create event handlers if native fullscreen is supported + if($.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled) { + this._fullscreenAddEventListeners(); + } + + // The native controls are only for video and are disabled when audio is also used. + this._restrictNativeVideoControls(); + + // Create the poster image. + this.htmlElement.poster = document.createElement('img'); + this.htmlElement.poster.id = this.internal.poster.id; + this.htmlElement.poster.onload = function() { // Note that this did not work on Firefox 3.6: poster.addEventListener("onload", function() {}, false); Did not investigate x-browser. + if(!self.status.video || self.status.waitForPlay) { + self.internal.poster.jq.show(); + } + }; + this.element.append(this.htmlElement.poster); + this.internal.poster.jq = $("#" + this.internal.poster.id); + this.internal.poster.jq.css({'width': this.status.width, 'height': this.status.height}); + this.internal.poster.jq.hide(); + this.internal.poster.jq.bind("click.jPlayer", function() { + self._trigger($.jPlayer.event.click); + }); + + // Generate the required media elements + this.html.audio.available = false; + if(this.require.audio) { // If a supplied format is audio + this.htmlElement.audio = document.createElement('audio'); + this.htmlElement.audio.id = this.internal.audio.id; + this.html.audio.available = !!this.htmlElement.audio.canPlayType && this._testCanPlayType(this.htmlElement.audio); // Test is for IE9 on Win Server 2008. + } + this.html.video.available = false; + if(this.require.video) { // If a supplied format is video + this.htmlElement.video = document.createElement('video'); + this.htmlElement.video.id = this.internal.video.id; + this.html.video.available = !!this.htmlElement.video.canPlayType && this._testCanPlayType(this.htmlElement.video); // Test is for IE9 on Win Server 2008. + } + + this.flash.available = this._checkForFlash(10.1); + + this.html.canPlay = {}; + this.aurora.canPlay = {}; + this.flash.canPlay = {}; + $.each(this.formats, function(priority, format) { + self.html.canPlay[format] = self.html[self.format[format].media].available && "" !== self.htmlElement[self.format[format].media].canPlayType(self.format[format].codec); + self.aurora.canPlay[format] = ($.inArray(format, self.aurora.formats) > -1); + self.flash.canPlay[format] = self.format[format].flashCanPlay && self.flash.available; + }); + this.html.desired = false; + this.aurora.desired = false; + this.flash.desired = false; + $.each(this.solutions, function(solutionPriority, solution) { + if(solutionPriority === 0) { + self[solution].desired = true; + } else { + var audioCanPlay = false; + var videoCanPlay = false; + $.each(self.formats, function(formatPriority, format) { + if(self[self.solutions[0]].canPlay[format]) { // The other solution can play + if(self.format[format].media === 'video') { + videoCanPlay = true; + } else { + audioCanPlay = true; + } + } + }); + self[solution].desired = (self.require.audio && !audioCanPlay) || (self.require.video && !videoCanPlay); + } + }); + // This is what jPlayer will support, based on solution and supplied. + this.html.support = {}; + this.aurora.support = {}; + this.flash.support = {}; + $.each(this.formats, function(priority, format) { + self.html.support[format] = self.html.canPlay[format] && self.html.desired; + self.aurora.support[format] = self.aurora.canPlay[format] && self.aurora.desired; + self.flash.support[format] = self.flash.canPlay[format] && self.flash.desired; + }); + // If jPlayer is supporting any format in a solution, then the solution is used. + this.html.used = false; + this.aurora.used = false; + this.flash.used = false; + $.each(this.solutions, function(solutionPriority, solution) { + $.each(self.formats, function(formatPriority, format) { + if(self[solution].support[format]) { + self[solution].used = true; + return false; + } + }); + }); + + // Init solution active state and the event gates to false. + this._resetActive(); + this._resetGate(); + + // Set up the css selectors for the control and feedback entities. + this._cssSelectorAncestor(this.options.cssSelectorAncestor); + + // If neither html nor aurora nor flash are being used by this browser, then media playback is not possible. Trigger an error event. + if(!(this.html.used || this.aurora.used || this.flash.used)) { + this._error( { + type: $.jPlayer.error.NO_SOLUTION, + context: "{solution:'" + this.options.solution + "', supplied:'" + this.options.supplied + "'}", + message: $.jPlayer.errorMsg.NO_SOLUTION, + hint: $.jPlayer.errorHint.NO_SOLUTION + }); + if(this.css.jq.noSolution.length) { + this.css.jq.noSolution.show(); + } + } else { + if(this.css.jq.noSolution.length) { + this.css.jq.noSolution.hide(); + } + } + + // Add the flash solution if it is being used. + if(this.flash.used) { + var htmlObj, + flashVars = 'jQuery=' + encodeURI(this.options.noConflict) + '&id=' + encodeURI(this.internal.self.id) + '&vol=' + this.options.volume + '&muted=' + this.options.muted; + + // Code influenced by SWFObject 2.2: http://code.google.com/p/swfobject/ + // Non IE browsers have an initial Flash size of 1 by 1 otherwise the wmode affected the Flash ready event. + + if($.jPlayer.browser.msie && (Number($.jPlayer.browser.version) < 9 || $.jPlayer.browser.documentMode < 9)) { + var objStr = ''; + + var paramStr = [ + '', + '', + '', + '', + '' + ]; + + htmlObj = document.createElement(objStr); + for(var i=0; i < paramStr.length; i++) { + htmlObj.appendChild(document.createElement(paramStr[i])); + } + } else { + var createParam = function(el, n, v) { + var p = document.createElement("param"); + p.setAttribute("name", n); + p.setAttribute("value", v); + el.appendChild(p); + }; + + htmlObj = document.createElement("object"); + htmlObj.setAttribute("id", this.internal.flash.id); + htmlObj.setAttribute("name", this.internal.flash.id); + htmlObj.setAttribute("data", this.internal.flash.swf); + htmlObj.setAttribute("type", "application/x-shockwave-flash"); + htmlObj.setAttribute("width", "1"); // Non-zero + htmlObj.setAttribute("height", "1"); // Non-zero + htmlObj.setAttribute("tabindex", "-1"); + createParam(htmlObj, "flashvars", flashVars); + createParam(htmlObj, "allowscriptaccess", "always"); + createParam(htmlObj, "bgcolor", this.options.backgroundColor); + createParam(htmlObj, "wmode", this.options.wmode); + } + + this.element.append(htmlObj); + this.internal.flash.jq = $(htmlObj); + } + + // Setup playbackRate ability before using _addHtmlEventListeners() + if(this.html.used && !this.flash.used) { // If only HTML + // Using the audio element capabilities for playbackRate. ie., Assuming video element is the same. + this.status.playbackRateEnabled = this._testPlaybackRate('audio'); + } else { + this.status.playbackRateEnabled = false; + } + + this._updatePlaybackRate(); + + // Add the HTML solution if being used. + if(this.html.used) { + + // The HTML Audio handlers + if(this.html.audio.available) { + this._addHtmlEventListeners(this.htmlElement.audio, this.html.audio); + this.element.append(this.htmlElement.audio); + this.internal.audio.jq = $("#" + this.internal.audio.id); + } + + // The HTML Video handlers + if(this.html.video.available) { + this._addHtmlEventListeners(this.htmlElement.video, this.html.video); + this.element.append(this.htmlElement.video); + this.internal.video.jq = $("#" + this.internal.video.id); + if(this.status.nativeVideoControls) { + this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height}); + } else { + this.internal.video.jq.css({'width':'0px', 'height':'0px'}); // Using size 0x0 since a .hide() causes issues in iOS + } + this.internal.video.jq.bind("click.jPlayer", function() { + self._trigger($.jPlayer.event.click); + }); + } + } + + // Add the Aurora.js solution if being used. + if(this.aurora.used) { + // Aurora.js player need to be created for each media, see setMedia function. + } + + // Create the bridge that emulates the HTML Media element on the jPlayer DIV + if( this.options.emulateHtml ) { + this._emulateHtmlBridge(); + } + + if((this.html.used || this.aurora.used) && !this.flash.used) { // If only HTML, then emulate flash ready() call after 100ms. + setTimeout( function() { + self.internal.ready = true; + self.version.flash = "n/a"; + self._trigger($.jPlayer.event.repeat); // Trigger the repeat event so its handler can initialize itself with the loop option. + self._trigger($.jPlayer.event.ready); + }, 100); + } + + // Initialize the interface components with the options. + this._updateNativeVideoControls(); + // The other controls are now setup in _cssSelectorAncestor() + if(this.css.jq.videoPlay.length) { + this.css.jq.videoPlay.hide(); + } + + $.jPlayer.prototype.count++; // Change static variable via prototype. + }, + destroy: function() { + // MJP: The background change remains. Would need to store the original to restore it correctly. + // MJP: The jPlayer element's size change remains. + + // Clear the media to reset the GUI and stop any downloads. Streams on some browsers had persited. (Chrome) + this.clearMedia(); + // Remove the size/sizeFull cssClass from the cssSelectorAncestor + this._removeUiClass(); + // Remove the times from the GUI + if(this.css.jq.currentTime.length) { + this.css.jq.currentTime.text(""); + } + if(this.css.jq.duration.length) { + this.css.jq.duration.text(""); + } + // Remove any bindings from the interface controls. + $.each(this.css.jq, function(fn, jq) { + // Check selector is valid before trying to execute method. + if(jq.length) { + jq.unbind(".jPlayer"); + } + }); + // Remove the click handlers for $.jPlayer.event.click + this.internal.poster.jq.unbind(".jPlayer"); + if(this.internal.video.jq) { + this.internal.video.jq.unbind(".jPlayer"); + } + // Remove the fullscreen event handlers + this._fullscreenRemoveEventListeners(); + // Remove key bindings + if(this === $.jPlayer.focus) { + $.jPlayer.focus = null; + } + // Destroy the HTML bridge. + if(this.options.emulateHtml) { + this._destroyHtmlBridge(); + } + this.element.removeData("jPlayer"); // Remove jPlayer data + this.element.unbind(".jPlayer"); // Remove all event handlers created by the jPlayer constructor + this.element.empty(); // Remove the inserted child elements + + delete this.instances[this.internal.instance]; // Clear the instance on the static instance object + }, + destroyRemoved: function() { // Destroy any instances that have gone away. + var self = this; + $.each(this.instances, function(i, element) { + if(self.element !== element) { // Do not destroy this instance. + if(!element.data("jPlayer")) { // Check that element is a real jPlayer. + element.jPlayer("destroy"); + delete self.instances[i]; + } + } + }); + }, + enable: function() { // Plan to implement + // options.disabled = false + }, + disable: function () { // Plan to implement + // options.disabled = true + }, + _testCanPlayType: function(elem) { + // IE9 on Win Server 2008 did not implement canPlayType(), but it has the property. + try { + elem.canPlayType(this.format.mp3.codec); // The type is irrelevant. + return true; + } catch(err) { + return false; + } + }, + _testPlaybackRate: function(type) { + // type: String 'audio' or 'video' + var el, rate = 0.5; + type = typeof type === 'string' ? type : 'audio'; + el = document.createElement(type); + // Wrapping in a try/catch, just in case older HTML5 browsers throw and error. + try { + if('playbackRate' in el) { + el.playbackRate = rate; + return el.playbackRate === rate; + } else { + return false; + } + } catch(err) { + return false; + } + }, + _uaBlocklist: function(list) { + // list : object with properties that are all regular expressions. Property names are irrelevant. + // Returns true if the user agent is matched in list. + var ua = navigator.userAgent.toLowerCase(), + block = false; + + $.each(list, function(p, re) { + if(re && re.test(ua)) { + block = true; + return false; // exit $.each. + } + }); + return block; + }, + _restrictNativeVideoControls: function() { + // Fallback to noFullWindow when nativeVideoControls is true and audio media is being used. Affects when both media types are used. + if(this.require.audio) { + if(this.status.nativeVideoControls) { + this.status.nativeVideoControls = false; + this.status.noFullWindow = true; + } + } + }, + _updateNativeVideoControls: function() { + if(this.html.video.available && this.html.used) { + // Turn the HTML Video controls on/off + this.htmlElement.video.controls = this.status.nativeVideoControls; + // Show/hide the jPlayer GUI. + this._updateAutohide(); + // For when option changed. The poster image is not updated, as it is dealt with in setMedia(). Acceptable degradation since seriously doubt these options will change on the fly. Can again review later. + if(this.status.nativeVideoControls && this.require.video) { + this.internal.poster.jq.hide(); + this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height}); + } else if(this.status.waitForPlay && this.status.video) { + this.internal.poster.jq.show(); + this.internal.video.jq.css({'width': '0px', 'height': '0px'}); + } + } + }, + _addHtmlEventListeners: function(mediaElement, entity) { + var self = this; + mediaElement.preload = this.options.preload; + mediaElement.muted = this.options.muted; + mediaElement.volume = this.options.volume; + + if(this.status.playbackRateEnabled) { + mediaElement.defaultPlaybackRate = this.options.defaultPlaybackRate; + mediaElement.playbackRate = this.options.playbackRate; + } + + // Create the event listeners + // Only want the active entity to affect jPlayer and bubble events. + // Using entity.gate so that object is referenced and gate property always current + + mediaElement.addEventListener("progress", function() { + if(entity.gate) { + if(self.internal.cmdsIgnored && this.readyState > 0) { // Detect iOS executed the command + self.internal.cmdsIgnored = false; + } + self._getHtmlStatus(mediaElement); + self._updateInterface(); + self._trigger($.jPlayer.event.progress); + } + }, false); + mediaElement.addEventListener("loadeddata", function() { + if(entity.gate) { + self.androidFix.setMedia = false; // Disable the fix after the first progress event. + if(self.androidFix.play) { // Play Android audio - performing the fix. + self.androidFix.play = false; + self.play(self.androidFix.time); + } + if(self.androidFix.pause) { // Pause Android audio at time - performing the fix. + self.androidFix.pause = false; + self.pause(self.androidFix.time); + } + self._trigger($.jPlayer.event.loadeddata); + } + }, false); + mediaElement.addEventListener("timeupdate", function() { + if(entity.gate) { + self._getHtmlStatus(mediaElement); + self._updateInterface(); + self._trigger($.jPlayer.event.timeupdate); + } + }, false); + mediaElement.addEventListener("durationchange", function() { + if(entity.gate) { + self._getHtmlStatus(mediaElement); + self._updateInterface(); + self._trigger($.jPlayer.event.durationchange); + } + }, false); + mediaElement.addEventListener("play", function() { + if(entity.gate) { + self._updateButtons(true); + self._html_checkWaitForPlay(); // So the native controls update this variable and puts the hidden interface in the correct state. Affects toggling native controls. + self._trigger($.jPlayer.event.play); + } + }, false); + mediaElement.addEventListener("playing", function() { + if(entity.gate) { + self._updateButtons(true); + self._seeked(); + self._trigger($.jPlayer.event.playing); + } + }, false); + mediaElement.addEventListener("pause", function() { + if(entity.gate) { + self._updateButtons(false); + self._trigger($.jPlayer.event.pause); + } + }, false); + mediaElement.addEventListener("waiting", function() { + if(entity.gate) { + self._seeking(); + self._trigger($.jPlayer.event.waiting); + } + }, false); + mediaElement.addEventListener("seeking", function() { + if(entity.gate) { + self._seeking(); + self._trigger($.jPlayer.event.seeking); + } + }, false); + mediaElement.addEventListener("seeked", function() { + if(entity.gate) { + self._seeked(); + self._trigger($.jPlayer.event.seeked); + } + }, false); + mediaElement.addEventListener("volumechange", function() { + if(entity.gate) { + // Read the values back from the element as the Blackberry PlayBook shares the volume with the physical buttons master volume control. + // However, when tested 6th July 2011, those buttons do not generate an event. The physical play/pause button does though. + self.options.volume = mediaElement.volume; + self.options.muted = mediaElement.muted; + self._updateMute(); + self._updateVolume(); + self._trigger($.jPlayer.event.volumechange); + } + }, false); + mediaElement.addEventListener("ratechange", function() { + if(entity.gate) { + self.options.defaultPlaybackRate = mediaElement.defaultPlaybackRate; + self.options.playbackRate = mediaElement.playbackRate; + self._updatePlaybackRate(); + self._trigger($.jPlayer.event.ratechange); + } + }, false); + mediaElement.addEventListener("suspend", function() { // Seems to be the only way of capturing that the iOS4 browser did not actually play the media from the page code. ie., It needs a user gesture. + if(entity.gate) { + self._seeked(); + self._trigger($.jPlayer.event.suspend); + } + }, false); + mediaElement.addEventListener("ended", function() { + if(entity.gate) { + // Order of the next few commands are important. Change the time and then pause. + // Solves a bug in Firefox, where issuing pause 1st causes the media to play from the start. ie., The pause is ignored. + if(!$.jPlayer.browser.webkit) { // Chrome crashes if you do this in conjunction with a setMedia command in an ended event handler. ie., The playlist demo. + self.htmlElement.media.currentTime = 0; // Safari does not care about this command. ie., It works with or without this line. (Both Safari and Chrome are Webkit.) + } + self.htmlElement.media.pause(); // Pause otherwise a click on the progress bar will play from that point, when it shouldn't, since it stopped playback. + self._updateButtons(false); + self._getHtmlStatus(mediaElement, true); // With override true. Otherwise Chrome leaves progress at full. + self._updateInterface(); + self._trigger($.jPlayer.event.ended); + } + }, false); + mediaElement.addEventListener("error", function() { + if(entity.gate) { + self._updateButtons(false); + self._seeked(); + if(self.status.srcSet) { // Deals with case of clearMedia() causing an error event. + clearTimeout(self.internal.htmlDlyCmdId); // Clears any delayed commands used in the HTML solution. + self.status.waitForLoad = true; // Allows the load operation to try again. + self.status.waitForPlay = true; // Reset since a play was captured. + if(self.status.video && !self.status.nativeVideoControls) { + self.internal.video.jq.css({'width':'0px', 'height':'0px'}); + } + if(self._validString(self.status.media.poster) && !self.status.nativeVideoControls) { + self.internal.poster.jq.show(); + } + if(self.css.jq.videoPlay.length) { + self.css.jq.videoPlay.show(); + } + self._error( { + type: $.jPlayer.error.URL, + context: self.status.src, // this.src shows absolute urls. Want context to show the url given. + message: $.jPlayer.errorMsg.URL, + hint: $.jPlayer.errorHint.URL + }); + } + } + }, false); + // Create all the other event listeners that bubble up to a jPlayer event from html, without being used by jPlayer. + $.each($.jPlayer.htmlEvent, function(i, eventType) { + mediaElement.addEventListener(this, function() { + if(entity.gate) { + self._trigger($.jPlayer.event[eventType]); + } + }, false); + }); + }, + _addAuroraEventListeners : function(player, entity) { + var self = this; + //player.preload = this.options.preload; + //player.muted = this.options.muted; + player.volume = this.options.volume * 100; + + // Create the event listeners + // Only want the active entity to affect jPlayer and bubble events. + // Using entity.gate so that object is referenced and gate property always current + + player.on("progress", function() { + if(entity.gate) { + if(self.internal.cmdsIgnored && this.readyState > 0) { // Detect iOS executed the command + self.internal.cmdsIgnored = false; + } + self._getAuroraStatus(player); + self._updateInterface(); + self._trigger($.jPlayer.event.progress); + // Progress with song duration, we estimate timeupdate need to be triggered too. + if (player.duration > 0) { + self._trigger($.jPlayer.event.timeupdate); + } + } + }, false); + player.on("ready", function() { + if(entity.gate) { + self._trigger($.jPlayer.event.loadeddata); + } + }, false); + player.on("duration", function() { + if(entity.gate) { + self._getAuroraStatus(player); + self._updateInterface(); + self._trigger($.jPlayer.event.durationchange); + } + }, false); + player.on("end", function() { + if(entity.gate) { + // Order of the next few commands are important. Change the time and then pause. + self._updateButtons(false); + self._getAuroraStatus(player, true); + self._updateInterface(); + self._trigger($.jPlayer.event.ended); + } + }, false); + player.on("error", function() { + if(entity.gate) { + self._updateButtons(false); + self._seeked(); + if(self.status.srcSet) { // Deals with case of clearMedia() causing an error event. + self.status.waitForLoad = true; // Allows the load operation to try again. + self.status.waitForPlay = true; // Reset since a play was captured. + if(self.status.video && !self.status.nativeVideoControls) { + self.internal.video.jq.css({'width':'0px', 'height':'0px'}); + } + if(self._validString(self.status.media.poster) && !self.status.nativeVideoControls) { + self.internal.poster.jq.show(); + } + if(self.css.jq.videoPlay.length) { + self.css.jq.videoPlay.show(); + } + self._error( { + type: $.jPlayer.error.URL, + context: self.status.src, // this.src shows absolute urls. Want context to show the url given. + message: $.jPlayer.errorMsg.URL, + hint: $.jPlayer.errorHint.URL + }); + } + } + }, false); + }, + _getHtmlStatus: function(media, override) { + var ct = 0, cpa = 0, sp = 0, cpr = 0; + + // Fixes the duration bug in iOS, where the durationchange event occurs when media.duration is not always correct. + // Fixes the initial duration bug in BB OS7, where the media.duration is infinity and displays as NaN:NaN due to Date() using inifity. + if(isFinite(media.duration)) { + this.status.duration = media.duration; + } + + ct = media.currentTime; + cpa = (this.status.duration > 0) ? 100 * ct / this.status.duration : 0; + if((typeof media.seekable === "object") && (media.seekable.length > 0)) { + sp = (this.status.duration > 0) ? 100 * media.seekable.end(media.seekable.length-1) / this.status.duration : 100; + cpr = (this.status.duration > 0) ? 100 * media.currentTime / media.seekable.end(media.seekable.length-1) : 0; // Duration conditional for iOS duration bug. ie., seekable.end is a NaN in that case. + } else { + sp = 100; + cpr = cpa; + } + + if(override) { + ct = 0; + cpr = 0; + cpa = 0; + } + + this.status.seekPercent = sp; + this.status.currentPercentRelative = cpr; + this.status.currentPercentAbsolute = cpa; + this.status.currentTime = ct; + + this.status.remaining = this.status.duration - this.status.currentTime; + + this.status.videoWidth = media.videoWidth; + this.status.videoHeight = media.videoHeight; + + this.status.readyState = media.readyState; + this.status.networkState = media.networkState; + this.status.playbackRate = media.playbackRate; + this.status.ended = media.ended; + }, + _getAuroraStatus: function(player, override) { + var ct = 0, cpa = 0, sp = 0, cpr = 0; + + this.status.duration = player.duration / 1000; + + ct = player.currentTime / 1000; + cpa = (this.status.duration > 0) ? 100 * ct / this.status.duration : 0; + if(player.buffered > 0) { + sp = (this.status.duration > 0) ? (player.buffered * this.status.duration) / this.status.duration : 100; + cpr = (this.status.duration > 0) ? ct / (player.buffered * this.status.duration) : 0; + } else { + sp = 100; + cpr = cpa; + } + + if(override) { + ct = 0; + cpr = 0; + cpa = 0; + } + + this.status.seekPercent = sp; + this.status.currentPercentRelative = cpr; + this.status.currentPercentAbsolute = cpa; + this.status.currentTime = ct; + + this.status.remaining = this.status.duration - this.status.currentTime; + + this.status.readyState = 4; // status.readyState; + this.status.networkState = 0; // status.networkState; + this.status.playbackRate = 1; // status.playbackRate; + this.status.ended = false; // status.ended; + }, + _resetStatus: function() { + this.status = $.extend({}, this.status, $.jPlayer.prototype.status); // Maintains the status properties that persist through a reset. + }, + _trigger: function(eventType, error, warning) { // eventType always valid as called using $.jPlayer.event.eventType + var event = $.Event(eventType); + event.jPlayer = {}; + event.jPlayer.version = $.extend({}, this.version); + event.jPlayer.options = $.extend(true, {}, this.options); // Deep copy + event.jPlayer.status = $.extend(true, {}, this.status); // Deep copy + event.jPlayer.html = $.extend(true, {}, this.html); // Deep copy + event.jPlayer.aurora = $.extend(true, {}, this.aurora); // Deep copy + event.jPlayer.flash = $.extend(true, {}, this.flash); // Deep copy + if(error) { + event.jPlayer.error = $.extend({}, error); + } + if(warning) { + event.jPlayer.warning = $.extend({}, warning); + } + this.element.trigger(event); + }, + jPlayerFlashEvent: function(eventType, status) { // Called from Flash + if(eventType === $.jPlayer.event.ready) { + if(!this.internal.ready) { + this.internal.ready = true; + this.internal.flash.jq.css({'width':'0px', 'height':'0px'}); // Once Flash generates the ready event, minimise to zero as it is not affected by wmode anymore. + + this.version.flash = status.version; + if(this.version.needFlash !== this.version.flash) { + this._error( { + type: $.jPlayer.error.VERSION, + context: this.version.flash, + message: $.jPlayer.errorMsg.VERSION + this.version.flash, + hint: $.jPlayer.errorHint.VERSION + }); + } + this._trigger($.jPlayer.event.repeat); // Trigger the repeat event so its handler can initialize itself with the loop option. + this._trigger(eventType); + } else { + // This condition occurs if the Flash is hidden and then shown again. + // Firefox also reloads the Flash if the CSS position changes. position:fixed is used for full screen. + + // Only do this if the Flash is the solution being used at the moment. Affects Media players where both solution may be being used. + if(this.flash.gate) { + + // Send the current status to the Flash now that it is ready (available) again. + if(this.status.srcSet) { + + // Need to read original status before issuing the setMedia command. + var currentTime = this.status.currentTime, + paused = this.status.paused; + + this.setMedia(this.status.media); + this.volumeWorker(this.options.volume); + if(currentTime > 0) { + if(paused) { + this.pause(currentTime); + } else { + this.play(currentTime); + } + } + } + this._trigger($.jPlayer.event.flashreset); + } + } + } + if(this.flash.gate) { + switch(eventType) { + case $.jPlayer.event.progress: + this._getFlashStatus(status); + this._updateInterface(); + this._trigger(eventType); + break; + case $.jPlayer.event.timeupdate: + this._getFlashStatus(status); + this._updateInterface(); + this._trigger(eventType); + break; + case $.jPlayer.event.play: + this._seeked(); + this._updateButtons(true); + this._trigger(eventType); + break; + case $.jPlayer.event.pause: + this._updateButtons(false); + this._trigger(eventType); + break; + case $.jPlayer.event.ended: + this._updateButtons(false); + this._trigger(eventType); + break; + case $.jPlayer.event.click: + this._trigger(eventType); // This could be dealt with by the default + break; + case $.jPlayer.event.error: + this.status.waitForLoad = true; // Allows the load operation to try again. + this.status.waitForPlay = true; // Reset since a play was captured. + if(this.status.video) { + this.internal.flash.jq.css({'width':'0px', 'height':'0px'}); + } + if(this._validString(this.status.media.poster)) { + this.internal.poster.jq.show(); + } + if(this.css.jq.videoPlay.length && this.status.video) { + this.css.jq.videoPlay.show(); + } + if(this.status.video) { // Set up for another try. Execute before error event. + this._flash_setVideo(this.status.media); + } else { + this._flash_setAudio(this.status.media); + } + this._updateButtons(false); + this._error( { + type: $.jPlayer.error.URL, + context:status.src, + message: $.jPlayer.errorMsg.URL, + hint: $.jPlayer.errorHint.URL + }); + break; + case $.jPlayer.event.seeking: + this._seeking(); + this._trigger(eventType); + break; + case $.jPlayer.event.seeked: + this._seeked(); + this._trigger(eventType); + break; + case $.jPlayer.event.ready: + // The ready event is handled outside the switch statement. + // Captured here otherwise 2 ready events would be generated if the ready event handler used setMedia. + break; + default: + this._trigger(eventType); + } + } + return false; + }, + _getFlashStatus: function(status) { + this.status.seekPercent = status.seekPercent; + this.status.currentPercentRelative = status.currentPercentRelative; + this.status.currentPercentAbsolute = status.currentPercentAbsolute; + this.status.currentTime = status.currentTime; + this.status.duration = status.duration; + this.status.remaining = status.duration - status.currentTime; + + this.status.videoWidth = status.videoWidth; + this.status.videoHeight = status.videoHeight; + + // The Flash does not generate this information in this release + this.status.readyState = 4; // status.readyState; + this.status.networkState = 0; // status.networkState; + this.status.playbackRate = 1; // status.playbackRate; + this.status.ended = false; // status.ended; + }, + _updateButtons: function(playing) { + if(playing === undefined) { + playing = !this.status.paused; + } else { + this.status.paused = !playing; + } + // Apply the state classes. (For the useStateClassSkin:true option) + if(playing) { + this.addStateClass('playing'); + } else { + this.removeStateClass('playing'); + } + if(!this.status.noFullWindow && this.options.fullWindow) { + this.addStateClass('fullScreen'); + } else { + this.removeStateClass('fullScreen'); + } + if(this.options.loop) { + this.addStateClass('looped'); + } else { + this.removeStateClass('looped'); + } + // Toggle the GUI element pairs. (For the useStateClassSkin:false option) + if(this.css.jq.play.length && this.css.jq.pause.length) { + if(playing) { + this.css.jq.play.hide(); + this.css.jq.pause.show(); + } else { + this.css.jq.play.show(); + this.css.jq.pause.hide(); + } + } + if(this.css.jq.restoreScreen.length && this.css.jq.fullScreen.length) { + if(this.status.noFullWindow) { + this.css.jq.fullScreen.hide(); + this.css.jq.restoreScreen.hide(); + } else if(this.options.fullWindow) { + this.css.jq.fullScreen.hide(); + this.css.jq.restoreScreen.show(); + } else { + this.css.jq.fullScreen.show(); + this.css.jq.restoreScreen.hide(); + } + } + if(this.css.jq.repeat.length && this.css.jq.repeatOff.length) { + if(this.options.loop) { + this.css.jq.repeat.hide(); + this.css.jq.repeatOff.show(); + } else { + this.css.jq.repeat.show(); + this.css.jq.repeatOff.hide(); + } + } + }, + _updateInterface: function() { + if(this.css.jq.seekBar.length) { + this.css.jq.seekBar.width(this.status.seekPercent+"%"); + } + if(this.css.jq.playBar.length) { + if(this.options.smoothPlayBar) { + this.css.jq.playBar.stop().animate({ + width: this.status.currentPercentAbsolute+"%" + }, 250, "linear"); + } else { + this.css.jq.playBar.width(this.status.currentPercentRelative+"%"); + } + } + var currentTimeText = ''; + if(this.css.jq.currentTime.length) { + currentTimeText = this._convertTime(this.status.currentTime); + if(currentTimeText !== this.css.jq.currentTime.text()) { + this.css.jq.currentTime.text(this._convertTime(this.status.currentTime)); + } + } + var durationText = '', + duration = this.status.duration, + remaining = this.status.remaining; + if(this.css.jq.duration.length) { + if(typeof this.status.media.duration === 'string') { + durationText = this.status.media.duration; + } else { + if(typeof this.status.media.duration === 'number') { + duration = this.status.media.duration; + remaining = duration - this.status.currentTime; + } + if(this.options.remainingDuration) { + durationText = (remaining > 0 ? '-' : '') + this._convertTime(remaining); + } else { + durationText = this._convertTime(duration); + } + } + if(durationText !== this.css.jq.duration.text()) { + this.css.jq.duration.text(durationText); + } + } + }, + _convertTime: ConvertTime.prototype.time, + _seeking: function() { + if(this.css.jq.seekBar.length) { + this.css.jq.seekBar.addClass("jp-seeking-bg"); + } + this.addStateClass('seeking'); + }, + _seeked: function() { + if(this.css.jq.seekBar.length) { + this.css.jq.seekBar.removeClass("jp-seeking-bg"); + } + this.removeStateClass('seeking'); + }, + _resetGate: function() { + this.html.audio.gate = false; + this.html.video.gate = false; + this.aurora.gate = false; + this.flash.gate = false; + }, + _resetActive: function() { + this.html.active = false; + this.aurora.active = false; + this.flash.active = false; + }, + _escapeHtml: function(s) { + return s.split('&').join('&').split('<').join('<').split('>').join('>').split('"').join('"'); + }, + _qualifyURL: function(url) { + var el = document.createElement('div'); + el.innerHTML= 'x'; + return el.firstChild.href; + }, + _absoluteMediaUrls: function(media) { + var self = this; + $.each(media, function(type, url) { + if(url && self.format[type] && url.substr(0, 5) !== "data:") { + media[type] = self._qualifyURL(url); + } + }); + return media; + }, + addStateClass: function(state) { + if(this.ancestorJq.length) { + this.ancestorJq.addClass(this.options.stateClass[state]); + } + }, + removeStateClass: function(state) { + if(this.ancestorJq.length) { + this.ancestorJq.removeClass(this.options.stateClass[state]); + } + }, + setMedia: function(media) { + + /* media[format] = String: URL of format. Must contain all of the supplied option's video or audio formats. + * media.poster = String: Video poster URL. + * media.track = Array: Of objects defining the track element: kind, src, srclang, label, def. + * media.stream = Boolean: * NOT IMPLEMENTED * Designating actual media streams. ie., "false/undefined" for files. Plan to refresh the flash every so often. + */ + + var self = this, + supported = false, + posterChanged = this.status.media.poster !== media.poster; // Compare before reset. Important for OSX Safari as this.htmlElement.poster.src is absolute, even if original poster URL was relative. + + this._resetMedia(); + this._resetGate(); + this._resetActive(); + + // Clear the Android Fix. + this.androidFix.setMedia = false; + this.androidFix.play = false; + this.androidFix.pause = false; + + // Convert all media URLs to absolute URLs. + media = this._absoluteMediaUrls(media); + + $.each(this.formats, function(formatPriority, format) { + var isVideo = self.format[format].media === 'video'; + $.each(self.solutions, function(solutionPriority, solution) { + if(self[solution].support[format] && self._validString(media[format])) { // Format supported in solution and url given for format. + var isHtml = solution === 'html'; + var isAurora = solution === 'aurora'; + + if(isVideo) { + if(isHtml) { + self.html.video.gate = true; + self._html_setVideo(media); + self.html.active = true; + } else { + self.flash.gate = true; + self._flash_setVideo(media); + self.flash.active = true; + } + if(self.css.jq.videoPlay.length) { + self.css.jq.videoPlay.show(); + } + self.status.video = true; + } else { + if(isHtml) { + self.html.audio.gate = true; + self._html_setAudio(media); + self.html.active = true; + + // Setup the Android Fix - Only for HTML audio. + if($.jPlayer.platform.android) { + self.androidFix.setMedia = true; + } + } else if(isAurora) { + self.aurora.gate = true; + self._aurora_setAudio(media); + self.aurora.active = true; + } else { + self.flash.gate = true; + self._flash_setAudio(media); + self.flash.active = true; + } + if(self.css.jq.videoPlay.length) { + self.css.jq.videoPlay.hide(); + } + self.status.video = false; + } + + supported = true; + return false; // Exit $.each + } + }); + if(supported) { + return false; // Exit $.each + } + }); + + if(supported) { + if(!(this.status.nativeVideoControls && this.html.video.gate)) { + // Set poster IMG if native video controls are not being used + // Note: With IE the IMG onload event occurs immediately when cached. + // Note: Poster hidden by default in _resetMedia() + if(this._validString(media.poster)) { + if(posterChanged) { // Since some browsers do not generate img onload event. + this.htmlElement.poster.src = media.poster; + } else { + this.internal.poster.jq.show(); + } + } + } + if(typeof media.title === 'string') { + if(this.css.jq.title.length) { + this.css.jq.title.html(media.title); + } + if(this.htmlElement.audio) { + this.htmlElement.audio.setAttribute('title', media.title); + } + if(this.htmlElement.video) { + this.htmlElement.video.setAttribute('title', media.title); + } + } + this.status.srcSet = true; + this.status.media = $.extend({}, media); + this._updateButtons(false); + this._updateInterface(); + this._trigger($.jPlayer.event.setmedia); + } else { // jPlayer cannot support any formats provided in this browser + // Send an error event + this._error( { + type: $.jPlayer.error.NO_SUPPORT, + context: "{supplied:'" + this.options.supplied + "'}", + message: $.jPlayer.errorMsg.NO_SUPPORT, + hint: $.jPlayer.errorHint.NO_SUPPORT + }); + } + }, + _resetMedia: function() { + this._resetStatus(); + this._updateButtons(false); + this._updateInterface(); + this._seeked(); + this.internal.poster.jq.hide(); + + clearTimeout(this.internal.htmlDlyCmdId); + + if(this.html.active) { + this._html_resetMedia(); + } else if(this.aurora.active) { + this._aurora_resetMedia(); + } else if(this.flash.active) { + this._flash_resetMedia(); + } + }, + clearMedia: function() { + this._resetMedia(); + + if(this.html.active) { + this._html_clearMedia(); + } else if(this.aurora.active) { + this._aurora_clearMedia(); + } else if(this.flash.active) { + this._flash_clearMedia(); + } + + this._resetGate(); + this._resetActive(); + }, + load: function() { + if(this.status.srcSet) { + if(this.html.active) { + this._html_load(); + } else if(this.aurora.active) { + this._aurora_load(); + } else if(this.flash.active) { + this._flash_load(); + } + } else { + this._urlNotSetError("load"); + } + }, + focus: function() { + if(this.options.keyEnabled) { + $.jPlayer.focus = this; + } + }, + play: function(time) { + var guiAction = typeof time === "object"; // Flags GUI click events so we know this was not a direct command, but an action taken by the user on the GUI. + if(guiAction && this.options.useStateClassSkin && !this.status.paused) { + this.pause(time); // The time would be the click event, but passing it over so info is not lost. + } else { + time = (typeof time === "number") ? time : NaN; // Remove jQuery event from click handler + if(this.status.srcSet) { + this.focus(); + if(this.html.active) { + this._html_play(time); + } else if(this.aurora.active) { + this._aurora_play(time); + } else if(this.flash.active) { + this._flash_play(time); + } + } else { + this._urlNotSetError("play"); + } + } + }, + videoPlay: function() { // Handles clicks on the play button over the video poster + this.play(); + }, + pause: function(time) { + time = (typeof time === "number") ? time : NaN; // Remove jQuery event from click handler + if(this.status.srcSet) { + if(this.html.active) { + this._html_pause(time); + } else if(this.aurora.active) { + this._aurora_pause(time); + } else if(this.flash.active) { + this._flash_pause(time); + } + } else { + this._urlNotSetError("pause"); + } + }, + tellOthers: function(command, conditions) { + var self = this, + hasConditions = typeof conditions === 'function', + args = Array.prototype.slice.call(arguments); // Convert arguments to an Array. + + if(typeof command !== 'string') { // Ignore, since no command. + return; // Return undefined to maintain chaining. + } + if(hasConditions) { + args.splice(1, 1); // Remove the conditions from the arguments + } + + $.jPlayer.prototype.destroyRemoved(); + $.each(this.instances, function() { + // Remember that "this" is the instance's "element" in the $.each() loop. + if(self.element !== this) { // Do not tell my instance. + if(!hasConditions || conditions.call(this.data("jPlayer"), self)) { + this.jPlayer.apply(this, args); + } + } + }); + }, + pauseOthers: function(time) { + this.tellOthers("pause", function() { + // In the conditions function, the "this" context is the other instance's jPlayer object. + return this.status.srcSet; + }, time); + }, + stop: function() { + if(this.status.srcSet) { + if(this.html.active) { + this._html_pause(0); + } else if(this.aurora.active) { + this._aurora_pause(0); + } else if(this.flash.active) { + this._flash_pause(0); + } + } else { + this._urlNotSetError("stop"); + } + }, + playHead: function(p) { + p = this._limitValue(p, 0, 100); + if(this.status.srcSet) { + if(this.html.active) { + this._html_playHead(p); + } else if(this.aurora.active) { + this._aurora_playHead(p); + } else if(this.flash.active) { + this._flash_playHead(p); + } + } else { + this._urlNotSetError("playHead"); + } + }, + _muted: function(muted) { + this.mutedWorker(muted); + if(this.options.globalVolume) { + this.tellOthers("mutedWorker", function() { + // Check the other instance has global volume enabled. + return this.options.globalVolume; + }, muted); + } + }, + mutedWorker: function(muted) { + this.options.muted = muted; + if(this.html.used) { + this._html_setProperty('muted', muted); + } + if(this.aurora.used) { + this._aurora_mute(muted); + } + if(this.flash.used) { + this._flash_mute(muted); + } + + // The HTML solution generates this event from the media element itself. + if(!this.html.video.gate && !this.html.audio.gate) { + this._updateMute(muted); + this._updateVolume(this.options.volume); + this._trigger($.jPlayer.event.volumechange); + } + }, + mute: function(mute) { // mute is either: undefined (true), an event object (true) or a boolean (muted). + var guiAction = typeof mute === "object"; // Flags GUI click events so we know this was not a direct command, but an action taken by the user on the GUI. + if(guiAction && this.options.useStateClassSkin && this.options.muted) { + this._muted(false); + } else { + mute = mute === undefined ? true : !!mute; + this._muted(mute); + } + }, + unmute: function(unmute) { // unmute is either: undefined (true), an event object (true) or a boolean (!muted). + unmute = unmute === undefined ? true : !!unmute; + this._muted(!unmute); + }, + _updateMute: function(mute) { + if(mute === undefined) { + mute = this.options.muted; + } + if(mute) { + this.addStateClass('muted'); + } else { + this.removeStateClass('muted'); + } + if(this.css.jq.mute.length && this.css.jq.unmute.length) { + if(this.status.noVolume) { + this.css.jq.mute.hide(); + this.css.jq.unmute.hide(); + } else if(mute) { + this.css.jq.mute.hide(); + this.css.jq.unmute.show(); + } else { + this.css.jq.mute.show(); + this.css.jq.unmute.hide(); + } + } + }, + volume: function(v) { + this.volumeWorker(v); + if(this.options.globalVolume) { + this.tellOthers("volumeWorker", function() { + // Check the other instance has global volume enabled. + return this.options.globalVolume; + }, v); + } + }, + volumeWorker: function(v) { + v = this._limitValue(v, 0, 1); + this.options.volume = v; + + if(this.html.used) { + this._html_setProperty('volume', v); + } + if(this.aurora.used) { + this._aurora_volume(v); + } + if(this.flash.used) { + this._flash_volume(v); + } + + // The HTML solution generates this event from the media element itself. + if(!this.html.video.gate && !this.html.audio.gate) { + this._updateVolume(v); + this._trigger($.jPlayer.event.volumechange); + } + }, + volumeBar: function(e) { // Handles clicks on the volumeBar + if(this.css.jq.volumeBar.length) { + // Using $(e.currentTarget) to enable multiple volume bars + var $bar = $(e.currentTarget), + offset = $bar.offset(), + x = e.pageX - offset.left, + w = $bar.width(), + y = $bar.height() - e.pageY + offset.top, + h = $bar.height(); + if(this.options.verticalVolume) { + this.volume(y/h); + } else { + this.volume(x/w); + } + } + if(this.options.muted) { + this._muted(false); + } + }, + _updateVolume: function(v) { + if(v === undefined) { + v = this.options.volume; + } + v = this.options.muted ? 0 : v; + + if(this.status.noVolume) { + this.addStateClass('noVolume'); + if(this.css.jq.volumeBar.length) { + this.css.jq.volumeBar.hide(); + } + if(this.css.jq.volumeBarValue.length) { + this.css.jq.volumeBarValue.hide(); + } + if(this.css.jq.volumeMax.length) { + this.css.jq.volumeMax.hide(); + } + } else { + this.removeStateClass('noVolume'); + if(this.css.jq.volumeBar.length) { + this.css.jq.volumeBar.show(); + } + if(this.css.jq.volumeBarValue.length) { + this.css.jq.volumeBarValue.show(); + this.css.jq.volumeBarValue[this.options.verticalVolume ? "height" : "width"]((v*100)+"%"); + } + if(this.css.jq.volumeMax.length) { + this.css.jq.volumeMax.show(); + } + } + }, + volumeMax: function() { // Handles clicks on the volume max + this.volume(1); + if(this.options.muted) { + this._muted(false); + } + }, + _cssSelectorAncestor: function(ancestor) { + var self = this; + this.options.cssSelectorAncestor = ancestor; + this._removeUiClass(); + this.ancestorJq = ancestor ? $(ancestor) : []; // Would use $() instead of [], but it is only 1.4+ + if(ancestor && this.ancestorJq.length !== 1) { // So empty strings do not generate the warning. + this._warning( { + type: $.jPlayer.warning.CSS_SELECTOR_COUNT, + context: ancestor, + message: $.jPlayer.warningMsg.CSS_SELECTOR_COUNT + this.ancestorJq.length + " found for cssSelectorAncestor.", + hint: $.jPlayer.warningHint.CSS_SELECTOR_COUNT + }); + } + this._addUiClass(); + $.each(this.options.cssSelector, function(fn, cssSel) { + self._cssSelector(fn, cssSel); + }); + + // Set the GUI to the current state. + this._updateInterface(); + this._updateButtons(); + this._updateAutohide(); + this._updateVolume(); + this._updateMute(); + }, + _cssSelector: function(fn, cssSel) { + var self = this; + if(typeof cssSel === 'string') { + if($.jPlayer.prototype.options.cssSelector[fn]) { + if(this.css.jq[fn] && this.css.jq[fn].length) { + this.css.jq[fn].unbind(".jPlayer"); + } + this.options.cssSelector[fn] = cssSel; + this.css.cs[fn] = this.options.cssSelectorAncestor + " " + cssSel; + + if(cssSel) { // Checks for empty string + this.css.jq[fn] = $(this.css.cs[fn]); + } else { + this.css.jq[fn] = []; // To comply with the css.jq[fn].length check before its use. As of jQuery 1.4 could have used $() for an empty set. + } + + if(this.css.jq[fn].length && this[fn]) { + var handler = function(e) { + e.preventDefault(); + self[fn](e); + if(self.options.autoBlur) { + $(this).blur(); + } else { + $(this).focus(); // Force focus for ARIA. + } + }; + this.css.jq[fn].bind("click.jPlayer", handler); // Using jPlayer namespace + } + + if(cssSel && this.css.jq[fn].length !== 1) { // So empty strings do not generate the warning. ie., they just remove the old one. + this._warning( { + type: $.jPlayer.warning.CSS_SELECTOR_COUNT, + context: this.css.cs[fn], + message: $.jPlayer.warningMsg.CSS_SELECTOR_COUNT + this.css.jq[fn].length + " found for " + fn + " method.", + hint: $.jPlayer.warningHint.CSS_SELECTOR_COUNT + }); + } + } else { + this._warning( { + type: $.jPlayer.warning.CSS_SELECTOR_METHOD, + context: fn, + message: $.jPlayer.warningMsg.CSS_SELECTOR_METHOD, + hint: $.jPlayer.warningHint.CSS_SELECTOR_METHOD + }); + } + } else { + this._warning( { + type: $.jPlayer.warning.CSS_SELECTOR_STRING, + context: cssSel, + message: $.jPlayer.warningMsg.CSS_SELECTOR_STRING, + hint: $.jPlayer.warningHint.CSS_SELECTOR_STRING + }); + } + }, + duration: function(e) { + if(this.options.toggleDuration) { + if(this.options.captureDuration) { + e.stopPropagation(); + } + this._setOption("remainingDuration", !this.options.remainingDuration); + } + }, + seekBar: function(e) { // Handles clicks on the seekBar + if(this.css.jq.seekBar.length) { + // Using $(e.currentTarget) to enable multiple seek bars + var $bar = $(e.currentTarget), + offset = $bar.offset(), + x = e.pageX - offset.left, + w = $bar.width(), + p = 100 * x / w; + this.playHead(p); + } + }, + playbackRate: function(pbr) { + this._setOption("playbackRate", pbr); + }, + playbackRateBar: function(e) { // Handles clicks on the playbackRateBar + if(this.css.jq.playbackRateBar.length) { + // Using $(e.currentTarget) to enable multiple playbackRate bars + var $bar = $(e.currentTarget), + offset = $bar.offset(), + x = e.pageX - offset.left, + w = $bar.width(), + y = $bar.height() - e.pageY + offset.top, + h = $bar.height(), + ratio, pbr; + if(this.options.verticalPlaybackRate) { + ratio = y/h; + } else { + ratio = x/w; + } + pbr = ratio * (this.options.maxPlaybackRate - this.options.minPlaybackRate) + this.options.minPlaybackRate; + this.playbackRate(pbr); + } + }, + _updatePlaybackRate: function() { + var pbr = this.options.playbackRate, + ratio = (pbr - this.options.minPlaybackRate) / (this.options.maxPlaybackRate - this.options.minPlaybackRate); + if(this.status.playbackRateEnabled) { + if(this.css.jq.playbackRateBar.length) { + this.css.jq.playbackRateBar.show(); + } + if(this.css.jq.playbackRateBarValue.length) { + this.css.jq.playbackRateBarValue.show(); + this.css.jq.playbackRateBarValue[this.options.verticalPlaybackRate ? "height" : "width"]((ratio*100)+"%"); + } + } else { + if(this.css.jq.playbackRateBar.length) { + this.css.jq.playbackRateBar.hide(); + } + if(this.css.jq.playbackRateBarValue.length) { + this.css.jq.playbackRateBarValue.hide(); + } + } + }, + repeat: function(event) { // Handle clicks on the repeat button + var guiAction = typeof event === "object"; // Flags GUI click events so we know this was not a direct command, but an action taken by the user on the GUI. + if(guiAction && this.options.useStateClassSkin && this.options.loop) { + this._loop(false); + } else { + this._loop(true); + } + }, + repeatOff: function() { // Handle clicks on the repeatOff button + this._loop(false); + }, + _loop: function(loop) { + if(this.options.loop !== loop) { + this.options.loop = loop; + this._updateButtons(); + this._trigger($.jPlayer.event.repeat); + } + }, + + // Options code adapted from ui.widget.js (1.8.7). Made changes so the key can use dot notation. To match previous getData solution in jPlayer 1. + option: function(key, value) { + var options = key; + + // Enables use: options(). Returns a copy of options object + if ( arguments.length === 0 ) { + return $.extend( true, {}, this.options ); + } + + if(typeof key === "string") { + var keys = key.split("."); + + // Enables use: options("someOption") Returns a copy of the option. Supports dot notation. + if(value === undefined) { + + var opt = $.extend(true, {}, this.options); + for(var i = 0; i < keys.length; i++) { + if(opt[keys[i]] !== undefined) { + opt = opt[keys[i]]; + } else { + this._warning( { + type: $.jPlayer.warning.OPTION_KEY, + context: key, + message: $.jPlayer.warningMsg.OPTION_KEY, + hint: $.jPlayer.warningHint.OPTION_KEY + }); + return undefined; + } + } + return opt; + } + + // Enables use: options("someOptionObject", someObject}). Creates: {someOptionObject:someObject} + // Enables use: options("someOption", someValue). Creates: {someOption:someValue} + // Enables use: options("someOptionObject.someOption", someValue). Creates: {someOptionObject:{someOption:someValue}} + + options = {}; + var opts = options; + + for(var j = 0; j < keys.length; j++) { + if(j < keys.length - 1) { + opts[keys[j]] = {}; + opts = opts[keys[j]]; + } else { + opts[keys[j]] = value; + } + } + } + + // Otherwise enables use: options(optionObject). Uses original object (the key) + + this._setOptions(options); + + return this; + }, + _setOptions: function(options) { + var self = this; + $.each(options, function(key, value) { // This supports the 2 level depth that the options of jPlayer has. Would review if we ever need more depth. + self._setOption(key, value); + }); + + return this; + }, + _setOption: function(key, value) { + var self = this; + + // The ability to set options is limited at this time. + + switch(key) { + case "volume" : + this.volume(value); + break; + case "muted" : + this._muted(value); + break; + case "globalVolume" : + this.options[key] = value; + break; + case "cssSelectorAncestor" : + this._cssSelectorAncestor(value); // Set and refresh all associations for the new ancestor. + break; + case "cssSelector" : + $.each(value, function(fn, cssSel) { + self._cssSelector(fn, cssSel); // NB: The option is set inside this function, after further validity checks. + }); + break; + case "playbackRate" : + this.options[key] = value = this._limitValue(value, this.options.minPlaybackRate, this.options.maxPlaybackRate); + if(this.html.used) { + this._html_setProperty('playbackRate', value); + } + this._updatePlaybackRate(); + break; + case "defaultPlaybackRate" : + this.options[key] = value = this._limitValue(value, this.options.minPlaybackRate, this.options.maxPlaybackRate); + if(this.html.used) { + this._html_setProperty('defaultPlaybackRate', value); + } + this._updatePlaybackRate(); + break; + case "minPlaybackRate" : + this.options[key] = value = this._limitValue(value, 0.1, this.options.maxPlaybackRate - 0.1); + this._updatePlaybackRate(); + break; + case "maxPlaybackRate" : + this.options[key] = value = this._limitValue(value, this.options.minPlaybackRate + 0.1, 16); + this._updatePlaybackRate(); + break; + case "fullScreen" : + if(this.options[key] !== value) { // if changed + var wkv = $.jPlayer.nativeFeatures.fullscreen.used.webkitVideo; + if(!wkv || wkv && !this.status.waitForPlay) { + if(!wkv) { // No sensible way to unset option on these devices. + this.options[key] = value; + } + if(value) { + this._requestFullscreen(); + } else { + this._exitFullscreen(); + } + if(!wkv) { + this._setOption("fullWindow", value); + } + } + } + break; + case "fullWindow" : + if(this.options[key] !== value) { // if changed + this._removeUiClass(); + this.options[key] = value; + this._refreshSize(); + } + break; + case "size" : + if(!this.options.fullWindow && this.options[key].cssClass !== value.cssClass) { + this._removeUiClass(); + } + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this._refreshSize(); + break; + case "sizeFull" : + if(this.options.fullWindow && this.options[key].cssClass !== value.cssClass) { + this._removeUiClass(); + } + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this._refreshSize(); + break; + case "autohide" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this._updateAutohide(); + break; + case "loop" : + this._loop(value); + break; + case "remainingDuration" : + this.options[key] = value; + this._updateInterface(); + break; + case "toggleDuration" : + this.options[key] = value; + break; + case "nativeVideoControls" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this.status.nativeVideoControls = this._uaBlocklist(this.options.nativeVideoControls); + this._restrictNativeVideoControls(); + this._updateNativeVideoControls(); + break; + case "noFullWindow" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this.status.nativeVideoControls = this._uaBlocklist(this.options.nativeVideoControls); // Need to check again as noFullWindow can depend on this flag and the restrict() can override it. + this.status.noFullWindow = this._uaBlocklist(this.options.noFullWindow); + this._restrictNativeVideoControls(); + this._updateButtons(); + break; + case "noVolume" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this.status.noVolume = this._uaBlocklist(this.options.noVolume); + this._updateVolume(); + this._updateMute(); + break; + case "emulateHtml" : + if(this.options[key] !== value) { // To avoid multiple event handlers being created, if true already. + this.options[key] = value; + if(value) { + this._emulateHtmlBridge(); + } else { + this._destroyHtmlBridge(); + } + } + break; + case "timeFormat" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + break; + case "keyEnabled" : + this.options[key] = value; + if(!value && this === $.jPlayer.focus) { + $.jPlayer.focus = null; + } + break; + case "keyBindings" : + this.options[key] = $.extend(true, {}, this.options[key], value); // store a merged DEEP copy of it, incase not all properties changed. + break; + case "audioFullScreen" : + this.options[key] = value; + break; + case "autoBlur" : + this.options[key] = value; + break; + } + + return this; + }, + // End of: (Options code adapted from ui.widget.js) + + _refreshSize: function() { + this._setSize(); // update status and jPlayer element size + this._addUiClass(); // update the ui class + this._updateSize(); // update internal sizes + this._updateButtons(); + this._updateAutohide(); + this._trigger($.jPlayer.event.resize); + }, + _setSize: function() { + // Determine the current size from the options + if(this.options.fullWindow) { + this.status.width = this.options.sizeFull.width; + this.status.height = this.options.sizeFull.height; + this.status.cssClass = this.options.sizeFull.cssClass; + } else { + this.status.width = this.options.size.width; + this.status.height = this.options.size.height; + this.status.cssClass = this.options.size.cssClass; + } + + // Set the size of the jPlayer area. + this.element.css({'width': this.status.width, 'height': this.status.height}); + }, + _addUiClass: function() { + if(this.ancestorJq.length) { + this.ancestorJq.addClass(this.status.cssClass); + } + }, + _removeUiClass: function() { + if(this.ancestorJq.length) { + this.ancestorJq.removeClass(this.status.cssClass); + } + }, + _updateSize: function() { + // The poster uses show/hide so can simply resize it. + this.internal.poster.jq.css({'width': this.status.width, 'height': this.status.height}); + + // Video html or flash resized if necessary at this time, or if native video controls being used. + if(!this.status.waitForPlay && this.html.active && this.status.video || this.html.video.available && this.html.used && this.status.nativeVideoControls) { + this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height}); + } + else if(!this.status.waitForPlay && this.flash.active && this.status.video) { + this.internal.flash.jq.css({'width': this.status.width, 'height': this.status.height}); + } + }, + _updateAutohide: function() { + var self = this, + event = "mousemove.jPlayer", + namespace = ".jPlayerAutohide", + eventType = event + namespace, + handler = function(event) { + var moved = false, + deltaX, deltaY; + if(typeof self.internal.mouse !== "undefined") { + //get the change from last position to this position + deltaX = self.internal.mouse.x - event.pageX; + deltaY = self.internal.mouse.y - event.pageY; + moved = (Math.floor(deltaX) > 0) || (Math.floor(deltaY)>0); + } else { + moved = true; + } + // store current position for next method execution + self.internal.mouse = { + x : event.pageX, + y : event.pageY + }; + // if mouse has been actually moved, do the gui fadeIn/fadeOut + if (moved) { + self.css.jq.gui.fadeIn(self.options.autohide.fadeIn, function() { + clearTimeout(self.internal.autohideId); + self.internal.autohideId = setTimeout( function() { + self.css.jq.gui.fadeOut(self.options.autohide.fadeOut); + }, self.options.autohide.hold); + }); + } + }; + + if(this.css.jq.gui.length) { + + // End animations first so that its callback is executed now. + // Otherwise an in progress fadeIn animation still has the callback to fadeOut again. + this.css.jq.gui.stop(true, true); + + // Removes the fadeOut operation from the fadeIn callback. + clearTimeout(this.internal.autohideId); + // undefine mouse + delete this.internal.mouse; + + this.element.unbind(namespace); + this.css.jq.gui.unbind(namespace); + + if(!this.status.nativeVideoControls) { + if(this.options.fullWindow && this.options.autohide.full || !this.options.fullWindow && this.options.autohide.restored) { + this.element.bind(eventType, handler); + this.css.jq.gui.bind(eventType, handler); + this.css.jq.gui.hide(); + } else { + this.css.jq.gui.show(); + } + } else { + this.css.jq.gui.hide(); + } + } + }, + fullScreen: function(event) { + var guiAction = typeof event === "object"; // Flags GUI click events so we know this was not a direct command, but an action taken by the user on the GUI. + if(guiAction && this.options.useStateClassSkin && this.options.fullScreen) { + this._setOption("fullScreen", false); + } else { + this._setOption("fullScreen", true); + } + }, + restoreScreen: function() { + this._setOption("fullScreen", false); + }, + _fullscreenAddEventListeners: function() { + var self = this, + fs = $.jPlayer.nativeFeatures.fullscreen; + + if(fs.api.fullscreenEnabled) { + if(fs.event.fullscreenchange) { + // Create the event handler function and store it for removal. + if(typeof this.internal.fullscreenchangeHandler !== 'function') { + this.internal.fullscreenchangeHandler = function() { + self._fullscreenchange(); + }; + } + document.addEventListener(fs.event.fullscreenchange, this.internal.fullscreenchangeHandler, false); + } + // No point creating handler for fullscreenerror. + // Either logic avoids fullscreen occurring (w3c/moz), or their is no event on the browser (webkit). + } + }, + _fullscreenRemoveEventListeners: function() { + var fs = $.jPlayer.nativeFeatures.fullscreen; + if(this.internal.fullscreenchangeHandler) { + document.removeEventListener(fs.event.fullscreenchange, this.internal.fullscreenchangeHandler, false); + } + }, + _fullscreenchange: function() { + // If nothing is fullscreen, then we cannot be in fullscreen mode. + if(this.options.fullScreen && !$.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()) { + this._setOption("fullScreen", false); + } + }, + _requestFullscreen: function() { + // Either the container or the jPlayer div + var e = this.ancestorJq.length ? this.ancestorJq[0] : this.element[0], + fs = $.jPlayer.nativeFeatures.fullscreen; + + // This method needs the video element. For iOS and Android. + if(fs.used.webkitVideo) { + e = this.htmlElement.video; + } + + if(fs.api.fullscreenEnabled) { + fs.api.requestFullscreen(e); + } + }, + _exitFullscreen: function() { + + var fs = $.jPlayer.nativeFeatures.fullscreen, + e; + + // This method needs the video element. For iOS and Android. + if(fs.used.webkitVideo) { + e = this.htmlElement.video; + } + + if(fs.api.fullscreenEnabled) { + fs.api.exitFullscreen(e); + } + }, + _html_initMedia: function(media) { + // Remove any existing track elements + var $media = $(this.htmlElement.media).empty(); + + // Create any track elements given with the media, as an Array of track Objects. + $.each(media.track || [], function(i,v) { + var track = document.createElement('track'); + track.setAttribute("kind", v.kind ? v.kind : ""); + track.setAttribute("src", v.src ? v.src : ""); + track.setAttribute("srclang", v.srclang ? v.srclang : ""); + track.setAttribute("label", v.label ? v.label : ""); + if(v.def) { + track.setAttribute("default", v.def); + } + $media.append(track); + }); + + this.htmlElement.media.src = this.status.src; + + if(this.options.preload !== 'none') { + this._html_load(); // See function for comments + } + this._trigger($.jPlayer.event.timeupdate); // The flash generates this event for its solution. + }, + _html_setFormat: function(media) { + var self = this; + // Always finds a format due to checks in setMedia() + $.each(this.formats, function(priority, format) { + if(self.html.support[format] && media[format]) { + self.status.src = media[format]; + self.status.format[format] = true; + self.status.formatType = format; + return false; + } + }); + }, + _html_setAudio: function(media) { + this._html_setFormat(media); + this.htmlElement.media = this.htmlElement.audio; + this._html_initMedia(media); + }, + _html_setVideo: function(media) { + this._html_setFormat(media); + if(this.status.nativeVideoControls) { + this.htmlElement.video.poster = this._validString(media.poster) ? media.poster : ""; + } + this.htmlElement.media = this.htmlElement.video; + this._html_initMedia(media); + }, + _html_resetMedia: function() { + if(this.htmlElement.media) { + if(this.htmlElement.media.id === this.internal.video.id && !this.status.nativeVideoControls) { + this.internal.video.jq.css({'width':'0px', 'height':'0px'}); + } + this.htmlElement.media.pause(); + } + }, + _html_clearMedia: function() { + if(this.htmlElement.media) { + this.htmlElement.media.src = "about:blank"; + // The following load() is only required for Firefox 3.6 (PowerMacs). + // Recent HTMl5 browsers only require the src change. Due to changes in W3C spec and load() effect. + this.htmlElement.media.load(); // Stops an old, "in progress" download from continuing the download. Triggers the loadstart, error and emptied events, due to the empty src. Also an abort event if a download was in progress. + } + }, + _html_load: function() { + // This function remains to allow the early HTML5 browsers to work, such as Firefox 3.6 + // A change in the W3C spec for the media.load() command means that this is no longer necessary. + // This command should be removed and actually causes minor undesirable effects on some browsers. Such as loading the whole file and not only the metadata. + if(this.status.waitForLoad) { + this.status.waitForLoad = false; + this.htmlElement.media.load(); + } + clearTimeout(this.internal.htmlDlyCmdId); + }, + _html_play: function(time) { + var self = this, + media = this.htmlElement.media; + + this.androidFix.pause = false; // Cancel the pause fix. + + this._html_load(); // Loads if required and clears any delayed commands. + + // Setup the Android Fix. + if(this.androidFix.setMedia) { + this.androidFix.play = true; + this.androidFix.time = time; + + } else if(!isNaN(time)) { + + // Attempt to play it, since iOS has been ignoring commands + if(this.internal.cmdsIgnored) { + media.play(); + } + + try { + // !media.seekable is for old HTML5 browsers, like Firefox 3.6. + // Checking seekable.length is important for iOS6 to work with setMedia().play(time) + if(!media.seekable || typeof media.seekable === "object" && media.seekable.length > 0) { + media.currentTime = time; + media.play(); + } else { + throw 1; + } + } catch(err) { + this.internal.htmlDlyCmdId = setTimeout(function() { + self.play(time); + }, 250); + return; // Cancel execution and wait for the delayed command. + } + } else { + media.play(); + } + this._html_checkWaitForPlay(); + }, + _html_pause: function(time) { + var self = this, + media = this.htmlElement.media; + + this.androidFix.play = false; // Cancel the play fix. + + if(time > 0) { // We do not want the stop() command, which does pause(0), causing a load operation. + this._html_load(); // Loads if required and clears any delayed commands. + } else { + clearTimeout(this.internal.htmlDlyCmdId); + } + + // Order of these commands is important for Safari (Win) and IE9. Pause then change currentTime. + media.pause(); + + // Setup the Android Fix. + if(this.androidFix.setMedia) { + this.androidFix.pause = true; + this.androidFix.time = time; + + } else if(!isNaN(time)) { + try { + if(!media.seekable || typeof media.seekable === "object" && media.seekable.length > 0) { + media.currentTime = time; + } else { + throw 1; + } + } catch(err) { + this.internal.htmlDlyCmdId = setTimeout(function() { + self.pause(time); + }, 250); + return; // Cancel execution and wait for the delayed command. + } + } + if(time > 0) { // Avoids a setMedia() followed by stop() or pause(0) hiding the video play button. + this._html_checkWaitForPlay(); + } + }, + _html_playHead: function(percent) { + var self = this, + media = this.htmlElement.media; + + this._html_load(); // Loads if required and clears any delayed commands. + + // This playHead() method needs a refactor to apply the android fix. + + try { + if(typeof media.seekable === "object" && media.seekable.length > 0) { + media.currentTime = percent * media.seekable.end(media.seekable.length-1) / 100; + } else if(media.duration > 0 && !isNaN(media.duration)) { + media.currentTime = percent * media.duration / 100; + } else { + throw "e"; + } + } catch(err) { + this.internal.htmlDlyCmdId = setTimeout(function() { + self.playHead(percent); + }, 250); + return; // Cancel execution and wait for the delayed command. + } + if(!this.status.waitForLoad) { + this._html_checkWaitForPlay(); + } + }, + _html_checkWaitForPlay: function() { + if(this.status.waitForPlay) { + this.status.waitForPlay = false; + if(this.css.jq.videoPlay.length) { + this.css.jq.videoPlay.hide(); + } + if(this.status.video) { + this.internal.poster.jq.hide(); + this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height}); + } + } + }, + _html_setProperty: function(property, value) { + if(this.html.audio.available) { + this.htmlElement.audio[property] = value; + } + if(this.html.video.available) { + this.htmlElement.video[property] = value; + } + }, + _aurora_setAudio: function(media) { + var self = this; + + // Always finds a format due to checks in setMedia() + $.each(this.formats, function(priority, format) { + if(self.aurora.support[format] && media[format]) { + self.status.src = media[format]; + self.status.format[format] = true; + self.status.formatType = format; + + return false; + } + }); + + this.aurora.player = new AV.Player.fromURL(this.status.src); + this._addAuroraEventListeners(this.aurora.player, this.aurora); + + if(this.options.preload === 'auto') { + this._aurora_load(); + this.status.waitForLoad = false; + } + }, + _aurora_resetMedia: function() { + if (this.aurora.player) { + this.aurora.player.stop(); + } + }, + _aurora_clearMedia: function() { + // Nothing to clear. + }, + _aurora_load: function() { + if(this.status.waitForLoad) { + this.status.waitForLoad = false; + this.aurora.player.preload(); + } + }, + _aurora_play: function(time) { + if (!this.status.waitForLoad) { + if (!isNaN(time)) { + this.aurora.player.seek(time); + } + } + if (!this.aurora.player.playing) { + this.aurora.player.play(); + } + this.status.waitForLoad = false; + this._aurora_checkWaitForPlay(); + + // No event from the player, update UI now. + this._updateButtons(true); + this._trigger($.jPlayer.event.play); + }, + _aurora_pause: function(time) { + if (!isNaN(time)) { + this.aurora.player.seek(time * 1000); + } + this.aurora.player.pause(); + + if(time > 0) { // Avoids a setMedia() followed by stop() or pause(0) hiding the video play button. + this._aurora_checkWaitForPlay(); + } + + // No event from the player, update UI now. + this._updateButtons(false); + this._trigger($.jPlayer.event.pause); + }, + _aurora_playHead: function(percent) { + if(this.aurora.player.duration > 0) { + // The seek() sould be in milliseconds, but the only codec that works with seek (aac.js) uses seconds. + this.aurora.player.seek(percent * this.aurora.player.duration / 100); // Using seconds + } + + if(!this.status.waitForLoad) { + this._aurora_checkWaitForPlay(); + } + }, + _aurora_checkWaitForPlay: function() { + if(this.status.waitForPlay) { + this.status.waitForPlay = false; + } + }, + _aurora_volume: function(v) { + this.aurora.player.volume = v * 100; + }, + _aurora_mute: function(m) { + if (m) { + this.aurora.properties.lastvolume = this.aurora.player.volume; + this.aurora.player.volume = 0; + } else { + this.aurora.player.volume = this.aurora.properties.lastvolume; + } + this.aurora.properties.muted = m; + }, + _flash_setAudio: function(media) { + var self = this; + try { + // Always finds a format due to checks in setMedia() + $.each(this.formats, function(priority, format) { + if(self.flash.support[format] && media[format]) { + switch (format) { + case "m4a" : + case "fla" : + self._getMovie().fl_setAudio_m4a(media[format]); + break; + case "mp3" : + self._getMovie().fl_setAudio_mp3(media[format]); + break; + case "rtmpa": + self._getMovie().fl_setAudio_rtmp(media[format]); + break; + } + self.status.src = media[format]; + self.status.format[format] = true; + self.status.formatType = format; + return false; + } + }); + + if(this.options.preload === 'auto') { + this._flash_load(); + this.status.waitForLoad = false; + } + } catch(err) { this._flashError(err); } + }, + _flash_setVideo: function(media) { + var self = this; + try { + // Always finds a format due to checks in setMedia() + $.each(this.formats, function(priority, format) { + if(self.flash.support[format] && media[format]) { + switch (format) { + case "m4v" : + case "flv" : + self._getMovie().fl_setVideo_m4v(media[format]); + break; + case "rtmpv": + self._getMovie().fl_setVideo_rtmp(media[format]); + break; + } + self.status.src = media[format]; + self.status.format[format] = true; + self.status.formatType = format; + return false; + } + }); + + if(this.options.preload === 'auto') { + this._flash_load(); + this.status.waitForLoad = false; + } + } catch(err) { this._flashError(err); } + }, + _flash_resetMedia: function() { + this.internal.flash.jq.css({'width':'0px', 'height':'0px'}); // Must do via CSS as setting attr() to zero causes a jQuery error in IE. + this._flash_pause(NaN); + }, + _flash_clearMedia: function() { + try { + this._getMovie().fl_clearMedia(); + } catch(err) { this._flashError(err); } + }, + _flash_load: function() { + try { + this._getMovie().fl_load(); + } catch(err) { this._flashError(err); } + this.status.waitForLoad = false; + }, + _flash_play: function(time) { + try { + this._getMovie().fl_play(time); + } catch(err) { this._flashError(err); } + this.status.waitForLoad = false; + this._flash_checkWaitForPlay(); + }, + _flash_pause: function(time) { + try { + this._getMovie().fl_pause(time); + } catch(err) { this._flashError(err); } + if(time > 0) { // Avoids a setMedia() followed by stop() or pause(0) hiding the video play button. + this.status.waitForLoad = false; + this._flash_checkWaitForPlay(); + } + }, + _flash_playHead: function(p) { + try { + this._getMovie().fl_play_head(p); + } catch(err) { this._flashError(err); } + if(!this.status.waitForLoad) { + this._flash_checkWaitForPlay(); + } + }, + _flash_checkWaitForPlay: function() { + if(this.status.waitForPlay) { + this.status.waitForPlay = false; + if(this.css.jq.videoPlay.length) { + this.css.jq.videoPlay.hide(); + } + if(this.status.video) { + this.internal.poster.jq.hide(); + this.internal.flash.jq.css({'width': this.status.width, 'height': this.status.height}); + } + } + }, + _flash_volume: function(v) { + try { + this._getMovie().fl_volume(v); + } catch(err) { this._flashError(err); } + }, + _flash_mute: function(m) { + try { + this._getMovie().fl_mute(m); + } catch(err) { this._flashError(err); } + }, + _getMovie: function() { + return document[this.internal.flash.id]; + }, + _getFlashPluginVersion: function() { + + // _getFlashPluginVersion() code influenced by: + // - FlashReplace 1.01: http://code.google.com/p/flashreplace/ + // - SWFObject 2.2: http://code.google.com/p/swfobject/ + + var version = 0, + flash; + if(window.ActiveXObject) { + try { + flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); + if (flash) { // flash will return null when ActiveX is disabled + var v = flash.GetVariable("$version"); + if(v) { + v = v.split(" ")[1].split(","); + version = parseInt(v[0], 10) + "." + parseInt(v[1], 10); + } + } + } catch(e) {} + } + else if(navigator.plugins && navigator.mimeTypes.length > 0) { + flash = navigator.plugins["Shockwave Flash"]; + if(flash) { + version = navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/, "$1"); + } + } + return version * 1; // Converts to a number + }, + _checkForFlash: function (version) { + var flashOk = false; + if(this._getFlashPluginVersion() >= version) { + flashOk = true; + } + return flashOk; + }, + _validString: function(url) { + return (url && typeof url === "string"); // Empty strings return false + }, + _limitValue: function(value, min, max) { + return (value < min) ? min : ((value > max) ? max : value); + }, + _urlNotSetError: function(context) { + this._error( { + type: $.jPlayer.error.URL_NOT_SET, + context: context, + message: $.jPlayer.errorMsg.URL_NOT_SET, + hint: $.jPlayer.errorHint.URL_NOT_SET + }); + }, + _flashError: function(error) { + var errorType; + if(!this.internal.ready) { + errorType = "FLASH"; + } else { + errorType = "FLASH_DISABLED"; + } + this._error( { + type: $.jPlayer.error[errorType], + context: this.internal.flash.swf, + message: $.jPlayer.errorMsg[errorType] + error.message, + hint: $.jPlayer.errorHint[errorType] + }); + // Allow the audio player to recover if display:none and then shown again, or with position:fixed on Firefox. + // This really only affects audio in a media player, as an audio player could easily move the jPlayer element away from such issues. + this.internal.flash.jq.css({'width':'1px', 'height':'1px'}); + }, + _error: function(error) { + this._trigger($.jPlayer.event.error, error); + if(this.options.errorAlerts) { + this._alert("Error!" + (error.message ? "\n" + error.message : "") + (error.hint ? "\n" + error.hint : "") + "\nContext: " + error.context); + } + }, + _warning: function(warning) { + this._trigger($.jPlayer.event.warning, undefined, warning); + if(this.options.warningAlerts) { + this._alert("Warning!" + (warning.message ? "\n" + warning.message : "") + (warning.hint ? "\n" + warning.hint : "") + "\nContext: " + warning.context); + } + }, + _alert: function(message) { + var msg = "jPlayer " + this.version.script + " : id='" + this.internal.self.id +"' : " + message; + if(!this.options.consoleAlerts) { + alert(msg); + } else if(window.console && window.console.log) { + window.console.log(msg); + } + }, + _emulateHtmlBridge: function() { + var self = this; + + // Emulate methods on jPlayer's DOM element. + $.each( $.jPlayer.emulateMethods.split(/\s+/g), function(i, name) { + self.internal.domNode[name] = function(arg) { + self[name](arg); + }; + + }); + + // Bubble jPlayer events to its DOM element. + $.each($.jPlayer.event, function(eventName,eventType) { + var nativeEvent = true; + $.each( $.jPlayer.reservedEvent.split(/\s+/g), function(i, name) { + if(name === eventName) { + nativeEvent = false; + return false; + } + }); + if(nativeEvent) { + self.element.bind(eventType + ".jPlayer.jPlayerHtml", function() { // With .jPlayer & .jPlayerHtml namespaces. + self._emulateHtmlUpdate(); + var domEvent = document.createEvent("Event"); + domEvent.initEvent(eventName, false, true); + self.internal.domNode.dispatchEvent(domEvent); + }); + } + // The error event would require a special case + }); + + // IE9 has a readyState property on all elements. The document should have it, but all (except media) elements inherit it in IE9. This conflicts with Popcorn, which polls the readyState. + }, + _emulateHtmlUpdate: function() { + var self = this; + + $.each( $.jPlayer.emulateStatus.split(/\s+/g), function(i, name) { + self.internal.domNode[name] = self.status[name]; + }); + $.each( $.jPlayer.emulateOptions.split(/\s+/g), function(i, name) { + self.internal.domNode[name] = self.options[name]; + }); + }, + _destroyHtmlBridge: function() { + var self = this; + + // Bridge event handlers are also removed by destroy() through .jPlayer namespace. + this.element.unbind(".jPlayerHtml"); // Remove all event handlers created by the jPlayer bridge. So you can change the emulateHtml option. + + // Remove the methods and properties + var emulated = $.jPlayer.emulateMethods + " " + $.jPlayer.emulateStatus + " " + $.jPlayer.emulateOptions; + $.each( emulated.split(/\s+/g), function(i, name) { + delete self.internal.domNode[name]; + }); + } + }; + + $.jPlayer.error = { + FLASH: "e_flash", + FLASH_DISABLED: "e_flash_disabled", + NO_SOLUTION: "e_no_solution", + NO_SUPPORT: "e_no_support", + URL: "e_url", + URL_NOT_SET: "e_url_not_set", + VERSION: "e_version" + }; + + $.jPlayer.errorMsg = { + FLASH: "jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ", // Used in: _flashError() + FLASH_DISABLED: "jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ", // Used in: _flashError() + NO_SOLUTION: "No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.", // Used in: _init() + NO_SUPPORT: "It is not possible to play any media format provided in setMedia() on this browser using your current options.", // Used in: setMedia() + URL: "Media URL could not be loaded.", // Used in: jPlayerFlashEvent() and _addHtmlEventListeners() + URL_NOT_SET: "Attempt to issue media playback commands, while no media url is set.", // Used in: load(), play(), pause(), stop() and playHead() + VERSION: "jPlayer " + $.jPlayer.prototype.version.script + " needs Jplayer.swf version " + $.jPlayer.prototype.version.needFlash + " but found " // Used in: jPlayerReady() + }; + + $.jPlayer.errorHint = { + FLASH: "Check your swfPath option and that Jplayer.swf is there.", + FLASH_DISABLED: "Check that you have not display:none; the jPlayer entity or any ancestor.", + NO_SOLUTION: "Review the jPlayer options: support and supplied.", + NO_SUPPORT: "Video or audio formats defined in the supplied option are missing.", + URL: "Check media URL is valid.", + URL_NOT_SET: "Use setMedia() to set the media URL.", + VERSION: "Update jPlayer files." + }; + + $.jPlayer.warning = { + CSS_SELECTOR_COUNT: "e_css_selector_count", + CSS_SELECTOR_METHOD: "e_css_selector_method", + CSS_SELECTOR_STRING: "e_css_selector_string", + OPTION_KEY: "e_option_key" + }; + + $.jPlayer.warningMsg = { + CSS_SELECTOR_COUNT: "The number of css selectors found did not equal one: ", + CSS_SELECTOR_METHOD: "The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.", + CSS_SELECTOR_STRING: "The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.", + OPTION_KEY: "The option requested in jPlayer('option') is undefined." + }; + + $.jPlayer.warningHint = { + CSS_SELECTOR_COUNT: "Check your css selector and the ancestor.", + CSS_SELECTOR_METHOD: "Check your method name.", + CSS_SELECTOR_STRING: "Check your css selector is a string.", + OPTION_KEY: "Check your option name." + }; +})); diff --git a/components/jplayer/jplayer-built.js b/components/jplayer/jplayer-built.js new file mode 100644 index 0000000..842f31b --- /dev/null +++ b/components/jplayer/jplayer-built.js @@ -0,0 +1,3506 @@ +/* + * jPlayer Plugin for jQuery JavaScript Library + * http://www.jplayer.org + * + * Copyright (c) 2009 - 2014 Happyworm Ltd + * Licensed under the MIT license. + * http://opensource.org/licenses/MIT + * + * Author: Mark J Panaghiston + * Version: 2.9.2 + * Date: 14th December 2014 + */ + +/* Support for Zepto 1.0 compiled with optional data module. + * For AMD or NODE/CommonJS support, you will need to manually switch the related 2 lines in the code below. + * Search terms: "jQuery Switch" and "Zepto Switch" + */ + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); // jQuery Switch + // define(['zepto'], factory); // Zepto Switch + } else if (typeof exports === 'object') { + // Node/CommonJS + factory(require('jquery')); // jQuery Switch + //factory(require('zepto')); // Zepto Switch + } else { + // Browser globals + if(root.jQuery) { // Use jQuery if available + factory(root.jQuery); + } else { // Otherwise, use Zepto + factory(root.Zepto); + } + } +}(this, function ($, undefined) { + + // Adapted from jquery.ui.widget.js (1.8.7): $.widget.bridge - Tweaked $.data(this,XYZ) to $(this).data(XYZ) for Zepto + $.fn.jPlayer = function( options ) { + var name = "jPlayer"; + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.charAt( 0 ) === "_" ) { + return returnValue; + } + + if ( isMethodCall ) { + this.each(function() { + var instance = $(this).data( name ), + methodValue = instance && $.isFunction( instance[options] ) ? + instance[ options ].apply( instance, args ) : + instance; + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $(this).data( name ); + if ( instance ) { + // instance.option( options || {} )._init(); // Orig jquery.ui.widget.js code: Not recommend for jPlayer. ie., Applying new options to an existing instance (via the jPlayer constructor) and performing the _init(). The _init() is what concerns me. It would leave a lot of event handlers acting on jPlayer instance and the interface. + instance.option( options || {} ); // The new constructor only changes the options. Changing options only has basic support atm. + } else { + $(this).data( name, new $.jPlayer( options, this ) ); + } + }); + } + + return returnValue; + }; + + $.jPlayer = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this.element = $(element); + this.options = $.extend(true, {}, + this.options, + options + ); + var self = this; + this.element.bind( "remove.jPlayer", function() { + self.destroy(); + }); + this._init(); + } + }; + // End of: (Adapted from jquery.ui.widget.js (1.8.7)) + + // Zepto is missing one of the animation methods. + if(typeof $.fn.stop !== 'function') { + $.fn.stop = function() {}; + } + + // Emulated HTML5 methods and properties + $.jPlayer.emulateMethods = "load play pause"; + $.jPlayer.emulateStatus = "src readyState networkState currentTime duration paused ended playbackRate"; + $.jPlayer.emulateOptions = "muted volume"; + + // Reserved event names generated by jPlayer that are not part of the HTML5 Media element spec + $.jPlayer.reservedEvent = "ready flashreset resize repeat error warning"; + + // Events generated by jPlayer + $.jPlayer.event = {}; + $.each( + [ + 'ready', + 'setmedia', // Fires when the media is set + 'flashreset', // Similar to the ready event if the Flash solution is set to display:none and then shown again or if it's reloaded for another reason by the browser. For example, using CSS position:fixed on Firefox for the full screen feature. + 'resize', // Occurs when the size changes through a full/restore screen operation or if the size/sizeFull options are changed. + 'repeat', // Occurs when the repeat status changes. Usually through clicks on the repeat button of the interface. + 'click', // Occurs when the user clicks on one of the following: poster image, html video, flash video. + 'error', // Event error code in event.jPlayer.error.type. See $.jPlayer.error + 'warning', // Event warning code in event.jPlayer.warning.type. See $.jPlayer.warning + + // Other events match HTML5 spec. + 'loadstart', + 'progress', + 'suspend', + 'abort', + 'emptied', + 'stalled', + 'play', + 'pause', + 'loadedmetadata', + 'loadeddata', + 'waiting', + 'playing', + 'canplay', + 'canplaythrough', + 'seeking', + 'seeked', + 'timeupdate', + 'ended', + 'ratechange', + 'durationchange', + 'volumechange' + ], + function() { + $.jPlayer.event[ this ] = 'jPlayer_' + this; + } + ); + + $.jPlayer.htmlEvent = [ // These HTML events are bubbled through to the jPlayer event, without any internal action. + "loadstart", + // "progress", // jPlayer uses internally before bubbling. + // "suspend", // jPlayer uses internally before bubbling. + "abort", + // "error", // jPlayer uses internally before bubbling. + "emptied", + "stalled", + // "play", // jPlayer uses internally before bubbling. + // "pause", // jPlayer uses internally before bubbling. + "loadedmetadata", + // "loadeddata", // jPlayer uses internally before bubbling. + // "waiting", // jPlayer uses internally before bubbling. + // "playing", // jPlayer uses internally before bubbling. + "canplay", + "canplaythrough" + // "seeking", // jPlayer uses internally before bubbling. + // "seeked", // jPlayer uses internally before bubbling. + // "timeupdate", // jPlayer uses internally before bubbling. + // "ended", // jPlayer uses internally before bubbling. + // "ratechange" // jPlayer uses internally before bubbling. + // "durationchange" // jPlayer uses internally before bubbling. + // "volumechange" // jPlayer uses internally before bubbling. + ]; + + $.jPlayer.pause = function() { + $.jPlayer.prototype.destroyRemoved(); + $.each($.jPlayer.prototype.instances, function(i, element) { + if(element.data("jPlayer").status.srcSet) { // Check that media is set otherwise would cause error event. + element.jPlayer("pause"); + } + }); + }; + + // Default for jPlayer option.timeFormat + $.jPlayer.timeFormat = { + showHour: false, + showMin: true, + showSec: true, + padHour: false, + padMin: true, + padSec: true, + sepHour: ":", + sepMin: ":", + sepSec: "" + }; + var ConvertTime = function() { + this.init(); + }; + ConvertTime.prototype = { + init: function() { + this.options = { + timeFormat: $.jPlayer.timeFormat + }; + }, + time: function(s) { // function used on jPlayer.prototype._convertTime to enable per instance options. + s = (s && typeof s === 'number') ? s : 0; + + var myTime = new Date(s * 1000), + hour = myTime.getUTCHours(), + min = this.options.timeFormat.showHour ? myTime.getUTCMinutes() : myTime.getUTCMinutes() + hour * 60, + sec = this.options.timeFormat.showMin ? myTime.getUTCSeconds() : myTime.getUTCSeconds() + min * 60, + strHour = (this.options.timeFormat.padHour && hour < 10) ? "0" + hour : hour, + strMin = (this.options.timeFormat.padMin && min < 10) ? "0" + min : min, + strSec = (this.options.timeFormat.padSec && sec < 10) ? "0" + sec : sec, + strTime = ""; + + strTime += this.options.timeFormat.showHour ? strHour + this.options.timeFormat.sepHour : ""; + strTime += this.options.timeFormat.showMin ? strMin + this.options.timeFormat.sepMin : ""; + strTime += this.options.timeFormat.showSec ? strSec + this.options.timeFormat.sepSec : ""; + + return strTime; + } + }; + var myConvertTime = new ConvertTime(); + $.jPlayer.convertTime = function(s) { + return myConvertTime.time(s); + }; + + // Adapting jQuery 1.4.4 code for jQuery.browser. Required since jQuery 1.3.2 does not detect Chrome as webkit. + $.jPlayer.uaBrowser = function( userAgent ) { + var ua = userAgent.toLowerCase(); + + // Useragent RegExp + var rwebkit = /(webkit)[ \/]([\w.]+)/; + var ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/; + var rmsie = /(msie) ([\w.]+)/; + var rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/; + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }; + + // Platform sniffer for detecting mobile devices + $.jPlayer.uaPlatform = function( userAgent ) { + var ua = userAgent.toLowerCase(); + + // Useragent RegExp + var rplatform = /(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/; + var rtablet = /(ipad|playbook)/; + var randroid = /(android)/; + var rmobile = /(mobile)/; + + var platform = rplatform.exec( ua ) || []; + var tablet = rtablet.exec( ua ) || + !rmobile.exec( ua ) && randroid.exec( ua ) || + []; + + if(platform[1]) { + platform[1] = platform[1].replace(/\s/g, "_"); // Change whitespace to underscore. Enables dot notation. + } + + return { platform: platform[1] || "", tablet: tablet[1] || "" }; + }; + + $.jPlayer.browser = { + }; + $.jPlayer.platform = { + }; + + var browserMatch = $.jPlayer.uaBrowser(navigator.userAgent); + if ( browserMatch.browser ) { + $.jPlayer.browser[ browserMatch.browser ] = true; + $.jPlayer.browser.version = browserMatch.version; + } + var platformMatch = $.jPlayer.uaPlatform(navigator.userAgent); + if ( platformMatch.platform ) { + $.jPlayer.platform[ platformMatch.platform ] = true; + $.jPlayer.platform.mobile = !platformMatch.tablet; + $.jPlayer.platform.tablet = !!platformMatch.tablet; + } + + // Internet Explorer (IE) Browser Document Mode Sniffer. Based on code at: + // http://msdn.microsoft.com/en-us/library/cc288325%28v=vs.85%29.aspx#GetMode + $.jPlayer.getDocMode = function() { + var docMode; + if ($.jPlayer.browser.msie) { + if (document.documentMode) { // IE8 or later + docMode = document.documentMode; + } else { // IE 5-7 + docMode = 5; // Assume quirks mode unless proven otherwise + if (document.compatMode) { + if (document.compatMode === "CSS1Compat") { + docMode = 7; // standards mode + } + } + } + } + return docMode; + }; + $.jPlayer.browser.documentMode = $.jPlayer.getDocMode(); + + $.jPlayer.nativeFeatures = { + init: function() { + + /* Fullscreen function naming influenced by W3C naming. + * No support for: Mozilla Proposal: https://wiki.mozilla.org/Gecko:FullScreenAPI + */ + + var d = document, + v = d.createElement('video'), + spec = { + // http://www.w3.org/TR/fullscreen/ + w3c: [ + 'fullscreenEnabled', + 'fullscreenElement', + 'requestFullscreen', + 'exitFullscreen', + 'fullscreenchange', + 'fullscreenerror' + ], + // https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode + moz: [ + 'mozFullScreenEnabled', + 'mozFullScreenElement', + 'mozRequestFullScreen', + 'mozCancelFullScreen', + 'mozfullscreenchange', + 'mozfullscreenerror' + ], + // http://developer.apple.com/library/safari/#documentation/WebKit/Reference/ElementClassRef/Element/Element.html + // http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html + webkit: [ + '', + 'webkitCurrentFullScreenElement', + 'webkitRequestFullScreen', + 'webkitCancelFullScreen', + 'webkitfullscreenchange', + '' + ], + // http://developer.apple.com/library/safari/#documentation/AudioVideo/Reference/HTMLVideoElementClassReference/HTMLVideoElement/HTMLVideoElement.html + // https://developer.apple.com/library/safari/samplecode/HTML5VideoEventFlow/Listings/events_js.html#//apple_ref/doc/uid/DTS40010085-events_js-DontLinkElementID_5 + // Events: 'webkitbeginfullscreen' and 'webkitendfullscreen' + webkitVideo: [ + 'webkitSupportsFullscreen', + 'webkitDisplayingFullscreen', + 'webkitEnterFullscreen', + 'webkitExitFullscreen', + '', + '' + ], + ms: [ + '', + 'msFullscreenElement', + 'msRequestFullscreen', + 'msExitFullscreen', + 'MSFullscreenChange', + 'MSFullscreenError' + ] + }, + specOrder = [ + 'w3c', + 'moz', + 'webkit', + 'webkitVideo', + 'ms' + ], + fs, i, il; + + this.fullscreen = fs = { + support: { + w3c: !!d[spec.w3c[0]], + moz: !!d[spec.moz[0]], + webkit: typeof d[spec.webkit[3]] === 'function', + webkitVideo: typeof v[spec.webkitVideo[2]] === 'function', + ms: typeof v[spec.ms[2]] === 'function' + }, + used: {} + }; + + // Store the name of the spec being used and as a handy boolean. + for(i = 0, il = specOrder.length; i < il; i++) { + var n = specOrder[i]; + if(fs.support[n]) { + fs.spec = n; + fs.used[n] = true; + break; + } + } + + if(fs.spec) { + var s = spec[fs.spec]; + fs.api = { + fullscreenEnabled: true, + fullscreenElement: function(elem) { + elem = elem ? elem : d; // Video element required for webkitVideo + return elem[s[1]]; + }, + requestFullscreen: function(elem) { + return elem[s[2]](); // Chrome and Opera want parameter (Element.ALLOW_KEYBOARD_INPUT) but Safari fails if flag used. + }, + exitFullscreen: function(elem) { + elem = elem ? elem : d; // Video element required for webkitVideo + return elem[s[3]](); + } + }; + fs.event = { + fullscreenchange: s[4], + fullscreenerror: s[5] + }; + } else { + fs.api = { + fullscreenEnabled: false, + fullscreenElement: function() { + return null; + }, + requestFullscreen: function() {}, + exitFullscreen: function() {} + }; + fs.event = {}; + } + } + }; + $.jPlayer.nativeFeatures.init(); + + // The keyboard control system. + + // The current jPlayer instance in focus. + $.jPlayer.focus = null; + + // The list of element node names to ignore with key controls. + $.jPlayer.keyIgnoreElementNames = "A INPUT TEXTAREA SELECT BUTTON"; + + // The function that deals with key presses. + var keyBindings = function(event) { + var f = $.jPlayer.focus, + ignoreKey; + + // A jPlayer instance must be in focus. ie., keyEnabled and the last one played. + if(f) { + // What generated the key press? + $.each( $.jPlayer.keyIgnoreElementNames.split(/\s+/g), function(i, name) { + // The strings should already be uppercase. + if(event.target.nodeName.toUpperCase() === name.toUpperCase()) { + ignoreKey = true; + return false; // exit each. + } + }); + if(!ignoreKey) { + // See if the key pressed matches any of the bindings. + $.each(f.options.keyBindings, function(action, binding) { + // The binding could be a null when the default has been disabled. ie., 1st clause in if() + if( + (binding && $.isFunction(binding.fn)) && + ((typeof binding.key === 'number' && event.which === binding.key) || + (typeof binding.key === 'string' && event.key === binding.key)) + ) { + event.preventDefault(); // Key being used by jPlayer, so prevent default operation. + binding.fn(f); + return false; // exit each. + } + }); + } + } + }; + + $.jPlayer.keys = function(en) { + var event = "keydown.jPlayer"; + // Remove any binding, just in case enabled more than once. + $(document.documentElement).unbind(event); + if(en) { + $(document.documentElement).bind(event, keyBindings); + } + }; + + // Enable the global key control handler ready for any jPlayer instance with the keyEnabled option enabled. + $.jPlayer.keys(true); + + $.jPlayer.prototype = { + count: 0, // Static Variable: Change it via prototype. + version: { // Static Object + script: "2.9.2", + needFlash: "2.9.0", + flash: "unknown" + }, + options: { // Instanced in $.jPlayer() constructor + swfPath: "js", // Path to jquery.jplayer.swf. Can be relative, absolute or server root relative. + solution: "html, flash", // Valid solutions: html, flash, aurora. Order defines priority. 1st is highest, + supplied: "mp3", // Defines which formats jPlayer will try and support and the priority by the order. 1st is highest, + auroraFormats: "wav", // List the aurora.js codecs being loaded externally. Its core supports "wav". Specify format in jPlayer context. EG., The aac.js codec gives the "m4a" format. + preload: 'metadata', // HTML5 Spec values: none, metadata, auto. + volume: 0.8, // The volume. Number 0 to 1. + muted: false, + remainingDuration: false, // When true, the remaining time is shown in the duration GUI element. + toggleDuration: false, // When true, clicks on the duration toggle between the duration and remaining display. + captureDuration: true, // When true, clicks on the duration are captured and no longer propagate up the DOM. + playbackRate: 1, + defaultPlaybackRate: 1, + minPlaybackRate: 0.5, + maxPlaybackRate: 4, + wmode: "opaque", // Valid wmode: window, transparent, opaque, direct, gpu. + backgroundColor: "#000000", // To define the jPlayer div and Flash background color. + cssSelectorAncestor: "#jp_container_1", + cssSelector: { // * denotes properties that should only be required when video media type required. _cssSelector() would require changes to enable splitting these into Audio and Video defaults. + videoPlay: ".jp-video-play", // * + play: ".jp-play", + pause: ".jp-pause", + stop: ".jp-stop", + seekBar: ".jp-seek-bar", + playBar: ".jp-play-bar", + mute: ".jp-mute", + unmute: ".jp-unmute", + volumeBar: ".jp-volume-bar", + volumeBarValue: ".jp-volume-bar-value", + volumeMax: ".jp-volume-max", + playbackRateBar: ".jp-playback-rate-bar", + playbackRateBarValue: ".jp-playback-rate-bar-value", + currentTime: ".jp-current-time", + duration: ".jp-duration", + title: ".jp-title", + fullScreen: ".jp-full-screen", // * + restoreScreen: ".jp-restore-screen", // * + repeat: ".jp-repeat", + repeatOff: ".jp-repeat-off", + gui: ".jp-gui", // The interface used with autohide feature. + noSolution: ".jp-no-solution" // For error feedback when jPlayer cannot find a solution. + }, + stateClass: { // Classes added to the cssSelectorAncestor to indicate the state. + playing: "jp-state-playing", + seeking: "jp-state-seeking", + muted: "jp-state-muted", + looped: "jp-state-looped", + fullScreen: "jp-state-full-screen", + noVolume: "jp-state-no-volume" + }, + useStateClassSkin: false, // A state class skin relies on the state classes to change the visual appearance. The single control toggles the effect, for example: play then pause, mute then unmute. + autoBlur: true, // GUI control handlers will drop focus after clicks. + smoothPlayBar: false, // Smooths the play bar transitions, which affects clicks and short media with big changes per second. + fullScreen: false, // Native Full Screen + fullWindow: false, + autohide: { + restored: false, // Controls the interface autohide feature. + full: true, // Controls the interface autohide feature. + fadeIn: 200, // Milliseconds. The period of the fadeIn anim. + fadeOut: 600, // Milliseconds. The period of the fadeOut anim. + hold: 1000 // Milliseconds. The period of the pause before autohide beings. + }, + loop: false, + repeat: function(event) { // The default jPlayer repeat event handler + if(event.jPlayer.options.loop) { + $(this).unbind(".jPlayerRepeat").bind($.jPlayer.event.ended + ".jPlayer.jPlayerRepeat", function() { + $(this).jPlayer("play"); + }); + } else { + $(this).unbind(".jPlayerRepeat"); + } + }, + nativeVideoControls: { + // Works well on standard browsers. + // Phone and tablet browsers can have problems with the controls disappearing. + }, + noFullWindow: { + msie: /msie [0-6]\./, + ipad: /ipad.*?os [0-4]\./, + iphone: /iphone/, + ipod: /ipod/, + android_pad: /android [0-3]\.(?!.*?mobile)/, + android_phone: /(?=.*android)(?!.*chrome)(?=.*mobile)/, + blackberry: /blackberry/, + windows_ce: /windows ce/, + iemobile: /iemobile/, + webos: /webos/ + }, + noVolume: { + ipad: /ipad/, + iphone: /iphone/, + ipod: /ipod/, + android_pad: /android(?!.*?mobile)/, + android_phone: /android.*?mobile/, + blackberry: /blackberry/, + windows_ce: /windows ce/, + iemobile: /iemobile/, + webos: /webos/, + playbook: /playbook/ + }, + timeFormat: { + // Specific time format for this instance. The supported options are defined in $.jPlayer.timeFormat + // For the undefined options we use the default from $.jPlayer.timeFormat + }, + keyEnabled: false, // Enables keyboard controls. + audioFullScreen: false, // Enables keyboard controls to enter full screen with audio media. + keyBindings: { // The key control object, defining the key codes and the functions to execute. + // The parameter, f = $.jPlayer.focus, will be checked truethy before attempting to call any of these functions. + // Properties may be added to this object, in key/fn pairs, to enable other key controls. EG, for the playlist add-on. + play: { + key: 80, // p + fn: function(f) { + if(f.status.paused) { + f.play(); + } else { + f.pause(); + } + } + }, + fullScreen: { + key: 70, // f + fn: function(f) { + if(f.status.video || f.options.audioFullScreen) { + f._setOption("fullScreen", !f.options.fullScreen); + } + } + }, + muted: { + key: 77, // m + fn: function(f) { + f._muted(!f.options.muted); + } + }, + volumeUp: { + key: 190, // . + fn: function(f) { + f.volume(f.options.volume + 0.1); + } + }, + volumeDown: { + key: 188, // , + fn: function(f) { + f.volume(f.options.volume - 0.1); + } + }, + loop: { + key: 76, // l + fn: function(f) { + f._loop(!f.options.loop); + } + } + }, + verticalVolume: false, // Calculate volume from the bottom of the volume bar. Default is from the left. Also volume affects either width or height. + verticalPlaybackRate: false, + globalVolume: false, // Set to make volume and muted changes affect all jPlayer instances with this option enabled + idPrefix: "jp", // Prefix for the ids of html elements created by jPlayer. For flash, this must not include characters: . - + * / \ + noConflict: "jQuery", + emulateHtml: false, // Emulates the HTML5 Media element on the jPlayer element. + consoleAlerts: true, // Alerts are sent to the console.log() instead of alert(). + errorAlerts: false, + warningAlerts: false + }, + optionsAudio: { + size: { + width: "0px", + height: "0px", + cssClass: "" + }, + sizeFull: { + width: "0px", + height: "0px", + cssClass: "" + } + }, + optionsVideo: { + size: { + width: "480px", + height: "270px", + cssClass: "jp-video-270p" + }, + sizeFull: { + width: "100%", + height: "100%", + cssClass: "jp-video-full" + } + }, + instances: {}, // Static Object + status: { // Instanced in _init() + src: "", + media: {}, + paused: true, + format: {}, + formatType: "", + waitForPlay: true, // Same as waitForLoad except in case where preloading. + waitForLoad: true, + srcSet: false, + video: false, // True if playing a video + seekPercent: 0, + currentPercentRelative: 0, + currentPercentAbsolute: 0, + currentTime: 0, + duration: 0, + remaining: 0, + videoWidth: 0, // Intrinsic width of the video in pixels. + videoHeight: 0, // Intrinsic height of the video in pixels. + readyState: 0, + networkState: 0, + playbackRate: 1, // Warning - Now both an option and a status property + ended: 0 + +/* Persistant status properties created dynamically at _init(): + width + height + cssClass + nativeVideoControls + noFullWindow + noVolume + playbackRateEnabled // Warning - Technically, we can have both Flash and HTML, so this might not be correct if the Flash is active. That is a niche case. +*/ + }, + + internal: { // Instanced in _init() + ready: false + // instance: undefined + // domNode: undefined + // htmlDlyCmdId: undefined + // autohideId: undefined + // mouse: undefined + // cmdsIgnored + }, + solution: { // Static Object: Defines the solutions built in jPlayer. + html: true, + aurora: true, + flash: true + }, + // 'MPEG-4 support' : canPlayType('video/mp4; codecs="mp4v.20.8"') + format: { // Static Object + mp3: { + codec: 'audio/mpeg', + flashCanPlay: true, + media: 'audio' + }, + m4a: { // AAC / MP4 + codec: 'audio/mp4; codecs="mp4a.40.2"', + flashCanPlay: true, + media: 'audio' + }, + m3u8a: { // AAC / MP4 / Apple HLS + codec: 'application/vnd.apple.mpegurl; codecs="mp4a.40.2"', + flashCanPlay: false, + media: 'audio' + }, + m3ua: { // M3U + codec: 'audio/mpegurl', + flashCanPlay: false, + media: 'audio' + }, + oga: { // OGG + codec: 'audio/ogg; codecs="vorbis, opus"', + flashCanPlay: false, + media: 'audio' + }, + flac: { // FLAC + codec: 'audio/x-flac', + flashCanPlay: false, + media: 'audio' + }, + wav: { // PCM + codec: 'audio/wav; codecs="1"', + flashCanPlay: false, + media: 'audio' + }, + webma: { // WEBM + codec: 'audio/webm; codecs="vorbis"', + flashCanPlay: false, + media: 'audio' + }, + fla: { // FLV / F4A + codec: 'audio/x-flv', + flashCanPlay: true, + media: 'audio' + }, + rtmpa: { // RTMP AUDIO + codec: 'audio/rtmp; codecs="rtmp"', + flashCanPlay: true, + media: 'audio' + }, + m4v: { // H.264 / MP4 + codec: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"', + flashCanPlay: true, + media: 'video' + }, + m3u8v: { // H.264 / AAC / MP4 / Apple HLS + codec: 'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"', + flashCanPlay: false, + media: 'video' + }, + m3uv: { // M3U + codec: 'audio/mpegurl', + flashCanPlay: false, + media: 'video' + }, + ogv: { // OGG + codec: 'video/ogg; codecs="theora, vorbis"', + flashCanPlay: false, + media: 'video' + }, + webmv: { // WEBM + codec: 'video/webm; codecs="vorbis, vp8"', + flashCanPlay: false, + media: 'video' + }, + flv: { // FLV / F4V + codec: 'video/x-flv', + flashCanPlay: true, + media: 'video' + }, + rtmpv: { // RTMP VIDEO + codec: 'video/rtmp; codecs="rtmp"', + flashCanPlay: true, + media: 'video' + } + }, + _init: function() { + var self = this; + + this.element.empty(); + + this.status = $.extend({}, this.status); // Copy static to unique instance. + this.internal = $.extend({}, this.internal); // Copy static to unique instance. + + // Initialize the time format + this.options.timeFormat = $.extend({}, $.jPlayer.timeFormat, this.options.timeFormat); + + // On iOS, assume commands will be ignored before user initiates them. + this.internal.cmdsIgnored = $.jPlayer.platform.ipad || $.jPlayer.platform.iphone || $.jPlayer.platform.ipod; + + this.internal.domNode = this.element.get(0); + + // Add key bindings focus to 1st jPlayer instanced with key control enabled. + if(this.options.keyEnabled && !$.jPlayer.focus) { + $.jPlayer.focus = this; + } + + // A fix for Android where older (2.3) and even some 4.x devices fail to work when changing the *audio* SRC and then playing immediately. + this.androidFix = { + setMedia: false, // True when media set + play: false, // True when a progress event will instruct the media to play + pause: false, // True when a progress event will instruct the media to pause at a time. + time: NaN // The play(time) parameter + }; + if($.jPlayer.platform.android) { + this.options.preload = this.options.preload !== 'auto' ? 'metadata' : 'auto'; // Default to metadata, but allow auto. + } + + this.formats = []; // Array based on supplied string option. Order defines priority. + this.solutions = []; // Array based on solution string option. Order defines priority. + this.require = {}; // Which media types are required: video, audio. + + this.htmlElement = {}; // DOM elements created by jPlayer + this.html = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array. + this.html.audio = {}; + this.html.video = {}; + this.aurora = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array. + this.aurora.formats = []; + this.aurora.properties = []; + this.flash = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array. + + this.css = {}; + this.css.cs = {}; // Holds the css selector strings + this.css.jq = {}; // Holds jQuery selectors. ie., $(css.cs.method) + + this.ancestorJq = []; // Holds jQuery selector of cssSelectorAncestor. Init would use $() instead of [], but it is only 1.4+ + + this.options.volume = this._limitValue(this.options.volume, 0, 1); // Limit volume value's bounds. + + // Create the formats array, with prority based on the order of the supplied formats string + $.each(this.options.supplied.toLowerCase().split(","), function(index1, value1) { + var format = value1.replace(/^\s+|\s+$/g, ""); //trim + if(self.format[format]) { // Check format is valid. + var dupFound = false; + $.each(self.formats, function(index2, value2) { // Check for duplicates + if(format === value2) { + dupFound = true; + return false; + } + }); + if(!dupFound) { + self.formats.push(format); + } + } + }); + + // Create the solutions array, with prority based on the order of the solution string + $.each(this.options.solution.toLowerCase().split(","), function(index1, value1) { + var solution = value1.replace(/^\s+|\s+$/g, ""); //trim + if(self.solution[solution]) { // Check solution is valid. + var dupFound = false; + $.each(self.solutions, function(index2, value2) { // Check for duplicates + if(solution === value2) { + dupFound = true; + return false; + } + }); + if(!dupFound) { + self.solutions.push(solution); + } + } + }); + + // Create Aurora.js formats array + $.each(this.options.auroraFormats.toLowerCase().split(","), function(index1, value1) { + var format = value1.replace(/^\s+|\s+$/g, ""); //trim + if(self.format[format]) { // Check format is valid. + var dupFound = false; + $.each(self.aurora.formats, function(index2, value2) { // Check for duplicates + if(format === value2) { + dupFound = true; + return false; + } + }); + if(!dupFound) { + self.aurora.formats.push(format); + } + } + }); + + this.internal.instance = "jp_" + this.count; + this.instances[this.internal.instance] = this.element; + + // Check the jPlayer div has an id and create one if required. Important for Flash to know the unique id for comms. + if(!this.element.attr("id")) { + this.element.attr("id", this.options.idPrefix + "_jplayer_" + this.count); + } + + this.internal.self = $.extend({}, { + id: this.element.attr("id"), + jq: this.element + }); + this.internal.audio = $.extend({}, { + id: this.options.idPrefix + "_audio_" + this.count, + jq: undefined + }); + this.internal.video = $.extend({}, { + id: this.options.idPrefix + "_video_" + this.count, + jq: undefined + }); + this.internal.flash = $.extend({}, { + id: this.options.idPrefix + "_flash_" + this.count, + jq: undefined, + swf: this.options.swfPath + (this.options.swfPath.toLowerCase().slice(-4) !== ".swf" ? (this.options.swfPath && this.options.swfPath.slice(-1) !== "/" ? "/" : "") + "jquery.jplayer.swf" : "") + }); + this.internal.poster = $.extend({}, { + id: this.options.idPrefix + "_poster_" + this.count, + jq: undefined + }); + + // Register listeners defined in the constructor + $.each($.jPlayer.event, function(eventName,eventType) { + if(self.options[eventName] !== undefined) { + self.element.bind(eventType + ".jPlayer", self.options[eventName]); // With .jPlayer namespace. + self.options[eventName] = undefined; // Destroy the handler pointer copy on the options. Reason, events can be added/removed in other ways so this could be obsolete and misleading. + } + }); + + // Determine if we require solutions for audio, video or both media types. + this.require.audio = false; + this.require.video = false; + $.each(this.formats, function(priority, format) { + self.require[self.format[format].media] = true; + }); + + // Now required types are known, finish the options default settings. + if(this.require.video) { + this.options = $.extend(true, {}, + this.optionsVideo, + this.options + ); + } else { + this.options = $.extend(true, {}, + this.optionsAudio, + this.options + ); + } + this._setSize(); // update status and jPlayer element size + + // Determine the status for Blocklisted options. + this.status.nativeVideoControls = this._uaBlocklist(this.options.nativeVideoControls); + this.status.noFullWindow = this._uaBlocklist(this.options.noFullWindow); + this.status.noVolume = this._uaBlocklist(this.options.noVolume); + + // Create event handlers if native fullscreen is supported + if($.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled) { + this._fullscreenAddEventListeners(); + } + + // The native controls are only for video and are disabled when audio is also used. + this._restrictNativeVideoControls(); + + // Create the poster image. + this.htmlElement.poster = document.createElement('img'); + this.htmlElement.poster.id = this.internal.poster.id; + this.htmlElement.poster.onload = function() { // Note that this did not work on Firefox 3.6: poster.addEventListener("onload", function() {}, false); Did not investigate x-browser. + if(!self.status.video || self.status.waitForPlay) { + self.internal.poster.jq.show(); + } + }; + this.element.append(this.htmlElement.poster); + this.internal.poster.jq = $("#" + this.internal.poster.id); + this.internal.poster.jq.css({'width': this.status.width, 'height': this.status.height}); + this.internal.poster.jq.hide(); + this.internal.poster.jq.bind("click.jPlayer", function() { + self._trigger($.jPlayer.event.click); + }); + + // Generate the required media elements + this.html.audio.available = false; + if(this.require.audio) { // If a supplied format is audio + this.htmlElement.audio = document.createElement('audio'); + this.htmlElement.audio.id = this.internal.audio.id; + this.html.audio.available = !!this.htmlElement.audio.canPlayType && this._testCanPlayType(this.htmlElement.audio); // Test is for IE9 on Win Server 2008. + } + this.html.video.available = false; + if(this.require.video) { // If a supplied format is video + this.htmlElement.video = document.createElement('video'); + this.htmlElement.video.id = this.internal.video.id; + this.html.video.available = !!this.htmlElement.video.canPlayType && this._testCanPlayType(this.htmlElement.video); // Test is for IE9 on Win Server 2008. + } + + this.flash.available = this._checkForFlash(10.1); + + this.html.canPlay = {}; + this.aurora.canPlay = {}; + this.flash.canPlay = {}; + $.each(this.formats, function(priority, format) { + self.html.canPlay[format] = self.html[self.format[format].media].available && "" !== self.htmlElement[self.format[format].media].canPlayType(self.format[format].codec); + self.aurora.canPlay[format] = ($.inArray(format, self.aurora.formats) > -1); + self.flash.canPlay[format] = self.format[format].flashCanPlay && self.flash.available; + }); + this.html.desired = false; + this.aurora.desired = false; + this.flash.desired = false; + $.each(this.solutions, function(solutionPriority, solution) { + if(solutionPriority === 0) { + self[solution].desired = true; + } else { + var audioCanPlay = false; + var videoCanPlay = false; + $.each(self.formats, function(formatPriority, format) { + if(self[self.solutions[0]].canPlay[format]) { // The other solution can play + if(self.format[format].media === 'video') { + videoCanPlay = true; + } else { + audioCanPlay = true; + } + } + }); + self[solution].desired = (self.require.audio && !audioCanPlay) || (self.require.video && !videoCanPlay); + } + }); + // This is what jPlayer will support, based on solution and supplied. + this.html.support = {}; + this.aurora.support = {}; + this.flash.support = {}; + $.each(this.formats, function(priority, format) { + self.html.support[format] = self.html.canPlay[format] && self.html.desired; + self.aurora.support[format] = self.aurora.canPlay[format] && self.aurora.desired; + self.flash.support[format] = self.flash.canPlay[format] && self.flash.desired; + }); + // If jPlayer is supporting any format in a solution, then the solution is used. + this.html.used = false; + this.aurora.used = false; + this.flash.used = false; + $.each(this.solutions, function(solutionPriority, solution) { + $.each(self.formats, function(formatPriority, format) { + if(self[solution].support[format]) { + self[solution].used = true; + return false; + } + }); + }); + + // Init solution active state and the event gates to false. + this._resetActive(); + this._resetGate(); + + // Set up the css selectors for the control and feedback entities. + this._cssSelectorAncestor(this.options.cssSelectorAncestor); + + // If neither html nor aurora nor flash are being used by this browser, then media playback is not possible. Trigger an error event. + if(!(this.html.used || this.aurora.used || this.flash.used)) { + this._error( { + type: $.jPlayer.error.NO_SOLUTION, + context: "{solution:'" + this.options.solution + "', supplied:'" + this.options.supplied + "'}", + message: $.jPlayer.errorMsg.NO_SOLUTION, + hint: $.jPlayer.errorHint.NO_SOLUTION + }); + if(this.css.jq.noSolution.length) { + this.css.jq.noSolution.show(); + } + } else { + if(this.css.jq.noSolution.length) { + this.css.jq.noSolution.hide(); + } + } + + // Add the flash solution if it is being used. + if(this.flash.used) { + var htmlObj, + flashVars = 'jQuery=' + encodeURI(this.options.noConflict) + '&id=' + encodeURI(this.internal.self.id) + '&vol=' + this.options.volume + '&muted=' + this.options.muted; + + // Code influenced by SWFObject 2.2: http://code.google.com/p/swfobject/ + // Non IE browsers have an initial Flash size of 1 by 1 otherwise the wmode affected the Flash ready event. + + if($.jPlayer.browser.msie && (Number($.jPlayer.browser.version) < 9 || $.jPlayer.browser.documentMode < 9)) { + var objStr = ''; + + var paramStr = [ + '', + '', + '', + '', + '' + ]; + + htmlObj = document.createElement(objStr); + for(var i=0; i < paramStr.length; i++) { + htmlObj.appendChild(document.createElement(paramStr[i])); + } + } else { + var createParam = function(el, n, v) { + var p = document.createElement("param"); + p.setAttribute("name", n); + p.setAttribute("value", v); + el.appendChild(p); + }; + + htmlObj = document.createElement("object"); + htmlObj.setAttribute("id", this.internal.flash.id); + htmlObj.setAttribute("name", this.internal.flash.id); + htmlObj.setAttribute("data", this.internal.flash.swf); + htmlObj.setAttribute("type", "application/x-shockwave-flash"); + htmlObj.setAttribute("width", "1"); // Non-zero + htmlObj.setAttribute("height", "1"); // Non-zero + htmlObj.setAttribute("tabindex", "-1"); + createParam(htmlObj, "flashvars", flashVars); + createParam(htmlObj, "allowscriptaccess", "always"); + createParam(htmlObj, "bgcolor", this.options.backgroundColor); + createParam(htmlObj, "wmode", this.options.wmode); + } + + this.element.append(htmlObj); + this.internal.flash.jq = $(htmlObj); + } + + // Setup playbackRate ability before using _addHtmlEventListeners() + if(this.html.used && !this.flash.used) { // If only HTML + // Using the audio element capabilities for playbackRate. ie., Assuming video element is the same. + this.status.playbackRateEnabled = this._testPlaybackRate('audio'); + } else { + this.status.playbackRateEnabled = false; + } + + this._updatePlaybackRate(); + + // Add the HTML solution if being used. + if(this.html.used) { + + // The HTML Audio handlers + if(this.html.audio.available) { + this._addHtmlEventListeners(this.htmlElement.audio, this.html.audio); + this.element.append(this.htmlElement.audio); + this.internal.audio.jq = $("#" + this.internal.audio.id); + } + + // The HTML Video handlers + if(this.html.video.available) { + this._addHtmlEventListeners(this.htmlElement.video, this.html.video); + this.element.append(this.htmlElement.video); + this.internal.video.jq = $("#" + this.internal.video.id); + if(this.status.nativeVideoControls) { + this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height}); + } else { + this.internal.video.jq.css({'width':'0px', 'height':'0px'}); // Using size 0x0 since a .hide() causes issues in iOS + } + this.internal.video.jq.bind("click.jPlayer", function() { + self._trigger($.jPlayer.event.click); + }); + } + } + + // Add the Aurora.js solution if being used. + if(this.aurora.used) { + // Aurora.js player need to be created for each media, see setMedia function. + } + + // Create the bridge that emulates the HTML Media element on the jPlayer DIV + if( this.options.emulateHtml ) { + this._emulateHtmlBridge(); + } + + if((this.html.used || this.aurora.used) && !this.flash.used) { // If only HTML, then emulate flash ready() call after 100ms. + setTimeout( function() { + self.internal.ready = true; + self.version.flash = "n/a"; + self._trigger($.jPlayer.event.repeat); // Trigger the repeat event so its handler can initialize itself with the loop option. + self._trigger($.jPlayer.event.ready); + }, 100); + } + + // Initialize the interface components with the options. + this._updateNativeVideoControls(); + // The other controls are now setup in _cssSelectorAncestor() + if(this.css.jq.videoPlay.length) { + this.css.jq.videoPlay.hide(); + } + + $.jPlayer.prototype.count++; // Change static variable via prototype. + }, + destroy: function() { + // MJP: The background change remains. Would need to store the original to restore it correctly. + // MJP: The jPlayer element's size change remains. + + // Clear the media to reset the GUI and stop any downloads. Streams on some browsers had persited. (Chrome) + this.clearMedia(); + // Remove the size/sizeFull cssClass from the cssSelectorAncestor + this._removeUiClass(); + // Remove the times from the GUI + if(this.css.jq.currentTime.length) { + this.css.jq.currentTime.text(""); + } + if(this.css.jq.duration.length) { + this.css.jq.duration.text(""); + } + // Remove any bindings from the interface controls. + $.each(this.css.jq, function(fn, jq) { + // Check selector is valid before trying to execute method. + if(jq.length) { + jq.unbind(".jPlayer"); + } + }); + // Remove the click handlers for $.jPlayer.event.click + this.internal.poster.jq.unbind(".jPlayer"); + if(this.internal.video.jq) { + this.internal.video.jq.unbind(".jPlayer"); + } + // Remove the fullscreen event handlers + this._fullscreenRemoveEventListeners(); + // Remove key bindings + if(this === $.jPlayer.focus) { + $.jPlayer.focus = null; + } + // Destroy the HTML bridge. + if(this.options.emulateHtml) { + this._destroyHtmlBridge(); + } + this.element.removeData("jPlayer"); // Remove jPlayer data + this.element.unbind(".jPlayer"); // Remove all event handlers created by the jPlayer constructor + this.element.empty(); // Remove the inserted child elements + + delete this.instances[this.internal.instance]; // Clear the instance on the static instance object + }, + destroyRemoved: function() { // Destroy any instances that have gone away. + var self = this; + $.each(this.instances, function(i, element) { + if(self.element !== element) { // Do not destroy this instance. + if(!element.data("jPlayer")) { // Check that element is a real jPlayer. + element.jPlayer("destroy"); + delete self.instances[i]; + } + } + }); + }, + enable: function() { // Plan to implement + // options.disabled = false + }, + disable: function () { // Plan to implement + // options.disabled = true + }, + _testCanPlayType: function(elem) { + // IE9 on Win Server 2008 did not implement canPlayType(), but it has the property. + try { + elem.canPlayType(this.format.mp3.codec); // The type is irrelevant. + return true; + } catch(err) { + return false; + } + }, + _testPlaybackRate: function(type) { + // type: String 'audio' or 'video' + var el, rate = 0.5; + type = typeof type === 'string' ? type : 'audio'; + el = document.createElement(type); + // Wrapping in a try/catch, just in case older HTML5 browsers throw and error. + try { + if('playbackRate' in el) { + el.playbackRate = rate; + return el.playbackRate === rate; + } else { + return false; + } + } catch(err) { + return false; + } + }, + _uaBlocklist: function(list) { + // list : object with properties that are all regular expressions. Property names are irrelevant. + // Returns true if the user agent is matched in list. + var ua = navigator.userAgent.toLowerCase(), + block = false; + + $.each(list, function(p, re) { + if(re && re.test(ua)) { + block = true; + return false; // exit $.each. + } + }); + return block; + }, + _restrictNativeVideoControls: function() { + // Fallback to noFullWindow when nativeVideoControls is true and audio media is being used. Affects when both media types are used. + if(this.require.audio) { + if(this.status.nativeVideoControls) { + this.status.nativeVideoControls = false; + this.status.noFullWindow = true; + } + } + }, + _updateNativeVideoControls: function() { + if(this.html.video.available && this.html.used) { + // Turn the HTML Video controls on/off + this.htmlElement.video.controls = this.status.nativeVideoControls; + // Show/hide the jPlayer GUI. + this._updateAutohide(); + // For when option changed. The poster image is not updated, as it is dealt with in setMedia(). Acceptable degradation since seriously doubt these options will change on the fly. Can again review later. + if(this.status.nativeVideoControls && this.require.video) { + this.internal.poster.jq.hide(); + this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height}); + } else if(this.status.waitForPlay && this.status.video) { + this.internal.poster.jq.show(); + this.internal.video.jq.css({'width': '0px', 'height': '0px'}); + } + } + }, + _addHtmlEventListeners: function(mediaElement, entity) { + var self = this; + mediaElement.preload = this.options.preload; + mediaElement.muted = this.options.muted; + mediaElement.volume = this.options.volume; + + if(this.status.playbackRateEnabled) { + mediaElement.defaultPlaybackRate = this.options.defaultPlaybackRate; + mediaElement.playbackRate = this.options.playbackRate; + } + + // Create the event listeners + // Only want the active entity to affect jPlayer and bubble events. + // Using entity.gate so that object is referenced and gate property always current + + mediaElement.addEventListener("progress", function() { + if(entity.gate) { + if(self.internal.cmdsIgnored && this.readyState > 0) { // Detect iOS executed the command + self.internal.cmdsIgnored = false; + } + self._getHtmlStatus(mediaElement); + self._updateInterface(); + self._trigger($.jPlayer.event.progress); + } + }, false); + mediaElement.addEventListener("loadeddata", function() { + if(entity.gate) { + self.androidFix.setMedia = false; // Disable the fix after the first progress event. + if(self.androidFix.play) { // Play Android audio - performing the fix. + self.androidFix.play = false; + self.play(self.androidFix.time); + } + if(self.androidFix.pause) { // Pause Android audio at time - performing the fix. + self.androidFix.pause = false; + self.pause(self.androidFix.time); + } + self._trigger($.jPlayer.event.loadeddata); + } + }, false); + mediaElement.addEventListener("timeupdate", function() { + if(entity.gate) { + self._getHtmlStatus(mediaElement); + self._updateInterface(); + self._trigger($.jPlayer.event.timeupdate); + } + }, false); + mediaElement.addEventListener("durationchange", function() { + if(entity.gate) { + self._getHtmlStatus(mediaElement); + self._updateInterface(); + self._trigger($.jPlayer.event.durationchange); + } + }, false); + mediaElement.addEventListener("play", function() { + if(entity.gate) { + self._updateButtons(true); + self._html_checkWaitForPlay(); // So the native controls update this variable and puts the hidden interface in the correct state. Affects toggling native controls. + self._trigger($.jPlayer.event.play); + } + }, false); + mediaElement.addEventListener("playing", function() { + if(entity.gate) { + self._updateButtons(true); + self._seeked(); + self._trigger($.jPlayer.event.playing); + } + }, false); + mediaElement.addEventListener("pause", function() { + if(entity.gate) { + self._updateButtons(false); + self._trigger($.jPlayer.event.pause); + } + }, false); + mediaElement.addEventListener("waiting", function() { + if(entity.gate) { + self._seeking(); + self._trigger($.jPlayer.event.waiting); + } + }, false); + mediaElement.addEventListener("seeking", function() { + if(entity.gate) { + self._seeking(); + self._trigger($.jPlayer.event.seeking); + } + }, false); + mediaElement.addEventListener("seeked", function() { + if(entity.gate) { + self._seeked(); + self._trigger($.jPlayer.event.seeked); + } + }, false); + mediaElement.addEventListener("volumechange", function() { + if(entity.gate) { + // Read the values back from the element as the Blackberry PlayBook shares the volume with the physical buttons master volume control. + // However, when tested 6th July 2011, those buttons do not generate an event. The physical play/pause button does though. + self.options.volume = mediaElement.volume; + self.options.muted = mediaElement.muted; + self._updateMute(); + self._updateVolume(); + self._trigger($.jPlayer.event.volumechange); + } + }, false); + mediaElement.addEventListener("ratechange", function() { + if(entity.gate) { + self.options.defaultPlaybackRate = mediaElement.defaultPlaybackRate; + self.options.playbackRate = mediaElement.playbackRate; + self._updatePlaybackRate(); + self._trigger($.jPlayer.event.ratechange); + } + }, false); + mediaElement.addEventListener("suspend", function() { // Seems to be the only way of capturing that the iOS4 browser did not actually play the media from the page code. ie., It needs a user gesture. + if(entity.gate) { + self._seeked(); + self._trigger($.jPlayer.event.suspend); + } + }, false); + mediaElement.addEventListener("ended", function() { + if(entity.gate) { + // Order of the next few commands are important. Change the time and then pause. + // Solves a bug in Firefox, where issuing pause 1st causes the media to play from the start. ie., The pause is ignored. + if(!$.jPlayer.browser.webkit) { // Chrome crashes if you do this in conjunction with a setMedia command in an ended event handler. ie., The playlist demo. + self.htmlElement.media.currentTime = 0; // Safari does not care about this command. ie., It works with or without this line. (Both Safari and Chrome are Webkit.) + } + self.htmlElement.media.pause(); // Pause otherwise a click on the progress bar will play from that point, when it shouldn't, since it stopped playback. + self._updateButtons(false); + self._getHtmlStatus(mediaElement, true); // With override true. Otherwise Chrome leaves progress at full. + self._updateInterface(); + self._trigger($.jPlayer.event.ended); + } + }, false); + mediaElement.addEventListener("error", function() { + if(entity.gate) { + self._updateButtons(false); + self._seeked(); + if(self.status.srcSet) { // Deals with case of clearMedia() causing an error event. + clearTimeout(self.internal.htmlDlyCmdId); // Clears any delayed commands used in the HTML solution. + self.status.waitForLoad = true; // Allows the load operation to try again. + self.status.waitForPlay = true; // Reset since a play was captured. + if(self.status.video && !self.status.nativeVideoControls) { + self.internal.video.jq.css({'width':'0px', 'height':'0px'}); + } + if(self._validString(self.status.media.poster) && !self.status.nativeVideoControls) { + self.internal.poster.jq.show(); + } + if(self.css.jq.videoPlay.length) { + self.css.jq.videoPlay.show(); + } + self._error( { + type: $.jPlayer.error.URL, + context: self.status.src, // this.src shows absolute urls. Want context to show the url given. + message: $.jPlayer.errorMsg.URL, + hint: $.jPlayer.errorHint.URL + }); + } + } + }, false); + // Create all the other event listeners that bubble up to a jPlayer event from html, without being used by jPlayer. + $.each($.jPlayer.htmlEvent, function(i, eventType) { + mediaElement.addEventListener(this, function() { + if(entity.gate) { + self._trigger($.jPlayer.event[eventType]); + } + }, false); + }); + }, + _addAuroraEventListeners : function(player, entity) { + var self = this; + //player.preload = this.options.preload; + //player.muted = this.options.muted; + player.volume = this.options.volume * 100; + + // Create the event listeners + // Only want the active entity to affect jPlayer and bubble events. + // Using entity.gate so that object is referenced and gate property always current + + player.on("progress", function() { + if(entity.gate) { + if(self.internal.cmdsIgnored && this.readyState > 0) { // Detect iOS executed the command + self.internal.cmdsIgnored = false; + } + self._getAuroraStatus(player); + self._updateInterface(); + self._trigger($.jPlayer.event.progress); + // Progress with song duration, we estimate timeupdate need to be triggered too. + if (player.duration > 0) { + self._trigger($.jPlayer.event.timeupdate); + } + } + }, false); + player.on("ready", function() { + if(entity.gate) { + self._trigger($.jPlayer.event.loadeddata); + } + }, false); + player.on("duration", function() { + if(entity.gate) { + self._getAuroraStatus(player); + self._updateInterface(); + self._trigger($.jPlayer.event.durationchange); + } + }, false); + player.on("end", function() { + if(entity.gate) { + // Order of the next few commands are important. Change the time and then pause. + self._updateButtons(false); + self._getAuroraStatus(player, true); + self._updateInterface(); + self._trigger($.jPlayer.event.ended); + } + }, false); + player.on("error", function() { + if(entity.gate) { + self._updateButtons(false); + self._seeked(); + if(self.status.srcSet) { // Deals with case of clearMedia() causing an error event. + self.status.waitForLoad = true; // Allows the load operation to try again. + self.status.waitForPlay = true; // Reset since a play was captured. + if(self.status.video && !self.status.nativeVideoControls) { + self.internal.video.jq.css({'width':'0px', 'height':'0px'}); + } + if(self._validString(self.status.media.poster) && !self.status.nativeVideoControls) { + self.internal.poster.jq.show(); + } + if(self.css.jq.videoPlay.length) { + self.css.jq.videoPlay.show(); + } + self._error( { + type: $.jPlayer.error.URL, + context: self.status.src, // this.src shows absolute urls. Want context to show the url given. + message: $.jPlayer.errorMsg.URL, + hint: $.jPlayer.errorHint.URL + }); + } + } + }, false); + }, + _getHtmlStatus: function(media, override) { + var ct = 0, cpa = 0, sp = 0, cpr = 0; + + // Fixes the duration bug in iOS, where the durationchange event occurs when media.duration is not always correct. + // Fixes the initial duration bug in BB OS7, where the media.duration is infinity and displays as NaN:NaN due to Date() using inifity. + if(isFinite(media.duration)) { + this.status.duration = media.duration; + } + + ct = media.currentTime; + cpa = (this.status.duration > 0) ? 100 * ct / this.status.duration : 0; + if((typeof media.seekable === "object") && (media.seekable.length > 0)) { + sp = (this.status.duration > 0) ? 100 * media.seekable.end(media.seekable.length-1) / this.status.duration : 100; + cpr = (this.status.duration > 0) ? 100 * media.currentTime / media.seekable.end(media.seekable.length-1) : 0; // Duration conditional for iOS duration bug. ie., seekable.end is a NaN in that case. + } else { + sp = 100; + cpr = cpa; + } + + if(override) { + ct = 0; + cpr = 0; + cpa = 0; + } + + this.status.seekPercent = sp; + this.status.currentPercentRelative = cpr; + this.status.currentPercentAbsolute = cpa; + this.status.currentTime = ct; + + this.status.remaining = this.status.duration - this.status.currentTime; + + this.status.videoWidth = media.videoWidth; + this.status.videoHeight = media.videoHeight; + + this.status.readyState = media.readyState; + this.status.networkState = media.networkState; + this.status.playbackRate = media.playbackRate; + this.status.ended = media.ended; + }, + _getAuroraStatus: function(player, override) { + var ct = 0, cpa = 0, sp = 0, cpr = 0; + + this.status.duration = player.duration / 1000; + + ct = player.currentTime / 1000; + cpa = (this.status.duration > 0) ? 100 * ct / this.status.duration : 0; + if(player.buffered > 0) { + sp = (this.status.duration > 0) ? (player.buffered * this.status.duration) / this.status.duration : 100; + cpr = (this.status.duration > 0) ? ct / (player.buffered * this.status.duration) : 0; + } else { + sp = 100; + cpr = cpa; + } + + if(override) { + ct = 0; + cpr = 0; + cpa = 0; + } + + this.status.seekPercent = sp; + this.status.currentPercentRelative = cpr; + this.status.currentPercentAbsolute = cpa; + this.status.currentTime = ct; + + this.status.remaining = this.status.duration - this.status.currentTime; + + this.status.readyState = 4; // status.readyState; + this.status.networkState = 0; // status.networkState; + this.status.playbackRate = 1; // status.playbackRate; + this.status.ended = false; // status.ended; + }, + _resetStatus: function() { + this.status = $.extend({}, this.status, $.jPlayer.prototype.status); // Maintains the status properties that persist through a reset. + }, + _trigger: function(eventType, error, warning) { // eventType always valid as called using $.jPlayer.event.eventType + var event = $.Event(eventType); + event.jPlayer = {}; + event.jPlayer.version = $.extend({}, this.version); + event.jPlayer.options = $.extend(true, {}, this.options); // Deep copy + event.jPlayer.status = $.extend(true, {}, this.status); // Deep copy + event.jPlayer.html = $.extend(true, {}, this.html); // Deep copy + event.jPlayer.aurora = $.extend(true, {}, this.aurora); // Deep copy + event.jPlayer.flash = $.extend(true, {}, this.flash); // Deep copy + if(error) { + event.jPlayer.error = $.extend({}, error); + } + if(warning) { + event.jPlayer.warning = $.extend({}, warning); + } + this.element.trigger(event); + }, + jPlayerFlashEvent: function(eventType, status) { // Called from Flash + if(eventType === $.jPlayer.event.ready) { + if(!this.internal.ready) { + this.internal.ready = true; + this.internal.flash.jq.css({'width':'0px', 'height':'0px'}); // Once Flash generates the ready event, minimise to zero as it is not affected by wmode anymore. + + this.version.flash = status.version; + if(this.version.needFlash !== this.version.flash) { + this._error( { + type: $.jPlayer.error.VERSION, + context: this.version.flash, + message: $.jPlayer.errorMsg.VERSION + this.version.flash, + hint: $.jPlayer.errorHint.VERSION + }); + } + this._trigger($.jPlayer.event.repeat); // Trigger the repeat event so its handler can initialize itself with the loop option. + this._trigger(eventType); + } else { + // This condition occurs if the Flash is hidden and then shown again. + // Firefox also reloads the Flash if the CSS position changes. position:fixed is used for full screen. + + // Only do this if the Flash is the solution being used at the moment. Affects Media players where both solution may be being used. + if(this.flash.gate) { + + // Send the current status to the Flash now that it is ready (available) again. + if(this.status.srcSet) { + + // Need to read original status before issuing the setMedia command. + var currentTime = this.status.currentTime, + paused = this.status.paused; + + this.setMedia(this.status.media); + this.volumeWorker(this.options.volume); + if(currentTime > 0) { + if(paused) { + this.pause(currentTime); + } else { + this.play(currentTime); + } + } + } + this._trigger($.jPlayer.event.flashreset); + } + } + } + if(this.flash.gate) { + switch(eventType) { + case $.jPlayer.event.progress: + this._getFlashStatus(status); + this._updateInterface(); + this._trigger(eventType); + break; + case $.jPlayer.event.timeupdate: + this._getFlashStatus(status); + this._updateInterface(); + this._trigger(eventType); + break; + case $.jPlayer.event.play: + this._seeked(); + this._updateButtons(true); + this._trigger(eventType); + break; + case $.jPlayer.event.pause: + this._updateButtons(false); + this._trigger(eventType); + break; + case $.jPlayer.event.ended: + this._updateButtons(false); + this._trigger(eventType); + break; + case $.jPlayer.event.click: + this._trigger(eventType); // This could be dealt with by the default + break; + case $.jPlayer.event.error: + this.status.waitForLoad = true; // Allows the load operation to try again. + this.status.waitForPlay = true; // Reset since a play was captured. + if(this.status.video) { + this.internal.flash.jq.css({'width':'0px', 'height':'0px'}); + } + if(this._validString(this.status.media.poster)) { + this.internal.poster.jq.show(); + } + if(this.css.jq.videoPlay.length && this.status.video) { + this.css.jq.videoPlay.show(); + } + if(this.status.video) { // Set up for another try. Execute before error event. + this._flash_setVideo(this.status.media); + } else { + this._flash_setAudio(this.status.media); + } + this._updateButtons(false); + this._error( { + type: $.jPlayer.error.URL, + context:status.src, + message: $.jPlayer.errorMsg.URL, + hint: $.jPlayer.errorHint.URL + }); + break; + case $.jPlayer.event.seeking: + this._seeking(); + this._trigger(eventType); + break; + case $.jPlayer.event.seeked: + this._seeked(); + this._trigger(eventType); + break; + case $.jPlayer.event.ready: + // The ready event is handled outside the switch statement. + // Captured here otherwise 2 ready events would be generated if the ready event handler used setMedia. + break; + default: + this._trigger(eventType); + } + } + return false; + }, + _getFlashStatus: function(status) { + this.status.seekPercent = status.seekPercent; + this.status.currentPercentRelative = status.currentPercentRelative; + this.status.currentPercentAbsolute = status.currentPercentAbsolute; + this.status.currentTime = status.currentTime; + this.status.duration = status.duration; + this.status.remaining = status.duration - status.currentTime; + + this.status.videoWidth = status.videoWidth; + this.status.videoHeight = status.videoHeight; + + // The Flash does not generate this information in this release + this.status.readyState = 4; // status.readyState; + this.status.networkState = 0; // status.networkState; + this.status.playbackRate = 1; // status.playbackRate; + this.status.ended = false; // status.ended; + }, + _updateButtons: function(playing) { + if(playing === undefined) { + playing = !this.status.paused; + } else { + this.status.paused = !playing; + } + // Apply the state classes. (For the useStateClassSkin:true option) + if(playing) { + this.addStateClass('playing'); + } else { + this.removeStateClass('playing'); + } + if(!this.status.noFullWindow && this.options.fullWindow) { + this.addStateClass('fullScreen'); + } else { + this.removeStateClass('fullScreen'); + } + if(this.options.loop) { + this.addStateClass('looped'); + } else { + this.removeStateClass('looped'); + } + // Toggle the GUI element pairs. (For the useStateClassSkin:false option) + if(this.css.jq.play.length && this.css.jq.pause.length) { + if(playing) { + this.css.jq.play.hide(); + this.css.jq.pause.show(); + } else { + this.css.jq.play.show(); + this.css.jq.pause.hide(); + } + } + if(this.css.jq.restoreScreen.length && this.css.jq.fullScreen.length) { + if(this.status.noFullWindow) { + this.css.jq.fullScreen.hide(); + this.css.jq.restoreScreen.hide(); + } else if(this.options.fullWindow) { + this.css.jq.fullScreen.hide(); + this.css.jq.restoreScreen.show(); + } else { + this.css.jq.fullScreen.show(); + this.css.jq.restoreScreen.hide(); + } + } + if(this.css.jq.repeat.length && this.css.jq.repeatOff.length) { + if(this.options.loop) { + this.css.jq.repeat.hide(); + this.css.jq.repeatOff.show(); + } else { + this.css.jq.repeat.show(); + this.css.jq.repeatOff.hide(); + } + } + }, + _updateInterface: function() { + if(this.css.jq.seekBar.length) { + this.css.jq.seekBar.width(this.status.seekPercent+"%"); + } + if(this.css.jq.playBar.length) { + if(this.options.smoothPlayBar) { + this.css.jq.playBar.stop().animate({ + width: this.status.currentPercentAbsolute+"%" + }, 250, "linear"); + } else { + this.css.jq.playBar.width(this.status.currentPercentRelative+"%"); + } + } + var currentTimeText = ''; + if(this.css.jq.currentTime.length) { + currentTimeText = this._convertTime(this.status.currentTime); + if(currentTimeText !== this.css.jq.currentTime.text()) { + this.css.jq.currentTime.text(this._convertTime(this.status.currentTime)); + } + } + var durationText = '', + duration = this.status.duration, + remaining = this.status.remaining; + if(this.css.jq.duration.length) { + if(typeof this.status.media.duration === 'string') { + durationText = this.status.media.duration; + } else { + if(typeof this.status.media.duration === 'number') { + duration = this.status.media.duration; + remaining = duration - this.status.currentTime; + } + if(this.options.remainingDuration) { + durationText = (remaining > 0 ? '-' : '') + this._convertTime(remaining); + } else { + durationText = this._convertTime(duration); + } + } + if(durationText !== this.css.jq.duration.text()) { + this.css.jq.duration.text(durationText); + } + } + }, + _convertTime: ConvertTime.prototype.time, + _seeking: function() { + if(this.css.jq.seekBar.length) { + this.css.jq.seekBar.addClass("jp-seeking-bg"); + } + this.addStateClass('seeking'); + }, + _seeked: function() { + if(this.css.jq.seekBar.length) { + this.css.jq.seekBar.removeClass("jp-seeking-bg"); + } + this.removeStateClass('seeking'); + }, + _resetGate: function() { + this.html.audio.gate = false; + this.html.video.gate = false; + this.aurora.gate = false; + this.flash.gate = false; + }, + _resetActive: function() { + this.html.active = false; + this.aurora.active = false; + this.flash.active = false; + }, + _escapeHtml: function(s) { + return s.split('&').join('&').split('<').join('<').split('>').join('>').split('"').join('"'); + }, + _qualifyURL: function(url) { + var el = document.createElement('div'); + el.innerHTML= 'x'; + return el.firstChild.href; + }, + _absoluteMediaUrls: function(media) { + var self = this; + $.each(media, function(type, url) { + if(url && self.format[type] && url.substr(0, 5) !== "data:") { + media[type] = self._qualifyURL(url); + } + }); + return media; + }, + addStateClass: function(state) { + if(this.ancestorJq.length) { + this.ancestorJq.addClass(this.options.stateClass[state]); + } + }, + removeStateClass: function(state) { + if(this.ancestorJq.length) { + this.ancestorJq.removeClass(this.options.stateClass[state]); + } + }, + setMedia: function(media) { + + /* media[format] = String: URL of format. Must contain all of the supplied option's video or audio formats. + * media.poster = String: Video poster URL. + * media.track = Array: Of objects defining the track element: kind, src, srclang, label, def. + * media.stream = Boolean: * NOT IMPLEMENTED * Designating actual media streams. ie., "false/undefined" for files. Plan to refresh the flash every so often. + */ + + var self = this, + supported = false, + posterChanged = this.status.media.poster !== media.poster; // Compare before reset. Important for OSX Safari as this.htmlElement.poster.src is absolute, even if original poster URL was relative. + + this._resetMedia(); + this._resetGate(); + this._resetActive(); + + // Clear the Android Fix. + this.androidFix.setMedia = false; + this.androidFix.play = false; + this.androidFix.pause = false; + + // Convert all media URLs to absolute URLs. + media = this._absoluteMediaUrls(media); + + $.each(this.formats, function(formatPriority, format) { + var isVideo = self.format[format].media === 'video'; + $.each(self.solutions, function(solutionPriority, solution) { + if(self[solution].support[format] && self._validString(media[format])) { // Format supported in solution and url given for format. + var isHtml = solution === 'html'; + var isAurora = solution === 'aurora'; + + if(isVideo) { + if(isHtml) { + self.html.video.gate = true; + self._html_setVideo(media); + self.html.active = true; + } else { + self.flash.gate = true; + self._flash_setVideo(media); + self.flash.active = true; + } + if(self.css.jq.videoPlay.length) { + self.css.jq.videoPlay.show(); + } + self.status.video = true; + } else { + if(isHtml) { + self.html.audio.gate = true; + self._html_setAudio(media); + self.html.active = true; + + // Setup the Android Fix - Only for HTML audio. + if($.jPlayer.platform.android) { + self.androidFix.setMedia = true; + } + } else if(isAurora) { + self.aurora.gate = true; + self._aurora_setAudio(media); + self.aurora.active = true; + } else { + self.flash.gate = true; + self._flash_setAudio(media); + self.flash.active = true; + } + if(self.css.jq.videoPlay.length) { + self.css.jq.videoPlay.hide(); + } + self.status.video = false; + } + + supported = true; + return false; // Exit $.each + } + }); + if(supported) { + return false; // Exit $.each + } + }); + + if(supported) { + if(!(this.status.nativeVideoControls && this.html.video.gate)) { + // Set poster IMG if native video controls are not being used + // Note: With IE the IMG onload event occurs immediately when cached. + // Note: Poster hidden by default in _resetMedia() + if(this._validString(media.poster)) { + if(posterChanged) { // Since some browsers do not generate img onload event. + this.htmlElement.poster.src = media.poster; + } else { + this.internal.poster.jq.show(); + } + } + } + if(typeof media.title === 'string') { + if(this.css.jq.title.length) { + this.css.jq.title.html(media.title); + } + if(this.htmlElement.audio) { + this.htmlElement.audio.setAttribute('title', media.title); + } + if(this.htmlElement.video) { + this.htmlElement.video.setAttribute('title', media.title); + } + } + this.status.srcSet = true; + this.status.media = $.extend({}, media); + this._updateButtons(false); + this._updateInterface(); + this._trigger($.jPlayer.event.setmedia); + } else { // jPlayer cannot support any formats provided in this browser + // Send an error event + this._error( { + type: $.jPlayer.error.NO_SUPPORT, + context: "{supplied:'" + this.options.supplied + "'}", + message: $.jPlayer.errorMsg.NO_SUPPORT, + hint: $.jPlayer.errorHint.NO_SUPPORT + }); + } + }, + _resetMedia: function() { + this._resetStatus(); + this._updateButtons(false); + this._updateInterface(); + this._seeked(); + this.internal.poster.jq.hide(); + + clearTimeout(this.internal.htmlDlyCmdId); + + if(this.html.active) { + this._html_resetMedia(); + } else if(this.aurora.active) { + this._aurora_resetMedia(); + } else if(this.flash.active) { + this._flash_resetMedia(); + } + }, + clearMedia: function() { + this._resetMedia(); + + if(this.html.active) { + this._html_clearMedia(); + } else if(this.aurora.active) { + this._aurora_clearMedia(); + } else if(this.flash.active) { + this._flash_clearMedia(); + } + + this._resetGate(); + this._resetActive(); + }, + load: function() { + if(this.status.srcSet) { + if(this.html.active) { + this._html_load(); + } else if(this.aurora.active) { + this._aurora_load(); + } else if(this.flash.active) { + this._flash_load(); + } + } else { + this._urlNotSetError("load"); + } + }, + focus: function() { + if(this.options.keyEnabled) { + $.jPlayer.focus = this; + } + }, + play: function(time) { + var guiAction = typeof time === "object"; // Flags GUI click events so we know this was not a direct command, but an action taken by the user on the GUI. + if(guiAction && this.options.useStateClassSkin && !this.status.paused) { + this.pause(time); // The time would be the click event, but passing it over so info is not lost. + } else { + time = (typeof time === "number") ? time : NaN; // Remove jQuery event from click handler + if(this.status.srcSet) { + this.focus(); + if(this.html.active) { + this._html_play(time); + } else if(this.aurora.active) { + this._aurora_play(time); + } else if(this.flash.active) { + this._flash_play(time); + } + } else { + this._urlNotSetError("play"); + } + } + }, + videoPlay: function() { // Handles clicks on the play button over the video poster + this.play(); + }, + pause: function(time) { + time = (typeof time === "number") ? time : NaN; // Remove jQuery event from click handler + if(this.status.srcSet) { + if(this.html.active) { + this._html_pause(time); + } else if(this.aurora.active) { + this._aurora_pause(time); + } else if(this.flash.active) { + this._flash_pause(time); + } + } else { + this._urlNotSetError("pause"); + } + }, + tellOthers: function(command, conditions) { + var self = this, + hasConditions = typeof conditions === 'function', + args = Array.prototype.slice.call(arguments); // Convert arguments to an Array. + + if(typeof command !== 'string') { // Ignore, since no command. + return; // Return undefined to maintain chaining. + } + if(hasConditions) { + args.splice(1, 1); // Remove the conditions from the arguments + } + + $.jPlayer.prototype.destroyRemoved(); + $.each(this.instances, function() { + // Remember that "this" is the instance's "element" in the $.each() loop. + if(self.element !== this) { // Do not tell my instance. + if(!hasConditions || conditions.call(this.data("jPlayer"), self)) { + this.jPlayer.apply(this, args); + } + } + }); + }, + pauseOthers: function(time) { + this.tellOthers("pause", function() { + // In the conditions function, the "this" context is the other instance's jPlayer object. + return this.status.srcSet; + }, time); + }, + stop: function() { + if(this.status.srcSet) { + if(this.html.active) { + this._html_pause(0); + } else if(this.aurora.active) { + this._aurora_pause(0); + } else if(this.flash.active) { + this._flash_pause(0); + } + } else { + this._urlNotSetError("stop"); + } + }, + playHead: function(p) { + p = this._limitValue(p, 0, 100); + if(this.status.srcSet) { + if(this.html.active) { + this._html_playHead(p); + } else if(this.aurora.active) { + this._aurora_playHead(p); + } else if(this.flash.active) { + this._flash_playHead(p); + } + } else { + this._urlNotSetError("playHead"); + } + }, + _muted: function(muted) { + this.mutedWorker(muted); + if(this.options.globalVolume) { + this.tellOthers("mutedWorker", function() { + // Check the other instance has global volume enabled. + return this.options.globalVolume; + }, muted); + } + }, + mutedWorker: function(muted) { + this.options.muted = muted; + if(this.html.used) { + this._html_setProperty('muted', muted); + } + if(this.aurora.used) { + this._aurora_mute(muted); + } + if(this.flash.used) { + this._flash_mute(muted); + } + + // The HTML solution generates this event from the media element itself. + if(!this.html.video.gate && !this.html.audio.gate) { + this._updateMute(muted); + this._updateVolume(this.options.volume); + this._trigger($.jPlayer.event.volumechange); + } + }, + mute: function(mute) { // mute is either: undefined (true), an event object (true) or a boolean (muted). + var guiAction = typeof mute === "object"; // Flags GUI click events so we know this was not a direct command, but an action taken by the user on the GUI. + if(guiAction && this.options.useStateClassSkin && this.options.muted) { + this._muted(false); + } else { + mute = mute === undefined ? true : !!mute; + this._muted(mute); + } + }, + unmute: function(unmute) { // unmute is either: undefined (true), an event object (true) or a boolean (!muted). + unmute = unmute === undefined ? true : !!unmute; + this._muted(!unmute); + }, + _updateMute: function(mute) { + if(mute === undefined) { + mute = this.options.muted; + } + if(mute) { + this.addStateClass('muted'); + } else { + this.removeStateClass('muted'); + } + if(this.css.jq.mute.length && this.css.jq.unmute.length) { + if(this.status.noVolume) { + this.css.jq.mute.hide(); + this.css.jq.unmute.hide(); + } else if(mute) { + this.css.jq.mute.hide(); + this.css.jq.unmute.show(); + } else { + this.css.jq.mute.show(); + this.css.jq.unmute.hide(); + } + } + }, + volume: function(v) { + this.volumeWorker(v); + if(this.options.globalVolume) { + this.tellOthers("volumeWorker", function() { + // Check the other instance has global volume enabled. + return this.options.globalVolume; + }, v); + } + }, + volumeWorker: function(v) { + v = this._limitValue(v, 0, 1); + this.options.volume = v; + + if(this.html.used) { + this._html_setProperty('volume', v); + } + if(this.aurora.used) { + this._aurora_volume(v); + } + if(this.flash.used) { + this._flash_volume(v); + } + + // The HTML solution generates this event from the media element itself. + if(!this.html.video.gate && !this.html.audio.gate) { + this._updateVolume(v); + this._trigger($.jPlayer.event.volumechange); + } + }, + volumeBar: function(e) { // Handles clicks on the volumeBar + if(this.css.jq.volumeBar.length) { + // Using $(e.currentTarget) to enable multiple volume bars + var $bar = $(e.currentTarget), + offset = $bar.offset(), + x = e.pageX - offset.left, + w = $bar.width(), + y = $bar.height() - e.pageY + offset.top, + h = $bar.height(); + if(this.options.verticalVolume) { + this.volume(y/h); + } else { + this.volume(x/w); + } + } + if(this.options.muted) { + this._muted(false); + } + }, + _updateVolume: function(v) { + if(v === undefined) { + v = this.options.volume; + } + v = this.options.muted ? 0 : v; + + if(this.status.noVolume) { + this.addStateClass('noVolume'); + if(this.css.jq.volumeBar.length) { + this.css.jq.volumeBar.hide(); + } + if(this.css.jq.volumeBarValue.length) { + this.css.jq.volumeBarValue.hide(); + } + if(this.css.jq.volumeMax.length) { + this.css.jq.volumeMax.hide(); + } + } else { + this.removeStateClass('noVolume'); + if(this.css.jq.volumeBar.length) { + this.css.jq.volumeBar.show(); + } + if(this.css.jq.volumeBarValue.length) { + this.css.jq.volumeBarValue.show(); + this.css.jq.volumeBarValue[this.options.verticalVolume ? "height" : "width"]((v*100)+"%"); + } + if(this.css.jq.volumeMax.length) { + this.css.jq.volumeMax.show(); + } + } + }, + volumeMax: function() { // Handles clicks on the volume max + this.volume(1); + if(this.options.muted) { + this._muted(false); + } + }, + _cssSelectorAncestor: function(ancestor) { + var self = this; + this.options.cssSelectorAncestor = ancestor; + this._removeUiClass(); + this.ancestorJq = ancestor ? $(ancestor) : []; // Would use $() instead of [], but it is only 1.4+ + if(ancestor && this.ancestorJq.length !== 1) { // So empty strings do not generate the warning. + this._warning( { + type: $.jPlayer.warning.CSS_SELECTOR_COUNT, + context: ancestor, + message: $.jPlayer.warningMsg.CSS_SELECTOR_COUNT + this.ancestorJq.length + " found for cssSelectorAncestor.", + hint: $.jPlayer.warningHint.CSS_SELECTOR_COUNT + }); + } + this._addUiClass(); + $.each(this.options.cssSelector, function(fn, cssSel) { + self._cssSelector(fn, cssSel); + }); + + // Set the GUI to the current state. + this._updateInterface(); + this._updateButtons(); + this._updateAutohide(); + this._updateVolume(); + this._updateMute(); + }, + _cssSelector: function(fn, cssSel) { + var self = this; + if(typeof cssSel === 'string') { + if($.jPlayer.prototype.options.cssSelector[fn]) { + if(this.css.jq[fn] && this.css.jq[fn].length) { + this.css.jq[fn].unbind(".jPlayer"); + } + this.options.cssSelector[fn] = cssSel; + this.css.cs[fn] = this.options.cssSelectorAncestor + " " + cssSel; + + if(cssSel) { // Checks for empty string + this.css.jq[fn] = $(this.css.cs[fn]); + } else { + this.css.jq[fn] = []; // To comply with the css.jq[fn].length check before its use. As of jQuery 1.4 could have used $() for an empty set. + } + + if(this.css.jq[fn].length && this[fn]) { + var handler = function(e) { + e.preventDefault(); + self[fn](e); + if(self.options.autoBlur) { + $(this).blur(); + } else { + $(this).focus(); // Force focus for ARIA. + } + }; + this.css.jq[fn].bind("click.jPlayer", handler); // Using jPlayer namespace + } + + if(cssSel && this.css.jq[fn].length !== 1) { // So empty strings do not generate the warning. ie., they just remove the old one. + this._warning( { + type: $.jPlayer.warning.CSS_SELECTOR_COUNT, + context: this.css.cs[fn], + message: $.jPlayer.warningMsg.CSS_SELECTOR_COUNT + this.css.jq[fn].length + " found for " + fn + " method.", + hint: $.jPlayer.warningHint.CSS_SELECTOR_COUNT + }); + } + } else { + this._warning( { + type: $.jPlayer.warning.CSS_SELECTOR_METHOD, + context: fn, + message: $.jPlayer.warningMsg.CSS_SELECTOR_METHOD, + hint: $.jPlayer.warningHint.CSS_SELECTOR_METHOD + }); + } + } else { + this._warning( { + type: $.jPlayer.warning.CSS_SELECTOR_STRING, + context: cssSel, + message: $.jPlayer.warningMsg.CSS_SELECTOR_STRING, + hint: $.jPlayer.warningHint.CSS_SELECTOR_STRING + }); + } + }, + duration: function(e) { + if(this.options.toggleDuration) { + if(this.options.captureDuration) { + e.stopPropagation(); + } + this._setOption("remainingDuration", !this.options.remainingDuration); + } + }, + seekBar: function(e) { // Handles clicks on the seekBar + if(this.css.jq.seekBar.length) { + // Using $(e.currentTarget) to enable multiple seek bars + var $bar = $(e.currentTarget), + offset = $bar.offset(), + x = e.pageX - offset.left, + w = $bar.width(), + p = 100 * x / w; + this.playHead(p); + } + }, + playbackRate: function(pbr) { + this._setOption("playbackRate", pbr); + }, + playbackRateBar: function(e) { // Handles clicks on the playbackRateBar + if(this.css.jq.playbackRateBar.length) { + // Using $(e.currentTarget) to enable multiple playbackRate bars + var $bar = $(e.currentTarget), + offset = $bar.offset(), + x = e.pageX - offset.left, + w = $bar.width(), + y = $bar.height() - e.pageY + offset.top, + h = $bar.height(), + ratio, pbr; + if(this.options.verticalPlaybackRate) { + ratio = y/h; + } else { + ratio = x/w; + } + pbr = ratio * (this.options.maxPlaybackRate - this.options.minPlaybackRate) + this.options.minPlaybackRate; + this.playbackRate(pbr); + } + }, + _updatePlaybackRate: function() { + var pbr = this.options.playbackRate, + ratio = (pbr - this.options.minPlaybackRate) / (this.options.maxPlaybackRate - this.options.minPlaybackRate); + if(this.status.playbackRateEnabled) { + if(this.css.jq.playbackRateBar.length) { + this.css.jq.playbackRateBar.show(); + } + if(this.css.jq.playbackRateBarValue.length) { + this.css.jq.playbackRateBarValue.show(); + this.css.jq.playbackRateBarValue[this.options.verticalPlaybackRate ? "height" : "width"]((ratio*100)+"%"); + } + } else { + if(this.css.jq.playbackRateBar.length) { + this.css.jq.playbackRateBar.hide(); + } + if(this.css.jq.playbackRateBarValue.length) { + this.css.jq.playbackRateBarValue.hide(); + } + } + }, + repeat: function(event) { // Handle clicks on the repeat button + var guiAction = typeof event === "object"; // Flags GUI click events so we know this was not a direct command, but an action taken by the user on the GUI. + if(guiAction && this.options.useStateClassSkin && this.options.loop) { + this._loop(false); + } else { + this._loop(true); + } + }, + repeatOff: function() { // Handle clicks on the repeatOff button + this._loop(false); + }, + _loop: function(loop) { + if(this.options.loop !== loop) { + this.options.loop = loop; + this._updateButtons(); + this._trigger($.jPlayer.event.repeat); + } + }, + + // Options code adapted from ui.widget.js (1.8.7). Made changes so the key can use dot notation. To match previous getData solution in jPlayer 1. + option: function(key, value) { + var options = key; + + // Enables use: options(). Returns a copy of options object + if ( arguments.length === 0 ) { + return $.extend( true, {}, this.options ); + } + + if(typeof key === "string") { + var keys = key.split("."); + + // Enables use: options("someOption") Returns a copy of the option. Supports dot notation. + if(value === undefined) { + + var opt = $.extend(true, {}, this.options); + for(var i = 0; i < keys.length; i++) { + if(opt[keys[i]] !== undefined) { + opt = opt[keys[i]]; + } else { + this._warning( { + type: $.jPlayer.warning.OPTION_KEY, + context: key, + message: $.jPlayer.warningMsg.OPTION_KEY, + hint: $.jPlayer.warningHint.OPTION_KEY + }); + return undefined; + } + } + return opt; + } + + // Enables use: options("someOptionObject", someObject}). Creates: {someOptionObject:someObject} + // Enables use: options("someOption", someValue). Creates: {someOption:someValue} + // Enables use: options("someOptionObject.someOption", someValue). Creates: {someOptionObject:{someOption:someValue}} + + options = {}; + var opts = options; + + for(var j = 0; j < keys.length; j++) { + if(j < keys.length - 1) { + opts[keys[j]] = {}; + opts = opts[keys[j]]; + } else { + opts[keys[j]] = value; + } + } + } + + // Otherwise enables use: options(optionObject). Uses original object (the key) + + this._setOptions(options); + + return this; + }, + _setOptions: function(options) { + var self = this; + $.each(options, function(key, value) { // This supports the 2 level depth that the options of jPlayer has. Would review if we ever need more depth. + self._setOption(key, value); + }); + + return this; + }, + _setOption: function(key, value) { + var self = this; + + // The ability to set options is limited at this time. + + switch(key) { + case "volume" : + this.volume(value); + break; + case "muted" : + this._muted(value); + break; + case "globalVolume" : + this.options[key] = value; + break; + case "cssSelectorAncestor" : + this._cssSelectorAncestor(value); // Set and refresh all associations for the new ancestor. + break; + case "cssSelector" : + $.each(value, function(fn, cssSel) { + self._cssSelector(fn, cssSel); // NB: The option is set inside this function, after further validity checks. + }); + break; + case "playbackRate" : + this.options[key] = value = this._limitValue(value, this.options.minPlaybackRate, this.options.maxPlaybackRate); + if(this.html.used) { + this._html_setProperty('playbackRate', value); + } + this._updatePlaybackRate(); + break; + case "defaultPlaybackRate" : + this.options[key] = value = this._limitValue(value, this.options.minPlaybackRate, this.options.maxPlaybackRate); + if(this.html.used) { + this._html_setProperty('defaultPlaybackRate', value); + } + this._updatePlaybackRate(); + break; + case "minPlaybackRate" : + this.options[key] = value = this._limitValue(value, 0.1, this.options.maxPlaybackRate - 0.1); + this._updatePlaybackRate(); + break; + case "maxPlaybackRate" : + this.options[key] = value = this._limitValue(value, this.options.minPlaybackRate + 0.1, 16); + this._updatePlaybackRate(); + break; + case "fullScreen" : + if(this.options[key] !== value) { // if changed + var wkv = $.jPlayer.nativeFeatures.fullscreen.used.webkitVideo; + if(!wkv || wkv && !this.status.waitForPlay) { + if(!wkv) { // No sensible way to unset option on these devices. + this.options[key] = value; + } + if(value) { + this._requestFullscreen(); + } else { + this._exitFullscreen(); + } + if(!wkv) { + this._setOption("fullWindow", value); + } + } + } + break; + case "fullWindow" : + if(this.options[key] !== value) { // if changed + this._removeUiClass(); + this.options[key] = value; + this._refreshSize(); + } + break; + case "size" : + if(!this.options.fullWindow && this.options[key].cssClass !== value.cssClass) { + this._removeUiClass(); + } + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this._refreshSize(); + break; + case "sizeFull" : + if(this.options.fullWindow && this.options[key].cssClass !== value.cssClass) { + this._removeUiClass(); + } + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this._refreshSize(); + break; + case "autohide" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this._updateAutohide(); + break; + case "loop" : + this._loop(value); + break; + case "remainingDuration" : + this.options[key] = value; + this._updateInterface(); + break; + case "toggleDuration" : + this.options[key] = value; + break; + case "nativeVideoControls" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this.status.nativeVideoControls = this._uaBlocklist(this.options.nativeVideoControls); + this._restrictNativeVideoControls(); + this._updateNativeVideoControls(); + break; + case "noFullWindow" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this.status.nativeVideoControls = this._uaBlocklist(this.options.nativeVideoControls); // Need to check again as noFullWindow can depend on this flag and the restrict() can override it. + this.status.noFullWindow = this._uaBlocklist(this.options.noFullWindow); + this._restrictNativeVideoControls(); + this._updateButtons(); + break; + case "noVolume" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this.status.noVolume = this._uaBlocklist(this.options.noVolume); + this._updateVolume(); + this._updateMute(); + break; + case "emulateHtml" : + if(this.options[key] !== value) { // To avoid multiple event handlers being created, if true already. + this.options[key] = value; + if(value) { + this._emulateHtmlBridge(); + } else { + this._destroyHtmlBridge(); + } + } + break; + case "timeFormat" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + break; + case "keyEnabled" : + this.options[key] = value; + if(!value && this === $.jPlayer.focus) { + $.jPlayer.focus = null; + } + break; + case "keyBindings" : + this.options[key] = $.extend(true, {}, this.options[key], value); // store a merged DEEP copy of it, incase not all properties changed. + break; + case "audioFullScreen" : + this.options[key] = value; + break; + case "autoBlur" : + this.options[key] = value; + break; + } + + return this; + }, + // End of: (Options code adapted from ui.widget.js) + + _refreshSize: function() { + this._setSize(); // update status and jPlayer element size + this._addUiClass(); // update the ui class + this._updateSize(); // update internal sizes + this._updateButtons(); + this._updateAutohide(); + this._trigger($.jPlayer.event.resize); + }, + _setSize: function() { + // Determine the current size from the options + if(this.options.fullWindow) { + this.status.width = this.options.sizeFull.width; + this.status.height = this.options.sizeFull.height; + this.status.cssClass = this.options.sizeFull.cssClass; + } else { + this.status.width = this.options.size.width; + this.status.height = this.options.size.height; + this.status.cssClass = this.options.size.cssClass; + } + + // Set the size of the jPlayer area. + this.element.css({'width': this.status.width, 'height': this.status.height}); + }, + _addUiClass: function() { + if(this.ancestorJq.length) { + this.ancestorJq.addClass(this.status.cssClass); + } + }, + _removeUiClass: function() { + if(this.ancestorJq.length) { + this.ancestorJq.removeClass(this.status.cssClass); + } + }, + _updateSize: function() { + // The poster uses show/hide so can simply resize it. + this.internal.poster.jq.css({'width': this.status.width, 'height': this.status.height}); + + // Video html or flash resized if necessary at this time, or if native video controls being used. + if(!this.status.waitForPlay && this.html.active && this.status.video || this.html.video.available && this.html.used && this.status.nativeVideoControls) { + this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height}); + } + else if(!this.status.waitForPlay && this.flash.active && this.status.video) { + this.internal.flash.jq.css({'width': this.status.width, 'height': this.status.height}); + } + }, + _updateAutohide: function() { + var self = this, + event = "mousemove.jPlayer", + namespace = ".jPlayerAutohide", + eventType = event + namespace, + handler = function(event) { + var moved = false, + deltaX, deltaY; + if(typeof self.internal.mouse !== "undefined") { + //get the change from last position to this position + deltaX = self.internal.mouse.x - event.pageX; + deltaY = self.internal.mouse.y - event.pageY; + moved = (Math.floor(deltaX) > 0) || (Math.floor(deltaY)>0); + } else { + moved = true; + } + // store current position for next method execution + self.internal.mouse = { + x : event.pageX, + y : event.pageY + }; + // if mouse has been actually moved, do the gui fadeIn/fadeOut + if (moved) { + self.css.jq.gui.fadeIn(self.options.autohide.fadeIn, function() { + clearTimeout(self.internal.autohideId); + self.internal.autohideId = setTimeout( function() { + self.css.jq.gui.fadeOut(self.options.autohide.fadeOut); + }, self.options.autohide.hold); + }); + } + }; + + if(this.css.jq.gui.length) { + + // End animations first so that its callback is executed now. + // Otherwise an in progress fadeIn animation still has the callback to fadeOut again. + this.css.jq.gui.stop(true, true); + + // Removes the fadeOut operation from the fadeIn callback. + clearTimeout(this.internal.autohideId); + // undefine mouse + delete this.internal.mouse; + + this.element.unbind(namespace); + this.css.jq.gui.unbind(namespace); + + if(!this.status.nativeVideoControls) { + if(this.options.fullWindow && this.options.autohide.full || !this.options.fullWindow && this.options.autohide.restored) { + this.element.bind(eventType, handler); + this.css.jq.gui.bind(eventType, handler); + this.css.jq.gui.hide(); + } else { + this.css.jq.gui.show(); + } + } else { + this.css.jq.gui.hide(); + } + } + }, + fullScreen: function(event) { + var guiAction = typeof event === "object"; // Flags GUI click events so we know this was not a direct command, but an action taken by the user on the GUI. + if(guiAction && this.options.useStateClassSkin && this.options.fullScreen) { + this._setOption("fullScreen", false); + } else { + this._setOption("fullScreen", true); + } + }, + restoreScreen: function() { + this._setOption("fullScreen", false); + }, + _fullscreenAddEventListeners: function() { + var self = this, + fs = $.jPlayer.nativeFeatures.fullscreen; + + if(fs.api.fullscreenEnabled) { + if(fs.event.fullscreenchange) { + // Create the event handler function and store it for removal. + if(typeof this.internal.fullscreenchangeHandler !== 'function') { + this.internal.fullscreenchangeHandler = function() { + self._fullscreenchange(); + }; + } + document.addEventListener(fs.event.fullscreenchange, this.internal.fullscreenchangeHandler, false); + } + // No point creating handler for fullscreenerror. + // Either logic avoids fullscreen occurring (w3c/moz), or their is no event on the browser (webkit). + } + }, + _fullscreenRemoveEventListeners: function() { + var fs = $.jPlayer.nativeFeatures.fullscreen; + if(this.internal.fullscreenchangeHandler) { + document.removeEventListener(fs.event.fullscreenchange, this.internal.fullscreenchangeHandler, false); + } + }, + _fullscreenchange: function() { + // If nothing is fullscreen, then we cannot be in fullscreen mode. + if(this.options.fullScreen && !$.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()) { + this._setOption("fullScreen", false); + } + }, + _requestFullscreen: function() { + // Either the container or the jPlayer div + var e = this.ancestorJq.length ? this.ancestorJq[0] : this.element[0], + fs = $.jPlayer.nativeFeatures.fullscreen; + + // This method needs the video element. For iOS and Android. + if(fs.used.webkitVideo) { + e = this.htmlElement.video; + } + + if(fs.api.fullscreenEnabled) { + fs.api.requestFullscreen(e); + } + }, + _exitFullscreen: function() { + + var fs = $.jPlayer.nativeFeatures.fullscreen, + e; + + // This method needs the video element. For iOS and Android. + if(fs.used.webkitVideo) { + e = this.htmlElement.video; + } + + if(fs.api.fullscreenEnabled) { + fs.api.exitFullscreen(e); + } + }, + _html_initMedia: function(media) { + // Remove any existing track elements + var $media = $(this.htmlElement.media).empty(); + + // Create any track elements given with the media, as an Array of track Objects. + $.each(media.track || [], function(i,v) { + var track = document.createElement('track'); + track.setAttribute("kind", v.kind ? v.kind : ""); + track.setAttribute("src", v.src ? v.src : ""); + track.setAttribute("srclang", v.srclang ? v.srclang : ""); + track.setAttribute("label", v.label ? v.label : ""); + if(v.def) { + track.setAttribute("default", v.def); + } + $media.append(track); + }); + + this.htmlElement.media.src = this.status.src; + + if(this.options.preload !== 'none') { + this._html_load(); // See function for comments + } + this._trigger($.jPlayer.event.timeupdate); // The flash generates this event for its solution. + }, + _html_setFormat: function(media) { + var self = this; + // Always finds a format due to checks in setMedia() + $.each(this.formats, function(priority, format) { + if(self.html.support[format] && media[format]) { + self.status.src = media[format]; + self.status.format[format] = true; + self.status.formatType = format; + return false; + } + }); + }, + _html_setAudio: function(media) { + this._html_setFormat(media); + this.htmlElement.media = this.htmlElement.audio; + this._html_initMedia(media); + }, + _html_setVideo: function(media) { + this._html_setFormat(media); + if(this.status.nativeVideoControls) { + this.htmlElement.video.poster = this._validString(media.poster) ? media.poster : ""; + } + this.htmlElement.media = this.htmlElement.video; + this._html_initMedia(media); + }, + _html_resetMedia: function() { + if(this.htmlElement.media) { + if(this.htmlElement.media.id === this.internal.video.id && !this.status.nativeVideoControls) { + this.internal.video.jq.css({'width':'0px', 'height':'0px'}); + } + this.htmlElement.media.pause(); + } + }, + _html_clearMedia: function() { + if(this.htmlElement.media) { + this.htmlElement.media.src = "about:blank"; + // The following load() is only required for Firefox 3.6 (PowerMacs). + // Recent HTMl5 browsers only require the src change. Due to changes in W3C spec and load() effect. + this.htmlElement.media.load(); // Stops an old, "in progress" download from continuing the download. Triggers the loadstart, error and emptied events, due to the empty src. Also an abort event if a download was in progress. + } + }, + _html_load: function() { + // This function remains to allow the early HTML5 browsers to work, such as Firefox 3.6 + // A change in the W3C spec for the media.load() command means that this is no longer necessary. + // This command should be removed and actually causes minor undesirable effects on some browsers. Such as loading the whole file and not only the metadata. + if(this.status.waitForLoad) { + this.status.waitForLoad = false; + this.htmlElement.media.load(); + } + clearTimeout(this.internal.htmlDlyCmdId); + }, + _html_play: function(time) { + var self = this, + media = this.htmlElement.media; + + this.androidFix.pause = false; // Cancel the pause fix. + + this._html_load(); // Loads if required and clears any delayed commands. + + // Setup the Android Fix. + if(this.androidFix.setMedia) { + this.androidFix.play = true; + this.androidFix.time = time; + + } else if(!isNaN(time)) { + + // Attempt to play it, since iOS has been ignoring commands + if(this.internal.cmdsIgnored) { + media.play(); + } + + try { + // !media.seekable is for old HTML5 browsers, like Firefox 3.6. + // Checking seekable.length is important for iOS6 to work with setMedia().play(time) + if(!media.seekable || typeof media.seekable === "object" && media.seekable.length > 0) { + media.currentTime = time; + media.play(); + } else { + throw 1; + } + } catch(err) { + this.internal.htmlDlyCmdId = setTimeout(function() { + self.play(time); + }, 250); + return; // Cancel execution and wait for the delayed command. + } + } else { + media.play(); + } + this._html_checkWaitForPlay(); + }, + _html_pause: function(time) { + var self = this, + media = this.htmlElement.media; + + this.androidFix.play = false; // Cancel the play fix. + + if(time > 0) { // We do not want the stop() command, which does pause(0), causing a load operation. + this._html_load(); // Loads if required and clears any delayed commands. + } else { + clearTimeout(this.internal.htmlDlyCmdId); + } + + // Order of these commands is important for Safari (Win) and IE9. Pause then change currentTime. + media.pause(); + + // Setup the Android Fix. + if(this.androidFix.setMedia) { + this.androidFix.pause = true; + this.androidFix.time = time; + + } else if(!isNaN(time)) { + try { + if(!media.seekable || typeof media.seekable === "object" && media.seekable.length > 0) { + media.currentTime = time; + } else { + throw 1; + } + } catch(err) { + this.internal.htmlDlyCmdId = setTimeout(function() { + self.pause(time); + }, 250); + return; // Cancel execution and wait for the delayed command. + } + } + if(time > 0) { // Avoids a setMedia() followed by stop() or pause(0) hiding the video play button. + this._html_checkWaitForPlay(); + } + }, + _html_playHead: function(percent) { + var self = this, + media = this.htmlElement.media; + + this._html_load(); // Loads if required and clears any delayed commands. + + // This playHead() method needs a refactor to apply the android fix. + + try { + if(typeof media.seekable === "object" && media.seekable.length > 0) { + media.currentTime = percent * media.seekable.end(media.seekable.length-1) / 100; + } else if(media.duration > 0 && !isNaN(media.duration)) { + media.currentTime = percent * media.duration / 100; + } else { + throw "e"; + } + } catch(err) { + this.internal.htmlDlyCmdId = setTimeout(function() { + self.playHead(percent); + }, 250); + return; // Cancel execution and wait for the delayed command. + } + if(!this.status.waitForLoad) { + this._html_checkWaitForPlay(); + } + }, + _html_checkWaitForPlay: function() { + if(this.status.waitForPlay) { + this.status.waitForPlay = false; + if(this.css.jq.videoPlay.length) { + this.css.jq.videoPlay.hide(); + } + if(this.status.video) { + this.internal.poster.jq.hide(); + this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height}); + } + } + }, + _html_setProperty: function(property, value) { + if(this.html.audio.available) { + this.htmlElement.audio[property] = value; + } + if(this.html.video.available) { + this.htmlElement.video[property] = value; + } + }, + _aurora_setAudio: function(media) { + var self = this; + + // Always finds a format due to checks in setMedia() + $.each(this.formats, function(priority, format) { + if(self.aurora.support[format] && media[format]) { + self.status.src = media[format]; + self.status.format[format] = true; + self.status.formatType = format; + + return false; + } + }); + + this.aurora.player = new AV.Player.fromURL(this.status.src); + this._addAuroraEventListeners(this.aurora.player, this.aurora); + + if(this.options.preload === 'auto') { + this._aurora_load(); + this.status.waitForLoad = false; + } + }, + _aurora_resetMedia: function() { + if (this.aurora.player) { + this.aurora.player.stop(); + } + }, + _aurora_clearMedia: function() { + // Nothing to clear. + }, + _aurora_load: function() { + if(this.status.waitForLoad) { + this.status.waitForLoad = false; + this.aurora.player.preload(); + } + }, + _aurora_play: function(time) { + if (!this.status.waitForLoad) { + if (!isNaN(time)) { + this.aurora.player.seek(time); + } + } + if (!this.aurora.player.playing) { + this.aurora.player.play(); + } + this.status.waitForLoad = false; + this._aurora_checkWaitForPlay(); + + // No event from the player, update UI now. + this._updateButtons(true); + this._trigger($.jPlayer.event.play); + }, + _aurora_pause: function(time) { + if (!isNaN(time)) { + this.aurora.player.seek(time * 1000); + } + this.aurora.player.pause(); + + if(time > 0) { // Avoids a setMedia() followed by stop() or pause(0) hiding the video play button. + this._aurora_checkWaitForPlay(); + } + + // No event from the player, update UI now. + this._updateButtons(false); + this._trigger($.jPlayer.event.pause); + }, + _aurora_playHead: function(percent) { + if(this.aurora.player.duration > 0) { + // The seek() sould be in milliseconds, but the only codec that works with seek (aac.js) uses seconds. + this.aurora.player.seek(percent * this.aurora.player.duration / 100); // Using seconds + } + + if(!this.status.waitForLoad) { + this._aurora_checkWaitForPlay(); + } + }, + _aurora_checkWaitForPlay: function() { + if(this.status.waitForPlay) { + this.status.waitForPlay = false; + } + }, + _aurora_volume: function(v) { + this.aurora.player.volume = v * 100; + }, + _aurora_mute: function(m) { + if (m) { + this.aurora.properties.lastvolume = this.aurora.player.volume; + this.aurora.player.volume = 0; + } else { + this.aurora.player.volume = this.aurora.properties.lastvolume; + } + this.aurora.properties.muted = m; + }, + _flash_setAudio: function(media) { + var self = this; + try { + // Always finds a format due to checks in setMedia() + $.each(this.formats, function(priority, format) { + if(self.flash.support[format] && media[format]) { + switch (format) { + case "m4a" : + case "fla" : + self._getMovie().fl_setAudio_m4a(media[format]); + break; + case "mp3" : + self._getMovie().fl_setAudio_mp3(media[format]); + break; + case "rtmpa": + self._getMovie().fl_setAudio_rtmp(media[format]); + break; + } + self.status.src = media[format]; + self.status.format[format] = true; + self.status.formatType = format; + return false; + } + }); + + if(this.options.preload === 'auto') { + this._flash_load(); + this.status.waitForLoad = false; + } + } catch(err) { this._flashError(err); } + }, + _flash_setVideo: function(media) { + var self = this; + try { + // Always finds a format due to checks in setMedia() + $.each(this.formats, function(priority, format) { + if(self.flash.support[format] && media[format]) { + switch (format) { + case "m4v" : + case "flv" : + self._getMovie().fl_setVideo_m4v(media[format]); + break; + case "rtmpv": + self._getMovie().fl_setVideo_rtmp(media[format]); + break; + } + self.status.src = media[format]; + self.status.format[format] = true; + self.status.formatType = format; + return false; + } + }); + + if(this.options.preload === 'auto') { + this._flash_load(); + this.status.waitForLoad = false; + } + } catch(err) { this._flashError(err); } + }, + _flash_resetMedia: function() { + this.internal.flash.jq.css({'width':'0px', 'height':'0px'}); // Must do via CSS as setting attr() to zero causes a jQuery error in IE. + this._flash_pause(NaN); + }, + _flash_clearMedia: function() { + try { + this._getMovie().fl_clearMedia(); + } catch(err) { this._flashError(err); } + }, + _flash_load: function() { + try { + this._getMovie().fl_load(); + } catch(err) { this._flashError(err); } + this.status.waitForLoad = false; + }, + _flash_play: function(time) { + try { + this._getMovie().fl_play(time); + } catch(err) { this._flashError(err); } + this.status.waitForLoad = false; + this._flash_checkWaitForPlay(); + }, + _flash_pause: function(time) { + try { + this._getMovie().fl_pause(time); + } catch(err) { this._flashError(err); } + if(time > 0) { // Avoids a setMedia() followed by stop() or pause(0) hiding the video play button. + this.status.waitForLoad = false; + this._flash_checkWaitForPlay(); + } + }, + _flash_playHead: function(p) { + try { + this._getMovie().fl_play_head(p); + } catch(err) { this._flashError(err); } + if(!this.status.waitForLoad) { + this._flash_checkWaitForPlay(); + } + }, + _flash_checkWaitForPlay: function() { + if(this.status.waitForPlay) { + this.status.waitForPlay = false; + if(this.css.jq.videoPlay.length) { + this.css.jq.videoPlay.hide(); + } + if(this.status.video) { + this.internal.poster.jq.hide(); + this.internal.flash.jq.css({'width': this.status.width, 'height': this.status.height}); + } + } + }, + _flash_volume: function(v) { + try { + this._getMovie().fl_volume(v); + } catch(err) { this._flashError(err); } + }, + _flash_mute: function(m) { + try { + this._getMovie().fl_mute(m); + } catch(err) { this._flashError(err); } + }, + _getMovie: function() { + return document[this.internal.flash.id]; + }, + _getFlashPluginVersion: function() { + + // _getFlashPluginVersion() code influenced by: + // - FlashReplace 1.01: http://code.google.com/p/flashreplace/ + // - SWFObject 2.2: http://code.google.com/p/swfobject/ + + var version = 0, + flash; + if(window.ActiveXObject) { + try { + flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); + if (flash) { // flash will return null when ActiveX is disabled + var v = flash.GetVariable("$version"); + if(v) { + v = v.split(" ")[1].split(","); + version = parseInt(v[0], 10) + "." + parseInt(v[1], 10); + } + } + } catch(e) {} + } + else if(navigator.plugins && navigator.mimeTypes.length > 0) { + flash = navigator.plugins["Shockwave Flash"]; + if(flash) { + version = navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/, "$1"); + } + } + return version * 1; // Converts to a number + }, + _checkForFlash: function (version) { + var flashOk = false; + if(this._getFlashPluginVersion() >= version) { + flashOk = true; + } + return flashOk; + }, + _validString: function(url) { + return (url && typeof url === "string"); // Empty strings return false + }, + _limitValue: function(value, min, max) { + return (value < min) ? min : ((value > max) ? max : value); + }, + _urlNotSetError: function(context) { + this._error( { + type: $.jPlayer.error.URL_NOT_SET, + context: context, + message: $.jPlayer.errorMsg.URL_NOT_SET, + hint: $.jPlayer.errorHint.URL_NOT_SET + }); + }, + _flashError: function(error) { + var errorType; + if(!this.internal.ready) { + errorType = "FLASH"; + } else { + errorType = "FLASH_DISABLED"; + } + this._error( { + type: $.jPlayer.error[errorType], + context: this.internal.flash.swf, + message: $.jPlayer.errorMsg[errorType] + error.message, + hint: $.jPlayer.errorHint[errorType] + }); + // Allow the audio player to recover if display:none and then shown again, or with position:fixed on Firefox. + // This really only affects audio in a media player, as an audio player could easily move the jPlayer element away from such issues. + this.internal.flash.jq.css({'width':'1px', 'height':'1px'}); + }, + _error: function(error) { + this._trigger($.jPlayer.event.error, error); + if(this.options.errorAlerts) { + this._alert("Error!" + (error.message ? "\n" + error.message : "") + (error.hint ? "\n" + error.hint : "") + "\nContext: " + error.context); + } + }, + _warning: function(warning) { + this._trigger($.jPlayer.event.warning, undefined, warning); + if(this.options.warningAlerts) { + this._alert("Warning!" + (warning.message ? "\n" + warning.message : "") + (warning.hint ? "\n" + warning.hint : "") + "\nContext: " + warning.context); + } + }, + _alert: function(message) { + var msg = "jPlayer " + this.version.script + " : id='" + this.internal.self.id +"' : " + message; + if(!this.options.consoleAlerts) { + alert(msg); + } else if(window.console && window.console.log) { + window.console.log(msg); + } + }, + _emulateHtmlBridge: function() { + var self = this; + + // Emulate methods on jPlayer's DOM element. + $.each( $.jPlayer.emulateMethods.split(/\s+/g), function(i, name) { + self.internal.domNode[name] = function(arg) { + self[name](arg); + }; + + }); + + // Bubble jPlayer events to its DOM element. + $.each($.jPlayer.event, function(eventName,eventType) { + var nativeEvent = true; + $.each( $.jPlayer.reservedEvent.split(/\s+/g), function(i, name) { + if(name === eventName) { + nativeEvent = false; + return false; + } + }); + if(nativeEvent) { + self.element.bind(eventType + ".jPlayer.jPlayerHtml", function() { // With .jPlayer & .jPlayerHtml namespaces. + self._emulateHtmlUpdate(); + var domEvent = document.createEvent("Event"); + domEvent.initEvent(eventName, false, true); + self.internal.domNode.dispatchEvent(domEvent); + }); + } + // The error event would require a special case + }); + + // IE9 has a readyState property on all elements. The document should have it, but all (except media) elements inherit it in IE9. This conflicts with Popcorn, which polls the readyState. + }, + _emulateHtmlUpdate: function() { + var self = this; + + $.each( $.jPlayer.emulateStatus.split(/\s+/g), function(i, name) { + self.internal.domNode[name] = self.status[name]; + }); + $.each( $.jPlayer.emulateOptions.split(/\s+/g), function(i, name) { + self.internal.domNode[name] = self.options[name]; + }); + }, + _destroyHtmlBridge: function() { + var self = this; + + // Bridge event handlers are also removed by destroy() through .jPlayer namespace. + this.element.unbind(".jPlayerHtml"); // Remove all event handlers created by the jPlayer bridge. So you can change the emulateHtml option. + + // Remove the methods and properties + var emulated = $.jPlayer.emulateMethods + " " + $.jPlayer.emulateStatus + " " + $.jPlayer.emulateOptions; + $.each( emulated.split(/\s+/g), function(i, name) { + delete self.internal.domNode[name]; + }); + } + }; + + $.jPlayer.error = { + FLASH: "e_flash", + FLASH_DISABLED: "e_flash_disabled", + NO_SOLUTION: "e_no_solution", + NO_SUPPORT: "e_no_support", + URL: "e_url", + URL_NOT_SET: "e_url_not_set", + VERSION: "e_version" + }; + + $.jPlayer.errorMsg = { + FLASH: "jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ", // Used in: _flashError() + FLASH_DISABLED: "jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ", // Used in: _flashError() + NO_SOLUTION: "No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.", // Used in: _init() + NO_SUPPORT: "It is not possible to play any media format provided in setMedia() on this browser using your current options.", // Used in: setMedia() + URL: "Media URL could not be loaded.", // Used in: jPlayerFlashEvent() and _addHtmlEventListeners() + URL_NOT_SET: "Attempt to issue media playback commands, while no media url is set.", // Used in: load(), play(), pause(), stop() and playHead() + VERSION: "jPlayer " + $.jPlayer.prototype.version.script + " needs Jplayer.swf version " + $.jPlayer.prototype.version.needFlash + " but found " // Used in: jPlayerReady() + }; + + $.jPlayer.errorHint = { + FLASH: "Check your swfPath option and that Jplayer.swf is there.", + FLASH_DISABLED: "Check that you have not display:none; the jPlayer entity or any ancestor.", + NO_SOLUTION: "Review the jPlayer options: support and supplied.", + NO_SUPPORT: "Video or audio formats defined in the supplied option are missing.", + URL: "Check media URL is valid.", + URL_NOT_SET: "Use setMedia() to set the media URL.", + VERSION: "Update jPlayer files." + }; + + $.jPlayer.warning = { + CSS_SELECTOR_COUNT: "e_css_selector_count", + CSS_SELECTOR_METHOD: "e_css_selector_method", + CSS_SELECTOR_STRING: "e_css_selector_string", + OPTION_KEY: "e_option_key" + }; + + $.jPlayer.warningMsg = { + CSS_SELECTOR_COUNT: "The number of css selectors found did not equal one: ", + CSS_SELECTOR_METHOD: "The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.", + CSS_SELECTOR_STRING: "The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.", + OPTION_KEY: "The option requested in jPlayer('option') is undefined." + }; + + $.jPlayer.warningHint = { + CSS_SELECTOR_COUNT: "Check your css selector and the ancestor.", + CSS_SELECTOR_METHOD: "Check your method name.", + CSS_SELECTOR_STRING: "Check your css selector is a string.", + OPTION_KEY: "Check your option name." + }; +})); diff --git a/components/require-built.js b/components/require-built.js new file mode 100644 index 0000000..ae1fa9d --- /dev/null +++ b/components/require-built.js @@ -0,0 +1,5553 @@ +/** vim: et:ts=4:sw=4:sts=4 + * @license RequireJS 2.1.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ +//Not using strict: uneven strict support in browsers, #392, and causes +//problems with requirejs.exec()/transpiler plugins that may not be strict. +/*jslint regexp: true, nomen: true, sloppy: true */ +/*global window, navigator, document, importScripts, setTimeout, opera */ + +var requirejs, require, define; +(function (global) { + var req, s, head, baseElement, dataMain, src, + interactiveScript, currentlyAddingScript, mainScript, subPath, + version = '2.1.5', + commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, + cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, + jsSuffixRegExp = /\.js$/, + currDirRegExp = /^\.\//, + op = Object.prototype, + ostring = op.toString, + hasOwn = op.hasOwnProperty, + ap = Array.prototype, + apsp = ap.splice, + isBrowser = !!(typeof window !== 'undefined' && navigator && document), + isWebWorker = !isBrowser && typeof importScripts !== 'undefined', + //PS3 indicates loaded and complete, but need to wait for complete + //specifically. Sequence is 'loading', 'loaded', execution, + // then 'complete'. The UA check is unfortunate, but not sure how + //to feature test w/o causing perf issues. + readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? + /^complete$/ : /^(complete|loaded)$/, + defContextName = '_', + //Oh the tragedy, detecting opera. See the usage of isOpera for reason. + isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]', + contexts = {}, + cfg = {}, + globalDefQueue = [], + useInteractive = false; + + function isFunction(it) { + return ostring.call(it) === '[object Function]'; + } + + function isArray(it) { + return ostring.call(it) === '[object Array]'; + } + + /** + * Helper function for iterating over an array. If the func returns + * a true value, it will break out of the loop. + */ + function each(ary, func) { + if (ary) { + var i; + for (i = 0; i < ary.length; i += 1) { + if (ary[i] && func(ary[i], i, ary)) { + break; + } + } + } + } + + /** + * Helper function for iterating over an array backwards. If the func + * returns a true value, it will break out of the loop. + */ + function eachReverse(ary, func) { + if (ary) { + var i; + for (i = ary.length - 1; i > -1; i -= 1) { + if (ary[i] && func(ary[i], i, ary)) { + break; + } + } + } + } + + function hasProp(obj, prop) { + return hasOwn.call(obj, prop); + } + + function getOwn(obj, prop) { + return hasProp(obj, prop) && obj[prop]; + } + + /** + * Cycles over properties in an object and calls a function for each + * property value. If the function returns a truthy value, then the + * iteration is stopped. + */ + function eachProp(obj, func) { + var prop; + for (prop in obj) { + if (hasProp(obj, prop)) { + if (func(obj[prop], prop)) { + break; + } + } + } + } + + /** + * Simple function to mix in properties from source into target, + * but only if target does not already have a property of the same name. + */ + function mixin(target, source, force, deepStringMixin) { + if (source) { + eachProp(source, function (value, prop) { + if (force || !hasProp(target, prop)) { + if (deepStringMixin && typeof value !== 'string') { + if (!target[prop]) { + target[prop] = {}; + } + mixin(target[prop], value, force, deepStringMixin); + } else { + target[prop] = value; + } + } + }); + } + return target; + } + + //Similar to Function.prototype.bind, but the 'this' object is specified + //first, since it is easier to read/figure out what 'this' will be. + function bind(obj, fn) { + return function () { + return fn.apply(obj, arguments); + }; + } + + function scripts() { + return document.getElementsByTagName('script'); + } + + //Allow getting a global that expressed in + //dot notation, like 'a.b.c'. + function getGlobal(value) { + if (!value) { + return value; + } + var g = global; + each(value.split('.'), function (part) { + g = g[part]; + }); + return g; + } + + /** + * Constructs an error with a pointer to an URL with more information. + * @param {String} id the error ID that maps to an ID on a web page. + * @param {String} message human readable error. + * @param {Error} [err] the original error, if there is one. + * + * @returns {Error} + */ + function makeError(id, msg, err, requireModules) { + var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id); + e.requireType = id; + e.requireModules = requireModules; + if (err) { + e.originalError = err; + } + return e; + } + + if (typeof define !== 'undefined') { + //If a define is already in play via another AMD loader, + //do not overwrite. + return; + } + + if (typeof requirejs !== 'undefined') { + if (isFunction(requirejs)) { + //Do not overwrite and existing requirejs instance. + return; + } + cfg = requirejs; + requirejs = undefined; + } + + //Allow for a require config object + if (typeof require !== 'undefined' && !isFunction(require)) { + //assume it is a config object. + cfg = require; + require = undefined; + } + + function newContext(contextName) { + var inCheckLoaded, Module, context, handlers, + checkLoadedTimeoutId, + config = { + //Defaults. Do not set a default for map + //config to speed up normalize(), which + //will run faster if there is no default. + waitSeconds: 7, + baseUrl: './', + paths: {}, + pkgs: {}, + shim: {}, + config: {} + }, + registry = {}, + //registry of just enabled modules, to speed + //cycle breaking code when lots of modules + //are registered, but not activated. + enabledRegistry = {}, + undefEvents = {}, + defQueue = [], + defined = {}, + urlFetched = {}, + requireCounter = 1, + unnormalizedCounter = 1; + + /** + * Trims the . and .. from an array of path segments. + * It will keep a leading path segment if a .. will become + * the first path segment, to help with module name lookups, + * which act like paths, but can be remapped. But the end result, + * all paths that use this function should look normalized. + * NOTE: this method MODIFIES the input array. + * @param {Array} ary the array of path segments. + */ + function trimDots(ary) { + var i, part; + for (i = 0; ary[i]; i += 1) { + part = ary[i]; + if (part === '.') { + ary.splice(i, 1); + i -= 1; + } else if (part === '..') { + if (i === 1 && (ary[2] === '..' || ary[0] === '..')) { + //End of the line. Keep at least one non-dot + //path segment at the front so it can be mapped + //correctly to disk. Otherwise, there is likely + //no path mapping for a path starting with '..'. + //This can still fail, but catches the most reasonable + //uses of .. + break; + } else if (i > 0) { + ary.splice(i - 1, 2); + i -= 2; + } + } + } + } + + /** + * Given a relative module name, like ./something, normalize it to + * a real name that can be mapped to a path. + * @param {String} name the relative name + * @param {String} baseName a real name that the name arg is relative + * to. + * @param {Boolean} applyMap apply the map config to the value. Should + * only be done if this normalization is for a dependency ID. + * @returns {String} normalized name + */ + function normalize(name, baseName, applyMap) { + var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment, + foundMap, foundI, foundStarMap, starI, + baseParts = baseName && baseName.split('/'), + normalizedBaseParts = baseParts, + map = config.map, + starMap = map && map['*']; + + //Adjust any relative paths. + if (name && name.charAt(0) === '.') { + //If have a base name, try to normalize against it, + //otherwise, assume it is a top-level require that will + //be relative to baseUrl in the end. + if (baseName) { + if (getOwn(config.pkgs, baseName)) { + //If the baseName is a package name, then just treat it as one + //name to concat the name with. + normalizedBaseParts = baseParts = [baseName]; + } else { + //Convert baseName to array, and lop off the last part, + //so that . matches that 'directory' and not name of the baseName's + //module. For instance, baseName of 'one/two/three', maps to + //'one/two/three.js', but we want the directory, 'one/two' for + //this normalization. + normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); + } + + name = normalizedBaseParts.concat(name.split('/')); + trimDots(name); + + //Some use of packages may use a . path to reference the + //'main' module name, so normalize for that. + pkgConfig = getOwn(config.pkgs, (pkgName = name[0])); + name = name.join('/'); + if (pkgConfig && name === pkgName + '/' + pkgConfig.main) { + name = pkgName; + } + } else if (name.indexOf('./') === 0) { + // No baseName, so this is ID is resolved relative + // to baseUrl, pull off the leading dot. + name = name.substring(2); + } + } + + //Apply map config if available. + if (applyMap && map && (baseParts || starMap)) { + nameParts = name.split('/'); + + for (i = nameParts.length; i > 0; i -= 1) { + nameSegment = nameParts.slice(0, i).join('/'); + + if (baseParts) { + //Find the longest baseName segment match in the config. + //So, do joins on the biggest to smallest lengths of baseParts. + for (j = baseParts.length; j > 0; j -= 1) { + mapValue = getOwn(map, baseParts.slice(0, j).join('/')); + + //baseName segment has config, find if it has one for + //this name. + if (mapValue) { + mapValue = getOwn(mapValue, nameSegment); + if (mapValue) { + //Match, update name to the new value. + foundMap = mapValue; + foundI = i; + break; + } + } + } + } + + if (foundMap) { + break; + } + + //Check for a star map match, but just hold on to it, + //if there is a shorter segment match later in a matching + //config, then favor over this star map. + if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) { + foundStarMap = getOwn(starMap, nameSegment); + starI = i; + } + } + + if (!foundMap && foundStarMap) { + foundMap = foundStarMap; + foundI = starI; + } + + if (foundMap) { + nameParts.splice(0, foundI, foundMap); + name = nameParts.join('/'); + } + } + + return name; + } + + function removeScript(name) { + if (isBrowser) { + each(scripts(), function (scriptNode) { + if (scriptNode.getAttribute('data-requiremodule') === name && + scriptNode.getAttribute('data-requirecontext') === context.contextName) { + scriptNode.parentNode.removeChild(scriptNode); + return true; + } + }); + } + } + + function hasPathFallback(id) { + var pathConfig = getOwn(config.paths, id); + if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) { + removeScript(id); + //Pop off the first array value, since it failed, and + //retry + pathConfig.shift(); + context.require.undef(id); + context.require([id]); + return true; + } + } + + //Turns a plugin!resource to [plugin, resource] + //with the plugin being undefined if the name + //did not have a plugin prefix. + function splitPrefix(name) { + var prefix, + index = name ? name.indexOf('!') : -1; + if (index > -1) { + prefix = name.substring(0, index); + name = name.substring(index + 1, name.length); + } + return [prefix, name]; + } + + /** + * Creates a module mapping that includes plugin prefix, module + * name, and path. If parentModuleMap is provided it will + * also normalize the name via require.normalize() + * + * @param {String} name the module name + * @param {String} [parentModuleMap] parent module map + * for the module name, used to resolve relative names. + * @param {Boolean} isNormalized: is the ID already normalized. + * This is true if this call is done for a define() module ID. + * @param {Boolean} applyMap: apply the map config to the ID. + * Should only be true if this map is for a dependency. + * + * @returns {Object} + */ + function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { + var url, pluginModule, suffix, nameParts, + prefix = null, + parentName = parentModuleMap ? parentModuleMap.name : null, + originalName = name, + isDefine = true, + normalizedName = ''; + + //If no name, then it means it is a require call, generate an + //internal name. + if (!name) { + isDefine = false; + name = '_@r' + (requireCounter += 1); + } + + nameParts = splitPrefix(name); + prefix = nameParts[0]; + name = nameParts[1]; + + if (prefix) { + prefix = normalize(prefix, parentName, applyMap); + pluginModule = getOwn(defined, prefix); + } + + //Account for relative paths if there is a base name. + if (name) { + if (prefix) { + if (pluginModule && pluginModule.normalize) { + //Plugin is loaded, use its normalize method. + normalizedName = pluginModule.normalize(name, function (name) { + return normalize(name, parentName, applyMap); + }); + } else { + normalizedName = normalize(name, parentName, applyMap); + } + } else { + //A regular module. + normalizedName = normalize(name, parentName, applyMap); + + //Normalized name may be a plugin ID due to map config + //application in normalize. The map config values must + //already be normalized, so do not need to redo that part. + nameParts = splitPrefix(normalizedName); + prefix = nameParts[0]; + normalizedName = nameParts[1]; + isNormalized = true; + + url = context.nameToUrl(normalizedName); + } + } + + //If the id is a plugin id that cannot be determined if it needs + //normalization, stamp it with a unique ID so two matching relative + //ids that may conflict can be separate. + suffix = prefix && !pluginModule && !isNormalized ? + '_unnormalized' + (unnormalizedCounter += 1) : + ''; + + return { + prefix: prefix, + name: normalizedName, + parentMap: parentModuleMap, + unnormalized: !!suffix, + url: url, + originalName: originalName, + isDefine: isDefine, + id: (prefix ? + prefix + '!' + normalizedName : + normalizedName) + suffix + }; + } + + function getModule(depMap) { + var id = depMap.id, + mod = getOwn(registry, id); + + if (!mod) { + mod = registry[id] = new context.Module(depMap); + } + + return mod; + } + + function on(depMap, name, fn) { + var id = depMap.id, + mod = getOwn(registry, id); + + if (hasProp(defined, id) && + (!mod || mod.defineEmitComplete)) { + if (name === 'defined') { + fn(defined[id]); + } + } else { + getModule(depMap).on(name, fn); + } + } + + function onError(err, errback) { + var ids = err.requireModules, + notified = false; + + if (errback) { + errback(err); + } else { + each(ids, function (id) { + var mod = getOwn(registry, id); + if (mod) { + //Set error on module, so it skips timeout checks. + mod.error = err; + if (mod.events.error) { + notified = true; + mod.emit('error', err); + } + } + }); + + if (!notified) { + req.onError(err); + } + } + } + + /** + * Internal method to transfer globalQueue items to this context's + * defQueue. + */ + function takeGlobalQueue() { + //Push all the globalDefQueue items into the context's defQueue + if (globalDefQueue.length) { + //Array splice in the values since the context code has a + //local var ref to defQueue, so cannot just reassign the one + //on context. + apsp.apply(defQueue, + [defQueue.length - 1, 0].concat(globalDefQueue)); + globalDefQueue = []; + } + } + + handlers = { + 'require': function (mod) { + if (mod.require) { + return mod.require; + } else { + return (mod.require = context.makeRequire(mod.map)); + } + }, + 'exports': function (mod) { + mod.usingExports = true; + if (mod.map.isDefine) { + if (mod.exports) { + return mod.exports; + } else { + return (mod.exports = defined[mod.map.id] = {}); + } + } + }, + 'module': function (mod) { + if (mod.module) { + return mod.module; + } else { + return (mod.module = { + id: mod.map.id, + uri: mod.map.url, + config: function () { + return (config.config && getOwn(config.config, mod.map.id)) || {}; + }, + exports: defined[mod.map.id] + }); + } + } + }; + + function cleanRegistry(id) { + //Clean up machinery used for waiting modules. + delete registry[id]; + delete enabledRegistry[id]; + } + + function breakCycle(mod, traced, processed) { + var id = mod.map.id; + + if (mod.error) { + mod.emit('error', mod.error); + } else { + traced[id] = true; + each(mod.depMaps, function (depMap, i) { + var depId = depMap.id, + dep = getOwn(registry, depId); + + //Only force things that have not completed + //being defined, so still in the registry, + //and only if it has not been matched up + //in the module already. + if (dep && !mod.depMatched[i] && !processed[depId]) { + if (getOwn(traced, depId)) { + mod.defineDep(i, defined[depId]); + mod.check(); //pass false? + } else { + breakCycle(dep, traced, processed); + } + } + }); + processed[id] = true; + } + } + + function checkLoaded() { + var map, modId, err, usingPathFallback, + waitInterval = config.waitSeconds * 1000, + //It is possible to disable the wait interval by using waitSeconds of 0. + expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), + noLoads = [], + reqCalls = [], + stillLoading = false, + needCycleCheck = true; + + //Do not bother if this call was a result of a cycle break. + if (inCheckLoaded) { + return; + } + + inCheckLoaded = true; + + //Figure out the state of all the modules. + eachProp(enabledRegistry, function (mod) { + map = mod.map; + modId = map.id; + + //Skip things that are not enabled or in error state. + if (!mod.enabled) { + return; + } + + if (!map.isDefine) { + reqCalls.push(mod); + } + + if (!mod.error) { + //If the module should be executed, and it has not + //been inited and time is up, remember it. + if (!mod.inited && expired) { + if (hasPathFallback(modId)) { + usingPathFallback = true; + stillLoading = true; + } else { + noLoads.push(modId); + removeScript(modId); + } + } else if (!mod.inited && mod.fetched && map.isDefine) { + stillLoading = true; + if (!map.prefix) { + //No reason to keep looking for unfinished + //loading. If the only stillLoading is a + //plugin resource though, keep going, + //because it may be that a plugin resource + //is waiting on a non-plugin cycle. + return (needCycleCheck = false); + } + } + } + }); + + if (expired && noLoads.length) { + //If wait time expired, throw error of unloaded modules. + err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads); + err.contextName = context.contextName; + return onError(err); + } + + //Not expired, check for a cycle. + if (needCycleCheck) { + each(reqCalls, function (mod) { + breakCycle(mod, {}, {}); + }); + } + + //If still waiting on loads, and the waiting load is something + //other than a plugin resource, or there are still outstanding + //scripts, then just try back later. + if ((!expired || usingPathFallback) && stillLoading) { + //Something is still waiting to load. Wait for it, but only + //if a timeout is not already in effect. + if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { + checkLoadedTimeoutId = setTimeout(function () { + checkLoadedTimeoutId = 0; + checkLoaded(); + }, 50); + } + } + + inCheckLoaded = false; + } + + Module = function (map) { + this.events = getOwn(undefEvents, map.id) || {}; + this.map = map; + this.shim = getOwn(config.shim, map.id); + this.depExports = []; + this.depMaps = []; + this.depMatched = []; + this.pluginMaps = {}; + this.depCount = 0; + + /* this.exports this.factory + this.depMaps = [], + this.enabled, this.fetched + */ + }; + + Module.prototype = { + init: function (depMaps, factory, errback, options) { + options = options || {}; + + //Do not do more inits if already done. Can happen if there + //are multiple define calls for the same module. That is not + //a normal, common case, but it is also not unexpected. + if (this.inited) { + return; + } + + this.factory = factory; + + if (errback) { + //Register for errors on this module. + this.on('error', errback); + } else if (this.events.error) { + //If no errback already, but there are error listeners + //on this module, set up an errback to pass to the deps. + errback = bind(this, function (err) { + this.emit('error', err); + }); + } + + //Do a copy of the dependency array, so that + //source inputs are not modified. For example + //"shim" deps are passed in here directly, and + //doing a direct modification of the depMaps array + //would affect that config. + this.depMaps = depMaps && depMaps.slice(0); + + this.errback = errback; + + //Indicate this module has be initialized + this.inited = true; + + this.ignore = options.ignore; + + //Could have option to init this module in enabled mode, + //or could have been previously marked as enabled. However, + //the dependencies are not known until init is called. So + //if enabled previously, now trigger dependencies as enabled. + if (options.enabled || this.enabled) { + //Enable this module and dependencies. + //Will call this.check() + this.enable(); + } else { + this.check(); + } + }, + + defineDep: function (i, depExports) { + //Because of cycles, defined callback for a given + //export can be called more than once. + if (!this.depMatched[i]) { + this.depMatched[i] = true; + this.depCount -= 1; + this.depExports[i] = depExports; + } + }, + + fetch: function () { + if (this.fetched) { + return; + } + this.fetched = true; + + context.startTime = (new Date()).getTime(); + + var map = this.map; + + //If the manager is for a plugin managed resource, + //ask the plugin to load it now. + if (this.shim) { + context.makeRequire(this.map, { + enableBuildCallback: true + })(this.shim.deps || [], bind(this, function () { + return map.prefix ? this.callPlugin() : this.load(); + })); + } else { + //Regular dependency. + return map.prefix ? this.callPlugin() : this.load(); + } + }, + + load: function () { + var url = this.map.url; + + //Regular dependency. + if (!urlFetched[url]) { + urlFetched[url] = true; + context.load(this.map.id, url); + } + }, + + /** + * Checks if the module is ready to define itself, and if so, + * define it. + */ + check: function () { + if (!this.enabled || this.enabling) { + return; + } + + var err, cjsModule, + id = this.map.id, + depExports = this.depExports, + exports = this.exports, + factory = this.factory; + + if (!this.inited) { + this.fetch(); + } else if (this.error) { + this.emit('error', this.error); + } else if (!this.defining) { + //The factory could trigger another require call + //that would result in checking this module to + //define itself again. If already in the process + //of doing that, skip this work. + this.defining = true; + + if (this.depCount < 1 && !this.defined) { + if (isFunction(factory)) { + //If there is an error listener, favor passing + //to that instead of throwing an error. + if (this.events.error) { + try { + exports = context.execCb(id, factory, depExports, exports); + } catch (e) { + err = e; + } + } else { + exports = context.execCb(id, factory, depExports, exports); + } + + if (this.map.isDefine) { + //If setting exports via 'module' is in play, + //favor that over return value and exports. After that, + //favor a non-undefined return value over exports use. + cjsModule = this.module; + if (cjsModule && + cjsModule.exports !== undefined && + //Make sure it is not already the exports value + cjsModule.exports !== this.exports) { + exports = cjsModule.exports; + } else if (exports === undefined && this.usingExports) { + //exports already set the defined value. + exports = this.exports; + } + } + + if (err) { + err.requireMap = this.map; + err.requireModules = [this.map.id]; + err.requireType = 'define'; + return onError((this.error = err)); + } + + } else { + //Just a literal value + exports = factory; + } + + this.exports = exports; + + if (this.map.isDefine && !this.ignore) { + defined[id] = exports; + + if (req.onResourceLoad) { + req.onResourceLoad(context, this.map, this.depMaps); + } + } + + //Clean up + cleanRegistry(id); + + this.defined = true; + } + + //Finished the define stage. Allow calling check again + //to allow define notifications below in the case of a + //cycle. + this.defining = false; + + if (this.defined && !this.defineEmitted) { + this.defineEmitted = true; + this.emit('defined', this.exports); + this.defineEmitComplete = true; + } + + } + }, + + callPlugin: function () { + var map = this.map, + id = map.id, + //Map already normalized the prefix. + pluginMap = makeModuleMap(map.prefix); + + //Mark this as a dependency for this plugin, so it + //can be traced for cycles. + this.depMaps.push(pluginMap); + + on(pluginMap, 'defined', bind(this, function (plugin) { + var load, normalizedMap, normalizedMod, + name = this.map.name, + parentName = this.map.parentMap ? this.map.parentMap.name : null, + localRequire = context.makeRequire(map.parentMap, { + enableBuildCallback: true + }); + + //If current map is not normalized, wait for that + //normalized name to load instead of continuing. + if (this.map.unnormalized) { + //Normalize the ID if the plugin allows it. + if (plugin.normalize) { + name = plugin.normalize(name, function (name) { + return normalize(name, parentName, true); + }) || ''; + } + + //prefix and name should already be normalized, no need + //for applying map config again either. + normalizedMap = makeModuleMap(map.prefix + '!' + name, + this.map.parentMap); + on(normalizedMap, + 'defined', bind(this, function (value) { + this.init([], function () { return value; }, null, { + enabled: true, + ignore: true + }); + })); + + normalizedMod = getOwn(registry, normalizedMap.id); + if (normalizedMod) { + //Mark this as a dependency for this plugin, so it + //can be traced for cycles. + this.depMaps.push(normalizedMap); + + if (this.events.error) { + normalizedMod.on('error', bind(this, function (err) { + this.emit('error', err); + })); + } + normalizedMod.enable(); + } + + return; + } + + load = bind(this, function (value) { + this.init([], function () { return value; }, null, { + enabled: true + }); + }); + + load.error = bind(this, function (err) { + this.inited = true; + this.error = err; + err.requireModules = [id]; + + //Remove temp unnormalized modules for this module, + //since they will never be resolved otherwise now. + eachProp(registry, function (mod) { + if (mod.map.id.indexOf(id + '_unnormalized') === 0) { + cleanRegistry(mod.map.id); + } + }); + + onError(err); + }); + + //Allow plugins to load other code without having to know the + //context or how to 'complete' the load. + load.fromText = bind(this, function (text, textAlt) { + /*jslint evil: true */ + var moduleName = map.name, + moduleMap = makeModuleMap(moduleName), + hasInteractive = useInteractive; + + //As of 2.1.0, support just passing the text, to reinforce + //fromText only being called once per resource. Still + //support old style of passing moduleName but discard + //that moduleName in favor of the internal ref. + if (textAlt) { + text = textAlt; + } + + //Turn off interactive script matching for IE for any define + //calls in the text, then turn it back on at the end. + if (hasInteractive) { + useInteractive = false; + } + + //Prime the system by creating a module instance for + //it. + getModule(moduleMap); + + //Transfer any config to this other module. + if (hasProp(config.config, id)) { + config.config[moduleName] = config.config[id]; + } + + try { + req.exec(text); + } catch (e) { + return onError(makeError('fromtexteval', + 'fromText eval for ' + id + + ' failed: ' + e, + e, + [id])); + } + + if (hasInteractive) { + useInteractive = true; + } + + //Mark this as a dependency for the plugin + //resource + this.depMaps.push(moduleMap); + + //Support anonymous modules. + context.completeLoad(moduleName); + + //Bind the value of that module to the value for this + //resource ID. + localRequire([moduleName], load); + }); + + //Use parentName here since the plugin's name is not reliable, + //could be some weird string with no path that actually wants to + //reference the parentName's path. + plugin.load(map.name, localRequire, load, config); + })); + + context.enable(pluginMap, this); + this.pluginMaps[pluginMap.id] = pluginMap; + }, + + enable: function () { + enabledRegistry[this.map.id] = this; + this.enabled = true; + + //Set flag mentioning that the module is enabling, + //so that immediate calls to the defined callbacks + //for dependencies do not trigger inadvertent load + //with the depCount still being zero. + this.enabling = true; + + //Enable each dependency + each(this.depMaps, bind(this, function (depMap, i) { + var id, mod, handler; + + if (typeof depMap === 'string') { + //Dependency needs to be converted to a depMap + //and wired up to this module. + depMap = makeModuleMap(depMap, + (this.map.isDefine ? this.map : this.map.parentMap), + false, + !this.skipMap); + this.depMaps[i] = depMap; + + handler = getOwn(handlers, depMap.id); + + if (handler) { + this.depExports[i] = handler(this); + return; + } + + this.depCount += 1; + + on(depMap, 'defined', bind(this, function (depExports) { + this.defineDep(i, depExports); + this.check(); + })); + + if (this.errback) { + on(depMap, 'error', this.errback); + } + } + + id = depMap.id; + mod = registry[id]; + + //Skip special modules like 'require', 'exports', 'module' + //Also, don't call enable if it is already enabled, + //important in circular dependency cases. + if (!hasProp(handlers, id) && mod && !mod.enabled) { + context.enable(depMap, this); + } + })); + + //Enable each plugin that is used in + //a dependency + eachProp(this.pluginMaps, bind(this, function (pluginMap) { + var mod = getOwn(registry, pluginMap.id); + if (mod && !mod.enabled) { + context.enable(pluginMap, this); + } + })); + + this.enabling = false; + + this.check(); + }, + + on: function (name, cb) { + var cbs = this.events[name]; + if (!cbs) { + cbs = this.events[name] = []; + } + cbs.push(cb); + }, + + emit: function (name, evt) { + each(this.events[name], function (cb) { + cb(evt); + }); + if (name === 'error') { + //Now that the error handler was triggered, remove + //the listeners, since this broken Module instance + //can stay around for a while in the registry. + delete this.events[name]; + } + } + }; + + function callGetModule(args) { + //Skip modules already defined. + if (!hasProp(defined, args[0])) { + getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]); + } + } + + function removeListener(node, func, name, ieName) { + //Favor detachEvent because of IE9 + //issue, see attachEvent/addEventListener comment elsewhere + //in this file. + if (node.detachEvent && !isOpera) { + //Probably IE. If not it will throw an error, which will be + //useful to know. + if (ieName) { + node.detachEvent(ieName, func); + } + } else { + node.removeEventListener(name, func, false); + } + } + + /** + * Given an event from a script node, get the requirejs info from it, + * and then removes the event listeners on the node. + * @param {Event} evt + * @returns {Object} + */ + function getScriptData(evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + var node = evt.currentTarget || evt.srcElement; + + //Remove the listeners once here. + removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange'); + removeListener(node, context.onScriptError, 'error'); + + return { + node: node, + id: node && node.getAttribute('data-requiremodule') + }; + } + + function intakeDefines() { + var args; + + //Any defined modules in the global queue, intake them now. + takeGlobalQueue(); + + //Make sure any remaining defQueue items get properly processed. + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])); + } else { + //args are id, deps, factory. Should be normalized by the + //define() function. + callGetModule(args); + } + } + } + + context = { + config: config, + contextName: contextName, + registry: registry, + defined: defined, + urlFetched: urlFetched, + defQueue: defQueue, + Module: Module, + makeModuleMap: makeModuleMap, + nextTick: req.nextTick, + onError: onError, + + /** + * Set a configuration for the context. + * @param {Object} cfg config object to integrate. + */ + configure: function (cfg) { + //Make sure the baseUrl ends in a slash. + if (cfg.baseUrl) { + if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { + cfg.baseUrl += '/'; + } + } + + //Save off the paths and packages since they require special processing, + //they are additive. + var pkgs = config.pkgs, + shim = config.shim, + objs = { + paths: true, + config: true, + map: true + }; + + eachProp(cfg, function (value, prop) { + if (objs[prop]) { + if (prop === 'map') { + if (!config.map) { + config.map = {}; + } + mixin(config[prop], value, true, true); + } else { + mixin(config[prop], value, true); + } + } else { + config[prop] = value; + } + }); + + //Merge shim + if (cfg.shim) { + eachProp(cfg.shim, function (value, id) { + //Normalize the structure + if (isArray(value)) { + value = { + deps: value + }; + } + if ((value.exports || value.init) && !value.exportsFn) { + value.exportsFn = context.makeShimExports(value); + } + shim[id] = value; + }); + config.shim = shim; + } + + //Adjust packages if necessary. + if (cfg.packages) { + each(cfg.packages, function (pkgObj) { + var location; + + pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj; + location = pkgObj.location; + + //Create a brand new object on pkgs, since currentPackages can + //be passed in again, and config.pkgs is the internal transformed + //state for all package configs. + pkgs[pkgObj.name] = { + name: pkgObj.name, + location: location || pkgObj.name, + //Remove leading dot in main, so main paths are normalized, + //and remove any trailing .js, since different package + //envs have different conventions: some use a module name, + //some use a file name. + main: (pkgObj.main || 'main') + .replace(currDirRegExp, '') + .replace(jsSuffixRegExp, '') + }; + }); + + //Done with modifications, assing packages back to context config + config.pkgs = pkgs; + } + + //If there are any "waiting to execute" modules in the registry, + //update the maps for them, since their info, like URLs to load, + //may have changed. + eachProp(registry, function (mod, id) { + //If module already has init called, since it is too + //late to modify them, and ignore unnormalized ones + //since they are transient. + if (!mod.inited && !mod.map.unnormalized) { + mod.map = makeModuleMap(id); + } + }); + + //If a deps array or a config callback is specified, then call + //require with those args. This is useful when require is defined as a + //config object before require.js is loaded. + if (cfg.deps || cfg.callback) { + context.require(cfg.deps || [], cfg.callback); + } + }, + + makeShimExports: function (value) { + function fn() { + var ret; + if (value.init) { + ret = value.init.apply(global, arguments); + } + return ret || (value.exports && getGlobal(value.exports)); + } + return fn; + }, + + makeRequire: function (relMap, options) { + options = options || {}; + + function localRequire(deps, callback, errback) { + var id, map, requireMod; + + if (options.enableBuildCallback && callback && isFunction(callback)) { + callback.__requireJsBuild = true; + } + + if (typeof deps === 'string') { + if (isFunction(callback)) { + //Invalid call + return onError(makeError('requireargs', 'Invalid require call'), errback); + } + + //If require|exports|module are requested, get the + //value for them from the special handlers. Caveat: + //this only works while module is being defined. + if (relMap && hasProp(handlers, deps)) { + return handlers[deps](registry[relMap.id]); + } + + //Synchronous access to one module. If require.get is + //available (as in the Node adapter), prefer that. + if (req.get) { + return req.get(context, deps, relMap, localRequire); + } + + //Normalize module name, if it contains . or .. + map = makeModuleMap(deps, relMap, false, true); + id = map.id; + + if (!hasProp(defined, id)) { + return onError(makeError('notloaded', 'Module name "' + + id + + '" has not been loaded yet for context: ' + + contextName + + (relMap ? '' : '. Use require([])'))); + } + return defined[id]; + } + + //Grab defines waiting in the global queue. + intakeDefines(); + + //Mark all the dependencies as needing to be loaded. + context.nextTick(function () { + //Some defines could have been added since the + //require call, collect them. + intakeDefines(); + + requireMod = getModule(makeModuleMap(null, relMap)); + + //Store if map config should be applied to this require + //call for dependencies. + requireMod.skipMap = options.skipMap; + + requireMod.init(deps, callback, errback, { + enabled: true + }); + + checkLoaded(); + }); + + return localRequire; + } + + mixin(localRequire, { + isBrowser: isBrowser, + + /** + * Converts a module name + .extension into an URL path. + * *Requires* the use of a module name. It does not support using + * plain URLs like nameToUrl. + */ + toUrl: function (moduleNamePlusExt) { + var ext, + index = moduleNamePlusExt.lastIndexOf('.'), + segment = moduleNamePlusExt.split('/')[0], + isRelative = segment === '.' || segment === '..'; + + //Have a file extension alias, and it is not the + //dots from a relative path. + if (index !== -1 && (!isRelative || index > 1)) { + ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); + moduleNamePlusExt = moduleNamePlusExt.substring(0, index); + } + + return context.nameToUrl(normalize(moduleNamePlusExt, + relMap && relMap.id, true), ext, true); + }, + + defined: function (id) { + return hasProp(defined, makeModuleMap(id, relMap, false, true).id); + }, + + specified: function (id) { + id = makeModuleMap(id, relMap, false, true).id; + return hasProp(defined, id) || hasProp(registry, id); + } + }); + + //Only allow undef on top level require calls + if (!relMap) { + localRequire.undef = function (id) { + //Bind any waiting define() calls to this context, + //fix for #408 + takeGlobalQueue(); + + var map = makeModuleMap(id, relMap, true), + mod = getOwn(registry, id); + + delete defined[id]; + delete urlFetched[map.url]; + delete undefEvents[id]; + + if (mod) { + //Hold on to listeners in case the + //module will be attempted to be reloaded + //using a different config. + if (mod.events.defined) { + undefEvents[id] = mod.events; + } + + cleanRegistry(id); + } + }; + } + + return localRequire; + }, + + /** + * Called to enable a module if it is still in the registry + * awaiting enablement. A second arg, parent, the parent module, + * is passed in for context, when this method is overriden by + * the optimizer. Not shown here to keep code compact. + */ + enable: function (depMap) { + var mod = getOwn(registry, depMap.id); + if (mod) { + getModule(depMap).enable(); + } + }, + + /** + * Internal method used by environment adapters to complete a load event. + * A load event could be a script load or just a load pass from a synchronous + * load call. + * @param {String} moduleName the name of the module to potentially complete. + */ + completeLoad: function (moduleName) { + var found, args, mod, + shim = getOwn(config.shim, moduleName) || {}, + shExports = shim.exports; + + takeGlobalQueue(); + + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + args[0] = moduleName; + //If already found an anonymous module and bound it + //to this name, then this is some other anon module + //waiting for its completeLoad to fire. + if (found) { + break; + } + found = true; + } else if (args[0] === moduleName) { + //Found matching define call for this script! + found = true; + } + + callGetModule(args); + } + + //Do this after the cycle of callGetModule in case the result + //of those calls/init calls changes the registry. + mod = getOwn(registry, moduleName); + + if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) { + if (config.enforceDefine && (!shExports || !getGlobal(shExports))) { + if (hasPathFallback(moduleName)) { + return; + } else { + return onError(makeError('nodefine', + 'No define call for ' + moduleName, + null, + [moduleName])); + } + } else { + //A script that does not call define(), so just simulate + //the call for it. + callGetModule([moduleName, (shim.deps || []), shim.exportsFn]); + } + } + + checkLoaded(); + }, + + /** + * Converts a module name to a file path. Supports cases where + * moduleName may actually be just an URL. + * Note that it **does not** call normalize on the moduleName, + * it is assumed to have already been normalized. This is an + * internal API, not a public one. Use toUrl for the public API. + */ + nameToUrl: function (moduleName, ext, skipExt) { + var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url, + parentPath; + + //If a colon is in the URL, it indicates a protocol is used and it is just + //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) + //or ends with .js, then assume the user meant to use an url and not a module id. + //The slash is important for protocol-less URLs as well as full paths. + if (req.jsExtRegExp.test(moduleName)) { + //Just a plain path, not module name lookup, so just return it. + //Add extension if it is included. This is a bit wonky, only non-.js things pass + //an extension, this method probably needs to be reworked. + url = moduleName + (ext || ''); + } else { + //A module that needs to be converted to a path. + paths = config.paths; + pkgs = config.pkgs; + + syms = moduleName.split('/'); + //For each module name segment, see if there is a path + //registered for it. Start with most specific name + //and work up from it. + for (i = syms.length; i > 0; i -= 1) { + parentModule = syms.slice(0, i).join('/'); + pkg = getOwn(pkgs, parentModule); + parentPath = getOwn(paths, parentModule); + if (parentPath) { + //If an array, it means there are a few choices, + //Choose the one that is desired + if (isArray(parentPath)) { + parentPath = parentPath[0]; + } + syms.splice(0, i, parentPath); + break; + } else if (pkg) { + //If module name is just the package name, then looking + //for the main module. + if (moduleName === pkg.name) { + pkgPath = pkg.location + '/' + pkg.main; + } else { + pkgPath = pkg.location; + } + syms.splice(0, i, pkgPath); + break; + } + } + + //Join the path parts together, then figure out if baseUrl is needed. + url = syms.join('/'); + url += (ext || (/\?/.test(url) || skipExt ? '' : '.js')); + url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url; + } + + return config.urlArgs ? url + + ((url.indexOf('?') === -1 ? '?' : '&') + + config.urlArgs) : url; + }, + + //Delegates to req.load. Broken out as a separate function to + //allow overriding in the optimizer. + load: function (id, url) { + req.load(context, id, url); + }, + + /** + * Executes a module callack function. Broken out as a separate function + * solely to allow the build system to sequence the files in the built + * layer in the right sequence. + * + * @private + */ + execCb: function (name, callback, args, exports) { + return callback.apply(exports, args); + }, + + /** + * callback for script loads, used to check status of loading. + * + * @param {Event} evt the event from the browser for the script + * that was loaded. + */ + onScriptLoad: function (evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + if (evt.type === 'load' || + (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) { + //Reset interactive script so a script node is not held onto for + //to long. + interactiveScript = null; + + //Pull out the name of the module and the context. + var data = getScriptData(evt); + context.completeLoad(data.id); + } + }, + + /** + * Callback for script errors. + */ + onScriptError: function (evt) { + var data = getScriptData(evt); + if (!hasPathFallback(data.id)) { + return onError(makeError('scripterror', 'Script error', evt, [data.id])); + } + } + }; + + context.require = context.makeRequire(); + return context; + } + + /** + * Main entry point. + * + * If the only argument to require is a string, then the module that + * is represented by that string is fetched for the appropriate context. + * + * If the first argument is an array, then it will be treated as an array + * of dependency string names to fetch. An optional function callback can + * be specified to execute when all of those dependencies are available. + * + * Make a local req variable to help Caja compliance (it assumes things + * on a require that are not standardized), and to give a short + * name for minification/local scope use. + */ + req = requirejs = function (deps, callback, errback, optional) { + + //Find the right context, use default + var context, config, + contextName = defContextName; + + // Determine if have config object in the call. + if (!isArray(deps) && typeof deps !== 'string') { + // deps is a config object + config = deps; + if (isArray(callback)) { + // Adjust args if there are dependencies + deps = callback; + callback = errback; + errback = optional; + } else { + deps = []; + } + } + + if (config && config.context) { + contextName = config.context; + } + + context = getOwn(contexts, contextName); + if (!context) { + context = contexts[contextName] = req.s.newContext(contextName); + } + + if (config) { + context.configure(config); + } + + return context.require(deps, callback, errback); + }; + + /** + * Support require.config() to make it easier to cooperate with other + * AMD loaders on globally agreed names. + */ + req.config = function (config) { + return req(config); + }; + + /** + * Execute something after the current tick + * of the event loop. Override for other envs + * that have a better solution than setTimeout. + * @param {Function} fn function to execute later. + */ + req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) { + setTimeout(fn, 4); + } : function (fn) { fn(); }; + + /** + * Export require as a global, but only if it does not already exist. + */ + if (!require) { + require = req; + } + + req.version = version; + + //Used to filter out dependencies that are already paths. + req.jsExtRegExp = /^\/|:|\?|\.js$/; + req.isBrowser = isBrowser; + s = req.s = { + contexts: contexts, + newContext: newContext + }; + + //Create default context. + req({}); + + //Exports some context-sensitive methods on global require. + each([ + 'toUrl', + 'undef', + 'defined', + 'specified' + ], function (prop) { + //Reference from contexts instead of early binding to default context, + //so that during builds, the latest instance of the default context + //with its config gets used. + req[prop] = function () { + var ctx = contexts[defContextName]; + return ctx.require[prop].apply(ctx, arguments); + }; + }); + + if (isBrowser) { + head = s.head = document.getElementsByTagName('head')[0]; + //If BASE tag is in play, using appendChild is a problem for IE6. + //When that browser dies, this can be removed. Details in this jQuery bug: + //http://dev.jquery.com/ticket/2709 + baseElement = document.getElementsByTagName('base')[0]; + if (baseElement) { + head = s.head = baseElement.parentNode; + } + } + + /** + * Any errors that require explicitly generates will be passed to this + * function. Intercept/override it if you want custom error handling. + * @param {Error} err the error object. + */ + req.onError = function (err) { + throw err; + }; + + /** + * Does the request to load a module for the browser case. + * Make this a separate function to allow other environments + * to override it. + * + * @param {Object} context the require context to find state. + * @param {String} moduleName the name of the module. + * @param {Object} url the URL to the module. + */ + req.load = function (context, moduleName, url) { + var config = (context && context.config) || {}, + node; + if (isBrowser) { + //In the browser so use a script tag + node = config.xhtml ? + document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') : + document.createElement('script'); + node.type = config.scriptType || 'text/javascript'; + node.charset = 'utf-8'; + node.async = true; + + node.setAttribute('data-requirecontext', context.contextName); + node.setAttribute('data-requiremodule', moduleName); + + //Set up load listener. Test attachEvent first because IE9 has + //a subtle issue in its addEventListener and script onload firings + //that do not match the behavior of all other browsers with + //addEventListener support, which fire the onload event for a + //script right after the script execution. See: + //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution + //UNFORTUNATELY Opera implements attachEvent but does not follow the script + //script execution mode. + if (node.attachEvent && + //Check if node.attachEvent is artificially added by custom script or + //natively supported by browser + //read https://github.com/jrburke/requirejs/issues/187 + //if we can NOT find [native code] then it must NOT natively supported. + //in IE8, node.attachEvent does not have toString() + //Note the test for "[native code" with no closing brace, see: + //https://github.com/jrburke/requirejs/issues/273 + !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && + !isOpera) { + //Probably IE. IE (at least 6-8) do not fire + //script onload right after executing the script, so + //we cannot tie the anonymous define call to a name. + //However, IE reports the script as being in 'interactive' + //readyState at the time of the define call. + useInteractive = true; + + node.attachEvent('onreadystatechange', context.onScriptLoad); + //It would be great to add an error handler here to catch + //404s in IE9+. However, onreadystatechange will fire before + //the error handler, so that does not help. If addEventListener + //is used, then IE will fire error before load, but we cannot + //use that pathway given the connect.microsoft.com issue + //mentioned above about not doing the 'script execute, + //then fire the script load event listener before execute + //next script' that other browsers do. + //Best hope: IE10 fixes the issues, + //and then destroys all installs of IE 6-9. + //node.attachEvent('onerror', context.onScriptError); + } else { + node.addEventListener('load', context.onScriptLoad, false); + node.addEventListener('error', context.onScriptError, false); + } + node.src = url; + + //For some cache cases in IE 6-8, the script executes before the end + //of the appendChild execution, so to tie an anonymous define + //call to the module name (which is stored on the node), hold on + //to a reference to this node, but clear after the DOM insertion. + currentlyAddingScript = node; + if (baseElement) { + head.insertBefore(node, baseElement); + } else { + head.appendChild(node); + } + currentlyAddingScript = null; + + return node; + } else if (isWebWorker) { + try { + //In a web worker, use importScripts. This is not a very + //efficient use of importScripts, importScripts will block until + //its script is downloaded and evaluated. However, if web workers + //are in play, the expectation that a build has been done so that + //only one script needs to be loaded anyway. This may need to be + //reevaluated if other use cases become common. + importScripts(url); + + //Account for anonymous modules + context.completeLoad(moduleName); + } catch (e) { + context.onError(makeError('importscripts', + 'importScripts failed for ' + + moduleName + ' at ' + url, + e, + [moduleName])); + } + } + }; + + function getInteractiveScript() { + if (interactiveScript && interactiveScript.readyState === 'interactive') { + return interactiveScript; + } + + eachReverse(scripts(), function (script) { + if (script.readyState === 'interactive') { + return (interactiveScript = script); + } + }); + return interactiveScript; + } + + //Look for a data-main script attribute, which could also adjust the baseUrl. + if (isBrowser) { + //Figure out baseUrl. Get it from the script tag with require.js in it. + eachReverse(scripts(), function (script) { + //Set the 'head' where we can append children by + //using the script's parent. + if (!head) { + head = script.parentNode; + } + + //Look for a data-main attribute to set main script for the page + //to load. If it is there, the path to data main becomes the + //baseUrl, if it is not already set. + dataMain = script.getAttribute('data-main'); + if (dataMain) { + //Set final baseUrl if there is not already an explicit one. + if (!cfg.baseUrl) { + //Pull off the directory of data-main for use as the + //baseUrl. + src = dataMain.split('/'); + mainScript = src.pop(); + subPath = src.length ? src.join('/') + '/' : './'; + + cfg.baseUrl = subPath; + dataMain = mainScript; + } + + //Strip off any trailing .js since dataMain is now + //like a module name. + dataMain = dataMain.replace(jsSuffixRegExp, ''); + + //Put the data-main script in the files to load. + cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain]; + + return true; + } + }); + } + + /** + * The function that handles definitions of modules. Differs from + * require() in that a string for the module should be the first argument, + * and the function to execute after dependencies are loaded should + * return a value to define the module corresponding to the first argument's + * name. + */ + define = function (name, deps, callback) { + var node, context; + + //Allow for anonymous modules + if (typeof name !== 'string') { + //Adjust args appropriately + callback = deps; + deps = name; + name = null; + } + + //This module may not have dependencies + if (!isArray(deps)) { + callback = deps; + deps = []; + } + + //If no name, and callback is a function, then figure out if it a + //CommonJS thing with dependencies. + if (!deps.length && isFunction(callback)) { + //Remove comments from the callback string, + //look for require calls, and pull them into the dependencies, + //but only if there are function args. + if (callback.length) { + callback + .toString() + .replace(commentRegExp, '') + .replace(cjsRequireRegExp, function (match, dep) { + deps.push(dep); + }); + + //May be a CommonJS thing even without require calls, but still + //could use exports, and module. Avoid doing exports and module + //work though if it just needs require. + //REQUIRES the function to expect the CommonJS variables in the + //order listed below. + deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps); + } + } + + //If in IE 6-8 and hit an anonymous define() call, do the interactive + //work. + if (useInteractive) { + node = currentlyAddingScript || getInteractiveScript(); + if (node) { + if (!name) { + name = node.getAttribute('data-requiremodule'); + } + context = contexts[node.getAttribute('data-requirecontext')]; + } + } + + //Always save off evaluating the def call until the script onload handler. + //This allows multiple modules to be in a file without prematurely + //tracing dependencies, and allows for anonymous module support, + //where the module name is not known until the script onload event + //occurs. If no context, use the global queue, and get it processed + //in the onscript load callback. + (context ? context.defQueue : globalDefQueue).push([name, deps, callback]); + }; + + define.amd = { + jQuery: true + }; + + + /** + * Executes the text. Normally just uses eval, but can be modified + * to use a better, environment-specific call. Only used for transpiling + * loader plugins, not for plain JS modules. + * @param {String} text the text to execute/evaluate. + */ + req.exec = function (text) { + /*jslint evil: true */ + return eval(text); + }; + + //Set up with config info. + req(cfg); +}(this)); + +var components = { + "packages": [ + { + "name": "jplayer", + "main": "jplayer-built.js" + } + ], + "shim": { + "jplayer": { + "deps": [ + "jquery" + ] + } + }, + "baseUrl": "components" +}; +if (typeof require !== "undefined" && require.config) { + require.config(components); +} else { + var require = components; +} +if (typeof exports !== "undefined" && typeof module !== "undefined") { + module.exports = components; +} +define('jplayer', function (require, exports, module) { +/* + * jPlayer Plugin for jQuery JavaScript Library + * http://www.jplayer.org + * + * Copyright (c) 2009 - 2014 Happyworm Ltd + * Licensed under the MIT license. + * http://opensource.org/licenses/MIT + * + * Author: Mark J Panaghiston + * Version: 2.9.2 + * Date: 14th December 2014 + */ + +/* Support for Zepto 1.0 compiled with optional data module. + * For AMD or NODE/CommonJS support, you will need to manually switch the related 2 lines in the code below. + * Search terms: "jQuery Switch" and "Zepto Switch" + */ + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); // jQuery Switch + // define(['zepto'], factory); // Zepto Switch + } else if (typeof exports === 'object') { + // Node/CommonJS + factory(require('jquery')); // jQuery Switch + //factory(require('zepto')); // Zepto Switch + } else { + // Browser globals + if(root.jQuery) { // Use jQuery if available + factory(root.jQuery); + } else { // Otherwise, use Zepto + factory(root.Zepto); + } + } +}(this, function ($, undefined) { + + // Adapted from jquery.ui.widget.js (1.8.7): $.widget.bridge - Tweaked $.data(this,XYZ) to $(this).data(XYZ) for Zepto + $.fn.jPlayer = function( options ) { + var name = "jPlayer"; + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.charAt( 0 ) === "_" ) { + return returnValue; + } + + if ( isMethodCall ) { + this.each(function() { + var instance = $(this).data( name ), + methodValue = instance && $.isFunction( instance[options] ) ? + instance[ options ].apply( instance, args ) : + instance; + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $(this).data( name ); + if ( instance ) { + // instance.option( options || {} )._init(); // Orig jquery.ui.widget.js code: Not recommend for jPlayer. ie., Applying new options to an existing instance (via the jPlayer constructor) and performing the _init(). The _init() is what concerns me. It would leave a lot of event handlers acting on jPlayer instance and the interface. + instance.option( options || {} ); // The new constructor only changes the options. Changing options only has basic support atm. + } else { + $(this).data( name, new $.jPlayer( options, this ) ); + } + }); + } + + return returnValue; + }; + + $.jPlayer = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this.element = $(element); + this.options = $.extend(true, {}, + this.options, + options + ); + var self = this; + this.element.bind( "remove.jPlayer", function() { + self.destroy(); + }); + this._init(); + } + }; + // End of: (Adapted from jquery.ui.widget.js (1.8.7)) + + // Zepto is missing one of the animation methods. + if(typeof $.fn.stop !== 'function') { + $.fn.stop = function() {}; + } + + // Emulated HTML5 methods and properties + $.jPlayer.emulateMethods = "load play pause"; + $.jPlayer.emulateStatus = "src readyState networkState currentTime duration paused ended playbackRate"; + $.jPlayer.emulateOptions = "muted volume"; + + // Reserved event names generated by jPlayer that are not part of the HTML5 Media element spec + $.jPlayer.reservedEvent = "ready flashreset resize repeat error warning"; + + // Events generated by jPlayer + $.jPlayer.event = {}; + $.each( + [ + 'ready', + 'setmedia', // Fires when the media is set + 'flashreset', // Similar to the ready event if the Flash solution is set to display:none and then shown again or if it's reloaded for another reason by the browser. For example, using CSS position:fixed on Firefox for the full screen feature. + 'resize', // Occurs when the size changes through a full/restore screen operation or if the size/sizeFull options are changed. + 'repeat', // Occurs when the repeat status changes. Usually through clicks on the repeat button of the interface. + 'click', // Occurs when the user clicks on one of the following: poster image, html video, flash video. + 'error', // Event error code in event.jPlayer.error.type. See $.jPlayer.error + 'warning', // Event warning code in event.jPlayer.warning.type. See $.jPlayer.warning + + // Other events match HTML5 spec. + 'loadstart', + 'progress', + 'suspend', + 'abort', + 'emptied', + 'stalled', + 'play', + 'pause', + 'loadedmetadata', + 'loadeddata', + 'waiting', + 'playing', + 'canplay', + 'canplaythrough', + 'seeking', + 'seeked', + 'timeupdate', + 'ended', + 'ratechange', + 'durationchange', + 'volumechange' + ], + function() { + $.jPlayer.event[ this ] = 'jPlayer_' + this; + } + ); + + $.jPlayer.htmlEvent = [ // These HTML events are bubbled through to the jPlayer event, without any internal action. + "loadstart", + // "progress", // jPlayer uses internally before bubbling. + // "suspend", // jPlayer uses internally before bubbling. + "abort", + // "error", // jPlayer uses internally before bubbling. + "emptied", + "stalled", + // "play", // jPlayer uses internally before bubbling. + // "pause", // jPlayer uses internally before bubbling. + "loadedmetadata", + // "loadeddata", // jPlayer uses internally before bubbling. + // "waiting", // jPlayer uses internally before bubbling. + // "playing", // jPlayer uses internally before bubbling. + "canplay", + "canplaythrough" + // "seeking", // jPlayer uses internally before bubbling. + // "seeked", // jPlayer uses internally before bubbling. + // "timeupdate", // jPlayer uses internally before bubbling. + // "ended", // jPlayer uses internally before bubbling. + // "ratechange" // jPlayer uses internally before bubbling. + // "durationchange" // jPlayer uses internally before bubbling. + // "volumechange" // jPlayer uses internally before bubbling. + ]; + + $.jPlayer.pause = function() { + $.jPlayer.prototype.destroyRemoved(); + $.each($.jPlayer.prototype.instances, function(i, element) { + if(element.data("jPlayer").status.srcSet) { // Check that media is set otherwise would cause error event. + element.jPlayer("pause"); + } + }); + }; + + // Default for jPlayer option.timeFormat + $.jPlayer.timeFormat = { + showHour: false, + showMin: true, + showSec: true, + padHour: false, + padMin: true, + padSec: true, + sepHour: ":", + sepMin: ":", + sepSec: "" + }; + var ConvertTime = function() { + this.init(); + }; + ConvertTime.prototype = { + init: function() { + this.options = { + timeFormat: $.jPlayer.timeFormat + }; + }, + time: function(s) { // function used on jPlayer.prototype._convertTime to enable per instance options. + s = (s && typeof s === 'number') ? s : 0; + + var myTime = new Date(s * 1000), + hour = myTime.getUTCHours(), + min = this.options.timeFormat.showHour ? myTime.getUTCMinutes() : myTime.getUTCMinutes() + hour * 60, + sec = this.options.timeFormat.showMin ? myTime.getUTCSeconds() : myTime.getUTCSeconds() + min * 60, + strHour = (this.options.timeFormat.padHour && hour < 10) ? "0" + hour : hour, + strMin = (this.options.timeFormat.padMin && min < 10) ? "0" + min : min, + strSec = (this.options.timeFormat.padSec && sec < 10) ? "0" + sec : sec, + strTime = ""; + + strTime += this.options.timeFormat.showHour ? strHour + this.options.timeFormat.sepHour : ""; + strTime += this.options.timeFormat.showMin ? strMin + this.options.timeFormat.sepMin : ""; + strTime += this.options.timeFormat.showSec ? strSec + this.options.timeFormat.sepSec : ""; + + return strTime; + } + }; + var myConvertTime = new ConvertTime(); + $.jPlayer.convertTime = function(s) { + return myConvertTime.time(s); + }; + + // Adapting jQuery 1.4.4 code for jQuery.browser. Required since jQuery 1.3.2 does not detect Chrome as webkit. + $.jPlayer.uaBrowser = function( userAgent ) { + var ua = userAgent.toLowerCase(); + + // Useragent RegExp + var rwebkit = /(webkit)[ \/]([\w.]+)/; + var ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/; + var rmsie = /(msie) ([\w.]+)/; + var rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/; + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }; + + // Platform sniffer for detecting mobile devices + $.jPlayer.uaPlatform = function( userAgent ) { + var ua = userAgent.toLowerCase(); + + // Useragent RegExp + var rplatform = /(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/; + var rtablet = /(ipad|playbook)/; + var randroid = /(android)/; + var rmobile = /(mobile)/; + + var platform = rplatform.exec( ua ) || []; + var tablet = rtablet.exec( ua ) || + !rmobile.exec( ua ) && randroid.exec( ua ) || + []; + + if(platform[1]) { + platform[1] = platform[1].replace(/\s/g, "_"); // Change whitespace to underscore. Enables dot notation. + } + + return { platform: platform[1] || "", tablet: tablet[1] || "" }; + }; + + $.jPlayer.browser = { + }; + $.jPlayer.platform = { + }; + + var browserMatch = $.jPlayer.uaBrowser(navigator.userAgent); + if ( browserMatch.browser ) { + $.jPlayer.browser[ browserMatch.browser ] = true; + $.jPlayer.browser.version = browserMatch.version; + } + var platformMatch = $.jPlayer.uaPlatform(navigator.userAgent); + if ( platformMatch.platform ) { + $.jPlayer.platform[ platformMatch.platform ] = true; + $.jPlayer.platform.mobile = !platformMatch.tablet; + $.jPlayer.platform.tablet = !!platformMatch.tablet; + } + + // Internet Explorer (IE) Browser Document Mode Sniffer. Based on code at: + // http://msdn.microsoft.com/en-us/library/cc288325%28v=vs.85%29.aspx#GetMode + $.jPlayer.getDocMode = function() { + var docMode; + if ($.jPlayer.browser.msie) { + if (document.documentMode) { // IE8 or later + docMode = document.documentMode; + } else { // IE 5-7 + docMode = 5; // Assume quirks mode unless proven otherwise + if (document.compatMode) { + if (document.compatMode === "CSS1Compat") { + docMode = 7; // standards mode + } + } + } + } + return docMode; + }; + $.jPlayer.browser.documentMode = $.jPlayer.getDocMode(); + + $.jPlayer.nativeFeatures = { + init: function() { + + /* Fullscreen function naming influenced by W3C naming. + * No support for: Mozilla Proposal: https://wiki.mozilla.org/Gecko:FullScreenAPI + */ + + var d = document, + v = d.createElement('video'), + spec = { + // http://www.w3.org/TR/fullscreen/ + w3c: [ + 'fullscreenEnabled', + 'fullscreenElement', + 'requestFullscreen', + 'exitFullscreen', + 'fullscreenchange', + 'fullscreenerror' + ], + // https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode + moz: [ + 'mozFullScreenEnabled', + 'mozFullScreenElement', + 'mozRequestFullScreen', + 'mozCancelFullScreen', + 'mozfullscreenchange', + 'mozfullscreenerror' + ], + // http://developer.apple.com/library/safari/#documentation/WebKit/Reference/ElementClassRef/Element/Element.html + // http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html + webkit: [ + '', + 'webkitCurrentFullScreenElement', + 'webkitRequestFullScreen', + 'webkitCancelFullScreen', + 'webkitfullscreenchange', + '' + ], + // http://developer.apple.com/library/safari/#documentation/AudioVideo/Reference/HTMLVideoElementClassReference/HTMLVideoElement/HTMLVideoElement.html + // https://developer.apple.com/library/safari/samplecode/HTML5VideoEventFlow/Listings/events_js.html#//apple_ref/doc/uid/DTS40010085-events_js-DontLinkElementID_5 + // Events: 'webkitbeginfullscreen' and 'webkitendfullscreen' + webkitVideo: [ + 'webkitSupportsFullscreen', + 'webkitDisplayingFullscreen', + 'webkitEnterFullscreen', + 'webkitExitFullscreen', + '', + '' + ], + ms: [ + '', + 'msFullscreenElement', + 'msRequestFullscreen', + 'msExitFullscreen', + 'MSFullscreenChange', + 'MSFullscreenError' + ] + }, + specOrder = [ + 'w3c', + 'moz', + 'webkit', + 'webkitVideo', + 'ms' + ], + fs, i, il; + + this.fullscreen = fs = { + support: { + w3c: !!d[spec.w3c[0]], + moz: !!d[spec.moz[0]], + webkit: typeof d[spec.webkit[3]] === 'function', + webkitVideo: typeof v[spec.webkitVideo[2]] === 'function', + ms: typeof v[spec.ms[2]] === 'function' + }, + used: {} + }; + + // Store the name of the spec being used and as a handy boolean. + for(i = 0, il = specOrder.length; i < il; i++) { + var n = specOrder[i]; + if(fs.support[n]) { + fs.spec = n; + fs.used[n] = true; + break; + } + } + + if(fs.spec) { + var s = spec[fs.spec]; + fs.api = { + fullscreenEnabled: true, + fullscreenElement: function(elem) { + elem = elem ? elem : d; // Video element required for webkitVideo + return elem[s[1]]; + }, + requestFullscreen: function(elem) { + return elem[s[2]](); // Chrome and Opera want parameter (Element.ALLOW_KEYBOARD_INPUT) but Safari fails if flag used. + }, + exitFullscreen: function(elem) { + elem = elem ? elem : d; // Video element required for webkitVideo + return elem[s[3]](); + } + }; + fs.event = { + fullscreenchange: s[4], + fullscreenerror: s[5] + }; + } else { + fs.api = { + fullscreenEnabled: false, + fullscreenElement: function() { + return null; + }, + requestFullscreen: function() {}, + exitFullscreen: function() {} + }; + fs.event = {}; + } + } + }; + $.jPlayer.nativeFeatures.init(); + + // The keyboard control system. + + // The current jPlayer instance in focus. + $.jPlayer.focus = null; + + // The list of element node names to ignore with key controls. + $.jPlayer.keyIgnoreElementNames = "A INPUT TEXTAREA SELECT BUTTON"; + + // The function that deals with key presses. + var keyBindings = function(event) { + var f = $.jPlayer.focus, + ignoreKey; + + // A jPlayer instance must be in focus. ie., keyEnabled and the last one played. + if(f) { + // What generated the key press? + $.each( $.jPlayer.keyIgnoreElementNames.split(/\s+/g), function(i, name) { + // The strings should already be uppercase. + if(event.target.nodeName.toUpperCase() === name.toUpperCase()) { + ignoreKey = true; + return false; // exit each. + } + }); + if(!ignoreKey) { + // See if the key pressed matches any of the bindings. + $.each(f.options.keyBindings, function(action, binding) { + // The binding could be a null when the default has been disabled. ie., 1st clause in if() + if( + (binding && $.isFunction(binding.fn)) && + ((typeof binding.key === 'number' && event.which === binding.key) || + (typeof binding.key === 'string' && event.key === binding.key)) + ) { + event.preventDefault(); // Key being used by jPlayer, so prevent default operation. + binding.fn(f); + return false; // exit each. + } + }); + } + } + }; + + $.jPlayer.keys = function(en) { + var event = "keydown.jPlayer"; + // Remove any binding, just in case enabled more than once. + $(document.documentElement).unbind(event); + if(en) { + $(document.documentElement).bind(event, keyBindings); + } + }; + + // Enable the global key control handler ready for any jPlayer instance with the keyEnabled option enabled. + $.jPlayer.keys(true); + + $.jPlayer.prototype = { + count: 0, // Static Variable: Change it via prototype. + version: { // Static Object + script: "2.9.2", + needFlash: "2.9.0", + flash: "unknown" + }, + options: { // Instanced in $.jPlayer() constructor + swfPath: "js", // Path to jquery.jplayer.swf. Can be relative, absolute or server root relative. + solution: "html, flash", // Valid solutions: html, flash, aurora. Order defines priority. 1st is highest, + supplied: "mp3", // Defines which formats jPlayer will try and support and the priority by the order. 1st is highest, + auroraFormats: "wav", // List the aurora.js codecs being loaded externally. Its core supports "wav". Specify format in jPlayer context. EG., The aac.js codec gives the "m4a" format. + preload: 'metadata', // HTML5 Spec values: none, metadata, auto. + volume: 0.8, // The volume. Number 0 to 1. + muted: false, + remainingDuration: false, // When true, the remaining time is shown in the duration GUI element. + toggleDuration: false, // When true, clicks on the duration toggle between the duration and remaining display. + captureDuration: true, // When true, clicks on the duration are captured and no longer propagate up the DOM. + playbackRate: 1, + defaultPlaybackRate: 1, + minPlaybackRate: 0.5, + maxPlaybackRate: 4, + wmode: "opaque", // Valid wmode: window, transparent, opaque, direct, gpu. + backgroundColor: "#000000", // To define the jPlayer div and Flash background color. + cssSelectorAncestor: "#jp_container_1", + cssSelector: { // * denotes properties that should only be required when video media type required. _cssSelector() would require changes to enable splitting these into Audio and Video defaults. + videoPlay: ".jp-video-play", // * + play: ".jp-play", + pause: ".jp-pause", + stop: ".jp-stop", + seekBar: ".jp-seek-bar", + playBar: ".jp-play-bar", + mute: ".jp-mute", + unmute: ".jp-unmute", + volumeBar: ".jp-volume-bar", + volumeBarValue: ".jp-volume-bar-value", + volumeMax: ".jp-volume-max", + playbackRateBar: ".jp-playback-rate-bar", + playbackRateBarValue: ".jp-playback-rate-bar-value", + currentTime: ".jp-current-time", + duration: ".jp-duration", + title: ".jp-title", + fullScreen: ".jp-full-screen", // * + restoreScreen: ".jp-restore-screen", // * + repeat: ".jp-repeat", + repeatOff: ".jp-repeat-off", + gui: ".jp-gui", // The interface used with autohide feature. + noSolution: ".jp-no-solution" // For error feedback when jPlayer cannot find a solution. + }, + stateClass: { // Classes added to the cssSelectorAncestor to indicate the state. + playing: "jp-state-playing", + seeking: "jp-state-seeking", + muted: "jp-state-muted", + looped: "jp-state-looped", + fullScreen: "jp-state-full-screen", + noVolume: "jp-state-no-volume" + }, + useStateClassSkin: false, // A state class skin relies on the state classes to change the visual appearance. The single control toggles the effect, for example: play then pause, mute then unmute. + autoBlur: true, // GUI control handlers will drop focus after clicks. + smoothPlayBar: false, // Smooths the play bar transitions, which affects clicks and short media with big changes per second. + fullScreen: false, // Native Full Screen + fullWindow: false, + autohide: { + restored: false, // Controls the interface autohide feature. + full: true, // Controls the interface autohide feature. + fadeIn: 200, // Milliseconds. The period of the fadeIn anim. + fadeOut: 600, // Milliseconds. The period of the fadeOut anim. + hold: 1000 // Milliseconds. The period of the pause before autohide beings. + }, + loop: false, + repeat: function(event) { // The default jPlayer repeat event handler + if(event.jPlayer.options.loop) { + $(this).unbind(".jPlayerRepeat").bind($.jPlayer.event.ended + ".jPlayer.jPlayerRepeat", function() { + $(this).jPlayer("play"); + }); + } else { + $(this).unbind(".jPlayerRepeat"); + } + }, + nativeVideoControls: { + // Works well on standard browsers. + // Phone and tablet browsers can have problems with the controls disappearing. + }, + noFullWindow: { + msie: /msie [0-6]\./, + ipad: /ipad.*?os [0-4]\./, + iphone: /iphone/, + ipod: /ipod/, + android_pad: /android [0-3]\.(?!.*?mobile)/, + android_phone: /(?=.*android)(?!.*chrome)(?=.*mobile)/, + blackberry: /blackberry/, + windows_ce: /windows ce/, + iemobile: /iemobile/, + webos: /webos/ + }, + noVolume: { + ipad: /ipad/, + iphone: /iphone/, + ipod: /ipod/, + android_pad: /android(?!.*?mobile)/, + android_phone: /android.*?mobile/, + blackberry: /blackberry/, + windows_ce: /windows ce/, + iemobile: /iemobile/, + webos: /webos/, + playbook: /playbook/ + }, + timeFormat: { + // Specific time format for this instance. The supported options are defined in $.jPlayer.timeFormat + // For the undefined options we use the default from $.jPlayer.timeFormat + }, + keyEnabled: false, // Enables keyboard controls. + audioFullScreen: false, // Enables keyboard controls to enter full screen with audio media. + keyBindings: { // The key control object, defining the key codes and the functions to execute. + // The parameter, f = $.jPlayer.focus, will be checked truethy before attempting to call any of these functions. + // Properties may be added to this object, in key/fn pairs, to enable other key controls. EG, for the playlist add-on. + play: { + key: 80, // p + fn: function(f) { + if(f.status.paused) { + f.play(); + } else { + f.pause(); + } + } + }, + fullScreen: { + key: 70, // f + fn: function(f) { + if(f.status.video || f.options.audioFullScreen) { + f._setOption("fullScreen", !f.options.fullScreen); + } + } + }, + muted: { + key: 77, // m + fn: function(f) { + f._muted(!f.options.muted); + } + }, + volumeUp: { + key: 190, // . + fn: function(f) { + f.volume(f.options.volume + 0.1); + } + }, + volumeDown: { + key: 188, // , + fn: function(f) { + f.volume(f.options.volume - 0.1); + } + }, + loop: { + key: 76, // l + fn: function(f) { + f._loop(!f.options.loop); + } + } + }, + verticalVolume: false, // Calculate volume from the bottom of the volume bar. Default is from the left. Also volume affects either width or height. + verticalPlaybackRate: false, + globalVolume: false, // Set to make volume and muted changes affect all jPlayer instances with this option enabled + idPrefix: "jp", // Prefix for the ids of html elements created by jPlayer. For flash, this must not include characters: . - + * / \ + noConflict: "jQuery", + emulateHtml: false, // Emulates the HTML5 Media element on the jPlayer element. + consoleAlerts: true, // Alerts are sent to the console.log() instead of alert(). + errorAlerts: false, + warningAlerts: false + }, + optionsAudio: { + size: { + width: "0px", + height: "0px", + cssClass: "" + }, + sizeFull: { + width: "0px", + height: "0px", + cssClass: "" + } + }, + optionsVideo: { + size: { + width: "480px", + height: "270px", + cssClass: "jp-video-270p" + }, + sizeFull: { + width: "100%", + height: "100%", + cssClass: "jp-video-full" + } + }, + instances: {}, // Static Object + status: { // Instanced in _init() + src: "", + media: {}, + paused: true, + format: {}, + formatType: "", + waitForPlay: true, // Same as waitForLoad except in case where preloading. + waitForLoad: true, + srcSet: false, + video: false, // True if playing a video + seekPercent: 0, + currentPercentRelative: 0, + currentPercentAbsolute: 0, + currentTime: 0, + duration: 0, + remaining: 0, + videoWidth: 0, // Intrinsic width of the video in pixels. + videoHeight: 0, // Intrinsic height of the video in pixels. + readyState: 0, + networkState: 0, + playbackRate: 1, // Warning - Now both an option and a status property + ended: 0 + +/* Persistant status properties created dynamically at _init(): + width + height + cssClass + nativeVideoControls + noFullWindow + noVolume + playbackRateEnabled // Warning - Technically, we can have both Flash and HTML, so this might not be correct if the Flash is active. That is a niche case. +*/ + }, + + internal: { // Instanced in _init() + ready: false + // instance: undefined + // domNode: undefined + // htmlDlyCmdId: undefined + // autohideId: undefined + // mouse: undefined + // cmdsIgnored + }, + solution: { // Static Object: Defines the solutions built in jPlayer. + html: true, + aurora: true, + flash: true + }, + // 'MPEG-4 support' : canPlayType('video/mp4; codecs="mp4v.20.8"') + format: { // Static Object + mp3: { + codec: 'audio/mpeg', + flashCanPlay: true, + media: 'audio' + }, + m4a: { // AAC / MP4 + codec: 'audio/mp4; codecs="mp4a.40.2"', + flashCanPlay: true, + media: 'audio' + }, + m3u8a: { // AAC / MP4 / Apple HLS + codec: 'application/vnd.apple.mpegurl; codecs="mp4a.40.2"', + flashCanPlay: false, + media: 'audio' + }, + m3ua: { // M3U + codec: 'audio/mpegurl', + flashCanPlay: false, + media: 'audio' + }, + oga: { // OGG + codec: 'audio/ogg; codecs="vorbis, opus"', + flashCanPlay: false, + media: 'audio' + }, + flac: { // FLAC + codec: 'audio/x-flac', + flashCanPlay: false, + media: 'audio' + }, + wav: { // PCM + codec: 'audio/wav; codecs="1"', + flashCanPlay: false, + media: 'audio' + }, + webma: { // WEBM + codec: 'audio/webm; codecs="vorbis"', + flashCanPlay: false, + media: 'audio' + }, + fla: { // FLV / F4A + codec: 'audio/x-flv', + flashCanPlay: true, + media: 'audio' + }, + rtmpa: { // RTMP AUDIO + codec: 'audio/rtmp; codecs="rtmp"', + flashCanPlay: true, + media: 'audio' + }, + m4v: { // H.264 / MP4 + codec: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"', + flashCanPlay: true, + media: 'video' + }, + m3u8v: { // H.264 / AAC / MP4 / Apple HLS + codec: 'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"', + flashCanPlay: false, + media: 'video' + }, + m3uv: { // M3U + codec: 'audio/mpegurl', + flashCanPlay: false, + media: 'video' + }, + ogv: { // OGG + codec: 'video/ogg; codecs="theora, vorbis"', + flashCanPlay: false, + media: 'video' + }, + webmv: { // WEBM + codec: 'video/webm; codecs="vorbis, vp8"', + flashCanPlay: false, + media: 'video' + }, + flv: { // FLV / F4V + codec: 'video/x-flv', + flashCanPlay: true, + media: 'video' + }, + rtmpv: { // RTMP VIDEO + codec: 'video/rtmp; codecs="rtmp"', + flashCanPlay: true, + media: 'video' + } + }, + _init: function() { + var self = this; + + this.element.empty(); + + this.status = $.extend({}, this.status); // Copy static to unique instance. + this.internal = $.extend({}, this.internal); // Copy static to unique instance. + + // Initialize the time format + this.options.timeFormat = $.extend({}, $.jPlayer.timeFormat, this.options.timeFormat); + + // On iOS, assume commands will be ignored before user initiates them. + this.internal.cmdsIgnored = $.jPlayer.platform.ipad || $.jPlayer.platform.iphone || $.jPlayer.platform.ipod; + + this.internal.domNode = this.element.get(0); + + // Add key bindings focus to 1st jPlayer instanced with key control enabled. + if(this.options.keyEnabled && !$.jPlayer.focus) { + $.jPlayer.focus = this; + } + + // A fix for Android where older (2.3) and even some 4.x devices fail to work when changing the *audio* SRC and then playing immediately. + this.androidFix = { + setMedia: false, // True when media set + play: false, // True when a progress event will instruct the media to play + pause: false, // True when a progress event will instruct the media to pause at a time. + time: NaN // The play(time) parameter + }; + if($.jPlayer.platform.android) { + this.options.preload = this.options.preload !== 'auto' ? 'metadata' : 'auto'; // Default to metadata, but allow auto. + } + + this.formats = []; // Array based on supplied string option. Order defines priority. + this.solutions = []; // Array based on solution string option. Order defines priority. + this.require = {}; // Which media types are required: video, audio. + + this.htmlElement = {}; // DOM elements created by jPlayer + this.html = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array. + this.html.audio = {}; + this.html.video = {}; + this.aurora = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array. + this.aurora.formats = []; + this.aurora.properties = []; + this.flash = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array. + + this.css = {}; + this.css.cs = {}; // Holds the css selector strings + this.css.jq = {}; // Holds jQuery selectors. ie., $(css.cs.method) + + this.ancestorJq = []; // Holds jQuery selector of cssSelectorAncestor. Init would use $() instead of [], but it is only 1.4+ + + this.options.volume = this._limitValue(this.options.volume, 0, 1); // Limit volume value's bounds. + + // Create the formats array, with prority based on the order of the supplied formats string + $.each(this.options.supplied.toLowerCase().split(","), function(index1, value1) { + var format = value1.replace(/^\s+|\s+$/g, ""); //trim + if(self.format[format]) { // Check format is valid. + var dupFound = false; + $.each(self.formats, function(index2, value2) { // Check for duplicates + if(format === value2) { + dupFound = true; + return false; + } + }); + if(!dupFound) { + self.formats.push(format); + } + } + }); + + // Create the solutions array, with prority based on the order of the solution string + $.each(this.options.solution.toLowerCase().split(","), function(index1, value1) { + var solution = value1.replace(/^\s+|\s+$/g, ""); //trim + if(self.solution[solution]) { // Check solution is valid. + var dupFound = false; + $.each(self.solutions, function(index2, value2) { // Check for duplicates + if(solution === value2) { + dupFound = true; + return false; + } + }); + if(!dupFound) { + self.solutions.push(solution); + } + } + }); + + // Create Aurora.js formats array + $.each(this.options.auroraFormats.toLowerCase().split(","), function(index1, value1) { + var format = value1.replace(/^\s+|\s+$/g, ""); //trim + if(self.format[format]) { // Check format is valid. + var dupFound = false; + $.each(self.aurora.formats, function(index2, value2) { // Check for duplicates + if(format === value2) { + dupFound = true; + return false; + } + }); + if(!dupFound) { + self.aurora.formats.push(format); + } + } + }); + + this.internal.instance = "jp_" + this.count; + this.instances[this.internal.instance] = this.element; + + // Check the jPlayer div has an id and create one if required. Important for Flash to know the unique id for comms. + if(!this.element.attr("id")) { + this.element.attr("id", this.options.idPrefix + "_jplayer_" + this.count); + } + + this.internal.self = $.extend({}, { + id: this.element.attr("id"), + jq: this.element + }); + this.internal.audio = $.extend({}, { + id: this.options.idPrefix + "_audio_" + this.count, + jq: undefined + }); + this.internal.video = $.extend({}, { + id: this.options.idPrefix + "_video_" + this.count, + jq: undefined + }); + this.internal.flash = $.extend({}, { + id: this.options.idPrefix + "_flash_" + this.count, + jq: undefined, + swf: this.options.swfPath + (this.options.swfPath.toLowerCase().slice(-4) !== ".swf" ? (this.options.swfPath && this.options.swfPath.slice(-1) !== "/" ? "/" : "") + "jquery.jplayer.swf" : "") + }); + this.internal.poster = $.extend({}, { + id: this.options.idPrefix + "_poster_" + this.count, + jq: undefined + }); + + // Register listeners defined in the constructor + $.each($.jPlayer.event, function(eventName,eventType) { + if(self.options[eventName] !== undefined) { + self.element.bind(eventType + ".jPlayer", self.options[eventName]); // With .jPlayer namespace. + self.options[eventName] = undefined; // Destroy the handler pointer copy on the options. Reason, events can be added/removed in other ways so this could be obsolete and misleading. + } + }); + + // Determine if we require solutions for audio, video or both media types. + this.require.audio = false; + this.require.video = false; + $.each(this.formats, function(priority, format) { + self.require[self.format[format].media] = true; + }); + + // Now required types are known, finish the options default settings. + if(this.require.video) { + this.options = $.extend(true, {}, + this.optionsVideo, + this.options + ); + } else { + this.options = $.extend(true, {}, + this.optionsAudio, + this.options + ); + } + this._setSize(); // update status and jPlayer element size + + // Determine the status for Blocklisted options. + this.status.nativeVideoControls = this._uaBlocklist(this.options.nativeVideoControls); + this.status.noFullWindow = this._uaBlocklist(this.options.noFullWindow); + this.status.noVolume = this._uaBlocklist(this.options.noVolume); + + // Create event handlers if native fullscreen is supported + if($.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled) { + this._fullscreenAddEventListeners(); + } + + // The native controls are only for video and are disabled when audio is also used. + this._restrictNativeVideoControls(); + + // Create the poster image. + this.htmlElement.poster = document.createElement('img'); + this.htmlElement.poster.id = this.internal.poster.id; + this.htmlElement.poster.onload = function() { // Note that this did not work on Firefox 3.6: poster.addEventListener("onload", function() {}, false); Did not investigate x-browser. + if(!self.status.video || self.status.waitForPlay) { + self.internal.poster.jq.show(); + } + }; + this.element.append(this.htmlElement.poster); + this.internal.poster.jq = $("#" + this.internal.poster.id); + this.internal.poster.jq.css({'width': this.status.width, 'height': this.status.height}); + this.internal.poster.jq.hide(); + this.internal.poster.jq.bind("click.jPlayer", function() { + self._trigger($.jPlayer.event.click); + }); + + // Generate the required media elements + this.html.audio.available = false; + if(this.require.audio) { // If a supplied format is audio + this.htmlElement.audio = document.createElement('audio'); + this.htmlElement.audio.id = this.internal.audio.id; + this.html.audio.available = !!this.htmlElement.audio.canPlayType && this._testCanPlayType(this.htmlElement.audio); // Test is for IE9 on Win Server 2008. + } + this.html.video.available = false; + if(this.require.video) { // If a supplied format is video + this.htmlElement.video = document.createElement('video'); + this.htmlElement.video.id = this.internal.video.id; + this.html.video.available = !!this.htmlElement.video.canPlayType && this._testCanPlayType(this.htmlElement.video); // Test is for IE9 on Win Server 2008. + } + + this.flash.available = this._checkForFlash(10.1); + + this.html.canPlay = {}; + this.aurora.canPlay = {}; + this.flash.canPlay = {}; + $.each(this.formats, function(priority, format) { + self.html.canPlay[format] = self.html[self.format[format].media].available && "" !== self.htmlElement[self.format[format].media].canPlayType(self.format[format].codec); + self.aurora.canPlay[format] = ($.inArray(format, self.aurora.formats) > -1); + self.flash.canPlay[format] = self.format[format].flashCanPlay && self.flash.available; + }); + this.html.desired = false; + this.aurora.desired = false; + this.flash.desired = false; + $.each(this.solutions, function(solutionPriority, solution) { + if(solutionPriority === 0) { + self[solution].desired = true; + } else { + var audioCanPlay = false; + var videoCanPlay = false; + $.each(self.formats, function(formatPriority, format) { + if(self[self.solutions[0]].canPlay[format]) { // The other solution can play + if(self.format[format].media === 'video') { + videoCanPlay = true; + } else { + audioCanPlay = true; + } + } + }); + self[solution].desired = (self.require.audio && !audioCanPlay) || (self.require.video && !videoCanPlay); + } + }); + // This is what jPlayer will support, based on solution and supplied. + this.html.support = {}; + this.aurora.support = {}; + this.flash.support = {}; + $.each(this.formats, function(priority, format) { + self.html.support[format] = self.html.canPlay[format] && self.html.desired; + self.aurora.support[format] = self.aurora.canPlay[format] && self.aurora.desired; + self.flash.support[format] = self.flash.canPlay[format] && self.flash.desired; + }); + // If jPlayer is supporting any format in a solution, then the solution is used. + this.html.used = false; + this.aurora.used = false; + this.flash.used = false; + $.each(this.solutions, function(solutionPriority, solution) { + $.each(self.formats, function(formatPriority, format) { + if(self[solution].support[format]) { + self[solution].used = true; + return false; + } + }); + }); + + // Init solution active state and the event gates to false. + this._resetActive(); + this._resetGate(); + + // Set up the css selectors for the control and feedback entities. + this._cssSelectorAncestor(this.options.cssSelectorAncestor); + + // If neither html nor aurora nor flash are being used by this browser, then media playback is not possible. Trigger an error event. + if(!(this.html.used || this.aurora.used || this.flash.used)) { + this._error( { + type: $.jPlayer.error.NO_SOLUTION, + context: "{solution:'" + this.options.solution + "', supplied:'" + this.options.supplied + "'}", + message: $.jPlayer.errorMsg.NO_SOLUTION, + hint: $.jPlayer.errorHint.NO_SOLUTION + }); + if(this.css.jq.noSolution.length) { + this.css.jq.noSolution.show(); + } + } else { + if(this.css.jq.noSolution.length) { + this.css.jq.noSolution.hide(); + } + } + + // Add the flash solution if it is being used. + if(this.flash.used) { + var htmlObj, + flashVars = 'jQuery=' + encodeURI(this.options.noConflict) + '&id=' + encodeURI(this.internal.self.id) + '&vol=' + this.options.volume + '&muted=' + this.options.muted; + + // Code influenced by SWFObject 2.2: http://code.google.com/p/swfobject/ + // Non IE browsers have an initial Flash size of 1 by 1 otherwise the wmode affected the Flash ready event. + + if($.jPlayer.browser.msie && (Number($.jPlayer.browser.version) < 9 || $.jPlayer.browser.documentMode < 9)) { + var objStr = ''; + + var paramStr = [ + '', + '', + '', + '', + '' + ]; + + htmlObj = document.createElement(objStr); + for(var i=0; i < paramStr.length; i++) { + htmlObj.appendChild(document.createElement(paramStr[i])); + } + } else { + var createParam = function(el, n, v) { + var p = document.createElement("param"); + p.setAttribute("name", n); + p.setAttribute("value", v); + el.appendChild(p); + }; + + htmlObj = document.createElement("object"); + htmlObj.setAttribute("id", this.internal.flash.id); + htmlObj.setAttribute("name", this.internal.flash.id); + htmlObj.setAttribute("data", this.internal.flash.swf); + htmlObj.setAttribute("type", "application/x-shockwave-flash"); + htmlObj.setAttribute("width", "1"); // Non-zero + htmlObj.setAttribute("height", "1"); // Non-zero + htmlObj.setAttribute("tabindex", "-1"); + createParam(htmlObj, "flashvars", flashVars); + createParam(htmlObj, "allowscriptaccess", "always"); + createParam(htmlObj, "bgcolor", this.options.backgroundColor); + createParam(htmlObj, "wmode", this.options.wmode); + } + + this.element.append(htmlObj); + this.internal.flash.jq = $(htmlObj); + } + + // Setup playbackRate ability before using _addHtmlEventListeners() + if(this.html.used && !this.flash.used) { // If only HTML + // Using the audio element capabilities for playbackRate. ie., Assuming video element is the same. + this.status.playbackRateEnabled = this._testPlaybackRate('audio'); + } else { + this.status.playbackRateEnabled = false; + } + + this._updatePlaybackRate(); + + // Add the HTML solution if being used. + if(this.html.used) { + + // The HTML Audio handlers + if(this.html.audio.available) { + this._addHtmlEventListeners(this.htmlElement.audio, this.html.audio); + this.element.append(this.htmlElement.audio); + this.internal.audio.jq = $("#" + this.internal.audio.id); + } + + // The HTML Video handlers + if(this.html.video.available) { + this._addHtmlEventListeners(this.htmlElement.video, this.html.video); + this.element.append(this.htmlElement.video); + this.internal.video.jq = $("#" + this.internal.video.id); + if(this.status.nativeVideoControls) { + this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height}); + } else { + this.internal.video.jq.css({'width':'0px', 'height':'0px'}); // Using size 0x0 since a .hide() causes issues in iOS + } + this.internal.video.jq.bind("click.jPlayer", function() { + self._trigger($.jPlayer.event.click); + }); + } + } + + // Add the Aurora.js solution if being used. + if(this.aurora.used) { + // Aurora.js player need to be created for each media, see setMedia function. + } + + // Create the bridge that emulates the HTML Media element on the jPlayer DIV + if( this.options.emulateHtml ) { + this._emulateHtmlBridge(); + } + + if((this.html.used || this.aurora.used) && !this.flash.used) { // If only HTML, then emulate flash ready() call after 100ms. + setTimeout( function() { + self.internal.ready = true; + self.version.flash = "n/a"; + self._trigger($.jPlayer.event.repeat); // Trigger the repeat event so its handler can initialize itself with the loop option. + self._trigger($.jPlayer.event.ready); + }, 100); + } + + // Initialize the interface components with the options. + this._updateNativeVideoControls(); + // The other controls are now setup in _cssSelectorAncestor() + if(this.css.jq.videoPlay.length) { + this.css.jq.videoPlay.hide(); + } + + $.jPlayer.prototype.count++; // Change static variable via prototype. + }, + destroy: function() { + // MJP: The background change remains. Would need to store the original to restore it correctly. + // MJP: The jPlayer element's size change remains. + + // Clear the media to reset the GUI and stop any downloads. Streams on some browsers had persited. (Chrome) + this.clearMedia(); + // Remove the size/sizeFull cssClass from the cssSelectorAncestor + this._removeUiClass(); + // Remove the times from the GUI + if(this.css.jq.currentTime.length) { + this.css.jq.currentTime.text(""); + } + if(this.css.jq.duration.length) { + this.css.jq.duration.text(""); + } + // Remove any bindings from the interface controls. + $.each(this.css.jq, function(fn, jq) { + // Check selector is valid before trying to execute method. + if(jq.length) { + jq.unbind(".jPlayer"); + } + }); + // Remove the click handlers for $.jPlayer.event.click + this.internal.poster.jq.unbind(".jPlayer"); + if(this.internal.video.jq) { + this.internal.video.jq.unbind(".jPlayer"); + } + // Remove the fullscreen event handlers + this._fullscreenRemoveEventListeners(); + // Remove key bindings + if(this === $.jPlayer.focus) { + $.jPlayer.focus = null; + } + // Destroy the HTML bridge. + if(this.options.emulateHtml) { + this._destroyHtmlBridge(); + } + this.element.removeData("jPlayer"); // Remove jPlayer data + this.element.unbind(".jPlayer"); // Remove all event handlers created by the jPlayer constructor + this.element.empty(); // Remove the inserted child elements + + delete this.instances[this.internal.instance]; // Clear the instance on the static instance object + }, + destroyRemoved: function() { // Destroy any instances that have gone away. + var self = this; + $.each(this.instances, function(i, element) { + if(self.element !== element) { // Do not destroy this instance. + if(!element.data("jPlayer")) { // Check that element is a real jPlayer. + element.jPlayer("destroy"); + delete self.instances[i]; + } + } + }); + }, + enable: function() { // Plan to implement + // options.disabled = false + }, + disable: function () { // Plan to implement + // options.disabled = true + }, + _testCanPlayType: function(elem) { + // IE9 on Win Server 2008 did not implement canPlayType(), but it has the property. + try { + elem.canPlayType(this.format.mp3.codec); // The type is irrelevant. + return true; + } catch(err) { + return false; + } + }, + _testPlaybackRate: function(type) { + // type: String 'audio' or 'video' + var el, rate = 0.5; + type = typeof type === 'string' ? type : 'audio'; + el = document.createElement(type); + // Wrapping in a try/catch, just in case older HTML5 browsers throw and error. + try { + if('playbackRate' in el) { + el.playbackRate = rate; + return el.playbackRate === rate; + } else { + return false; + } + } catch(err) { + return false; + } + }, + _uaBlocklist: function(list) { + // list : object with properties that are all regular expressions. Property names are irrelevant. + // Returns true if the user agent is matched in list. + var ua = navigator.userAgent.toLowerCase(), + block = false; + + $.each(list, function(p, re) { + if(re && re.test(ua)) { + block = true; + return false; // exit $.each. + } + }); + return block; + }, + _restrictNativeVideoControls: function() { + // Fallback to noFullWindow when nativeVideoControls is true and audio media is being used. Affects when both media types are used. + if(this.require.audio) { + if(this.status.nativeVideoControls) { + this.status.nativeVideoControls = false; + this.status.noFullWindow = true; + } + } + }, + _updateNativeVideoControls: function() { + if(this.html.video.available && this.html.used) { + // Turn the HTML Video controls on/off + this.htmlElement.video.controls = this.status.nativeVideoControls; + // Show/hide the jPlayer GUI. + this._updateAutohide(); + // For when option changed. The poster image is not updated, as it is dealt with in setMedia(). Acceptable degradation since seriously doubt these options will change on the fly. Can again review later. + if(this.status.nativeVideoControls && this.require.video) { + this.internal.poster.jq.hide(); + this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height}); + } else if(this.status.waitForPlay && this.status.video) { + this.internal.poster.jq.show(); + this.internal.video.jq.css({'width': '0px', 'height': '0px'}); + } + } + }, + _addHtmlEventListeners: function(mediaElement, entity) { + var self = this; + mediaElement.preload = this.options.preload; + mediaElement.muted = this.options.muted; + mediaElement.volume = this.options.volume; + + if(this.status.playbackRateEnabled) { + mediaElement.defaultPlaybackRate = this.options.defaultPlaybackRate; + mediaElement.playbackRate = this.options.playbackRate; + } + + // Create the event listeners + // Only want the active entity to affect jPlayer and bubble events. + // Using entity.gate so that object is referenced and gate property always current + + mediaElement.addEventListener("progress", function() { + if(entity.gate) { + if(self.internal.cmdsIgnored && this.readyState > 0) { // Detect iOS executed the command + self.internal.cmdsIgnored = false; + } + self._getHtmlStatus(mediaElement); + self._updateInterface(); + self._trigger($.jPlayer.event.progress); + } + }, false); + mediaElement.addEventListener("loadeddata", function() { + if(entity.gate) { + self.androidFix.setMedia = false; // Disable the fix after the first progress event. + if(self.androidFix.play) { // Play Android audio - performing the fix. + self.androidFix.play = false; + self.play(self.androidFix.time); + } + if(self.androidFix.pause) { // Pause Android audio at time - performing the fix. + self.androidFix.pause = false; + self.pause(self.androidFix.time); + } + self._trigger($.jPlayer.event.loadeddata); + } + }, false); + mediaElement.addEventListener("timeupdate", function() { + if(entity.gate) { + self._getHtmlStatus(mediaElement); + self._updateInterface(); + self._trigger($.jPlayer.event.timeupdate); + } + }, false); + mediaElement.addEventListener("durationchange", function() { + if(entity.gate) { + self._getHtmlStatus(mediaElement); + self._updateInterface(); + self._trigger($.jPlayer.event.durationchange); + } + }, false); + mediaElement.addEventListener("play", function() { + if(entity.gate) { + self._updateButtons(true); + self._html_checkWaitForPlay(); // So the native controls update this variable and puts the hidden interface in the correct state. Affects toggling native controls. + self._trigger($.jPlayer.event.play); + } + }, false); + mediaElement.addEventListener("playing", function() { + if(entity.gate) { + self._updateButtons(true); + self._seeked(); + self._trigger($.jPlayer.event.playing); + } + }, false); + mediaElement.addEventListener("pause", function() { + if(entity.gate) { + self._updateButtons(false); + self._trigger($.jPlayer.event.pause); + } + }, false); + mediaElement.addEventListener("waiting", function() { + if(entity.gate) { + self._seeking(); + self._trigger($.jPlayer.event.waiting); + } + }, false); + mediaElement.addEventListener("seeking", function() { + if(entity.gate) { + self._seeking(); + self._trigger($.jPlayer.event.seeking); + } + }, false); + mediaElement.addEventListener("seeked", function() { + if(entity.gate) { + self._seeked(); + self._trigger($.jPlayer.event.seeked); + } + }, false); + mediaElement.addEventListener("volumechange", function() { + if(entity.gate) { + // Read the values back from the element as the Blackberry PlayBook shares the volume with the physical buttons master volume control. + // However, when tested 6th July 2011, those buttons do not generate an event. The physical play/pause button does though. + self.options.volume = mediaElement.volume; + self.options.muted = mediaElement.muted; + self._updateMute(); + self._updateVolume(); + self._trigger($.jPlayer.event.volumechange); + } + }, false); + mediaElement.addEventListener("ratechange", function() { + if(entity.gate) { + self.options.defaultPlaybackRate = mediaElement.defaultPlaybackRate; + self.options.playbackRate = mediaElement.playbackRate; + self._updatePlaybackRate(); + self._trigger($.jPlayer.event.ratechange); + } + }, false); + mediaElement.addEventListener("suspend", function() { // Seems to be the only way of capturing that the iOS4 browser did not actually play the media from the page code. ie., It needs a user gesture. + if(entity.gate) { + self._seeked(); + self._trigger($.jPlayer.event.suspend); + } + }, false); + mediaElement.addEventListener("ended", function() { + if(entity.gate) { + // Order of the next few commands are important. Change the time and then pause. + // Solves a bug in Firefox, where issuing pause 1st causes the media to play from the start. ie., The pause is ignored. + if(!$.jPlayer.browser.webkit) { // Chrome crashes if you do this in conjunction with a setMedia command in an ended event handler. ie., The playlist demo. + self.htmlElement.media.currentTime = 0; // Safari does not care about this command. ie., It works with or without this line. (Both Safari and Chrome are Webkit.) + } + self.htmlElement.media.pause(); // Pause otherwise a click on the progress bar will play from that point, when it shouldn't, since it stopped playback. + self._updateButtons(false); + self._getHtmlStatus(mediaElement, true); // With override true. Otherwise Chrome leaves progress at full. + self._updateInterface(); + self._trigger($.jPlayer.event.ended); + } + }, false); + mediaElement.addEventListener("error", function() { + if(entity.gate) { + self._updateButtons(false); + self._seeked(); + if(self.status.srcSet) { // Deals with case of clearMedia() causing an error event. + clearTimeout(self.internal.htmlDlyCmdId); // Clears any delayed commands used in the HTML solution. + self.status.waitForLoad = true; // Allows the load operation to try again. + self.status.waitForPlay = true; // Reset since a play was captured. + if(self.status.video && !self.status.nativeVideoControls) { + self.internal.video.jq.css({'width':'0px', 'height':'0px'}); + } + if(self._validString(self.status.media.poster) && !self.status.nativeVideoControls) { + self.internal.poster.jq.show(); + } + if(self.css.jq.videoPlay.length) { + self.css.jq.videoPlay.show(); + } + self._error( { + type: $.jPlayer.error.URL, + context: self.status.src, // this.src shows absolute urls. Want context to show the url given. + message: $.jPlayer.errorMsg.URL, + hint: $.jPlayer.errorHint.URL + }); + } + } + }, false); + // Create all the other event listeners that bubble up to a jPlayer event from html, without being used by jPlayer. + $.each($.jPlayer.htmlEvent, function(i, eventType) { + mediaElement.addEventListener(this, function() { + if(entity.gate) { + self._trigger($.jPlayer.event[eventType]); + } + }, false); + }); + }, + _addAuroraEventListeners : function(player, entity) { + var self = this; + //player.preload = this.options.preload; + //player.muted = this.options.muted; + player.volume = this.options.volume * 100; + + // Create the event listeners + // Only want the active entity to affect jPlayer and bubble events. + // Using entity.gate so that object is referenced and gate property always current + + player.on("progress", function() { + if(entity.gate) { + if(self.internal.cmdsIgnored && this.readyState > 0) { // Detect iOS executed the command + self.internal.cmdsIgnored = false; + } + self._getAuroraStatus(player); + self._updateInterface(); + self._trigger($.jPlayer.event.progress); + // Progress with song duration, we estimate timeupdate need to be triggered too. + if (player.duration > 0) { + self._trigger($.jPlayer.event.timeupdate); + } + } + }, false); + player.on("ready", function() { + if(entity.gate) { + self._trigger($.jPlayer.event.loadeddata); + } + }, false); + player.on("duration", function() { + if(entity.gate) { + self._getAuroraStatus(player); + self._updateInterface(); + self._trigger($.jPlayer.event.durationchange); + } + }, false); + player.on("end", function() { + if(entity.gate) { + // Order of the next few commands are important. Change the time and then pause. + self._updateButtons(false); + self._getAuroraStatus(player, true); + self._updateInterface(); + self._trigger($.jPlayer.event.ended); + } + }, false); + player.on("error", function() { + if(entity.gate) { + self._updateButtons(false); + self._seeked(); + if(self.status.srcSet) { // Deals with case of clearMedia() causing an error event. + self.status.waitForLoad = true; // Allows the load operation to try again. + self.status.waitForPlay = true; // Reset since a play was captured. + if(self.status.video && !self.status.nativeVideoControls) { + self.internal.video.jq.css({'width':'0px', 'height':'0px'}); + } + if(self._validString(self.status.media.poster) && !self.status.nativeVideoControls) { + self.internal.poster.jq.show(); + } + if(self.css.jq.videoPlay.length) { + self.css.jq.videoPlay.show(); + } + self._error( { + type: $.jPlayer.error.URL, + context: self.status.src, // this.src shows absolute urls. Want context to show the url given. + message: $.jPlayer.errorMsg.URL, + hint: $.jPlayer.errorHint.URL + }); + } + } + }, false); + }, + _getHtmlStatus: function(media, override) { + var ct = 0, cpa = 0, sp = 0, cpr = 0; + + // Fixes the duration bug in iOS, where the durationchange event occurs when media.duration is not always correct. + // Fixes the initial duration bug in BB OS7, where the media.duration is infinity and displays as NaN:NaN due to Date() using inifity. + if(isFinite(media.duration)) { + this.status.duration = media.duration; + } + + ct = media.currentTime; + cpa = (this.status.duration > 0) ? 100 * ct / this.status.duration : 0; + if((typeof media.seekable === "object") && (media.seekable.length > 0)) { + sp = (this.status.duration > 0) ? 100 * media.seekable.end(media.seekable.length-1) / this.status.duration : 100; + cpr = (this.status.duration > 0) ? 100 * media.currentTime / media.seekable.end(media.seekable.length-1) : 0; // Duration conditional for iOS duration bug. ie., seekable.end is a NaN in that case. + } else { + sp = 100; + cpr = cpa; + } + + if(override) { + ct = 0; + cpr = 0; + cpa = 0; + } + + this.status.seekPercent = sp; + this.status.currentPercentRelative = cpr; + this.status.currentPercentAbsolute = cpa; + this.status.currentTime = ct; + + this.status.remaining = this.status.duration - this.status.currentTime; + + this.status.videoWidth = media.videoWidth; + this.status.videoHeight = media.videoHeight; + + this.status.readyState = media.readyState; + this.status.networkState = media.networkState; + this.status.playbackRate = media.playbackRate; + this.status.ended = media.ended; + }, + _getAuroraStatus: function(player, override) { + var ct = 0, cpa = 0, sp = 0, cpr = 0; + + this.status.duration = player.duration / 1000; + + ct = player.currentTime / 1000; + cpa = (this.status.duration > 0) ? 100 * ct / this.status.duration : 0; + if(player.buffered > 0) { + sp = (this.status.duration > 0) ? (player.buffered * this.status.duration) / this.status.duration : 100; + cpr = (this.status.duration > 0) ? ct / (player.buffered * this.status.duration) : 0; + } else { + sp = 100; + cpr = cpa; + } + + if(override) { + ct = 0; + cpr = 0; + cpa = 0; + } + + this.status.seekPercent = sp; + this.status.currentPercentRelative = cpr; + this.status.currentPercentAbsolute = cpa; + this.status.currentTime = ct; + + this.status.remaining = this.status.duration - this.status.currentTime; + + this.status.readyState = 4; // status.readyState; + this.status.networkState = 0; // status.networkState; + this.status.playbackRate = 1; // status.playbackRate; + this.status.ended = false; // status.ended; + }, + _resetStatus: function() { + this.status = $.extend({}, this.status, $.jPlayer.prototype.status); // Maintains the status properties that persist through a reset. + }, + _trigger: function(eventType, error, warning) { // eventType always valid as called using $.jPlayer.event.eventType + var event = $.Event(eventType); + event.jPlayer = {}; + event.jPlayer.version = $.extend({}, this.version); + event.jPlayer.options = $.extend(true, {}, this.options); // Deep copy + event.jPlayer.status = $.extend(true, {}, this.status); // Deep copy + event.jPlayer.html = $.extend(true, {}, this.html); // Deep copy + event.jPlayer.aurora = $.extend(true, {}, this.aurora); // Deep copy + event.jPlayer.flash = $.extend(true, {}, this.flash); // Deep copy + if(error) { + event.jPlayer.error = $.extend({}, error); + } + if(warning) { + event.jPlayer.warning = $.extend({}, warning); + } + this.element.trigger(event); + }, + jPlayerFlashEvent: function(eventType, status) { // Called from Flash + if(eventType === $.jPlayer.event.ready) { + if(!this.internal.ready) { + this.internal.ready = true; + this.internal.flash.jq.css({'width':'0px', 'height':'0px'}); // Once Flash generates the ready event, minimise to zero as it is not affected by wmode anymore. + + this.version.flash = status.version; + if(this.version.needFlash !== this.version.flash) { + this._error( { + type: $.jPlayer.error.VERSION, + context: this.version.flash, + message: $.jPlayer.errorMsg.VERSION + this.version.flash, + hint: $.jPlayer.errorHint.VERSION + }); + } + this._trigger($.jPlayer.event.repeat); // Trigger the repeat event so its handler can initialize itself with the loop option. + this._trigger(eventType); + } else { + // This condition occurs if the Flash is hidden and then shown again. + // Firefox also reloads the Flash if the CSS position changes. position:fixed is used for full screen. + + // Only do this if the Flash is the solution being used at the moment. Affects Media players where both solution may be being used. + if(this.flash.gate) { + + // Send the current status to the Flash now that it is ready (available) again. + if(this.status.srcSet) { + + // Need to read original status before issuing the setMedia command. + var currentTime = this.status.currentTime, + paused = this.status.paused; + + this.setMedia(this.status.media); + this.volumeWorker(this.options.volume); + if(currentTime > 0) { + if(paused) { + this.pause(currentTime); + } else { + this.play(currentTime); + } + } + } + this._trigger($.jPlayer.event.flashreset); + } + } + } + if(this.flash.gate) { + switch(eventType) { + case $.jPlayer.event.progress: + this._getFlashStatus(status); + this._updateInterface(); + this._trigger(eventType); + break; + case $.jPlayer.event.timeupdate: + this._getFlashStatus(status); + this._updateInterface(); + this._trigger(eventType); + break; + case $.jPlayer.event.play: + this._seeked(); + this._updateButtons(true); + this._trigger(eventType); + break; + case $.jPlayer.event.pause: + this._updateButtons(false); + this._trigger(eventType); + break; + case $.jPlayer.event.ended: + this._updateButtons(false); + this._trigger(eventType); + break; + case $.jPlayer.event.click: + this._trigger(eventType); // This could be dealt with by the default + break; + case $.jPlayer.event.error: + this.status.waitForLoad = true; // Allows the load operation to try again. + this.status.waitForPlay = true; // Reset since a play was captured. + if(this.status.video) { + this.internal.flash.jq.css({'width':'0px', 'height':'0px'}); + } + if(this._validString(this.status.media.poster)) { + this.internal.poster.jq.show(); + } + if(this.css.jq.videoPlay.length && this.status.video) { + this.css.jq.videoPlay.show(); + } + if(this.status.video) { // Set up for another try. Execute before error event. + this._flash_setVideo(this.status.media); + } else { + this._flash_setAudio(this.status.media); + } + this._updateButtons(false); + this._error( { + type: $.jPlayer.error.URL, + context:status.src, + message: $.jPlayer.errorMsg.URL, + hint: $.jPlayer.errorHint.URL + }); + break; + case $.jPlayer.event.seeking: + this._seeking(); + this._trigger(eventType); + break; + case $.jPlayer.event.seeked: + this._seeked(); + this._trigger(eventType); + break; + case $.jPlayer.event.ready: + // The ready event is handled outside the switch statement. + // Captured here otherwise 2 ready events would be generated if the ready event handler used setMedia. + break; + default: + this._trigger(eventType); + } + } + return false; + }, + _getFlashStatus: function(status) { + this.status.seekPercent = status.seekPercent; + this.status.currentPercentRelative = status.currentPercentRelative; + this.status.currentPercentAbsolute = status.currentPercentAbsolute; + this.status.currentTime = status.currentTime; + this.status.duration = status.duration; + this.status.remaining = status.duration - status.currentTime; + + this.status.videoWidth = status.videoWidth; + this.status.videoHeight = status.videoHeight; + + // The Flash does not generate this information in this release + this.status.readyState = 4; // status.readyState; + this.status.networkState = 0; // status.networkState; + this.status.playbackRate = 1; // status.playbackRate; + this.status.ended = false; // status.ended; + }, + _updateButtons: function(playing) { + if(playing === undefined) { + playing = !this.status.paused; + } else { + this.status.paused = !playing; + } + // Apply the state classes. (For the useStateClassSkin:true option) + if(playing) { + this.addStateClass('playing'); + } else { + this.removeStateClass('playing'); + } + if(!this.status.noFullWindow && this.options.fullWindow) { + this.addStateClass('fullScreen'); + } else { + this.removeStateClass('fullScreen'); + } + if(this.options.loop) { + this.addStateClass('looped'); + } else { + this.removeStateClass('looped'); + } + // Toggle the GUI element pairs. (For the useStateClassSkin:false option) + if(this.css.jq.play.length && this.css.jq.pause.length) { + if(playing) { + this.css.jq.play.hide(); + this.css.jq.pause.show(); + } else { + this.css.jq.play.show(); + this.css.jq.pause.hide(); + } + } + if(this.css.jq.restoreScreen.length && this.css.jq.fullScreen.length) { + if(this.status.noFullWindow) { + this.css.jq.fullScreen.hide(); + this.css.jq.restoreScreen.hide(); + } else if(this.options.fullWindow) { + this.css.jq.fullScreen.hide(); + this.css.jq.restoreScreen.show(); + } else { + this.css.jq.fullScreen.show(); + this.css.jq.restoreScreen.hide(); + } + } + if(this.css.jq.repeat.length && this.css.jq.repeatOff.length) { + if(this.options.loop) { + this.css.jq.repeat.hide(); + this.css.jq.repeatOff.show(); + } else { + this.css.jq.repeat.show(); + this.css.jq.repeatOff.hide(); + } + } + }, + _updateInterface: function() { + if(this.css.jq.seekBar.length) { + this.css.jq.seekBar.width(this.status.seekPercent+"%"); + } + if(this.css.jq.playBar.length) { + if(this.options.smoothPlayBar) { + this.css.jq.playBar.stop().animate({ + width: this.status.currentPercentAbsolute+"%" + }, 250, "linear"); + } else { + this.css.jq.playBar.width(this.status.currentPercentRelative+"%"); + } + } + var currentTimeText = ''; + if(this.css.jq.currentTime.length) { + currentTimeText = this._convertTime(this.status.currentTime); + if(currentTimeText !== this.css.jq.currentTime.text()) { + this.css.jq.currentTime.text(this._convertTime(this.status.currentTime)); + } + } + var durationText = '', + duration = this.status.duration, + remaining = this.status.remaining; + if(this.css.jq.duration.length) { + if(typeof this.status.media.duration === 'string') { + durationText = this.status.media.duration; + } else { + if(typeof this.status.media.duration === 'number') { + duration = this.status.media.duration; + remaining = duration - this.status.currentTime; + } + if(this.options.remainingDuration) { + durationText = (remaining > 0 ? '-' : '') + this._convertTime(remaining); + } else { + durationText = this._convertTime(duration); + } + } + if(durationText !== this.css.jq.duration.text()) { + this.css.jq.duration.text(durationText); + } + } + }, + _convertTime: ConvertTime.prototype.time, + _seeking: function() { + if(this.css.jq.seekBar.length) { + this.css.jq.seekBar.addClass("jp-seeking-bg"); + } + this.addStateClass('seeking'); + }, + _seeked: function() { + if(this.css.jq.seekBar.length) { + this.css.jq.seekBar.removeClass("jp-seeking-bg"); + } + this.removeStateClass('seeking'); + }, + _resetGate: function() { + this.html.audio.gate = false; + this.html.video.gate = false; + this.aurora.gate = false; + this.flash.gate = false; + }, + _resetActive: function() { + this.html.active = false; + this.aurora.active = false; + this.flash.active = false; + }, + _escapeHtml: function(s) { + return s.split('&').join('&').split('<').join('<').split('>').join('>').split('"').join('"'); + }, + _qualifyURL: function(url) { + var el = document.createElement('div'); + el.innerHTML= 'x'; + return el.firstChild.href; + }, + _absoluteMediaUrls: function(media) { + var self = this; + $.each(media, function(type, url) { + if(url && self.format[type] && url.substr(0, 5) !== "data:") { + media[type] = self._qualifyURL(url); + } + }); + return media; + }, + addStateClass: function(state) { + if(this.ancestorJq.length) { + this.ancestorJq.addClass(this.options.stateClass[state]); + } + }, + removeStateClass: function(state) { + if(this.ancestorJq.length) { + this.ancestorJq.removeClass(this.options.stateClass[state]); + } + }, + setMedia: function(media) { + + /* media[format] = String: URL of format. Must contain all of the supplied option's video or audio formats. + * media.poster = String: Video poster URL. + * media.track = Array: Of objects defining the track element: kind, src, srclang, label, def. + * media.stream = Boolean: * NOT IMPLEMENTED * Designating actual media streams. ie., "false/undefined" for files. Plan to refresh the flash every so often. + */ + + var self = this, + supported = false, + posterChanged = this.status.media.poster !== media.poster; // Compare before reset. Important for OSX Safari as this.htmlElement.poster.src is absolute, even if original poster URL was relative. + + this._resetMedia(); + this._resetGate(); + this._resetActive(); + + // Clear the Android Fix. + this.androidFix.setMedia = false; + this.androidFix.play = false; + this.androidFix.pause = false; + + // Convert all media URLs to absolute URLs. + media = this._absoluteMediaUrls(media); + + $.each(this.formats, function(formatPriority, format) { + var isVideo = self.format[format].media === 'video'; + $.each(self.solutions, function(solutionPriority, solution) { + if(self[solution].support[format] && self._validString(media[format])) { // Format supported in solution and url given for format. + var isHtml = solution === 'html'; + var isAurora = solution === 'aurora'; + + if(isVideo) { + if(isHtml) { + self.html.video.gate = true; + self._html_setVideo(media); + self.html.active = true; + } else { + self.flash.gate = true; + self._flash_setVideo(media); + self.flash.active = true; + } + if(self.css.jq.videoPlay.length) { + self.css.jq.videoPlay.show(); + } + self.status.video = true; + } else { + if(isHtml) { + self.html.audio.gate = true; + self._html_setAudio(media); + self.html.active = true; + + // Setup the Android Fix - Only for HTML audio. + if($.jPlayer.platform.android) { + self.androidFix.setMedia = true; + } + } else if(isAurora) { + self.aurora.gate = true; + self._aurora_setAudio(media); + self.aurora.active = true; + } else { + self.flash.gate = true; + self._flash_setAudio(media); + self.flash.active = true; + } + if(self.css.jq.videoPlay.length) { + self.css.jq.videoPlay.hide(); + } + self.status.video = false; + } + + supported = true; + return false; // Exit $.each + } + }); + if(supported) { + return false; // Exit $.each + } + }); + + if(supported) { + if(!(this.status.nativeVideoControls && this.html.video.gate)) { + // Set poster IMG if native video controls are not being used + // Note: With IE the IMG onload event occurs immediately when cached. + // Note: Poster hidden by default in _resetMedia() + if(this._validString(media.poster)) { + if(posterChanged) { // Since some browsers do not generate img onload event. + this.htmlElement.poster.src = media.poster; + } else { + this.internal.poster.jq.show(); + } + } + } + if(typeof media.title === 'string') { + if(this.css.jq.title.length) { + this.css.jq.title.html(media.title); + } + if(this.htmlElement.audio) { + this.htmlElement.audio.setAttribute('title', media.title); + } + if(this.htmlElement.video) { + this.htmlElement.video.setAttribute('title', media.title); + } + } + this.status.srcSet = true; + this.status.media = $.extend({}, media); + this._updateButtons(false); + this._updateInterface(); + this._trigger($.jPlayer.event.setmedia); + } else { // jPlayer cannot support any formats provided in this browser + // Send an error event + this._error( { + type: $.jPlayer.error.NO_SUPPORT, + context: "{supplied:'" + this.options.supplied + "'}", + message: $.jPlayer.errorMsg.NO_SUPPORT, + hint: $.jPlayer.errorHint.NO_SUPPORT + }); + } + }, + _resetMedia: function() { + this._resetStatus(); + this._updateButtons(false); + this._updateInterface(); + this._seeked(); + this.internal.poster.jq.hide(); + + clearTimeout(this.internal.htmlDlyCmdId); + + if(this.html.active) { + this._html_resetMedia(); + } else if(this.aurora.active) { + this._aurora_resetMedia(); + } else if(this.flash.active) { + this._flash_resetMedia(); + } + }, + clearMedia: function() { + this._resetMedia(); + + if(this.html.active) { + this._html_clearMedia(); + } else if(this.aurora.active) { + this._aurora_clearMedia(); + } else if(this.flash.active) { + this._flash_clearMedia(); + } + + this._resetGate(); + this._resetActive(); + }, + load: function() { + if(this.status.srcSet) { + if(this.html.active) { + this._html_load(); + } else if(this.aurora.active) { + this._aurora_load(); + } else if(this.flash.active) { + this._flash_load(); + } + } else { + this._urlNotSetError("load"); + } + }, + focus: function() { + if(this.options.keyEnabled) { + $.jPlayer.focus = this; + } + }, + play: function(time) { + var guiAction = typeof time === "object"; // Flags GUI click events so we know this was not a direct command, but an action taken by the user on the GUI. + if(guiAction && this.options.useStateClassSkin && !this.status.paused) { + this.pause(time); // The time would be the click event, but passing it over so info is not lost. + } else { + time = (typeof time === "number") ? time : NaN; // Remove jQuery event from click handler + if(this.status.srcSet) { + this.focus(); + if(this.html.active) { + this._html_play(time); + } else if(this.aurora.active) { + this._aurora_play(time); + } else if(this.flash.active) { + this._flash_play(time); + } + } else { + this._urlNotSetError("play"); + } + } + }, + videoPlay: function() { // Handles clicks on the play button over the video poster + this.play(); + }, + pause: function(time) { + time = (typeof time === "number") ? time : NaN; // Remove jQuery event from click handler + if(this.status.srcSet) { + if(this.html.active) { + this._html_pause(time); + } else if(this.aurora.active) { + this._aurora_pause(time); + } else if(this.flash.active) { + this._flash_pause(time); + } + } else { + this._urlNotSetError("pause"); + } + }, + tellOthers: function(command, conditions) { + var self = this, + hasConditions = typeof conditions === 'function', + args = Array.prototype.slice.call(arguments); // Convert arguments to an Array. + + if(typeof command !== 'string') { // Ignore, since no command. + return; // Return undefined to maintain chaining. + } + if(hasConditions) { + args.splice(1, 1); // Remove the conditions from the arguments + } + + $.jPlayer.prototype.destroyRemoved(); + $.each(this.instances, function() { + // Remember that "this" is the instance's "element" in the $.each() loop. + if(self.element !== this) { // Do not tell my instance. + if(!hasConditions || conditions.call(this.data("jPlayer"), self)) { + this.jPlayer.apply(this, args); + } + } + }); + }, + pauseOthers: function(time) { + this.tellOthers("pause", function() { + // In the conditions function, the "this" context is the other instance's jPlayer object. + return this.status.srcSet; + }, time); + }, + stop: function() { + if(this.status.srcSet) { + if(this.html.active) { + this._html_pause(0); + } else if(this.aurora.active) { + this._aurora_pause(0); + } else if(this.flash.active) { + this._flash_pause(0); + } + } else { + this._urlNotSetError("stop"); + } + }, + playHead: function(p) { + p = this._limitValue(p, 0, 100); + if(this.status.srcSet) { + if(this.html.active) { + this._html_playHead(p); + } else if(this.aurora.active) { + this._aurora_playHead(p); + } else if(this.flash.active) { + this._flash_playHead(p); + } + } else { + this._urlNotSetError("playHead"); + } + }, + _muted: function(muted) { + this.mutedWorker(muted); + if(this.options.globalVolume) { + this.tellOthers("mutedWorker", function() { + // Check the other instance has global volume enabled. + return this.options.globalVolume; + }, muted); + } + }, + mutedWorker: function(muted) { + this.options.muted = muted; + if(this.html.used) { + this._html_setProperty('muted', muted); + } + if(this.aurora.used) { + this._aurora_mute(muted); + } + if(this.flash.used) { + this._flash_mute(muted); + } + + // The HTML solution generates this event from the media element itself. + if(!this.html.video.gate && !this.html.audio.gate) { + this._updateMute(muted); + this._updateVolume(this.options.volume); + this._trigger($.jPlayer.event.volumechange); + } + }, + mute: function(mute) { // mute is either: undefined (true), an event object (true) or a boolean (muted). + var guiAction = typeof mute === "object"; // Flags GUI click events so we know this was not a direct command, but an action taken by the user on the GUI. + if(guiAction && this.options.useStateClassSkin && this.options.muted) { + this._muted(false); + } else { + mute = mute === undefined ? true : !!mute; + this._muted(mute); + } + }, + unmute: function(unmute) { // unmute is either: undefined (true), an event object (true) or a boolean (!muted). + unmute = unmute === undefined ? true : !!unmute; + this._muted(!unmute); + }, + _updateMute: function(mute) { + if(mute === undefined) { + mute = this.options.muted; + } + if(mute) { + this.addStateClass('muted'); + } else { + this.removeStateClass('muted'); + } + if(this.css.jq.mute.length && this.css.jq.unmute.length) { + if(this.status.noVolume) { + this.css.jq.mute.hide(); + this.css.jq.unmute.hide(); + } else if(mute) { + this.css.jq.mute.hide(); + this.css.jq.unmute.show(); + } else { + this.css.jq.mute.show(); + this.css.jq.unmute.hide(); + } + } + }, + volume: function(v) { + this.volumeWorker(v); + if(this.options.globalVolume) { + this.tellOthers("volumeWorker", function() { + // Check the other instance has global volume enabled. + return this.options.globalVolume; + }, v); + } + }, + volumeWorker: function(v) { + v = this._limitValue(v, 0, 1); + this.options.volume = v; + + if(this.html.used) { + this._html_setProperty('volume', v); + } + if(this.aurora.used) { + this._aurora_volume(v); + } + if(this.flash.used) { + this._flash_volume(v); + } + + // The HTML solution generates this event from the media element itself. + if(!this.html.video.gate && !this.html.audio.gate) { + this._updateVolume(v); + this._trigger($.jPlayer.event.volumechange); + } + }, + volumeBar: function(e) { // Handles clicks on the volumeBar + if(this.css.jq.volumeBar.length) { + // Using $(e.currentTarget) to enable multiple volume bars + var $bar = $(e.currentTarget), + offset = $bar.offset(), + x = e.pageX - offset.left, + w = $bar.width(), + y = $bar.height() - e.pageY + offset.top, + h = $bar.height(); + if(this.options.verticalVolume) { + this.volume(y/h); + } else { + this.volume(x/w); + } + } + if(this.options.muted) { + this._muted(false); + } + }, + _updateVolume: function(v) { + if(v === undefined) { + v = this.options.volume; + } + v = this.options.muted ? 0 : v; + + if(this.status.noVolume) { + this.addStateClass('noVolume'); + if(this.css.jq.volumeBar.length) { + this.css.jq.volumeBar.hide(); + } + if(this.css.jq.volumeBarValue.length) { + this.css.jq.volumeBarValue.hide(); + } + if(this.css.jq.volumeMax.length) { + this.css.jq.volumeMax.hide(); + } + } else { + this.removeStateClass('noVolume'); + if(this.css.jq.volumeBar.length) { + this.css.jq.volumeBar.show(); + } + if(this.css.jq.volumeBarValue.length) { + this.css.jq.volumeBarValue.show(); + this.css.jq.volumeBarValue[this.options.verticalVolume ? "height" : "width"]((v*100)+"%"); + } + if(this.css.jq.volumeMax.length) { + this.css.jq.volumeMax.show(); + } + } + }, + volumeMax: function() { // Handles clicks on the volume max + this.volume(1); + if(this.options.muted) { + this._muted(false); + } + }, + _cssSelectorAncestor: function(ancestor) { + var self = this; + this.options.cssSelectorAncestor = ancestor; + this._removeUiClass(); + this.ancestorJq = ancestor ? $(ancestor) : []; // Would use $() instead of [], but it is only 1.4+ + if(ancestor && this.ancestorJq.length !== 1) { // So empty strings do not generate the warning. + this._warning( { + type: $.jPlayer.warning.CSS_SELECTOR_COUNT, + context: ancestor, + message: $.jPlayer.warningMsg.CSS_SELECTOR_COUNT + this.ancestorJq.length + " found for cssSelectorAncestor.", + hint: $.jPlayer.warningHint.CSS_SELECTOR_COUNT + }); + } + this._addUiClass(); + $.each(this.options.cssSelector, function(fn, cssSel) { + self._cssSelector(fn, cssSel); + }); + + // Set the GUI to the current state. + this._updateInterface(); + this._updateButtons(); + this._updateAutohide(); + this._updateVolume(); + this._updateMute(); + }, + _cssSelector: function(fn, cssSel) { + var self = this; + if(typeof cssSel === 'string') { + if($.jPlayer.prototype.options.cssSelector[fn]) { + if(this.css.jq[fn] && this.css.jq[fn].length) { + this.css.jq[fn].unbind(".jPlayer"); + } + this.options.cssSelector[fn] = cssSel; + this.css.cs[fn] = this.options.cssSelectorAncestor + " " + cssSel; + + if(cssSel) { // Checks for empty string + this.css.jq[fn] = $(this.css.cs[fn]); + } else { + this.css.jq[fn] = []; // To comply with the css.jq[fn].length check before its use. As of jQuery 1.4 could have used $() for an empty set. + } + + if(this.css.jq[fn].length && this[fn]) { + var handler = function(e) { + e.preventDefault(); + self[fn](e); + if(self.options.autoBlur) { + $(this).blur(); + } else { + $(this).focus(); // Force focus for ARIA. + } + }; + this.css.jq[fn].bind("click.jPlayer", handler); // Using jPlayer namespace + } + + if(cssSel && this.css.jq[fn].length !== 1) { // So empty strings do not generate the warning. ie., they just remove the old one. + this._warning( { + type: $.jPlayer.warning.CSS_SELECTOR_COUNT, + context: this.css.cs[fn], + message: $.jPlayer.warningMsg.CSS_SELECTOR_COUNT + this.css.jq[fn].length + " found for " + fn + " method.", + hint: $.jPlayer.warningHint.CSS_SELECTOR_COUNT + }); + } + } else { + this._warning( { + type: $.jPlayer.warning.CSS_SELECTOR_METHOD, + context: fn, + message: $.jPlayer.warningMsg.CSS_SELECTOR_METHOD, + hint: $.jPlayer.warningHint.CSS_SELECTOR_METHOD + }); + } + } else { + this._warning( { + type: $.jPlayer.warning.CSS_SELECTOR_STRING, + context: cssSel, + message: $.jPlayer.warningMsg.CSS_SELECTOR_STRING, + hint: $.jPlayer.warningHint.CSS_SELECTOR_STRING + }); + } + }, + duration: function(e) { + if(this.options.toggleDuration) { + if(this.options.captureDuration) { + e.stopPropagation(); + } + this._setOption("remainingDuration", !this.options.remainingDuration); + } + }, + seekBar: function(e) { // Handles clicks on the seekBar + if(this.css.jq.seekBar.length) { + // Using $(e.currentTarget) to enable multiple seek bars + var $bar = $(e.currentTarget), + offset = $bar.offset(), + x = e.pageX - offset.left, + w = $bar.width(), + p = 100 * x / w; + this.playHead(p); + } + }, + playbackRate: function(pbr) { + this._setOption("playbackRate", pbr); + }, + playbackRateBar: function(e) { // Handles clicks on the playbackRateBar + if(this.css.jq.playbackRateBar.length) { + // Using $(e.currentTarget) to enable multiple playbackRate bars + var $bar = $(e.currentTarget), + offset = $bar.offset(), + x = e.pageX - offset.left, + w = $bar.width(), + y = $bar.height() - e.pageY + offset.top, + h = $bar.height(), + ratio, pbr; + if(this.options.verticalPlaybackRate) { + ratio = y/h; + } else { + ratio = x/w; + } + pbr = ratio * (this.options.maxPlaybackRate - this.options.minPlaybackRate) + this.options.minPlaybackRate; + this.playbackRate(pbr); + } + }, + _updatePlaybackRate: function() { + var pbr = this.options.playbackRate, + ratio = (pbr - this.options.minPlaybackRate) / (this.options.maxPlaybackRate - this.options.minPlaybackRate); + if(this.status.playbackRateEnabled) { + if(this.css.jq.playbackRateBar.length) { + this.css.jq.playbackRateBar.show(); + } + if(this.css.jq.playbackRateBarValue.length) { + this.css.jq.playbackRateBarValue.show(); + this.css.jq.playbackRateBarValue[this.options.verticalPlaybackRate ? "height" : "width"]((ratio*100)+"%"); + } + } else { + if(this.css.jq.playbackRateBar.length) { + this.css.jq.playbackRateBar.hide(); + } + if(this.css.jq.playbackRateBarValue.length) { + this.css.jq.playbackRateBarValue.hide(); + } + } + }, + repeat: function(event) { // Handle clicks on the repeat button + var guiAction = typeof event === "object"; // Flags GUI click events so we know this was not a direct command, but an action taken by the user on the GUI. + if(guiAction && this.options.useStateClassSkin && this.options.loop) { + this._loop(false); + } else { + this._loop(true); + } + }, + repeatOff: function() { // Handle clicks on the repeatOff button + this._loop(false); + }, + _loop: function(loop) { + if(this.options.loop !== loop) { + this.options.loop = loop; + this._updateButtons(); + this._trigger($.jPlayer.event.repeat); + } + }, + + // Options code adapted from ui.widget.js (1.8.7). Made changes so the key can use dot notation. To match previous getData solution in jPlayer 1. + option: function(key, value) { + var options = key; + + // Enables use: options(). Returns a copy of options object + if ( arguments.length === 0 ) { + return $.extend( true, {}, this.options ); + } + + if(typeof key === "string") { + var keys = key.split("."); + + // Enables use: options("someOption") Returns a copy of the option. Supports dot notation. + if(value === undefined) { + + var opt = $.extend(true, {}, this.options); + for(var i = 0; i < keys.length; i++) { + if(opt[keys[i]] !== undefined) { + opt = opt[keys[i]]; + } else { + this._warning( { + type: $.jPlayer.warning.OPTION_KEY, + context: key, + message: $.jPlayer.warningMsg.OPTION_KEY, + hint: $.jPlayer.warningHint.OPTION_KEY + }); + return undefined; + } + } + return opt; + } + + // Enables use: options("someOptionObject", someObject}). Creates: {someOptionObject:someObject} + // Enables use: options("someOption", someValue). Creates: {someOption:someValue} + // Enables use: options("someOptionObject.someOption", someValue). Creates: {someOptionObject:{someOption:someValue}} + + options = {}; + var opts = options; + + for(var j = 0; j < keys.length; j++) { + if(j < keys.length - 1) { + opts[keys[j]] = {}; + opts = opts[keys[j]]; + } else { + opts[keys[j]] = value; + } + } + } + + // Otherwise enables use: options(optionObject). Uses original object (the key) + + this._setOptions(options); + + return this; + }, + _setOptions: function(options) { + var self = this; + $.each(options, function(key, value) { // This supports the 2 level depth that the options of jPlayer has. Would review if we ever need more depth. + self._setOption(key, value); + }); + + return this; + }, + _setOption: function(key, value) { + var self = this; + + // The ability to set options is limited at this time. + + switch(key) { + case "volume" : + this.volume(value); + break; + case "muted" : + this._muted(value); + break; + case "globalVolume" : + this.options[key] = value; + break; + case "cssSelectorAncestor" : + this._cssSelectorAncestor(value); // Set and refresh all associations for the new ancestor. + break; + case "cssSelector" : + $.each(value, function(fn, cssSel) { + self._cssSelector(fn, cssSel); // NB: The option is set inside this function, after further validity checks. + }); + break; + case "playbackRate" : + this.options[key] = value = this._limitValue(value, this.options.minPlaybackRate, this.options.maxPlaybackRate); + if(this.html.used) { + this._html_setProperty('playbackRate', value); + } + this._updatePlaybackRate(); + break; + case "defaultPlaybackRate" : + this.options[key] = value = this._limitValue(value, this.options.minPlaybackRate, this.options.maxPlaybackRate); + if(this.html.used) { + this._html_setProperty('defaultPlaybackRate', value); + } + this._updatePlaybackRate(); + break; + case "minPlaybackRate" : + this.options[key] = value = this._limitValue(value, 0.1, this.options.maxPlaybackRate - 0.1); + this._updatePlaybackRate(); + break; + case "maxPlaybackRate" : + this.options[key] = value = this._limitValue(value, this.options.minPlaybackRate + 0.1, 16); + this._updatePlaybackRate(); + break; + case "fullScreen" : + if(this.options[key] !== value) { // if changed + var wkv = $.jPlayer.nativeFeatures.fullscreen.used.webkitVideo; + if(!wkv || wkv && !this.status.waitForPlay) { + if(!wkv) { // No sensible way to unset option on these devices. + this.options[key] = value; + } + if(value) { + this._requestFullscreen(); + } else { + this._exitFullscreen(); + } + if(!wkv) { + this._setOption("fullWindow", value); + } + } + } + break; + case "fullWindow" : + if(this.options[key] !== value) { // if changed + this._removeUiClass(); + this.options[key] = value; + this._refreshSize(); + } + break; + case "size" : + if(!this.options.fullWindow && this.options[key].cssClass !== value.cssClass) { + this._removeUiClass(); + } + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this._refreshSize(); + break; + case "sizeFull" : + if(this.options.fullWindow && this.options[key].cssClass !== value.cssClass) { + this._removeUiClass(); + } + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this._refreshSize(); + break; + case "autohide" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this._updateAutohide(); + break; + case "loop" : + this._loop(value); + break; + case "remainingDuration" : + this.options[key] = value; + this._updateInterface(); + break; + case "toggleDuration" : + this.options[key] = value; + break; + case "nativeVideoControls" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this.status.nativeVideoControls = this._uaBlocklist(this.options.nativeVideoControls); + this._restrictNativeVideoControls(); + this._updateNativeVideoControls(); + break; + case "noFullWindow" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this.status.nativeVideoControls = this._uaBlocklist(this.options.nativeVideoControls); // Need to check again as noFullWindow can depend on this flag and the restrict() can override it. + this.status.noFullWindow = this._uaBlocklist(this.options.noFullWindow); + this._restrictNativeVideoControls(); + this._updateButtons(); + break; + case "noVolume" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + this.status.noVolume = this._uaBlocklist(this.options.noVolume); + this._updateVolume(); + this._updateMute(); + break; + case "emulateHtml" : + if(this.options[key] !== value) { // To avoid multiple event handlers being created, if true already. + this.options[key] = value; + if(value) { + this._emulateHtmlBridge(); + } else { + this._destroyHtmlBridge(); + } + } + break; + case "timeFormat" : + this.options[key] = $.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed. + break; + case "keyEnabled" : + this.options[key] = value; + if(!value && this === $.jPlayer.focus) { + $.jPlayer.focus = null; + } + break; + case "keyBindings" : + this.options[key] = $.extend(true, {}, this.options[key], value); // store a merged DEEP copy of it, incase not all properties changed. + break; + case "audioFullScreen" : + this.options[key] = value; + break; + case "autoBlur" : + this.options[key] = value; + break; + } + + return this; + }, + // End of: (Options code adapted from ui.widget.js) + + _refreshSize: function() { + this._setSize(); // update status and jPlayer element size + this._addUiClass(); // update the ui class + this._updateSize(); // update internal sizes + this._updateButtons(); + this._updateAutohide(); + this._trigger($.jPlayer.event.resize); + }, + _setSize: function() { + // Determine the current size from the options + if(this.options.fullWindow) { + this.status.width = this.options.sizeFull.width; + this.status.height = this.options.sizeFull.height; + this.status.cssClass = this.options.sizeFull.cssClass; + } else { + this.status.width = this.options.size.width; + this.status.height = this.options.size.height; + this.status.cssClass = this.options.size.cssClass; + } + + // Set the size of the jPlayer area. + this.element.css({'width': this.status.width, 'height': this.status.height}); + }, + _addUiClass: function() { + if(this.ancestorJq.length) { + this.ancestorJq.addClass(this.status.cssClass); + } + }, + _removeUiClass: function() { + if(this.ancestorJq.length) { + this.ancestorJq.removeClass(this.status.cssClass); + } + }, + _updateSize: function() { + // The poster uses show/hide so can simply resize it. + this.internal.poster.jq.css({'width': this.status.width, 'height': this.status.height}); + + // Video html or flash resized if necessary at this time, or if native video controls being used. + if(!this.status.waitForPlay && this.html.active && this.status.video || this.html.video.available && this.html.used && this.status.nativeVideoControls) { + this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height}); + } + else if(!this.status.waitForPlay && this.flash.active && this.status.video) { + this.internal.flash.jq.css({'width': this.status.width, 'height': this.status.height}); + } + }, + _updateAutohide: function() { + var self = this, + event = "mousemove.jPlayer", + namespace = ".jPlayerAutohide", + eventType = event + namespace, + handler = function(event) { + var moved = false, + deltaX, deltaY; + if(typeof self.internal.mouse !== "undefined") { + //get the change from last position to this position + deltaX = self.internal.mouse.x - event.pageX; + deltaY = self.internal.mouse.y - event.pageY; + moved = (Math.floor(deltaX) > 0) || (Math.floor(deltaY)>0); + } else { + moved = true; + } + // store current position for next method execution + self.internal.mouse = { + x : event.pageX, + y : event.pageY + }; + // if mouse has been actually moved, do the gui fadeIn/fadeOut + if (moved) { + self.css.jq.gui.fadeIn(self.options.autohide.fadeIn, function() { + clearTimeout(self.internal.autohideId); + self.internal.autohideId = setTimeout( function() { + self.css.jq.gui.fadeOut(self.options.autohide.fadeOut); + }, self.options.autohide.hold); + }); + } + }; + + if(this.css.jq.gui.length) { + + // End animations first so that its callback is executed now. + // Otherwise an in progress fadeIn animation still has the callback to fadeOut again. + this.css.jq.gui.stop(true, true); + + // Removes the fadeOut operation from the fadeIn callback. + clearTimeout(this.internal.autohideId); + // undefine mouse + delete this.internal.mouse; + + this.element.unbind(namespace); + this.css.jq.gui.unbind(namespace); + + if(!this.status.nativeVideoControls) { + if(this.options.fullWindow && this.options.autohide.full || !this.options.fullWindow && this.options.autohide.restored) { + this.element.bind(eventType, handler); + this.css.jq.gui.bind(eventType, handler); + this.css.jq.gui.hide(); + } else { + this.css.jq.gui.show(); + } + } else { + this.css.jq.gui.hide(); + } + } + }, + fullScreen: function(event) { + var guiAction = typeof event === "object"; // Flags GUI click events so we know this was not a direct command, but an action taken by the user on the GUI. + if(guiAction && this.options.useStateClassSkin && this.options.fullScreen) { + this._setOption("fullScreen", false); + } else { + this._setOption("fullScreen", true); + } + }, + restoreScreen: function() { + this._setOption("fullScreen", false); + }, + _fullscreenAddEventListeners: function() { + var self = this, + fs = $.jPlayer.nativeFeatures.fullscreen; + + if(fs.api.fullscreenEnabled) { + if(fs.event.fullscreenchange) { + // Create the event handler function and store it for removal. + if(typeof this.internal.fullscreenchangeHandler !== 'function') { + this.internal.fullscreenchangeHandler = function() { + self._fullscreenchange(); + }; + } + document.addEventListener(fs.event.fullscreenchange, this.internal.fullscreenchangeHandler, false); + } + // No point creating handler for fullscreenerror. + // Either logic avoids fullscreen occurring (w3c/moz), or their is no event on the browser (webkit). + } + }, + _fullscreenRemoveEventListeners: function() { + var fs = $.jPlayer.nativeFeatures.fullscreen; + if(this.internal.fullscreenchangeHandler) { + document.removeEventListener(fs.event.fullscreenchange, this.internal.fullscreenchangeHandler, false); + } + }, + _fullscreenchange: function() { + // If nothing is fullscreen, then we cannot be in fullscreen mode. + if(this.options.fullScreen && !$.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()) { + this._setOption("fullScreen", false); + } + }, + _requestFullscreen: function() { + // Either the container or the jPlayer div + var e = this.ancestorJq.length ? this.ancestorJq[0] : this.element[0], + fs = $.jPlayer.nativeFeatures.fullscreen; + + // This method needs the video element. For iOS and Android. + if(fs.used.webkitVideo) { + e = this.htmlElement.video; + } + + if(fs.api.fullscreenEnabled) { + fs.api.requestFullscreen(e); + } + }, + _exitFullscreen: function() { + + var fs = $.jPlayer.nativeFeatures.fullscreen, + e; + + // This method needs the video element. For iOS and Android. + if(fs.used.webkitVideo) { + e = this.htmlElement.video; + } + + if(fs.api.fullscreenEnabled) { + fs.api.exitFullscreen(e); + } + }, + _html_initMedia: function(media) { + // Remove any existing track elements + var $media = $(this.htmlElement.media).empty(); + + // Create any track elements given with the media, as an Array of track Objects. + $.each(media.track || [], function(i,v) { + var track = document.createElement('track'); + track.setAttribute("kind", v.kind ? v.kind : ""); + track.setAttribute("src", v.src ? v.src : ""); + track.setAttribute("srclang", v.srclang ? v.srclang : ""); + track.setAttribute("label", v.label ? v.label : ""); + if(v.def) { + track.setAttribute("default", v.def); + } + $media.append(track); + }); + + this.htmlElement.media.src = this.status.src; + + if(this.options.preload !== 'none') { + this._html_load(); // See function for comments + } + this._trigger($.jPlayer.event.timeupdate); // The flash generates this event for its solution. + }, + _html_setFormat: function(media) { + var self = this; + // Always finds a format due to checks in setMedia() + $.each(this.formats, function(priority, format) { + if(self.html.support[format] && media[format]) { + self.status.src = media[format]; + self.status.format[format] = true; + self.status.formatType = format; + return false; + } + }); + }, + _html_setAudio: function(media) { + this._html_setFormat(media); + this.htmlElement.media = this.htmlElement.audio; + this._html_initMedia(media); + }, + _html_setVideo: function(media) { + this._html_setFormat(media); + if(this.status.nativeVideoControls) { + this.htmlElement.video.poster = this._validString(media.poster) ? media.poster : ""; + } + this.htmlElement.media = this.htmlElement.video; + this._html_initMedia(media); + }, + _html_resetMedia: function() { + if(this.htmlElement.media) { + if(this.htmlElement.media.id === this.internal.video.id && !this.status.nativeVideoControls) { + this.internal.video.jq.css({'width':'0px', 'height':'0px'}); + } + this.htmlElement.media.pause(); + } + }, + _html_clearMedia: function() { + if(this.htmlElement.media) { + this.htmlElement.media.src = "about:blank"; + // The following load() is only required for Firefox 3.6 (PowerMacs). + // Recent HTMl5 browsers only require the src change. Due to changes in W3C spec and load() effect. + this.htmlElement.media.load(); // Stops an old, "in progress" download from continuing the download. Triggers the loadstart, error and emptied events, due to the empty src. Also an abort event if a download was in progress. + } + }, + _html_load: function() { + // This function remains to allow the early HTML5 browsers to work, such as Firefox 3.6 + // A change in the W3C spec for the media.load() command means that this is no longer necessary. + // This command should be removed and actually causes minor undesirable effects on some browsers. Such as loading the whole file and not only the metadata. + if(this.status.waitForLoad) { + this.status.waitForLoad = false; + this.htmlElement.media.load(); + } + clearTimeout(this.internal.htmlDlyCmdId); + }, + _html_play: function(time) { + var self = this, + media = this.htmlElement.media; + + this.androidFix.pause = false; // Cancel the pause fix. + + this._html_load(); // Loads if required and clears any delayed commands. + + // Setup the Android Fix. + if(this.androidFix.setMedia) { + this.androidFix.play = true; + this.androidFix.time = time; + + } else if(!isNaN(time)) { + + // Attempt to play it, since iOS has been ignoring commands + if(this.internal.cmdsIgnored) { + media.play(); + } + + try { + // !media.seekable is for old HTML5 browsers, like Firefox 3.6. + // Checking seekable.length is important for iOS6 to work with setMedia().play(time) + if(!media.seekable || typeof media.seekable === "object" && media.seekable.length > 0) { + media.currentTime = time; + media.play(); + } else { + throw 1; + } + } catch(err) { + this.internal.htmlDlyCmdId = setTimeout(function() { + self.play(time); + }, 250); + return; // Cancel execution and wait for the delayed command. + } + } else { + media.play(); + } + this._html_checkWaitForPlay(); + }, + _html_pause: function(time) { + var self = this, + media = this.htmlElement.media; + + this.androidFix.play = false; // Cancel the play fix. + + if(time > 0) { // We do not want the stop() command, which does pause(0), causing a load operation. + this._html_load(); // Loads if required and clears any delayed commands. + } else { + clearTimeout(this.internal.htmlDlyCmdId); + } + + // Order of these commands is important for Safari (Win) and IE9. Pause then change currentTime. + media.pause(); + + // Setup the Android Fix. + if(this.androidFix.setMedia) { + this.androidFix.pause = true; + this.androidFix.time = time; + + } else if(!isNaN(time)) { + try { + if(!media.seekable || typeof media.seekable === "object" && media.seekable.length > 0) { + media.currentTime = time; + } else { + throw 1; + } + } catch(err) { + this.internal.htmlDlyCmdId = setTimeout(function() { + self.pause(time); + }, 250); + return; // Cancel execution and wait for the delayed command. + } + } + if(time > 0) { // Avoids a setMedia() followed by stop() or pause(0) hiding the video play button. + this._html_checkWaitForPlay(); + } + }, + _html_playHead: function(percent) { + var self = this, + media = this.htmlElement.media; + + this._html_load(); // Loads if required and clears any delayed commands. + + // This playHead() method needs a refactor to apply the android fix. + + try { + if(typeof media.seekable === "object" && media.seekable.length > 0) { + media.currentTime = percent * media.seekable.end(media.seekable.length-1) / 100; + } else if(media.duration > 0 && !isNaN(media.duration)) { + media.currentTime = percent * media.duration / 100; + } else { + throw "e"; + } + } catch(err) { + this.internal.htmlDlyCmdId = setTimeout(function() { + self.playHead(percent); + }, 250); + return; // Cancel execution and wait for the delayed command. + } + if(!this.status.waitForLoad) { + this._html_checkWaitForPlay(); + } + }, + _html_checkWaitForPlay: function() { + if(this.status.waitForPlay) { + this.status.waitForPlay = false; + if(this.css.jq.videoPlay.length) { + this.css.jq.videoPlay.hide(); + } + if(this.status.video) { + this.internal.poster.jq.hide(); + this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height}); + } + } + }, + _html_setProperty: function(property, value) { + if(this.html.audio.available) { + this.htmlElement.audio[property] = value; + } + if(this.html.video.available) { + this.htmlElement.video[property] = value; + } + }, + _aurora_setAudio: function(media) { + var self = this; + + // Always finds a format due to checks in setMedia() + $.each(this.formats, function(priority, format) { + if(self.aurora.support[format] && media[format]) { + self.status.src = media[format]; + self.status.format[format] = true; + self.status.formatType = format; + + return false; + } + }); + + this.aurora.player = new AV.Player.fromURL(this.status.src); + this._addAuroraEventListeners(this.aurora.player, this.aurora); + + if(this.options.preload === 'auto') { + this._aurora_load(); + this.status.waitForLoad = false; + } + }, + _aurora_resetMedia: function() { + if (this.aurora.player) { + this.aurora.player.stop(); + } + }, + _aurora_clearMedia: function() { + // Nothing to clear. + }, + _aurora_load: function() { + if(this.status.waitForLoad) { + this.status.waitForLoad = false; + this.aurora.player.preload(); + } + }, + _aurora_play: function(time) { + if (!this.status.waitForLoad) { + if (!isNaN(time)) { + this.aurora.player.seek(time); + } + } + if (!this.aurora.player.playing) { + this.aurora.player.play(); + } + this.status.waitForLoad = false; + this._aurora_checkWaitForPlay(); + + // No event from the player, update UI now. + this._updateButtons(true); + this._trigger($.jPlayer.event.play); + }, + _aurora_pause: function(time) { + if (!isNaN(time)) { + this.aurora.player.seek(time * 1000); + } + this.aurora.player.pause(); + + if(time > 0) { // Avoids a setMedia() followed by stop() or pause(0) hiding the video play button. + this._aurora_checkWaitForPlay(); + } + + // No event from the player, update UI now. + this._updateButtons(false); + this._trigger($.jPlayer.event.pause); + }, + _aurora_playHead: function(percent) { + if(this.aurora.player.duration > 0) { + // The seek() sould be in milliseconds, but the only codec that works with seek (aac.js) uses seconds. + this.aurora.player.seek(percent * this.aurora.player.duration / 100); // Using seconds + } + + if(!this.status.waitForLoad) { + this._aurora_checkWaitForPlay(); + } + }, + _aurora_checkWaitForPlay: function() { + if(this.status.waitForPlay) { + this.status.waitForPlay = false; + } + }, + _aurora_volume: function(v) { + this.aurora.player.volume = v * 100; + }, + _aurora_mute: function(m) { + if (m) { + this.aurora.properties.lastvolume = this.aurora.player.volume; + this.aurora.player.volume = 0; + } else { + this.aurora.player.volume = this.aurora.properties.lastvolume; + } + this.aurora.properties.muted = m; + }, + _flash_setAudio: function(media) { + var self = this; + try { + // Always finds a format due to checks in setMedia() + $.each(this.formats, function(priority, format) { + if(self.flash.support[format] && media[format]) { + switch (format) { + case "m4a" : + case "fla" : + self._getMovie().fl_setAudio_m4a(media[format]); + break; + case "mp3" : + self._getMovie().fl_setAudio_mp3(media[format]); + break; + case "rtmpa": + self._getMovie().fl_setAudio_rtmp(media[format]); + break; + } + self.status.src = media[format]; + self.status.format[format] = true; + self.status.formatType = format; + return false; + } + }); + + if(this.options.preload === 'auto') { + this._flash_load(); + this.status.waitForLoad = false; + } + } catch(err) { this._flashError(err); } + }, + _flash_setVideo: function(media) { + var self = this; + try { + // Always finds a format due to checks in setMedia() + $.each(this.formats, function(priority, format) { + if(self.flash.support[format] && media[format]) { + switch (format) { + case "m4v" : + case "flv" : + self._getMovie().fl_setVideo_m4v(media[format]); + break; + case "rtmpv": + self._getMovie().fl_setVideo_rtmp(media[format]); + break; + } + self.status.src = media[format]; + self.status.format[format] = true; + self.status.formatType = format; + return false; + } + }); + + if(this.options.preload === 'auto') { + this._flash_load(); + this.status.waitForLoad = false; + } + } catch(err) { this._flashError(err); } + }, + _flash_resetMedia: function() { + this.internal.flash.jq.css({'width':'0px', 'height':'0px'}); // Must do via CSS as setting attr() to zero causes a jQuery error in IE. + this._flash_pause(NaN); + }, + _flash_clearMedia: function() { + try { + this._getMovie().fl_clearMedia(); + } catch(err) { this._flashError(err); } + }, + _flash_load: function() { + try { + this._getMovie().fl_load(); + } catch(err) { this._flashError(err); } + this.status.waitForLoad = false; + }, + _flash_play: function(time) { + try { + this._getMovie().fl_play(time); + } catch(err) { this._flashError(err); } + this.status.waitForLoad = false; + this._flash_checkWaitForPlay(); + }, + _flash_pause: function(time) { + try { + this._getMovie().fl_pause(time); + } catch(err) { this._flashError(err); } + if(time > 0) { // Avoids a setMedia() followed by stop() or pause(0) hiding the video play button. + this.status.waitForLoad = false; + this._flash_checkWaitForPlay(); + } + }, + _flash_playHead: function(p) { + try { + this._getMovie().fl_play_head(p); + } catch(err) { this._flashError(err); } + if(!this.status.waitForLoad) { + this._flash_checkWaitForPlay(); + } + }, + _flash_checkWaitForPlay: function() { + if(this.status.waitForPlay) { + this.status.waitForPlay = false; + if(this.css.jq.videoPlay.length) { + this.css.jq.videoPlay.hide(); + } + if(this.status.video) { + this.internal.poster.jq.hide(); + this.internal.flash.jq.css({'width': this.status.width, 'height': this.status.height}); + } + } + }, + _flash_volume: function(v) { + try { + this._getMovie().fl_volume(v); + } catch(err) { this._flashError(err); } + }, + _flash_mute: function(m) { + try { + this._getMovie().fl_mute(m); + } catch(err) { this._flashError(err); } + }, + _getMovie: function() { + return document[this.internal.flash.id]; + }, + _getFlashPluginVersion: function() { + + // _getFlashPluginVersion() code influenced by: + // - FlashReplace 1.01: http://code.google.com/p/flashreplace/ + // - SWFObject 2.2: http://code.google.com/p/swfobject/ + + var version = 0, + flash; + if(window.ActiveXObject) { + try { + flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); + if (flash) { // flash will return null when ActiveX is disabled + var v = flash.GetVariable("$version"); + if(v) { + v = v.split(" ")[1].split(","); + version = parseInt(v[0], 10) + "." + parseInt(v[1], 10); + } + } + } catch(e) {} + } + else if(navigator.plugins && navigator.mimeTypes.length > 0) { + flash = navigator.plugins["Shockwave Flash"]; + if(flash) { + version = navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/, "$1"); + } + } + return version * 1; // Converts to a number + }, + _checkForFlash: function (version) { + var flashOk = false; + if(this._getFlashPluginVersion() >= version) { + flashOk = true; + } + return flashOk; + }, + _validString: function(url) { + return (url && typeof url === "string"); // Empty strings return false + }, + _limitValue: function(value, min, max) { + return (value < min) ? min : ((value > max) ? max : value); + }, + _urlNotSetError: function(context) { + this._error( { + type: $.jPlayer.error.URL_NOT_SET, + context: context, + message: $.jPlayer.errorMsg.URL_NOT_SET, + hint: $.jPlayer.errorHint.URL_NOT_SET + }); + }, + _flashError: function(error) { + var errorType; + if(!this.internal.ready) { + errorType = "FLASH"; + } else { + errorType = "FLASH_DISABLED"; + } + this._error( { + type: $.jPlayer.error[errorType], + context: this.internal.flash.swf, + message: $.jPlayer.errorMsg[errorType] + error.message, + hint: $.jPlayer.errorHint[errorType] + }); + // Allow the audio player to recover if display:none and then shown again, or with position:fixed on Firefox. + // This really only affects audio in a media player, as an audio player could easily move the jPlayer element away from such issues. + this.internal.flash.jq.css({'width':'1px', 'height':'1px'}); + }, + _error: function(error) { + this._trigger($.jPlayer.event.error, error); + if(this.options.errorAlerts) { + this._alert("Error!" + (error.message ? "\n" + error.message : "") + (error.hint ? "\n" + error.hint : "") + "\nContext: " + error.context); + } + }, + _warning: function(warning) { + this._trigger($.jPlayer.event.warning, undefined, warning); + if(this.options.warningAlerts) { + this._alert("Warning!" + (warning.message ? "\n" + warning.message : "") + (warning.hint ? "\n" + warning.hint : "") + "\nContext: " + warning.context); + } + }, + _alert: function(message) { + var msg = "jPlayer " + this.version.script + " : id='" + this.internal.self.id +"' : " + message; + if(!this.options.consoleAlerts) { + alert(msg); + } else if(window.console && window.console.log) { + window.console.log(msg); + } + }, + _emulateHtmlBridge: function() { + var self = this; + + // Emulate methods on jPlayer's DOM element. + $.each( $.jPlayer.emulateMethods.split(/\s+/g), function(i, name) { + self.internal.domNode[name] = function(arg) { + self[name](arg); + }; + + }); + + // Bubble jPlayer events to its DOM element. + $.each($.jPlayer.event, function(eventName,eventType) { + var nativeEvent = true; + $.each( $.jPlayer.reservedEvent.split(/\s+/g), function(i, name) { + if(name === eventName) { + nativeEvent = false; + return false; + } + }); + if(nativeEvent) { + self.element.bind(eventType + ".jPlayer.jPlayerHtml", function() { // With .jPlayer & .jPlayerHtml namespaces. + self._emulateHtmlUpdate(); + var domEvent = document.createEvent("Event"); + domEvent.initEvent(eventName, false, true); + self.internal.domNode.dispatchEvent(domEvent); + }); + } + // The error event would require a special case + }); + + // IE9 has a readyState property on all elements. The document should have it, but all (except media) elements inherit it in IE9. This conflicts with Popcorn, which polls the readyState. + }, + _emulateHtmlUpdate: function() { + var self = this; + + $.each( $.jPlayer.emulateStatus.split(/\s+/g), function(i, name) { + self.internal.domNode[name] = self.status[name]; + }); + $.each( $.jPlayer.emulateOptions.split(/\s+/g), function(i, name) { + self.internal.domNode[name] = self.options[name]; + }); + }, + _destroyHtmlBridge: function() { + var self = this; + + // Bridge event handlers are also removed by destroy() through .jPlayer namespace. + this.element.unbind(".jPlayerHtml"); // Remove all event handlers created by the jPlayer bridge. So you can change the emulateHtml option. + + // Remove the methods and properties + var emulated = $.jPlayer.emulateMethods + " " + $.jPlayer.emulateStatus + " " + $.jPlayer.emulateOptions; + $.each( emulated.split(/\s+/g), function(i, name) { + delete self.internal.domNode[name]; + }); + } + }; + + $.jPlayer.error = { + FLASH: "e_flash", + FLASH_DISABLED: "e_flash_disabled", + NO_SOLUTION: "e_no_solution", + NO_SUPPORT: "e_no_support", + URL: "e_url", + URL_NOT_SET: "e_url_not_set", + VERSION: "e_version" + }; + + $.jPlayer.errorMsg = { + FLASH: "jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ", // Used in: _flashError() + FLASH_DISABLED: "jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ", // Used in: _flashError() + NO_SOLUTION: "No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.", // Used in: _init() + NO_SUPPORT: "It is not possible to play any media format provided in setMedia() on this browser using your current options.", // Used in: setMedia() + URL: "Media URL could not be loaded.", // Used in: jPlayerFlashEvent() and _addHtmlEventListeners() + URL_NOT_SET: "Attempt to issue media playback commands, while no media url is set.", // Used in: load(), play(), pause(), stop() and playHead() + VERSION: "jPlayer " + $.jPlayer.prototype.version.script + " needs Jplayer.swf version " + $.jPlayer.prototype.version.needFlash + " but found " // Used in: jPlayerReady() + }; + + $.jPlayer.errorHint = { + FLASH: "Check your swfPath option and that Jplayer.swf is there.", + FLASH_DISABLED: "Check that you have not display:none; the jPlayer entity or any ancestor.", + NO_SOLUTION: "Review the jPlayer options: support and supplied.", + NO_SUPPORT: "Video or audio formats defined in the supplied option are missing.", + URL: "Check media URL is valid.", + URL_NOT_SET: "Use setMedia() to set the media URL.", + VERSION: "Update jPlayer files." + }; + + $.jPlayer.warning = { + CSS_SELECTOR_COUNT: "e_css_selector_count", + CSS_SELECTOR_METHOD: "e_css_selector_method", + CSS_SELECTOR_STRING: "e_css_selector_string", + OPTION_KEY: "e_option_key" + }; + + $.jPlayer.warningMsg = { + CSS_SELECTOR_COUNT: "The number of css selectors found did not equal one: ", + CSS_SELECTOR_METHOD: "The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.", + CSS_SELECTOR_STRING: "The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.", + OPTION_KEY: "The option requested in jPlayer('option') is undefined." + }; + + $.jPlayer.warningHint = { + CSS_SELECTOR_COUNT: "Check your css selector and the ancestor.", + CSS_SELECTOR_METHOD: "Check your method name.", + CSS_SELECTOR_STRING: "Check your css selector is a string.", + OPTION_KEY: "Check your option name." + }; +})); + +}); diff --git a/components/require.config.js b/components/require.config.js new file mode 100644 index 0000000..8097aa8 --- /dev/null +++ b/components/require.config.js @@ -0,0 +1,24 @@ +var components = { + "packages": [ + { + "name": "jplayer", + "main": "jplayer-built.js" + } + ], + "shim": { + "jplayer": { + "deps": [ + "jquery" + ] + } + }, + "baseUrl": "components" +}; +if (typeof require !== "undefined" && require.config) { + require.config(components); +} else { + var require = components; +} +if (typeof exports !== "undefined" && typeof module !== "undefined") { + module.exports = components; +} \ No newline at end of file diff --git a/components/require.css b/components/require.css new file mode 100644 index 0000000..e69de29 diff --git a/components/require.js b/components/require.js new file mode 100644 index 0000000..24a45d0 --- /dev/null +++ b/components/require.js @@ -0,0 +1,2044 @@ +/** vim: et:ts=4:sw=4:sts=4 + * @license RequireJS 2.1.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ +//Not using strict: uneven strict support in browsers, #392, and causes +//problems with requirejs.exec()/transpiler plugins that may not be strict. +/*jslint regexp: true, nomen: true, sloppy: true */ +/*global window, navigator, document, importScripts, setTimeout, opera */ + +var requirejs, require, define; +(function (global) { + var req, s, head, baseElement, dataMain, src, + interactiveScript, currentlyAddingScript, mainScript, subPath, + version = '2.1.5', + commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, + cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, + jsSuffixRegExp = /\.js$/, + currDirRegExp = /^\.\//, + op = Object.prototype, + ostring = op.toString, + hasOwn = op.hasOwnProperty, + ap = Array.prototype, + apsp = ap.splice, + isBrowser = !!(typeof window !== 'undefined' && navigator && document), + isWebWorker = !isBrowser && typeof importScripts !== 'undefined', + //PS3 indicates loaded and complete, but need to wait for complete + //specifically. Sequence is 'loading', 'loaded', execution, + // then 'complete'. The UA check is unfortunate, but not sure how + //to feature test w/o causing perf issues. + readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? + /^complete$/ : /^(complete|loaded)$/, + defContextName = '_', + //Oh the tragedy, detecting opera. See the usage of isOpera for reason. + isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]', + contexts = {}, + cfg = {}, + globalDefQueue = [], + useInteractive = false; + + function isFunction(it) { + return ostring.call(it) === '[object Function]'; + } + + function isArray(it) { + return ostring.call(it) === '[object Array]'; + } + + /** + * Helper function for iterating over an array. If the func returns + * a true value, it will break out of the loop. + */ + function each(ary, func) { + if (ary) { + var i; + for (i = 0; i < ary.length; i += 1) { + if (ary[i] && func(ary[i], i, ary)) { + break; + } + } + } + } + + /** + * Helper function for iterating over an array backwards. If the func + * returns a true value, it will break out of the loop. + */ + function eachReverse(ary, func) { + if (ary) { + var i; + for (i = ary.length - 1; i > -1; i -= 1) { + if (ary[i] && func(ary[i], i, ary)) { + break; + } + } + } + } + + function hasProp(obj, prop) { + return hasOwn.call(obj, prop); + } + + function getOwn(obj, prop) { + return hasProp(obj, prop) && obj[prop]; + } + + /** + * Cycles over properties in an object and calls a function for each + * property value. If the function returns a truthy value, then the + * iteration is stopped. + */ + function eachProp(obj, func) { + var prop; + for (prop in obj) { + if (hasProp(obj, prop)) { + if (func(obj[prop], prop)) { + break; + } + } + } + } + + /** + * Simple function to mix in properties from source into target, + * but only if target does not already have a property of the same name. + */ + function mixin(target, source, force, deepStringMixin) { + if (source) { + eachProp(source, function (value, prop) { + if (force || !hasProp(target, prop)) { + if (deepStringMixin && typeof value !== 'string') { + if (!target[prop]) { + target[prop] = {}; + } + mixin(target[prop], value, force, deepStringMixin); + } else { + target[prop] = value; + } + } + }); + } + return target; + } + + //Similar to Function.prototype.bind, but the 'this' object is specified + //first, since it is easier to read/figure out what 'this' will be. + function bind(obj, fn) { + return function () { + return fn.apply(obj, arguments); + }; + } + + function scripts() { + return document.getElementsByTagName('script'); + } + + //Allow getting a global that expressed in + //dot notation, like 'a.b.c'. + function getGlobal(value) { + if (!value) { + return value; + } + var g = global; + each(value.split('.'), function (part) { + g = g[part]; + }); + return g; + } + + /** + * Constructs an error with a pointer to an URL with more information. + * @param {String} id the error ID that maps to an ID on a web page. + * @param {String} message human readable error. + * @param {Error} [err] the original error, if there is one. + * + * @returns {Error} + */ + function makeError(id, msg, err, requireModules) { + var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id); + e.requireType = id; + e.requireModules = requireModules; + if (err) { + e.originalError = err; + } + return e; + } + + if (typeof define !== 'undefined') { + //If a define is already in play via another AMD loader, + //do not overwrite. + return; + } + + if (typeof requirejs !== 'undefined') { + if (isFunction(requirejs)) { + //Do not overwrite and existing requirejs instance. + return; + } + cfg = requirejs; + requirejs = undefined; + } + + //Allow for a require config object + if (typeof require !== 'undefined' && !isFunction(require)) { + //assume it is a config object. + cfg = require; + require = undefined; + } + + function newContext(contextName) { + var inCheckLoaded, Module, context, handlers, + checkLoadedTimeoutId, + config = { + //Defaults. Do not set a default for map + //config to speed up normalize(), which + //will run faster if there is no default. + waitSeconds: 7, + baseUrl: './', + paths: {}, + pkgs: {}, + shim: {}, + config: {} + }, + registry = {}, + //registry of just enabled modules, to speed + //cycle breaking code when lots of modules + //are registered, but not activated. + enabledRegistry = {}, + undefEvents = {}, + defQueue = [], + defined = {}, + urlFetched = {}, + requireCounter = 1, + unnormalizedCounter = 1; + + /** + * Trims the . and .. from an array of path segments. + * It will keep a leading path segment if a .. will become + * the first path segment, to help with module name lookups, + * which act like paths, but can be remapped. But the end result, + * all paths that use this function should look normalized. + * NOTE: this method MODIFIES the input array. + * @param {Array} ary the array of path segments. + */ + function trimDots(ary) { + var i, part; + for (i = 0; ary[i]; i += 1) { + part = ary[i]; + if (part === '.') { + ary.splice(i, 1); + i -= 1; + } else if (part === '..') { + if (i === 1 && (ary[2] === '..' || ary[0] === '..')) { + //End of the line. Keep at least one non-dot + //path segment at the front so it can be mapped + //correctly to disk. Otherwise, there is likely + //no path mapping for a path starting with '..'. + //This can still fail, but catches the most reasonable + //uses of .. + break; + } else if (i > 0) { + ary.splice(i - 1, 2); + i -= 2; + } + } + } + } + + /** + * Given a relative module name, like ./something, normalize it to + * a real name that can be mapped to a path. + * @param {String} name the relative name + * @param {String} baseName a real name that the name arg is relative + * to. + * @param {Boolean} applyMap apply the map config to the value. Should + * only be done if this normalization is for a dependency ID. + * @returns {String} normalized name + */ + function normalize(name, baseName, applyMap) { + var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment, + foundMap, foundI, foundStarMap, starI, + baseParts = baseName && baseName.split('/'), + normalizedBaseParts = baseParts, + map = config.map, + starMap = map && map['*']; + + //Adjust any relative paths. + if (name && name.charAt(0) === '.') { + //If have a base name, try to normalize against it, + //otherwise, assume it is a top-level require that will + //be relative to baseUrl in the end. + if (baseName) { + if (getOwn(config.pkgs, baseName)) { + //If the baseName is a package name, then just treat it as one + //name to concat the name with. + normalizedBaseParts = baseParts = [baseName]; + } else { + //Convert baseName to array, and lop off the last part, + //so that . matches that 'directory' and not name of the baseName's + //module. For instance, baseName of 'one/two/three', maps to + //'one/two/three.js', but we want the directory, 'one/two' for + //this normalization. + normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); + } + + name = normalizedBaseParts.concat(name.split('/')); + trimDots(name); + + //Some use of packages may use a . path to reference the + //'main' module name, so normalize for that. + pkgConfig = getOwn(config.pkgs, (pkgName = name[0])); + name = name.join('/'); + if (pkgConfig && name === pkgName + '/' + pkgConfig.main) { + name = pkgName; + } + } else if (name.indexOf('./') === 0) { + // No baseName, so this is ID is resolved relative + // to baseUrl, pull off the leading dot. + name = name.substring(2); + } + } + + //Apply map config if available. + if (applyMap && map && (baseParts || starMap)) { + nameParts = name.split('/'); + + for (i = nameParts.length; i > 0; i -= 1) { + nameSegment = nameParts.slice(0, i).join('/'); + + if (baseParts) { + //Find the longest baseName segment match in the config. + //So, do joins on the biggest to smallest lengths of baseParts. + for (j = baseParts.length; j > 0; j -= 1) { + mapValue = getOwn(map, baseParts.slice(0, j).join('/')); + + //baseName segment has config, find if it has one for + //this name. + if (mapValue) { + mapValue = getOwn(mapValue, nameSegment); + if (mapValue) { + //Match, update name to the new value. + foundMap = mapValue; + foundI = i; + break; + } + } + } + } + + if (foundMap) { + break; + } + + //Check for a star map match, but just hold on to it, + //if there is a shorter segment match later in a matching + //config, then favor over this star map. + if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) { + foundStarMap = getOwn(starMap, nameSegment); + starI = i; + } + } + + if (!foundMap && foundStarMap) { + foundMap = foundStarMap; + foundI = starI; + } + + if (foundMap) { + nameParts.splice(0, foundI, foundMap); + name = nameParts.join('/'); + } + } + + return name; + } + + function removeScript(name) { + if (isBrowser) { + each(scripts(), function (scriptNode) { + if (scriptNode.getAttribute('data-requiremodule') === name && + scriptNode.getAttribute('data-requirecontext') === context.contextName) { + scriptNode.parentNode.removeChild(scriptNode); + return true; + } + }); + } + } + + function hasPathFallback(id) { + var pathConfig = getOwn(config.paths, id); + if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) { + removeScript(id); + //Pop off the first array value, since it failed, and + //retry + pathConfig.shift(); + context.require.undef(id); + context.require([id]); + return true; + } + } + + //Turns a plugin!resource to [plugin, resource] + //with the plugin being undefined if the name + //did not have a plugin prefix. + function splitPrefix(name) { + var prefix, + index = name ? name.indexOf('!') : -1; + if (index > -1) { + prefix = name.substring(0, index); + name = name.substring(index + 1, name.length); + } + return [prefix, name]; + } + + /** + * Creates a module mapping that includes plugin prefix, module + * name, and path. If parentModuleMap is provided it will + * also normalize the name via require.normalize() + * + * @param {String} name the module name + * @param {String} [parentModuleMap] parent module map + * for the module name, used to resolve relative names. + * @param {Boolean} isNormalized: is the ID already normalized. + * This is true if this call is done for a define() module ID. + * @param {Boolean} applyMap: apply the map config to the ID. + * Should only be true if this map is for a dependency. + * + * @returns {Object} + */ + function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { + var url, pluginModule, suffix, nameParts, + prefix = null, + parentName = parentModuleMap ? parentModuleMap.name : null, + originalName = name, + isDefine = true, + normalizedName = ''; + + //If no name, then it means it is a require call, generate an + //internal name. + if (!name) { + isDefine = false; + name = '_@r' + (requireCounter += 1); + } + + nameParts = splitPrefix(name); + prefix = nameParts[0]; + name = nameParts[1]; + + if (prefix) { + prefix = normalize(prefix, parentName, applyMap); + pluginModule = getOwn(defined, prefix); + } + + //Account for relative paths if there is a base name. + if (name) { + if (prefix) { + if (pluginModule && pluginModule.normalize) { + //Plugin is loaded, use its normalize method. + normalizedName = pluginModule.normalize(name, function (name) { + return normalize(name, parentName, applyMap); + }); + } else { + normalizedName = normalize(name, parentName, applyMap); + } + } else { + //A regular module. + normalizedName = normalize(name, parentName, applyMap); + + //Normalized name may be a plugin ID due to map config + //application in normalize. The map config values must + //already be normalized, so do not need to redo that part. + nameParts = splitPrefix(normalizedName); + prefix = nameParts[0]; + normalizedName = nameParts[1]; + isNormalized = true; + + url = context.nameToUrl(normalizedName); + } + } + + //If the id is a plugin id that cannot be determined if it needs + //normalization, stamp it with a unique ID so two matching relative + //ids that may conflict can be separate. + suffix = prefix && !pluginModule && !isNormalized ? + '_unnormalized' + (unnormalizedCounter += 1) : + ''; + + return { + prefix: prefix, + name: normalizedName, + parentMap: parentModuleMap, + unnormalized: !!suffix, + url: url, + originalName: originalName, + isDefine: isDefine, + id: (prefix ? + prefix + '!' + normalizedName : + normalizedName) + suffix + }; + } + + function getModule(depMap) { + var id = depMap.id, + mod = getOwn(registry, id); + + if (!mod) { + mod = registry[id] = new context.Module(depMap); + } + + return mod; + } + + function on(depMap, name, fn) { + var id = depMap.id, + mod = getOwn(registry, id); + + if (hasProp(defined, id) && + (!mod || mod.defineEmitComplete)) { + if (name === 'defined') { + fn(defined[id]); + } + } else { + getModule(depMap).on(name, fn); + } + } + + function onError(err, errback) { + var ids = err.requireModules, + notified = false; + + if (errback) { + errback(err); + } else { + each(ids, function (id) { + var mod = getOwn(registry, id); + if (mod) { + //Set error on module, so it skips timeout checks. + mod.error = err; + if (mod.events.error) { + notified = true; + mod.emit('error', err); + } + } + }); + + if (!notified) { + req.onError(err); + } + } + } + + /** + * Internal method to transfer globalQueue items to this context's + * defQueue. + */ + function takeGlobalQueue() { + //Push all the globalDefQueue items into the context's defQueue + if (globalDefQueue.length) { + //Array splice in the values since the context code has a + //local var ref to defQueue, so cannot just reassign the one + //on context. + apsp.apply(defQueue, + [defQueue.length - 1, 0].concat(globalDefQueue)); + globalDefQueue = []; + } + } + + handlers = { + 'require': function (mod) { + if (mod.require) { + return mod.require; + } else { + return (mod.require = context.makeRequire(mod.map)); + } + }, + 'exports': function (mod) { + mod.usingExports = true; + if (mod.map.isDefine) { + if (mod.exports) { + return mod.exports; + } else { + return (mod.exports = defined[mod.map.id] = {}); + } + } + }, + 'module': function (mod) { + if (mod.module) { + return mod.module; + } else { + return (mod.module = { + id: mod.map.id, + uri: mod.map.url, + config: function () { + return (config.config && getOwn(config.config, mod.map.id)) || {}; + }, + exports: defined[mod.map.id] + }); + } + } + }; + + function cleanRegistry(id) { + //Clean up machinery used for waiting modules. + delete registry[id]; + delete enabledRegistry[id]; + } + + function breakCycle(mod, traced, processed) { + var id = mod.map.id; + + if (mod.error) { + mod.emit('error', mod.error); + } else { + traced[id] = true; + each(mod.depMaps, function (depMap, i) { + var depId = depMap.id, + dep = getOwn(registry, depId); + + //Only force things that have not completed + //being defined, so still in the registry, + //and only if it has not been matched up + //in the module already. + if (dep && !mod.depMatched[i] && !processed[depId]) { + if (getOwn(traced, depId)) { + mod.defineDep(i, defined[depId]); + mod.check(); //pass false? + } else { + breakCycle(dep, traced, processed); + } + } + }); + processed[id] = true; + } + } + + function checkLoaded() { + var map, modId, err, usingPathFallback, + waitInterval = config.waitSeconds * 1000, + //It is possible to disable the wait interval by using waitSeconds of 0. + expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), + noLoads = [], + reqCalls = [], + stillLoading = false, + needCycleCheck = true; + + //Do not bother if this call was a result of a cycle break. + if (inCheckLoaded) { + return; + } + + inCheckLoaded = true; + + //Figure out the state of all the modules. + eachProp(enabledRegistry, function (mod) { + map = mod.map; + modId = map.id; + + //Skip things that are not enabled or in error state. + if (!mod.enabled) { + return; + } + + if (!map.isDefine) { + reqCalls.push(mod); + } + + if (!mod.error) { + //If the module should be executed, and it has not + //been inited and time is up, remember it. + if (!mod.inited && expired) { + if (hasPathFallback(modId)) { + usingPathFallback = true; + stillLoading = true; + } else { + noLoads.push(modId); + removeScript(modId); + } + } else if (!mod.inited && mod.fetched && map.isDefine) { + stillLoading = true; + if (!map.prefix) { + //No reason to keep looking for unfinished + //loading. If the only stillLoading is a + //plugin resource though, keep going, + //because it may be that a plugin resource + //is waiting on a non-plugin cycle. + return (needCycleCheck = false); + } + } + } + }); + + if (expired && noLoads.length) { + //If wait time expired, throw error of unloaded modules. + err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads); + err.contextName = context.contextName; + return onError(err); + } + + //Not expired, check for a cycle. + if (needCycleCheck) { + each(reqCalls, function (mod) { + breakCycle(mod, {}, {}); + }); + } + + //If still waiting on loads, and the waiting load is something + //other than a plugin resource, or there are still outstanding + //scripts, then just try back later. + if ((!expired || usingPathFallback) && stillLoading) { + //Something is still waiting to load. Wait for it, but only + //if a timeout is not already in effect. + if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { + checkLoadedTimeoutId = setTimeout(function () { + checkLoadedTimeoutId = 0; + checkLoaded(); + }, 50); + } + } + + inCheckLoaded = false; + } + + Module = function (map) { + this.events = getOwn(undefEvents, map.id) || {}; + this.map = map; + this.shim = getOwn(config.shim, map.id); + this.depExports = []; + this.depMaps = []; + this.depMatched = []; + this.pluginMaps = {}; + this.depCount = 0; + + /* this.exports this.factory + this.depMaps = [], + this.enabled, this.fetched + */ + }; + + Module.prototype = { + init: function (depMaps, factory, errback, options) { + options = options || {}; + + //Do not do more inits if already done. Can happen if there + //are multiple define calls for the same module. That is not + //a normal, common case, but it is also not unexpected. + if (this.inited) { + return; + } + + this.factory = factory; + + if (errback) { + //Register for errors on this module. + this.on('error', errback); + } else if (this.events.error) { + //If no errback already, but there are error listeners + //on this module, set up an errback to pass to the deps. + errback = bind(this, function (err) { + this.emit('error', err); + }); + } + + //Do a copy of the dependency array, so that + //source inputs are not modified. For example + //"shim" deps are passed in here directly, and + //doing a direct modification of the depMaps array + //would affect that config. + this.depMaps = depMaps && depMaps.slice(0); + + this.errback = errback; + + //Indicate this module has be initialized + this.inited = true; + + this.ignore = options.ignore; + + //Could have option to init this module in enabled mode, + //or could have been previously marked as enabled. However, + //the dependencies are not known until init is called. So + //if enabled previously, now trigger dependencies as enabled. + if (options.enabled || this.enabled) { + //Enable this module and dependencies. + //Will call this.check() + this.enable(); + } else { + this.check(); + } + }, + + defineDep: function (i, depExports) { + //Because of cycles, defined callback for a given + //export can be called more than once. + if (!this.depMatched[i]) { + this.depMatched[i] = true; + this.depCount -= 1; + this.depExports[i] = depExports; + } + }, + + fetch: function () { + if (this.fetched) { + return; + } + this.fetched = true; + + context.startTime = (new Date()).getTime(); + + var map = this.map; + + //If the manager is for a plugin managed resource, + //ask the plugin to load it now. + if (this.shim) { + context.makeRequire(this.map, { + enableBuildCallback: true + })(this.shim.deps || [], bind(this, function () { + return map.prefix ? this.callPlugin() : this.load(); + })); + } else { + //Regular dependency. + return map.prefix ? this.callPlugin() : this.load(); + } + }, + + load: function () { + var url = this.map.url; + + //Regular dependency. + if (!urlFetched[url]) { + urlFetched[url] = true; + context.load(this.map.id, url); + } + }, + + /** + * Checks if the module is ready to define itself, and if so, + * define it. + */ + check: function () { + if (!this.enabled || this.enabling) { + return; + } + + var err, cjsModule, + id = this.map.id, + depExports = this.depExports, + exports = this.exports, + factory = this.factory; + + if (!this.inited) { + this.fetch(); + } else if (this.error) { + this.emit('error', this.error); + } else if (!this.defining) { + //The factory could trigger another require call + //that would result in checking this module to + //define itself again. If already in the process + //of doing that, skip this work. + this.defining = true; + + if (this.depCount < 1 && !this.defined) { + if (isFunction(factory)) { + //If there is an error listener, favor passing + //to that instead of throwing an error. + if (this.events.error) { + try { + exports = context.execCb(id, factory, depExports, exports); + } catch (e) { + err = e; + } + } else { + exports = context.execCb(id, factory, depExports, exports); + } + + if (this.map.isDefine) { + //If setting exports via 'module' is in play, + //favor that over return value and exports. After that, + //favor a non-undefined return value over exports use. + cjsModule = this.module; + if (cjsModule && + cjsModule.exports !== undefined && + //Make sure it is not already the exports value + cjsModule.exports !== this.exports) { + exports = cjsModule.exports; + } else if (exports === undefined && this.usingExports) { + //exports already set the defined value. + exports = this.exports; + } + } + + if (err) { + err.requireMap = this.map; + err.requireModules = [this.map.id]; + err.requireType = 'define'; + return onError((this.error = err)); + } + + } else { + //Just a literal value + exports = factory; + } + + this.exports = exports; + + if (this.map.isDefine && !this.ignore) { + defined[id] = exports; + + if (req.onResourceLoad) { + req.onResourceLoad(context, this.map, this.depMaps); + } + } + + //Clean up + cleanRegistry(id); + + this.defined = true; + } + + //Finished the define stage. Allow calling check again + //to allow define notifications below in the case of a + //cycle. + this.defining = false; + + if (this.defined && !this.defineEmitted) { + this.defineEmitted = true; + this.emit('defined', this.exports); + this.defineEmitComplete = true; + } + + } + }, + + callPlugin: function () { + var map = this.map, + id = map.id, + //Map already normalized the prefix. + pluginMap = makeModuleMap(map.prefix); + + //Mark this as a dependency for this plugin, so it + //can be traced for cycles. + this.depMaps.push(pluginMap); + + on(pluginMap, 'defined', bind(this, function (plugin) { + var load, normalizedMap, normalizedMod, + name = this.map.name, + parentName = this.map.parentMap ? this.map.parentMap.name : null, + localRequire = context.makeRequire(map.parentMap, { + enableBuildCallback: true + }); + + //If current map is not normalized, wait for that + //normalized name to load instead of continuing. + if (this.map.unnormalized) { + //Normalize the ID if the plugin allows it. + if (plugin.normalize) { + name = plugin.normalize(name, function (name) { + return normalize(name, parentName, true); + }) || ''; + } + + //prefix and name should already be normalized, no need + //for applying map config again either. + normalizedMap = makeModuleMap(map.prefix + '!' + name, + this.map.parentMap); + on(normalizedMap, + 'defined', bind(this, function (value) { + this.init([], function () { return value; }, null, { + enabled: true, + ignore: true + }); + })); + + normalizedMod = getOwn(registry, normalizedMap.id); + if (normalizedMod) { + //Mark this as a dependency for this plugin, so it + //can be traced for cycles. + this.depMaps.push(normalizedMap); + + if (this.events.error) { + normalizedMod.on('error', bind(this, function (err) { + this.emit('error', err); + })); + } + normalizedMod.enable(); + } + + return; + } + + load = bind(this, function (value) { + this.init([], function () { return value; }, null, { + enabled: true + }); + }); + + load.error = bind(this, function (err) { + this.inited = true; + this.error = err; + err.requireModules = [id]; + + //Remove temp unnormalized modules for this module, + //since they will never be resolved otherwise now. + eachProp(registry, function (mod) { + if (mod.map.id.indexOf(id + '_unnormalized') === 0) { + cleanRegistry(mod.map.id); + } + }); + + onError(err); + }); + + //Allow plugins to load other code without having to know the + //context or how to 'complete' the load. + load.fromText = bind(this, function (text, textAlt) { + /*jslint evil: true */ + var moduleName = map.name, + moduleMap = makeModuleMap(moduleName), + hasInteractive = useInteractive; + + //As of 2.1.0, support just passing the text, to reinforce + //fromText only being called once per resource. Still + //support old style of passing moduleName but discard + //that moduleName in favor of the internal ref. + if (textAlt) { + text = textAlt; + } + + //Turn off interactive script matching for IE for any define + //calls in the text, then turn it back on at the end. + if (hasInteractive) { + useInteractive = false; + } + + //Prime the system by creating a module instance for + //it. + getModule(moduleMap); + + //Transfer any config to this other module. + if (hasProp(config.config, id)) { + config.config[moduleName] = config.config[id]; + } + + try { + req.exec(text); + } catch (e) { + return onError(makeError('fromtexteval', + 'fromText eval for ' + id + + ' failed: ' + e, + e, + [id])); + } + + if (hasInteractive) { + useInteractive = true; + } + + //Mark this as a dependency for the plugin + //resource + this.depMaps.push(moduleMap); + + //Support anonymous modules. + context.completeLoad(moduleName); + + //Bind the value of that module to the value for this + //resource ID. + localRequire([moduleName], load); + }); + + //Use parentName here since the plugin's name is not reliable, + //could be some weird string with no path that actually wants to + //reference the parentName's path. + plugin.load(map.name, localRequire, load, config); + })); + + context.enable(pluginMap, this); + this.pluginMaps[pluginMap.id] = pluginMap; + }, + + enable: function () { + enabledRegistry[this.map.id] = this; + this.enabled = true; + + //Set flag mentioning that the module is enabling, + //so that immediate calls to the defined callbacks + //for dependencies do not trigger inadvertent load + //with the depCount still being zero. + this.enabling = true; + + //Enable each dependency + each(this.depMaps, bind(this, function (depMap, i) { + var id, mod, handler; + + if (typeof depMap === 'string') { + //Dependency needs to be converted to a depMap + //and wired up to this module. + depMap = makeModuleMap(depMap, + (this.map.isDefine ? this.map : this.map.parentMap), + false, + !this.skipMap); + this.depMaps[i] = depMap; + + handler = getOwn(handlers, depMap.id); + + if (handler) { + this.depExports[i] = handler(this); + return; + } + + this.depCount += 1; + + on(depMap, 'defined', bind(this, function (depExports) { + this.defineDep(i, depExports); + this.check(); + })); + + if (this.errback) { + on(depMap, 'error', this.errback); + } + } + + id = depMap.id; + mod = registry[id]; + + //Skip special modules like 'require', 'exports', 'module' + //Also, don't call enable if it is already enabled, + //important in circular dependency cases. + if (!hasProp(handlers, id) && mod && !mod.enabled) { + context.enable(depMap, this); + } + })); + + //Enable each plugin that is used in + //a dependency + eachProp(this.pluginMaps, bind(this, function (pluginMap) { + var mod = getOwn(registry, pluginMap.id); + if (mod && !mod.enabled) { + context.enable(pluginMap, this); + } + })); + + this.enabling = false; + + this.check(); + }, + + on: function (name, cb) { + var cbs = this.events[name]; + if (!cbs) { + cbs = this.events[name] = []; + } + cbs.push(cb); + }, + + emit: function (name, evt) { + each(this.events[name], function (cb) { + cb(evt); + }); + if (name === 'error') { + //Now that the error handler was triggered, remove + //the listeners, since this broken Module instance + //can stay around for a while in the registry. + delete this.events[name]; + } + } + }; + + function callGetModule(args) { + //Skip modules already defined. + if (!hasProp(defined, args[0])) { + getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]); + } + } + + function removeListener(node, func, name, ieName) { + //Favor detachEvent because of IE9 + //issue, see attachEvent/addEventListener comment elsewhere + //in this file. + if (node.detachEvent && !isOpera) { + //Probably IE. If not it will throw an error, which will be + //useful to know. + if (ieName) { + node.detachEvent(ieName, func); + } + } else { + node.removeEventListener(name, func, false); + } + } + + /** + * Given an event from a script node, get the requirejs info from it, + * and then removes the event listeners on the node. + * @param {Event} evt + * @returns {Object} + */ + function getScriptData(evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + var node = evt.currentTarget || evt.srcElement; + + //Remove the listeners once here. + removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange'); + removeListener(node, context.onScriptError, 'error'); + + return { + node: node, + id: node && node.getAttribute('data-requiremodule') + }; + } + + function intakeDefines() { + var args; + + //Any defined modules in the global queue, intake them now. + takeGlobalQueue(); + + //Make sure any remaining defQueue items get properly processed. + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])); + } else { + //args are id, deps, factory. Should be normalized by the + //define() function. + callGetModule(args); + } + } + } + + context = { + config: config, + contextName: contextName, + registry: registry, + defined: defined, + urlFetched: urlFetched, + defQueue: defQueue, + Module: Module, + makeModuleMap: makeModuleMap, + nextTick: req.nextTick, + onError: onError, + + /** + * Set a configuration for the context. + * @param {Object} cfg config object to integrate. + */ + configure: function (cfg) { + //Make sure the baseUrl ends in a slash. + if (cfg.baseUrl) { + if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { + cfg.baseUrl += '/'; + } + } + + //Save off the paths and packages since they require special processing, + //they are additive. + var pkgs = config.pkgs, + shim = config.shim, + objs = { + paths: true, + config: true, + map: true + }; + + eachProp(cfg, function (value, prop) { + if (objs[prop]) { + if (prop === 'map') { + if (!config.map) { + config.map = {}; + } + mixin(config[prop], value, true, true); + } else { + mixin(config[prop], value, true); + } + } else { + config[prop] = value; + } + }); + + //Merge shim + if (cfg.shim) { + eachProp(cfg.shim, function (value, id) { + //Normalize the structure + if (isArray(value)) { + value = { + deps: value + }; + } + if ((value.exports || value.init) && !value.exportsFn) { + value.exportsFn = context.makeShimExports(value); + } + shim[id] = value; + }); + config.shim = shim; + } + + //Adjust packages if necessary. + if (cfg.packages) { + each(cfg.packages, function (pkgObj) { + var location; + + pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj; + location = pkgObj.location; + + //Create a brand new object on pkgs, since currentPackages can + //be passed in again, and config.pkgs is the internal transformed + //state for all package configs. + pkgs[pkgObj.name] = { + name: pkgObj.name, + location: location || pkgObj.name, + //Remove leading dot in main, so main paths are normalized, + //and remove any trailing .js, since different package + //envs have different conventions: some use a module name, + //some use a file name. + main: (pkgObj.main || 'main') + .replace(currDirRegExp, '') + .replace(jsSuffixRegExp, '') + }; + }); + + //Done with modifications, assing packages back to context config + config.pkgs = pkgs; + } + + //If there are any "waiting to execute" modules in the registry, + //update the maps for them, since their info, like URLs to load, + //may have changed. + eachProp(registry, function (mod, id) { + //If module already has init called, since it is too + //late to modify them, and ignore unnormalized ones + //since they are transient. + if (!mod.inited && !mod.map.unnormalized) { + mod.map = makeModuleMap(id); + } + }); + + //If a deps array or a config callback is specified, then call + //require with those args. This is useful when require is defined as a + //config object before require.js is loaded. + if (cfg.deps || cfg.callback) { + context.require(cfg.deps || [], cfg.callback); + } + }, + + makeShimExports: function (value) { + function fn() { + var ret; + if (value.init) { + ret = value.init.apply(global, arguments); + } + return ret || (value.exports && getGlobal(value.exports)); + } + return fn; + }, + + makeRequire: function (relMap, options) { + options = options || {}; + + function localRequire(deps, callback, errback) { + var id, map, requireMod; + + if (options.enableBuildCallback && callback && isFunction(callback)) { + callback.__requireJsBuild = true; + } + + if (typeof deps === 'string') { + if (isFunction(callback)) { + //Invalid call + return onError(makeError('requireargs', 'Invalid require call'), errback); + } + + //If require|exports|module are requested, get the + //value for them from the special handlers. Caveat: + //this only works while module is being defined. + if (relMap && hasProp(handlers, deps)) { + return handlers[deps](registry[relMap.id]); + } + + //Synchronous access to one module. If require.get is + //available (as in the Node adapter), prefer that. + if (req.get) { + return req.get(context, deps, relMap, localRequire); + } + + //Normalize module name, if it contains . or .. + map = makeModuleMap(deps, relMap, false, true); + id = map.id; + + if (!hasProp(defined, id)) { + return onError(makeError('notloaded', 'Module name "' + + id + + '" has not been loaded yet for context: ' + + contextName + + (relMap ? '' : '. Use require([])'))); + } + return defined[id]; + } + + //Grab defines waiting in the global queue. + intakeDefines(); + + //Mark all the dependencies as needing to be loaded. + context.nextTick(function () { + //Some defines could have been added since the + //require call, collect them. + intakeDefines(); + + requireMod = getModule(makeModuleMap(null, relMap)); + + //Store if map config should be applied to this require + //call for dependencies. + requireMod.skipMap = options.skipMap; + + requireMod.init(deps, callback, errback, { + enabled: true + }); + + checkLoaded(); + }); + + return localRequire; + } + + mixin(localRequire, { + isBrowser: isBrowser, + + /** + * Converts a module name + .extension into an URL path. + * *Requires* the use of a module name. It does not support using + * plain URLs like nameToUrl. + */ + toUrl: function (moduleNamePlusExt) { + var ext, + index = moduleNamePlusExt.lastIndexOf('.'), + segment = moduleNamePlusExt.split('/')[0], + isRelative = segment === '.' || segment === '..'; + + //Have a file extension alias, and it is not the + //dots from a relative path. + if (index !== -1 && (!isRelative || index > 1)) { + ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); + moduleNamePlusExt = moduleNamePlusExt.substring(0, index); + } + + return context.nameToUrl(normalize(moduleNamePlusExt, + relMap && relMap.id, true), ext, true); + }, + + defined: function (id) { + return hasProp(defined, makeModuleMap(id, relMap, false, true).id); + }, + + specified: function (id) { + id = makeModuleMap(id, relMap, false, true).id; + return hasProp(defined, id) || hasProp(registry, id); + } + }); + + //Only allow undef on top level require calls + if (!relMap) { + localRequire.undef = function (id) { + //Bind any waiting define() calls to this context, + //fix for #408 + takeGlobalQueue(); + + var map = makeModuleMap(id, relMap, true), + mod = getOwn(registry, id); + + delete defined[id]; + delete urlFetched[map.url]; + delete undefEvents[id]; + + if (mod) { + //Hold on to listeners in case the + //module will be attempted to be reloaded + //using a different config. + if (mod.events.defined) { + undefEvents[id] = mod.events; + } + + cleanRegistry(id); + } + }; + } + + return localRequire; + }, + + /** + * Called to enable a module if it is still in the registry + * awaiting enablement. A second arg, parent, the parent module, + * is passed in for context, when this method is overriden by + * the optimizer. Not shown here to keep code compact. + */ + enable: function (depMap) { + var mod = getOwn(registry, depMap.id); + if (mod) { + getModule(depMap).enable(); + } + }, + + /** + * Internal method used by environment adapters to complete a load event. + * A load event could be a script load or just a load pass from a synchronous + * load call. + * @param {String} moduleName the name of the module to potentially complete. + */ + completeLoad: function (moduleName) { + var found, args, mod, + shim = getOwn(config.shim, moduleName) || {}, + shExports = shim.exports; + + takeGlobalQueue(); + + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + args[0] = moduleName; + //If already found an anonymous module and bound it + //to this name, then this is some other anon module + //waiting for its completeLoad to fire. + if (found) { + break; + } + found = true; + } else if (args[0] === moduleName) { + //Found matching define call for this script! + found = true; + } + + callGetModule(args); + } + + //Do this after the cycle of callGetModule in case the result + //of those calls/init calls changes the registry. + mod = getOwn(registry, moduleName); + + if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) { + if (config.enforceDefine && (!shExports || !getGlobal(shExports))) { + if (hasPathFallback(moduleName)) { + return; + } else { + return onError(makeError('nodefine', + 'No define call for ' + moduleName, + null, + [moduleName])); + } + } else { + //A script that does not call define(), so just simulate + //the call for it. + callGetModule([moduleName, (shim.deps || []), shim.exportsFn]); + } + } + + checkLoaded(); + }, + + /** + * Converts a module name to a file path. Supports cases where + * moduleName may actually be just an URL. + * Note that it **does not** call normalize on the moduleName, + * it is assumed to have already been normalized. This is an + * internal API, not a public one. Use toUrl for the public API. + */ + nameToUrl: function (moduleName, ext, skipExt) { + var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url, + parentPath; + + //If a colon is in the URL, it indicates a protocol is used and it is just + //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) + //or ends with .js, then assume the user meant to use an url and not a module id. + //The slash is important for protocol-less URLs as well as full paths. + if (req.jsExtRegExp.test(moduleName)) { + //Just a plain path, not module name lookup, so just return it. + //Add extension if it is included. This is a bit wonky, only non-.js things pass + //an extension, this method probably needs to be reworked. + url = moduleName + (ext || ''); + } else { + //A module that needs to be converted to a path. + paths = config.paths; + pkgs = config.pkgs; + + syms = moduleName.split('/'); + //For each module name segment, see if there is a path + //registered for it. Start with most specific name + //and work up from it. + for (i = syms.length; i > 0; i -= 1) { + parentModule = syms.slice(0, i).join('/'); + pkg = getOwn(pkgs, parentModule); + parentPath = getOwn(paths, parentModule); + if (parentPath) { + //If an array, it means there are a few choices, + //Choose the one that is desired + if (isArray(parentPath)) { + parentPath = parentPath[0]; + } + syms.splice(0, i, parentPath); + break; + } else if (pkg) { + //If module name is just the package name, then looking + //for the main module. + if (moduleName === pkg.name) { + pkgPath = pkg.location + '/' + pkg.main; + } else { + pkgPath = pkg.location; + } + syms.splice(0, i, pkgPath); + break; + } + } + + //Join the path parts together, then figure out if baseUrl is needed. + url = syms.join('/'); + url += (ext || (/\?/.test(url) || skipExt ? '' : '.js')); + url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url; + } + + return config.urlArgs ? url + + ((url.indexOf('?') === -1 ? '?' : '&') + + config.urlArgs) : url; + }, + + //Delegates to req.load. Broken out as a separate function to + //allow overriding in the optimizer. + load: function (id, url) { + req.load(context, id, url); + }, + + /** + * Executes a module callack function. Broken out as a separate function + * solely to allow the build system to sequence the files in the built + * layer in the right sequence. + * + * @private + */ + execCb: function (name, callback, args, exports) { + return callback.apply(exports, args); + }, + + /** + * callback for script loads, used to check status of loading. + * + * @param {Event} evt the event from the browser for the script + * that was loaded. + */ + onScriptLoad: function (evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + if (evt.type === 'load' || + (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) { + //Reset interactive script so a script node is not held onto for + //to long. + interactiveScript = null; + + //Pull out the name of the module and the context. + var data = getScriptData(evt); + context.completeLoad(data.id); + } + }, + + /** + * Callback for script errors. + */ + onScriptError: function (evt) { + var data = getScriptData(evt); + if (!hasPathFallback(data.id)) { + return onError(makeError('scripterror', 'Script error', evt, [data.id])); + } + } + }; + + context.require = context.makeRequire(); + return context; + } + + /** + * Main entry point. + * + * If the only argument to require is a string, then the module that + * is represented by that string is fetched for the appropriate context. + * + * If the first argument is an array, then it will be treated as an array + * of dependency string names to fetch. An optional function callback can + * be specified to execute when all of those dependencies are available. + * + * Make a local req variable to help Caja compliance (it assumes things + * on a require that are not standardized), and to give a short + * name for minification/local scope use. + */ + req = requirejs = function (deps, callback, errback, optional) { + + //Find the right context, use default + var context, config, + contextName = defContextName; + + // Determine if have config object in the call. + if (!isArray(deps) && typeof deps !== 'string') { + // deps is a config object + config = deps; + if (isArray(callback)) { + // Adjust args if there are dependencies + deps = callback; + callback = errback; + errback = optional; + } else { + deps = []; + } + } + + if (config && config.context) { + contextName = config.context; + } + + context = getOwn(contexts, contextName); + if (!context) { + context = contexts[contextName] = req.s.newContext(contextName); + } + + if (config) { + context.configure(config); + } + + return context.require(deps, callback, errback); + }; + + /** + * Support require.config() to make it easier to cooperate with other + * AMD loaders on globally agreed names. + */ + req.config = function (config) { + return req(config); + }; + + /** + * Execute something after the current tick + * of the event loop. Override for other envs + * that have a better solution than setTimeout. + * @param {Function} fn function to execute later. + */ + req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) { + setTimeout(fn, 4); + } : function (fn) { fn(); }; + + /** + * Export require as a global, but only if it does not already exist. + */ + if (!require) { + require = req; + } + + req.version = version; + + //Used to filter out dependencies that are already paths. + req.jsExtRegExp = /^\/|:|\?|\.js$/; + req.isBrowser = isBrowser; + s = req.s = { + contexts: contexts, + newContext: newContext + }; + + //Create default context. + req({}); + + //Exports some context-sensitive methods on global require. + each([ + 'toUrl', + 'undef', + 'defined', + 'specified' + ], function (prop) { + //Reference from contexts instead of early binding to default context, + //so that during builds, the latest instance of the default context + //with its config gets used. + req[prop] = function () { + var ctx = contexts[defContextName]; + return ctx.require[prop].apply(ctx, arguments); + }; + }); + + if (isBrowser) { + head = s.head = document.getElementsByTagName('head')[0]; + //If BASE tag is in play, using appendChild is a problem for IE6. + //When that browser dies, this can be removed. Details in this jQuery bug: + //http://dev.jquery.com/ticket/2709 + baseElement = document.getElementsByTagName('base')[0]; + if (baseElement) { + head = s.head = baseElement.parentNode; + } + } + + /** + * Any errors that require explicitly generates will be passed to this + * function. Intercept/override it if you want custom error handling. + * @param {Error} err the error object. + */ + req.onError = function (err) { + throw err; + }; + + /** + * Does the request to load a module for the browser case. + * Make this a separate function to allow other environments + * to override it. + * + * @param {Object} context the require context to find state. + * @param {String} moduleName the name of the module. + * @param {Object} url the URL to the module. + */ + req.load = function (context, moduleName, url) { + var config = (context && context.config) || {}, + node; + if (isBrowser) { + //In the browser so use a script tag + node = config.xhtml ? + document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') : + document.createElement('script'); + node.type = config.scriptType || 'text/javascript'; + node.charset = 'utf-8'; + node.async = true; + + node.setAttribute('data-requirecontext', context.contextName); + node.setAttribute('data-requiremodule', moduleName); + + //Set up load listener. Test attachEvent first because IE9 has + //a subtle issue in its addEventListener and script onload firings + //that do not match the behavior of all other browsers with + //addEventListener support, which fire the onload event for a + //script right after the script execution. See: + //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution + //UNFORTUNATELY Opera implements attachEvent but does not follow the script + //script execution mode. + if (node.attachEvent && + //Check if node.attachEvent is artificially added by custom script or + //natively supported by browser + //read https://github.com/jrburke/requirejs/issues/187 + //if we can NOT find [native code] then it must NOT natively supported. + //in IE8, node.attachEvent does not have toString() + //Note the test for "[native code" with no closing brace, see: + //https://github.com/jrburke/requirejs/issues/273 + !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && + !isOpera) { + //Probably IE. IE (at least 6-8) do not fire + //script onload right after executing the script, so + //we cannot tie the anonymous define call to a name. + //However, IE reports the script as being in 'interactive' + //readyState at the time of the define call. + useInteractive = true; + + node.attachEvent('onreadystatechange', context.onScriptLoad); + //It would be great to add an error handler here to catch + //404s in IE9+. However, onreadystatechange will fire before + //the error handler, so that does not help. If addEventListener + //is used, then IE will fire error before load, but we cannot + //use that pathway given the connect.microsoft.com issue + //mentioned above about not doing the 'script execute, + //then fire the script load event listener before execute + //next script' that other browsers do. + //Best hope: IE10 fixes the issues, + //and then destroys all installs of IE 6-9. + //node.attachEvent('onerror', context.onScriptError); + } else { + node.addEventListener('load', context.onScriptLoad, false); + node.addEventListener('error', context.onScriptError, false); + } + node.src = url; + + //For some cache cases in IE 6-8, the script executes before the end + //of the appendChild execution, so to tie an anonymous define + //call to the module name (which is stored on the node), hold on + //to a reference to this node, but clear after the DOM insertion. + currentlyAddingScript = node; + if (baseElement) { + head.insertBefore(node, baseElement); + } else { + head.appendChild(node); + } + currentlyAddingScript = null; + + return node; + } else if (isWebWorker) { + try { + //In a web worker, use importScripts. This is not a very + //efficient use of importScripts, importScripts will block until + //its script is downloaded and evaluated. However, if web workers + //are in play, the expectation that a build has been done so that + //only one script needs to be loaded anyway. This may need to be + //reevaluated if other use cases become common. + importScripts(url); + + //Account for anonymous modules + context.completeLoad(moduleName); + } catch (e) { + context.onError(makeError('importscripts', + 'importScripts failed for ' + + moduleName + ' at ' + url, + e, + [moduleName])); + } + } + }; + + function getInteractiveScript() { + if (interactiveScript && interactiveScript.readyState === 'interactive') { + return interactiveScript; + } + + eachReverse(scripts(), function (script) { + if (script.readyState === 'interactive') { + return (interactiveScript = script); + } + }); + return interactiveScript; + } + + //Look for a data-main script attribute, which could also adjust the baseUrl. + if (isBrowser) { + //Figure out baseUrl. Get it from the script tag with require.js in it. + eachReverse(scripts(), function (script) { + //Set the 'head' where we can append children by + //using the script's parent. + if (!head) { + head = script.parentNode; + } + + //Look for a data-main attribute to set main script for the page + //to load. If it is there, the path to data main becomes the + //baseUrl, if it is not already set. + dataMain = script.getAttribute('data-main'); + if (dataMain) { + //Set final baseUrl if there is not already an explicit one. + if (!cfg.baseUrl) { + //Pull off the directory of data-main for use as the + //baseUrl. + src = dataMain.split('/'); + mainScript = src.pop(); + subPath = src.length ? src.join('/') + '/' : './'; + + cfg.baseUrl = subPath; + dataMain = mainScript; + } + + //Strip off any trailing .js since dataMain is now + //like a module name. + dataMain = dataMain.replace(jsSuffixRegExp, ''); + + //Put the data-main script in the files to load. + cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain]; + + return true; + } + }); + } + + /** + * The function that handles definitions of modules. Differs from + * require() in that a string for the module should be the first argument, + * and the function to execute after dependencies are loaded should + * return a value to define the module corresponding to the first argument's + * name. + */ + define = function (name, deps, callback) { + var node, context; + + //Allow for anonymous modules + if (typeof name !== 'string') { + //Adjust args appropriately + callback = deps; + deps = name; + name = null; + } + + //This module may not have dependencies + if (!isArray(deps)) { + callback = deps; + deps = []; + } + + //If no name, and callback is a function, then figure out if it a + //CommonJS thing with dependencies. + if (!deps.length && isFunction(callback)) { + //Remove comments from the callback string, + //look for require calls, and pull them into the dependencies, + //but only if there are function args. + if (callback.length) { + callback + .toString() + .replace(commentRegExp, '') + .replace(cjsRequireRegExp, function (match, dep) { + deps.push(dep); + }); + + //May be a CommonJS thing even without require calls, but still + //could use exports, and module. Avoid doing exports and module + //work though if it just needs require. + //REQUIRES the function to expect the CommonJS variables in the + //order listed below. + deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps); + } + } + + //If in IE 6-8 and hit an anonymous define() call, do the interactive + //work. + if (useInteractive) { + node = currentlyAddingScript || getInteractiveScript(); + if (node) { + if (!name) { + name = node.getAttribute('data-requiremodule'); + } + context = contexts[node.getAttribute('data-requirecontext')]; + } + } + + //Always save off evaluating the def call until the script onload handler. + //This allows multiple modules to be in a file without prematurely + //tracing dependencies, and allows for anonymous module support, + //where the module name is not known until the script onload event + //occurs. If no context, use the global queue, and get it processed + //in the onscript load callback. + (context ? context.defQueue : globalDefQueue).push([name, deps, callback]); + }; + + define.amd = { + jQuery: true + }; + + + /** + * Executes the text. Normally just uses eval, but can be modified + * to use a better, environment-specific call. Only used for transpiling + * loader plugins, not for plain JS modules. + * @param {String} text the text to execute/evaluate. + */ + req.exec = function (text) { + /*jslint evil: true */ + return eval(text); + }; + + //Set up with config info. + req(cfg); +}(this)); + +var components = { + "packages": [ + { + "name": "jplayer", + "main": "jplayer-built.js" + } + ], + "shim": { + "jplayer": { + "deps": [ + "jquery" + ] + } + }, + "baseUrl": "components" +}; +if (typeof require !== "undefined" && require.config) { + require.config(components); +} else { + var require = components; +} +if (typeof exports !== "undefined" && typeof module !== "undefined") { + module.exports = components; +} \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..efb1290 --- /dev/null +++ b/composer.json @@ -0,0 +1,37 @@ +{ + "name":"hathor/hathor", + "description":"Local music api", + "authors": [{ + "name":"R. Eric Wheeler", + "email":"eric@rewiv.com", + "homepage":"https://rewiv.com", + "role":"Developer" + }], + "keywords":["music", "angular","javascript","slim"], + "license": "(GPL-2.0 or GPL-2.0+)", + "config": { + "vendor-dir":"app/3rdparty", + "autoloader-suffix":"hathor", + "notify-on-install":false + }, + "require": { + "php":">=5.6.0", + "james-heinrich/getid3":"1.*", + "ext-sockets":"*", + "ext-PDO":"*", + "slim/slim": "2.*", + "slim/pdo":"1.*", + "slim/csrf":"0.*", + "slim/middleware": "1.*", + "slim/logger":"0.*" + }, + "prefer-stable": true, + "scripts": { + "pre-install-cmd": ["tests/phpChecks"] + }, + + "suggest": { + "slim/logger":"If you want to use logging features", + "slim/middleware":"If you want to extend hathor" + } +} diff --git a/config.cc b/config.cc new file mode 100644 index 0000000..b736c86 --- /dev/null +++ b/config.cc @@ -0,0 +1,115 @@ +#include "config.hh" + +json parse_file(const string &filename) { + + json j_JSON; + ifstream f_JSON; + string f_line; + stringstream s_JSON; + + f_JSON.open(filename); + + if (f_JSON.is_open()) { + while ( getline (f_JSON,f_line) ) { + s_JSON << f_line; + } + f_JSON.close(); + } else { + char * buf; + asprintf(&buf, "Could not read from file : %s", filename.c_str()); + perror( buf ); + delete buf; + exit(1); + } + + try { + j_JSON = json::parse(s_JSON); + } catch(const invalid_argument &e) { + + printf( "%s in %s.\n", e.what(), filename.c_str() ); + exit(EXIT_FAILURE); + } + f_JSON.close(); + return j_JSON; +} + +scanner_config hathor_config(json &j_JSON) { + + scanner_config opts; + json mysql, scanner, php; + + mysql = j_JSON["mysql"]; + scanner = j_JSON["scanner"]; + php = j_JSON["php"]; + + opts.mysql.host = mysql["host"].get(); + opts.mysql.db = mysql["db"].get(); + opts.mysql.user = mysql["user"].get(); + + opts.mysql.pass = mysql["pass"].is_null() ? "null" : mysql["pass"].get(); + + opts.scanner.path = scanner["path"].get(); + + opts.php.root = php["root"].get(); + opts.php.user = php["user"].get(); + opts.php.email = php["email"].get(); + opts.php.pass = php["pass"].is_null() ? "null" : php["pass"].get(); + + + + if( mysql["port"].is_number() ) { + opts.mysql.port = mysql["port"]; + } + else { + try { + string port = mysql["port"]; + opts.mysql.port = stoi( port, nullptr, 0 ); + } catch(exception& e) { + opts.mysql.port = 3306; + } + } + if( scanner["throttle"].is_number() ) { + opts.scanner.throttle = scanner["throttle"]; + } + else { + try { + string throttle = scanner["throttle"]; + opts.scanner.throttle = stoi( throttle,nullptr,0 ); + } catch(exception& e) { + opts.scanner.throttle = 0; + } // try + } // else + if( strcmp(opts.mysql.host.c_str(), "null") == 0 ) { + opts.mysql.host = "localhost"; + } + if( strcmp(opts.mysql.db.c_str(), "null") == 0 ) { + opts.mysql.db = "hathor"; + } + try { + if( strcmp(opts.mysql.user.c_str(), "null") == 0 ) { + throw domain_error("Required values are missing from config.json : 'mysql:{user}'"); + } + //else if( strcmp(opts.mysql.pass.c_str(), "null") == 0 ) { + // throw domain_error("Required values are missing from config.json : 'mysql:{pass}'"); + //} + else if( strcmp(opts.scanner.path.c_str(), "null") == 0 ) { + throw domain_error("Required values are missing from config.json : 'scanner:{path}'"); + } + else if( strcmp(opts.php.user.c_str(), "null") == 0 ) { + throw domain_error("Required values are missing from config.json : 'php:{user}'"); + } + //else if( strcmp(opts.php.pass.c_str(), "null") == 0 ) { + // throw domain_error("Required values are missing from config.json : 'php:{pass}'"); + // } + else if( strcmp(opts.php.email.c_str(), "null") == 0 ) { + throw domain_error("Required values are missing from config.json : 'php:{email}'"); + } + else if( strcmp(opts.php.root.c_str(), "null") == 0 ) { + throw domain_error("Required values are missing from config.json : 'php:{root}'"); + } //if + } catch(exception &e) { + cout << e.what() << endl; + } //try + return opts; + +} // hathor_config diff --git a/config.hh b/config.hh new file mode 100644 index 0000000..8856d1b --- /dev/null +++ b/config.hh @@ -0,0 +1,50 @@ +#ifndef HATHOR_CONFIG_H +#define HATHOR_CONFIG_H +#endif +#include +#include +#include +#include "3rdparty/json/src/json.hpp" + +// JSON +using nlohmann::json; +// String +using std::string; +using std::cout; +using std::endl; +using std::ifstream; +using std::stringstream; +// Errors +using std::exception; +using std::domain_error; +using std::invalid_argument; + +struct scanner_config { + + struct { + string host; + string db; + short port; + string user; + string pass; + } mysql; + + struct { + string path; + short throttle; + } scanner; + + struct { + string root; + string user; + string pass; + string email; + } php; + +}; + +string getFileExtension(std::string fn); +json parse_file(const std::string &filename); +scanner_config hathor_config(json &j_JSON); + + diff --git a/config.json b/config.json new file mode 100644 index 0000000..abf22f8 --- /dev/null +++ b/config.json @@ -0,0 +1,34 @@ +{ + "_comment":"MySQL connection information", + "mysql": + { + "__comment" : "MySQL hostname, if left blank defaults to localhost", + "host" : "localhost", + "__comment" : "MySQL database to use, if left blank defaults to hathor", + "db" : "hathor_music", + "port" : 3306, + "user" : "root", + "pass" : "123" + }, + "_comment" : "Scanner settings", + "scanner" : + { + "__comment" : "Path to your music", + "path" : "/home/eric/Music/", + "__comment" : "Seconds between database writes", + "throttle" : 30, + "covers" : [ + "album.jpg", + "cover.jpg", + "artist.jpg", + "folder.jpg", + "Artist.jpg" + ] + }, + "_comment":"PHP Settings", + "php": { + "root":"/var/www/hathor", + "user": "eric", + "email":"eric@rewiv.com" + } +} diff --git a/crypt.cc b/crypt.cc new file mode 100644 index 0000000..8ad5649 --- /dev/null +++ b/crypt.cc @@ -0,0 +1,29 @@ + +#define BCRYPT_HASHSIZE (64) +#define RANDBYTES (16) +#define COST (12) + +void gen_random(char *s, const int len) { + +static const char alphanum[] = + "0123456789" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz"; + + for (int i = 0; i < len; ++i) { + s[i] = alphanum[rand() % (sizeof(alphanum) - 1)]; + } + + s[len] = 0; +} + +const char * hathor_crypt(const char * password) { + + char salt[BCRYPT_HASHSIZE]; + char hash[BCRYPT_HASHSIZE]; + gen_random(salt, COST); + sprintf(hash, "$5$%d$%s", COST, salt ); + return crypt(password, hash); + +} + diff --git a/crypt.hh b/crypt.hh new file mode 100644 index 0000000..dfbc492 --- /dev/null +++ b/crypt.hh @@ -0,0 +1,9 @@ +#ifndef HATHOR_CRYPT_HH +#define HATHOR_CRYPT_HH + +#include + +void gen_random(char *s, const int len); +const char * hathor_crypt(const char * password); + +#endif \ No newline at end of file diff --git a/hathor.sql b/hathor.sql new file mode 100644 index 0000000..112c553 --- /dev/null +++ b/hathor.sql @@ -0,0 +1,162 @@ +-- MySQL dump 10.13 Distrib 5.6.26, for Linux (x86_64) +-- +-- Host: localhost Database: hathor +-- ------------------------------------------------------ +-- Server version 5.6.26-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Current Database: `hathor` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `music` /*!40100 DEFAULT CHARACTER SET utf8 */; + +USE `music`; + +-- +-- Table structure for table `albums` +-- + +DROP TABLE IF EXISTS `albums`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `albums` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id of the album', + `aid` varchar(64) NOT NULL COMMENT 'album id in md5', + `arid` varchar(64) NOT NULL COMMENT 'matching arist id from artist table', + `released` year(4) DEFAULT '1969' COMMENT 'year released', + `web` blob COMMENT 'json list of web sites for this album', + `extra` blob COMMENT 'any extra information about this album in json format.', + `first_available` date DEFAULT '1969-01-01', + PRIMARY KEY (`id`), + UNIQUE KEY `aid_hathor` (`aid`), + UNIQUE KEY `arid_hathor` (`arid`), + FOREIGN KEY (`arid`) REFERENCES `artists` (`arid`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `artists` +-- + +DROP TABLE IF EXISTS `artists`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `artists` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `arid` varchar(64) NOT NULL COMMENT 'unique artist id in md5 format', + `name` varchar(255) NOT NULL COMMENT 'name of the artist', + `web` blob COMMENT 'json formated information with different web sites', + `tour` blob COMMENT 'json formated information about touring', + `rating` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT 'rating from 1 to 10 of artist', + `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'updated timestamp', + `extra` blob COMMENT 'any extra information about artist in json format', + PRIMARY KEY (`id`), + UNIQUE KEY `arid_hathor` (`arid`), + UNIQUE KEY `name_hathor` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `playlists` +-- + +DROP TABLE IF EXISTS `playlists`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `playlists` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'playlist id', + `uid` varchar(64) NOT NULL COMMENT 'uid in the users table in md5', + `plsid` varchar(64) NOT NULL COMMENT 'playlist id in md5', + `name` varchar(255) NOT NULL COMMENT 'name for this playlist', + `track` varchar(64) NOT NULL COMMENT 'the track in md5 format from the tracks table', + `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'playlist last updated timestamp', + PRIMARY KEY (`id`), + UNIQUE KEY `uid_hathor` (`uid`), + UNIQUE KEY `uid_pls_hathor` (`uid`), + KEY `playlist_track_idx` (`track`), + FOREIGN KEY (`track`) REFERENCES `tracks` (`tid`) ON DELETE CASCADE ON UPDATE CASCADE, + FOREIGN KEY (`uid`) REFERENCES `users` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `tracks` +-- + +DROP TABLE IF EXISTS `tracks`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `tracks` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id of the song in the database', + `tid` varchar(64) NOT NULL COMMENT 'song id md5 hash', + `arid` varchar(64) NOT NULL COMMENT 'corresponding artist id from artist table in md5 hash', + `aid` varchar(64) NOT NULL COMMENT 'corresponding album id from album table in md5 hash', + `title` varchar(255) NOT NULL COMMENT 'title of song', + `track` tinyint(4) unsigned DEFAULT '0' COMMENT 'track number of song', + `genre` varchar(45) DEFAULT NULL COMMENT 'genre of song', + `year` tinyint(4) DEFAULT '0' COMMENT 'year of song', + `label` varchar(255) DEFAULT NULL COMMENT 'music label of song e.g. Columbia Records', + `lyrics` blob COMMENT 'lyrics if any', + `bitrate` mediumint(6) unsigned DEFAULT '0' COMMENT 'bitrate of song', + `sample` mediumint(6) unsigned DEFAULT '0' COMMENT 'sample rate of song', + `channels` smallint(2) unsigned DEFAULT '0' COMMENT 'channels of song i.e stereo = 2, mono = 1', + `length` int(10) unsigned DEFAULT '0' COMMENT 'length of song', + `minutes` tinytext COMMENT 'total length of song in minutes and seconds', + `seconds` tinyint(4) unsigned DEFAULT '0' COMMENT 'seconds of song', + `pls` blob COMMENT 'playlists this song is associated with', + `ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'timestamp of last update of song', + PRIMARY KEY (`id`), + UNIQUE KEY `arid_hathor` (`arid`) USING BTREE, + UNIQUE KEY `aid_hathor` (`aid`), + UNIQUE KEY `title_hathor` (`title`), + UNIQUE KEY `sid_hathor` (`tid`), + FOREIGN KEY (`aid`) REFERENCES `albums` (`aid`) ON DELETE CASCADE ON UPDATE CASCADE, + FOREIGN KEY (`arid`) REFERENCES `artists` (`arid`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'the user id int', + `uid` varchar(64) NOT NULL COMMENT 'user id in md5', + `username` varchar(20) NOT NULL COMMENT 'the users name', + `email` varchar(255) NOT NULL COMMENT 'the users email', + `password` varchar(255) NOT NULL COMMENT 'the users hashed password', + `isadmin` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'true or false, admin rights', + `pls` blob COMMENT 'json list of playlist ids', + `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'timestamp of user record', + PRIMARY KEY (`id`), + UNIQUE KEY `hathor_username` (`username`), + UNIQUE KEY `hathor_email` (`email`), + UNIQUE KEY `hathor_id` (`id`), + UNIQUE KEY `hathor_uid` (`uid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2015-08-15 21:43:51 diff --git a/hathor_mysql.hh b/hathor_mysql.hh new file mode 100644 index 0000000..c56d094 --- /dev/null +++ b/hathor_mysql.hh @@ -0,0 +1,28 @@ +// +// Created by eric on 8/15/15. +// + +#ifndef HATHOR_MYSQL_HH +#define HATHOR_MYSQL_HH + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +sql::Connection* get_connection( + const char * user, + const char * password, + const char * host = "localhost", + unsigned short port=3306 +); + +int hathor_install_schema( sql::Connection* connection ); +unsigned int get_max_statements( sql::Connection *connection ); + +#endif //HATHOR_MYSQL_HH diff --git a/installphplibs b/installphplibs new file mode 100755 index 0000000..fc86bc8 --- /dev/null +++ b/installphplibs @@ -0,0 +1,4 @@ +#!/bin/bash + +PHP=$(which php) +$PHP -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/tmp --filename=composer &>/dev/null diff --git a/makeLogging b/makeLogging new file mode 100644 index 0000000..0aab8d4 --- /dev/null +++ b/makeLogging @@ -0,0 +1,3 @@ +all: + g++ -o logging logging.cc -lboost_log -lboost_system -lboost_log_setup -std=c++11 -lboost_thread -lpthread -DBOOST_LOG_DYN_LINK + diff --git a/md5.cc b/md5.cc new file mode 100644 index 0000000..0d3126b --- /dev/null +++ b/md5.cc @@ -0,0 +1,44 @@ +#include +#include +#include +#include +#include + +using namespace std; + +char *hathor_md5( const char * str ) { + + static char result[32]; // MD5 Result + unsigned char buffer_md5[16]; // Buffer to hold MD5 + char buf[2]; // Temporary sprintf buffer + + MD5_CTX md5; + MD5_Init (&md5); + MD5_Update (&md5, (const unsigned char *) str, strlen(str) ); + MD5_Final ( buffer_md5, &md5); + + for ( unsigned int i = 0; i < 16; i++ ) { + sprintf(buf, "%02x", buffer_md5[i]); + strcat(result,buf); + } + return result; +} +/* +int main( int argc, char ** argv ) { + if( argc > 1 ) { + cout << md5( argv[1] ) << endl; + } + else { + char in[100]; + printf("Enter password : "); + scanf("%s", in); + //char* hash = md5(in); + cout << md5(in) << endl; + + } + + return 0; + +} + +*/ \ No newline at end of file diff --git a/music.sql b/music.sql new file mode 100644 index 0000000..a65e2dc --- /dev/null +++ b/music.sql @@ -0,0 +1,186 @@ +-- MySQL dump 10.13 Distrib 5.6.26, for Linux (x86_64) +-- +-- Host: localhost Database: hathor_music +-- ------------------------------------------------------ +-- Server version 5.6.26-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Current Database: `hathor_music` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `hathor_music` /*!40100 DEFAULT CHARACTER SET utf8 */; + +USE `hathor_music`; + +-- +-- Table structure for table `albums` +-- + +DROP TABLE IF EXISTS `albums`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `albums` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id of the album', + `aid` varchar(64) NOT NULL COMMENT 'album id in md5', + `name` varchar(255) NOT NULL COMMENT 'name of the album', + `arid` varchar(64) NOT NULL COMMENT 'matching arist id from artist table', + `albumartist` varchar(255) DEFAULT NULL COMMENT 'the album artist', + `label` varchar(255) DEFAULT NULL COMMENT 'the album label', + `released` year(4) DEFAULT '1969' COMMENT 'year released', + `first_available` date DEFAULT '1969-01-01', + `web` blob COMMENT 'json list of web sites for this album', + `extra` blob COMMENT 'any extra information about this album in json format.', + PRIMARY KEY (`id`), + UNIQUE KEY `aid_albums_unq` (`aid`), + KEY `aid_albums_idx` (`aid`), + KEY `arid_albums_idx` (`arid`), + CONSTRAINT `arid_albums` FOREIGN KEY (`arid`) REFERENCES `artists` (`arid`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `artists` +-- + +DROP TABLE IF EXISTS `artists`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `artists` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `arid` varchar(64) NOT NULL COMMENT 'unique artist id in md5 format', + `name` varchar(255) NOT NULL COMMENT 'name of the artist', + `web` blob COMMENT 'json formated information with different web sites', + `tour` blob COMMENT 'json formated information about touring', + `rating` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT 'rating from 1 to 10 of artist', + `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'updated timestamp', + `extra` blob COMMENT 'any extra information about artist in json format', + PRIMARY KEY (`id`), + UNIQUE KEY `arid_artists` (`arid`), + UNIQUE KEY `name_artists` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `covers` +-- + +DROP TABLE IF EXISTS `covers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `covers` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'the unique id', + `cid` varchar(64) DEFAULT NULL COMMENT 'cover id in md5', + `aid` varchar(64) DEFAULT NULL COMMENT 'the album this belongs to', + `file` varchar(1000) DEFAULT NULL COMMENT 'the actual filename', + `base64` blob COMMENT 'base64 encoded output', + `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT 'last updated', + PRIMARY KEY (`id`), + KEY `cid_idx` (`cid`), + KEY `aid_covers_idx` (`aid`), + CONSTRAINT `covers_aid` FOREIGN KEY (`aid`) REFERENCES `albums` (`aid`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `playlists` +-- + +DROP TABLE IF EXISTS `playlists`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `playlists` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'playlist id', + `uid` varchar(64) NOT NULL COMMENT 'uid in the users table in md5', + `plsid` varchar(64) NOT NULL COMMENT 'playlist id in md5', + `name` varchar(255) NOT NULL COMMENT 'name for this playlist', + `track` varchar(64) NOT NULL COMMENT 'the track in md5 format from the tracks table', + `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'playlist last updated timestamp', + PRIMARY KEY (`id`), + KEY `playlist_uid_idx` (`uid`), + KEY `playlist_track_idx` (`track`), + CONSTRAINT `playlist_track_idx` FOREIGN KEY (`track`) REFERENCES `tracks` (`tid`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `playlist_uid_idx` FOREIGN KEY (`uid`) REFERENCES `users` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `tracks` +-- + +DROP TABLE IF EXISTS `tracks`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `tracks` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id of the song in the database', + `tid` varchar(64) NOT NULL COMMENT 'song id md5 hash', + `uri` varchar(1000) NOT NULL DEFAULT 'unknown', + `arid` varchar(64) NOT NULL COMMENT 'corresponding artist id from artist table in md5 hash', + `aid` varchar(64) NOT NULL COMMENT 'corresponding album id from album table in md5 hash', + `title` varchar(255) NOT NULL COMMENT 'title of song', + `track` tinyint(4) unsigned DEFAULT '0' COMMENT 'track number of song', + `genre` varchar(45) DEFAULT NULL COMMENT 'genre of song', + `lyrics` blob COMMENT 'lyrics if any', + `comment` blob, + `bitrate` mediumint(6) unsigned DEFAULT '0' COMMENT 'bitrate of song', + `sample` mediumint(6) unsigned DEFAULT '0' COMMENT 'sample rate of song', + `channels` smallint(2) unsigned DEFAULT '0' COMMENT 'channels of song i.e stereo = 2, mono = 1', + `length` int(10) unsigned DEFAULT '0' COMMENT 'length of song', + `minutes` tinytext COMMENT 'total length of song in minutes and seconds', + `seconds` tinyint(4) unsigned DEFAULT '0' COMMENT 'seconds of song', + `pls` blob COMMENT 'playlists this song is associated with', + `ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'timestamp of last update of song', + PRIMARY KEY (`id`), + UNIQUE KEY `tid_idx` (`tid`), + UNIQUE KEY `id_idx` (`id`), + KEY `tracks_arid` (`arid`), + KEY `tracks_aid` (`aid`), + CONSTRAINT `tracks_arid` FOREIGN KEY (`arid`) REFERENCES `artists` (`arid`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `tracks_aid` FOREIGN KEY (`aid`) REFERENCES `albums` (`aid`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'the user id int', + `uid` varchar(64) NOT NULL COMMENT 'user id in md5', + `username` varchar(20) NOT NULL COMMENT 'the users name', + `email` varchar(255) NOT NULL COMMENT 'the users email', + `password` varchar(255) NOT NULL COMMENT 'the users hashed password', + `isadmin` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'true or false, admin rights', + `pls` blob COMMENT 'json list of playlist ids', + `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'timestamp of user record', + PRIMARY KEY (`id`), + UNIQUE KEY `username_idx` (`username`), + UNIQUE KEY `email_idx` (`email`), + UNIQUE KEY `id_idx` (`id`), + UNIQUE KEY `uid_idx` (`uid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2015-08-30 12:07:30 diff --git a/mysql.cc b/mysql.cc new file mode 100644 index 0000000..18a95bf --- /dev/null +++ b/mysql.cc @@ -0,0 +1,242 @@ +/* Copyright 2008, 2010, Oracle and/or its affiliates. All rights reserved. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +There are special exceptions to the terms and conditions of the GPL +as it is applied to this software. View the full text of the +exception in file EXCEPTIONS-CONNECTOR-C++ in the directory of this +software distribution. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Standard C++ includes */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "sql.hh" +#include "common.hh" +#include "config.hh" + +#define BCRYPT_HASHSIZE (64) +#define RANDBYTES (16) +#define COST (12) +#ifndef DROP +#define DROP false +#endif + + +using namespace std; + +int hathor_install_schema( sql::Connection* connection ) { + + json j = parse_file("config.json"); + scanner_config s_opts = hathor_config(j); + + char databaseSql[50] = "CREATE DATABASE IF NOT EXISTS "; + strcat(databaseSql, s_opts.mysql.db.c_str()); + if(strcmp(s_opts.php.pass.c_str(), "null") == 0) + { + s_opts.php.pass = getPass("Enter new password for admin user : ", '*'); + } + try + { + + sql::Statement *statement = connection->createStatement(); + statement->execute(databaseSql); + connection->setSchema(s_opts.mysql.db); + sql::PreparedStatement *pstmt; + + if(DROP) + { + statement->execute(SqlMap["playlistsSql"]); + statement->execute(SqlMap["tracksSql"]); + statement->execute(SqlMap["albumsSql"]); + statement->execute(SqlMap["artistsSql"]); + statement->execute(SqlMap["userSql"]); + } + statement->execute(SqlMap["userCreateSql"]); + statement->execute(SqlMap["artistCreateSql"]); + statement->execute(SqlMap["albumCreateSql"]); + statement->execute(SqlMap["tracksCreateSql"]); + statement->execute(SqlMap["playlistsCreateSql"]); + pstmt = connection->prepareStatement("INSERT IGNORE INTO users(uid,username,email,password,isadmin) VALUES (?,?,?,?,?)"); + pstmt->setString(1, s_opts.php.user.c_str()); + pstmt->setString(2, s_opts.php.user); + pstmt->setString(3, s_opts.php.email); + pstmt->setString(4, s_opts.php.pass.c_str()); + pstmt->setInt(5, 1); + pstmt->executeQuery(); + connection->commit(); + delete pstmt; + delete statement; + } + catch (sql::SQLException &e) + { + cout << "# ERR: SQLException in " << __FILE__; + cout << "(" << __FUNCTION__ << ") on line " << __LINE__ << endl; + cout << "# ERR: " << e.what(); + cout << " (MySQL error code: " << e.getErrorCode(); + cout << ", SQLState: " << e.getSQLState() << " )" << endl; + return 0; + } + catch(std::exception &e) + { + cout << e.what() << endl; + return 0; + } + cout << "Installed database tables into " << s_opts.mysql.db << "." << endl; + return 0; +} + +sql::Connection* get_connection( + const char * user, + const char * password, + const char * host = "localhost", + unsigned short port=3306 + ) +{ + sql::Driver *driver = sql::mysql::get_driver_instance(); + driver->threadInit(); + char connection[255]; + sprintf(connection, "tcp://%s:%d", host, port); + sql::Connection *con = driver->connect(connection, user, password); + driver->threadEnd(); + return con; +} +unsigned int get_max_statements( sql::Connection *connection ) +{ + std::string::size_type size; + unsigned int maxPstms = stoi(dynamic_cast< sql::mysql::MySQL_Connection * >( + connection->getMetaData()->getConnection() + )->getSessionVariable("max_prepared_stmt_count"), &size); + + return ( maxPstms == 0 ) ? 10000 : maxPstms; + +} +#ifdef TEST +int main(int argc, char * argv[]) +{ + +//sql::PreparedStatement *artist, *album, *track, *user; + +if(argc == 2) { + char * cmd = argv[1]; + for(unsigned int i=0; isetAutoCommit(0); + + + //sql::PreparedStatement *pstmt = con->prepareStatement("INSERT IGNORE INTO users(username,email,password,isadmin) VALUES (?,?,?,?)"); + + /*for(unsigned int i = 1; i<=10; i++ ) + { + cout << "Queueing record " << i << "." << endl; + pstmt->setString(1, "eric"); + pstmt->setString(2, "eric@rewiv.com"); + pstmt->setString(3, "password"); + pstmt->setInt(4,false); + pstmt->executeUpdate(); + + pstmt2->setString(1, "eric1"); + pstmt2->setString(2, "eric1@rewiv.com"); + pstmt2->setString(3, "password"); + pstmt2->setInt(4,true); + pstmt2->executeUpdate(); + + if( ( i % maxPreparedStatements ) == 0 || ( i % maxPreparedStatements ) == maxPreparedStatements ) { + cout << "Commiting " << i << " records." << endl; + con->commit(); + pstmt->clearParameters(); + pstmt2->clearParameters(); + } + } + + cout << "Commiting last updates ..." << endl; + con->commit(); +*/ + + //delete pstmt; + //delete pstmt2; + delete con; + //delete artist, album, track, user; + +} catch (sql::SQLException &e) { + cout << "# ERR: SQLException in " << __FILE__; + cout << "(" << __FUNCTION__ << ") on line " << __LINE__ << endl; + cout << "# ERR: " << e.what(); + cout << " (MySQL error code: " << e.getErrorCode(); + cout << ", SQLState: " << e.getSQLState() << " )" << endl; + return 0; +} catch(std::exception &e){ + cout << e.what() << endl; +} + +cout << endl; + +return EXIT_SUCCESS; +} +#endif diff --git a/mysql2.cc b/mysql2.cc new file mode 100644 index 0000000..fae300d --- /dev/null +++ b/mysql2.cc @@ -0,0 +1,59 @@ +#include "my_global.h" // Include this file first to avoid problems +#include "mysql.h" // MySQL Include File +#include +#include +#define SERVER "localhost" +#define USER "root" +#define PASSWORD "123" +#define DATABASE "domains" + +int main() +{ + MYSQL *connect; // Create a pointer to the MySQL instance + connect=mysql_init(NULL); // Initialise the instance + /* This If is irrelevant and you don't need to show it. I kept it in for Fault Testing.*/ + if(!connect) /* If instance didn't initialize say so and exit with fault.*/ + { + fprintf(stderr,"MySQL Initialization Failed"); + return 1; + } + /* Now we will actually connect to the specific database.*/ + + connect=mysql_real_connect(connect,SERVER,USER,PASSWORD,DATABASE,0,NULL,0); + /* Following if statements are unneeded too, but it's worth it to show on your + first app, so that if your database is empty or the query didn't return anything it + will at least let you know that the connection to the mysql server was established. */ + + if(connect){ + printf(" * Connection Succeeded\n"); + } + else{ + printf("Connection Failed!\n"); + } + MYSQL_RES *res_set; /* Create a pointer to recieve the return value.*/ + MYSQL_ROW row; /* Assign variable for rows. */ + mysql_query(connect,"SELECT id, fname,lname,username,email FROM users"); + /* Send a query to the database. */ + unsigned int i = 0; /* Create a counter for the rows */ + + res_set = mysql_store_result(connect); /* Receive the result and store it in res_set */ + + unsigned int numrows = mysql_num_rows(res_set); /* Create the count to print all rows */ + + /* This while is to print all rows and not just the first row found, */ + int numfields = mysql_num_fields(res_set); + MYSQL_FIELD *mfield; + while((row = mysql_fetch_row(res_set))) +{ + + //std::cout << mfield->name << std::endl; + for(i = 0; i < numfields; i++) + { + mfield = mysql_fetch_field(res_set); + char *val = row[i]; + printf(" * %-10s : %s\n", mfield->name, val); + } +} + mysql_close(connect); /* Close and shutdown */ + return 0; +} diff --git a/mysqlMakefile b/mysqlMakefile new file mode 100644 index 0000000..f649cd8 --- /dev/null +++ b/mysqlMakefile @@ -0,0 +1,2 @@ +all: + g++ -o mysql mysql.cc crypt.cc -lmysqlcppconn -lcrypt -std=c++11 \ No newline at end of file diff --git a/scanner.cc b/scanner.cc new file mode 100644 index 0000000..309ebbf --- /dev/null +++ b/scanner.cc @@ -0,0 +1,222 @@ +// default c++ headers +#include +#include +#include +#include +#include +#include "scanner.hh" +#include "config.hh" +#include "common.hh" +#include "hathor_mysql.hh" +#include "3rdparty/crypt_blowfish.h" + +namespace fs = boost::filesystem; +using namespace std; + +static FileType fileType( std::string extension ) { + + for( unsigned int i = 1; i < s_fileTypeStrings.size(); i++ ) { + if( extension.compare(s_fileTypeStrings.at( i )) == 0 ) + return FileType( i ); + } + return FileType( Unknown ); + +} +/* + * hathor_handle_file( std::string file ) + * Process file information and send it to MySQL + */ +static s_fileFields handle_file( std::string file ) { + + s_fileFields filefields; // Structure to store file information for MySQL + fs::path current = fs::system_complete(file); // Get current file object + std::string current_path = current.parent_path().native(); // Get current path minus the file + TagLib::FileRef f( file.c_str() ); // Create TagLib object + + if(!f.isNull() && f.tag()) { + + filefields.artist = ( f.tag()->artist().isEmpty() ? "Unknown" : f.tag()->artist().toCString(true)); + filefields.album = ( f.tag()->album().isEmpty() ? "Unknown" : f.tag()->album().toCString(true)); + filefields.title = ( f.tag()->title().isEmpty() ? file.c_str() : f.tag()->title().toCString(true) ); + filefields.genre = ( f.tag()->genre().isEmpty() ? "null" : f.tag()->genre().toCString(true)); + filefields.comment = ( f.tag()->comment().isEmpty() ? "null" : f.tag()->comment().toCString(true)); + filefields.tracknum = ( f.tag()->track() ? f.tag()->track() : 0 ); + filefields.year = ( f.tag()->year() ? f.tag()->year() : 0 ); + + TagLib::AudioProperties *p = f.audioProperties(); + filefields.bitrate = ( p->bitrate() ? p->bitrate() : 0 ); + filefields.sample = ( p->sampleRate() ? p->sampleRate() : 0 ); + filefields.channels = ( p->channels() ? p->channels() : 0 ); + + if( p->length() ) { + filefields.length = p->length(); + filefields.seconds = p->length() % 60; + filefields.minutes = ( p->length() - filefields.seconds ) / 60; + } else { + filefields.length = 0; + filefields.seconds = 0; + filefields.minutes = 0; + } + + TagLib::PropertyMap tags = f.file()->properties(); + for(TagLib::PropertyMap::ConstIterator i = tags.begin(); i != tags.end(); ++i) { + for(TagLib::StringList::ConstIterator j = i->second.begin(); j != i->second.end(); ++j) { + if(i->first == "ALBUMARTIST") { filefields.albumartist = (j->isEmpty() ? "null" : j->toCString(true)); } + if(i->first == "LYRICS") { filefields.lyrics = (j->isEmpty() ? "null" : j->toCString(true)); } + if(i->first == "LABEL") { filefields.label = (j->isEmpty() ? "null" : j->toCString(true));} + } + } + + ++file_count; + + } + else { + FILE * notagslog; + notagslog = fopen("no_media_info.log", "a"); + fprintf (notagslog, "Skipping %s, no media information found ...\n",file.c_str()); + printf("Skipping %s, no media information found ...\n", file.c_str()); + //notagslog << file << endl; + ++no_info_count; + fclose(notagslog); + } + return filefields; +} + + +json j = parse_file("config.json"); +scanner_config s_opts = hathor_config(j); + +static int handle_directory( std::string path ) { + + sql::Connection *conn = get_connection( + s_opts.mysql.user.c_str(), + s_opts.mysql.pass.c_str(), + s_opts.mysql.host.c_str(), + s_opts.mysql.port + ); + conn->setAutoCommit(0); // Turn autocommit off for transactions. + conn->setSchema(s_opts.mysql.db); + unsigned int maxPstmt = get_max_statements(conn); + sql::PreparedStatement *artist = conn->prepareStatement("INSERT IGNORE INTO artists (arid,name) VALUES(MD5(?),?)"); + sql::PreparedStatement *album = conn->prepareStatement("INSERT IGNORE INTO albums (aid,name,arid,albumartist,label,released) VALUES(MD5(?),?,MD5(?),?,?,?)"); + sql::PreparedStatement *track = conn->prepareStatement("INSERT IGNORE INTO tracks (tid,uri,arid,aid,title,track,genre,lyrics,comment,bitrate,sample,channels,length,minutes,seconds) VALUES(MD5(?),?,MD5(?),MD5(?),?,?,?,?,?,?,?,?,?,?,?)"); + + ofstream skipped; // Open file for adding skipped files + skipped.open("skipped_files.log", ios::out | ios::app); // open log + ofstream error_log; + error_log.open("errors.log",ios::out|ios::app); + + fs::path p( fs::system_complete( path.c_str() ) ); // Get the current path we are working on + cout << p.native() << endl; + if ( !fs::exists(p) ) { // exit if path was not found + std::cout << "\nPath Not found: " << p << std::endl; + return 1; + } + + fs::recursive_directory_iterator end_iter; + + for (fs::recursive_directory_iterator dir_itr(p); dir_itr != end_iter; ++dir_itr) { + try { + if ( fs::is_directory( dir_itr->status() ) && !is_hidden( dir_itr->path() ) ) { + ++dir_count; + printf(" * Scanning directory %s ...\n", dir_itr->path().native().c_str()); + continue; + } + else if ( fs::is_regular_file( dir_itr->status() ) && !is_hidden( dir_itr->path() ) ) { + std::string extension = dir_itr->path().extension().native(); + if( !extension.empty() ) { + extension.erase(extension.find('.'), extension.find('.')+1); + toLower(extension); + if( fileType(extension) == FileType( Unknown ) ) { + std::cout << " * Skipping file " << dir_itr->path().native() << " ... \n"; + skipped << "[" << extension << "] " << dir_itr->path().native() << "\n"; + ++skip_count; + } else { + s_fileFields filefields = handle_file( dir_itr->path().native() ); + + + char aid[1000]; + std::string ayear = boost::lexical_cast(filefields.year); + + strcpy(aid,filefields.album.c_str()); + strcat(aid,filefields.artist.c_str()); + strcat(aid, ayear.c_str()); + // Artist + artist->setString(1, filefields.artist ); // artists.arid + artist->setString(2, filefields.artist ); // artists.name + artist->executeUpdate(); + // Album + album->setString(1, aid ); // albums.aid + album->setString(2, filefields.album ); // albums.name + album->setString(3, filefields.artist ); // albums.arid + album->setString(4, filefields.albumartist ); // albums.albumartist + album->setString(5, filefields.label ); // albums.label + album->setInt (6, filefields.year ); // albums.released + album->executeUpdate(); + // Tracks + track->setString(1, dir_itr->path().native() ); // tracks.tid + track->setString(2, dir_itr->path().native() ); // tracks.uri + track->setString(3, filefields.artist ); // tracks.arid + track->setString(4, aid ); // tracks.aid + track->setString(5, filefields.title ); // tracks.title + track->setInt (6, filefields.tracknum ); // tracks.track + track->setString(7, filefields.genre ); // tracks.genre + track->setString(8, filefields.lyrics ); // tracks.lyrics + track->setString(9, filefields.comment ); // tracks.comment + track->setInt (10, filefields.bitrate ); // tracks.bitrate + track->setInt (11, filefields.sample ); // tracks.sample + track->setInt (12, filefields.channels ); // tracks.channels + track->setInt (13, filefields.length ); // tracks.length + track->setInt (14, filefields.minutes ); // tracks.minutes + track->setInt (15, filefields.seconds ); // tracks.seconds + track->executeUpdate(); + + + } + } else { + //std::cout << " * Skipping file " << dir_itr->path().native() << " ... \n"; + skipped << "[no extension] " << dir_itr->path().native() << "\n"; + ++skip_count; + } + } + else { + skipped << "[other] " << dir_itr->path().native() << "\n"; + ++other_count; + } + } catch (const sql::SQLException & sqlError ) { + error_log << "[SQLError] : " << dir_itr->path().filename() << " " << sqlError.what() << std::endl; + continue; + } + catch (const std::exception & ex) { + ++err_count; + std::cout << dir_itr->path().filename() << " " << ex.what() << std::endl; + error_log << dir_itr->path().filename() << " " << ex.what() << std::endl; + } + } + + skipped.close(); + error_log.close(); + conn->commit(); + + + delete artist; + delete album; + delete track; + delete conn; + return 0; + +} + +int main( int argc, char *argv[] ) { + + if(argc > 1) s_opts.scanner.path = fs::current_path().native(); + handle_directory(s_opts.scanner.path); + std::cout << "Directorys : " << dir_count << endl; + std::cout << "Media : " << file_count << endl; + std::cout << "No tags : " << no_info_count << endl; + std::cout << "Skipped : " << skip_count << endl; + std::cout << "Other Files : " << other_count << endl; + std::cout << "Errors : " << err_count << endl; + + return 0; +} diff --git a/scanner.hh b/scanner.hh new file mode 100644 index 0000000..9655bb2 --- /dev/null +++ b/scanner.hh @@ -0,0 +1,80 @@ +// +// Created by eric on 8/15/15. +// + +#ifndef HATHOR_SCANNER_HH +#define HATHOR_SCANNER_HH + +#include +#include +#include + +// Include boost +#include "boost/filesystem.hpp" +#include "boost/filesystem/operations.hpp" +#include "boost/filesystem/path.hpp" +#include "boost/progress.hpp" + +// Include taglib +#include +#include +#include +#include +#include + +#include "common.hh" + +#ifndef HATHOR_MAX_SUPPORTED +#define HATHOR_MAX_SUPPORTED 9 +#endif +unsigned long file_count = 0; +unsigned long dir_count = 0; +unsigned long other_count = 0; +unsigned long err_count = 0; +unsigned long skip_count = 0; +unsigned long no_info_count = 0; + + +static std::array s_fileTypeStrings = + {"","mp2","mp3","mp4","m4p","m4a","ogg","flac","wma"}; + +struct s_fileFields { + + std::string artist; + std::string albumartist; + std::string album; + std::string title; + unsigned int tracknum; + std::string genre; + unsigned int year; + + std::string label; + std::string lyrics; + std::string comment; + unsigned int bitrate; + unsigned int sample; + unsigned int channels; + unsigned int length; + unsigned int minutes; // (properties->length() - seconds) / 60 + unsigned int seconds; // properties->length() % 60 + +}; +enum FileType +{ + Unknown = 0, + mp2 = 1, + mp3 = 2, + mp4 = 3, // please use just for Ogg Vorbis + m4p = 4, + m4a = 5, + ogg = 6, // a file in MPEG-4 container that may or may not contain video + flac = 7, // a file in MPEG-4 container that contains only audio + wma = 8 + +}; + + +//static FileType fileType( std::string extension ); +//static bool is_hidden(const fs::path &p); + +#endif //HATHOR_SCANNER_HH diff --git a/sql.hh b/sql.hh new file mode 100644 index 0000000..c7cdef7 --- /dev/null +++ b/sql.hh @@ -0,0 +1,46 @@ +// +// Created by eric on 8/15/15. +// + +#ifndef HATHOR_SQL_HH +#define HATHOR_SQL_HH + +#include +#include + +sql::SQLString userSql("DROP TABLE IF EXISTS `users`;"); + +sql::SQLString artistsSql("DROP TABLE IF EXISTS `artists`;"); + +sql::SQLString albumsSql("DROP TABLE IF EXISTS `albums`;"); + +sql::SQLString tracksSql("DROP TABLE IF EXISTS `tracks`;"); + +sql::SQLString playlistsSql("DROP TABLE IF EXISTS `playlists`;"); + +sql::SQLString userCreateSql("CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'the user id int', `uid` varchar(64) NOT NULL COMMENT 'user id in md5', `username` varchar(20) NOT NULL COMMENT 'the users name', `email` varchar(255) NOT NULL COMMENT 'the users email', `password` varchar(255) NOT NULL COMMENT 'the users hashed password', `isadmin` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'true or false, admin rights', `pls` blob COMMENT 'json list of playlist ids', `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'timestamp of user record', PRIMARY KEY (`id`), UNIQUE KEY `hathor_username` (`username`), UNIQUE KEY `hathor_email` (`email`), UNIQUE KEY `hathor_id` (`id`), UNIQUE KEY `hathor_uid` (`uid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + +sql::SQLString artistCreateSql("CREATE TABLE IF NOT EXISTS `artists` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `arid` varchar(64) NOT NULL COMMENT 'unique artist id in md5 format', `name` varchar(255) NOT NULL COMMENT 'name of the artist', `web` blob COMMENT 'json formated information with different web sites', `tour` blob COMMENT 'json formated information about touring', `rating` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT 'rating from 1 to 10 of artist', `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'updated timestamp', `extra` blob COMMENT 'any extra information about artist in json format', PRIMARY KEY (`id`), UNIQUE KEY `arid_hathor` (`arid`), UNIQUE KEY `name_hathor` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + +sql::SQLString albumCreateSql("CREATE TABLE `albums` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id of the album', `aid` varchar(64) NOT NULL COMMENT 'album id in md5', `arid` varchar(64) NOT NULL COMMENT 'matching arist id from artist table', `released` year(4) DEFAULT '1969' COMMENT 'year released', `web` blob COMMENT 'json list of web sites for this album', `extra` blob COMMENT 'any extra information about this album in json format.', `first_available` date DEFAULT '1969-01-01', PRIMARY KEY (`id`), UNIQUE KEY `aid_hathor` (`aid`), UNIQUE KEY `arid_hathor` (`arid`), CONSTRAINT `arid_artists` FOREIGN KEY (`arid`) REFERENCES `artists` (`arid`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + +sql::SQLString tracksCreateSql("CREATE TABLE IF NOT EXISTS `tracks` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id of the song in the database', `tid` varchar(64) NOT NULL COMMENT 'song id md5 hash', `arid` varchar(64) NOT NULL COMMENT 'corresponding artist id from artist table in md5 hash', `aid` varchar(64) NOT NULL COMMENT 'corresponding album id from album table in md5 hash', `title` varchar(255) NOT NULL COMMENT 'title of song', `track` tinyint(4) unsigned DEFAULT '0' COMMENT 'track number of song', `genre` varchar(45) DEFAULT NULL COMMENT 'genre of song', `year` tinyint(4) DEFAULT '0' COMMENT 'year of song', `label` varchar(255) DEFAULT NULL COMMENT 'music label of song e.g. Columbia Records', `lyrics` blob COMMENT 'lyrics if any', `bitrate` mediumint(6) unsigned DEFAULT '0' COMMENT 'bitrate of song', `sample` mediumint(6) unsigned DEFAULT '0' COMMENT 'sample rate of song', `channels` smallint(2) unsigned DEFAULT '0' COMMENT 'channels of song i.e stereo = 2, mono = 1', `length` int(10) unsigned DEFAULT '0' COMMENT 'length of song', `minutes` tinytext COMMENT 'total length of song in minutes and seconds', `seconds` tinyint(4) unsigned DEFAULT '0' COMMENT 'seconds of song', `pls` blob COMMENT 'playlists this song is associated with', `ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'timestamp of last update of song', PRIMARY KEY (`id`), UNIQUE KEY `arid_hathor` (`arid`) USING BTREE, UNIQUE KEY `aid_hathor` (`aid`), UNIQUE KEY `title_hathor` (`title`), UNIQUE KEY `sid_hathor` (`tid`), CONSTRAINT `aid_albums_table` FOREIGN KEY (`aid`) REFERENCES `albums` (`aid`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `arid_artists_table` FOREIGN KEY (`arid`) REFERENCES `artists` (`arid`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + +sql::SQLString playlistsCreateSql("CREATE TABLE IF NOT EXISTS `playlists` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'playlist id', `uid` varchar(64) NOT NULL COMMENT 'uid in the users table in md5', `plsid` varchar(64) NOT NULL COMMENT 'playlist id in md5', `name` varchar(255) NOT NULL COMMENT 'name for this playlist', `track` varchar(64) NOT NULL COMMENT 'the track in md5 format from the tracks table', `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'playlist last updated timestamp', PRIMARY KEY (`id`), UNIQUE KEY `uid_hathor` (`uid`), UNIQUE KEY `uid_pls_hathor` (`uid`), KEY `playlist_track_idx` (`track`), CONSTRAINT `playlist_track` FOREIGN KEY (`track`) REFERENCES `tracks` (`tid`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `playlist_uid` FOREIGN KEY (`uid`) REFERENCES `users` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + +std::map< std::string, sql::SQLString > SqlMap = +{ + {"userSql", userSql}, + {"userCreateSql", userCreateSql}, + {"artistsSql", artistsSql}, + {"artistCreateSql", artistCreateSql}, + {"albumsSql", albumsSql}, + {"albumCreateSql", albumCreateSql}, + {"tracksSql", tracksSql}, + {"tracksCreateSql", tracksCreateSql}, + {"playlistsSql", playlistsSql}, + {"playlistsCreateSql", playlistsCreateSql}, + +}; + +#endif //HATHOR_SQL_HH diff --git a/tests/Bob Dylan (John Wesley Harding) - 12 - I'll Be Your Baby Tonight.wma b/tests/Bob Dylan (John Wesley Harding) - 12 - I'll Be Your Baby Tonight.wma new file mode 100644 index 0000000..4601c61 Binary files /dev/null and b/tests/Bob Dylan (John Wesley Harding) - 12 - I'll Be Your Baby Tonight.wma differ diff --git a/tests/Bob Dylan.Bringing It All Back Home.01.Subterranean Homesick Blues.mp3 b/tests/Bob Dylan.Bringing It All Back Home.01.Subterranean Homesick Blues.mp3 new file mode 100644 index 0000000..f651325 Binary files /dev/null and b/tests/Bob Dylan.Bringing It All Back Home.01.Subterranean Homesick Blues.mp3 differ diff --git a/tests/Satanic_Warmaster_-_Carelian_Satanist_Madness_-_01_.The_Vampiric_Tyrant.mp3 b/tests/Satanic_Warmaster_-_Carelian_Satanist_Madness_-_01_.The_Vampiric_Tyrant.mp3 new file mode 100644 index 0000000..ff14083 Binary files /dev/null and b/tests/Satanic_Warmaster_-_Carelian_Satanist_Madness_-_01_.The_Vampiric_Tyrant.mp3 differ diff --git a/tests/album.jpg b/tests/album.jpg new file mode 100644 index 0000000..cca0664 Binary files /dev/null and b/tests/album.jpg differ diff --git a/tests/connect.cpp b/tests/connect.cpp new file mode 100644 index 0000000..25f4c17 --- /dev/null +++ b/tests/connect.cpp @@ -0,0 +1,236 @@ +/* +Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + +The MySQL Connector/C++ is licensed under the terms of the GPLv2 +, like most +MySQL Connectors. There are special exceptions to the terms and +conditions of the GPLv2 as it is applied to this software, see the +FLOSS License Exception +. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published +by the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + + + +/** +* Basic example demonstrating connect and simple queries +* +*/ + + +// Standard C++ includes +#include +#include +#include +#include + +/* + Public interface of the MySQL Connector/C++. + You might not use it but directly include directly the different + headers from cppconn/ and mysql_driver.h + mysql_util.h + (and mysql_connection.h). This will reduce your build time! +*/ +#include "mysql_public_iface.h" +/* Connection parameter and sample data */ +#include "examples.h" + +using namespace std; + +/** +* Usage example for Driver, Connection, (simple) Statement, ResultSet +*/ +int main(int argc, const char **argv) +{ + string url(argc >= 2 ? argv[1] : EXAMPLE_HOST); + const string user(argc >= 3 ? argv[2] : EXAMPLE_USER); + const string pass(argc >= 4 ? argv[3] : EXAMPLE_PASS); + const string database(argc >= 5 ? argv[4] : EXAMPLE_DB); + + /* sql::ResultSet.rowsCount() returns size_t */ + size_t row; + stringstream sql; + stringstream msg; + int i, affected_rows; + + cout << boolalpha; + cout << "1..1" << endl; + cout << "# Connector/C++ connect basic usage example.." << endl; + cout << "#" << endl; + + try { + sql::Driver * driver = sql::mysql::get_driver_instance(); + /* Using the Driver to create a connection */ + std::auto_ptr< sql::Connection > con(driver->connect(url, user, pass)); + + /* Creating a "simple" statement - "simple" = not a prepared statement */ + std::auto_ptr< sql::Statement > stmt(con->createStatement()); + + /* Create a test table demonstrating the use of sql::Statement.execute() */ + stmt->execute("USE " + database); + stmt->execute("DROP TABLE IF EXISTS test"); + stmt->execute("CREATE TABLE test(id INT, label CHAR(1))"); + cout << "#\t Test table created" << endl; + + /* Populate the test table with data */ + for (i = 0; i < EXAMPLE_NUM_TEST_ROWS; i++) { + /* + KLUDGE: You should take measures against SQL injections! + example.h contains the test data + */ + sql.str(""); + sql << "INSERT INTO test(id, label) VALUES ("; + sql << test_data[i].id << ", '" << test_data[i].label << "')"; + stmt->execute(sql.str()); + } + cout << "#\t Test table populated" << endl; + + { + /* + Run a query which returns exactly one result set like SELECT + Stored procedures (CALL) may return more than one result set + */ + std::auto_ptr< sql::ResultSet > res(stmt->executeQuery("SELECT id, label FROM test ORDER BY id ASC")); + cout << "#\t Running 'SELECT id, label FROM test ORDER BY id ASC'" << endl; + + /* Number of rows in the result set */ + cout << "#\t\t Number of rows\t"; + cout << "res->rowsCount() = " << res->rowsCount() << endl; + if (res->rowsCount() != EXAMPLE_NUM_TEST_ROWS) { + msg.str(""); + msg << "Expecting " << EXAMPLE_NUM_TEST_ROWS << "rows, found " << res->rowsCount(); + throw runtime_error(msg.str()); + } + + /* Fetching data */ + row = 0; + while (res->next()) { + cout << "#\t\t Fetching row " << row << "\t"; + /* You can use either numeric offsets... */ + cout << "id = " << res->getInt(1); + /* ... or column names for accessing results. The latter is recommended. */ + cout << ", label = '" << res->getString("label") << "'" << endl; + row++; + } + } + + { + /* Fetching again but using type convertion methods */ + std::auto_ptr< sql::ResultSet > res(stmt->executeQuery("SELECT id FROM test ORDER BY id DESC")); + cout << "#\t Fetching 'SELECT id FROM test ORDER BY id DESC' using type conversion" << endl; + row = 0; + while (res->next()) { + cout << "#\t\t Fetching row " << row; + cout << "#\t id (int) = " << res->getInt("id"); + cout << "#\t id (boolean) = " << res->getBoolean("id"); + cout << "#\t id (long) = " << res->getInt64("id") << endl; + row++; + } + } + + /* Usage of UPDATE */ + stmt->execute("INSERT INTO test(id, label) VALUES (100, 'z')"); + affected_rows = stmt->executeUpdate("UPDATE test SET label = 'y' WHERE id = 100"); + cout << "#\t UPDATE indicates " << affected_rows << " affected rows" << endl; + if (affected_rows != 1) { + msg.str(""); + msg << "Expecting one row to be changed, but " << affected_rows << "change(s) reported"; + throw runtime_error(msg.str()); + } + + { + std::auto_ptr< sql::ResultSet > res(stmt->executeQuery("SELECT id, label FROM test WHERE id = 100")); + + res->next(); + if ((res->getInt("id") != 100) || (res->getString("label") != "y")) { + msg.str("Update must have failed, expecting 100/y got"); + msg << res->getInt("id") << "/" << res->getString("label"); + throw runtime_error(msg.str()); + } + + cout << "#\t\t Expecting id = 100, label = 'y' and got id = " << res->getInt("id"); + cout << ", label = '" << res->getString("label") << "'" << endl; + } + + /* Clean up */ + stmt->execute("DROP TABLE IF EXISTS test"); + stmt.reset(NULL); /* free the object inside */ + + cout << "#" << endl; + cout << "#\t Demo of connection URL syntax" << endl; + try { + /*s This will implicitly assume that the host is 'localhost' */ + url = "unix://var/run/mysqld.sock"; + con.reset(driver->connect(url, user, pass)); + } catch (sql::SQLException &e) { + cout << "#\t\t unix://path_to_mysql_socket.sock caused expected exception" << endl; + cout << "#\t\t " << e.what() << " (MySQL error code: " << e.getErrorCode(); + cout << ", SQLState: " << e.getSQLState() << " )" << endl; + } + + try { + url = "tcp://hostname_or_ip[:port]"; + con.reset(driver->connect(url, user, pass)); + } catch (sql::SQLException &e) { + cout << "#\t\t tcp://hostname_or_ip[:port] caused expected exception" << endl; + cout << "#\t\t " << e.what() << " (MySQL error code: " << e.getErrorCode(); + cout << ", SQLState: " << e.getSQLState() << " )" << endl; + } + + try { + /* + Note: in the MySQL C-API host = localhost would cause a socket connection! + Not so with the C++ Connector. The C++ Connector will translate + tcp://localhost into tcp://127.0.0.1 and give you a TCP connection + url = "tcp://localhost[:port]"; + */ + con.reset(driver->connect(url, user, pass)); + } catch (sql::SQLException &e) { + cout << "#\t\t tcp://hostname_or_ip[:port] caused expected exception" << endl; + cout << "#\t\t " << e.what() << " (MySQL error code: " << e.getErrorCode(); + cout << ", SQLState: " << e.getSQLState() << " )" << endl; + } + + cout << "# done!" << endl; + + } catch (sql::SQLException &e) { + /* + The MySQL Connector/C++ throws three different exceptions: + + - sql::MethodNotImplementedException (derived from sql::SQLException) + - sql::InvalidArgumentException (derived from sql::SQLException) + - sql::SQLException (derived from std::runtime_error) + */ + cout << "# ERR: SQLException in " << __FILE__; + cout << "(" << EXAMPLE_FUNCTION << ") on line " << __LINE__ << endl; + /* Use what() (derived from std::runtime_error) to fetch the error message */ + cout << "# ERR: " << e.what(); + cout << " (MySQL error code: " << e.getErrorCode(); + cout << ", SQLState: " << e.getSQLState() << " )" << endl; + cout << "not ok 1 - examples/connect.php" << endl; + + return EXIT_FAILURE; + } catch (std::runtime_error &e) { + + cout << "# ERR: runtime_error in " << __FILE__; + cout << "(" << EXAMPLE_FUNCTION << ") on line " << __LINE__ << endl; + cout << "# ERR: " << e.what() << endl; + cout << "not ok 1 - examples/connect.php" << endl; + + return EXIT_FAILURE; + } + + cout << "ok 1 - examples/connect.php" << endl; + return EXIT_SUCCESS; +} diff --git a/tests/image.cc b/tests/image.cc new file mode 100644 index 0000000..b67361e --- /dev/null +++ b/tests/image.cc @@ -0,0 +1,96 @@ +#include +#include +#include +#include +#include +using namespace Magick; +using namespace std; +#define BF_MAX_SALT_LEN 60 +#define RANDBYTES 16 +static const char base64_table[] = + { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '\0' + }; + +static const char base64_pad = '='; + +unsigned char *php_base64_encode(const unsigned char *str, int length, int *ret_length) +{ + const unsigned char *current = str; + unsigned char *p; + unsigned char *result; + + if ((length + 2) < 0 || ((length + 2) / 3) >= (1 << (sizeof(int) * 8 - 2))) { + if (ret_length != NULL) { + *ret_length = 0; + } + return NULL; + } + + result = (unsigned char *)malloc(((length + 2) / 3) * 4); + p = result; + + while (length > 2) { /* keep going until we have less than 24 bits */ + *p++ = base64_table[current[0] >> 2]; + *p++ = base64_table[((current[0] & 0x03) << 4) + (current[1] >> 4)]; + *p++ = base64_table[((current[1] & 0x0f) << 2) + (current[2] >> 6)]; + *p++ = base64_table[current[2] & 0x3f]; + + current += 3; + length -= 3; /* we just handle 3 octets of data */ + } + + /* now deal with the tail end of things */ + if (length != 0) { + *p++ = base64_table[current[0] >> 2]; + if (length > 1) { + *p++ = base64_table[((current[0] & 0x03) << 4) + (current[1] >> 4)]; + *p++ = base64_table[(current[1] & 0x0f) << 2]; + *p++ = base64_pad; + } else { + *p++ = base64_table[(current[0] & 0x03) << 4]; + *p++ = base64_pad; + *p++ = base64_pad; + } + } + if (ret_length != NULL) { + *ret_length = (int)(p - result); + } + *p = '\0'; + return result; +} +int main(int argc, char ** argv) { + unsigned char * buffer; + int * ret_len; + stringstream ss; + InitializeMagick(*argv); + Image image("album.jpg"); + Blob blob; + image.magick("JPEG"); + image.write(&blob); + std::string base = blob.base64(); + const void* data = blob.data(); + size_t dataLen = blob.length(); + Geometry size = image.size(); + cout << size.height() << endl; + cout << size.width() << endl; + cout << size.xOff() << endl; + cout << size.yOff() << endl; + cout << image.fileSize() << endl; + cout << image.fileName() << endl; + cout << image.format() << endl; + cout << image.label() << endl; + cout << image.magick() << endl; + cout << image.quality() << endl; + cout << image.comment() << endl; + cout << base64("mydata") << endl; + //cout << image.size() << endl; + //printf("Width : %d, Height : %d\n", image.width(), image.height()); + //buffer = php_base64_encode(data.data(), dataLen, ret_len); + //cout << buffer << endl; + //free(buffer); + return 0; +} \ No newline at end of file diff --git a/tests/phpChecks b/tests/phpChecks new file mode 100755 index 0000000..2126411 --- /dev/null +++ b/tests/phpChecks @@ -0,0 +1,12 @@ +#!/usr/bin/env php +=") ): + throw new Exception(sprintf("\n\x1b[41;1m[error] : PHP Version \x1b[4m%s\x1b[0m\x1b[41;1m \x1b[37;1mor above is required, please update.\n\n", $phpRequired)); + endif; +} catch (Exception $e) { + fwrite(STDERR, $e->getMessage()) . PHP_EOL; + exit(255); +} diff --git a/tests/php_hash_test.php b/tests/php_hash_test.php new file mode 100644 index 0000000..2de197c --- /dev/null +++ b/tests/php_hash_test.php @@ -0,0 +1,21 @@ + diff --git a/tests/taglib.cc b/tests/taglib.cc new file mode 100644 index 0000000..9949585 --- /dev/null +++ b/tests/taglib.cc @@ -0,0 +1,110 @@ +/* Copyright (C) 2003 Scott Wheeler + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include + +#include + +using namespace std; +using namespace TagLib; + +int main(int argc, char *argv[]) +{ + // process the command line args + + + for(int i = 1; i < argc; i++) { + + cout << "******************** \"" << argv[i] << "\"********************" << endl; + + + MPEG::File f(argv[i]); + ID3v2::Tag *id3v2tag = f.ID3v2Tag(); + + if(id3v2tag) { + + cout << "ID3v2." + << id3v2tag->header()->majorVersion() + << "." + << id3v2tag->header()->revisionNumber() + << ", " + << id3v2tag->header()->tagSize() + << " bytes in tag" + << endl; + + ID3v2::FrameList::ConstIterator it = id3v2tag->frameList().begin(); + for(; it != id3v2tag->frameList().end(); it++) + cout << (*it)->frameID() << " - \"" << (*it)->toString() << "\"" << endl; + } + else + cout << "file does not have a valid id3v2 tag" << endl; + + cout << endl << "ID3v1" << endl; + + ID3v1::Tag *id3v1tag = f.ID3v1Tag(); + + if(id3v1tag) { + cout << "title - \"" << id3v1tag->title() << "\"" << endl; + cout << "artist - \"" << id3v1tag->artist() << "\"" << endl; + cout << "album - \"" << id3v1tag->album() << "\"" << endl; + cout << "year - \"" << id3v1tag->year() << "\"" << endl; + cout << "comment - \"" << id3v1tag->comment() << "\"" << endl; + cout << "track - \"" << id3v1tag->track() << "\"" << endl; + cout << "genre - \"" << id3v1tag->genre() << "\"" << endl; + } + else + cout << "file does not have a valid id3v1 tag" << endl; + + APE::Tag *ape = f.APETag(); + + cout << endl << "APE" << endl; + + if(ape) { + for(APE::ItemListMap::ConstIterator it = ape->itemListMap().begin(); + it != ape->itemListMap().end(); ++it) + { + if((*it).second.type() != APE::Item::Binary) + cout << (*it).first << " - \"" << (*it).second.toString() << "\"" << endl; + else + cout << (*it).first << " - Binary data (" << (*it).second.binaryData().size() << " bytes)" << endl; + } + } + else + cout << "file does not have a valid APE tag" << endl; + + cout << endl; + } +} diff --git a/tests/taglibexample.cc b/tests/taglibexample.cc new file mode 100644 index 0000000..5529867 --- /dev/null +++ b/tests/taglibexample.cc @@ -0,0 +1,128 @@ +/* Copyright (C) 2003 Scott Wheeler + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include //mp3 file +#include +#include +#include +//#include +using namespace std; +string get_id3v2_picture(const char * file) { + + TagLib::MPEG::File mp3File(file); + TagLib::ID3v2::Tag *v2tag = mp3File.ID3v2Tag(); + TagLib::ID3v2::FrameList frame = v2tag->frameListMap()["APIC"]; + TagLib::ID3v2::AttachedPictureFrame * pictureFrame; + + TagLib::ID3v2::FrameList::ConstIterator it= frame.begin(); + + for(; it != frame.end() ; it++) + { + pictureFrame = static_cast (*it);//cast Frame * to AttachedPictureFrame* + cout << "toString() : " << pictureFrame->toString() << endl; + cout << "textEncoding() : " << pictureFrame->textEncoding() << endl; + cout << "type() : " << TagLib::ID3v2::AttachedPictureFrame::Type( pictureFrame->type() ) << endl; + cout << "mimeType() :" << pictureFrame->mimeType() << endl; + cout << "description() : " << pictureFrame->description() << endl; + cout << "size() :" << pictureFrame->size() << endl; + cout << "data() :" << pictureFrame->picture().data() << endl; + } + return pictureFrame->toString().toCString(true); +} +int main(int argc, char *argv[]) +{ + TagLib::String lyrics,label,albumartist; + + for(int i = 1; i < argc; i++) { + + cout << "******************** \"" << argv[i] << "\" ********************" << endl; + + TagLib::FileRef f(argv[i], true, TagLib::AudioProperties::Accurate); + + cout << get_id3v2_picture(argv[i]) << endl; + if(!f.isNull() && f.tag()) { + + TagLib::Tag *tag = f.tag(); + unsigned int year = tag->year(); + cout << "-- TAG (basic) --" << endl; + cout << "title - \"" << tag->title() << "\"" << endl; + cout << "artist - \"" << tag->artist() << "\"" << endl; + cout << "album - \"" << tag->album() << "\"" << endl; + cout << "year - \"" << (unsigned int)tag->year() << "\"" << endl; + cout << "comment - \"" << tag->comment() << "\"" << endl; + cout << "track - \"" << tag->track() << "\"" << endl; + cout << "genre - \"" << tag->genre().toCString() << "\"" << endl; + + TagLib::PropertyMap tags = f.file()->properties(); + + unsigned int longest = 0; + for(TagLib::PropertyMap::ConstIterator i = tags.begin(); i != tags.end(); ++i) { + if (i->first.size() > longest) { + longest = i->first.size(); + } + } + + + cout << "-- TAG (properties) --" << endl; + for(TagLib::PropertyMap::ConstIterator i = tags.begin(); i != tags.end(); ++i) { + for(TagLib::StringList::ConstIterator j = i->second.begin(); j != i->second.end(); ++j) { + cout << left << std::setw(longest) << i->first << " - " << '"' << *j << '"' << endl; + if( strcmp(i->first.toCString(true),"ALBUMARTIST") == 0 ) { albumartist = *j; } + // if( strcmp(i->first.toCString(true), "LYRICS") == 0) { lyrics = *j; } + if( strcmp(i->first.toCString(true), "TRACKNUMBER") == 0) { cout << "FOUND TRACK NUMBER" << *j << endl;} + if(i->first == "LABEL") { label = *j; } + } + } + + } + + if(!f.isNull() && f.audioProperties()) { + + + TagLib::AudioProperties *properties = f.audioProperties(); + + int seconds = properties->length() % 60; + int minutes = (properties->length() - seconds) / 60; + + cout << "-- AUDIO --" << endl; + cout << "bitrate - " << properties->bitrate() << endl; + cout << "sample rate - " << properties->sampleRate() << endl; + cout << "channels - " << properties->channels() << endl; + cout << "length - " << minutes << ":" << setfill('0') << setw(2) << seconds << endl; + + } + } + // .isEmpty() + //cout << "lyrics:" << lyrics << endl; + //cout << "label:" << ( label.isEmpty() ? "no Lyrics\n" : label ) << endl; + return 0; +}