rse         99/06/09 03:45:04

  Modified:    src      CHANGES Configure
               src/helpers TestCompile
               src/lib/expat-lite Makefile.tmpl xmldef.h
  Log:
  Determine AP_BYTE_ORDER for ap_config_auto.h and already
  use this at least for Expat.
  
  Revision  Changes    Path
  1.1373    +3 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1372
  retrieving revision 1.1373
  diff -u -r1.1372 -r1.1373
  --- CHANGES   1999/06/07 12:05:58     1.1372
  +++ CHANGES   1999/06/09 10:44:59     1.1373
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.7
   
  +  *) Determine AP_BYTE_ORDER for ap_config_auto.h and already
  +     use this at least for Expat. [Ralf S. Engelschall]
  +
     *) Allow .module files to specify libraries with Lib:.
        [Ben Laurie]
   
  
  
  
  1.353     +18 -0     apache-1.3/src/Configure
  
  Index: Configure
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/Configure,v
  retrieving revision 1.352
  retrieving revision 1.353
  diff -u -r1.352 -r1.353
  --- Configure 1999/06/07 12:05:35     1.352
  +++ Configure 1999/06/09 10:45:00     1.353
  @@ -1893,6 +1893,24 @@
   echo "#define AP_LONGEST_LONG $AP_LONGEST_LONG" >>$AP_CONFIG_AUTO_H
   echo "#endif" >>$AP_CONFIG_AUTO_H
   
  +####################################################################
  +## More building ap_config_auto.h
  +##
  +## We check for the endianess of the machine
  +##
  +AP_BYTE_ORDER=`./helpers/TestCompile -r byteorder`
  +if [ "x$AP_BYTE_ORDER" = "x21" ]; then
  +    AP_BYTE_ORDER="21" # big endian
  +else
  +    AP_BYTE_ORDER="12" # little endian
  +fi
  +
  +echo "" >>$AP_CONFIG_AUTO_H
  +echo "/* determine: byte order of machine (12: little endian, 21: big 
endian) */" >>$AP_CONFIG_AUTO_H
  +echo "#ifndef AP_BYTE_ORDER" >>$AP_CONFIG_AUTO_H
  +echo "#define AP_BYTE_ORDER $AP_BYTE_ORDER" >>$AP_CONFIG_AUTO_H
  +echo "#endif" >>$AP_CONFIG_AUTO_H
  +
   ##
   ## Now compare the sizes of off_t to long
   ##
  
  
  
  1.31      +27 -0     apache-1.3/src/helpers/TestCompile
  
  Index: TestCompile
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/helpers/TestCompile,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- TestCompile       1999/06/02 07:02:59     1.30
  +++ TestCompile       1999/06/09 10:45:02     1.31
  @@ -26,6 +26,10 @@
   #    Which prints out the sizeof <type> (sure would be nice
   #    if sizeof could be use in preprocessor if's)
   #
  +# ./helpers/TestCompile byteorder
  +#    Which prints out the byte order of the machine
  +#    (12: little endian, 21: big endian)
  +#
   # It does these by creating a small mini-makefile, based on
   # ../Makefile.config and trying to compile a small dummy
   # program. If the compilation succeeds, we assume the test
  @@ -102,6 +106,29 @@
   #include <sys/types.h>
   int main(void) {
       printf("%d\n", sizeof($2));
  +    return(0);
  +}
  +EOF
  +     ;;
  +    "byteorder")
  +     TLIB=""
  +     if [ "x$VERBOSE" = "xyes" ]; then
  +         ERRDIR=""
  +     else
  +         ERRDIR='2>/dev/null'
  +     fi
  +     TARGET='testfunc'
  +     cat <<EOF >testfunc.c
  +#include <stdio.h>
  +#include <sys/types.h>
  +int main(void) {
  +    /* Are we little or big endian? From Harbison & Steele */
  +    union {
  +        long l;
  +        char c[sizeof(long)];
  +    } u;
  +    u.l = 1;
  +    printf("%s\n", u.c[sizeof(long)-1] == 1 ? "21" : "12");
       return(0);
   }
   EOF
  
  
  
  1.2       +1 -6      apache-1.3/src/lib/expat-lite/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/lib/expat-lite/Makefile.tmpl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Makefile.tmpl     1999/05/31 10:56:24     1.1
  +++ Makefile.tmpl     1999/06/09 10:45:03     1.2
  @@ -2,13 +2,8 @@
   # default definition of these two. dunno how to get it prepended when the
   # Makefile is built, so we do it manually
   #
  -CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
  +CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -DAPACHE
   INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES)
  -
  -# If you know what your system's byte order is, define BYTE_ORDER:
  -# use -DBYTE_ORDER=12 for little-endian byte order;
  -# use -DBYTE_ORDER=21 for big-endian (network) byte order.
  -#CFLAGS=-O2
   
   OBJS=xmltok.o xmlrole.o xmlparse.o hashtable.o
   
  
  
  
  1.2       +7 -0      apache-1.3/src/lib/expat-lite/xmldef.h
  
  Index: xmldef.h
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/lib/expat-lite/xmldef.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- xmldef.h  1999/05/31 10:56:25     1.1
  +++ xmldef.h  1999/06/09 10:45:03     1.2
  @@ -61,3 +61,10 @@
   #define int int32
   
   #endif /* MOZILLA */
  +
  +#ifdef APACHE
  +
  +#include "ap_config.h"
  +#define XML_BYTE_ORDER AP_BYTE_ORDER
  +
  +#endif /* APACHE */
  
  
  

Reply via email to