Skip to content

Commit

Permalink
squid: fix compilation with ccache
Browse files Browse the repository at this point in the history
Added a patch to remove BUILDCXXFLAGS. For some reason, TARGET_CXXFLAGS
are leaking.

Removed custom Build/Compile section. There's already PKG_INSTALL.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
  • Loading branch information
neheb committed Dec 6, 2020
1 parent 2ef9701 commit a642218
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
16 changes: 4 additions & 12 deletions net/squid/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=squid
PKG_VERSION:=4.12
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www3.us.squid-cache.org/Versions/v4/ \
Expand All @@ -21,9 +21,9 @@ PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
PKG_LICENSE:=GPL-2.0-or-later
PKG_CPE_ID:=cpe:/a:squid-cache:squid

PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk

Expand Down Expand Up @@ -69,8 +69,7 @@ define Package/squid-mod-cachemgr
endef

CONFIGURE_ARGS += \
BUILDCXX=$(HOSTCXX) \
BUILDCXXFLAGS=$(if $(HOST_CXXFLAGS),$(HOST_CXXFLAGS),-O2) \
BUILDCXX=$(HOSTCXX_NOCACHE) \
--config-cache \
--datadir=/usr/share/squid \
--libexecdir=/usr/lib/squid \
Expand Down Expand Up @@ -122,13 +121,6 @@ CONFIGURE_VARS += \
TARGET_CFLAGS += -Wno-error
TARGET_LDFLAGS += -latomic

define Build/Compile
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/lib all
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" \
install
endef

define Package/squid/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
Expand Down
11 changes: 11 additions & 0 deletions net/squid/patches/010-no-buildbxxflags.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -765,7 +765,7 @@ cache_cf.o: cf_parser.cci

# cf_gen builds the configuration files.
cf_gen$(EXEEXT): $(cf_gen_SOURCES) $(cf_gen_DEPENDENCIES) cf_gen_defines.cci
- $(BUILDCXX) $(BUILDCXXFLAGS) -o $@ $(srcdir)/cf_gen.cc -I$(srcdir) -I$(top_builddir)/include/ -I$(top_builddir)/src
+ $(BUILDCXX) -o $@ $(srcdir)/cf_gen.cc -I$(srcdir) -I$(top_builddir)/include/ -I$(top_builddir)/src

# squid.conf.default is built by cf_gen when making cf_parser.cci
squid.conf.default squid.conf.documented: cf_parser.cci

0 comments on commit a642218

Please sign in to comment.