#! /bin/sh
# configure - configuration script for retawq 0.2.6b
#
# This configuration script file has been auto-generated by
# itchconfig 0.0.4 <http://itchconfig.sourceforge.net/>.
# Copyright (C) 2002 Arne Thomassen <arne@arne-thomassen.de>
# This configuration script file is free software WITHOUT ANY WARRANTY;
# you are given unlimited permission to copy, distribute and modify this file,
# as long as this notice is kept intact and you indicate file modifications.

exec 5>/dev/null
if test -n "${ZSH_VERSION+set}" && (emulate sh) >&5 2>&1; then
  emulate sh
  NULLCMD=:
elif test -n "${BASH_VERSION+set}" && (set -o posix) >&5 2>&1; then
  set -o posix
fi

ic_nl='
'
IFS=" 	$ic_nl"
export IFS

if (FOO=FOO; unset FOO) >&5 2>&1; then
  ic_unset=unset
else
  ic_unset=false
fi

$ic_unset ENV MAIL MAILPATH
PS1='$ '
PS2='> '
PS4='+ '

for i_x in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_TIME
do
  if (set +x; test -n "`(eval $i_x=C; export $i_x) 2>&1`"); then
    eval $i_x=C; export $i_x
  else
    $ic_unset $i_x
  fi
done

ic_me=`echo "$0" | sed 's,.*[/],,'`
ic_version='0.0.4'
ic_package_name='retawq'
ic_package_version='0.2.6b'
ic_fatal_error=echo
ic_show_message=echo
ic_show_info=false

ic_site_file=
ic_site_next=
i_site="${ITCHCONFIG_SITE-}"
if test -n "$i_site"; then
  for i_x in '-retawq' ''
  do
    i_s=`echo "$i_site" | sed "s,%P%,$i_x,g"`
    if test -n "$i_s" && test -f "$i_s"; then
      ic_site_file="$i_s"
      ic_site_next=init1
      break
    fi
  done
fi

if test -n "$ic_site_file" && test "x$ic_site_next" = xinit1; then
  ic_site_stage=init1
  ic_site_next=
  . "$ic_site_file"
fi

ic_AZ=ABCDEFGHIJKLMNOPQRSTUVWXYZ
ic_az=abcdefghijklmnopqrstuvwxyz
ic_Az=$ic_AZ$ic_az
ic_Az09=${ic_Az}0123456789

# Override env vars?
for i_arg
do
  case $i_arg in
  [_$ic_Az]*=*)
  i_var=`expr "x$i_arg" : 'x\([^=]*\)='`
  i_val=`expr "x$i_arg" : 'x[^=]*=\(.*\)' | sed "s/'/'\\\\\\\\''/g"`
  eval "$i_var='$i_val'"; export $i_var
  ;;
  esac
done

SHELL="${ITCHCONFIG_SHELL-/bin/sh}"
export SHELL
ic_makedir="${MKDIRPROG-mkdir}"
if test "${PATH_SEPARATOR+set}" != set; then
  PATH_SEPARATOR=:
fi
$ic_unset CDPATH

case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  *c*,-n*) ic_ECHO_N= ic_ECHO_C='
' ic_ECHO_T='	' ;;
  *c*,*  ) ic_ECHO_N=-n ic_ECHO_C= ic_ECHO_T= ;;
  *)      ic_ECHO_N= ic_ECHO_C='\c' ic_ECHO_T= ;;
esac

ic_option_tg=ncurses
ic_option_textmodemouse=1
ic_option_i18n=0
ic_option_news=1
ic_option_cookies=1
ic_option_local_cgi=0
ic_option_ipv6=0
ic_option_birtcfg=0
ic_option_tls=0
ic_option_execext=0
ic_option_ced=1
ic_option_threading=1
if echo a | (grep -E '(a|b)') >&5 2>&1
  then ic_egrep='grep -E'
  else ic_egrep='egrep'
fi
ic_path_archprefix='${ic_path_prefix}'
ic_path_prefix=/usr/local
ic_path_bin='${ic_path_archprefix}/bin'
ic_path_man='${ic_path_prefix}/man'
ic_path_doc='${ic_path_prefix}/doc/retawq'
ic_path_locale='${ic_path_prefix}/share/locale'
ic_installs=
ic_program_prefix=
ic_program_suffix=
ic_binaries=
ic_CC=${CC-gcc}
ic_CFLAGS0="${CFLAGS-}"
ic_CFLAGS="$ic_CFLAGS0"
ic_CPPFLAGS0="${CPPFLAGS-}"
if test "x$ic_CC" = "xgcc"; then
  ic_CFLAGS="-O2 $ic_CFLAGS"
fi
if test "${LDFLAGS+set}" = set; then
  ic_LDFLAGS="$LDFLAGS"
else
  ic_LDFLAGS='-s'
fi
ic_objext="${OBJEXT-o}"


if test -n "$ic_site_file" && test "x$ic_site_next" = xinit2; then
  ic_site_stage=init2
  ic_site_next=
  . "$ic_site_file"
fi

# Parse args
i_premature_exit=a
for i_arg
do

i_aval=`expr "x$i_arg" : 'x[^=]*=\(.*\)'`

case $i_arg in

  --set-tg=*)
  ic_option_tg="$i_aval"
  ;;

  --enable-textmodemouse)
  ic_option_textmodemouse=1
  ;;

  --disable-textmodemouse)
  ic_option_textmodemouse=0
  ;;

  --enable-i18n)
  ic_option_i18n=1
  ;;

  --disable-i18n)
  ic_option_i18n=0
  ;;

  --enable-news)
  ic_option_news=1
  ;;

  --disable-news)
  ic_option_news=0
  ;;

  --enable-cookies)
  ic_option_cookies=1
  ;;

  --disable-cookies)
  ic_option_cookies=0
  ;;

  --enable-local-cgi)
  ic_option_local_cgi=1
  ;;

  --disable-local-cgi)
  ic_option_local_cgi=0
  ;;

  --enable-ipv6)
  ic_option_ipv6=1
  ;;

  --disable-ipv6)
  ic_option_ipv6=0
  ;;

  --enable-birtcfg)
  ic_option_birtcfg=1
  ;;

  --disable-birtcfg)
  ic_option_birtcfg=0
  ;;

  --set-tls=*)
  ic_option_tls="$i_aval"
  ;;

  --set-execext=*)
  ic_option_execext="$i_aval"
  ;;

  --set-ced=*)
  ic_option_ced="$i_aval"
  ;;

  --set-threading=*)
  ic_option_threading="$i_aval"
  ;;

  --path-archprefix=*)
  ic_path_archprefix="$i_aval"
  ;;

  --path-prefix=*)
  ic_path_prefix="$i_aval"
  ;;

  --path-bin=*)
  ic_path_bin="$i_aval"
  ;;

  --path-man=*)
  ic_path_man="$i_aval"
  ;;

  --path-doc=*)
  ic_path_doc="$i_aval"
  ;;

  --path-locale=*)
  ic_path_locale="$i_aval"
  ;;

  --program-prefix=*)
  ic_program_prefix="$i_aval"
  ;;

  --program-suffix=*)
  ic_program_suffix="$i_aval"
  ;;

  --verbose)
  ic_show_info=echo
  ;;

  --quiet)
  ic_fatal_error=false
  ic_show_message=false
  ;;

  --version | -V)
  i_premature_exit=b
  break
  ;;

  --report)
  i_premature_exit=c
  break
  ;;

  --help)
  i_premature_exit=d
  break
  ;;

  --site* | [_$ic_Az]*=*)
  ;;

  *)
  $ic_fatal_error "$ic_me: unrecognized option: $i_arg. Try \"./$ic_me --help\"!" >&2
  { (exit 1); exit 1; }
  ;;

