MacPorts

Fixing Package Problems
The following is an example of fixing the readline package.

Problem
$ sudo port install readline ---> Computing dependencies for readline ---> Fetching readline ---> Verifying checksum(s) for readline ---> Extracting readline ---> Applying patches to readline ---> Configuring readline ---> Building readline Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_readline/work/readline-6.0" && /usr/bin/make -j1 all " returned error 2 Command output: rm -f readline.o /usr/bin/gcc-4.0 -c -DHAVE_CONFIG_H  -I/opt/local/include -I. -I. -DRL_LIBRARY_VERSION='"6.0"' -O2 -arch i386 readline.c rm -f vi_mode.o /usr/bin/gcc-4.0 -c -DHAVE_CONFIG_H  -I/opt/local/include -I. -I. -DRL_LIBRARY_VERSION='"6.0"' -O2 -arch i386 vi_mode.c vi_mode.c: In function '_rl_vi_append_forward': vi_mode.c:617: error: 'MB_CUR_MAX' undeclared (first use in this function) vi_mode.c:617: error: (Each undeclared identifier is reported only once vi_mode.c:617: error: for each function it appears in.)

...

make: *** [vi_mode.o] Error 1

Error: Status 1 encountered during processing.

Analysis
The portfile for readline is in: /opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/readline/Portfile

So we check the configure options: $ egrep configure /opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/readline/Portfile configure.args --with-curses ...

The work directory for the failed build is in: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_readline/work/readline-6.0/