dgaudet     97/11/05 04:48:26

  Modified:    src      .cvsignore CHANGES Configure Makefile.tmpl
               src/main conf.h http_core.c http_main.c
               src/modules/proxy proxy_cache.c
               src/regex .cvsignore mkh
  Added:       src/helpers PrintPathOS2
               src/os/emx .cvsignore Makefile.tmpl os-inline.c os.c os.h
               src/regex Makefile.tmpl
  Removed:     src/regex Makefile
  Log:
  OS/2 update.  It should now be possible to compile OS/2 from the same
  sources as Unix.
  
  Submitted by: Brian Havard <[EMAIL PROTECTED]>
  Reviewed by:  Dean Gaudet, Paul Sutton, Jim Jagielski
  
  Revision  Changes    Path
  1.10      +1 -0      apachen/src/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/.cvsignore,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- .cvsignore        1997/08/25 02:12:26     1.9
  +++ .cvsignore        1997/11/05 12:48:10     1.10
  @@ -1,3 +1,4 @@
  +Makefile
   *.dsw
   *.mdp
   *.ncb
  
  
  
  1.486     +3 -0      apachen/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/CHANGES,v
  retrieving revision 1.485
  retrieving revision 1.486
  diff -u -r1.485 -r1.486
  --- CHANGES   1997/11/05 11:23:21     1.485
  +++ CHANGES   1997/11/05 12:48:11     1.486
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3b3
   
  +  *) OS/2 Port updated; it should be possible to build OS/2 from the same
  +     sources as Unix now.  [Brian Havard <[EMAIL PROTECTED]>]
  +
     *) Fix a year formatting bug in mod_usertrack.
        [Paul Eggert <[EMAIL PROTECTED]>] PR#1342
   
  
  
  
  1.168     +12 -8     apachen/src/Configure
  
  Index: Configure
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/Configure,v
  retrieving revision 1.167
  retrieving revision 1.168
  diff -u -r1.167 -r1.168
  --- Configure 1997/11/05 01:04:52     1.167
  +++ Configure 1997/11/05 12:48:12     1.168
  @@ -161,7 +161,10 @@
   DBM_LIB="-ldbm"
   DB_LIB="-ldb"
   SHELL="/bin/sh"
  -if ./helpers/PrintPath -s ranlib; then
  +TARGET="httpd"
  +PRINTPATH=PrintPath
  +
  +if ./helpers/$PRINTPATH -s ranlib; then
       RANLIB="ranlib"
   else
       RANLIB="true"
  @@ -235,8 +238,11 @@
        DEF_WANTHSREGEX=yes
        OS='EMX OS/2'
        CFLAGS="$CFLAGS -Zbsd-signals -Zbin-files -DTCPIPV4 -g"
  -     LIBS="$LIBS -lsocket -llibufc -lbsd"
  +     LIBS="$LIBS -lsocket -lufc -lbsd"
        DBM_LIB="-lgdbm"
  +     TARGET=httpd.exe
  +     SHELL=sh
  +     PRINTPATH=PrintPathOS2
        ;;
       *-hi-hiux)
        OS='HI-UX'
  @@ -595,7 +601,7 @@
        for compilers in "gcc" "cc" "acc" "c89"
        do
            lookedfor="$lookedfor $compilers"
  -         if ./helpers/PrintPath -s $compilers; then
  +         if ./helpers/$PRINTPATH -s $compilers; then
                COMPILER="$compilers"
                break
            fi
  @@ -990,6 +996,7 @@
   echo "SHELL=$SHELL">> Makefile.config
   echo "OSDIR=$OSDIR">> Makefile.config
   echo "SUBDIRS=$SUBDIRS">> Makefile.config
  +echo "TARGET=$TARGET" >> Makefile.config
   echo >> Makefile.config
   echo "#### End of Configure created section ####">> Makefile.config
   
  @@ -1022,7 +1029,7 @@
   #
   # directories to create makefiles in
   #
  -MAKEDIRS="support main $OSDIR"
  +MAKEDIRS="support main regex $OSDIR"
   for dir in $MAKEDIRS ; do
        echo Creating Makefile in $dir
        cat Makefile.config $dir/Makefile.tmpl > $dir/Makefile
  @@ -1037,10 +1044,7 @@
   default: all
   
   all clean :: 
  -     for i in \$(MODULES); do \\
  -      (cd \$\$i; \\
  -       \$(MAKE) CC='\$(CC)' AUX_CFLAGS='\$(CFLAGS)' RANLIB='\$(RANLIB)' \$@) 
