Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#57673 closed defect (fixed)

claws-mail: configure: error: libetpan 0.57 not found

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: pmetzger (Perry E. Metzger)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: claws-mail

Description (last modified by ryandesign (Ryan Carsten Schmidt))

claws-mail fails to configure on Snow Leopard:

checking whether to use libetpan... yes
checking for libetpan-config... /opt/local/bin/libetpan-config
checking libetpan/libetpan.h usability... yes
checking libetpan/libetpan.h presence... yes
checking for libetpan/libetpan.h... yes
checking whether libetpan-config hints compiles and links fine... no
*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ 
*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.
configure: error: libetpan 0.57 not found

libetpan is of course installed; config.log shows the reason why it wasn't detected:

configure:20395: checking whether libetpan-config hints compiles and links fine
configure:20409: /usr/bin/gcc-4.2 -o conftest -pipe -Os -arch x86_64 -Wno-unused-function -Wno-pointer-sign -Wall -no-cpp-precomp -fno-common -I/opt/local/include -I/opt/local/include -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -Wl,-export_dynamic conftest.c  -lm -lresolv -L/opt/local/lib -letpan -L/opt/local/lib -Wl,-headerpad_max_install_names -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -lcurl -lidn2 -lpsl -lssl -lcrypto -lssl -lcrypto -lz -lexpat -lz -lssl -lcrypto -liconv -lsasl2 -lssl -lcrypto >&5
ld: unknown option: -export_dynamic
collect2: ld returned 1 exit status

Change History (12)

comment:1 Changed 6 years ago by pmetzger (Perry E. Metzger)

This works under current Xcode. I'm not sure what the correct way to fix this so it works across more compilers would be. What's recommended?

comment:2 in reply to:  1 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

Replying to pmetzger:

This works under current Xcode.

No doubt! But apparently the version of ld on Snow Leopard is too old to know about -export_dynamic. (I was mistaken earlier when I thought it was due to the old compiler because I saw /usr/bin/gcc-4.2 on the line, but -Wl,-export_dynamic means "pass -export_dynamic to the linker", so it's actually the old linker that's causing the problem.)

Ideally, the configure script should first check whether the linker understands a flag before trying to use it. That's the purpose of configure scripts: to determine the capabilities of the system and not make assumptions. Looking at configure.ac, it's unconditionally using -Wl,-export_dynamic on macOS.

comment:3 Changed 6 years ago by pmetzger (Perry E. Metzger)

Sure, but what should I do to fix this? I don't have a Snow Leopard machine to test with, and I don't know enough about hacking configure.ac files. If you have a few lines you could put into a patch and commit, it would be a big help.

comment:4 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

I don't have that. I can read configure files ok, but I'm not great at writing them. I've reported the problem to the developers.

comment:5 Changed 6 years ago by kencu (Ken)

I was going to help on this, but libetpan doesn't build any more against the current curl, so I'm stuck for now. Of course, the libetpan issue needs to be a separate ticket.

libtool: compile:  /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../src/data-types -I../../../src/low-level/imf -I/opt/local/include -DDEBUG -I/opt/local/include -D_REENTRANT -I/opt/local/include -I/opt/local/include -pipe -Os -arch x86_64 -W -Wall -c newsfeed_item.c  -fno-common -DPIC -o .libs/newsfeed_item.o
parser.c: In function ‘elparse_end_dummy’:
parser.c:135: warning: unused parameter ‘el’
parser.c: In function ‘unknown_encoding_handler’:
parser.c:342: warning: unused parameter ‘encdata’
newsfeed.c: In function ‘curl_error_convert’:
newsfeed.c:538: error: duplicate case value
newsfeed.c:533: error: previously used here
make[7]: *** [newsfeed.lo] Error 1

comment:6 Changed 6 years ago by kencu (Ken)

It looks like this commit and then this commit to configure.ac were the ones that broke it for older systems. Reverting this little bit of that commit:

        *-apple-*)
                platform_osx=yes
-               LDFLAGS="$LDFLAGS -Wl,-export_dynamic"

and success:

$ port -v installed claws-mail
The following ports are currently installed:
  claws-mail @3.17.1_3 (active) platform='darwin 10' archs='x86_64' date='2018-11-25T13:14:19-0800'
Last edited 6 years ago by kencu (Ken) (previous) (diff)

comment:7 Changed 6 years ago by kencu (Ken)

BTW -- I tried all kinds of ways to force the build to use a newer ld64 but nothing worked. It seems determined to use the one baked into the compiler, as far as I can see.

comment:8 Changed 6 years ago by pmetzger (Perry E. Metzger)

Ken, is there a good way to remove the -export_dynamic only on the older platform?

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

The quick-fix way would be to only apply a patch removing that line on OS versions that don't understand it. The better way suitable for sending upstream would be to check the OS or ld version in the configure script before adding the flag. It's only needed for ld versions that can do LTO.

comment:10 Changed 6 years ago by kencu (Ken)

Oh, it's all done -- the PR is waiting for you to hit "Commit" <https://github.com/macports/macports-ports/pull/3083>

comment:11 Changed 6 years ago by ken-cunningham-webuse

Resolution: fixed
Status: assignedclosed

In 0cb9995304ff980b97e7b305bc95efbdc778eed0/macports-ports (master):

claws-mail: disable unrecognized ld flag on older systems

closes: #57673

comment:12 Changed 6 years ago by pmetzger (Perry E. Metzger)

I merged it. If it needs more love, we can of course fine tune the fix.

Note: See TracTickets for help on using tickets.