configure.in 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(ppremake.cxx)
  3. AM_INIT_AUTOMAKE(ppremake, 0.60)
  4. AM_CONFIG_HEADER(config.h)
  5. AC_PREFIX_DEFAULT(/usr/local/panda)
  6. AC_PROG_MAKE_SET
  7. AC_CANONICAL_HOST
  8. # If we have a CFLAGS variable but not a CXXFLAGS variable, let them
  9. # be the same.
  10. if test "${CXXFLAGS+set}" != set -a "${CFLAGS+set}" = set; then
  11. CXXFLAGS=$CFLAGS
  12. fi
  13. # Save these variables for later, so we can easily append to them or
  14. # change them.
  15. user_ldflags=${LDFLAGS-}
  16. user_cflags=${CFLAGS-}
  17. user_cxxflags=${CXXFLAGS-}
  18. dnl Checks for programs.
  19. AC_PROG_CC
  20. AC_PROG_CXX
  21. dnl First, we'll test for C-specific features.
  22. AC_LANG_C
  23. dnl Checks for libraries.
  24. libdl=
  25. libm=
  26. AC_CHECK_LIB(m, sin, libm=-lm)
  27. AC_SUBST(libm)
  28. dnl Checks for header files.
  29. AC_HEADER_STDC
  30. AC_CHECK_HEADERS(malloc.h alloca.h unistd.h io.h minmax.h sys/types.h string.h regex.h)
  31. dnl Checks for typedefs, structures, and compiler characteristics.
  32. dnl Checks for library functions.
  33. AC_CHECK_FUNCS(getopt)
  34. dnl Now we can test some C++-specific features.
  35. AC_LANG_CPLUSPLUS
  36. AC_HEADER_IOSTREAM
  37. AC_NAMESPACE
  38. AC_LANG_C
  39. AC_ARG_WITH(platform,
  40. [ --with-platform=platform Set the $[PLATFORM] predefined variable.])
  41. if test "${with_platform-no}" != "no"; then
  42. PLATFORM=$with_platform
  43. else
  44. case "$host_os" in
  45. irix*) PLATFORM=Irix;;
  46. linux*) PLATFORM=Linux;;
  47. cygwin*) PLATFORM=Win32;;
  48. *) echo "Cannot determine platform; use --with-platform=name."
  49. exit 1;;
  50. esac
  51. fi
  52. if test "$PLATFORM" = "Win32"; then
  53. AC_DEFINE(PLATFORM_WIN32)
  54. fi
  55. AC_DEFINE_UNQUOTED(PLATFORM, "$PLATFORM")
  56. AC_OUTPUT(Makefile)