1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.59)dnl
3AC_INIT(Makefile.in)
4AC_CONFIG_HEADER(cconfig.h:config.in)
5
6# Bugs in autoconf 2.59 break the call to SIM_AC_COMMON, hack around
7# it by inlining the macro's contents.
8sinclude(../common/common.m4)
9
10# Put a useful copy of CPP_FOR_TARGET in Makefile.
11# This is only used to build the target values header files.  These files are
12# shipped with distributions so CPP_FOR_TARGET only needs to work in
13# developer's trees.  This value is borrowed from ../../Makefile.in.
14CPP_FOR_TARGET="\` \
15  if test -f \$\${rootme}/../../gcc/Makefile ; then \
16    if test -f \$\${rootme}/../../\$(TARGET_SUBDIR)/newlib/Makefile ; then \
17      echo \$\${rootme}/../../gcc/xgcc -B\$\${rootme}/../../gcc/ -idirafter \$\${rootme}/../../\$(TARGET_SUBDIR)/newlib/targ-include -idirafter \$(srcroot)/newlib/libc/include -nostdinc; \
18    else \
19      echo \$\${rootme}/../../gcc/xgcc -B\$\${rootme}/../../gcc/; \
20    fi; \
21  else \
22    if test '\$(host_canonical)' = '\$(target_canonical)' ; then \
23      echo \$(CC); \
24    else \
25      t='\$(program_transform_name)'; echo gcc | sed -e 's/x/x/' \$\$t; \
26    fi; \
27  fi\` -E"
28AC_SUBST(CPP_FOR_TARGET)
29
30# Set TARGET_SUBDIR, needed by CPP_FOR_TARGET.
31if test x"${host}" = x"${target}" ; then
32	TARGET_SUBDIR="."
33else
34	TARGET_SUBDIR=${target_alias}
35fi
36AC_SUBST(TARGET_SUBDIR)
37
38# These aren't all needed yet, but will be eventually.
39AC_CHECK_HEADERS(stdlib.h string.h strings.h time.h sys/times.h sys/stat.h sys/mman.h)
40AC_CHECK_FUNCS(mmap munmap lstat truncate ftruncate)
41AC_CHECK_MEMBERS([[struct stat.st_dev], [struct stat.st_ino],
42[struct stat.st_mode], [struct stat.st_nlink], [struct stat.st_uid],
43[struct stat.st_gid], [struct stat.st_rdev], [struct stat.st_size],
44[struct stat.st_blksize], [struct stat.st_blocks], [struct stat.st_atime],
45[struct stat.st_mtime], [struct stat.st_ctime]], [], [],
46[[#ifdef HAVE_SYS_TYPES_H
47#include <sys/types.h>
48#endif
49#ifdef HAVE_SYS_STAT_H
50#include <sys/stat.h>
51#endif]])
52AC_CHECK_TYPES(socklen_t, [], [],
53[#include <sys/types.h>
54#include <sys/socket.h>
55])
56
57AC_OUTPUT(Makefile,
58[case x$CONFIG_HEADERS in xcconfig.h:config.in) echo > stamp-h ;; esac])
59