Source: ipvsadm Version: 1:1.28-3 Tags: patch upstream User: helm...@debian.org Usertags: rebootstrap
ipvsadm fails to cross build from source, because the upstream build system hard codes the build architecture pkg-config. After making it substitutable, ipvsadm cross builds successfully. Please consider applying the attached patch. Helmut
--- ipvsadm-1.28.orig/Makefile +++ ipvsadm-1.28/Makefile @@ -36,6 +36,7 @@ RPMSPECDIR = $(shell rpm --eval '%_specdir') CC = gcc +PKG_CONFIG ?= pkg-config INCLUDE = SBIN = $(BUILD_ROOT)/sbin MANDIR = usr/man @@ -66,10 +67,10 @@ LIBS = -lpopt ifneq (0,$(HAVE_NL)) LIBS += $(shell \ - if which pkg-config > /dev/null 2>&1; then \ - if pkg-config --libs libnl-genl-3.0 2> /dev/null; then :;\ - elif pkg-config --libs libnl-2.0 2> /dev/null; then :;\ - elif pkg-config --libs libnl-1 2> /dev/null; then :;\ + if which $(PKG_CONFIG) > /dev/null 2>&1; then \ + if $(PKG_CONFIG) --libs libnl-genl-3.0 2> /dev/null; then :;\ + elif $(PKG_CONFIG) --libs libnl-2.0 2> /dev/null; then :;\ + elif $(PKG_CONFIG) --libs libnl-1 2> /dev/null; then :;\ fi; \ else echo "-lnl"; fi) endif --- ipvsadm-1.28.orig/libipvs/Makefile +++ ipvsadm-1.28/libipvs/Makefile @@ -1,14 +1,15 @@ # Makefile for libipvs CC = gcc +PKG_CONFIG ?= pkg-config CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -fPIC ifneq (0,$(HAVE_NL)) CFLAGS += -DLIBIPVS_USE_NL CFLAGS += $(shell \ - if which pkg-config > /dev/null 2>&1; then \ - if pkg-config --cflags libnl-3.0 2> /dev/null; then :; \ - elif pkg-config --cflags libnl-2.0 2> /dev/null; then :; \ - elif pkg-config --cflags libnl-1 2> /dev/null; then :; \ + if which $(PKG_CONFIG) > /dev/null 2>&1; then \ + if $(PKG_CONFIG) --cflags libnl-3.0 2> /dev/null; then :; \ + elif $(PKG_CONFIG) --cflags libnl-2.0 2> /dev/null; then :; \ + elif $(PKG_CONFIG) --cflags libnl-1 2> /dev/null; then :; \ fi; \ fi) endif @@ -17,10 +18,10 @@ echo "-I../../."; fi;) DEFINES = $(shell if [ ! -f ../../ip_vs.h ]; then \ echo "-DHAVE_NET_IP_VS_H"; fi;) -DEFINES += $(shell if which pkg-config > /dev/null 2>&1; then \ - if pkg-config --exists libnl-3.0; then :; \ - elif pkg-config --exists libnl-2.0; then :; \ - elif pkg-config --exists libnl-1; \ +DEFINES += $(shell if which $(PKG_CONFIG) > /dev/null 2>&1; then \ + if $(PKG_CONFIG) --exists libnl-3.0; then :; \ + elif $(PKG_CONFIG) --exists libnl-2.0; then :; \ + elif $(PKG_CONFIG) --exists libnl-1; \ then echo "-DFALLBACK_LIBNL1"; fi; fi) .PHONY = all clean install dist distclean rpm rpms