Hi Sam, Sam Steingold wrote: > I am trying to use the gnulib-tool --avoid to put the gnulib regexp code > in the regexp directory, fnmatch code in the wildcard dir &c. > So far I came up with the following in Makefile.devel: > > GNULIB = $(GNULIB_CHECKOUT)/gnulib-tool --import --no-vc-files --no-libtool \ > --no-changelog --aux-dir=src/build-aux > GNULIB_CORE = stdint stdbool havelib gettext localcharset \ > uniwidth/width streq uniname/uniname unitypes link-follow \ > nocrash libsigsegv gnu-make gettimeofday getpagesize sys_time > # these modules are included as dependencies by regexp and fnmatch > # so we include them here so that they appear once in src/gl* > # instead of twice in regexp/gl* and wildcard/gl* > GNULIB_MODULES = alloca-opt alloca extensions include_next verify \ > mbsinit wchar wctype mbrtowc mbsrtowcs \ > memmove memcmp memchr > GNULIB_COMMON = $(GNULIB_CORE) $(GNULIB_MODULES) > GNULIB_AVOID = $(addprefix --avoid=, $(GNULIB_COMMON)) > gnulib-imported : update-gnulib force > $(RM) configure.ac; ln -sv src/configure.in configure.ac > $(GNULIB) --source-base=src/gllib --m4-base=src/glm4 $(GNULIB_COMMON) > $(GNULIB) --source-base=modules/regexp/gllib --macro-prefix=rx_gl \ > --m4-base=modules/regexp/glm4 $(GNULIB_AVOID) regex > $(GNULIB) --source-base=modules/wildcard/gllib --macro-prefix=wc_gl \ > --m4-base=modules/wildcard/glm4 $(GNULIB_AVOID) fnmatch-gnu > $(RM) configure.ac > for d in src/gllib modules/regexp/gllib modules/wildcard/gllib; do \ > $(RM) `find $d -name \*~`; done
Looks all reasonable. > alas, there is still some duplication between > modules/regexp/glm4 and src/glm4, specifically: > codeset.m4 > locale-fr.m4 > locale-ja.m4 > locale-zh.m4 > mbrtowc.m4 > mbstate_t.m4 > unistd_h.m4 Duplication between .m4 files is harmless. The files are identical, therefore 'aclocal' cannot pick the "wrong" one. > and between modules/regexp/gllib and src/gllib, specifically: > unistd.in.h You should be able to fix this by adding 'unistd' to your GNULIB_CORE variable. > also, build-dir/gllib no longer builds: > > $ make gllib > mkdir -p gllib > if test ! -f gllib/Makefile; then sh config.status gllib/Makefile depfiles; fi > config.status: creating gllib/Makefile > config.status: executing depfiles commands > cd gllib && make CFLAGS="-W -Wswitch -Wcomment -Wpointer-arith -Wimplicit > -Wreturn-type -Wmissing-declarations -Wno-sign-compare -Wno-format-nonliteral > -O2 -fexpensive-optimizations -falign-functions=4 -DUNICODE -DDYNAMIC_FFI -I. > " > make[1]: Entering directory `/home/sds/src/clisp/current/build-O/gllib' > ... > rm -f string.h-t string.h > { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ > sed -e 's|@''INCLUDE_NEXT''@|include_next|g' \ > -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ > -e 's|@''NEXT_STRING_H''@||g' \ > -e 's|@''GNULIB_MBSLEN''@||g' \ > -e 's|@''GNULIB_MBSNLEN''@||g' \ > ... > ./string.h:27:15: error: #include_next expects "FILENAME" or <FILENAME> > ./string.h:54:5: error: #if with no expression The 'string' module occurs as dependency of the 'memchr' module or 'mbsrtowcs' modules. Somehow a bunch of AC_SUBSTed variables (such as NEXT_STRING_H) are not correctly substituted. You should verify that 1) gllib/Makefile.in contains the line NEXT_STRING_H = @NEXT_STRING_H@ 2) config.status contains the line S["NEXT_STRING_H"]="<string.h>" 3) configure contains the lines NEXT_STRING_H and NEXT_STRING_H=$gl_cv_next_string_h If 1) is not fulfilled, you should look at the automake invocation that you issued after the autoconf invocation after the gnulib-tool invocations. If 3) is not fulfilled, it's time to look at your autoconf and m4 versions. If 2) is not fulfilled but 3) is, what are your versions of sh (bash?) and awk (gawk)? Bruno