cvs commit: apache/src/helpers TestLib dummy.c testlib.c

1997-07-21 Thread Dean Gaudet
dgaudet 97/07/21 13:19:00

  Modified:src/helpers  TestLib dummy.c
  Removed: src/helpers  testlib.c
  Log:
  I really botched this up.  Jim had it right all along and I was misreading
  things.
  
  Revision  ChangesPath
  1.8   +7 -7  apache/src/helpers/TestLib
  
  Index: TestLib
  ===
  RCS file: /export/home/cvs/apache/src/helpers/TestLib,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -C3 -r1.7 -r1.8
  *** TestLib   1997/07/21 19:52:12 1.7
  --- TestLib   1997/07/21 20:18:59 1.8
  ***
  *** 1,6 
#!/bin/sh
exstat=1
  ! trap 'rm -f Makefile testlib; exit $exstat' 0 1 2 3 15
#
# Yet another Apache Configure helper script.
# This one exists simply to test for the existance of
  --- 1,6 
#!/bin/sh
exstat=1
  ! trap 'rm -f Makefile dummy; exit $exstat' 0 1 2 3 15
#
# Yet another Apache Configure helper script.
# This one exists simply to test for the existance of
  ***
  *** 28,34 
# Get makefile settings and build a basic Makefile
#
cd ./helpers
  ! rm -f testlib
cat ../Makefile.config  Makefile
cat EOF  Makefile
CFLAGS=\$(OPTIM) \$(CFLAGS1) \$(EXTRA_CFLAGS)
  --- 28,34 
# Get makefile settings and build a basic Makefile
#
cd ./helpers
  ! rm -f dummy
cat ../Makefile.config  Makefile
cat EOF  Makefile
CFLAGS=\$(OPTIM) \$(CFLAGS1) \$(EXTRA_CFLAGS)
  ***
  *** 36,51 
INCLUDES=\$(INCLUDES1) \$(EXTRA_INCLUDES)
LDFLAGS=\$(LDFLAGS1) \$(EXTRA_LDFLAGS)

  ! testlib:
  ! \$(CC) \$(CFLAGS) \$(INCLUDES) \$(LDFLAGS) helpers/testlib.c -o testlib 
-l$1

EOF

# Now run that Makefile
  ! make testlib  /dev/null 21

  ! # And see if testlib exists, if so, then we assume the 
# library we are testing for exists
  ! if [ -f testlib ]; then
exstat=0
fi
  --- 36,51 
INCLUDES=\$(INCLUDES1) \$(EXTRA_INCLUDES)
LDFLAGS=\$(LDFLAGS1) \$(EXTRA_LDFLAGS)

  ! dummy:
  ! \$(CC) \$(CFLAGS) \$(INCLUDES) \$(LDFLAGS) dummy.c -o dummy -l$1

EOF

# Now run that Makefile
  ! make dummy  /dev/null 21

  ! # And see if dummy exists, if so, then we assume the 
# library we are testing for exists
  ! if [ -f dummy ]; then
exstat=0
fi
  
  
  
  1.2   +1 -0  apache/src/helpers/dummy.c
  
  Index: dummy.c
  ===
  RCS file: /export/home/cvs/apache/src/helpers/dummy.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -C3 -r1.1 -r1.2
  *** dummy.c   1997/07/17 02:56:37 1.1
  --- dummy.c   1997/07/21 20:18:59 1.2
  ***
  *** 1,3 
  --- 1,4 
  + /* this file is used by TestLib */
int main(void) {
return 0;
}
  
  
  


cvs commit: apache/src/helpers TestLib

1997-07-20 Thread Dean Gaudet
dgaudet 97/07/20 17:16:20

  Modified:src/helpers  TestLib
  Log:
  I get nervous about 'rm -r' where it's not strictly needed.
  
  Revision  ChangesPath
  1.5   +2 -2  apache/src/helpers/TestLib
  
  Index: TestLib
  ===
  RCS file: /export/home/cvs/apache/src/helpers/TestLib,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -C3 -r1.4 -r1.5
  *** TestLib   1997/07/17 17:12:42 1.4
  --- TestLib   1997/07/21 00:16:19 1.5
  ***
  *** 1,5 
#!/bin/sh
  ! trap 'rm -rf Makefile dummy; exit' 0 1 2 3 15
#
# Yet another Apache Configure helper script.
# This one exists simply to test for the existance of
  --- 1,5 
#!/bin/sh
  ! trap 'rm -f Makefile dummy; exit' 0 1 2 3 15
#
# Yet another Apache Configure helper script.
# This one exists simply to test for the existance of
  ***
  *** 27,33 
# Get makefile settings and build a basic Makefile
#
cd ./helpers
  ! rm -rf dummy
cat ../Makefile.config  Makefile
cat EOF  Makefile
CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
  --- 27,33 
# Get makefile settings and build a basic Makefile
#
cd ./helpers
  ! rm -f dummy
cat ../Makefile.config  Makefile
cat EOF  Makefile
CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
  
  
  


cvs commit: apache/src/helpers TestLib

1997-07-20 Thread Jim Jagielski
jim 97/07/20 18:21:34

  Modified:src/helpers  TestLib
  Log:
  Add Dean's suggestions in... TestLib is now silent, we check it's
  exit status .
  
  Revision  ChangesPath
  1.6   +12 -12apache/src/helpers/TestLib
  
  Index: TestLib
  ===
  RCS file: /export/home/cvs/apache/src/helpers/TestLib,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -C3 -r1.5 -r1.6
  *** TestLib   1997/07/21 00:16:19 1.5
  --- TestLib   1997/07/21 01:21:33 1.6
  ***
  *** 1,5 
#!/bin/sh
  ! trap 'rm -f Makefile dummy; exit' 0 1 2 3 15
#
# Yet another Apache Configure helper script.
# This one exists simply to test for the existance of
  --- 1,6 
#!/bin/sh
  ! exstat=1
  ! trap 'rm -f Makefile dummy; exit $exstat' 0 1 2 3 15
#
# Yet another Apache Configure helper script.
# This one exists simply to test for the existance of
  ***
  *** 20,26 
# Make sure we have an argument
#
if [ x$1 = x ]; then
  !   exit 1
fi

#
  --- 21,27 
# Make sure we have an argument
#
if [ x$1 = x ]; then
  !   exit
fi

#
  ***
  *** 30,51 
rm -f dummy
cat ../Makefile.config  Makefile
cat EOF  Makefile
  ! CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
  ! LIBS=$(EXTRA_LIBS) $(LIBS1)
  ! INCLUDES=$(INCLUDES1) $(EXTRA_INCLUDES)
  ! LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)

  ! all:
\$(CC) \$(CFLAGS) \$(INCLUDES) \$(LDFLAGS) dummy.c -o dummy -l$1

EOF

# Now run that Makefile
  ! `make  /dev/null 21`

  ! # And see if dummy exists
if [ -f dummy ]; then
  ! echo yes
  ! else
  ! echo no
fi
  --- 31,51 
rm -f dummy
cat ../Makefile.config  Makefile
cat EOF  Makefile
  ! CFLAGS=\$(OPTIM) \$(CFLAGS1) \$(EXTRA_CFLAGS)
  ! LIBS=\$(EXTRA_LIBS) \$(LIBS1)
  ! INCLUDES=\$(INCLUDES1) \$(EXTRA_INCLUDES)
  ! LDFLAGS=\$(LDFLAGS1) \$(EXTRA_LDFLAGS)

  ! dummy:
\$(CC) \$(CFLAGS) \$(INCLUDES) \$(LDFLAGS) dummy.c -o dummy -l$1

EOF

# Now run that Makefile
  ! make dummy  /dev/null 21

  ! # And see if dummy exists, if so, then we assume the 
  ! # library we are testing for exists
if [ -f dummy ]; then
  ! exstat=0
fi
  
  
  


cvs commit: apache/src/helpers TestLib

1997-07-17 Thread Jim Jagielski
jim 97/07/17 10:12:42

  Modified:src   Configure
   src/helpers  TestLib
  Log:
  Configure: Clean up comments and let them stand out, almost module-like
  TestLib: Instead of creating a.out, use dummy
  
  Revision  ChangesPath
  1.112 +59 -43apache/src/Configure
  
  Index: Configure
  ===
  RCS file: /export/home/cvs/apache/src/Configure,v
  retrieving revision 1.111
  retrieving revision 1.112
  diff -C3 -r1.111 -r1.112
  *** Configure 1997/07/17 03:03:20 1.111
  --- Configure 1997/07/17 17:12:40 1.112
  ***
  *** 10,29 
