jim         99/01/15 12:06:59

  Modified:    .        Makefile.tmpl configure
  Log:
  Some configure cleanups and the first attempts at some sort of
  universal style.
  
  First of all, we remove the hard-wire of TAR=tar and check to see if
  the tar we wind up with supports '-h'.
  
  Secondly, when we do shell string tests, [ ".$var" != .yes ] looks better
  when checking for the string "yes", I think it's better if, when checking
  for/against a NULL string, we use 'x', eg:
  
      [ "x$var" != x ]
  
  I'll start adjusting the other shell scripts as well.
  
  Revision  Changes    Path
  1.63      +4 -3      apache-1.3/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/Makefile.tmpl,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- Makefile.tmpl     1999/01/07 11:50:45     1.62
  +++ Makefile.tmpl     1999/01/15 20:06:56     1.63
  @@ -79,7 +79,6 @@
   CP              = cp
   LN              = ln
   RM              = rm -f
  -TAR             = tar
   MKDIR           = $(TOP)/$(AUX)/mkdir.sh
   INSTALL         = $(TOP)/$(AUX)/install.sh -c
   INSTALL_PROGRAM = $(INSTALL) -s -m 755
  @@ -87,6 +86,8 @@
   INSTALL_SCRIPT  = $(INSTALL) -m 755
   INSTALL_DATA    = $(INSTALL) -m 644
   PERL            = @PERL@
  +TAR          = @TAR@
  +TAROPT               = @TAROPT@
   
   #   installation name of Apache webserver
   TARGET          = @TARGET@
  @@ -367,7 +368,7 @@
                echo "[PRESERVING EXISTING DATA SUBDIR: 
$(root)$(datadir)/htdocs/]"; \
        else \
                echo "Copying tree $(TOP)/htdocs/ -> 
$(root)$(datadir)/htdocs/"; \
  -             (cd $(TOP)/htdocs/ && $(TAR) -hcf - *) |\
  +             (cd $(TOP)/htdocs/ && $(TAR) $(TAROPT) - *) |\
                (cd $(root)$(datadir)/htdocs/ && $(TAR) -xf -); \
                find $(root)$(datadir)/htdocs/ -type d -exec chmod a+rx {} \; ; 
