summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2017-07-10 12:14:05 (GMT)
committerMilan Crha <mcrha@redhat.com>2017-07-10 12:20:30 (GMT)
commitf03000e095a6083b334ee540397291baf1ff7dac (patch)
treecb10c27643f7c7cd3ecccb76e4f40b83a1851986
parentfe7d307e008c145855a72542345575d8286171c3 (diff)
downloadevolution-data-server-f03000e.zip
evolution-data-server-f03000e.tar.xz
Warn and set default when sendmail not found during the build
When sendmail is not available when building, the corresponding SENDMAIL_PATH variable contains useless value. This change makes it possible to define SENDMAIL_PATH as an environment variable, which then points to the sendmail binary (like "/usr/sbin/sendmail"), and if not set, then it is searched for and when even that fails, then a default is used. There had been also SYSTEM_MAIL_DIR variable, but it was not used anywhere, thus it's removed now. The issue with missing sendmail had been reported at: https://bugzilla.redhat.com/show_bug.cgi?id=1468890
-rw-r--r--CMakeLists.txt11
-rw-r--r--config.h.in3
2 files changed, 9 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c1f4e9..7ff5870 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -605,8 +605,15 @@ CHECK_C_SOURCE_RUNS("
# system mail stuff
# ******************************
-find_program(SENDMAIL_PATH sendmail /usr/sbin /usr/lib)
-find_path(SYSTEM_MAIL_DIR /var/mail /var/spool/mail)
+if("$ENV{SENDMAIL_PATH}" STREQUAL "")
+ find_program(SENDMAIL_PATH sendmail /usr/sbin /usr/lib)
+ if(NOT SENDMAIL_PATH)
+ set(SENDMAIL_PATH "/usr/sbin/sendmail")
+ message(WARNING "sendmail not found, defaulting to ${SENDMAIL_PATH}")
+ endif(NOT SENDMAIL_PATH)
+else("$ENV{SENDMAIL_PATH}" STREQUAL "")
+ set(SENDMAIL_PATH $ENV{SENDMAIL_PATH})
+endif("$ENV{SENDMAIL_PATH}" STREQUAL "")
# ******************************
# Timezone checks
diff --git a/config.h.in b/config.h.in
index ba1c33e..6d4e506 100644
--- a/config.h.in
+++ b/config.h.in
@@ -39,9 +39,6 @@
/* Path to a sendmail binary, or equivalent */
#define SENDMAIL_PATH "@SENDMAIL_PATH@"
-/* Directory local mail is delivered to */
-#define SYSTEM_MAIL_DIR "@SYSTEM_MAIL_DIR@"
-
/* Configured with enabled maintainer mode */
#cmakedefine ENABLE_MAINTAINER_MODE 1