[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mutt-dev
Subject:    Re: Fwd: broken strings compiled-in into mutt
From:       "Kevin J. McCarthy" <kevin () 8t8 ! us>
Date:       2015-08-10 2:14:25
Message-ID: 20150810021425.GA2582 () zaogao ! lan
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


David Champion wrote:
> * On 08 Aug 2015, Kevin J. McCarthy wrote: 
> > Kevin J. McCarthy wrote:
> > > The only question is whether there is a better makefile fix than:
> > >  -       -$${NATIVECC-$(CC)} -o $@ $<
> > >  +       -$${NATIVECC-$(CC)} -o $@ `test -f 'txt2c.c' || echo '$(srcdir)/'`txt2c.c
> > 
> > Ah.  I finally figured out what was bothering me with this.
> > 
> > Was there any reason we didn't just add txt2c to noinst_PROGRAMS and
> > just say txt2c_SOURCES = txt2c.c?
> 
> Without digging in, I think probably not.  I submitted this as a quick
> solution to a logged ticket, so was probably looking for minimal impact
> on the rest of the build at the time.  Now that it's survived and is
> really part of the big picture, it makes sense to treat it like a member
> of the family.

The attached patch seems to be working for me (also tested on FreeBSD).
Resetting txt2c_LDADD is necessary or else it defaults to $(LDADD) which
includes $(INTLLIBS) and causes a spectacular build failure...

When configure is run with "--with-idn" I noticed it's putting -lidn
directly into $(LIBS), which is appended that to all the linker
invocations.  It's not causing any problems, so I'm leaving that for
now.

dgc, if you'd like me to commit the sed patch, should I attribute it to
your bikeshed or uchicago email address?

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
http://www.8t8.us/configs/gpg-key-transition-statement.txt

["makefile-amfix.patch" (text/plain)]

# HG changeset patch
# User Kevin McCarthy <kevin@8t8.us>
# Date 1439172036 25200
#      Sun Aug 09 19:00:36 2015 -0700
# Node ID 49c02555b1b2e92db797901de7ff6099a401d31c
# Parent  0a0a7b027ee7158270a59e7becf0ac771c288e82
Compile txt2c using automake rules.

The compilation rule used $< which isn't portable for ordinary make
rules.

diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -84,25 +84,24 @@
 pgpring_SOURCES = pgppubring.c pgplib.c lib.c extlib.c sha1.c md5.c pgppacket.c ascii.c
 pgpring_LDADD = $(LIBOBJS) $(INTLLIBS)
 pgpring_DEPENDENCIES = $(LIBOBJS) $(INTLDEPS)
 
 mutt_md5_SOURCES = md5.c
 mutt_md5_CFLAGS = -DMD5UTIL
 mutt_md5_LDADD =
 
-noinst_PROGRAMS = $(MUTT_MD5)
+txt2c_SOURCES = txt2c.c
+txt2c_LDADD =
+
+noinst_PROGRAMS = $(MUTT_MD5) txt2c
 
 mutt_dotlock.c: dotlock.c
 	cp $(srcdir)/dotlock.c mutt_dotlock.c
 
-# If this fails, we will fall back to the implementation in txt2c.sh
-txt2c: txt2c.c
-	-$${NATIVECC-$(CC)} -o $@ $<
-
 conststrings.c: txt2c config.status
 	( \
 		$(CC) -v || \
 		$(CC) --version || \
 		$(CC) -V || \
 		echo "unknown compiler"; \
 	) 2>&1 | ${srcdir}/txt2c.sh cc_version >conststrings_c
 	echo "$(CFLAGS)" | ${srcdir}/txt2c.sh cc_cflags >>conststrings_c

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic