:
# Guess values for system-dependant variables and create `Makefile'.
# Copyright (C) 1991 Free Software Foundation, Inc.
#
# seriously truncated & heavily modified version - aeb, Dec. 1994
#
# Usage:
#   configure -ask		(ask all questions)
# As soon as some other option is specified, configure will not ask questions.
#   configure -d[efault]	(language=en)
#   configure +suid             (make man suid)
#   configure +lang de,en,nl,pt	(language(s) as specified)
#				("all" will specify all available languages)
#   configure +fsstnd		(follow FSSTND)
#
trap 'rm -f conftest conftest.c; exit 1' 1 3 15

set +u # Make sure unset variables are ok.

if [ $# = 0 ]; then
  echo "usage: configure -ask"
  echo "   or: configure [-d|-default] [+suid] [+fsstnd] [+lang {en,nl,de,pt|all}]"
  exit 1
fi

default=true

for arg in $*; do
  if [ x$setlang = xtrue ]
  then
    case $arg in
      all)
	languages="??"
	;;
      *)
	languages=`echo $arg | sed -e 's/,/ /g'`
    esac
    setlang=false
  else
    case $arg in
      -default | -d)
	  ;;
      -ask | -a)
	  default=
	  ;;
      +lang)
	  setlang=true
	  ;;
      +suid)
	  suid=true
	  ;;
      +fsstnd)
	  fsstnd=true
	  ;;
      *)
	  echo "usage: configure [-d|-default] [+suid] [+fsstnd] [+lang {en,nl,de,pt|all}]"
	  exit 1
	  ;;
    esac
  fi
done

if test "$RANDOM" = "$RANDOM"; then
  # Plain old Bourne shell.
  echo checking for gcc
  test -z "$CC" -a -n "`gcc 2>&1`" && CC="gcc -O"
else
  # ksh, bash or zsh.  ksh and zsh write "command not found" to stderr.
  echo checking for gcc
  test -z "$CC" && type gcc && CC="gcc -O"
fi

CC=${CC-cc}
INSTALL=${INSTALL-install}
INCLUDEDIR=${INCLUDEDIR-/usr/include}

rm -f conftest conftest.c
compile="$CC $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1"

# Check for various header files.

echo checking for ANSI C header files
echo "#include <stdlib.h>
#include <string.h>
main() { exit(0); strerror(0); }" > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then
  DEFS="$DEFS -DSTDC_HEADERS"
fi
rm -f conftest conftest.c

echo checking for POSIX.1 header files
echo "#include <unistd.h>
main() {
#ifdef _POSIX_VERSION
exit(0);
#else
exit(1);
#endif
}" > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then
  DEFS="$DEFS -DPOSIX"
fi
rm -f conftest conftest.c

echo checking for BSD string and memory functions
echo "#include <strings.h>
main() { exit(0); rindex(0, 0); bzero(0, 0); }" > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then :
  else DEFS="$DEFS -DUSG"
fi
rm -f conftest conftest.c

echo checking whether sys/types.h defines uid_t
echo '#include <sys/types.h>
main() { uid_t x; exit(0); }' > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then :
else
  uid_t=`awk '/pw_uid;/ {print $1}' $INCLUDEDIR/pwd.h`
  DEFS="$DEFS -Duid_t=${uid_t} -Dgid_t=${uid_t}"
fi
rm -f conftest conftest.c

echo checking for Xenix
if test -f /xenix; then
  LIBS="$LIBS -lx"
  case "$DEFS" in
  *SYSNDIR*) ;;
  *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  esac
fi

echo checking how to get alloca
echo '
#ifdef __GNUC__
#define alloca __builtin_alloca
#else
#ifdef sparc
#include <alloca.h>
#else
#ifdef _AIX
 #pragma alloca
#else
char *alloca ();
#endif
#endif
#endif
main() { char *p = (char *) alloca(1); exit(0); }' > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then :
elif test -d /usr/ucblib; then LIBS="$LIBS -L/usr/ucblib -lucb"
elif test -f /usr/lib/libPW.a; then LIBS="$LIBS -lPW"
else DEFS="$DEFS -DALLOCA_MISSING"
fi
rm -f conftest conftest.c

echo checking for nls
echo '#include <nl_types.h>
main() {nl_catd catfd; exit(0); }' > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then :
else
  DEFS="$DEFS -DNONLS"
