From: Ævar Arnfjörð Bjarmason Date: Thu, 25 Nov 2010 16:33:11 GMT Subject: Re: What's cooking in git.git (Nov 2010, #03; Wed, 24) Message-ID: In-Reply-To: On Thu, Nov 25, 2010 at 16:03, Erik Faye-Lund wrote: > I'm really not thinking straight today: This was in the MSVC-section, > and I tried to build with MinGW. If I move it to the MinGW section, > then it's closer to working: > > $ make >    CC alias.o >    CC alloc.o > <...> >    CC gettext.o > gettext.c:3:21: error: libintl.h: No such file or directory > gettext.c:7:22: error: langinfo.h: No such file or directory > gettext.c: In function 'git_setup_gettext': > gettext.c:17: warning: implicit declaration of function 'bindtextdomain' > gettext.c:25: error: 'LC_MESSAGES' undeclared (first use in this function) > gettext.c:25: error: (Each undeclared identifier is reported only once > gettext.c:25: error: for each function it appears in.) > gettext.c:30: warning: implicit declaration of function 'nl_langinfo' > gettext.c:30: error: 'CODESET' undeclared (first use in this function) > gettext.c:30: warning: assignment makes pointer from integer without a cast > gettext.c:32: warning: implicit declaration of function 'bind_textdomain_codeset > ' > gettext.c:34: warning: implicit declaration of function 'textdomain' > make: *** [gettext.o] Error 1 > > So this seems to be the same issue as what Hannes is talking about; > gettext.o being included into LIB_OBJS before we know if it should or > not. > > Moving it down to the rest of the NO_GETTEXT-magic fixes the problem for me: > > > diff --git a/Makefile b/Makefile > index 8357106..a858708 100644 > --- a/Makefile > +++ b/Makefile > @@ -1,6 +1,5 @@ >  # The default target of this Makefile is... >  all:: > - >  # Define V=1 to have a more verbose compile. >  # >  # Define SHELL_PATH to a POSIX shell if your /bin/sh is broken. > @@ -628,9 +627,6 @@ LIB_OBJS += entry.o >  LIB_OBJS += environment.o >  LIB_OBJS += exec_cmd.o >  LIB_OBJS += fsck.o > -ifndef NO_GETTEXT > -LIB_OBJS += gettext.o > -endif >  LIB_OBJS += graph.o >  LIB_OBJS += grep.o >  LIB_OBJS += hash.o > @@ -1603,6 +1600,8 @@ endif > >  ifdef NO_GETTEXT >        COMPAT_CFLAGS += -DNO_GETTEXT > +else > +       LIB_OBJS += gettext.o >  endif > >  ifdef NEEDS_LIBINTL Doesn't it also work for you to just add: NO_GETTEXT = YesPlease NEEDS_LIBINTL = To the MinGW specific section in the Makefile? That's why I did the "Makefile: move "Platform specific tweaks" above LIB_{H,OBJS}" patch. I just hadn't submitted another patch to disable it on MinGW. I think I asked someone to look into that (e.g. I know that you're working on MinGW + gettext, so maybe we don't want to disable it anymore). But I can't find that posting now, and maybe I didn't send it. Anyway, if that works it's a cleaner way to disable it.