X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=configure.in;h=e113860ef74ec6a7d352ab45eb1c69a25157a85c;hp=3b9f44c4d0cdcbfb14859e95bb2115f625a297e4;hb=ff636cd27782f33f11ff8477b0dad4535d1ab9ab;hpb=76d105d8136c53f1445849e84d49b100b29fbb78 diff --git a/configure.in b/configure.in index 3b9f44c..e113860 100644 --- a/configure.in +++ b/configure.in @@ -444,6 +444,25 @@ AC_SUBST(MAIL_SPOOL_GRP)dnl dnl ------------------ dnl CHECK HEADER FILES dnl ------------------ + +dnl On glibc we need to define at least the '_XOPEN_SOURCE' level of features, +dnl or wchar.h doesn't declare a prototype for wcwidth(). But if we only define +dnl that level then db.h won't compile. So we define _GNU_SOURCE which turns +dnl on everything. Perhaps other OSes need some feature switch set to get wcwidth() +dnl declared; if so they should have an entry added to this case statement. +dnl NB that we must define this on the compiler command line, not in config.h, +dnl because it must be set before any system header is included and there's no +dnl portable way to make sure that files generated by lex include config.h +dnl before system header files. + +case "$target_os" in + linux*) + # Like DEFS, but doesn't get stomped on by configure when using config.h: + OURDEFS="$OURDEFS -D_GNU_SOURCE" + ;; +esac +AC_SUBST(OURDEFS) + AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_TIME @@ -984,6 +1003,7 @@ target os : ${target} compiler : ${CC} compiler flags : ${CFLAGS} linker flags : ${LDFLAGS} +definitions : ${OURDEFS} source code location : ${srcdir} binary install path : ${nmhbin2} libary install path : ${nmhlib2}