commit 6648e38361034b959c2591f61b3f87e251b1ced4
Author: Jan Palus <[email protected]>
Date:   Mon Dec 7 00:17:31 2020 +0000

    fix build with glibc after dropping rpc
    
    ...at least when libtirpc is not linked against heimdal

 busybox-initrd.config |  1 -
 busybox.config        |  1 -
 busybox.spec          | 32 +++++++++++++++++++++++++++-----
 3 files changed, 27 insertions(+), 7 deletions(-)
---
diff --git a/busybox.spec b/busybox.spec
index f5275b2..30bae8c 100644
--- a/busybox.spec
+++ b/busybox.spec
@@ -64,12 +64,17 @@ URL:                http://www.busybox.net/
 BuildRequires: gcc >= 3.2
 BuildRequires: perl-tools-pod
 BuildRequires: rpmbuild(macros) >= 1.652
+%if %{with glibc}
+BuildRequires: libtirpc-devel
+BuildRequires: pkgconfig
+%endif
 %if %{with initrd} || %{with static}
        %if %{with dietlibc}
 BuildRequires: dietlibc-static
        %else
                %if %{with glibc}
 BuildRequires: glibc-static
+BuildRequires: libtirpc-static
                %else
 %if "%{_target_base_arch}" != "%{_host_base_arch}"
 BuildRequires: cross%{_target_base_arch}-uClibc-static
@@ -99,6 +104,16 @@ BuildRoot:  %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                filterout_ld    -Wl,-z,(combreloc|relro)
 
+%if %{with glibc}
+%define                tirpccflags     %(pkg-config --cflags libtirpc)
+%if %{with initrd} || %{with static}
+%define                tirpcslibs      %(pkg-config --libs --static 
libtirpc|sed s/-l//g)
+%endif
+%if %{with dynamic}
+%define                tirpcdlibs      %(pkg-config --libs libtirpc|sed 
s/-l//g)
+%endif
+%endif
+
 %description
 BusyBox combines tiny versions of many common UNIX utilities into a
 single small executable. It provides minimalist replacements for most
@@ -175,10 +190,11 @@ Statycznie skonsolidowany busybox dla initrd.
 install -d built
 %if %{with initrd}
 install %{SOURCE2} .config
+echo 'CONFIG_EXTRA_LDLIBS="%{?with_glibc:%{tirpcslibs}}"' >> .config
 %{__make} oldconfig
 %{__make} \
        %{?with_verbose:V=1} \
-       EXTRA_CFLAGS="%{rpmcflags} -Os -D_BSD_SOURCE" \
+       EXTRA_CFLAGS="%{rpmcflags} %{?with_glibc:%{tirpccflags}} -Os 
-D_BSD_SOURCE" \
        EXTRA_LDFLAGS="%{rpmldflags} -static -Wl,-z,noexecstack" \
 %if %{with dietlibc}
        LIBRARIES="-lrpc" \
@@ -199,17 +215,17 @@ mv -f busybox built/busybox.initrd
 %{__make} clean
 %endif
 
+%if %{with static}
 %if %{with altconfig}
 install %{SOURCE3} .config
 %else
 install %{SOURCE1} .config
+echo 'CONFIG_EXTRA_LDLIBS="%{?with_glibc:%{tirpcslibs}}"' >> .config
 %endif
-
-%if %{with static}
 %{__make} oldconfig
 %{__make} \
        %{?with_verbose:V=1} \
-       EXTRA_CFLAGS="%{rpmcflags} -Os -D_BSD_SOURCE" \
+       EXTRA_CFLAGS="%{rpmcflags} %{?with_glibc:%{tirpccflags}} -Os 
-D_BSD_SOURCE" \
        EXTRA_LDFLAGS="%{rpmldflags} -static -Wl,-z,noexecstack" \
 %if %{with dietlibc}
        LIBRARIES="-lrpc" \
@@ -231,11 +247,17 @@ mv -f busybox built/busybox.static
 %endif
 
 %if %{with dynamic}
+%if %{with altconfig}
+install %{SOURCE3} .config
+%else
+install %{SOURCE1} .config
+echo 'CONFIG_EXTRA_LDLIBS="%{?with_glibc:%{tirpcdlibs}}"' >> .config
+%endif
 %{__make} oldconfig
 %{__make} \
        %{?with_verbose:V=1} \
        %{CrossOpts} \
-       EXTRA_CFLAGS="%{rpmcflags}" \
+       EXTRA_CFLAGS="%{rpmcflags} %{?with_glibc:%{tirpccflags}}" \
        EXTRA_LDFLAGS="%{rpmldflags} -Wl,-z,noexecstack" \
        CC="%{__cc}"
 %{__make} busybox.links docs/busybox.1
diff --git a/busybox-initrd.config b/busybox-initrd.config
index 824c4d2..365d3c9 100644
--- a/busybox-initrd.config
+++ b/busybox-initrd.config
@@ -61,7 +61,6 @@ CONFIG_CROSS_COMPILER_PREFIX=""
 CONFIG_SYSROOT=""
 CONFIG_EXTRA_CFLAGS=""
 CONFIG_EXTRA_LDFLAGS=""
-CONFIG_EXTRA_LDLIBS=""
 
 #
 # Debugging Options
diff --git a/busybox.config b/busybox.config
index 1a1ca11..da42d3f 100644
--- a/busybox.config
+++ b/busybox.config
@@ -66,7 +66,6 @@ CONFIG_CROSS_COMPILER_PREFIX=""
 CONFIG_SYSROOT=""
 CONFIG_EXTRA_CFLAGS=""
 CONFIG_EXTRA_LDFLAGS=""
-CONFIG_EXTRA_LDLIBS=""
 
 #
 # Debugging Options
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/busybox.git/commitdiff/6648e38361034b959c2591f61b3f87e251b1ced4

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to