aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-07-13 09:39:03 +0300
committerSergey Poznyakoff <gray@gnu.org>2020-07-13 09:39:03 +0300
commit142252826b38a0d87dd24b65c337770fc01b2daf (patch)
tree7f244811f85dfb2f871e3af788ac2d0a15e583be
parent135a42227021e7091fe5f5d8d00ae71c159cbab6 (diff)
downloadmailfromd-142252826b38a0d87dd24b65c337770fc01b2daf.tar.gz
mailfromd-142252826b38a0d87dd24b65c337770fc01b2daf.tar.bz2
Fix compilation without external preprocessor
-rw-r--r--configure.ac6
-rw-r--r--src/Makefile.am5
-rw-r--r--src/lex.l4
3 files changed, 12 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 40aa774d..7f555044 100644
--- a/configure.ac
+++ b/configure.ac
@@ -263,13 +263,19 @@ if test $use_ext_pp != no; then
AC_PATH_PROG(PPBIN, $DEFAULT_PREPROCESSOR)
DEFAULT_PREPROCESSOR=$PPBIN
if test -n "$DEFAULT_PREPROCESSOR"; then
+ use_ext_pp=yes
DEFAULT_PREPROCESSOR="$DEFAULT_PREPROCESSOR $PREPROC_OPTIONS"
case $PPBIN in
*m4) AC_SUBST(PP_SETUP_FILE,'pp-setup');; # Install default pp-setup
esac
+ else
+ use_ext_pp=no
fi
PATH=$save_PATH
+else
+ unset DEFAULT_PREPROCESSOR
fi
+AM_CONDITIONAL([PREPROC_COND], [test "$use_ext_pp" = yes])
AC_ARG_WITH([readline],
AC_HELP_STRING([--without-readline],
diff --git a/src/Makefile.am b/src/Makefile.am
index 1d92912d..6d7f30f3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -120,9 +120,12 @@ AM_CPPFLAGS=\
-DDEFAULT_SOCKET=\"$(DEFAULT_SOCKET)\"\
-DDEFAULT_VERSION_INCLUDE_DIR=\"$(incdir)\"\
-DDEFAULT_INCLUDE_DIR=\"$(pkgdatadir)/include\"\
- -DDEFAULT_PREPROCESSOR="\"$(DEFAULT_PREPROCESSOR)\""\
-DLOCALEDIR=\"$(localedir)\"
+if PREPROC_COND
+ AM_CPPFLAGS += -DDEFAULT_PREPROCESSOR="\"$(DEFAULT_PREPROCESSOR)\""
+endif
+
if NETTLE_COND
AM_CPPFLAGS += -DWITH_DKIM=1
endif
diff --git a/src/lex.l b/src/lex.l
index e0defb47..eb9a7f80 100644
--- a/src/lex.l
+++ b/src/lex.l
@@ -1232,10 +1232,10 @@ builtin_const_value(const char *s, size_t len, const char **sval, long *nval)
*sval = DEFAULT_STATE_DIR;
return dtype_string;
} else if (strncmp(s, "__preproc__", len) == 0) {
- *sval = ext_pp;
+ *sval = ext_pp ? ext_pp : "";
return dtype_string;
} else if (strncmp(s, "__defpreproc__", len) == 0) {
- *sval = (DEFAULT_PREPROCESSOR) ? DEFAULT_PREPROCESSOR : "";
+ *sval = DEF_EXT_PP ? DEF_EXT_PP : "";
return dtype_string;
} else if (strncmp(s, "__module__", len) == 0) {
*sval = top_module->dclname ? top_module->dclname : top_module->name;

Return to:

Send suggestions and report system problems to the System administrator.