esac
done

case $i_premature_exit in
a)
  ;;
b)
  cat <<EOF
$ic_me - configuration script for retawq 0.2.6b
This configuration script file has been auto-generated by
itchconfig 0.0.4 <http://itchconfig.sourceforge.net/>.
Copyright (C) 2002 Arne Thomassen <arne@arne-thomassen.de>
This configuration script file is free software WITHOUT ANY WARRANTY;
you are given unlimited permission to copy, distribute and modify this file,
as long as this notice is kept intact and you indicate file modifications.
EOF
  { :; exit 0; }
  ;;
c)
  echo "$ic_me report for retawq 0.2.6b (by itchconfig 0.0.4):"
  if test -f "./config.guess"; then
    i_xv="`./config.guess --version 2>&5 | sed 1q`"
    i_x="`./config.guess 2>&5`"
    echo "config.guess ($i_xv) says: $i_x"
  fi
  i_x="`uname -a 2>&5`"
  echo "uname -a says: $i_x"
  i_x="`make --version 2>&5 | sed 1q`"
  echo "make version: $i_x"
  i_x="`$ic_CC --version 2>&5 | sed 1q`"
  echo "C compiler: $ic_CC, $i_x"
  { :; exit 0; }
  ;;
d)
  cat <<EOF
\`$ic_me' configures retawq 0.2.6b to adapt to your computer.
Script generated by itchconfig 0.0.4 <http://itchconfig.sourceforge.net/>.
Usage: ./$ic_me [option] ...
Default values are shown in brackets below.

General Options:
--verbose      print more information about what happens
--quiet        don't print any messages
--version, -V  print the version information and exit
--report       print a little configuration report and exit
--help         print this help and exit

Installation Options:
--program-prefix=...  standard program prefix [NONE]
--program-suffix=...  standard program suffix [NONE]

Installation Paths:
--path-archprefix=PATH  path prefix for architecture-dependent files [PREFIX]
--path-prefix=PATH      path prefix for architecture-independent files
                        [/usr/local]
--path-bin=PATH         normal programs [ARCHPREFIX/bin]
--path-man=PATH         manual documentation [PREFIX/man]
--path-doc=PATH         HTML documentation [PREFIX/doc/retawq]
--path-locale=PATH      natural language texts [PREFIX/share/locale]

Package Options:
--disable-FEATURE       the opposite of --enable-FEATURE
--set-tg=VALUE          text/graphics mode (curses, ncurses, ...) [ncurses]
--enable-textmodemouse  text-mode mouse [ENABLED]
--enable-i18n           internationalization [DISABLED]
--enable-news           news/NNTP support [ENABLED]
--enable-cookies        HTTP cookies [ENABLED]
--enable-local-cgi      local CGI scripts [DISABLED]
--enable-ipv6           IPv6 support [DISABLED]
--enable-birtcfg        built-in run-time configuration file [DISABLED]
--set-tls=VALUE         TLS support (0=none, 1=GnuTLS, 2=OpenSSL) [0]
--set-execext=VALUE     execution of "external" programs [0]
--set-ced=VALUE         quality of character entity display (0..1) [1]
--set-threading=VALUE   threading (0=none, 1=pthreads, 2=Linux clone()) [1]
EOF
  { :; exit 0; }
  ;;
esac

if test -f "parser.c"; then :; else
  $ic_fatal_error "$ic_me: configuration script launched from wrong directory!" >&2
  { (exit 1); exit 1; }
fi


# Make sure that paths are absolute
for i_path in ic_path_archprefix ic_path_prefix ic_path_bin ic_path_man \
              ic_path_doc ic_path_locale
do
eval ic_val=$`echo $i_path`
case $ic_val in
  [/$]*)
  ;;
  *)
  $ic_fatal_error "$ic_me: $i_path must be absolute, but is \"$ic_val\"" >&2
  { (exit 1); exit 1; }
  ;;
esac
done


# Create a temporary directory
{ trap 'exit_status=$?; rm -rf $ic_tempdir && exit $exit_status' 0
  trap '{ (exit 1); exit 1; }' 1 2 13 15
}
: ${TMPDIR=/tmp}
{ ic_tempdir=`(umask 077 && mktemp -d -q "$TMPDIR/icXXXXXX") 2>&5` &&
  test -n "$ic_tempdir" && test -d "$ic_tempdir"
} ||
{ ic_tempdir=$TMPDIR/ic$$-$RANDOM
  (umask 077 && $ic_makedir $ic_tempdir)
} ||
{
  $ic_fatal_error "$ic_me: cannot create a temporary directory in $TMPDIR" >&2
  { (exit 1); exit 1; }
}

$ic_show_info "Configuring retawq 0.2.6b..."
ic_testfile=$ic_tempdir/test
ic_substfile=$ic_tempdir/subst
exec 8>$ic_substfile
ic_int_config_h=$ic_tempdir/int_config.h
echo >$ic_int_config_h
ic_c_definc='#include <stdio.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# if HAVE_STDLIB_H
#  include <stdlib.h>
# endif
#endif
#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
#  include <memory.h>
# endif
# include <string.h>
#endif
#if HAVE_STRINGS_H
# include <strings.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#else
# if HAVE_STDINT_H
#  include <stdint.h>
# endif
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
'

$ic_show_message $ic_ECHO_N "Checking how to run the C pre-processor... $ic_ECHO_C"
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -n "$CPP"; then
  ic_CPP="$CPP"
else
  ic_CPP=
cat >$ic_testfile.c <<__IC_EOF__
#include <assert.h>
  Syntax error
__IC_EOF__
  for CPP in "$ic_CC -E" "$ic_CC -E -traditional-cpp" /lib/cpp
  do
    if $CPP $ic_CPPFLAGS0 $ic_testfile.c >&5 2>&1; then
      ic_CPP="$CPP"
      break
    fi
  done
fi
$ic_show_message "${ic_ECHO_T}$ic_CPP"
if test -z "$ic_CPP"; then
  $ic_fatal_error "$ic_me: cannot find out how to run the C pre-processor; set the environment variable CPP and try again" >&2
  { (exit 1); exit 1; }
fi
$ic_show_message $ic_ECHO_N "Checking for ANSI-compliant C header files... $ic_ECHO_C"
cat >$ic_testfile.c <<__IC_EOF__
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  i_result=1
fi
ic_c_stdc=$i_result

case $ic_c_stdc in
1)
cat >$ic_testfile.c <<__IC_EOF__
#include <string.h>
__IC_EOF__
if $ic_CPP $ic_CPPFLAGS0 $ic_testfile.c 2>&5 | $ic_egrep "memchr" >&5 2>&5; then
  i_result=1
else
  i_result=0
fi
case $i_result in
  0) ic_c_stdc=0 ;;
esac
;;
esac

case $ic_c_stdc in
1)
cat >$ic_testfile.c <<__IC_EOF__
#include <stdlib.h>
__IC_EOF__
if $ic_CPP $ic_CPPFLAGS0 $ic_testfile.c 2>&5 | $ic_egrep "free" >&5 2>&5; then
  i_result=1
else
  i_result=0
fi
case $i_result in
  0) ic_c_stdc=0 ;;
esac
;;
esac

case $ic_c_stdc in
1)
cat >$ic_testfile.c <<__IC_EOF__
#include <ctype.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') || ('j' <= (c) && (c) <= 'r') || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif

#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main()
{ int i;
  for (i = 0; i < 256; i++)
    if (XOR(islower(i), ISLOWER(i))
        || toupper(i) != TOUPPER(i))
      return(2);
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 $ic_LDFLAGS $ic_testfile.$ic_objext $LIBS -o $ic_testfile >&5 2>&5; then
    i_result=1
    $ic_testfile >&5 2>&5
    i_x=$?
    if test "x$i_x" != "x0"; then
      i_result=0
    fi
  fi
fi
case $i_result in
  0) ic_c_stdc=0 ;;
esac
;;
esac

case $ic_c_stdc in
  0) i_x=no ;;
  *) i_x=yes ;;
esac
$ic_show_message "${ic_ECHO_T}$i_x"
echo "#define STDC_HEADERS $ic_c_stdc" >>$ic_int_config_h

# IC_C_HEADERS

for i_header in inttypes.h memory.h stdint.h stdlib.h string.h strings.h sys/param.h sys/stat.h sys/types.h unistd.h
do
i_r=`echo "$i_header" | sed "y,$ic_az,$ic_AZ,;s,[^_${ic_Az09}],_,g"`
i_resultid='HAVE_'${i_r}
$ic_show_message $ic_ECHO_N "Checking whether the C header file $i_header exists... $ic_ECHO_C"
cat >$ic_testfile.c <<__IC_EOF__
#include <$i_header>
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  i_result=1
fi
case $i_result in
  0) i_x=no ;;
  *) i_x=yes ;;
esac
$ic_show_message "${ic_ECHO_T}$i_x"
echo "#define $i_resultid $i_result" >>$ic_int_config_h
done

ic_makefile=$ic_tempdir/Makefile
exec 6>$ic_makefile
cat >&6 <<EOF
# This Makefile for retawq 0.2.6b has been auto-generated by      -*-Makefile-*-
# itchconfig 0.0.4 <http://itchconfig.sourceforge.net/>.
# Copyright (C) 2002 Arne Thomassen <arne@arne-thomassen.de>
# This Makefile is free software WITHOUT ANY WARRANTY;
# you are given unlimited permission to copy, distribute and modify this file,
# as long as this notice is kept intact and you indicate file modifications.

all: default-target
SHELL=$SHELL

EOF

ic_config_h=$ic_tempdir/config.h
exec 7>$ic_config_h
cat >&7 <<EOF
/* This config.h file for retawq 0.2.6b has been auto-generated by       -*-C-*-
   itchconfig 0.0.4 <http://itchconfig.sourceforge.net/>.
   Copyright (C) 2002 Arne Thomassen <arne@arne-thomassen.de>
   This config.h file is free software WITHOUT ANY WARRANTY;
   you are given unlimited permission to copy, distribute and modify this file,
   as long as this notice is kept intact and you indicate file modifications.
*/

EOF

cat >&7 <<EOF
#define RETAWQ_VERSION "0.2.6b"
EOF
ic_binaries="$ic_binaries retawq"
ic_binary_retawq_libs=
ic_binary_retawq_c_sources=
ic_binary_retawq_cflags="$ic_CFLAGS"

ic_binary_retawq_c_sources="$ic_binary_retawq_c_sources init.c init.h main.c parser.c parser.h resource.c resource.h stuff.c stuff.h"
case "x$ic_option_threading" in
  x0) ;;
  *)
ic_binary_retawq_cflags="$ic_binary_retawq_cflags -D_REENTRANT -D_THREAD_SAFE"
;;
esac
cat >&7 <<EOF
#define USING_CONFIGURE 1
#define OPTION_TG $ic_option_tg
#define OPTION_TEXTMODEMOUSE $ic_option_textmodemouse
#define OPTION_I18N $ic_option_i18n
#define OPTION_NEWS $ic_option_news
#define OPTION_COOKIES $ic_option_cookies
#define OPTION_LOCAL_CGI $ic_option_local_cgi
#define OPTION_IPV6 $ic_option_ipv6
#define OPTION_BIRTCFG $ic_option_birtcfg
#define OPTION_TLS $ic_option_tls
#define OPTION_EXECEXT $ic_option_execext
#define OPTION_CED $ic_option_ced
#define OPTION_THREADING $ic_option_threading
#define CONFIG_KEYMAPS 1
#define OPTION_POP 0
#define OPTION_IMAP 0
#define OPTION_SMTP 0
#define OPTION_TRAP 0
#define OPTION_BUILTIN_DNS 0
#define OPTION_EXECINT 0
#define OPTION_POLL 0
#define CONFIG_MENUS 32767
#define CONFIG_LOCALDIR 2
#define CONFIG_FTPDIR 1
#define CONFIG_RTCONFIG 1
#define CONFIG_SESSIONS 1
#define CONFIG_JUMPS 1
#define CONFIG_CONSOLE 1
#define CONFIG_HTTP 32767
#define CONFIG_FTP 1
#define CONFIG_FINGER 1
#define CONFIG_GOPHER 0
#define CONFIG_ABOUT 32767
#define CONFIG_USER_QUERY 1
#define CONFIG_BLOAT 32767
#define CONFIG_EXTRA 32767
#define CONFIG_WK 32767
#define CONFIG_DISK_CACHE 0
#define CONFIG_HTML 32767
#define CONFIG_PLATFORM 0
#define CONFIG_JAVASCRIPT 0
#define CONFIG_CSS 0
#define CONFIG_DEBUG 0
EOF
{ tool/tgmode --init $ic_option_tg ||
{
$ic_fatal_error "$ic_me: bad OPTION_TG" >&2
{ (exit 1); exit 1; }
:;
}
}
cftg=`tool/tgmode --cftg $ic_option_tg`
cat >&7 <<EOF
#define CONFIG_TG $cftg
EOF
ic_binary_retawq_c_sources="$ic_binary_retawq_c_sources `tool/tgmode --objs $ic_option_tg | sed 's,\.o,\.c,'`"
ic_binary_retawq_libs="$ic_binary_retawq_libs `tool/tgmode --libs $ic_option_tg`"
case "x$ic_option_tls" in
  x0) ;;
  *) ic_binary_retawq_cflags="$ic_binary_retawq_cflags `tool/tlsmode --cflags $ic_option_tls`"
ic_binary_retawq_libs="$ic_binary_retawq_libs `tool/tlsmode --libs $ic_option_tls`"
  ;;
esac


# IC_C_HEADERS_STDC

cat >&7 <<EOF
#define STDC_HEADERS $ic_c_stdc
EOF

# IC_C_HEADERS

for i_header in arpa/inet.h dirent.h errno.h fcntl.h libintl.h limits.h memory.h ndir.h netdb.h netinet/in.h stdarg.h stdlib.h string.h strings.h sys/dir.h sys/ioctl.h sys/ndir.h sys/poll.h sys/select.h sys/socket.h sys/stat.h sys/time.h sys/types.h sys/wait.h termios.h unistd.h varargs.h
do
i_r=`echo "$i_header" | sed "y,$ic_az,$ic_AZ,;s,[^_${ic_Az09}],_,g"`
i_resultid='HAVE_'${i_r}
$ic_show_message $ic_ECHO_N "Checking whether the C header file $i_header exists... $ic_ECHO_C"
cat >$ic_testfile.c <<__IC_EOF__
#include <$i_header>
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  i_result=1
fi
case $i_result in
  0) i_x=no ;;
  *) i_x=yes ;;
esac
$ic_show_message "${ic_ECHO_T}$i_x"
cat >&7 <<EOF
#define $i_resultid $i_result
EOF
done

# IC_C_CONST

$ic_show_message $ic_ECHO_N "Checking whether the C const modifier works... $ic_ECHO_C"
cat >$ic_testfile.c <<__IC_EOF__
int main()
{
#ifndef __cplusplus
  /* Ultrix mips cc rejects this. */
  typedef int charset[2];
  const charset x;
  /* SunOS 4.1.1 cc rejects this. */
  char const *const *ccp;
  char **p;
  /* NEC SVR4.0.2 mips cc rejects this. */
  struct point {int x, y;};
  static struct point const zero = {0,0};
  /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X*
     pointer from another in an arm of an if-expression whose if-part is not a
     constant expression. */
  const char *g = "string";
  ccp = &g + (g ? g-g : 0);
  /* HPUX 7.0 cc rejects these. */
  ++ccp;
  p = (char**) ccp;
  ccp = (char const *const *) p;
  { /* SCO 3.2v4 cc rejects this.  */
    char *t;
    char const *s = 0 ? (char *) 0 : (char const *) 0;
    *t++ = 0;
  }
  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
    int x[] = {25, 17};
    const int *foo = &x[0];
    ++foo;
  }
  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
    typedef const int *iptr;
    iptr p = 0;
    ++p;
  }
  { /* AIX XL C 1.02.0.0 rejects this saying
       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
    struct s { int j; const int *ap[3]; };
    struct s *b; b->j = 5;
  }
  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this. */
    const int foo = 10;
  }
#endif
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  i_result=1
fi
if test "x$i_result" = "x0"; then
$ic_show_message "${ic_ECHO_T}no"
cat >&7 <<EOF
#define const
EOF
else
$ic_show_message "${ic_ECHO_T}yes"
fi

# IC_C_INLINE

$ic_show_message $ic_ECHO_N "Checking whether the C inline modifier works... $ic_ECHO_C"
working_inline=
for keyword in inline __inline__ __inline
do
cat >$ic_testfile.c <<__IC_EOF__
#ifndef __cplusplus
typedef int foo_type;
static $keyword foo_type static_foo_func() { return(0); }
$keyword foo_type foo_func() { return(0); }
#endif
int main()
{ return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  i_result=1
fi
if test "x$i_result" = "x1"; then
  working_inline="$keyword"
  break
fi
done
if test "$working_inline" != "inline"; then
cat >&7 <<EOF
#define inline $working_inline
EOF
fi
$ic_show_message "${ic_ECHO_T}$working_inline"

# IC_C_TYPES

$ic_show_message $ic_ECHO_N "Checking whether the C type gid_t exists... $ic_ECHO_C"
cat >$ic_testfile.c <<__IC_EOF__
#include "int_config.h"
$ic_c_definc
int main()
{ if ((gid_t *) 0) return(0);
  if (sizeof(gid_t)) return(0);
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  i_result=1
fi
if test "x$i_result" = "x0"; then
$ic_show_message "${ic_ECHO_T}no"
cat >&7 <<EOF
typedef int gid_t;
EOF
else
$ic_show_message "${ic_ECHO_T}yes"
fi
$ic_show_message $ic_ECHO_N "Checking whether the C type mode_t exists... $ic_ECHO_C"
cat >$ic_testfile.c <<__IC_EOF__
#include "int_config.h"
$ic_c_definc
int main()
{ if ((mode_t *) 0) return(0);
  if (sizeof(mode_t)) return(0);
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  i_result=1
fi
if test "x$i_result" = "x0"; then
$ic_show_message "${ic_ECHO_T}no"
cat >&7 <<EOF
typedef int mode_t;
EOF
else
$ic_show_message "${ic_ECHO_T}yes"
fi
$ic_show_message $ic_ECHO_N "Checking whether the C type off_t exists... $ic_ECHO_C"
cat >$ic_testfile.c <<__IC_EOF__
#include "int_config.h"
$ic_c_definc
int main()
{ if ((off_t *) 0) return(0);
  if (sizeof(off_t)) return(0);
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  i_result=1
fi
if test "x$i_result" = "x0"; then
$ic_show_message "${ic_ECHO_T}no"
cat >&7 <<EOF
typedef long off_t;
EOF
else
$ic_show_message "${ic_ECHO_T}yes"
fi
$ic_show_message $ic_ECHO_N "Checking whether the C type pid_t exists... $ic_ECHO_C"
cat >$ic_testfile.c <<__IC_EOF__
#include "int_config.h"
$ic_c_definc
int main()
{ if ((pid_t *) 0) return(0);
  if (sizeof(pid_t)) return(0);
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  i_result=1
fi
if test "x$i_result" = "x0"; then
$ic_show_message "${ic_ECHO_T}no"
cat >&7 <<EOF
typedef int pid_t;
EOF
else
$ic_show_message "${ic_ECHO_T}yes"
fi
$ic_show_message $ic_ECHO_N "Checking whether the C type size_t exists... $ic_ECHO_C"
cat >$ic_testfile.c <<__IC_EOF__
#include "int_config.h"
$ic_c_definc
int main()
{ if ((size_t *) 0) return(0);
  if (sizeof(size_t)) return(0);
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  i_result=1
fi
if test "x$i_result" = "x0"; then
$ic_show_message "${ic_ECHO_T}no"
cat >&7 <<EOF
typedef unsigned size_t;
EOF
else
$ic_show_message "${ic_ECHO_T}yes"
fi

# IC_C_FUNCTION_MMAP

$ic_show_message $ic_ECHO_N "Checking whether mmap() works... $ic_ECHO_C"
cat >$ic_testfile.c <<__IC_EOF__
/* Thanks to Mike Haertel and Jim Avera for this test (from GNU autoconf). */
#include "int_config.h"
$ic_c_definc
#include <fcntl.h>
#include <sys/mman.h>

#if !STDC_HEADERS && !HAVE_STDLIB_H
char *malloc();
#endif

/* This mess was copied from the GNU getpagesize.h. */
#if !HAVE_GETPAGESIZE
/* Assume that all systems that can run configure have sys/param.h. */
# if !HAVE_SYS_PARAM_H
#  define HAVE_SYS_PARAM_H 1
# endif

# ifdef _SC_PAGESIZE
#  define getpagesize() sysconf(_SC_PAGESIZE)
# else /* no _SC_PAGESIZE */
#  if HAVE_SYS_PARAM_H
#   include <sys/param.h>
#   ifdef EXEC_PAGESIZE
#    define getpagesize() EXEC_PAGESIZE
#   else /* no EXEC_PAGESIZE */
#    ifdef NBPG
#     define getpagesize() NBPG * CLSIZE
#     ifndef CLSIZE
#      define CLSIZE 1
#     endif /* no CLSIZE */
#    else /* no NBPG */
#     ifdef NBPC
#      define getpagesize() NBPC
#     else /* no NBPC */
#      ifdef PAGESIZE
#       define getpagesize() PAGESIZE
#      endif /* PAGESIZE */
#     endif /* no NBPC */
#    endif /* no NBPG */
#   endif /* no EXEC_PAGESIZE */
#  else /* no HAVE_SYS_PARAM_H */
#   define getpagesize() 8192	/* punt totally */
#  endif /* no HAVE_SYS_PARAM_H */
# endif /* no _SC_PAGESIZE */

#endif /* no HAVE_GETPAGESIZE */

int
main()
{ char *data, *data2, *data3;
  int i, pagesize;
  int fd;

  pagesize = getpagesize();

  /* First, make a file with some known garbage in it. */
  data = (char *) malloc(pagesize);
  if (!data)
    return(1);
  for (i = 0; i < pagesize; ++i)
    *(data + i) = rand();
  umask(0);
  fd = creat("$ic_testfile.mmap", 0600);
  if (fd < 0)
    return(2);
  if (write(fd, data, pagesize) != pagesize)
    return(3);
  close(fd);

  /* Next, try to mmap the file at a fixed address which already has
     something else allocated at it. If we can, also make sure that
     we see the same garbage. */
  fd = open("$ic_testfile.mmap", O_RDWR);
  if (fd < 0)
    return(4);
  data2 = (char *) malloc(2 * pagesize);
  if (!data2)
    return(5);
  data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
  if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
                     MAP_PRIVATE | MAP_FIXED, fd, 0L))
    return(6);
  for (i = 0; i < pagesize; ++i)
    if (*(data + i) != *(data2 + i))
      return(7);

  /* Finally, make sure that changes to the mapped area do not
     percolate back to the file as seen by read(). (This is a bug on
     some variants of i386 svr4.0.) */
  for (i = 0; i < pagesize; ++i)
    *(data2 + i) = *(data2 + i) + 1;
  data3 = (char *) malloc(pagesize);
  if (!data3)
    return(8);
  if (read(fd, data3, pagesize) != pagesize)
    return(9);
  for (i = 0; i < pagesize; ++i)
    if (*(data + i) != *(data3 + i))
      return(10);
  close(fd);
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 $ic_LDFLAGS $ic_testfile.$ic_objext $LIBS -o $ic_testfile >&5 2>&5; then
    i_result=1
    $ic_testfile >&5 2>&5
    i_x=$?
    if test "x$i_x" != "x0"; then
      i_result=0
    fi
  fi
fi
cat >&7 <<EOF
#define HAVE_MMAP $i_result
EOF
case $i_result in
  0) i_x=no ;;
  *) i_x=yes ;;
esac
$ic_show_message "${ic_ECHO_T}$i_x"

# IC_C_FUNCTIONS

for i_func in bcopy bzero dup2 getcwd gettimeofday memcpy memset putenv setenv sigaction sigdelset sigfillset sigprocmask strcasecmp strchr strerror strncasecmp strrchr strstr uname wait3 waitpid
do
i_r=`echo "$i_func" | sed "y,$ic_az,$ic_AZ,;s,[^_${ic_Az09}],_,g"`
i_resultid='HAVE_'${i_r}
$ic_show_message $ic_ECHO_N "Checking whether the C function $i_func() exists... $ic_ECHO_C"
cat >$ic_testfile.c <<__IC_EOF__
#include "int_config.h"
#include <assert.h>
#ifdef __cplusplus
extern "C"
#endif
char $i_func();
char (*f)();

int main()
{
#if defined(__stub_$i_func) || defined(__stub___$i_func)
  choke me
#else
  f=$i_func;
#endif
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 $ic_LDFLAGS $ic_testfile.$ic_objext $LIBS -o $ic_testfile >&5 2>&5; then
    i_result=1
  fi
fi
case $i_result in
  0) i_x=no ;;
  *) i_x=yes ;;
esac
$ic_show_message "${ic_ECHO_T}$i_x"
cat >&7 <<EOF
#define $i_resultid $i_result
EOF
done
case "x$ic_option_threading" in
  x1)

# IC_C_FUNCTIONS_OPTLIB

i_need_lib=false
i_putsym=:
for i_func in 0 pthread_create
do
case $i_func in
  0) i_putsym=false; continue ;;
  1) i_putsym=:; continue ;;
esac
i_r=`echo "$i_func" | sed "y,$ic_az,$ic_AZ,;s,[^_${ic_Az09}],_,g"`
i_resultid='HAVE_'${i_r}
$ic_show_message $ic_ECHO_N "Checking whether/where $i_func() exists... $ic_ECHO_C"
for i_lib in '' pthread
do
cat >$ic_testfile.c <<__IC_EOF__
#include "int_config.h"
#include <assert.h>
#ifdef __cplusplus
extern "C"
#endif
char $i_func();
char (*f)();

int main()
{
#if defined(__stub_$i_func) || defined(__stub___$i_func)
  choke me
#else
  f=$i_func;
#endif
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  case $i_lib in
    '') i_realib='' ;;
    *) i_realib="-l$i_lib" ;;
  esac
  if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 $ic_LDFLAGS $ic_testfile.$ic_objext $LIBS $i_realib -o $ic_testfile >&5 2>&5; then
    i_result=1
  fi
fi
case $i_result in
  1) break ;;
esac
i_need_lib=:
done
case $i_result in
  0) i_x=no
     i_need_lib=false
     ;;
  *) i_x=yes
     case $i_lib in
     '') i_x="$i_x (libc)" ;;
     *) i_x="$i_x (-l$i_lib)" ;;
     esac
     ;;
esac
$ic_show_message "${ic_ECHO_T}$i_x"
if $i_putsym; then
cat >&7 <<EOF
#define $i_resultid $i_result
EOF
fi
done
if $i_need_lib; then
  for i_bin in $ic_binaries
  do
    eval i_var="ic_binary_${i_bin}_libs"
    eval i_val="$`echo $i_var`"
    eval "$i_var='$i_val -lpthread'"
  done
fi
  ;;
esac

if test "x$ic_option_i18n" = x1; then

# IC_C_FUNCTIONS_OPTLIB

i_need_lib=false
i_putsym=:
for i_func in 0 gettext
do
case $i_func in
  0) i_putsym=false; continue ;;
  1) i_putsym=:; continue ;;
esac
i_r=`echo "$i_func" | sed "y,$ic_az,$ic_AZ,;s,[^_${ic_Az09}],_,g"`
i_resultid='HAVE_'${i_r}
$ic_show_message $ic_ECHO_N "Checking whether/where $i_func() exists... $ic_ECHO_C"
for i_lib in '' intl
do
cat >$ic_testfile.c <<__IC_EOF__
#include "int_config.h"
#include <assert.h>
#ifdef __cplusplus
extern "C"
#endif
char $i_func();
char (*f)();

int main()
{
#if defined(__stub_$i_func) || defined(__stub___$i_func)
  choke me
#else
  f=$i_func;
#endif
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  case $i_lib in
    '') i_realib='' ;;
    *) i_realib="-l$i_lib" ;;
  esac
  if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 $ic_LDFLAGS $ic_testfile.$ic_objext $LIBS $i_realib -o $ic_testfile >&5 2>&5; then
    i_result=1
  fi
fi
case $i_result in
  1) break ;;
esac
i_need_lib=:
done
case $i_result in
  0) i_x=no
     i_need_lib=false
     ;;
  *) i_x=yes
     case $i_lib in
     '') i_x="$i_x (libc)" ;;
     *) i_x="$i_x (-l$i_lib)" ;;
     esac
     ;;
esac
$ic_show_message "${ic_ECHO_T}$i_x"
if $i_putsym; then
cat >&7 <<EOF
#define $i_resultid $i_result
EOF
fi
done
if $i_need_lib; then
  for i_bin in $ic_binaries
  do
    eval i_var="ic_binary_${i_bin}_libs"
    eval i_val="$`echo $i_var`"
    eval "$i_var='$i_val -lintl'"
  done
fi
fi

# IC_C_FUNCTIONS_OPTLIB

i_need_lib=false
i_putsym=:
for i_func in getaddrinfo getnameinfo 0 connect endservent freeaddrinfo gai_strerror getprotobyname getsockopt htonl htons ntohs setservent setsockopt socket
do
case $i_func in
  0) i_putsym=false; continue ;;
  1) i_putsym=:; continue ;;
esac
i_r=`echo "$i_func" | sed "y,$ic_az,$ic_AZ,;s,[^_${ic_Az09}],_,g"`
i_resultid='HAVE_'${i_r}
$ic_show_message $ic_ECHO_N "Checking whether/where $i_func() exists... $ic_ECHO_C"
for i_lib in '' socket
do
cat >$ic_testfile.c <<__IC_EOF__
#include "int_config.h"
#include <assert.h>
#ifdef __cplusplus
extern "C"
#endif
char $i_func();
char (*f)();

int main()
{
#if defined(__stub_$i_func) || defined(__stub___$i_func)
  choke me
#else
  f=$i_func;
#endif
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  case $i_lib in
    '') i_realib='' ;;
    *) i_realib="-l$i_lib" ;;
  esac
  if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 $ic_LDFLAGS $ic_testfile.$ic_objext $LIBS $i_realib -o $ic_testfile >&5 2>&5; then
    i_result=1
  fi
fi
case $i_result in
  1) break ;;
esac
i_need_lib=:
done
case $i_result in
  0) i_x=no
     i_need_lib=false
     ;;
  *) i_x=yes
     case $i_lib in
     '') i_x="$i_x (libc)" ;;
     *) i_x="$i_x (-l$i_lib)" ;;
     esac
     ;;
esac
$ic_show_message "${ic_ECHO_T}$i_x"
if $i_putsym; then
cat >&7 <<EOF
#define $i_resultid $i_result
EOF
fi
done
if $i_need_lib; then
  for i_bin in $ic_binaries
  do
    eval i_var="ic_binary_${i_bin}_libs"
    eval i_val="$`echo $i_var`"
    eval "$i_var='$i_val -lsocket'"
  done
fi

# IC_C_FUNCTIONS_OPTLIB

i_need_lib=false
i_putsym=:
for i_func in getipnodebyname inet_addr inet_ntop inet_pton 0 endhostent freehostent gethostbyname gethostent sethostent
do
case $i_func in
  0) i_putsym=false; continue ;;
  1) i_putsym=:; continue ;;
esac
i_r=`echo "$i_func" | sed "y,$ic_az,$ic_AZ,;s,[^_${ic_Az09}],_,g"`
i_resultid='HAVE_'${i_r}
$ic_show_message $ic_ECHO_N "Checking whether/where $i_func() exists... $ic_ECHO_C"
for i_lib in '' nsl
do
cat >$ic_testfile.c <<__IC_EOF__
#include "int_config.h"
#include <assert.h>
#ifdef __cplusplus
extern "C"
#endif
char $i_func();
char (*f)();

int main()
{
#if defined(__stub_$i_func) || defined(__stub___$i_func)
  choke me
#else
  f=$i_func;
#endif
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  case $i_lib in
    '') i_realib='' ;;
    *) i_realib="-l$i_lib" ;;
  esac
  if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 $ic_LDFLAGS $ic_testfile.$ic_objext $LIBS $i_realib -o $ic_testfile >&5 2>&5; then
    i_result=1
  fi
fi
case $i_result in
  1) break ;;
esac
i_need_lib=:
done
case $i_result in
  0) i_x=no
     i_need_lib=false
     ;;
  *) i_x=yes
     case $i_lib in
     '') i_x="$i_x (libc)" ;;
     *) i_x="$i_x (-l$i_lib)" ;;
     esac
     ;;
esac
$ic_show_message "${ic_ECHO_T}$i_x"
if $i_putsym; then
cat >&7 <<EOF
#define $i_resultid $i_result
EOF
fi
done
if $i_need_lib; then
  for i_bin in $ic_binaries
  do
    eval i_var="ic_binary_${i_bin}_libs"
    eval i_val="$`echo $i_var`"
    eval "$i_var='$i_val -lnsl'"
  done
fi
rszt=`tool/tgmode --rszt $ic_option_tg`
case "x$rszt" in
  x) ICV_has_resizeterm=1 ;;
  *)
cat >$ic_testfile.c <<__IC_EOF__

#include "int_config.h"
#include <assert.h>
#ifdef __cplusplus
extern "C"
#endif
char resizeterm();
char (*f)();

int main()
{
#if defined(__stub_resizeterm) || defined(__stub___resizeterm)
  choke me
#else
  f=resizeterm;
#endif
  return(0);
}
__IC_EOF__
i_result=0
if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 -c $ic_testfile.c -o $ic_testfile.$ic_objext >&5 2>&5; then
  case $rszt in
    '') i_realib='' ;;
    *) i_realib="-l$rszt" ;;
  esac
  if $ic_CC $ic_CFLAGS0 $ic_CPPFLAGS0 $ic_LDFLAGS $ic_testfile.$ic_objext $LIBS $i_realib -o $ic_testfile >&5 2>&5; then
    i_result=1
  fi
fi
ICV_has_resizeterm="$i_result"
;;
esac
cat >&7 <<EOF
#define HAVE_CURSES_RESIZETERM $ICV_has_resizeterm
EOF
ic_installs="$ic_installs bin"
ic_install_bin_files="retawq"
ic_install_bin_perm="u=rwx,g=rx,o=rx"
ic_install_bin_magic=m1
ic_installs="$ic_installs man"
ic_install_man_files="docu/retawq.1"
ic_install_man_perm="u=rw,g=r,o=r"
ic_install_man_magic=m2
ic_installs="$ic_installs doc"
ic_install_doc_files="README"
ic_install_doc_perm="u=rw,g=r,o=r"
ic_install_doc_magic=m3
if test "x$ic_option_i18n" = x1; then
ic_installs="$ic_installs locale"
ic_install_locale_files="i18n/de.mo i18n/es.mo i18n/fr.mo i18n/pt_BR.mo"
ic_install_locale_perm="u=rw,g=r,o=r"
ic_install_locale_magic=m4
fi
eval pfinal0="$ic_path_doc"
eval pfinal="$pfinal0"
cat >&7 <<EOF
#define PATH_INSTALL_DOC "$pfinal"
EOF
eval pfinal0="$ic_path_locale"
eval pfinal="$pfinal0"
cat >&7 <<EOF
#define PATH_INSTALL_LOCALE "$pfinal"
EOF

if test -n "$ic_binaries"; then
  allbin="all-binaries:"
  for bin in $ic_binaries
  do
    allbin="$allbin binary-$bin"
  done
  cat >&6 <<EOF
$allbin

EOF
  for bin in $ic_binaries
  do
    eval src=$`echo "ic_binary_${bin}_c_sources"`
    eval cflags=$`echo "ic_binary_${bin}_cflags"`
    eval libs0=$`echo "ic_binary_${bin}_libs"`
    libs=
    for lib in $libs0
    do
      case $lib in
        -*) ;;
        *) lib="-l$lib" ;;
      esac
      libs="$libs $lib"
    done
    dep="$src .config"
    ovals=
    if test -n "$src"; then
      for src1 in $src
      do
        case $src1 in
          *.c)
          oval=`expr "x$src1" : 'x*\(.*\)\.c\$'`
          oval=$oval.$ic_objext
          ovals="$ovals $oval"
          cat >&6 <<EOF
$oval: $dep
	$ic_CC $cflags $ic_CPPFLAGS0 -c $src1 -o $oval
EOF
          ;;
        esac
      done
    fi
    cat >&6 <<EOF
binary-$bin: $ovals
	$ic_CC $cflags $ic_CPPFLAGS0 $ic_LDFLAGS $ovals $LIBS $libs -o $bin

EOF
  done
else
  cat >&6 <<EOF
all-binaries:
	@echo "Nothing to do!" >&2
EOF
fi

if test -n "$ic_installs"; then
  allinst="install:"
  for inst in $ic_installs
  do
    eval ic_val=$`echo "ic_install_${inst}_files"`
    if test -n "$ic_val"; then
      eval path=$`echo "ic_path_${inst}" | sed "s,[^$ic_Az09],_,g"`
      eval pfinal0="$path"
      eval pfinal="$pfinal0"
      eval perm=$`echo "ic_install_${inst}_perm"`
      eval magic=$`echo "ic_install_${inst}_magic"`
      allinst="$allinst install-$inst"
      cat >&6 <<EOF
install-$inst:
	@./configure.act --int-install $perm $magic $pfinal "$ic_val"
EOF
    fi
  done
  echo "$allinst" >&6
fi

mf_mostlyclean="	-@rm -f"
for mfm in init. main. parser. resource. stuff.
do
  mf_mostlyclean="$mf_mostlyclean $mfm$ic_objext"
done
cat >&6 <<EOF

mostlyclean:
$mf_mostlyclean
clean: mostlyclean
	-@rm -f retawq
distclean: clean
	-@rm -f configure.act .config
	-@if test -f "Makefile-classical"; then mv -f Makefile-classical Makefile; else :; fi
maintainer-clean: distclean
	-@rm -rf *~

default-target: all-binaries
.PHONY: all all-binaries binary-retawq clean default-target distclean \\\\
        install install-bin install-doc install-locale install-man \\\\
        maintainer-clean mostlyclean
.SUFFIXES:
.DELETE_ON_ERROR:
.NOEXPORT:
EOF
exec 6>&5
exec 7>&5
exec 8>&5

$ic_show_info "Writing configure.act"
exec 6>configure.act
cat >&6 <<EOFACT
#! $SHELL
# configure.act - configured actions for retawq 0.2.6b
#
# This configuration script file has been auto-generated by
# itchconfig 0.0.4 <http://itchconfig.sourceforge.net/>.
# Copyright (C) 2002 Arne Thomassen <arne@arne-thomassen.de>
# This configuration script file is free software WITHOUT ANY WARRANTY;
# you are given unlimited permission to copy, distribute and modify this file,
# as long as this notice is kept intact and you indicate file modifications.

exec 5>/dev/null
if test -n "\${ZSH_VERSION+set}" && (emulate sh) >&5 2>&1; then
  emulate sh
  NULLCMD=:
elif test -n "\${BASH_VERSION+set}" && (set -o posix) >&5 2>&1; then
  set -o posix
fi

ic_nl='
'
IFS=" 	\$ic_nl"
export IFS

if (FOO=FOO; unset FOO) >&5 2>&1; then
  ic_unset=unset
else
  ic_unset=false
fi

\$ic_unset ENV MAIL MAILPATH
PS1='\$ '
PS2='> '
PS4='+ '

for i_x in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_TIME
do
  if (set +x; test -n "\`(eval \$i_x=C; export \$i_x) 2>&1\`"); then
    eval \$i_x=C; export \$i_x
  else
    \$ic_unset \$i_x
  fi
done

ic_me=\`echo "\$0" | sed 's,.*[/],,'\`
ic_fatal_error=$ic_fatal_error
ic_show_info=$ic_show_info

if test -f "parser.c"; then :; else
  \$ic_fatal_error "\$ic_me: configuration script launched from wrong directory!" >&2
  { (exit 1); exit 1; }
fi


case \$1 in
  --int-install)
  mode="\$2"
  magic="\$3"
  initial_path="\$4"
  files="\$5"
  act="\${ITCHCONFIG_ACT-}"
  ic_makedir="\${MKDIRPROG-mkdir}"
  ic_program_prefix="$ic_program_prefix"
  ic_program_suffix="$ic_program_suffix"
  checked_path=
  for one_file in \$files
  do
    path="\$initial_path"
    file=\`echo "\$one_file" | sed 's,.*[/],,'\`
    case \$magic in
    m0) ;;
    m1)
file="\$ic_program_prefix\$file\$ic_program_suffix"
    ;;
    m2)
num=\`echo "\$file" | sed 's,.*\\.\\([0123456789]\\).*,\\1,'\`
path="\$path/man\$num"
    ;;
    m3)
tool/instdocu \$path
break
    ;;
    m4)
mcf=\`echo "\$file" | sed 's,\\.mo\$,,'\`
path="\$path/\$mcf/LC_MESSAGES"
file="retawq.mo"
    ;;
    *)
    \$ic_fatal_error "\$ic_me: unknown installer magic \\"\$magic\\"" >&2
    { (exit 1); exit 1; }
    ;;
    esac
    if test "x\$checked_path" != "x\$path"; then
      checked_path="\$path"
      parts=\`echo "\$path" | sed 's,/, ,g'\`
      p=
      for part in \$parts
      do
        p="\$p/\$part"
        if test -d "\$p" || \$act \$ic_makedir "\$p"; then :; else
          \$ic_fatal_error "\$ic_me: cannot create directory \\"\$p\\"" >&2
          { (exit 1); exit 1; }
        fi
      done
    fi
    dest_file="\$path/\$file"
    if test -f "\$dest_file"; then
      temp_file=\$path/#itch.\$\$#
      \$act trap "mv -f \$temp_file \$dest_file" 1 2 13 15
      \$act mv -f \$dest_file \$temp_file
      \$act cp \$one_file \$dest_file
      \$act rm -f \$temp_file
    else
      \$act cp \$one_file \$dest_file
    fi
    \$act chmod \$mode \$dest_file
  done
  { :; exit 0; }
  ;;
esac


# Parse args
i_premature_exit=a
for i_arg
do

case \$i_arg in

  --version | -V)
  i_premature_exit=b
  break
  ;;

  --help)
  i_premature_exit=c
  break
  ;;

  *)
  \$ic_fatal_error "\$ic_me: unrecognized option: \$i_arg. Try \\"./\$ic_me --help\\"!" >&2
  { (exit 1); exit 1; }
  ;;

esac
done

case \$i_premature_exit in
a)
  ;;
b)
  cat <<EOF
\$ic_me - configured actions for retawq 0.2.6b
This configuration script file has been auto-generated by
itchconfig 0.0.4 <http://itchconfig.sourceforge.net/>.
Copyright (C) 2002 Arne Thomassen <arne@arne-thomassen.de>
This configuration script file is free software WITHOUT ANY WARRANTY;
you are given unlimited permission to copy, distribute and modify this file,
as long as this notice is kept intact and you indicate file modifications.
EOF
  { :; exit 0; }
  ;;
c)
  cat <<EOF
\\\`\$ic_me' performs configured actions for retawq 0.2.6b.
Script generated by itchconfig 0.0.4 <http://itchconfig.sourceforge.net/>.
Usage: ./\$ic_me [option] ...

General Options:
--version, -V  print the version information and exit
--help         print this help and exit
EOF
  { :; exit 0; }
  ;;
esac

EOFACT

cat >&6 <<EOFACT
if test -f "Makefile-classical"; then :; else
  mv -f Makefile Makefile-classical
fi
EOFACT

cat >&6 <<EOFACT
\$ic_show_info "Writing the Makefile"
EOFACT
echo "cat >Makefile <<EOFINACT" >&6
cat >&6 <$ic_makefile
echo "EOFINACT" >&6

cat >&6 <<EOFACT
\$ic_show_info "Writing the config.h file (.config)"
EOFACT
echo "cat >.config <<EOFINACT" >&6
cat >&6 <$ic_config_h
echo "EOFINACT" >&6

echo "{ :; exit 0; }" >&6
exec 6>&5

$ic_show_info "Executing configure.act"
chmod u+rx configure.act
$SHELL configure.act

{ :; exit 0; }