You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

276 lines
8.0 KiB

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(lightdm, 1.26.0)
  3. AC_CONFIG_MACRO_DIR(m4)
  4. AC_CONFIG_HEADER(config.h)
  5. AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz foreign])
  6. AM_SILENT_RULES(yes)
  7. AC_PROG_CC_C99
  8. LT_INIT
  9. AM_PROG_CC_C_O
  10. AC_PROG_CXX
  11. AC_PROG_LIBTOOL
  12. AC_PROG_LN_S
  13. AC_PROG_MKDIR_P
  14. AM_MAINTAINER_MODE
  15. dnl Check if the compiler really supports `-std=c99`.
  16. if test "x$ac_cv_prog_cc_c99" == xno; then
  17. AC_MSG_ERROR([$CC does not support '-std=c99'.])
  18. fi
  19. dnl Enable compile warnings (only supporting GCC)
  20. if test "x$GCC" == xyes; then
  21. WARN_CFLAGS="-Wall \
  22. -Wstrict-prototypes \
  23. -Wnested-externs \
  24. -Werror=missing-prototypes \
  25. -Werror=implicit-function-declaration \
  26. -Werror=pointer-arith \
  27. -Werror=init-self \
  28. -Werror=format-security \
  29. -Werror=format=2 \
  30. -Werror=missing-include-dirs"
  31. WARN_CXXFLAGS="-Wall"
  32. fi
  33. AC_SUBST(WARN_CFLAGS)
  34. AC_SUBST(WARN_CXXFLAGS)
  35. GOBJECT_INTROSPECTION_CHECK(0.9.5)
  36. VAPIGEN_CHECK([0.16])
  37. dnl ###########################################################################
  38. dnl Dependencies
  39. dnl ###########################################################################
  40. AC_CHECK_HEADERS(security/pam_appl.h, [], AC_MSG_ERROR(PAM not found))
  41. AC_CHECK_HEADERS(gcrypt.h, [], AC_MSG_ERROR(libgcrypt not found))
  42. AC_CHECK_FUNCS(setresgid setresuid clearenv)
  43. PKG_CHECK_MODULES(LIGHTDM, [
  44. glib-2.0 >= 2.44
  45. gio-2.0 >= 2.26
  46. gio-unix-2.0
  47. xdmcp
  48. xcb
  49. ])
  50. PKG_CHECK_MODULES(GLIB, [
  51. glib-2.0
  52. ])
  53. PKG_CHECK_MODULES(GIO, [
  54. gio-2.0
  55. ])
  56. PKG_CHECK_MODULES(GIO_UNIX, [
  57. gio-unix-2.0
  58. ])
  59. PKG_CHECK_MODULES(GOBJECT, [
  60. gobject-2.0
  61. ])
  62. PKG_CHECK_MODULES(XCB, [
  63. xcb
  64. ])
  65. PKG_CHECK_MODULES(LIBLIGHTDM_GOBJECT, [
  66. glib-2.0 >= 2.44
  67. gio-2.0 >= 2.26
  68. gio-unix-2.0
  69. gobject-2.0
  70. libxklavier
  71. x11
  72. ])
  73. AC_ARG_ENABLE(liblightdm-qt,
  74. AS_HELP_STRING([--enable-liblightdm-qt],[Enable LightDM client Qt4 libraries [[default=auto]]]),
  75. [enable_liblightdm_qt4=$enableval],
  76. [enable_liblightdm_qt4="auto"])
  77. compile_liblightdm_qt4=no
  78. if test x"$enable_liblightdm_qt4" != "xno" ; then
  79. PKG_CHECK_MODULES(LIBLIGHTDM_QT4, [
  80. QtCore
  81. QtDBus
  82. QtGui
  83. ],
  84. [compile_liblightdm_qt4=yes],
  85. [if test "x$enable_liblightdm_qt4" != xauto; then
  86. AC_MSG_FAILURE(
  87. [--enable-liblightdm-qt was given, but test for Qt4 failed])
  88. fi
  89. ])
  90. AC_CHECK_TOOLS(MOC4, [moc-qt4 moc])
  91. if test x$MOC4 = x; then
  92. compile_liblightdm_qt4=no
  93. if test "x$enable_liblightdm_qt4" != xauto; then
  94. AC_MSG_FAILURE(
  95. [--enable-liblightdm-qt4 was given, but MOC not found])
  96. fi
  97. fi
  98. if test x"$MOC4" = xmoc; then
  99. if test x"$(readlink $(which $MOC4))" = xqtchooser; then
  100. MOC4="$MOC4 --qt=4"
  101. fi
  102. fi
  103. fi
  104. AM_CONDITIONAL(COMPILE_LIBLIGHTDM_QT4, test x"$compile_liblightdm_qt4" != "xno")
  105. AC_ARG_ENABLE(liblightdm-qt5,
  106. AS_HELP_STRING([--enable-liblightdm-qt5],[Enable LightDM client Qt5 libraries [[default=auto]]]),
  107. [enable_liblightdm_qt5=$enableval],
  108. [enable_liblightdm_qt5="auto"])
  109. compile_liblightdm_qt5=no
  110. if test x"$enable_liblightdm_qt5" != "xno"; then
  111. PKG_CHECK_MODULES(LIBLIGHTDM_QT5, [
  112. Qt5Core
  113. Qt5DBus
  114. Qt5Gui
  115. ],
  116. [compile_liblightdm_qt5=yes],
  117. [if test "x$enable_liblightdm_qt5" != xauto; then
  118. AC_MSG_FAILURE(
  119. [--enable-liblightdm-qt5 was given, but test for Qt5 failed])
  120. fi
  121. ])
  122. AC_CHECK_TOOLS(MOC5, [moc-qt5 moc])
  123. if test x$MOC5 = x; then
  124. compile_liblightdm_qt5=no
  125. if test "x$enable_liblightdm_qt5" != xauto; then
  126. AC_MSG_FAILURE(
  127. [--enable-liblightdm-qt5 was given, but MOC not found])
  128. fi
  129. fi
  130. if test x"$MOC5" = xmoc; then
  131. if test x"$(readlink $(which $MOC5))" = xqtchooser; then
  132. MOC5="$MOC5 --qt=5"
  133. fi
  134. fi
  135. fi
  136. AM_CONDITIONAL(COMPILE_LIBLIGHTDM_QT5, test x"$compile_liblightdm_qt5" != "xno")
  137. AC_ARG_ENABLE([libaudit],
  138. AS_HELP_STRING([--enable-libaudit],
  139. [Enable libaudit logging of login and logout events [[default=auto]]]),
  140. [enable_libaudit=$enableval],
  141. [enable_libaudit=auto])
  142. use_libaudit=no
  143. if test x"$enable_libaudit" != "xno"; then
  144. AC_CHECK_LIB([audit], [audit_log_user_message],
  145. [use_libaudit=yes
  146. AC_DEFINE(HAVE_LIBAUDIT, 1, [libaudit support])
  147. LIGHTDM_LIBS="${LIGHTDM_LIBS} -laudit"
  148. ],
  149. [if test "x$enable_libaudit" != xauto; then
  150. AC_MSG_FAILURE(
  151. [--enable-libaudit was given, but test for libaudit failed])
  152. fi
  153. ])
  154. fi
  155. AC_MSG_CHECKING(whether to build tests)
  156. AC_ARG_ENABLE(tests,
  157. AS_HELP_STRING([--disable-tests], [Disable tests building]),
  158. [], [enable_tests="yes"])
  159. AM_CONDITIONAL(COMPILE_TESTS, test x"$enable_tests" != "xno")
  160. dnl ###########################################################################
  161. dnl Configurable values
  162. dnl ###########################################################################
  163. DEFAULT_USER_SESSION=default
  164. AC_ARG_WITH(user-session,
  165. AS_HELP_STRING(--with-user-session=<name>,
  166. Session to use for user accounts),
  167. if test x$withval != x; then
  168. DEFAULT_USER_SESSION="$withval"
  169. fi
  170. )
  171. AC_SUBST(DEFAULT_USER_SESSION)
  172. AC_DEFINE_UNQUOTED(DEFAULT_USER_SESSION, "$DEFAULT_USER_SESSION", User session)
  173. DEFAULT_GREETER_SESSION=default
  174. AC_ARG_WITH(greeter-session,
  175. AS_HELP_STRING(--with-greeter-session=<session>,
  176. Greeter session),
  177. if test x$withval != x; then
  178. DEFAULT_GREETER_SESSION="$withval"
  179. fi
  180. )
  181. AC_SUBST(DEFAULT_GREETER_SESSION)
  182. AC_DEFINE_UNQUOTED(DEFAULT_GREETER_SESSION, "$DEFAULT_GREETER_SESSION", Greeter session)
  183. GREETER_USER=lightdm
  184. AC_ARG_WITH(greeter-user,
  185. AS_HELP_STRING(--with-greeter-user=<username>,
  186. User to run greeter as),
  187. if test x$withval != x; then
  188. GREETER_USER="$withval"
  189. fi
  190. )
  191. AC_SUBST(GREETER_USER)
  192. AC_DEFINE_UNQUOTED(GREETER_USER, "$GREETER_USER", User to run greeter as)
  193. dnl ###########################################################################
  194. dnl Documentation
  195. dnl ###########################################################################
  196. GTK_DOC_CHECK
  197. YELP_HELP_INIT
  198. dnl ###########################################################################
  199. dnl Internationalization
  200. dnl ###########################################################################
  201. IT_PROG_INTLTOOL(0.35.0)
  202. AC_SUBST(GETTEXT_PACKAGE, lightdm)
  203. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", Gettext package)
  204. dnl ###########################################################################
  205. dnl Files to generate
  206. dnl ###########################################################################
  207. AC_CONFIG_FILES([
  208. Makefile
  209. common/Makefile
  210. data/Makefile
  211. doc/Makefile
  212. help/Makefile
  213. liblightdm-gobject/liblightdm-gobject-1.pc
  214. liblightdm-gobject/Makefile
  215. liblightdm-qt/Makefile
  216. liblightdm-qt/liblightdm-qt-3.pc
  217. liblightdm-qt/liblightdm-qt5-3.pc
  218. po/Makefile.in
  219. src/Makefile
  220. tests/Makefile
  221. tests/src/Makefile
  222. ])
  223. AC_OUTPUT
  224. dnl ###########################################################################
  225. dnl Summary
  226. dnl ###########################################################################
  227. echo "
  228. Light Display Manager $VERSION
  229. ===========================
  230. prefix: $prefix
  231. Greeter session: $DEFAULT_GREETER_SESSION
  232. Greeter user: $GREETER_USER
  233. User session: $DEFAULT_USER_SESSION
  234. GObject introspection: $found_introspection
  235. Vala bindings: $enable_vala
  236. liblightdm-qt: $compile_liblightdm_qt4
  237. liblightdm-qt5: $compile_liblightdm_qt5
  238. libaudit support: $use_libaudit
  239. Enable tests: $enable_tests
  240. "