]> granicus.if.org Git - mutt/commitdiff
Introduce $dotlock_program: This makes the mutt_dotlock program's
authorThomas Roessler <roessler@does-not-exist.org>
Thu, 18 Feb 1999 22:11:27 +0000 (22:11 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Thu, 18 Feb 1999 22:11:27 +0000 (22:11 +0000)
location a run-time configuration variable.

Makefile.am
acconfig.h
configure.in
globals.h
init.h
mx.c

index e0d4937fbc5072571cc807671ca94507a7a94f64..5c5b57e5c2b2d5438a64a89aafa1d01f772f1c30 100644 (file)
@@ -19,7 +19,8 @@ mutt_SOURCES =        addrbook.c alias.c attach.c browser.c buffy.c color.c \
 mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(INTLLIBS) 
 mutt_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(INTLDEPS)
 
-DEFS=-DSHAREDIR=\"$(sharedir)\" -DSYSCONFDIR=\"$(sysconfdir)\"
+DEFS=-DSHAREDIR=\"$(sharedir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \
+       -DBINDIR=\"$(bindir)\" -DHAVE_CONFIG_H=1
 INCLUDES=-I. -I$(includedir)
 
 non_us_sources = pgp.c pgpinvoke.c pgpkey.c pgppubring.c sha1dgst.c \
index 8a3c86c545d66264e8ec79865734577445694281..6562ca29c367d8b4130b6a8ffe5c87c7c676af07 100644 (file)
@@ -26,6 +26,9 @@
 /* use dotlocking to lock mailboxes? */
 #undef USE_DOTLOCK
 
+/* use an external dotlocking program? */
+#undef DL_STANDALONE
+
 /* use flock() to lock mailboxes? */
 #undef USE_FLOCK
 
 
 /* Where are the character set definitions located? */
 #undef CHARMAPS_DIR
+
index 58555c26dabea740ab6e3a4d5b5a2b5fa7732d50..547771f22831fd62e54adf8a3fdbfcbefc4a23fb 100644 (file)
@@ -318,9 +318,13 @@ int main (int argc, char **argv)
        fi
 fi
 
-if test "x$mutt_cv_setgid" = "xyes" || test "x$mutt_cv_fchdir" = "xno"
+AC_ARG_ENABLE(external_dotlock, [  --enable-external-dotlock   Force use of an external dotlock program],
+       [mutt_cv_external_dotlock=yes])
+
+if test "x$mutt_cv_setgid" = "xyes" || test "x$mutt_cv_fchdir" = "xno" \
+       || test "x$mutt_cv_external_dotlock" = "xyes"
 then
-       CPPFLAGS="$CPPFLAGS -DDL_STANDALONE -DDOTLOCK=\"\\\"\$(bindir)/mutt_dotlock\\\"\""
+       AC_DEFINE(DL_STANDALONE)
        DOTLOCK_TARGET="mutt_dotlock"
 else
        MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS dotlock.o"
@@ -448,8 +452,6 @@ if test "$ac_cv_prog_CC" = gcc -a $mutt_cv_warnings = yes; then
        CFLAGS="-Wall -pedantic $CFLAGS"
 fi
 
-CFLAGS="-DHAVE_CONFIG_H=1 $CFLAGS"
-
 AC_ARG_ENABLE(nfs-fix, [  --enable-nfs-fix           Work around an NFS with broken attributes caching ],
        [if test x$enableval = xyes; then
                 AC_DEFINE(NFS_ATTRIBUTE_HACK)
index e035a941b06d757d77abe095e866234f77770cb6..deb89867b4a76a4e22d371f5c8c91d29a0c94634 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -22,6 +22,10 @@ WHERE CONTEXT *Context;
 
 WHERE char Errorbuf[SHORT_STRING];
 
+#if defined(DL_STANDALONE) && defined(USE_DOTLOCK)
+WHERE char *MuttDotlock;
+#endif
+
 WHERE char *AliasFile;
 WHERE char *AliasFmt;
 WHERE char *AttachSep;
diff --git a/init.h b/init.h
index aaf70fcbe040f0191c191e9c0473214801858296..8858b5f146dcbf60d410732dd088e479230eec35 100644 (file)
--- a/init.h
+++ b/init.h
@@ -95,6 +95,9 @@ struct option_t MuttVars[] = {
   { "date_format",     DT_STR,  R_BOTH, UL &DateFmt, UL "!%a, %b %d, %Y at %I:%M:%S%p %Z" },
   { "default_hook",    DT_STR,  R_NONE, UL &DefaultHook, UL "~f %s !~P | (~P ~C %s)" },
   { "delete",          DT_QUAD, R_NONE, OPT_DELETE, M_ASKYES },
+#if defined(DL_STANDALONE) && defined(USE_DOTLOCK)
+  { "dotlock_program",  DT_PATH, R_NONE, UL &MuttDotlock, UL BINDIR "/mutt_dotlock" },
+#endif
   { "dsn_notify",      DT_STR,  R_NONE, UL &DsnNotify, UL "" },
   { "dsn_return",      DT_STR,  R_NONE, UL &DsnReturn, UL "" },
   { "edit_headers",    DT_BOOL, R_NONE, OPTEDITHDRS, 0 },
diff --git a/mx.c b/mx.c
index 9c6b770b903fff82bb66b1994f70cbbf30aab482..12d696e546df3e7372f845c47aad10498ae5c3dd 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -78,14 +78,14 @@ static int invoke_dotlock (const char *path, int flags, int retry)
   mutt_quote_filename (f, sizeof (f), path);
   
   snprintf (cmd, sizeof (cmd),
-          "%s %s%s%s%s%s%s",
-          DOTLOCK,
-          flags & DL_FL_TRY ? "-t " : "",
-          flags & DL_FL_UNLOCK ? "-u " : "",
-          flags & DL_FL_USEPRIV ? "-p " : "",
-          flags & DL_FL_FORCE ? "-f " : "",
-          flags & DL_FL_RETRY ? r : "",
-          f);
+           "%s %s%s%s%s%s%s",
+           NONULL (MuttDotlock),
+           flags & DL_FL_TRY ? "-t " : "",
+           flags & DL_FL_UNLOCK ? "-u " : "",
+           flags & DL_FL_USEPRIV ? "-p " : "",
+           flags & DL_FL_FORCE ? "-f " : "",
+           flags & DL_FL_RETRY ? r : "",
+           f);
   
   return mutt_system (cmd);
 }