# modules and rules. These rules are used to allow Configure to
# be totally configured from Configuration
#
  ! # Uses 3 supplemental scripts located in ./helpers: CutRule,
  ! # GuessOS and PrintPath
  ! #
  ! #
  ! # Setup some defaults
  ! #
file=Configuration
tmpfile=htconf.$$
makefile_tmpl=Makefile.tmpl

  ! #
  ! # Now handle any arguments, which, for now, are -file and -make
  ! # to select alternate Configuration and Makefile.tmpl files
  ! #
while [ x$1 != x ]; do
  if [ x$1 = x-file ] ; then
shift 1; file=$1; shift 1
  --- 10,32 
# modules and rules. These rules are used to allow Configure to
# be totally configured from Configuration
#
  ! # Uses 4 supplemental scripts located in ./helpers:
  ! #   CutRule: Determines the value for a specified Rule
  ! #   GuessOS: Uses uname to determine OS/platform
  ! #   PrintPath: generic type or whence replacement
  ! #   TestLib: See if a specified library is available
  ! #
  ! 
  ! ## Setup some defaults
  ! ##
file=Configuration
tmpfile=htconf.$$
makefile_tmpl=Makefile.tmpl

  ! 
  ! ## Now handle any arguments, which, for now, are -file and -make
  ! ## to select alternate Configuration and Makefile.tmpl files
  ! ##
while [ x$1 != x ]; do
  if [ x$1 = x-file ] ; then
shift 1; file=$1; shift 1
  ***
  *** 50,57 
  exit 1
fi

#
  ! # First, strip comments and blank lines, remove whitespace around
# = assignments, change Rules to comments and then remove whitespace
# before Module declarations
#
  --- 53,64 
  exit 1
fi

  + 
  + ## From the Configuration file, create a cleaned-up version
  + ## that's easy to scan
  + ##
#
  ! # Strip comments and blank lines, remove whitespace around
# = assignments, change Rules to comments and then remove whitespace
# before Module declarations
#
  ***
  *** 64,80 
 sed 's/^[]*%Module/%Module/'  $tmpfile

#
  ! # Check for syntax errors...
#
if egrep -v '^%?Module[ ]+[A-Za-z0-9_]+[]+[^]+$' $tmpfile \
  !| grep -v =  /dev/null
then
  !echo Syntax error --- The configuration file is used only to
  !echo define the list of included modules or to set Makefile
  !echo options or Configure rules, and I don't see that at all:
  !egrep -v '^Module[   ]+[A-Za-z0-9_]+[]+[^]+$' $tmpfile | 
\
  !  grep -v =
  !exit 1
fi

#
  --- 71,89 
 sed 's/^[]*%Module/%Module/'  $tmpfile

#
  ! # Only assignment (=) statements and Module lines
  ! # should be left at this point. If there is other stuff
  ! # we bail out
#
if egrep -v '^%?Module[ ]+[A-Za-z0-9_]+[]+[^]+$' $tmpfile \
  !  | grep -v =  /dev/null
then
  !   echo Syntax error --- The configuration file is used only to
  !   echo define the list of included modules or to set Makefile
  !   echo options or Configure rules, and I don't see that at all:
  !   egrep -v '^Module[]+[A-Za-z0-9_]+[]+[^]+$' $tmpfile | 
\
  !grep -v =
  !   exit 1
fi

#
  ***
  *** 83,92 
if [ -f Makefile ] ; then mv Makefile Makefile.bak; fi
if [ -f modules.c ] ; then mv modules.c modules.c.bak; fi

  ! #
# Start building the modules.c file from what was included
# in Configuration
  ! #
sed -e 's/_module//' $tmpfile | awk modules.c '\
   BEGIN { modules[n++] = core ; pmodules[pn++] = core} \
   /^Module/ { modules[n++] = $2 ; pmodules[pn++] = $2 } \
  --- 92,101 
if [ -f Makefile ] ; then mv Makefile Makefile.bak; fi
if [ -f modules.c ] ; then mv modules.c modules.c.bak; fi

  ! 
# Start building the modules.c file from what was included
# in Configuration
  ! 
