configure.ac 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. dnl Process this file with autoconf to produce a configure script.
  2. dnl Created by Anjuta - will be overwritten
  3. dnl If you don't want it to overwrite it,
  4. dnl Please disable it in the Anjuta project configuration
  5. AC_INIT(configure.ac)
  6. AM_INIT_AUTOMAKE(berusky2, 0.12)
  7. AM_CONFIG_HEADER(config.h)
  8. AM_MAINTAINER_MODE
  9. AC_ISC_POSIX
  10. AC_PROG_CC
  11. AM_PROG_CC_STDC
  12. AC_HEADER_STDC
  13. AC_PROG_CPP
  14. AC_PROG_CXX
  15. GETTEXT_PACKAGE=berusky2
  16. AC_SUBST(GETTEXT_PACKAGE)
  17. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
  18. dnl Languages which your application supports
  19. ALL_LINGUAS=""
  20. AM_GLIB_GNU_GETTEXT
  21. AM_PROG_LIBTOOL
  22. PKG_CHECK_MODULES(SDL, [sdl SDL_image])
  23. AC_SUBST(SDL_CFLAGS)
  24. AC_SUBST(SDL_LIBS)
  25. PKG_CHECK_MODULES(OPENGL, [gl glu])
  26. AC_SUBST(OPENGL_CFLAGS)
  27. AC_SUBST(OPENGL_LIBS)
  28. PKG_CHECK_MODULES(X11, [x11])
  29. AC_SUBST(X11_CFLAGS)
  30. AC_SUBST(X11_LIBS)
  31. PKG_CHECK_MODULES(ZLIB, [zlib])
  32. AC_SUBST(ZLIB_CFLAGS)
  33. AC_SUBST(ZLIB_LIBS)
  34. PKG_CHECK_MODULES(SOUND, [openal freealut vorbisfile])
  35. AC_SUBST(SOUND_CFLAGS)
  36. AC_SUBST(SOUND_LIBS)
  37. CFLAGS="$CFLAGS $SDL_CFLAGS $OPENGL_CFLAGS $X11_CFLAGS $SOUND_CFLAGS $ZLIB_CFLAGS"
  38. CXXFLAGS="$CXXFLAGS $SDL_CFLAGS $OPENGL_CFLAGS $X11_CFLAGS $SOUND_CFLAGS $ZLIB_CFLAGS"
  39. LDFLAGS="$LDFLAGS $SDL_LIBS $OPENGL_LIBS $X11_LIBS $SOUND_LIBS $ZLIB_LIBS"
  40. # https://github.com/stransky/berusky2/issues/23
  41. LDFLAGS="$LDFLAGS -lpthread"
  42. AC_SUBST(CFLAGS)
  43. AC_SUBST(CXXFLAGS)
  44. AC_SUBST(LDFLAGS)
  45. AC_ARG_WITH([user_directory],
  46. AS_HELP_STRING([--with-user-directory=DIR], [User directory location (default is ~/.berusky2)]))
  47. if test "x$with_user_directory" != x; then
  48. AC_DEFINE_UNQUOTED([INI_USER_DIRECTORY], [$with_user_directory], [Default user directory location.])
  49. else
  50. AC_DEFINE_UNQUOTED([INI_USER_DIRECTORY], ["~/.berusky2"], [Default user directory location.])
  51. fi
  52. AC_ARG_WITH([saves_directory],
  53. AS_HELP_STRING([--with-saves-directory=DIR], [Game saves dir (default is ~/.berusky2/Save)]))
  54. if test "x$with_saves_directory" != x; then
  55. AC_DEFINE_UNQUOTED([INI_SAVES_DIRECTORY], [$with_saves_directory], [Game saves dir])
  56. else
  57. AC_DEFINE_UNQUOTED([INI_SAVES_DIRECTORY], ["~/.berusky2/Save"], [Game saves dir])
  58. fi
  59. AC_ARG_WITH([profile_directory],
  60. AS_HELP_STRING([--with-profile-directory=DIR], [User profiles dir (default is ~/.berusky2/Save/profiles)]))
  61. if test "x$with_profile_directory" != x; then
  62. AC_DEFINE_UNQUOTED([INI_PROFILE_DIRECTORY], [$with_profile_directory], [User profile dir.])
  63. else
  64. AC_DEFINE_UNQUOTED([INI_PROFILE_DIRECTORY], ["~/.berusky2/Save/profiles"], [User profile dir.])
  65. fi
  66. AC_ARG_WITH([ini_file],
  67. AS_HELP_STRING([--with-ini-file=NAME], [Define ini file name (default is berusky3d.ini)]))
  68. if test "x$with_ini_file" != x; then
  69. AC_DEFINE_UNQUOTED([INI_FILE_NAME], [$with_ini_file], [Game ini file])
  70. else
  71. AC_DEFINE_UNQUOTED([INI_FILE_NAME], ["berusky3d.ini"], [Game ini file])
  72. fi
  73. AC_ARG_WITH([ini_file_global_dir],
  74. AS_HELP_STRING([--with-ini-file-global-dir=DIR], [Location of global ini file (default is /var/games/berusky2)]))
  75. if test "x$with_ini_file_global_dir" != x; then
  76. AC_DEFINE_UNQUOTED([INI_FILE_GLOBAL_DIR], [$with_ini_file_global_dir], [Global ini file dir.])
  77. else
  78. AC_DEFINE_UNQUOTED([INI_FILE_GLOBAL_DIR], ["/var/games/berusky2"], [Global ini file dir.])
  79. fi
  80. dnl Set PACKAGE_LOCALE_DIR in config.h.
  81. if test "x${prefix}" = "xNONE"; then
  82. AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale", [Package local directory])
  83. else
  84. AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale", [Package local directory])
  85. fi
  86. dnl Set PACKAGE SOURCE DIR in config.h.
  87. packagesrcdir=`cd $srcdir && pwd`
  88. dnl Set PACKAGE PREFIX
  89. if test "x${prefix}" = "xNONE"; then
  90. packageprefix=${ac_default_prefix}
  91. else
  92. packageprefix=${prefix}
  93. fi
  94. dnl Set PACKAGE DATA & DOC DIR
  95. packagedatadir=share
  96. packagedocdir=doc/${PACKAGE}
  97. dnl Set PACKAGE DIRS in config.h.
  98. packagepixmapsdir=${packagedatadir}/pixmaps
  99. packagehelpdir=${packagedatadir}/help
  100. packagemenudir=${packagedatadir}
  101. dnl Subst PACKAGE_DATA_DIR.
  102. NO_PREFIX_PACKAGE_DATA_DIR="${packagedatadir}"
  103. AC_SUBST(NO_PREFIX_PACKAGE_DATA_DIR)
  104. PACKAGE_DATA_DIR="${packageprefix}/${packagedatadir}"
  105. AC_SUBST(PACKAGE_DATA_DIR)
  106. dnl Subst PACKAGE_DOC_DIR.
  107. NO_PREFIX_PACKAGE_DOC_DIR="${packagedocdir}"
  108. AC_SUBST(NO_PREFIX_PACKAGE_DOC_DIR)
  109. PACKAGE_DOC_DIR="${packageprefix}/${packagedocdir}"
  110. AC_SUBST(PACKAGE_DOC_DIR)
  111. dnl Subst PACKAGE_PIXMAPS_DIR.
  112. NO_PREFIX_PACKAGE_PIXMAPS_DIR="${packagepixmapsdir}"
  113. AC_SUBST(NO_PREFIX_PACKAGE_PIXMAPS_DIR)
  114. PACKAGE_PIXMAPS_DIR="${packageprefix}/${packagepixmapsdir}"
  115. AC_SUBST(PACKAGE_PIXMAPS_DIR)
  116. dnl Subst PACKAGE_HELP_DIR.
  117. NO_PREFIX_PACKAGE_HELP_DIR="${packagehelpdir}"
  118. AC_SUBST(NO_PREFIX_PACKAGE_HELP_DIR)
  119. PACKAGE_HELP_DIR="${packageprefix}/${packagehelpdir}"
  120. AC_SUBST(PACKAGE_HELP_DIR)
  121. dnl Subst PACKAGE_MENU_DIR.
  122. NO_PREFIX_PACKAGE_MENU_DIR="${packagemenudir}"
  123. AC_SUBST(NO_PREFIX_PACKAGE_MENU_DIR)
  124. PACKAGE_MENU_DIR="${packageprefix}/${packagemenudir}"
  125. AC_SUBST(PACKAGE_MENU_DIR)
  126. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${packageprefix}/${packagedatadir}")
  127. AC_DEFINE_UNQUOTED(PACKAGE_DOC_DIR, "${packageprefix}/${packagedocdir}")
  128. AC_DEFINE_UNQUOTED(PACKAGE_PIXMAPS_DIR, "${packageprefix}/${packagepixmapsdir}")
  129. AC_DEFINE_UNQUOTED(PACKAGE_HELP_DIR, "${packageprefix}/${packagehelpdir}")
  130. AC_DEFINE_UNQUOTED(PACKAGE_MENU_DIR, "${packageprefix}/${packagemenudir}")
  131. AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
  132. AC_OUTPUT([
  133. Makefile
  134. po/Makefile.in
  135. src/Makefile
  136. data/Makefile
  137. ])