\
                find $(root)$(datadir)/htdocs/ -type f -exec chmod a+r {} \; ; \
  @@ -384,7 +385,7 @@
                done; \
        fi
        @echo "Copying tree $(TOP)/icons/ -> $(root)$(datadir)/icons/"; \
  -     (cd $(TOP)/icons/ && $(TAR) -hcf - *) |\
  +     (cd $(TOP)/icons/ && $(TAR) $(TAROPT) - *) |\
        (cd $(root)$(datadir)/icons/ && $(TAR) -xf -); \
        find $(root)$(datadir)/icons/ -type d -exec chmod a+rx {} \; ;\
        find $(root)$(datadir)/icons/ -type f -exec chmod a+r {} \;
  
  
  
  1.68      +43 -20    apache-1.3/configure
  
  Index: configure
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/configure,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- configure 1999/01/02 13:19:41     1.67
  +++ configure 1999/01/15 20:06:57     1.68
  @@ -119,7 +119,7 @@
   ##
   PERL=no-perl-on-this-system
   perlpath="`$aux/PrintPath perl5 perl miniperl`"
  -if [ ".$perlpath" != . ]; then
  +if [ "x$perlpath" != x ]; then
       PERL="$perlpath"
   fi
   
  @@ -152,11 +152,32 @@
   ##
   AWK=awk
   awkpath="`$aux/PrintPath nawk gawk awk`"
  -if [ ".$awkpath" != . ]; then
  +if [ "x$awkpath" != x ]; then
       AWK="$awkpath"
   fi
   
   ##
  +## Look for a good tar. If we don't find 'GNU tar' then make
  +## sure ours can handle the '-h' (don't copy symlink, copy
  +## the actual data) option.
  +##
  +TAR=tar
  +tarpath="`$aux/PrintPath gtar gnutar tar`"
  +if [ "x$awkpath" != x ]; then
  +    TAR="$tarpath"
  +fi
  +case "`$TAR --version 2>/dev/null`" in
  +    *GNU*) TAROPT="-hcf" ;;
  +    *) if $TAR -hcf - Makefile.tmpl > /dev/null 2>&1
  +       then
  +           TAROPT="-hcf"
  +       else
  +           TAROPT="-cf"
  +       fi
  +       ;;
  +esac
  +
  +##
   ##  determine default parameters
   ##
   
  @@ -237,7 +258,7 @@
   OIFS="$IFS" IFS="$DIFS"
   for var in CFLAGS LDFLAGS LIBS INCLUDES DEPS; do
       eval "val=\$EXTRA_$var"
  -    if [ ".$val" != . ]; then
  +    if [ "x$val" != x ]; then
           eval "$var=\$val"
           eval "EXTRA_$var=\"\"; export EXTRA_$var"
           echo " + Hint: please use $var instead of EXTRA_$var next time"
  @@ -252,7 +273,7 @@
       *--with-layout=* ) 
           ;;
       * ) 
  -        if [ ".$*" = . ]; then
  +        if [ "x$*" = x ]; then
               set -- '--with-layout=Apache'
           else
               set -- '--with-layout=Apache' "$@"
  @@ -272,7 +293,7 @@
   for apc_option
   do
       #   if previous option needs an argument, assign it.
  -    if [ ".$apc_prev" != . ]; then
  +    if [ "x$apc_prev" != x ]; then
           eval "$apc_prev=\$apc_option"
           apc_prev=""
           continue
  @@ -412,7 +433,7 @@
   for apc_option
   do
       #   if previous option needs an argument, assign it.
  -    if [ ".$apc_prev" != . ]; then
  +    if [ "x$apc_prev" != x ]; then
           eval "$apc_prev=\$apc_option"
           apc_prev=""
           continue
  @@ -465,7 +486,7 @@
                   echo "##  Apache Makefile (shadow wrapper)" >> Makefile
                   echo "##" >> Makefile
                   echo "" >> Makefile
  -                if [ ".$shadow" != . ]; then
  +                if [ "x$shadow" != x ]; then
                       echo "SHADOW=$shadow" >> Makefile
                   else
                       echo "SHADOW=." >> Makefile
  @@ -635,7 +656,7 @@
                       apc_optarg=`echo "$apc_optarg" | tr "A-Z" "a-z"`
                       apc_optarg_real=`echo "$apc_optarg" | tr "a-z" "A-Z"`
                       eval "exists=\$rule_${apc_optarg}" 
  -                    if [ ".$exists" = . ]; then
  +                    if [ "x$exists" = x ]; then
                           echo "configure:Error: No such rule named 
'${apc_optarg_real}'" 1>&2
                           exit 1
                       fi
  @@ -665,7 +686,7 @@
                              ;;
                          * ) 
                              eval "exists=\$module_${apc_optarg}" 
  -                           if [ ".$exists" = . ]; then
  +                           if [ "x$exists" = x ]; then
                                  echo "configure:Error: No such module named 
'${apc_optarg}'" 1>&2
                                  exit 1
                              fi
  @@ -697,7 +718,7 @@
                              ;;
                          * ) 
                              eval "exists=\$module_${apc_optarg}" 
  -                           if [ ".$exists" = . ]; then
  +                           if [ "x$exists" = x ]; then
                                  echo "configure:Error: No such module named 
'${apc_optarg}'" 1>&2
                                  exit 1
                              fi
  @@ -722,7 +743,7 @@
                       apc_optarg=`echo "$apc_optarg" | tr "A-Z" "a-z"`
                       apc_optarg_real=`echo "$apc_optarg" | tr "a-z" "A-Z"`
                       eval "exists=\$rule_${apc_optarg}" 
  -                    if [ ".$exists" = . ]; then
  +                    if [ "x$exists" = x ]; then
                           echo "configure:Error: No such rule named 
