CVS: rdesktop configure,1.31,1.32 rdesktop.h,1.21,1.22
Michael Gernoth <[email protected]>
| Newsgroups | gmane.network.rdesktop.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5047
Modified Files:
configure rdesktop.h
Log Message:
configure-check for endianess and fallback in rdesktop.h
Index: configure
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/configure,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** configure 27 Apr 2004 09:13:50 -0000 1.31
--- configure 7 May 2004 04:56:08 -0000 1.32
***************
*** 297,300 ****
--- 297,327 ----
# Platform-specific options
+
+ #Endianess
+ cat >conftest.$$.c << EOF
+ #include <stdlib.h>
+ #include <signal.h>
+
+ int main(int argc, char **argv)
+ {
+ int test = 1;
+
+ return(*(unsigned char*) (&test));
+ }
+ EOF
+ $cc -o conftest.$$ conftest.$$.c
+ ./conftest.$$
+ if [ "$?" = "0" ]; then
+ echo "Architecture is big-endian"
+ echo
+ cflags="$cflags -DB_ENDIAN"
+ else
+ echo "Architecture is little-endian"
+ echo
+ cflags="$cflags -DL_ENDIAN"
+ fi
+ rm conftest.$$ conftest.$$.c
+
+ #Alignment
cat >conftest.$$.c << EOF
#include <stdlib.h>
***************
*** 318,322 ****
echo "Architecture needs alignment"
echo
! cflags="$cflags -DNEED_ALIGNMENT"
fi
rm conftest.$$ conftest.$$.c
--- 345,349 ----
echo "Architecture needs alignment"
echo
! cflags="$cflags -DNEED_ALIGN"
fi
rm conftest.$$ conftest.$$.c
Index: rdesktop.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdesktop.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** rdesktop.h 4 Mar 2004 08:23:17 -0000 1.21
--- rdesktop.h 7 May 2004 04:56:09 -0000 1.22
***************
*** 60,63 ****
--- 60,75 ----
#endif
+ /* If configure does not define the endianess, try
+ to find it out */
+ #if !defined(L_ENDIAN) && !defined(B_ENDIAN)
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+ #define L_ENDIAN
+ #elif __BYTE_ORDER == __BIG_ENDIAN
+ #define B_ENDIAN
+ #else
+ #error Unknown endianness. Edit rdesktop.h.
+ #endif
+ #endif /* B_ENDIAN, L_ENDIAN from configure */
+
#include "parse.h"
#include "constants.h"
-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3