X-Git-Url: https://ruderich.org/simon/gitweb/?p=wall-notify%2Fwall-notify.git;a=blobdiff_plain;f=configure.ac;h=7b4ab5a39de5b51a651400cc88067c4861eded41;hp=582be6dab0cbb0284315883df70a9d255ab7a3ae;hb=HEAD;hpb=2c0433b2dd29753ed82a124ba3b65a0d33da474c diff --git a/configure.ac b/configure.ac index 582be6d..7b4ab5a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -dnl Copyright (C) 2014 Simon Ruderich +dnl Copyright (C) 2014-2015 Simon Ruderich dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -43,9 +43,13 @@ if test "x$ac_cv_header_utempter_h" = xyes; then AC_CHECK_LIB([utempter], [utempter_remove_record], [], [AC_MSG_ERROR([utempter_remove_record() required])]) AC_DEFINE([USE_UTEMPTER], 1, [Define to 1 to use utempter.]) + elif test "x$ac_cv_header_utmpx_h" = xyes; then AC_MSG_NOTICE([using utmp]) + AC_CHECK_FUNCS([setresuid setresgid],[], + [AC_MSG_ERROR([setresuid() and setresgid() required for utmpx])]) AC_DEFINE([USE_UTMPX], 1, [Define to 1 to use utmp.]) + else AC_MSG_ERROR([neither utmpx.h nor utempter.h found, aborting]) fi @@ -54,7 +58,30 @@ AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T -AC_CONFIG_FILES([Makefile src/Makefile]) +disable_x11_support= +AC_ARG_ENABLE([x11], + [AS_HELP_STRING([--disable-x11], [disable x11 support])], + [if test "x$enableval" = xno; then + disable_x11_support=yes + AC_DEFINE([DONT_USE_X11], 1, [Define to not use X11.]) + fi]) + +if test -z "$disable_x11_support"; then + AX_PTHREAD([], + [AC_MSG_ERROR([pthread is required for X, use --disable-x11])]) + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$PTHREAD_CFLAGS $CFLAGS" + CC="$PTHREAD_CC" + + AC_PATH_XTRA + if test x"$no_x" = xyes; then + AC_MSG_ERROR([X11 is required, use --disable-x11]) + fi + LIBS="$X_PRE_LIBS $X_EXTRA_LIBS $X_LIBS -lX11 $LIBS" + CFLAGS="$X_CFLAGS $CFLAGS" +fi + +AC_CONFIG_FILES([Makefile src/Makefile man/Makefile]) AC_OUTPUT if test "x$ac_cv_header_utempter_h" != xyes; then