PWD= @PWD@
AR= @AR@
CC= @CC@
-CC_FOR_BUILD= @CC_FOR_BUILD@
+CC_FOR_BUILD= @CC_FOR_BUILD@ @CFLAGS_FOR_BUILD@
CPP= @CPP@
CFLAGS= @CPPFLAGS@ @CFLAGS@ -I. -I@top_srcdir@ -Wall $(EXTRA_CFLAGS)
LDFLAGS= @LDFLAGS@ $(EXTRA_LDFLAGS)
if {[cc-check-standards c99] eq {}} {
user-error "C99 is required"
}
+ define-append CFLAGS_FOR_BUILD -std=c99
# Check for tools and programs
cc-check-tools ar ranlib strip
# Enable extensions (reverse-engineered from AC_SYSTEM_EXTENSIONS)
if {1} {
if {[cc-check-includes minix/config.h]} {
- define-append CFLAGS -D_POSIX_SOURCE=1
- define-append CFLAGS -D_POSIX_1_SOURCE=2
- define-append CFLAGS -D_MINIX=1
+ lappend extensions -D_POSIX_SOURCE=1
+ lappend extensions -D_POSIX_1_SOURCE=2
+ lappend extensions -D_MINIX=1
}
- define-append CFLAGS -D_ALL_SOURCE=1
- define-append CFLAGS -D_GNU_SOURCE=1
- define-append CFLAGS -D__EXTENSIONS__
+ lappend extensions -D_ALL_SOURCE=1
+ lappend extensions -D_GNU_SOURCE=1
+ lappend extensions -D__EXTENSIONS__
+ define-append CFLAGS_FOR_BUILD {*}$extensions
+ define-append CFLAGS {*}$extensions
}
cc-with [list -cflags [get-define CFLAGS]]
-MAKEDOC_CPP = $(CC_FOR_BUILD) $(CPPFLAGS) -D_MAKEDOC -E -C -I.
+MAKEDOC_CPP = $(CC_FOR_BUILD) -D_MAKEDOC -E -C -I.
doc/makedoc$(EXEEXT): doc/makedoc.c
- $(CC_FOR_BUILD) $(CPPFLAGS) $(CFLAGS) -o $@ doc/makedoc.c
+ $(CC_FOR_BUILD) -I. -o $@ doc/makedoc.c
doc/neomuttrc: $(SRCDIR)/init.h doc/makedoc$(EXEEXT) $(SRCDIR)/doc/neomuttrc.head
sed -e 's,@docdir@,$(docdir),' $(SRCDIR)/doc/neomuttrc.head \