]> git.pld-linux.org Git - packages/busybox.git/commitdiff
fix build with glibc after dropping rpc
authorJan Palus <atler@pld-linux.org>
Mon, 7 Dec 2020 00:17:31 +0000 (00:17 +0000)
committerJan Palus <atler@pld-linux.org>
Mon, 7 Dec 2020 00:19:59 +0000 (00:19 +0000)
...at least when libtirpc is not linked against heimdal

busybox-initrd.config
busybox.config
busybox.spec

index 824c4d2a789ba101371a68db92d816d1b93d42c8..365d3c9a122dadfe17f228b3f4cb15256ed44065 100644 (file)
@@ -61,7 +61,6 @@ CONFIG_CROSS_COMPILER_PREFIX=""
 CONFIG_SYSROOT=""
 CONFIG_EXTRA_CFLAGS=""
 CONFIG_EXTRA_LDFLAGS=""
-CONFIG_EXTRA_LDLIBS=""
 
 #
 # Debugging Options
index 1a1ca119a5d99d4cd1391c97e1b03cec5af8b9b1..da42d3f9cef50629ee8646c6f985bdc70c4a0e69 100644 (file)
@@ -66,7 +66,6 @@ CONFIG_CROSS_COMPILER_PREFIX=""
 CONFIG_SYSROOT=""
 CONFIG_EXTRA_CFLAGS=""
 CONFIG_EXTRA_LDFLAGS=""
-CONFIG_EXTRA_LDLIBS=""
 
 #
 # Debugging Options
index f5275b28cea7671b1e04fda5e9c2495a5922427f..30bae8ce725a855f9f7d723903f983751282ff2e 100644 (file)
@@ -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
This page took 0.502444 seconds and 4 git commands to generate.