configure.ac 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. AC_INIT([love], [HEAD])
  2. AC_CONFIG_HEADERS([config.h])
  3. AC_CONFIG_AUX_DIR([platform/unix])
  4. AC_CONFIG_MACRO_DIR([platform/unix/m4])
  5. AC_CONFIG_SRCDIR([src/love.cpp])
  6. AM_INIT_AUTOMAKE([foreign -Wall foreign tar-ustar silent-rules])
  7. AM_SILENT_RULES
  8. AC_PREFIX_DEFAULT([/usr])
  9. m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
  10. LT_INIT([disable-static])
  11. AC_PROG_CC
  12. AC_PROG_CXX
  13. AC_PROG_SED
  14. AC_PROG_MKDIR_P
  15. AC_PROG_OBJCXX
  16. PKG_PROG_PKG_CONFIG
  17. AC_C_BIGENDIAN
  18. AC_LANG([C++])
  19. dnl Workaround for old aclocal versions
  20. m4_include([platform/unix/cpp11.m4])
  21. m4_include([platform/unix/deps.m4])
  22. includes=
  23. AC_DEFUN([LOVE_MSG_ERROR],
  24. [AC_MSG_ERROR([LÖVE needs "$1"[,] please install "$1" with development files and try again])])
  25. # C++11 support in cpp11.m4
  26. ACLOVE_CPP11_TEST
  27. # Allow people on OSX to use autotools, they need their platform files
  28. AC_ARG_ENABLE([osx],
  29. AC_HELP_STRING([--enable-osx], [Compile platform-specific files for OSX]), [], [enable_osx=no])
  30. AS_VAR_IF([enable_osx], [no], [], #else
  31. ac_cv_search_glLoadIdentity="-framework OpenGL"
  32. AC_SUBST([LDFLAGS], ["${LDFLAGS} -framework CoreFoundation -framework Cocoa"])
  33. AC_SUBST([CPPFLAGS], ["${CPPFLAGS} -I../platform/macosx"]))
  34. # --with-lua and --with-luaversion
  35. AC_ARG_WITH([lua], [AS_HELP_STRING([--with-lua], [Select the lua implementation])],
  36. [], [with_lua=luajit])
  37. AC_ARG_WITH([luaversion], [AS_HELP_STRING([--with-luaversion], [Select the lua version])],
  38. [], [with_luaversion=5.1])
  39. with_clean_luaversion=`printf ${with_luaversion} | sed 's/\.//g'`
  40. # Generated sources for enabling/disabling modules
  41. m4_include([configure-modules.ac])
  42. # Other features that can be enabled/disabled
  43. AC_ARG_ENABLE([mpg123], AC_HELP_STRING([--disable-mpg123], [Disable mp3 support, for patent-free builds]), [], [enable_mpg123=yes])
  44. AC_ARG_ENABLE([gme], AC_HELP_STRING([--enable-gme], [Enable GME support, for more chiptuney goodness]), [], [enable_gme=no])
  45. ACLOVE_DEP_LUA
  46. ACLOVE_DEP_SDL2
  47. ACLOVE_DEP_LIBM
  48. ACLOVE_DEP_ZLIB
  49. AS_VAR_IF([enable_audio_openal], [true], [ACLOVE_DEP_OPENAL], [])
  50. AS_VAR_IF([enable_filesystem_physfs], [true], [ACLOVE_DEP_PHYSFS], [])
  51. AS_VAR_IF([enable_font_freetype], [true], [ACLOVE_DEP_FREETYPE2], [])
  52. AS_VAR_IF([enable_sound_lullaby], [true], [
  53. ACLOVE_DEP_LIBMODPLUG
  54. ACLOVE_DEP_VORBISFILE
  55. ], [enable_mpg123=no])
  56. AS_VAR_IF([enable_video_theora], [true], [ACLOVE_DEP_THEORA], [])
  57. AS_VAR_IF([enable_gme], [yes], [ACLOVE_DEP_GME], [])
  58. AS_VAR_IF([enable_mpg123], [no],
  59. AC_DEFINE([LOVE_NOMPG123], [], [Build without mpg123]),
  60. [ACLOVE_DEP_MPG123])
  61. # GME, treated seperately because it can be enabled (default off)
  62. # libenet check for socklen_t
  63. ACLOVE_SOCKLEN_T
  64. # Optionally build the executable (default on)
  65. AC_ARG_ENABLE([exe],
  66. AC_HELP_STRING([--disable-exe], [Disable building of executable launcher]), [], [enable_exe=yes])
  67. AS_VAR_IF([enable_exe], [no], [], #else
  68. AC_DEFINE([LOVE_BUILD_EXE], [], [Skip building launcher]))
  69. AM_CONDITIONAL([LOVE_BUILD_EXE], [test "x$enable_exe" != xno])
  70. AM_CONDITIONAL([LOVE_NOMPG123], [test "x$enable_mpg123" = xno])
  71. AM_CONDITIONAL([LOVE_TARGET_OSX], [test "x$enable_osx" != xno])
  72. # Automatic script file rebuilding
  73. AC_CHECK_PROGS([LUA_EXECUTABLE], ["${with_lua}${with_luaversion}" "${with_lua}" "lua"], [:])
  74. AS_VAR_IF([LUA_EXECUTABLE], [:],
  75. [AC_MSG_WARN([Did not find a lua executable, you may need to update the scripts manually if you change them])], [])
  76. # Set our includes as automake variable
  77. AC_SUBST([LOVE_INCLUDES], ["$includes"])
  78. AC_CONFIG_FILES([
  79. Makefile
  80. src/Makefile
  81. platform/unix/debian/control
  82. platform/unix/debian/changelog
  83. platform/unix/debian/rules
  84. ])
  85. AC_OUTPUT
  86. chmod 755 platform/unix/debian/rules