[MacPorts] #42796: gdb-apple @1824: build failure due to texinfo5
MacPorts
noreply at macports.org
Fri Jun 6 11:27:47 PDT 2014
#42796: gdb-apple @1824: build failure due to texinfo5
------------------------+--------------------------------
Reporter: egall@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.2.1
Resolution: | Keywords:
Port: gdb-apple |
------------------------+--------------------------------
Comment (by egall@…):
Replying to [comment:3 ntraft@…]:
> Hey Eric, could you post instructions for what changes are necessary to
the Portfile?
>
Well I have made a bunch of changes to the portfile in general, so I am
not really sure which ones were the necessary ones... I suppose I can try
to walk through them though...
The first hunk is mostly just whitespace changes, so we can skip over it
(I like my lines wrapped a little tighter than normal):
{{{
#!diff
--- Portfile (revision 108929)
+++ Portfile (working copy)
@@ -6,25 +6,31 @@
name gdb-apple
version 1824
+revision 1
categories devel
license GPL-2+
maintainers jeremyhu openmaintainer
-description GDB: The GNU Project Debugger with Apple Modifications
(based on 6.3.50)
+description GDB: The GNU Project Debugger with Apple Modifications \
+ (based on 6.3.50)
long_description \
-GDB, the GNU Project debugger, allows you to see what is going on
'inside' \
-another program while it executes -- or what another program was doing at
the \
-moment it crashed. GDB can do four main kinds of things (plus other
things \
-in support of these) to help you catch bugs in the act: \
- a) start your program, specifying anything that might affect its
behavior, \
- b) make your program stop on specified conditions, \
- c) examine what has happened, when your program has stopped, \
- d) change things in your program, so you can experiment with
correcting \
- the effects of one bug and go on to learn about another. \
-The program being debugged can be written in Ada, C, C++, Objective-C, \
-Pascal (and many other languages). Those programs might be executing on \
-the same machine as GDB (native) or on another machine (remote). GDB \
-can run on most popular UNIX and Microsoft Windows variants.
+GDB, the GNU Project debugger, allows you to see what is going on \
+'inside' another program while it executes -- or what another program was
\
+doing at the moment it crashed. GDB can do four main kinds of things \
+(plus other things in support of these) to help you catch bugs in action:
\
+\n\
+ a) start your program, specifying anything that might affect its \
+ behavior, \n\
+ b) make your program stop on specified conditions, \n\
+ c) examine what has happened, when your program has stopped, \n\
+ d) change things in your program, so you can experiment with \
+ correcting the effects of 1 bug and go on to learn about
another.\n\
+\n\
+The program being debugged can be written in Ada, C, C++, Objective-C, or
\
+Pascal, as well as many other languages. Those programs might be \
+executing on the same machine as GDB (native) or on another machine \
+(remote). GDB can run on most popular UNIX and Microsoft Windows variants
\
+(this version is primarily for OS X though).
homepage http://opensource.apple.com/source/gdb
platforms darwin
}}}
In the next hunk I removed the dependency on texinfo and replaced it with
a dependency on gsed, because there is some tricky `sed` usage that I was
trying to silence a warning from... `gsed` is not strictly necessary
though. [[BR]]
I also added some library dependencies that `otool -L` said were linked
against, and that `nm -m` confirmed that symbols were used from; but those
are not relevant to the `makeinfo` parts though. [[BR]]
I also added a comment explaining why `worksrcdir` has to be changed.
[[BR]]
Also all the "`-append`"s are because I always use "`-append`" by default,
just in case, ''unless'' I specifically need to override something. Those
additions can be ignored though:
{{{
#!diff
--- Portfile (revision 108929)
+++ Portfile (working copy)
@@ -39,9 +45,22 @@
checksums rmd160 90290c3950dd06c1691a477b9ee302c00b681ed1 \
sha256
d25b056a826015e1e0ea338b9b8f03e40dce3ff4696faf95df259ae1a42698da
-depends_build port:gettext port:zlib port:flex port:texinfo
-
-worksrcdir ${worksrcdir}/src
+depends_build-append \
+ port:gettext \
+ port:zlib \
+ port:flex \
+ port:gsed
+# Removed texinfo because we now force the use of the system makeinfo
+
+# port-depcheck.sh reports these linkages:
+depends_lib-append \
+ port:libiconv \
+ port:ncurses \
+ port:sqlite3
+
+# The configure script is one level deeper; the top-level Makefile is
+# hand-written and full of Apple-internal-specific things:
+worksrcdir ${worksrcdir}/src
post-patch {
# https://trac.macports.org/ticket/37790
}}}
In this next hunk I tried some additional configure arguments. None of
them led to any actual changes though, so they can probably be ignored:
{{{
#!diff
--- Portfile (revision 108929)
+++ Portfile (working copy)
@@ -51,19 +70,82 @@
${worksrcpath}/bfd/configure.host
}
-configure.args \
+configure.args-append \
--infodir=${prefix}/share/info \
--mandir=${prefix}/share/man \
--with-docdir=${prefix}/share/doc \
--program-suffix=-apple \
- --disable-werror
+ --disable-werror \
+ --with-mpfr=${prefix} \
+ --with-gmp=${prefix} \
+ --enable-libada \
+ --enable-libssp
+
}}}
In this next hunk I tried setting a bunch of environment variables.
[[BR]]
The `GSED` one forces the use of the gsed port that I added a build
dependency on above. [[BR]]
I just realized that the values to `MAKEINFO` are different in the
configure and build environments, but that is okay, because either one
works, at least on my machine. If we want to be consistent, though, it
might make more sense to stick with the one with `missing` in it, as that
would be safer. [[BR]]
All the variables with "`MSG`" somewhere in them, and the other variables
around there, are to try to force the usage of the gettext port from
MacPorts. They are not strictly necessary though. [[BR]]
A lot of the variables with "`RC_`" in them, and the other variables
around there, are to try to simulate being inside a `darwinbuild`
environment, which was part of my attempts to get the project to build
from the top-level Makefile instead of from the one that we currently use
in `src/`. I never managed to get that to work though, so those variables
can probably be ignored as well. [[BR]]
Clearing the value of `READELF_PROG` was because I had been experiencing a
build failure with it, and this was an attempt to try to fix that.
Although that might have just been copied from my work on the Portfile for
the FSF version of gdb, so I am not sure if it is strictly necessary here
as well... [[BR]]
(Note that this hunk of the diff is not actually a separate hunk; I just
split it off from the previous one so that I could fit these comments in
here)
{{{
#!diff
--- Portfile (revision 108929)
+++ Portfile (working copy)
@@ -60,10 +83,69 @@
+
+configure.env-append \
+ SED=${prefix}/bin/gsed \
+ MSGFMT=${prefix}/bin/msgfmt \
+ GMSGFMT=${prefix}/bin/msgfmt \
+ XGETTEXT=${prefix}/bin/xgettext \
+ MSGMERGE=${prefix}/bin/msgmerge \
+ MAKEINFO="${worksrcpath}/missing makeinfo" \
+ INSTALLED_PRODUCT_ASIDES=YES \
+ RC_JASPER=YES \
+ RC_NONARCH_CFLAGS="${configure.optflags}" \
+ RC_XBS=YES \
+ SEPARATE_STRIP=YES \
+ UNAME_RELEASE="${os.version}" \
+ HOST_ARCHITECTURE="${configure.build_arch}"
+
+platform macosx {
+ configure.args-append \
+ --enable-carbon-framework \
+ --enable-debug-symbols-framework
+ configure.env-append \
+ RC_OS=macos \
+ RC_TARGET_CONFIG=MacOSX
+ build.env-append \
+ RC_OS=macos \
+ RC_TARGET_CONFIG=MacOSX
+}
+
+platform darwin {
+ configure.env-append \
+ RC_PRIVATE=/private \
+ UNAME_SYSNAME=Darwin \
+ NEXT_ROOT=""
+ build.env-append \
+ RC_PRIVATE=/private \
+ UNAME_SYSNAME=Darwin \
+ NEXT_ROOT=""
+}
+
+build.args-append \
+ MAKEINFO="/usr/bin/makeinfo" \
+ LEXLIB="${prefix}/lib/libfl.a" \
+ READELF_PROG=""
+
+build.env-append \
+ MAKEINFO="/usr/bin/makeinfo" \
+ LEXLIB="${prefix}/lib/libfl.a" \
+ SED=${prefix}/bin/gsed \
+ MSGFMT=${prefix}/bin/msgfmt \
+ GMSGFMT=${prefix}/bin/msgfmt \
+ XGETTEXT=${prefix}/bin/xgettext \
+ MSGMERGE=${prefix}/bin/msgmerge \
+ INSTALLED_PRODUCT_ASIDES=YES \
+ RC_JASPER=YES \
+ RC_XBS=YES \
+ SEPARATE_STRIP=YES \
+ UNAME_RELEASE="${os.version}" \
+ HOST_ARCHITECTURE="${build_arch}" \
+ READELF_PROG=""
-build.args \
- MAKEINFO="${prefix}/bin/makeinfo" \
+destroot.args-append \
+ MAKEINFO="/usr/bin/makeinfo" \
LEXLIB="${prefix}/lib/libfl.a"
-destroot.args \
- MAKEINFO="${prefix}/bin/makeinfo" \
+destroot.env-append \
+ MAKEINFO="/usr/bin/makeinfo" \
LEXLIB="${prefix}/lib/libfl.a"
post-destroot {
}}}
Finally, in this last hunk, instead of deleting stuff, I solved some
conflicts with other ports by renaming the files instead of deleting them.
I also had destroot install some additional files that I considered to be
useful. This part is all taking place after the place where the `makeinfo`
failure had occurred though, so these next changes are not actually
strictly relevant to this issue:
{{{
#!diff
--- Portfile (revision 108929)
+++ Portfile (working copy)
@@ -74,12 +156,26 @@
move ${destroot}${prefix}/share/info/${info}
${destroot}${prefix}/share/info/apple-${info}
}
- eval delete [glob ${destroot}${prefix}/lib/*.{,l}a]
- eval delete [glob
${destroot}${prefix}/bin/{addr2line,ar,c*filt,nm,objcopy,objdump,ranlib,readelf,size,strings,strip}-apple]
+ # avoid conflicts with other gdb/binutils installations from
MacPorts:
+ xinstall -d ${destroot}${prefix}/lib/${name}
+ eval move [glob ${destroot}${prefix}/lib/*.{,l}a]
${destroot}${prefix}/lib/${name}
+ eval reinplace "s|${prefix}/lib|${prefix}/lib/${name}|g" [glob
${destroot}${prefix}/lib/${name}/*.la]
+ xinstall -d ${destroot}${prefix}/include/${name}
+ eval move [glob ${destroot}${prefix}/include/*.h]
${destroot}${prefix}/include/${name}
+ xinstall -d ${destroot}${prefix}/share/info/${name}
+ eval move [glob
${destroot}${prefix}/share/info/{annotate,bfd,stabs}.info]
${destroot}${prefix}/share/info/${name}
+ foreach msgs [glob
${destroot}${prefix}/share/locale/*/LC_MESSAGES/*.mo] {
+ if [file isfile ${msgs}] {
+ move ${msgs} [file dirname ${msgs}]/${name}-[file tail
${msgs}]
+ }
+ }
+ xinstall -d ${destroot}${prefix}/share/${name}
+ eval xinstall -m 644 [glob ${worksrcpath}/../conf/*.gdb]
${destroot}${prefix}/share/${name}
+ xinstall -d ${destroot}${prefix}/etc/${name}
+ xinstall ${worksrcpath}/../gdb.conf ${destroot}${prefix}/etc/${name}
+ xinstall -d ${destroot}${prefix}/share/doc/${name}
+ xinstall ${worksrcpath}/../doc/refcard.pdf
${destroot}${prefix}/share/doc/${name}
eval delete [glob ${destroot}${prefix}/*darwin*]
- eval delete [glob ${destroot}${prefix}/include/*.h]
- eval delete [glob
${destroot}${prefix}/share/info/{annotate,bfd,stabs}.info]
- eval delete [glob
${destroot}${prefix}/share/locale/*/LC_MESSAGES/{bfd,binutils,opcodes}.mo]
}
if {${os.platform} eq "darwin" && ${os.major} >= 12} {
}}}
So, to summarize, the changes that fixed the `texinfo` issue for me here
were to append `MAKEINFO="${worksrcpath}/missing makeinfo"` to the
configure environment, and to change the
`MAKEINFO="${prefix}/bin/makeinfo"` entry in the build and destroot
environment to be `MAKEINFO="/usr/bin/makeinfo"` instead, and to remove
the dependency on `texinfo`. Those ones are the relevant ones here; the
rest can be ignored.
Replying to [comment:3 ntraft@…]:
> The confusing thing here is that even though it output an error, I still
have a gdb-apple binary in my bin/ folder, and it seems to work just
fine... makeinfo also looks like it's there... are these prebuilt
binaries? Why am I seeing this error?
>
Which `bin/` folder? The one in your prefix? It could just be a previous
version. And `makeinfo` already being in the `bin/` folder in your prefix
is what was causing this issue in the first place. If you meant that a new
gdb-apple binary still gets built, though, it could just be parallelism in
`make` causing the libraries that `gdb-apple` needs to get built before
the documentation...
--
Ticket URL: <https://trac.macports.org/ticket/42796#comment:5>
MacPorts <http://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list