From: Mingli Yu <[email protected]> Explicitly make the BUILT_SOURCES which are the generated headers such as stdio.h, fcntl.h and etc to be the dependencies of the gl_LIBOBJS such as libbison_a-sprintf.o, libbison_a-printf.o and etc to guarantee the BUILT_SOURCES is generated before begin to compile EXTRA_lib_libbison_a_SOURCES such as fprintf.c in parallel builid, otherwise there may come below error: | muscle-tab.c:(.text+0x77a): undefined reference to `rpl_sprintf'
It does the same for src_bison_OBJECTS and lib_libbison_a_OBJECTS to make sure BUILT_SOURCES generated before begin to compile src_bison_SOURCES which contains AnnotationList.c and etc. BTW, the MOSTLYCLEANFILES also contains the generated header needs to be created early in the build process, so add it also in to avoid below error: | ./lib/uniwidth/width.c:21:10: fatal error: uniwidth.h: No such file or directory Signed-off-by: Mingli Yu <[email protected]> --- lib/gnulib.mk | 41 +++++++++-------------------------------- src/local.mk | 6 +++--- 2 files changed, 12 insertions(+), 35 deletions(-) diff --git a/lib/gnulib.mk b/lib/gnulib.mk index 5ce2a5c..27fb3dc 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk @@ -76,7 +76,6 @@ # progname \ # quote \ # quotearg \ -# readline \ # readme-release \ # realloc-posix \ # relocatable-prog \ @@ -121,6 +120,8 @@ lib_libbison_a_SOURCES = lib_libbison_a_LIBADD = $(gl_LIBOBJS) lib_libbison_a_DEPENDENCIES = $(gl_LIBOBJS) EXTRA_lib_libbison_a_SOURCES = +$(lib_libbison_a_OBJECTS): $(BUILT_SOURCES) $(MOSTLYCLEANFILES:%.h) +$(gl_LIBOBJS): $(BUILT_SOURCES) $(MOSTLYCLEANFILES:%.h) lib_libbison_a_CPPFLAGS = $(AM_CPPFLAGS) -DDEFAULT_TEXT_DOMAIN=\"bison-gnulib\" @@ -400,6 +401,13 @@ EXTRA_DIST += $(top_srcdir)/build-aux/do-release-commit-and-tag ## end gnulib module do-release-commit-and-tag +## begin gnulib module dosname + + +EXTRA_DIST += lib/dosname.h + +## end gnulib module dosname + ## begin gnulib module dup2 @@ -670,17 +678,6 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gendocs.sh ## end gnulib module gendocs -## begin gnulib module getdelim - -if gl_GNULIB_ENABLED_getdelim - -endif -EXTRA_DIST += lib/getdelim.c - -EXTRA_lib_libbison_a_SOURCES += lib/getdelim.c - -## end gnulib module getdelim - ## begin gnulib module getdtablesize if gl_GNULIB_ENABLED_getdtablesize @@ -700,17 +697,6 @@ EXTRA_DIST += lib/gethrxtime.h lib/xtime.h ## end gnulib module gethrxtime -## begin gnulib module getline - -if gl_GNULIB_ENABLED_getline - -endif -EXTRA_DIST += lib/getline.c - -EXTRA_lib_libbison_a_SOURCES += lib/getline.c - -## end gnulib module getline - ## begin gnulib module getopt-posix BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_H) @@ -1783,15 +1769,6 @@ EXTRA_lib_libbison_a_SOURCES += lib/rawmemchr.c ## end gnulib module rawmemchr -## begin gnulib module readline - - -EXTRA_DIST += lib/readline.c lib/readline.h - -EXTRA_lib_libbison_a_SOURCES += lib/readline.c - -## end gnulib module readline - ## begin gnulib module readlink diff --git a/src/local.mk b/src/local.mk index c072d99..b5b9079 100644 --- a/src/local.mk +++ b/src/local.mk @@ -24,6 +24,7 @@ if RELOCATABLE_VIA_LD src_bison_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)` endif +$(src_bison_OBJECTS): $(BUILT_SOURCES) $(MOSTLYCLEANFILES:%.h) src_bison_CFLAGS = $(AM_CFLAGS) $(WERROR_CFLAGS) src_bison_SOURCES = \ src/AnnotationList.c \ @@ -117,7 +118,6 @@ BUILT_SOURCES += \ # definition of libbison, beware that they might expand as flags such as # `-lm`. Keep them here. Or use a Libtool convenience library. src_bison_LDADD = \ - lib/libbison.a \ $(ISNAND_LIBM) \ $(ISNANF_LIBM) \ $(ISNANL_LIBM) \ @@ -127,10 +127,10 @@ src_bison_LDADD = \ $(LIBTHREAD) \ $(LIB_CLOCK_GETTIME) \ $(LIB_GETHRXTIME) \ - $(LIBTEXTSTYLE) + $(LIBTEXTSTYLE) \ + lib/libbison.a -EXTRA_DIST += %D%/i18n-strings.c ## ------ ## -- 2.24.1
