configure.in 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. *) echo "Cannot determine platform from $host_os; use --with-platform=name."
  59. exit 1;;
  60. esac
  61. fi
  62. if test "$PLATFORM" = "Cygwin"; then
  63. AC_DEFINE(HAVE_CYGWIN, 1, [Define if we're compiling with Cygwin.])
  64. fi
  65. if test "$PLATFORM" = "OSX"; then
  66. AC_DEFINE(HAVE_OSX, 1, [Define if we're compiling for OSX.])
  67. fi
  68. AC_DEFINE_UNQUOTED(PLATFORM, "$PLATFORM",
  69. [The platform ppremake is compiled for. This primarily controls the
  70. initial setting of the PLATFORM ppremake variable.])
  71. AC_OUTPUT(Makefile)