Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rtorrent] Update global CFLAGS/CXXFLAGS/LIBS at the end of configure.ac #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zetafunction
Copy link

@zetafunction zetafunction commented Jan 14, 2019

Changes to CFLAGS/CXXFLAGS/LIBS affect following lines in configure.ac.
As originally written, this would cause random libraries, such as
libtorrent, to be linked into the autoconf test program. Occasionally,
this would cause the things like the pkgconfig checks to fail with
mysterious linker errors (e.g. #76).

Instead, only populate these global flags with the additional flags for
dependencies at the very end, before the invocation of AC_OUTPUT.

This is a followup to #118 and fixes the root cause of random autoconf failures.

config.log for XMLRPC-C check before this change:

configure:18550: checking for XMLRPC-C
configure:18584: g++ -o conftest -g -O2 -g -DDEBUG -I/home/z/.local/rtorrent/0.9.6-PS-1.2-dev/include -I/home/z/.local/rtorrent/0.9.6-PS-1.2-dev/include -I/home/z/.local/rtorrent/0.9.6-PS-1.2-dev/include -I /home/z/.local/rtorrent/0.9.6-PS-1.2-dev/include -pthread -std=c++11 -Wl,-rpath,/home/z/.local/rtorrent/0.9.6-PS-1.2-dev/lib -L/home/z/.local/rtorrent/0.9.6-PS-1.2-dev/lib conftest.cpp -lncursesw -lcppunit -L/home/z/.local/rtorrent/0.9.6-PS-1.2-dev/lib -lcurl -L/home/z/.local/rtorrent/0.9.6-PS-1.2-dev/lib -ltorrent -lpthread -L/home/z/.local/rtorrent/0.9.6-PS-1.2-dev/lib -lxmlrpc_server -lxmlrpc -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc_util -lpthread >&5
configure:18584: $? = 0
configure:18586: result: ok

config.log for XMLRPC-C check after this change:

configure:18192: checking for XMLRPC-C
configure:18226: g++ -o conftest -g -O2 -g -DDEBUG -I/home/z/.local/rtorrent/0.9.6-PS-1.2-dev/include -I /home/z/.local/rtorrent/0.9.6-PS-1.2-dev/include -pthread -std=c++11 -Wl,-rpath,/home/z/.local/rtorrent/0.9.6-PS-1.2-dev/lib -L/home/z/.local/rtorrent/0.9.6-PS-1.2-dev/lib conftest.cpp -lpthread -L/home/z/.local/rtorrent/0.9.6-PS-1.2-dev/lib -lxmlrpc_server -lxmlrpc -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc_util -lpthread >&5
configure:18226: $? = 0
configure:18228: result: ok

This is a separate patch file from rt-base-cppunit-pkgconfig.patch, since that patch file is no longer needed in rtorrent 0.9.7 and later.

Changes to CFLAGS/CXXFLAGS/LIBS affect following lines in configure.ac.
As originally written, this would cause random libraries, such as
libtorrent, to be linked into the autoconf test program. Occasionally,
this would cause the things like the pkgconfig checks to fail with
mysterious linker errors (e.g. pyroscope#76).

Instead, only populate these global flags with the additional flags for
dependencies at the very end, before the invocation of AC_OUTPUT.
+++ b/configure.ac
@@ -42,10 +42,6 @@
PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit="yes"])
PKG_CHECK_MODULES([DEPENDENCIES], [libtorrent >= 0.13.7])
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked that this patch applies successfully against both 0.13.6/0.9.6 and 0.13.7/0.9.7, but I'm happy to change this if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant