Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#13441 closed defect (fixed)

gunits fails to build on OS X 10.5

Reported by: edward.edmondson@… Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 1.5.2
Keywords: Cc:
Port:

Description (last modified by jmpp@…)

gunits fails to build on Leopard with the error

units.c: In function 'main':
units.c:2563: error: 'rl_compentry_func_t' undeclared (first use in this function)
units.c:2563: error: (Each undeclared identifier is reported only once
units.c:2563: error: for each function it appears in.)
units.c:2563: error: syntax error before ')' token
make: *** [units.o] Error 1

Attachments (1)

leopard (637 bytes) - added by hans@… 13 years ago.
Leopard build patch

Download all attachments as: .zip

Change History (8)

comment:1 Changed 13 years ago by jmpp@…

Description: modified (diff)

Changed 13 years ago by hans@…

Attachment: leopard added

Leopard build patch

comment:2 Changed 13 years ago by hans@…

The problem seems to be it's finding the wrong readline.

comment:3 Changed 12 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to jmr@…
Status: newassigned

comment:4 Changed 12 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: assignedclosed

Thanks, committed in r34595.

comment:5 Changed 12 years ago by ryandesign (Ryan Schmidt)

Resolution: fixed
Status: closedreopened

Bad. You've caused two problems:

  1. Before r34595, the port correctly linked with readline and ncurses from MacPorts (at least on my 10.4.11 Intel system with MacPorts 1.7.0 built from trunk):
$ otool -L /opt/local/bin/gunits 
/opt/local/bin/gunits:
        /opt/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0)
        /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9)
$

After r34595, it links with the system versions of those libraries, which is exactly what we don't want:

$ otool -L /opt/local/bin/gunits 
/opt/local/bin/gunits:
        /usr/lib/libedit.2.dylib (compatibility version 2.0.0, current version 2.0.0)
        /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9)
$

The reason for this problem is this line that you added:

configure.ldflags -I${prefix}/lib

"-I${prefix}/lib" is not an appropriate value for LDFLAGS. "-L${prefix}/lib" is, but it's also the default. So this line should be removed again.

I'm also not at all convinced that the other line from the patch needed to be added:

configure.cflags -I${prefix}/include

MacPorts already sets CPPFLAGS (but not CFLAGS) to "-I${prefix}/include" so this should not have been necessary, and wasn't for me on Tiger. (This feature may have been added to MacPorts base after this ticket was filed.) Can you confirm that this line really was necessary on Leopard with MacPorts 1.6.0? If the line is not necessary, it should be removed again.

  1. Before r34595, gunits correctly installed its info and manpages:
$ port contents gunits
Port gunits contains:
  /opt/local/bin/gunits
  /opt/local/share/info/units.info
  /opt/local/share/man/man1/gunits.1.gz
  /opt/local/share/units.dat
$

After r34595, it still installs them, but they're not registered as belonging to the port:

$ port contents gunits
Port gunits contains:
  /opt/local/bin/gunits
  /opt/local/share/units.dat
$ ls /opt/local/share/info/units.info /opt/local/share/man/man1/gunits.1
/opt/local/share/info/units.info        /opt/local/share/man/man1/gunits.1
$ port provides /opt/local/share/info/units.info /opt/local/share/man/man1/gunits.1
/opt/local/share/info/units.info is not provided by a MacPorts port.
/opt/local/share/man/man1/gunits.1 is not provided by a MacPorts port.
$

This means that "port uninstall" will not uninstall them, which is bad. This happened because you changed the --mandir and --infodir arguments, which also had nothing to do with this ticket, so that change should not have been done in the context of this ticket regardless. Please change these lines back to the way they were. I don't 100% understand why it works, but I think it has to do with expanding the ${prefix} variable at a later time so that it ends up being ${destroot}${prefix} somehow. In any case we don't need to question why it works; we just need to not fiddle with parts of portfiles that work just fine.

  1. When you fix these problems, the port revision should be incremented so that anybody who built the port during the time that the portfile was broken will get the fixed version.

comment:6 Changed 12 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: reopenedclosed

Fixed in r34603. The configure flags really are needed to build on 10.5 with MacPorts 1.60.

comment:7 Changed 11 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.