git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Johannes Sixt <j.sixt@viscovery.net>
Subject: Re: [PATCH 003/160] gettext: fix bug in git-sh-i18n's eval_gettext() by using envsubst(1)
Date: Sun, 14 Nov 2010 22:42:57 +0100	[thread overview]
Message-ID: <AANLkTim-j6TLwz0PugZvaEf1x3hW=76vT1gALC=w3DOu@mail.gmail.com> (raw)
In-Reply-To: <20101114212757.GD10150@burratino>

On Sun, Nov 14, 2010 at 22:27, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Ævar Arnfjörð Bjarmason wrote:
>
>> Thanks for the suggestion. I'll put it in envsubst/ then.
>>
>> Any idea about the issue of it being linked to too many things?
>
> Maybe http://thread.gmane.org/gmane.comp.version-control.git/160842
> is related?
>
>> tried to add another entry to this section:
>>
>>     git-%$X: %.o $(GITLIBS)
>>         $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter
>> %.o,$^) $(LIBS)
>>
>>     git-imap-send$X: imap-send.o $(GITLIBS)
>>         $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
>>             $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)
>>
>> But it wasn't actually used. But then again I don't know Makefile
>> hacking that much.
>
> If you send output from "make envsubst" from your attempt with V=1,
> I can try to debug it.

This is how it currently gets compiled:

    $ rm git-sh-i18n--envsubst sh-i18n--envsubst.o; make -j 5 all V=1
    gcc -o sh-i18n--envsubst.o -c   -g -O2 -Wall -I.  -DHAVE_PATHS_H
-DSHA1_HEADER='<openssl/sha.h>'  -DNO_STRLCPY -DNO_MKSTEMPS
sh-i18n--envsubst.c
    gcc  -g -O2 -Wall -I.  -DHAVE_PATHS_H
-DSHA1_HEADER='<openssl/sha.h>'  -DNO_STRLCPY -DNO_MKSTEMPS -o
git-sh-i18n--envsubst   sh-i18n--envsubst.o libgit.a xdiff/lib.a  -lz
-lcrypto -lpthread

I tried to remove some of those library includes. But it'll
complain. However if I do:

    diff --git a/sh-i18n--envsubst.c b/sh-i18n--envsubst.c
    index 8db71b1..7d4c870 100644
    --- a/sh-i18n--envsubst.c
    +++ b/sh-i18n--envsubst.c
    @@ -215 +215 @@ string_list_append (string_list_ty *slp, const char *s)
    -      slp->item = (const char **) xrealloc (slp->item, nbytes);
    +      slp->item = (const char **) realloc (slp->item, nbytes);
    @@ -293 +293 @@ note_variable (const char *var_ptr, size_t var_len)
    -  char *string = xmalloc (var_len + 1);
    +  char *string = malloc (var_len + 1);
    @@ -368 +368 @@ subst_from_stdin ()
    -                     buffer = xrealloc (buffer, bufmax);
    +                     buffer = realloc (buffer, bufmax);
    @@ -402 +402 @@ subst_from_stdin ()
    -                     buffer = xrealloc (buffer, bufmax);
    +                     buffer = realloc (buffer, bufmax);

It'll compile stand-alone with no library includes at all. Maybe I
should just modify it to have basic versions of those two x* functions
so we can compile it completely stand-alone.

  reply	other threads:[~2010-11-14 21:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-14 15:07 [PATCH 000/160] [PULL] ab/i18n rebased on ab/i18n-prereqs Ævar Arnfjörð Bjarmason
2010-11-14 15:07 ` [PATCH 002/160] Makefile: Set NO_GETTEXT=YesPlease on Windows & MinGW Ævar Arnfjörð Bjarmason
2010-11-15 10:35   ` Erik Faye-Lund
2010-11-14 15:07 ` [PATCH 003/160] gettext: fix bug in git-sh-i18n's eval_gettext() by using envsubst(1) Ævar Arnfjörð Bjarmason
2010-11-14 18:16   ` Jonathan Nieder
2010-11-14 19:15     ` Junio C Hamano
2010-11-14 21:25       ` Ævar Arnfjörð Bjarmason
2010-11-14 21:27         ` Jonathan Nieder
2010-11-14 21:42           ` Ævar Arnfjörð Bjarmason [this message]
2010-11-14 21:47             ` Jonathan Nieder
2010-11-14 22:26               ` Ævar Arnfjörð Bjarmason
2010-11-16  0:53 ` [PATCH 000/160] [PULL] ab/i18n rebased on ab/i18n-prereqs Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTim-j6TLwz0PugZvaEf1x3hW=76vT1gALC=w3DOu@mail.gmail.com' \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    --cc=jrnieder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).