2
0

configure.in 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(ppremake.cxx)
  3. dnl **************** UPDATE VERSION NUMBER HERE ****************
  4. dnl ** Also be sure to change the version number **
  5. dnl ** at the end of config_msvc.h. **
  6. dnl **************** ****************
  7. AM_INIT_AUTOMAKE(ppremake, 1.22)
  8. dnl **************** UPDATE VERSION NUMBER HERE ****************
  9. AM_CONFIG_HEADER(config.h)
  10. AC_PREFIX_DEFAULT(/usr/local/panda)
  11. AC_PROG_MAKE_SET
  12. AC_CANONICAL_HOST
  13. # If we have a CFLAGS variable but not a CXXFLAGS variable, let them
  14. # be the same.
  15. if test "${CXXFLAGS+set}" != set -a "${CFLAGS+set}" = set; then
  16. CXXFLAGS=$CFLAGS
  17. fi
  18. CPPFLAGS="${CPPFLAGS} -DINSTALL_DIR='\""'$(prefix)'"\"'"
  19. # Save these variables for later, so we can easily append to them or
  20. # change them.
  21. user_ldflags=${LDFLAGS-}
  22. user_cflags=${CFLAGS-}
  23. user_cxxflags=${CXXFLAGS-}
  24. dnl Checks for programs.
  25. AC_PROG_CC
  26. AC_PROG_CXX
  27. dnl First, we'll test for C-specific features.
  28. AC_LANG_C
  29. dnl Checks for libraries.
  30. libdl=
  31. libm=
  32. AC_CHECK_LIB(m, sin, libm=-lm)
  33. AC_SUBST(libm)
  34. dnl Checks for header files.
  35. AC_HEADER_STDC
  36. AC_CHECK_HEADERS(malloc.h alloca.h unistd.h utime.h io.h minmax.h dirent.h glob.h sys/types.h sys/time.h sys/utime.h sys/wait.h string.h regex.h getopt.h)
  37. dnl Checks for typedefs, structures, and compiler characteristics.
  38. dnl Checks for library functions.
  39. AC_CHECK_FUNCS(getopt)
  40. dnl Now we can test some C++-specific features.
  41. AC_LANG_CPLUSPLUS
  42. AC_HEADER_IOSTREAM
  43. AC_HEADER_SSTREAM
  44. AC_NAMESPACE
  45. AC_IOS_BINARY
  46. AC_OPEN_MASK
  47. AC_LANG_C
  48. AC_ARG_WITH(platform,
  49. [ --with-platform=platform Set the $[PLATFORM] predefined variable.])
  50. if test "${with_platform-no}" != "no"; then
  51. PLATFORM=$with_platform
  52. else
  53. case "$host_os" in
  54. irix*) PLATFORM=Irix;;
  55. linux*) PLATFORM=Linux;;
  56. cygwin*) PLATFORM=Cygwin;;
  57. darwin*) PLATFORM=OSX;;
  58. freebsd*) PLATFORM=FreeBSD;;
  59. *) echo "Cannot determine platform from $host_os; use --with-platform=name."
  60. exit 1;;
  61. esac
  62. fi
  63. if test "$PLATFORM" = "Cygwin"; then
  64. AC_DEFINE(HAVE_CYGWIN, 1, [Define if we're compiling with Cygwin.])
  65. fi
  66. if test "$PLATFORM" = "OSX"; then
  67. AC_DEFINE(HAVE_OSX, 1, [Define if we're compiling for OSX.])
  68. fi
  69. AC_DEFINE_UNQUOTED(PLATFORM, "$PLATFORM",
  70. [The platform ppremake is compiled for. This primarily controls the
  71. initial setting of the PLATFORM ppremake variable.])
  72. AC_OUTPUT(Makefile)