##############################################################################

## This file is a shell script fragment that supplies the information
## necessary to tailor a template configure script into the configure
## script appropriate for this directory.  For more information, check
## any existing configure script.  

## Be warned, there are two types of configure.in files.  There are those
## used by Autoconf, which are macros which are expanded into a configure
## script by autoconf.  The other sort, of which this is one, is executed
## by Cygnus configure.  

## For more information on these two systems, check out the documentation
## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi).  


################################################################################


################################################################################

configdirs=""
x11subdirs=""
utilsubdirs="util util/et util/ss"
libsubdirs="include lib lib/des lib/krb lib/kdb lib/kadm lib/knet lib/acl lib/kstream"
othersubdirs="kuser kadmin server slave admin appl appl/bsd man tests appl/sample"
emailsubdirs="email email/pfrom email/POP"
subdirs="$utilsubdirs $libsubdirs $othersubdirs"

srctrigger=move-if-change
srcname="kerberos"

common_makefile_frag=config/common
postfix_makefile_frag=config/postfix

# per-host:

host_makefile_frag=config/host

# per-target:

case "${target}" in
  sparc-sun-solaris2*)	target_makefile_frag=config/mt-spsol ;;
  sparc-sun-sunos4*)	target_makefile_frag=config/mt-sun ;;
  m68k-sun-sunos4*)	target_makefile_frag=config/mt-sun ;;
  mips-dec-ultrix*)     target_makefile_frag=config/mt-decstation ;;
  mips-sgi-irix4*)      target_makefile_frag=config/mt-irix4 ;;
  mips-sgi-irix5*)	target_makefile_frag=config/mt-irix5 ;;
  i[34]86-*-sco*)	target_makefile_frag=config/mt-sco
			subdirs="$subdirs appl/x5dm" ;;
  i[34]86-*-linux*)	target_makefile_frag=config/mt-linux ;;
  powerpc-*-linux)	target_makefile_frag=config/mt-linux ;;
  i[34]86-*-bsd)	target_makefile_frag=config/mt-386bsd ;;
  i[34]86-*-netbsd*)	target_makefile_frag=config/mt-netbsd_le ;;
  m68k-*-netbsd*)	target_makefile_frag=config/mt-netbsd_be ;;
  sparc-*-netbsd*)	target_makefile_frag=config/mt-netbsd_be ;;
  rs6000-ibm-aix)	target_makefile_frag=config/mt-rsaix ;;
  hppa1.1-hp-hpux*)	target_makefile_frag=config/mt-snake ;;
  m68k-hp-hpux)		target_makefile_frag=config/mt-hp300 ;;
  m68k-next-bsd)	target_makefile_frag=config/mt-next ;;
  alpha-dec-osf1.*)	target_makefile_frag=config/mt-alpha ;;

  i960-*-vxworks)	target_makefile_frag=config/mt-i960vx ;;
  *) echo "Target ${target} not supported yet"; exit 1;;
esac

# some tools are only suitable for building in a "native" situation.
# Those are added when we have a host==target configuration.  For cross
# toolchains, we add some directories that should only be useful in a
# cross-compiler.

if [ x"${host}" != x"${target}" ] ; then
	echo "Cross build not supported yet" ; exit 1
fi	

# post-target:

case ${with_x11r5_lib} in
  "") x11r5lib=
      ;;
  *)  x11r5lib="-L${with_x11r5_lib}"
      ;;
esac

case ${with_x11r5_include} in
  "") x11r5inc=
      ;;
  *)  x11r5inc="-I${with_x11r5_include}"
      ;;
esac

if grep '# USE X11R5' ${Makefile} >/dev/null ; then
	rm -f ${Makefile}.tem
	mv ${Makefile} ${Makefile}.tem
	echo XLD=${x11r5lib} > ${Makefile}
	echo INCLUDE_ARG=${x11r5inc} >> ${Makefile}
	cat ${Makefile}.tem >> ${Makefile}
	rm -f ${Makefile}.tem
	echo "modified ${Makefile} for x11 headers"
fi

