diff options
| author | Milan Crha <mcrha@redhat.com> | 2017-07-10 12:14:05 (GMT) |
|---|---|---|
| committer | Milan Crha <mcrha@redhat.com> | 2017-07-10 12:20:30 (GMT) |
| commit | f03000e095a6083b334ee540397291baf1ff7dac (patch) | |
| tree | cb10c27643f7c7cd3ecccb76e4f40b83a1851986 | |
| parent | fe7d307e008c145855a72542345575d8286171c3 (diff) | |
| download | evolution-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.txt | 11 | ||||
| -rw-r--r-- | config.h.in | 3 |
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 |