Bruno, 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 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 and between modules/regexp/gllib and src/gllib, specifically: unistd.in.h 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' { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat ../../src/gllib/alloca.in.h; \ } > alloca.h-t mv -f alloca.h-t alloca.h rm -f configmake.h-t { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ echo '#define PREFIX "/usr/local"'; \ echo '#define EXEC_PREFIX "/usr/local"'; \ echo '#define BINDIR "/usr/local/bin"'; \ echo '#define SBINDIR "/usr/local/sbin"'; \ echo '#define LIBEXECDIR "/usr/local/libexec"'; \ echo '#define DATAROOTDIR "/usr/local/share"'; \ echo '#define DATADIR "/usr/local/share"'; \ echo '#define SYSCONFDIR "/usr/local/etc"'; \ echo '#define SHAREDSTATEDIR "/usr/local/com"'; \ echo '#define LOCALSTATEDIR "/usr/local/var"'; \ echo '#define INCLUDEDIR "/usr/local/include"'; \ echo '#define OLDINCLUDEDIR "/usr/include"'; \ echo '#define DOCDIR "/usr/local/share/doc/clisp"'; \ echo '#define INFODIR "/usr/local/share/info"'; \ echo '#define HTMLDIR "/usr/local/share/doc/clisp"'; \ echo '#define DVIDIR "/usr/local/share/doc/clisp"'; \ echo '#define PDFDIR "/usr/local/share/doc/clisp"'; \ echo '#define PSDIR "/usr/local/share/doc/clisp"'; \ echo '#define LIBDIR "/usr/local/lib"'; \ echo '#define LISPDIR ""'; \ echo '#define LOCALEDIR "/usr/local/share/locale"'; \ echo '#define MANDIR "/usr/local/share/man"'; \ echo '#define MANEXT ""'; \ echo '#define PKGDATADIR "/usr/local/share/clisp"'; \ echo '#define PKGINCLUDEDIR "/usr/local/include/clisp"'; \ echo '#define PKGLIBDIR "/usr/local/lib/clisp"'; \ echo '#define PKGLIBEXECDIR ""'; \ } | sed '/""/d' > configmake.h-t if test -f configmake.h && cmp configmake.h-t configmake.h > /dev/null; then \ rm -f configmake.h-t; \ else \ rm -f configmake.h; mv configmake.h-t configmake.h; \ fi 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' \ -e 's|@''GNULIB_MBSCHR''@||g' \ -e 's|@''GNULIB_MBSRCHR''@||g' \ -e 's|@''GNULIB_MBSSTR''@||g' \ -e 's|@''GNULIB_MBSCASECMP''@||g' \ -e 's|@''GNULIB_MBSNCASECMP''@||g' \ -e 's|@''GNULIB_MBSPCASECMP''@||g' \ -e 's|@''GNULIB_MBSCASESTR''@||g' \ -e 's|@''GNULIB_MBSCSPN''@||g' \ -e 's|@''GNULIB_MBSPBRK''@||g' \ -e 's|@''GNULIB_MBSSPN''@||g' \ -e 's|@''GNULIB_MBSSEP''@||g' \ -e 's|@''GNULIB_MBSTOK_R''@||g' \ -e 's|@''GNULIB_MEMCHR''@||g' \ -e 's|@''GNULIB_MEMMEM''@||g' \ -e 's|@''GNULIB_MEMPCPY''@||g' \ -e 's|@''GNULIB_MEMRCHR''@||g' \ -e 's|@''GNULIB_RAWMEMCHR''@||g' \ -e 's|@''GNULIB_STPCPY''@||g' \ -e 's|@''GNULIB_STPNCPY''@||g' \ -e 's|@''GNULIB_STRCHRNUL''@||g' \ -e 's|@''GNULIB_STRDUP''@||g' \ -e 's|@''GNULIB_STRNDUP''@||g' \ -e 's|@''GNULIB_STRNLEN''@||g' \ -e 's|@''GNULIB_STRPBRK''@||g' \ -e 's|@''GNULIB_STRSEP''@||g' \ -e 's|@''GNULIB_STRSTR''@||g' \ -e 's|@''GNULIB_STRCASESTR''@||g' \ -e 's|@''GNULIB_STRTOK_R''@||g' \ -e 's|@''GNULIB_STRERROR''@||g' \ -e 's|@''GNULIB_STRSIGNAL''@||g' \ -e 's|@''GNULIB_STRVERSCMP''@||g' \ -e 's|@''HAVE_DECL_MEMMEM''@||g' \ -e 's|@''HAVE_MEMPCPY''@||g' \ -e 's|@''HAVE_DECL_MEMRCHR''@||g' \ -e 's|@''HAVE_RAWMEMCHR''@||g' \ -e 's|@''HAVE_STPCPY''@||g' \ -e 's|@''HAVE_STPNCPY''@||g' \ -e 's|@''HAVE_STRCHRNUL''@||g' \ -e 's|@''HAVE_DECL_STRDUP''@||g' \ -e 's|@''HAVE_STRNDUP''@||g' \ -e 's|@''HAVE_DECL_STRNDUP''@||g' \ -e 's|@''HAVE_DECL_STRNLEN''@||g' \ -e 's|@''HAVE_STRPBRK''@||g' \ -e 's|@''HAVE_STRSEP''@||g' \ -e 's|@''HAVE_STRCASESTR''@||g' \ -e 's|@''HAVE_DECL_STRTOK_R''@||g' \ -e 's|@''HAVE_DECL_STRERROR''@||g' \ -e 's|@''HAVE_DECL_STRSIGNAL''@||g' \ -e 's|@''HAVE_STRVERSCMP''@||g' \ -e 's|@''REPLACE_MEMCHR''@||g' \ -e 's|@''REPLACE_MEMMEM''@||g' \ -e 's|@''REPLACE_STRCASESTR''@||g' \ -e 's|@''REPLACE_STRDUP''@||g' \ -e 's|@''REPLACE_STRSTR''@||g' \ -e 's|@''REPLACE_STRERROR''@||g' \ -e 's|@''REPLACE_STRSIGNAL''@||g' \ -e '/definition of GL_LINK_WARNING/r ../../src/src/build-aux/link-warning.h' \ < ../../src/gllib/string.in.h; \ } > string.h-t mv string.h-t string.h rm -f unistd.h-t unistd.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_UNISTD_H''@|1|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ -e 's|@''NEXT_UNISTD_H''@|<unistd.h>|g' \ -e 's|@''GNULIB_CHOWN''@|0|g' \ -e 's|@''GNULIB_CLOSE''@|0|g' \ -e 's|@''GNULIB_DUP2''@|0|g' \ -e 's|@''GNULIB_ENVIRON''@|0|g' \ -e 's|@''GNULIB_EUIDACCESS''@|0|g' \ -e 's|@''GNULIB_FCHDIR''@|0|g' \ -e 's|@''GNULIB_FSYNC''@|0|g' \ -e 's|@''GNULIB_FTRUNCATE''@|0|g' \ -e 's|@''GNULIB_GETCWD''@|0|g' \ -e 's|@''GNULIB_GETDOMAINNAME''@|0|g' \ -e 's|@''GNULIB_GETDTABLESIZE''@|0|g' \ -e 's|@''GNULIB_GETHOSTNAME''@|0|g' \ -e 's|@''GNULIB_GETLOGIN_R''@|0|g' \ -e 's|@''GNULIB_GETPAGESIZE''@|1|g' \ -e 's|@''GNULIB_GETUSERSHELL''@|0|g' \ -e 's|@''GNULIB_LCHOWN''@|0|g' \ -e 's|@''GNULIB_LINK''@|0|g' \ -e 's|@''GNULIB_LSEEK''@|0|g' \ -e 's|@''GNULIB_READLINK''@|0|g' \ -e 's|@''GNULIB_SLEEP''@|0|g' \ -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|0|g' \ -e 's|@''GNULIB_WRITE''@|0|g' \ -e 's|@''HAVE_DUP2''@|1|g' \ -e 's|@''HAVE_EUIDACCESS''@|1|g' \ -e 's|@''HAVE_FSYNC''@|1|g' \ -e 's|@''HAVE_FTRUNCATE''@|1|g' \ -e 's|@''HAVE_GETDOMAINNAME''@|1|g' \ -e 's|@''HAVE_GETDTABLESIZE''@|1|g' \ -e 's|@''HAVE_GETHOSTNAME''@|1|g' \ -e 's|@''HAVE_GETPAGESIZE''@|1|g' \ -e 's|@''HAVE_GETUSERSHELL''@|1|g' \ -e 's|@''HAVE_LINK''@|1|g' \ -e 's|@''HAVE_READLINK''@|1|g' \ -e 's|@''HAVE_SLEEP''@|1|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|1|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|1|g' \ -e 's|@''HAVE_OS_H''@|0|g' \ -e 's|@''HAVE_SYS_PARAM_H''@|0|g' \ -e 's|@''REPLACE_CHOWN''@|0|g' \ -e 's|@''REPLACE_CLOSE''@|0|g' \ -e 's|@''REPLACE_DUP2''@|0|g' \ -e 's|@''REPLACE_FCHDIR''@|0|g' \ -e 's|@''REPLACE_GETCWD''@|0|g' \ -e 's|@''REPLACE_GETPAGESIZE''@|0|g' \ -e 's|@''REPLACE_LCHOWN''@|0|g' \ -e 's|@''REPLACE_LSEEK''@|0|g' \ -e 's|@''REPLACE_WRITE''@|0|g' \ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|0|g' \ -e '/definition of GL_LINK_WARNING/r ../../src/src/build-aux/link-warning.h' \ < ../../src/gllib/unistd.in.h; \ } > unistd.h-t mv unistd.h-t unistd.h make all-recursive make[2]: Entering directory `/home/sds/src/clisp/current/build-O/gllib' make[3]: Entering directory `/home/sds/src/clisp/current/build-O/gllib' depbase=`echo localcharset.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -DHAVE_CONFIG_H -I. -I../../src/gllib -I.. -I../intl -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. -MT localcharset.o -MD -MP -MF $depbase.Tpo -c -o localcharset.o ../../src/gllib/localcharset.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from ../../src/gllib/localcharset.c:28: ./string.h:27:15: error: #include_next expects "FILENAME" or <FILENAME> ./string.h:54:5: error: #if with no expression ./string.h:69:5: error: #if with no expression ./string.h:89:5: error: #if with no expression ./string.h:103:5: error: #if with no expression ./string.h:119:5: error: #if with no expression ./string.h:133:5: error: #if with no expression ./string.h:147:5: error: #if with no expression ./string.h:173:5: error: #if with no expression ./string.h:187:5: error: #if with no expression ./string.h:204:5: error: #if with no expression ./string.h:223:5: error: #if with no expression ./string.h:250:5: error: #if with no expression ./string.h:313:5: error: #if with no expression ./string.h:333:5: error: #if with no expression ./string.h:356:5: error: #if with no expression ./string.h:400:5: error: #if with no expression ./string.h:425:5: error: #if with no expression ./string.h:431:5: error: #if with no expression ./string.h:437:5: error: #if with no expression ./string.h:446:5: error: #if with no expression ./string.h:455:5: error: #if with no expression ./string.h:463:5: error: #if with no expression ./string.h:473:5: error: #if with no expression ./string.h:486:5: error: #if with no expression ./string.h:499:5: error: #if with no expression ./string.h:508:5: error: #if with no expression ./string.h:517:5: error: #if with no expression ./string.h:526:5: error: #if with no expression ./string.h:535:5: error: #if with no expression ./string.h:553:5: error: #if with no expression ./string.h:574:5: error: #if with no expression ./string.h:588:5: error: #if with no expression ./string.h:603:5: error: #if with no expression ../../src/gllib/localcharset.c: In function 'get_charset_aliases': ../../src/gllib/localcharset.c:133: warning: implicit declaration of function 'strlen' ../../src/gllib/localcharset.c:133: warning: incompatible implicit declaration of built-in function 'strlen' ../../src/gllib/localcharset.c:139: warning: implicit declaration of function 'memcpy' ../../src/gllib/localcharset.c:139: warning: incompatible implicit declaration of built-in function 'memcpy' ../../src/gllib/localcharset.c:181: warning: incompatible implicit declaration of built-in function 'strlen' ../../src/gllib/localcharset.c:202: warning: implicit declaration of function 'strcpy' ../../src/gllib/localcharset.c:202: warning: incompatible implicit declaration of built-in function 'strcpy' ../../src/gllib/localcharset.c: In function 'locale_charset': ../../src/gllib/localcharset.c:484: warning: incompatible implicit declaration of built-in function 'strlen' ../../src/gllib/localcharset.c:485: warning: implicit declaration of function 'strcmp' make[3]: *** [localcharset.o] Error 1 make[3]: Leaving directory `/home/sds/src/clisp/current/build-O/gllib' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/sds/src/clisp/current/build-O/gllib' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/sds/src/clisp/current/build-O/gllib' make: *** [gllib] Error 2 any insight? -- Sam Steingold (http://sds.podval.org/) on Ubuntu 9.04 (jaunty) http://iris.org.il http://palestinefacts.org http://mideasttruth.com http://www.memritv.org http://honestreporting.com http://thereligionofpeace.com Live free or die.