#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53 and edited for this module 9-22-03
#
# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
#
#
#	Makefile.PL changes needed to use this script
#
#	clean	=> 'whatever....   localStuff.h config.log'
#
# sub MY::top_targets {
#    package MY;
#    my $begin = q|
# config  :: localStuff.h
#        @$(NOOP)
#
# # siteconf CCname Cfile_ext OBJext EXEext "Cflags" "LDflags" "LDLOADLIBS"
# #
# localStuff.h :
#	./siteconf "$(CC)" ".c" "$(OBJ_EXT)" "$(EXE_EXT)" "$(CCFLAGS)" "$(LDFLAGS)" "$(LDLOADLIBS)"
# |;
#   my $inherited = shift->SUPER::top_targets(@_);
# # whatever additional change, additions that may be needed
#   $begin . $inherited;
# }
#
#

# the command line must contain
#
#	siteconf CCname Cfile_ext OBJext EXEext "Cflags" "LDflags"
if [ $# -ne 7 ]; then
  echo this script is run by make, do not run it from the command line
  exit -1
fi

CC=$1
ac_ext=`echo $2 | sed 's/.//; q'`
ac_objext=`echo $3 | sed 's/.//; q'`
ac_cv_exeext=`echo $4 | sed 's/.//; q'`
CFLAGS=$5
LDFLAGS=$6
LIBS=$7

# want something like this...
#CC=gcc
#ac_ext=c
#ac_objext=o
#ac_cv_exeext=

exec 5>config.log

ac_exeext=$ac_cv_exeext
ac_compile='$CC -c $CFLAGS conftest.$ac_ext >&5'
ac_compile='$CC -c $CFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'


if expr a : '\(a\)' >/dev/null 2>&1; then
  as_expr=expr
else
  as_expr=false
fi

exec 6>&1

rm -f localStuff.h

cat >localStuff.h <<\_ASBOX
/* ****************************************************	*
 *		## localStuff.h  ##			*
 *		## ----------- ##			*
 *							*
 * This file was generated automatically by 'siteconf'.	*
 * Don't edit this file, edit 'siteconf' instead.	*
 *							*
 * ****************************************************	*/

/*	Don't know how much of this definition set from perl's Socket.xs 
	is needed for all the address families, but include them anyway
 */
 
#include <stddef.h>

#ifndef VMS
# ifdef I_SYS_TYPES   
#  include <sys/types.h>
# endif  
# if !defined(ultrix) /* Avoid double definition. */
#   include <sys/socket.h>
# endif
# if defined(USE_SOCKS) && defined(I_SOCKS)
#   include <socks.h>
# endif
# ifdef MPE
#  define PF_INET AF_INET
#  define PF_UNIX AF_UNIX
#  define SOCK_RAW 3
# endif
# ifdef I_SYS_UN
#  include <sys/un.h>
# endif  
/* XXX Configure test for <netinet/in_systm.h needed XXX */
# if defined(NeXT) || defined(__NeXT__)
#  include <netinet/in_systm.h>
# endif
# if defined(__sgi) && !defined(AF_LINK) && defined(PF_LINK) && PF_LINK == AF_LNK
#  undef PF_LINK
# endif
# if defined(I_NETINET_IN) || defined(__ultrix__)
#  include <netinet/in.h>
# endif
# ifdef I_NETDB
#  if !defined(ultrix)  /* Avoid double definition. */
#   include <netdb.h>
#  endif
# endif
# ifdef I_ARPA_INET
#  include <arpa/inet.h>
# endif
# ifdef I_NETINET_TCP
#  include <netinet/tcp.h>
# endif
#else
# include "sockadapt.h"
#endif

/*	End of perl's socket address stuff	*/

_ASBOX

## --------------------- ##
## M4sh Initialization.  ##
## --------------------- ##

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

# Name of the executable.
as_me=`(basename "$0") 2>/dev/null ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)$' \| \
	 .     : '\(.\)' 2>/dev/null ||
echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
  	  /^X\/\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`

# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  echo "#! /bin/sh" >conftest.sh
  echo  "exit 0"   >>conftest.sh
  chmod +x conftest.sh
  if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
    PATH_SEPARATOR=';'
  else
    PATH_SEPARATOR=:
  fi
  rm -f conftest.sh
fi


  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
  # Find who we are.  Look in the path if we contain no path at all
  # relative or not.
  case $0 in
    *[\\/]* ) as_myself=$0 ;;
    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done

       ;;
  esac
  # We did not find ourselves, most probably we were run as `sh COMMAND'
  # in which case we are not to be found in the path.
  if test "x$as_myself" = x; then
    as_myself=$0
  fi
  if test ! -f "$as_myself"; then
    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
   { (exit 1); exit 1; }; }
  fi
  case $CONFIG_SHELL in
  '')
    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for as_base in sh bash ksh sh5; do
	 case $as_dir in
	 /*)
	   if ("$as_dir/$as_base" -c '
  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
	     CONFIG_SHELL=$as_dir/$as_base
	     export CONFIG_SHELL
	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
	   fi;;
	 esac
       done
done
;;
  esac

  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
  # uniformly replaced by the line number.  The first 'sed' inserts a
  # line-number line before each line; the second 'sed' does the real
  # work.  The second script uses 'N' to pair each line-number line
  # with the numbered line, and appends trailing '-' during
  # substitution so that $LINENO is not a special case at line end.
  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
  sed '=' <$as_myself |
    sed '
      N
      s,$,-,
      : loop
      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
      t loop
      s,-$,,
      s,^['$as_cr_digits']*\n,,
    ' >$as_me.lineno &&
  chmod +x $as_me.lineno ||
    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
   { (exit 1); exit 1; }; }

  # Don't try to exec as it changes $[0], causing all sort of problems
  # (the dirname of $[0] is not the place where we might find the
  # original and so on.  Autoconf is especially sensible to this).
  . ./$as_me.lineno
  # Exit status is that of the last command.
  exit
}


case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  *c*,-n*) ECHO_N= ECHO_C='
' ECHO_T='	' ;;
  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac

if expr a : '\(a\)' >/dev/null 2>&1; then
  as_expr=expr
else
  as_expr=false
fi

cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running siteconf, to aid debugging if siteconf makes a mistake.

It was created by $as_me, which was
generated by GNU Autoconf 2.53.  Invocation command line was

  $ $0 $@

_ACEOF

# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif"
#ifdef __APPLE__
#include <mach/machine/vm_param.h>
#endif

############### begin tests #############################

# checking for PAGE_SIZE

echo "$as_me:$LINENO: checking PAGE_SIZE" >&5
echo $ECHO_N "checking for PAGE_SIZE $ECHO_C" >&6
	cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "siteconf"
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif

#include "sconfig.h"

#ifdef HAVE_I_UNISTD
#include <unistd.h>
#endif

#ifdef __APPLE__
#include <mach/machine/vm_param.h>
#endif

int
main()
{
int pagesize = 0;
#if defined(HAVE_SYSCONF) && (defined(_SC_PAGESIZE) || defined(_SC_PAGE_SIZE) || defined(_SC_MMAP_PAGE_SIZE))
#   if defined(_SC_PAGESIZE)
	pagesize = sysconf(_SC_PAGESIZE);
#   elif defined(_SC_PAGE_SIZE)
	pagesize = sysconf(_SC_PAGE_SIZE);
#   else
	pagesize = sysconf(_SC_MMAP_PAGE_SIZE);
#   endif
#elif defined HAVE_GETPAGESIZE
    pagesize = getpagesize();
#elif defined(PAGESIZE)
    pagesize = PAGESIZE;
#elif defined(PAGE_SIZE)
    pagesize = PAGE_SIZE;
#else
    return 1;
#endif
  printf("%d\n",pagesize);
  return pagesize;
}
_ACEOF

rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  {(eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  PSZ=`(eval $ac_try) 2>&5`
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  };} && [ $ac_status -eq 0 ]; then
  echo "#define MY_PGSIZE $PSZ" >>localStuff.h
  echo "$as_me:$LINENO: result: PAGE_SIZE $PSZ" >&5
  echo "${ECHO_T}... PAGE_SIZE $PSZ" >&6
else
echo "$as_me:$LINENO: \$? = $ac_status" >&5
  echo "$as_me: failed program was:" >&5
  cat conftest.$ac_ext >&5
  { echo "$as_me:$LINENO: error: can't figure out PAGE_SIZE" >&5
    echo "${ECHO_T}error: can't figure out PAGE_SIZE" >&6
  { (exit 1); exit 1; }; };
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext

# checking for SA_LEN

echo "$as_me:$LINENO: checking SA_LEN" >&5
echo $ECHO_N "checking for SA_LEN $ECHO_C" >&6
	cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "siteconf"
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif

#include <sys/types.h>
#include <sys/socket.h>

int
main()
{
  struct sockaddr sa; sa.sa_len = 0;
  return 0;
}
_ACEOF

rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  {(eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  };} && [ $ac_status -eq 0 ]; then
  echo "#define HAVE_SA_LEN" >>localStuff.h
  echo "$as_me:$LINENO: result: has SA_LEN" >&5
  echo "${ECHO_T}... has SA_LEN" >&6
else
  echo "$as_me:$LINENO: result: missing SA_LEN" >&5
  echo "${ECHO_T}... missing SA_LEN" >&6
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext

