configure.ac 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. AC_INIT([love], [0.11.0])
  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. # stb_image sse2 override (https://github.com/nothings/stb/issues/280)
  35. AC_ARG_ENABLE([stbi-sse2-override],
  36. AC_HELP_STRING([--enable-stbi-sse2-override], [Force stb_image SSE2 support]), [], [enable_stbi_sse2_override=no])
  37. AS_VAR_IF([enable_stbi_sse2_override], [no], [], #else
  38. AC_SUBST([CPPFLAGS], ["${CPPFLAGS} -DLOVE_STBI_SSE2_OVERRIDE"]))
  39. # --with-lua and --with-luaversion
  40. AC_ARG_WITH([lua], [AS_HELP_STRING([--with-lua], [Select the lua implementation])],
  41. [], [with_lua=luajit])
  42. AC_ARG_WITH([luaversion], [AS_HELP_STRING([--with-luaversion], [Select the lua version])],
  43. [], [with_luaversion=5.1])
  44. with_clean_luaversion=`printf ${with_luaversion} | sed 's/\.//g'`
  45. # Generated sources for enabling/disabling modules
  46. m4_include([configure-modules.ac])
  47. # Other features that can be enabled/disabled
  48. AC_ARG_ENABLE([mpg123], AC_HELP_STRING([--disable-mpg123], [Disable mp3 support, for patent-free builds]), [], [enable_mpg123=yes])
  49. AC_ARG_ENABLE([gme], AC_HELP_STRING([--enable-gme], [Enable GME support, for more chiptuney goodness]), [], [enable_gme=no])
  50. ACLOVE_DEP_LUA
  51. ACLOVE_DEP_SDL2
  52. ACLOVE_DEP_LIBM
  53. ACLOVE_DEP_ZLIB
  54. AS_VAR_IF([enable_audio_openal], [true], [ACLOVE_DEP_OPENAL], [])
  55. AS_VAR_IF([enable_filesystem_physfs], [true], [ACLOVE_DEP_PHYSFS], [])
  56. AS_VAR_IF([enable_font_freetype], [true], [ACLOVE_DEP_FREETYPE2], [])
  57. AS_VAR_IF([enable_sound_lullaby], [true], [
  58. ACLOVE_DEP_LIBMODPLUG
  59. ACLOVE_DEP_VORBISFILE
  60. ], [enable_mpg123=no])
  61. AS_VAR_IF([enable_video_theora], [true], [ACLOVE_DEP_THEORA], [])
  62. AS_VAR_IF([enable_gme], [yes], [ACLOVE_DEP_GME], [])
  63. AS_VAR_IF([enable_mpg123], [no],
  64. AC_DEFINE([LOVE_NOMPG123], [], [Build without mpg123]),
  65. [ACLOVE_DEP_MPG123])
  66. # GME, treated seperately because it can be enabled (default off)
  67. # libenet check for socklen_t
  68. ACLOVE_SOCKLEN_T
  69. # Optionally build the executable (default on)
  70. AC_ARG_ENABLE([exe],
  71. AC_HELP_STRING([--disable-exe], [Disable building of executable launcher]), [], [enable_exe=yes])
  72. AS_VAR_IF([enable_exe], [no], [], #else
  73. AC_DEFINE([LOVE_BUILD_EXE], [], [Skip building launcher]))
  74. AM_CONDITIONAL([LOVE_BUILD_EXE], [test "x$enable_exe" != xno])
  75. AM_CONDITIONAL([LOVE_NOMPG123], [test "x$enable_mpg123" = xno])
  76. AM_CONDITIONAL([LOVE_TARGET_OSX], [test "x$enable_osx" != xno])
  77. # Automatic script file rebuilding
  78. AC_CHECK_PROGS([LUA_EXECUTABLE], ["${with_lua}${with_luaversion}" "${with_lua}" "lua"], [:])
  79. AS_VAR_IF([LUA_EXECUTABLE], [:],
  80. [AC_MSG_WARN([Did not find a lua executable, you may need to update the scripts manually if you change them])], [])
  81. # Set our includes as automake variable
  82. AC_SUBST([LOVE_INCLUDES], ["$includes"])
  83. AC_CONFIG_FILES([
  84. Makefile
  85. src/Makefile
  86. platform/unix/debian/control
  87. platform/unix/debian/changelog
  88. platform/unix/debian/rules
  89. ])
  90. AC_OUTPUT
  91. chmod 755 platform/unix/debian/rules