From bc89c69d31e242e2ff4589438f4eb5869d5899f9 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Fri, 18 May 2007 10:37:13 +0200 Subject: [PATCH] make configuration script slightly better. hide advanced settings. minor tweaks Signed-off-by: Pierre Habouzit --- CMakeLists.txt | 43 +++++++++++++++++++++++++------------------ cmake/XConfig.cmake | 1 + doconfig.sh | 8 +------- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2673f3b..ec93ee7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ ADD_DEFINITIONS("-DSYSCONFDIR=\\\"${SYSCONFDIR}\\\"") ADD_DEFINITIONS("-DVERSION=\\\"${VERSION}\\\"") ADD_DEFINITIONS("-DMUTTLOCALEDIR=\\\"${DATADIR}/locale\\\"") -OPTION(WITH_MAILPATH "Where new mail is spooled") +SET(MAILPATH CACHE STRING "Where new mail is spooled") OPTION(WITH_GPGME "Use GPGME [default: on]" ON) OPTION(WITH_NNTP "Build NNTP support [default: off]") OPTION(WITH_IDN "Use GNU libidn for domain names [default: off]") @@ -43,21 +43,28 @@ OPTION(USE_FLOCK "Use flock to lock files [default: off]") OPTION(USE_FCNTL "Use fcntl to lock files [default: on]" ON) OPTION(USE_HCACHE "Enable headers caching [default: off]") -FIND_FILE(GPERF gperf) -FIND_FILE(SENDMAIL sendmail PATHS /usr/sbin /sbin /usr/lib) -FIND_FILE(MIXMASTER mixmaster) - -IF(WITH_MAILPATH) - SET(MAILPATH ${WITH_MAILPATH}) -ELSEIF(EXISTS /var/mail) - SET(MAILPATH "/var/mail") -ELSEIF(EXISTS /var/spool/mail) - SET(MAILPATH "/var/spool/mail") -ELSEIF(EXISTS /usr/spool/mail) - SET(MAILPATH "/usr/spool/mail") -ELSEIF(EXISTS /usr/mail) - SET(MAILPATH "/usr/mail") -ENDIF(WITH_MAILPATH) +FIND_FILE(SENDMAIL sendmail + PATHS /usr/sbin /sbin /usr/lib + DOC "path to sendmail executable" +) +FIND_FILE(MIXMASTER mixmaster DOC "path to mixmaster") +IF(NOT MIXMASTER) + SET(MIXMASTER "mixmaster") +ENDIF(NOT MIXMASTER) + +IF(NOT MAILPATH) + IF(EXISTS /var/mail) + SET(MAILPATH "/var/mail") + ELSEIF(EXISTS /var/spool/mail) + SET(MAILPATH "/var/spool/mail") + ELSEIF(EXISTS /usr/spool/mail) + SET(MAILPATH "/usr/spool/mail") + ELSEIF(EXISTS /usr/mail) + SET(MAILPATH "/usr/mail") + ELSE(EXISTS /var/mail) + MESSAGE(FATAL_ERROR "Unable to determine MAILPATH") + ENDIF(EXISTS /var/mail) +ENDIF(NOT MAILPATH) # headers {{{ INCLUDE(CheckIncludeFile) @@ -240,10 +247,10 @@ IF(WITH_LIBESMTP) SET(MUTTLIBS "${MUTTLIBS} -lesmtp") ENDIF(WITH_LIBESMTP) -IF(WITH_NNTP) +IF(WITH_NNTP AND NOT USE_NNTP) SET(USE_NNTP 1) MESSAGE(STATUS "building NNTP support") -ENDIF(WITH_NNTP) +ENDIF(WITH_NNTP AND NOT USE_NNTP) # }}} # C flags {{{ diff --git a/cmake/XConfig.cmake b/cmake/XConfig.cmake index 53eb357..7277b1f 100644 --- a/cmake/XConfig.cmake +++ b/cmake/XConfig.cmake @@ -25,5 +25,6 @@ MACRO(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags) ELSE(${_package}CONFIG_EXECUTABLE) MESSAGE(STATUS "found ${_package}: no") ENDIF(${_package}CONFIG_EXECUTABLE) + MARK_AS_ADVANCED(${_package}CONFIG_EXECUTABLE) ENDMACRO(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags) diff --git a/doconfig.sh b/doconfig.sh index 8ebae85..f9ea5e6 100755 --- a/doconfig.sh +++ b/doconfig.sh @@ -1,7 +1 @@ -#./autogen.sh -#./configure -C --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \ -# --with-sharedir=/usr/share/mutt-ng --with-docdir=/usr/share/doc/mutt-ng \ -# --with-mailpath=/var/mail --enable-fcntl --with-idn --with-curses --enable-nntp \ -# --with-libesmtp --enable-gpgme --enable-hcache --enable-doc - -cmake -D WITH_NNTP=1 -D WITH_IDN=1 -D USE_HCACHE=1 -D WITH_LIBESMTP=1 . +cmake -D WITH_NNTP=1 -D WITH_IDN=1 -D USE_HCACHE=1 -D WITH_LIBESMTP=1 --with-prefix=/usr $(dirname $0) -- 2.20.1