fi
rm -f conftest conftest.c

echo checking for getopt.h
echo '#include <getopt.h>
#include <stdio.h>
struct option long_opts[] = { { "", no_argument, NULL, 0 } };
main() { exit(0); }' > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then
  manpathoption="--path"
else
  manpathoption="-w"
  DEFS="$DEFS -DNOGETOPT"
fi
rm -f conftest conftest.c

# first determine how to suppress newline on echo command (stolen from
# Perl's Configure) ...

if [ x$default = x ]; then
  echo "Checking echo to see how to suppress newlines..."
  (echo "hi there\c" ; echo " ") >conftest
  if grep c conftest >/dev/null 2>&1 ; then
    echo "...using -n."
    n='-n'
    c=''
  else
    cat <<'EOM'
...using \c
EOM
    n=''
    c='\c'
  fi
  rm -f conftest
# echo $n "Type carriage return to continue.  Your cursor should be here-->$c"
# read ans
fi

# Ask the installer where various things are located.

IFS0="$IFS"
IFS=":$IFS"
for i in /bin:/usr/bin:/usr/ucb:/usr/local/bin:$PATH
do
  case $i in
    /*)
      DEFPATH="$DEFPATH $i"
      ;;
  esac
done
IFS="$IFS0"

if [ x$default = x ]; then
  echo ""
  echo $n "Do you have the nroff source for man pages?  [yes] $c"
  ok=false
  while test "$ok" = "false"
  do
    read yesno
    if test "$yesno" = "" || test "$yesno" = "yes"
    then
      ok=true
      ans=true
    elif test "$yesno" = "no"
    then
      ok=true
      ans=false
    else
      ok=false
      echo "You must enter yes or no"
    fi
  done
else
  echo ""
  echo "Assuming you want to be able to handle the nroff source for man pages."
  ans=true
fi

if test "$ans" = "false"
then
  for i in less cmp
  do
    eval F$i="missing"
    for j in $DEFPATH
    do
      if test -f $j/$i
      then
	eval F$i=$j/$i
      fi
    done
  done
  troff=""
  nroff=""
  eqn=""
  neqn=""
  tbl=""
  col=""
  vgrind=""
  refer=""
  grap=""
  pic=""
  pager="$Fless -s"
  cmp="$Fcmp -s"

  FILTERS="pager cmp"
else
  for i in groff geqn gtbl col vgrind grefer grap gpic less cmp
  do
    eval F$i="missing"
    for j in $DEFPATH
    do
      if test -f $j/$i
      then
	eval F$i=$j/$i
      fi
    done
  done
  troff="$Fgroff -Tps -mandoc"
  nroff="$Fgroff -Tlatin1 -mandoc"
  eqn="$Fgeqn -Tps"
  neqn="$Fgeqn -Tlatin1"
  tbl="$Fgtbl"
  col="$Fcol"
  vgrind="$Fvgrind"
  refer="$Fgrefer"
  grap="$Fgrap"
  pic="$Fgpic"
  pager="$Fless -s"
  cmp="$Fcmp -s"

  FILTERS="troff nroff eqn neqn tbl col vgrind refer grap pic pager cmp"
fi

if [ x$default = x ]; then
  echo ""
  echo "If you don't have one of the following programs, enter \`missing'."
  echo "It's best to enter absolute pathnames so that man won't have to"
  echo "depend on the user's path to work properly.  Default values are"
  echo "given in square brackets.  The answers given are only checked to"
  echo "see if the programs exist, not to see see if the given flags are"
  echo "correct."
  
  for filter in $FILTERS
  do
    found=false
    while test "$found" = "false"
    do
      echo ""
      echo $n "$filter command to use [`eval echo $"$filter"`] $c"
      read tmp
      if test -n "$tmp"
      then
        if test "$tmp" = "missing"
        then
          if test "$filter" = "pager"
          then
            found=false
            echo "You must have a pager!"
          else
            found=true
            eval $filter=""
          fi
        elif test -f `echo $tmp | awk '{print $1}'`
        then
          found=true
          eval $filter=\""$tmp"\"
        else
          found=false
          echo ""
          echo "`echo $tmp | awk '{print $1}'` doesn't seem to exist!  Try again or enter \`missing'"
        fi
      elif test `eval echo $"$filter" | awk '{print $1}'` = "missing"
      then
        found=true
        eval $filter=""
      elif test -f `eval echo $"$filter" | awk '{print $1}'`
      then
        found=true
      else
        found=false
        echo ""
        echo "`eval echo $"$filter" | awk '{print $1}'` doesn't seem to exist!  Try again or enter \`missing'"
      fi
    done
  done
else
  echo ""
  echo "Assuming the following ways to invoke the various commands and filters":
  for filter in $FILTERS
  do
    echo "$filter command:	`eval echo $"$filter"`"
    if test `eval echo $"$filter" | awk '{print $1}'` = "missing"
    then
      eval $filter=""
    fi
  done
fi

case $nroff in
  *groff*)
    echo ""
    echo "It seems that no col is needed, since you use groff."
    pcol=
    nocol="# " ;;
  *)
    pcol=$col
    nocol= ;;
esac
  
# How should man be installed?

# prefix="/usr/local"
prefix="/usr"
bindir="bin"
libdir="lib"
mandir="man"

if [ x$default = x ]; then
  for d in bindir libdir mandir
  do
    case $d in
      bindir)
        echo ""
        echo $n "Where should executables be installed?  [$prefix/${bindir}] $c" ;;
      libdir)
        echo ""
        echo $n "Where should man.config be installed?  [$prefix/${libdir}] $c" ;;
      mandir)
        echo ""
        echo $n "Where should man pages be installed? [$prefix/${mandir}] $c" ;;
    esac
    dd=`eval echo $"$d"`
    dir=$prefix/$dd
    ok=false
    while test "$ok" = "false"
    do
      read tmpdir
      if test "$tmpdir" = "" && test "$dir" != ""
      then
        if test -d $dir
        then
          ok=true
          eval $d=$dir
        else
          ok=false
          echo ""
          echo "$dir doesn't seem to exist!  Try again!"
        fi
      elif test -d "$tmpdir"
      then
        ok=true
        eval $d=$tmpdir
        newprefix=`echo $tmpdir | sed -e "s:/$dd::"`
        if test "$tmpdir" = "$newprefix/$dd"
        then
  	prefix=$newprefix
        fi
      else
        ok=false
        echo ""
        echo "$tmpdir doesn't seem to exist!  Try again!"
      fi
    done
  done

  tmpext=1
  echo ""
  echo $n "What extension should installed man(1) pages have? [${tmpext}] $c"
  read man1ext
  if test "$man1ext" = ""; then man1ext=$tmpext; fi

  tmpext=5
  echo ""
  echo $n "What extension should installed man(5) pages have? [${tmpext}] $c"
  read man5ext
  if test "$man5ext" = ""; then man5ext=$tmpext; fi
else
  bindir=$prefix/$bindir
  libdir=$prefix/$libdir
  mandir=$prefix/$mandir
  echo ""
  echo "Assuming that binaries go to $bindir, the configuration file"
  echo "goes to $libdir, and the man pages to $mandir/man*."
  man1ext=1
  man5ext=5
fi

if [ x$fsstnd = x ]; then
  if [ x$default = x ]; then
    echo ""
    echo $n "Do you want to put the cat pages under /var/catman? [no] $c"
    ok=false
    while test "$ok" = "false"
    do
      read yesno
      if test "$yesno" = "" || test "$yesno" = "no"
      then
        ok=true
        ans=false
      elif test "$yesno" = "yes"
      then
        ok=true
        ans=true
      else
        ok=false
        echo "You must enter yes or no"
      fi
    done
  else
    echo ""
    if [ -d /var/catman ]; then
      ans=true
      echo "Using /var/catman for cat pages, following FSSTND."
    else
      ans=false
      echo "Using /usr/man/cat* (if that exists) for cat pages."
    fi
  fi
else
  ans=true
fi

if [ $ans = true ]; then
  fsstnd=
else
  fsstnd="# "
fi

if [ x$default = x ]; then
  echo ""
  echo $n "Do you want to install non-english man pages? [no] $c"
  ok=false
  while test "$ok" = "false"
  do
    read yesno
    if test "$yesno" = "" || test "$yesno" = "no"
    then
      ok=true
      ans=false
    elif test "$yesno" = "yes"
    then
      ok=true
      ans=true
    else
      ok=false
      echo "You must enter yes or no"
    fi
  done
else
  if [ "x$languages" = x ]; then
    echo ""
    echo "Assuming that you do not want to install non-english man pages."
  fi
  ans=false
fi

if test "$ans" = "true"
then
  cd man
  languages=""
  for i in ??; do
    langname=`cat $i.txt`
    echo $n "Install $langname pages? [no] $c"
    ok=false
    while test "$ok" = "false"
    do
      read yesno
      if test "$yesno" = "" || test "$yesno" = "no"
      then
        ok=true
        ans=false
      elif test "$yesno" = "yes"
      then
        ok=true
        ans=true
      else
        ok=false
        echo "You must enter yes or no"
      fi
    done
    if test "$ans" = "true"
    then
      languages="$languages $i"
    fi
  done
  cd ..
  if [ "x$languages" = x ]; then echo "Not installing any man pages, then."; fi
else
  if [ "x$languages" = x ]
  then
    languages="en"
  fi
fi

if [ "x$languages" != x -a "x$languages" != xen ]
then
  deflocalepath=`echo $NLSPATH:/usr/lib/locale/%N/%L | sed 's/:/ /g'`
  for i in deflocalepath; do
    if [ x$deflocale = x ]; then
      tstdir=`echo $i | sed -e 's/%N//; s/%L//'`
      if [ -f $tstdir ]; then
	deflocale=$i
      else
	tstdir=`echo $i | sed -e 's/%N/*/; s/%L/*/'`
	if [ -f $tstdir ]; then
	  deflocale=$i
	fi
      fi
    fi
  done
  if [ x$deflocale = x ]; then
    deflocale="/usr/lib/locale/%N/%L"
  fi
  if [ x$default = x ]; then
    echo ""
    echo $n "Do you want to install non-english message catalogs for man? [yes] $c"
    ok=false
    while test "$ok" = "false"
    do
      read yesno
      if test "$yesno" = "" || test "$yesno" = "yes"
      then
        ok=true
        ans=true
      elif test "$yesno" = "no"
      then
        ok=true
        ans=false
      else
        ok=false
        echo "You must enter yes or no"
      fi
    done
    if [ $ans = true ]; then
      echo $n "Where? [$deflocale] $c"
      read locale
      if [ x$locale = x ]; then
        locale=$deflocale
      fi
    else
      locale=
    fi
  else
    locale=$deflocale
  fi
fi

if [ x$suid = x ]; then
  if [ x$default = x ]; then
    echo ""
    echo "Do you want to install man setuid or setgid to some user"
    echo $n "who owns all the man pages?  [no] $c"
    ok=false
    while test "$ok" = "false"
    do
      read yesno
      if test "$yesno" = "" || test "$yesno" = "no"
      then
        ok=true
        ans=false
      elif test "$yesno" = "yes"
      then
        ok=true
        ans=true
      else
        ok=false
        echo "You must enter yes or no"
      fi
    done
  else
    echo "Assuming that you do not want man to be suid."
    echo "(But you can always do _chown man man; chmod 04755 man_ later.)"
    ans=false
  fi
else
  ans=true
fi

if test "$ans" = "true"
then
  man_user=man
  man_group=man
  man_mode=6755
  if [ x$default = x ]; then
    echo ""
    echo $n "What owner should man have? [${man_user}] $c"
    read user
    if test "$user" != ""; then man_user=$user; fi
    echo ""
    echo $n "What group should man have? [${man_group}] $c"
    read group
    if test "$group" != ""; then man_group=$group; fi
    echo ""
    echo $n "What mode should the installed man have? [${man_mode}] $c"
    read mode
    if test "$mode" != ""; then man_mode=$mode; fi
  fi
  man_install_flags="-m $man_mode -o $man_user -g $man_group"
fi

# What sections do we anticipate?

tmpsections="1 2 3 4 5 6 7 8 9 tcl n l p o"

if [ x$default = x ]; then
  echo ""
  echo "Enter the man page sections your system uses, separated by"
  echo "spaces, and in the order they should be searched."
  echo $n "[${tmpsections}] $c"
  read sects
  if test "$sects" != ""; then tmpsections="$sects"; fi
else
  echo "Setting the default section search order to $tmpsections."
fi

for sect in $tmpsections
do
  if [ x$sections = x ]; then
    sections=$sect
  else
    sections=$sections:$sect
  fi
done

if test "$nroff" != ""
then
  if [ x$default = x ]; then
    echo ""
    echo $n "Compress formatted pages? [yes] $c"
    ok=false
    while test "$ok" = "false"
    do
      read yesno
      if test "$yesno" = "" || test "$yesno" = "yes"
      then
        ok=true
        ans=true
      elif test "$yesno" = "no"
      then
        ok=true
        ans=false
      else
        ok=false
        echo "You must enter yes or no"
      fi
    done
  else
    echo ""
    echo "Assuming that formatted pages should be compressed."
    ans=true
  fi

  if test "$ans" = "true"
  then
    DO_COMPRESSION=true
    compress=
    for i in gzip compress freeze yabba
    do
      eval F$i=missing
      for j in $DEFPATH
      do
        if test -f $j/$i
        then
	  eval F$i=$j/$i
	  if [ x$compress = x ]; then compress=$j/$i; fi
        fi
      done
    done

    if [ x$default = x ]; then
      echo ""
      echo "What program should be used to compress the formatted pages?"
      echo $n "Note that it must work as a filter! [${compress}] $c"
      found=false
      while test "$found" = "false"
      do
        read tmp
        if test -n "$tmp"
        then
          if test -f `echo $tmp | awk '{print $1}'`
          then
            found=true
            compress=$tmp
          else
            found=false
            echo ""
            echo "`echo $tmp | awk '{print $1}'` doesn't seem to exist!  Try again!"
          fi
        elif test -f `echo "$compress" | awk '{print $1}'`
        then
          found=true
        else
          found=false
          echo ""
          echo "`echo "$compress" | awk '{print $1}'` doesn't seem to exist!  Try again!"
        fi
      done
    else
      if [ x$compress = x ]
      then
	DO_COMPRESSION=false
	echo "Could not find any compression programs."
      else
        echo "Using $compress for compression."
      fi
    fi

    case $compress in
      *gzip*) ext=".gz" ;;
      *compress*) ext=".Z" ;;
      *freeze*) ext=".F" ;;
      *yabba*) ext=".Y" ;;
      *) ext="" ;;
    esac
    if [ x$default = x ]; then
      echo ""
      echo "What extension should be added to"
      if test "$ext" = ""
      then
        echo "compressed files?"
      else
        echo $n "compressed files?  [${ext}] $c"
      fi
      ok=false
      while test "$ok" = "false"
      do
        read tmp_ext
        if test "$tmp_ext" = "" && test "$ext" != ""
        then
          ok=true
          compress_ext=$ext
        elif test "$tmp_ext" != ""
        then
          ok=true
          compress_ext=$tmp_ext
        fi
      done
    else
      compress_ext=$ext
    fi
  else
    DO_COMPRESSION=false
  fi
fi

# unconditionally handle uncompression
UNCOMPRESSORS="gunzip zcat fcat unyabba"
for i in $UNCOMPRESSORS
do
  eval F$i=missing
  for j in $DEFPATH
  do
    if test -f $j/$i
    then
      eval F$i=$j/$i
    fi
  done
done
gunzip="$Fgunzip -c"
zcat="$Fzcat"
fcat="$Ffcat"
unyabba="$Funyabba"

if [ x$default = x ]; then
  echo ""
  echo "Now let us look at programs for uncompressing compressed man pages."
  echo ""
  echo "If you don't have one of the following programs, enter \`missing'."
  echo "It's best to enter absolute pathnames so that man won't have to"
  echo "depend on the user's path to work properly.  Default values are"
  echo "given in square brackets.  The answers given are only checked to"
  echo "see if the programs exist, not to see see if the given flags are"
  echo "correct."
  for filter in $UNCOMPRESSORS
  do
    found=false
    while test "$found" = "false"
    do
      echo ""
      case $filter in
	gunzip)
	  echo "Command to use for .gz files (standard gzip)"
	  echo $n "[`eval echo $"$filter"`] $c" ;;
        zcat)
          echo "Command to use for .Z files (standard compress)"
          echo $n "[`eval echo $"$filter"`] $c" ;;
        fcat)
          echo "Command to use for .F files (freeze/melt from net posting)"
          echo $n "[`eval echo $"$filter"`] $c" ;;
        unyabba)
          echo "Command to use for .Y files (yabba/unyabba from net posting)"
          echo $n "[`eval echo $"$filter"`] $c" ;;
        esac
      read tmp
      if test -n "$tmp"
      then
        if test "$tmp" = "missing"
        then
          found=true
          eval $filter=""
        elif test -f `echo $tmp | awk '{print $1}'`
        then
          found=true
          eval $filter="$tmp"
        else
          found=false
          echo ""
          echo "`echo $tmp | awk '{print $1}'` doesn't seem to exist!  Try again or enter \`missing'"
        fi
      elif test `eval echo $"$filter" | awk '{print $1}'` = "missing"
      then
        found=true
        eval $filter=""
      elif test -f `eval echo $"$filter" | awk '{print $1}'`
      then
        found=true
      else
        found=false
        echo ""
        echo "`eval echo $"$filter" | awk '{print $1}'` doesn't seem to exist!  Try again or enter \`missing'"
      fi
    done
  done
else
  echo ""
  echo "Assuming the following ways to invoke the various decompressors:"
  for filter in $UNCOMPRESSORS
  do
    echo "$filter command:   	`eval echo $"$filter"`"
    if test `eval echo $"$filter" | awk '{print $1}'` = "missing"
    then
      eval $filter=""
    fi
  done
fi

if test "$DO_COMPRESSION" = "true"
then
  DEFS="$DEFS -DDO_COMPRESS"
fi

man=$bindir/man
apropos=$bindir/apropos
whatis=$bindir/whatis
makewhatis=$libdir/makewhatis
man_config_file=$libdir/man.config

if [ x$locale = x ]; then
  sed -e 's/%.*//' < Makefile.in > Makefile
