From 856625f6652a34d8b1235286705d06d65da4db65 Mon Sep 17 00:00:00 2001 From: "Steffen \"Daode\" Nurpmeso" Date: Fri, 27 Dec 2013 15:20:35 +0100 Subject: [PATCH] =?utf8?q?mk-conf.sh+:=20$CFLAGS+=20only=20if=20WANT=5FAUT?= =?utf8?q?OCC=3D1=20(J=C3=BCrgen=20Daubert)..?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It seems packagers want to have the capability to set $CFLAGS to the empty string, so only set $CFLAGS and $LDFLAGS when WANT_AUTOCC=1, not also automatically when they are not set at all (or to the empty string). --- conf.rc | 9 +++++---- mk-conf.sh | 13 ++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/conf.rc b/conf.rc index 776e1ba2..7e0d2986 100644 --- a/conf.rc +++ b/conf.rc @@ -20,10 +20,11 @@ # S-nail automatically detects compilers and has a set of known compiler flags # which work well. Since users should be able to define their own $CC, $CFLAGS # and $LDFLAGS, however, it only uses the detected environment if the user -# has either not set those values at all, are has set them to the empty value. -# To always force use of S-nail build system detected values, set WANT_AUTOCC. -# Note: it is possible to add to the detected values by setting ADDCFLAGS= -# and/or ADDLDFLAGS= (with proper configuration-changed detection)! +# forces their usage via setting WANT_AUTOCC=1. (Except for $CC, which is +# always set if it's empty or set to "cc".) +# Note: it is possible to add to the detected values by setting ADDCFLAGS="xy" +# and/or ADDLDFLAGS="xy" -- "configuration-has-changed" detection will work on +# the final $CC / $CFLAGS / $LDFLAGS, and thus will include those additions WANT_AUTOCC=0 # It is possible to compile S-nail as a "single-source", meaning that all diff --git a/mk-conf.sh b/mk-conf.sh index c91709c0..795da277 100644 --- a/mk-conf.sh +++ b/mk-conf.sh @@ -141,13 +141,10 @@ compiler_flags() { _LDFLAGS="${_LDFLAGS} ${ADDLDFLAGS}" # XXX -Wl,--sort-common,[-O1] export _CFLAGS _LDFLAGS - if wantfeat AUTOCC || [ -z "${CFLAGS}" ]; then + if wantfeat AUTOCC; then CFLAGS=$_CFLAGS - export CFLAGS - fi - if wantfeat AUTOCC || [ -z "${LDFLAGS}" ]; then LDFLAGS=$_LDFLAGS - export LDFLAGS + export CFLAGS LDFLAGS fi } @@ -1079,11 +1076,13 @@ printf '# ifdef HAVE_POP3\n ",POP3"\n# endif\n' >> ${h} printf '# ifdef HAVE_SMTP\n ",SMTP"\n# endif\n' >> ${h} printf '# ifdef HAVE_SPAM\n ",SPAM"\n# endif\n' >> ${h} printf '# ifdef HAVE_IDNA\n ",IDNA"\n# endif\n' >> ${h} -printf '# if defined HAVE_READLINE || defined HAVE_EDITLINE || '\ -'defined HAVE_NCL\n ",COMMAND LINE EDITOR"\n# endif\n' >> ${h} +printf '# ifdef HAVE_READLINE\n ",READLINE"\n# endif\n' >> ${h} +printf '# ifdef HAVE_EDITLINE\n ",EDITLINE"\n# endif\n' >> ${h} +printf '# ifdef HAVE_NCL\n ",NCL"\n# endif\n' >> ${h} printf '# ifdef HAVE_TABEXPAND\n ",TABEXPAND"\n# endif\n' >> ${h} printf '# ifdef HAVE_HISTORY\n ",HISTORY MANAGEMENT"\n# endif\n' >> ${h} printf '# ifdef HAVE_QUOTE_FOLD\n ",QUOTE-FOLD"\n# endif\n' >> ${h} +printf '# ifdef HAVE_DEBUG\n ",DEBUG"\n# endif\n' >> ${h} printf ';\n#endif /* _MAIN_SOURCE */\n' >> ${h} printf '#endif /* _CONFIG_H */\n' >> ${h} -- 2.11.4.GIT