make configuration script slightly better.
authorPierre Habouzit <madcoder@debian.org>
Fri, 18 May 2007 08:37:13 +0000 (10:37 +0200)
committerPierre Habouzit <madcoder@debian.org>
Fri, 18 May 2007 08:37:13 +0000 (10:37 +0200)
  hide advanced settings.
  minor tweaks

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
CMakeLists.txt
cmake/XConfig.cmake
doconfig.sh

index 2673f3b..ec93ee7 100644 (file)
@@ -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 {{{
index 53eb357..7277b1f 100644 (file)
@@ -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)
 
index 8ebae85..f9ea5e6 100755 (executable)
@@ -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)