configure.ac 2.0 KB

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