]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed linking with libecap after PKG_CHECK_MODULES changes.
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 17 Feb 2011 19:11:06 +0000 (12:11 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 17 Feb 2011 19:11:06 +0000 (12:11 -0700)
Previous commit (r11126) made sense and seemed to work fine until I
discovered that touching a source file in src/adaptation/ecap and
running "make" there leads to libtool's "file not found" errors for some
libtool-generated internal file. However, "make clean all" would still
work.

To better diagnose the issue, I renamed PKG_CHECK_MODULES prefix to
EXTLIBECAP and our ecap/libecap to ecap/libxecap. The difference in
names allowed to distinguish external libecap-related names/failures
from internal ones, but it did not solve the problem.

Moving EXTLIBECAP_LIBS from adaptation/ecap/ to adaptation/ Makefile.am
helped.  Older code included external libecap in adaptation/Makefile.am
as well, perhaps to avoid similar problems. It does not make sense to
put external libecap there instead of the ecap-specific directory, but
it works.

configure.ac
src/adaptation/Makefile.am
src/adaptation/ecap/Makefile.am

index 9c65346ab4b35b6d070f10ae54b5709eea46efcd..9b0f7defd2cf47502c10b151fe6be0ab7dd86f78 100644 (file)
@@ -901,7 +901,6 @@ dnl Necessary if the first PKG_CHECK_MODULES call is conditional
 PKG_PROG_PKG_CONFIG
 
 dnl Perform configuration consistency checks for eCAP
-ECAPLIB=""
 if test "x$squid_opt_use_ecap" = "xyes";
 then
     dnl eCAP support requires loadable modules, which are enabled by default
@@ -921,7 +920,7 @@ AM_CONDITIONAL(USE_ECAP, test "x$squid_opt_use_ecap" = "xyes")
 if test "x$squid_opt_use_ecap" = "xyes";
 then
     AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
-    ECAP_LIBS="ecap/libecap.la"
+    ECAP_LIBS="ecap/libxecap.la"
     squid_opt_use_adaptation=yes
 else
     AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
index b9466de778053c95a6d6b4c3412941ae7cd46f3e..7fd6401634f2c4ff4ca0d1dda3a2c698952667d0 100644 (file)
@@ -45,6 +45,7 @@ libadaptation_la_SOURCES = \
        History.h 
 
 # add libraries for specific adaptation schemes
+libadaptation_la_LDFLAGS = $(EXTLIBECAP_LIBS)
 libadaptation_la_LIBADD = $(ECAP_LIBS) $(ICAP_LIBS)
 
 libadaptation_la_DEPENDENCIES = $(ECAP_LIBS) $(ICAP_LIBS)
index 5d54ee48466a1de5a26207283435433d66d49281..eff0af1334e76fc10ab594f71a5a8f5552c983d3 100644 (file)
@@ -1,9 +1,9 @@
 include $(top_srcdir)/src/Common.am
 include $(top_srcdir)/src/TestHeaders.am
 
-noinst_LTLIBRARIES = libecap.la
+noinst_LTLIBRARIES = libxecap.la
 
-libecap_la_SOURCES = \
+libxecap_la_SOURCES = \
        Config.h \
        Config.cc \
        Host.h \
@@ -18,5 +18,9 @@ libecap_la_SOURCES = \
        Registry.h
 
 # add libecap using its pkg-config-produced configuration variables
-libecap_la_LDFLAGS = $(EXTLIBECAP_LIBS)
-libecap_la_CPPFLAGS = $(EXTLIBECAP_CFLAGS)
+libxecap_la_CPPFLAGS = $(EXTLIBECAP_CFLAGS)
+
+## It is tempting to put libxecap_la_LDFLAGS here, but it leads to weird
+## linking errors. For example, "make clean all" works, but rebuilding after
+## modifying a single source file leads to libtool's "file not found" errors.
+## libxecap_la_LDFLAGS = $(EXTLIBECAP_LIBS)