|| exit 1;\\
  -     done
  +     for i in \$(MODULES); do (cd \$\$i; \$(MAKE) CC='\$(CC)' 
AUX_CFLAGS='\$(CFLAGS)' RANLIB='\$(RANLIB)' \$@) || exit 1; done
   
   EOF
   
  
  
  
  1.70      +4 -4      apachen/src/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/Makefile.tmpl,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- Makefile.tmpl     1997/10/15 20:30:02     1.69
  +++ Makefile.tmpl     1997/11/05 12:48:13     1.70
  @@ -17,7 +17,7 @@
   .c.o:
        $(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $<
   
  -all: @@Configuration@@ httpd
  +all: @@Configuration@@ $(TARGET)
   
   @@Configuration@@: Configuration.tmpl
        @echo "@@Configuration@@ older than Configuration.tmpl, or doesn't 
exist."
  @@ -26,11 +26,11 @@
        @echo "If not, you will at least have to touch @@Configuration@@."
        @false
   
  -httpd:  subdirs modules.o
  +$(TARGET):  subdirs modules.o
        rm -f buildmark.c
        echo 'const char SERVER_BUILT[] = "'`date`'";' > buildmark.c
        $(CC) -c $(CFLAGS) buildmark.c
  -     $(CC) $(CFLAGS) $(LDFLAGS)  -o httpd buildmark.o $(OBJS) $(REGLIB) 
$(LIBS)
  +     $(CC) $(CFLAGS) $(LDFLAGS)  -o $(TARGET) buildmark.o $(OBJS) $(REGLIB) 
$(LIBS)
   
   subdirs:
        for i in $(SUBDIRS); do \
  @@ -43,7 +43,7 @@
        cd support; $(MAKE) CC='$(CC)' AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)'
   
   clean:
  -     rm -f httpd *.o
  +     rm -f $(TARGET) *.o
        for i in $(SUBDIRS); do \
                ( cd $$i; $(MAKE) $@ ) || exit 1; \
        done
  
  
  
  1.1                  apachen/src/helpers/PrintPathOS2
  
  Index: PrintPathOS2
  ===================================================================
  #!/bin/sh
  # Look for $1 somewhere in $PATH
  #  will print out the full pathname unless
  #  called with the '-s' option
  #
  
  if [ "x$1" = "x-s" ]; then
      shift
  else
      echo="yes"
  fi
  
  for path in `echo $PATH |
   sed 's/^;/.;/
        s/;;/;.;/g
        s/;$/;./
        s/;/ /g' `
  do
      if [ $test_exec_flag $path/$1.exe ] && [ ! -d $path/$1.exe ]; then
          if [ "$echo" = "yes" ]; then
            echo $path/$1.exe
        fi
        exit 0
      fi
  done
  exit 1
  
  
  
  
  1.151     +1 -3      apachen/src/main/conf.h
  
  Index: conf.h
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/main/conf.h,v
  retrieving revision 1.150
  retrieving revision 1.151
  diff -u -r1.150 -r1.151
  --- conf.h    1997/10/25 01:52:45     1.150
  +++ conf.h    1997/11/05 12:48:15     1.151
  @@ -59,6 +59,7 @@
   
   /* Have to include sys/stat.h before ../os/win32/os.h so we can override
   stat() properly */
  +#include <sys/types.h>
   #include <sys/stat.h>
   
   #ifdef WIN32
  @@ -800,10 +801,7 @@
   #endif
   
   #ifndef S_ISLNK
  -#ifndef __EMX__
  -/* Don't define this for OS/2 */
   #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
  -#endif
   #endif
   
   #ifndef INADDR_NONE
  
  
  
  1.134     +1 -1      apachen/src/main/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/main/http_core.c,v
  retrieving revision 1.133
  retrieving revision 1.134
  diff -u -r1.133 -r1.134
  --- http_core.c       1997/10/26 20:19:39     1.133
  +++ http_core.c       1997/11/05 12:48:16     1.134
  @@ -1121,7 +1121,7 @@
                "requires SUEXEC wrapper.\n");
        }
       }
  -#if !defined (BIG_SECURITY_HOLE)
  +#if !defined (BIG_SECURITY_HOLE) && !defined (__EMX__)
       if (cmd->server->server_uid == 0) {
        fprintf (stderr,
   "Error:\tApache has not been designed to serve pages while running\n"
  
  
  
  1.244     +3 -3      apachen/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/main/http_main.c,v
  retrieving revision 1.243
  retrieving revision 1.244
  diff -u -r1.243 -r1.244
  --- http_main.c       1997/11/03 10:11:42     1.243
  +++ http_main.c       1997/11/05 12:48:17     1.244
  @@ -1228,7 +1228,7 @@
       char errstr[MAX_STRING_LEN];
       int rc;
   
  -    m = (caddr_t) create_shared_heap("\\SHAREMEM\\SCOREBOARD", 
HARD_SERVER_LIMIT * sizeof(short_score));
  +    m = (caddr_t) create_shared_heap("\\SHAREMEM\\SCOREBOARD", 
SCOREBOARD_SIZE);
       if (m == 0) {
        fprintf(stderr, "httpd: Could not create OS/2 Shared memory pool.\n");
        exit(1);
  @@ -2086,7 +2086,7 @@
   
   void detach(void)
   {
  -#ifndef WIN32
  +#if !defined(WIN32) && !defined(__EMX__)
       int x;
   
       chdir("/");
  @@ -2145,7 +2145,7 @@
        * but we haven't opened that yet.  So leave it alone for now and it'll
        * be reopened moments later.
        */
  -#endif /* ndef WIN32 */
  +#endif /* ndef WIN32 or __EMX__ */
   }
   
   /* Reset group privileges, after rereading the config files
  
  
  
  1.30      +25 -0     apachen/src/modules/proxy/proxy_cache.c
  
  Index: proxy_cache.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/modules/proxy/proxy_cache.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- proxy_cache.c     1997/10/22 20:30:06     1.29
  +++ proxy_cache.c     1997/11/05 12:48:21     1.30
  @@ -276,6 +276,27 @@
        /* FIXME: Shouldn't any unexpected files be deleted? */
        /*      if (strlen(ent->d_name) != HASH_LEN) continue; */
   
  +/* under OS/2 use dirent's d_attr to identify a diretory */
  +#ifdef __EMX__
  +/* is it a directory? */
  +     if (ent->d_attr & A_DIR) {
  +         char newcachedir[HUGE_STRING_LEN];
  +         ap_snprintf(newcachedir, sizeof(newcachedir),
  +                     "%s%s/", cachesubdir, ent->d_name);
  +         if (!sub_garbage_coll(r, files, cachebasedir, newcachedir)) {
  +             ap_snprintf(newcachedir, sizeof(newcachedir),
  +                         "%s%s", cachedir, ent->d_name);
  +#if TESTING
  +             fprintf(stderr, "Would remove directory %s\n", newcachedir);
  +#else
  +             rmdir(newcachedir);
  +#endif
  +             --nfiles;
  +         }
  +         continue;
  +     }
  +#endif
  +
   /* read the file */
        fd = open(filename, O_RDONLY | O_BINARY);
        if (fd == -1) {
  @@ -289,6 +310,9 @@
            close(fd);
            continue;
        }
  +
  +/* In OS/2 this has already been done above */
  +#ifndef __EMX__
        if (S_ISDIR(buf.st_mode)) {
            char newcachedir[HUGE_STRING_LEN];
            close(fd);
  @@ -306,6 +330,7 @@
            }
            continue;
        }
  +#endif
   
        i = read(fd, line, 26);
        if (i == -1) {
  
  
  
  1.1                  apachen/src/os/emx/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  Makefile
  
  
  
  1.1                  apachen/src/os/emx/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===================================================================
  CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
  LIBS=$(EXTRA_LIBS) $(LIBS1)
  INCLUDES=$(INCLUDES_DEPTH2) $(EXTRA_INCLUDES)
  LFLAGS=$(LFLAGS1) $(EXTRA_LFLAGS)
  INCDIR=../../main
  
  OBJS= os.o os-inline.o
  COPY= os.h os-inline.c
  
  LIB=  libos.a
  
  all:  $(LIB) copy
  
  copy:
        for i in $(COPY); do  \
                rm -f $(INCDIR)/$$i ;\
                cp `pwd`/$$i $(INCDIR)/$$i ;\
        done
  
  $(LIB): $(OBJS)
        rm -f $@
        ar cr $@ $(OBJS)
        $(RANLIB) $@
  
  .c.o:
        $(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $<
  
  clean:
        for i in $(COPY); do  rm -f $(INCDIR)/$$i ; done
        rm -f $(OBJS) $(LIB)
  
  $(OBJS): Makefile
  
  # DO NOT REMOVE
  os.o: os.c os-inline.c
  
  
  
  1.1                  apachen/src/os/emx/os-inline.c
  
  Index: os-inline.c
  ===================================================================
  /*
   * This file contains functions which can be inlined if the compiler
   * has an "inline" modifier. Because of this, this file is both a
   * header file and a compilable module.
   *
   * Only inlineable functions should be defined in here. They must all
   * include the INLINE modifier. 
   *
   * If the compiler supports inline, this file will be #included as a
   * header file from os.h to create all the inline function
   * definitions. INLINE will be defined to whatever is required on
   * function definitions to make them inline declarations.
   *
   * If the compiler does not support inline, this file will be compiled
   * as a normal C file into libos.a (along with os.c). In this case
   * INLINE will _not_ be set so we can use this to test if we are
   * compiling this source file.  
   */
  
  #ifndef INLINE
  #define INLINE
  
  /* Anything required only when compiling */
  
  #endif
  
  INLINE int os_is_path_absolute(char *file)
  {
    /* For now, just do the same check that http_request.c and mod_alias.c
     * do. 
     */
    return file && (file[0] == '/' || file[1] == ':');
  }
  
  
  
  1.1                  apachen/src/os/emx/os.c
  
  Index: os.c
  ===================================================================
  /*
   * This file will include OS specific functions which are not inlineable.
   * Any inlineable functions should be defined in os-inline.c instead.
   */
  
  #include "os.h"
  
  
  
  1.1                  apachen/src/os/emx/os.h
  
  Index: os.h
  ===================================================================
  /*
   * This file in included in all Apache source code. It contains definitions
   * of facilities available on _this_ operating system (HAVE_* macros),
   * and prototypes of OS specific functions defined in os.c or os-inline.c
   */
  
  #if defined(__GNUC__) && !defined(INLINE)
  /* Compiler supports inline, so include the inlineable functions as
   * part of the header
   */
  #define INLINE extern __inline__
  #include "os-inline.c"
  #endif
  
  #ifndef INLINE
  /* Compiler does not support inline, so prototype the inlineable functions
   * as normal
   */
  extern int os_is_path_absolute(char *f);
  #endif
  
  /* OS/2 doesn't have symlinks so S_ISLNK is always false */
  #define S_ISLNK(m) 0
  
  
  
  1.5       +1 -0      apachen/src/regex/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/regex/.cvsignore,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- .cvsignore        1997/07/08 18:05:38     1.4
  +++ .cvsignore        1997/11/05 12:48:24     1.5
  @@ -3,3 +3,4 @@
   Release
   regex.mdp
   regex.ncb
  +Makefile
  
  
  
  1.2       +0 -1      apachen/src/regex/mkh
  
  Index: mkh
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/regex/mkh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mkh       1996/07/23 22:06:44     1.1
  +++ mkh       1997/11/05 12:48:25     1.2
  @@ -1,6 +1,5 @@
   #! /bin/sh
   # mkh - pull headers out of C source
  -PATH=/bin:/usr/bin ; export PATH
   
   # egrep pattern to pick out marked lines
   egrep='^ =([         ]|$)'
  
  
  
  1.1                  apachen/src/regex/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===================================================================
  # You probably want to take -DREDEBUG out of CFLAGS, and put something like
  # -O in, *after* testing (-DREDEBUG strengthens testing by enabling a lot of
  # internal assertion checking and some debugging facilities).
  # Put -Dconst= in for a pre-ANSI compiler.
  # Do not take -DPOSIX_MISTAKE out.
  # REGCFLAGS isn't important to you (it's for my use in some special contexts).
  CFLAGS=-I. -DPOSIX_MISTAKE $(AUX_CFLAGS)
  
  # If you have a pre-ANSI compiler, put -o into MKHFLAGS.  If you want
  # the Berkeley __P macro, put -b in.
  MKHFLAGS=
  
  # Flags for linking but not compiling, if any.
  LDFLAGS=
  
  # Extra libraries for linking, if any.
  LIBS=
  
  # Internal stuff, should not need changing.
  OBJPRODN=regcomp.o regexec.o regerror.o regfree.o
  OBJS=$(OBJPRODN) split.o debug.o main.o
  H=cclass.h cname.h regex2.h utils.h
  REGSRC=regcomp.c regerror.c regexec.c regfree.c
  ALLSRC=$(REGSRC) engine.c debug.c main.c split.c
  
  # Stuff that matters only if you're trying to lint the package.
  LINTFLAGS=-I. -Dstatic= -Dconst= -DREDEBUG
  LINTC=regcomp.c regexec.c regerror.c regfree.c debug.c main.c
  JUNKLINT=possible pointer alignment|null effect
  
  # arrangements to build forward-reference header files
  .SUFFIXES:    .ih .h
  .c.ih:
        sh ./mkh $(MKHFLAGS) -p $< >$@
  
  all lib: libregex.a
  
  libregex.a: $(OBJPRODN)
        rm -f libregex.a
        ar cr libregex.a $(OBJPRODN)
        $(RANLIB) libregex.a
  
  default:      r
  
  purge:
        rm -f *.o
  
  # stuff to build regex.h
  REGEXH=regex.h
  REGEXHSRC=regex2.h $(REGSRC)
  $(REGEXH):    $(REGEXHSRC) mkh
        sh ./mkh $(MKHFLAGS) -i _REGEX_H_ $(REGEXHSRC) >regex.h
        #cmp -s regex.tmp regex.h 2>/dev/null || cp regex.tmp regex.h
        #rm -f regex.tmp
  
  # dependencies
  $(OBJPRODN) debug.o:  utils.h regex.h regex2.h
  regcomp.o:    cclass.h cname.h regcomp.ih
  regexec.o:    engine.c engine.ih
  regerror.o:   regerror.ih
  debug.o:      debug.ih
  main.o:       main.ih
  
  # tester
  re:   $(OBJS)
        $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
  
  # regression test
  r:    re tests
        ./re <tests
        ./re -el <tests
        ./re -er <tests
  
  # 57 variants, and other stuff, for development use -- not useful to you
  ra:   ./re tests
        -./re <tests
        -./re -el <tests
        -./re -er <tests
  
  rx:   ./re tests
        ./re -x <tests
        ./re -x -el <tests
        ./re -x -er <tests
  
  t:    ./re tests
        -time ./re <tests
        -time ./re -cs <tests
        -time ./re -el <tests
        -time ./re -cs -el <tests
  
  l:    $(LINTC)
        lint $(LINTFLAGS) -h $(LINTC) 2>&1 | egrep -v '$(JUNKLINT)' | tee lint
  
  fullprint:
        ti README WHATSNEW notes todo | list
        ti *.h | list
        list *.c
        list regex.3 regex.7
  
  print:
        ti README WHATSNEW notes todo | list
        ti *.h | list
        list reg*.c engine.c
  
  
  mf.tmp:       Makefile
        sed '/^REGEXH=/s/=.*/=regex.h/' Makefile | sed '/#DEL$$/d' >$@
  
  DTRH=cclass.h cname.h regex2.h utils.h
  PRE=COPYRIGHT README WHATSNEW
  POST=mkh regex.3 regex.7 tests $(DTRH) $(ALLSRC) fake/*.[ch]
  FILES=$(PRE) Makefile $(POST)
  DTR=$(PRE) Makefile=mf.tmp $(POST)
  dtr:  $(FILES) mf.tmp
        makedtr $(DTR) >$@
        rm mf.tmp
  
  cio:  $(FILES)
        cio $(FILES)
  
  rdf:  $(FILES)
        rcsdiff -c $(FILES) 2>&1 | p
  
  # various forms of cleanup
  tidy:
        rm -f junk* core core.* *.core dtr *.tmp lint
  
  clean:        tidy
        rm -f *.o *.s re libregex.a
  
  # don't do this one unless you know what you're doing
  spotless:     clean
        rm -f mkh regex.h
  
  
  

Reply via email to