else
  sed -e 's/%//' < Makefile.in > Makefile
fi

# some definitions to avoid extensive quoting in the script below
allargs='$@'
infiles='$infiles'
infile='$infile'
cb='$cb'
cs='$cs'
ce='$ce'
mancomment='.\\\"'

# Note: the script below only works when none of the variables
# contains a comma.

cat > conf_script << EOS
#!/bin/sh
infiles=$allargs
trap 'rm -f $infiles; exit 1' 1 3 15

echo ""
for infile in $infiles
do
  case $infile in
  *.h)
    cb="/*"; cs=" *"; ce=" */";;
  *.$man1ext|*.$man5ext)
    cb=$mancomment; cs=$mancomment; ce=$mancomment;;
  *)
    cb="#"; cs="#"; ce="#";;
  esac
  echo "$cb"                                                    > $infile
  echo "$cs Generated automatically from $infile.in by the"     >> $infile
  echo "$cs configure script."                                  >> $infile
  echo "$ce"                                                    >> $infile
  echo "Creating $infile from $infile.in"
  sed -e '
s,@CC@,$CC,
s,@INSTALL@,$INSTALL,
s,@DEFS@,$DEFS,
s,@LIBS@,$LIBS,
s,@LIBOBJS@,$LIBOBJS,
s,@troff@,$troff,
s,@nroff@,$nroff,
s,@eqn@,$eqn,
s,@neqn@,$neqn,
s,@tbl@,$tbl,
s,@nocol@,$nocol,
s,@pcol@,$pcol,
s,@col@,$col,
s,@vgrind@,$vgrind,
s,@refer@,$refer,
s,@grap@,$grap,
s,@pic@,$pic,
s,@fcat@,$fcat,
s,@zcat@,$zcat,
s,@gunzip@,$gunzip,
s,@unyabba@,$unyabba,
s,@compress@,$compress,
s,@compress_ext@,$compress_ext,
s,@pager@,$pager,
s,@cmp@,$cmp,
s,@bindir@,$bindir,
s,@libdir@,$libdir,
s,@locale@,$locale,
s,@fsstnd@,$fsstnd,
s,@mandir@,$mandir,
s,@man1ext@,$man1ext,g
s,@man5ext@,$man5ext,g
s,@man_install_flags@,$man_install_flags,
s,@man_user@,$man_user,
s,@languages@,$languages,
s,@man@,$man,
s,@apropos@,$apropos,
s,@whatis@,$whatis,
s,@makewhatis@,$makewhatis,
s,@man_config_file@,$man_config_file,
s,@manpathoption@,$manpathoption,
s/@sections@/$sections/
' $infile.in >> $infile
done
EOS

chmod +x conf_script

echo ""
echo 'Created Makefile and conf_script. Now do "make" and "make install".'
echo ""