'${apc_optarg_real}'" 1>&2
                           exit 1
                       fi
  @@ -739,7 +760,7 @@
                              ;;
                          * ) 
                              eval "exists=\$module_${apc_optarg}" 
  -                           if [ ".$exists" = . ]; then
  +                           if [ "x$exists" = x ]; then
                                  echo "configure:Error: No such module named 
'${apc_optarg}'" 1>&2
                                  exit 1
                              fi
  @@ -758,7 +779,7 @@
                              ;;
                          * ) 
                              eval "exists=\$module_${apc_optarg}" 
  -                           if [ ".$exists" = . ]; then
  +                           if [ "x$exists" = x ]; then
                                  echo "configure:Error: No such module named 
'${apc_optarg}'" 1>&2
                                  exit 1
                              fi
  @@ -776,7 +797,7 @@
                       BEGIN|END)
                           ;;
                       *)  eval "exists=\$module_${mod}" 
  -                        if [ ".$exists" = . ]; then
  +                        if [ "x$exists" = x ]; then
                               echo "configure:Error: No such module named 
'${mod}'" 1>&2
                               exit 1
                           fi
  @@ -835,7 +856,7 @@
       esac
   done
   IFS="$OIFS1"
  -if [ ".$apc_prev" != . ]; then
  +if [ "x$apc_prev" != x ]; then
       echo "configure:Error: missing argument to --`echo $apc_prev | sed 
's/_/-/g'`" 1>&2
       exit 1
   fi
  @@ -860,7 +881,7 @@
   for var in CC CPP OPTIM CFLAGS CFLAGS_SHLIB LDFLAGS LD_SHLIB LDFLAGS_SHLIB \
              LDFLAGS_SHLIB_EXPORT LIBS INCLUDES RANLIB DEPS TARGET; do
       eval "val=\"\$$var\""
  -    if [ ".$val" != . ]; then
  +    if [ "x$val" != x ]; then
           echo "$var=$val" |\
           sed -e 's:\(["$\\]\):\\\1:g' \
               -e 's:\([A-Z]*=\):\1":' \
  @@ -906,7 +927,7 @@
   ##
   ##  target name
   ##
  -if [ ".$TARGET" != . ]; then
  +if [ "x$TARGET" != x ]; then
       thetarget=$TARGET
   else
       thetarget=httpd
  @@ -1042,6 +1063,8 @@
   fi
   sed <Makefile.tmpl >$mkf \
   -e "[EMAIL PROTECTED]@%$PERL%g" \
  +-e "[EMAIL PROTECTED]@%$TAR%g" \
  +-e "[EMAIL PROTECTED]@%$TAROPT%g" \
   -e "[EMAIL PROTECTED]@%$src%g" \
   -e "[EMAIL PROTECTED]@%$mkf%g" \
   -e "[EMAIL PROTECTED]@%$aux%g" \
  @@ -1114,7 +1137,7 @@
   for var in CC CPP OPTIM CFLAGS CFLAGS_SHLIB LDFLAGS LD_SHLIB LDFLAGS_SHLIB \
              LDFLAGS_SHLIB_EXPORT LIBS INCLUDES RANLIB DEPS TARGET; do
       eval "val=\"\$$var\"";
  -    if [ ".$val" != . ]; then
  +    if [ "x$val" != x ]; then
           case $var in 
               CFLAGS|LDFLAGS|LIBS|INCLUDES|DEPS) 
                   echo $SEO "s%^#*\\(EXTRA_$var=\\).*%\\1$val%g" >>$sedsubst
  @@ -1165,7 +1188,7 @@
   fi
   
   #   module permutation support
  -if [ ".$permute" != . ]; then
  +if [ "x$permute" != x ]; then
       sed -e '/## mod_mmap_static/,$d' <src/Configuration.tmpl >$tplconf
       OIFS="$IFS" IFS='
   '
  @@ -1308,7 +1331,7 @@
   ##  final hints
   ##
   if [ .$quiet = .no ]; then
  -    if [ ".$shadow" != . ]; then
  +    if [ "x$shadow" != x ]; then
           echo "Hint: You now have to build inside $shadow."
           echo "This can be done either by running the canonical commands"
           echo "  \$ cd $shadow"
  
  
  

Reply via email to