sys-apps/iproute2: improve configure tests #602960
authorMike Frysinger <vapier@gentoo.org>
Sun, 18 Dec 2016 00:12:23 +0000 (19:12 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sun, 18 Dec 2016 00:13:43 +0000 (19:13 -0500)
sys-apps/iproute2/iproute2-4.4.0.ebuild
sys-apps/iproute2/iproute2-4.5.0.ebuild
sys-apps/iproute2/iproute2-4.6.0.ebuild
sys-apps/iproute2/iproute2-4.7.0.ebuild
sys-apps/iproute2/iproute2-4.8.0.ebuild
sys-apps/iproute2/iproute2-4.9.0.ebuild
sys-apps/iproute2/iproute2-9999.ebuild

index 1689227397e4ee6bdf91508b0f48509d54ca5829..50d9b37d6a8e3726259c341d6e7aa252cfbb7369 100644 (file)
@@ -69,10 +69,10 @@ src_configure() {
        # This sure is ugly.  Should probably move into toolchain-funcs at some point.
        local setns
        pushd "${T}" >/dev/null
-       echo 'main(){return setns();};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
-       echo 'main(){};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+       printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+       echo 'int main(){return 0;}' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
        popd >/dev/null
 
        cat <<-EOF > Config
index e916e84841615b783aea6fa93c8b89afc782d6e3..d144f174a32fcdea9feadc96abef4d4f78056fa6 100644 (file)
@@ -69,10 +69,10 @@ src_configure() {
        # This sure is ugly.  Should probably move into toolchain-funcs at some point.
        local setns
        pushd "${T}" >/dev/null
-       echo 'main(){return setns();};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
-       echo 'main(){};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+       printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+       echo 'int main(){return 0;}' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
        popd >/dev/null
 
        cat <<-EOF > Config
index 9a1447daa5d8d2ff29ac682a88ac37e4d5311409..f8ff844d8851b51b4811debd3ff93b3ca429cca8 100644 (file)
@@ -79,10 +79,10 @@ src_configure() {
        # This sure is ugly.  Should probably move into toolchain-funcs at some point.
        local setns
        pushd "${T}" >/dev/null
-       echo 'main(){return setns();};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
-       echo 'main(){};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+       printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+       echo 'int main(){return 0;}' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
        popd >/dev/null
 
        cat <<-EOF > Config
index 4b4f69e7fb3d1752272bc4edc1553983349314cd..89523f671cfe447f3cd62f794173dd860f3c9321 100644 (file)
@@ -79,10 +79,10 @@ src_configure() {
        # This sure is ugly.  Should probably move into toolchain-funcs at some point.
        local setns
        pushd "${T}" >/dev/null
-       echo 'main(){return setns();};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
-       echo 'main(){};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+       printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+       echo 'int main(){return 0;}' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
        popd >/dev/null
 
        cat <<-EOF > Config
index 4b4f69e7fb3d1752272bc4edc1553983349314cd..89523f671cfe447f3cd62f794173dd860f3c9321 100644 (file)
@@ -79,10 +79,10 @@ src_configure() {
        # This sure is ugly.  Should probably move into toolchain-funcs at some point.
        local setns
        pushd "${T}" >/dev/null
-       echo 'main(){return setns();};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
-       echo 'main(){};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+       printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+       echo 'int main(){return 0;}' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
        popd >/dev/null
 
        cat <<-EOF > Config
index e1d91593c5ad308e5023c2e3c2816f485251262d..d82b3ad8024f1d5e37d1ea2a8858f40e03100423 100644 (file)
@@ -78,10 +78,10 @@ src_configure() {
        # This sure is ugly.  Should probably move into toolchain-funcs at some point.
        local setns
        pushd "${T}" >/dev/null
-       echo 'main(){return setns();};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
-       echo 'main(){};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+       printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+       echo 'int main(){return 0;}' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
        popd >/dev/null
 
        cat <<-EOF > Config
index 2e7af2b5505ad8c0db9e2ed587128876f150526a..e9beb84bf045160194ecdabfb17a958674a51013 100644 (file)
@@ -70,10 +70,10 @@ src_configure() {
        # This sure is ugly.  Should probably move into toolchain-funcs at some point.
        local setns
        pushd "${T}" >/dev/null
-       echo 'main(){return setns();};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
-       echo 'main(){};' > test.c
-       ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+       printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+       echo 'int main(){return 0;}' > test.c
+       ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
        popd >/dev/null
 
        cat <<-EOF > Config