[shacrypt] push by Nightgunner5 - Add support for cross compiling for mingw32. on 2010-03-02 21:54 GMT

0 views
Skip to first unread message

shac...@googlecode.com

unread,
Mar 2, 2010, 4:55:12 PM3/2/10
to shac...@googlegroups.com
Revision: e7e48995cd
Author: Nightgunner5
Date: Tue Mar 2 13:53:13 2010
Log: Add support for cross compiling for mingw32.
http://code.google.com/p/shacrypt/source/detail?r=e7e48995cd

Deleted:
/build-aux/config.h.in
Modified:
/ChangeLog
/configure.ac
/src/third-party/mt19937ar.h

=======================================
--- /build-aux/config.h.in Sat Feb 27 20:17:00 2010
+++ /dev/null
@@ -1,89 +0,0 @@
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define to 1 if your system has a GNU libc compatible `malloc' function,
and
- to 0 otherwise. */
-#undef HAVE_MALLOC
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be
sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
-
-/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
- <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed,
the
- #define below would cause a syntax error. */
-#undef _UINT32_T
-
-/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
- <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed,
the
- #define below would cause a syntax error. */
-#undef _UINT8_T
-
-/* Define to rpl_malloc if the replacement function should be used. */
-#undef malloc
-
-/* Define to the type of an unsigned integer type of width exactly 32 bits
if
- such a type exists and the standard includes do not define it. */
-#undef uint32_t
-
-/* Define to the type of an unsigned integer type of width exactly 8 bits
if
- such a type exists and the standard includes do not define it. */
-#undef uint8_t
=======================================
--- /ChangeLog Sat Feb 27 20:17:00 2010
+++ /ChangeLog Tue Mar 2 13:53:13 2010
@@ -1,3 +1,8 @@
+2010-03-02 Nightgunner5 <nightg...@llamaslayers.net>
+
+ * configure.ac, src/third-party/mt19937ar.h, build-aux/config.h.in:
+ Add support for cross compiling for mingw32.
+
2010-02-27 Nightgunner5 <nightg...@llamaslayers.net>

* Makefile.am, Makefile.in, NEWS, configure, configure.ac, tests/t1.sh,
=======================================
--- /configure.ac Sat Feb 27 20:17:00 2010
+++ /configure.ac Tue Mar 2 13:53:13 2010
@@ -14,7 +14,7 @@
AC_PROG_RANLIB
AM_PROG_CC_C_O
AC_PROG_SED
-AC_CHECK_PROG([WINDRES_EXE], [windres], [windres])
+AC_CHECK_TOOL([WINDRES_EXE], [windres], [windres])

# Check file extensions
AC_EXEEXT
=======================================
--- /src/third-party/mt19937ar.h Sat Feb 27 20:17:00 2010
+++ /src/third-party/mt19937ar.h Tue Mar 2 13:53:13 2010
@@ -44,20 +44,20 @@
#include <stdio.h>

/* Period parameters */
-#define N 624
-#define M 397
-#define MATRIX_A 0x9908b0dfUL /* constant vector a */
-#define UPPER_MASK 0x80000000UL /* most significant w-r bits */
-#define LOWER_MASK 0x7fffffffUL /* least significant r bits */
-
-static unsigned long mt[N]; /* the array for the state vector */
-static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */
+#define MT_N 624
+#define MT_M 397
+#define MT_MATRIX_A 0x9908b0dfUL /* constant vector a */
+#define MT_UPPER_MASK 0x80000000UL /* most significant w-r bits */
+#define MT_LOWER_MASK 0x7fffffffUL /* least significant r bits */
+
+static unsigned long mt[MT_N]; /* the array for the state vector */
+static int mti=MT_N+1; /* mti==N+1 means mt[N] is not initialized */

/* initializes mt[N] with a seed */
void mt_init_genrand(unsigned long s)
{
mt[0]= s & 0xffffffffUL;
- for (mti=1; mti<N; mti++) {
+ for (mti=1; mti<MT_N; mti++) {
mt[mti] =
(1812433253UL * (mt[mti-1] ^ (mt[mti-1] >> 30)) + mti);
/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
@@ -78,21 +78,21 @@
int i, j, k;
mt_init_genrand(19650218UL);
i=1; j=0;
- k = (N>key_length ? N : key_length);
+ k = (MT_N>key_length ? MT_N : key_length);
for (; k; k--) {
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL))
+ init_key[j] + j; /* non linear */
mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++; j++;
- if (i>=N) { mt[0] = mt[N-1]; i=1; }
+ if (i>=MT_N) { mt[0] = mt[MT_N-1]; i=1; }
if (j>=key_length) j=0;
}
- for (k=N-1; k; k--) {
+ for (k=MT_N-1; k; k--) {
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL))
- i; /* non linear */
mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++;
- if (i>=N) { mt[0] = mt[N-1]; i=1; }
+ if (i>=MT_N) { mt[0] = mt[MT_N-1]; i=1; }
}

mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */
@@ -102,25 +102,25 @@
unsigned long mt_genrand_int32(void)
{
unsigned long y;
- static unsigned long mag01[2]={0x0UL, MATRIX_A};
+ static unsigned long mag01[2]={0x0UL, MT_MATRIX_A};
/* mag01[x] = x * MATRIX_A for x=0,1 */

- if (mti >= N) { /* generate N words at one time */
+ if (mti >= MT_N) { /* generate N words at one time */
int kk;

- if (mti == N+1) /* if init_genrand() has not been called, */
+ if (mti == MT_N+1) /* if init_genrand() has not been called, */
mt_init_genrand(5489UL); /* a default initial seed is used */

- for (kk=0;kk<N-M;kk++) {
- y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
- mt[kk] = mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1UL];
- }
- for (;kk<N-1;kk++) {
- y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
- mt[kk] = mt[kk+(M-N)] ^ (y >> 1) ^ mag01[y & 0x1UL];
- }
- y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK);
- mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1UL];
+ for (kk=0;kk<MT_N-MT_M;kk++) {
+ y = (mt[kk]&MT_UPPER_MASK)|(mt[kk+1]&MT_LOWER_MASK);
+ mt[kk] = mt[kk+MT_M] ^ (y >> 1) ^ mag01[y & 0x1UL];
+ }
+ for (;kk<MT_N-1;kk++) {
+ y = (mt[kk]&MT_UPPER_MASK)|(mt[kk+1]&MT_LOWER_MASK);
+ mt[kk] = mt[kk+(MT_M-MT_N)] ^ (y >> 1) ^ mag01[y & 0x1UL];
+ }
+ y = (mt[MT_N-1]&MT_UPPER_MASK)|(mt[0]&MT_LOWER_MASK);
+ mt[MT_N-1] = mt[MT_M-1] ^ (y >> 1) ^ mag01[y & 0x1UL];

mti = 0;
}

Reply all
Reply to author
Forward
0 new messages