sed -e 's/_module//' $tmpfile | awk modules.c '\
   BEGIN { modules[n++] = core ; pmodules[pn++] = core} \
   /^Module/ { modules[n++] = $2 ; pmodules[pn++] = $2 } \
  

cvs commit: apache/src/helpers TestLib dummy.c

1997-07-16 Thread Jim Jagielski
jim 97/07/16 19:56:38

  Added:   src/helpers  TestLib dummy.c
  Log:
  Add another helper script: TestLib. This one
  uses Makefile.config to help see if a library file exists
  
  Revision  ChangesPath
  1.1  apache/src/helpers/TestLib
  
  Index: TestLib
  ===
  #!/bin/sh
  trap 'rm -rf Makefile a.out; exit' 0 1 2 3 15
  #
  # Yet another Apache Configure helper script.
  # This one exists simply to test for the existance of
  # a library. It does so by using ../Makefile.config to get
  # things like the C-compiler, etc, and then trying to
  # compile a dummy program and linking it with that
  # library. If the linking succeeds, then we assume that
  # library exists and we print out yes otherwise we
  # print out no
  #
  
  #
  # Get makefile settings and build a basic Makefile
  #
  rm -rf a.out
  cat ../Makefile.config  Makefile
  cat EOF  Makefile
  TLIB=-$1
  CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
  LIBS=$(EXTRA_LIBS) $(LIBS1)
  INCLUDES=$(INCLUDES1) $(EXTRA_INCLUDES)
  LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)
  
  all:
  EOF
  cat \EOFF  Makefile
$(CC) $(CFLAGS) $(INCLUDES) $(LDFLAGS) dummy.c $(TLIB) 
  EOFF
  
  # Now run that Makefile
  `make  /dev/null 21`
  
  # And see if a.out exists
  if [ -f a.out ]; then
  echo yes
  else
  echo no
  fi
  
  
  
  1.1  apache/src/helpers/dummy.c
  
  Index: dummy.c
  ===
  int main(void) {
  return 0;
  }
  
  
  


cvs commit: apache/src/helpers TestLib

1997-07-16 Thread Jim Jagielski
jim 97/07/16 20:08:31

  Modified:src/helpers  TestLib
  Log:
  Oops
  
  Revision  ChangesPath
  1.2   +1 -1  apache/src/helpers/TestLib
  
  Index: TestLib
  ===
  RCS file: /export/home/cvs/apache/src/helpers/TestLib,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -C3 -r1.1 -r1.2
  *** TestLib   1997/07/17 02:56:37 1.1
  --- TestLib   1997/07/17 03:08:30 1.2
  ***
  *** 17,23 
rm -rf a.out
cat ../Makefile.config  Makefile
cat EOF  Makefile
  ! TLIB=-$1
CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
LIBS=$(EXTRA_LIBS) $(LIBS1)
INCLUDES=$(INCLUDES1) $(EXTRA_INCLUDES)
  --- 17,23 
rm -rf a.out
cat ../Makefile.config  Makefile
cat EOF  Makefile
  ! TLIB=-l$1
CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
LIBS=$(EXTRA_LIBS) $(LIBS1)
INCLUDES=$(INCLUDES1) $(EXTRA_INCLUDES)
  
  
  


cvs commit: apache/src/helpers TestLib

1997-07-16 Thread Jim Jagielski
jim 97/07/16 20:22:45

  Modified:src/helpers  TestLib
  Log:
  Oops II, I'm tired
  
  Revision  ChangesPath
  1.3   +6 -0  apache/src/helpers/TestLib
  
  Index: TestLib
  ===
  RCS file: /export/home/cvs/apache/src/helpers/TestLib,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -C3 -r1.2 -r1.3
  *** TestLib   1997/07/17 03:08:30 1.2
  --- TestLib   1997/07/17 03:22:45 1.3
  ***
  *** 10,19 
  --- 10,25 
# library exists and we print out yes otherwise we
# print out no
#
  + # This must be run as './helpers/TestLib libname' from
  + # the ./src directory (same directory that Configure is
  + # located) if you want to test it out. Configure must
  + # also call it as './helpers/TestLib libname'
  + #

#
# Get makefile settings and build a basic Makefile
#
  + cd ./helpers
rm -rf a.out
cat ../Makefile.config  Makefile
cat EOF  Makefile