mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-09-17 08:20:31 -04:00
80 lines
2.0 KiB
Plaintext
80 lines
2.0 KiB
Plaintext
$NetBSD: patch-configure,v 1.14 2016/09/04 09:21:04 ryoon Exp $
|
|
|
|
Don't use gld on SunOS
|
|
add check for shm_open
|
|
avoid bad substitution
|
|
|
|
--- configure.orig 2016-09-02 15:34:17.000000000 +0000
|
|
+++ configure
|
|
@@ -625,7 +625,6 @@ SunOS)
|
|
solaris="yes"
|
|
make="${MAKE-gmake}"
|
|
install="${INSTALL-ginstall}"
|
|
- ld="gld"
|
|
smbd="${SMBD-/usr/sfw/sbin/smbd}"
|
|
needs_libsunmath="no"
|
|
solarisrev=$(uname -r | cut -f2 -d.)
|
|
@@ -3706,6 +3705,27 @@ if compile_prog "" "" ; then
|
|
fallocate_zero_range=yes
|
|
fi
|
|
|
|
+# check for shm_open
|
|
+shm_open=no
|
|
+cat > $TMPC << EOF
|
|
+#include <sys/types.h>
|
|
+#include <sys/mman.h>
|
|
+#include <fcntl.h>
|
|
+#include <stddef.h> // for NULL
|
|
+
|
|
+int main(void)
|
|
+{
|
|
+ shm_open(NULL, O_RDWR, 0644);
|
|
+ return 0;
|
|
+}
|
|
+EOF
|
|
+if compile_prog "" "" ; then
|
|
+ shm_open=yes
|
|
+elif compile_prog "" "-lrt" ; then
|
|
+ LIBS="$LIBS -lrt"
|
|
+ shm_open=yes
|
|
+fi
|
|
+
|
|
# check for posix_fallocate
|
|
posix_fallocate=no
|
|
cat > $TMPC << EOF
|
|
@@ -3955,8 +3975,13 @@ fi
|
|
cat > $TMPC <<EOF
|
|
#include <signal.h>
|
|
#include <time.h>
|
|
+#include <sys/types.h>
|
|
+#include <sys/mman.h>
|
|
+#include <fcntl.h>
|
|
+
|
|
int main(void) {
|
|
timer_create(CLOCK_REALTIME, NULL, NULL);
|
|
+ shm_open(NULL, O_RDWR, 0644);
|
|
return clock_gettime(CLOCK_REALTIME, NULL);
|
|
}
|
|
EOF
|
|
@@ -4607,7 +4632,9 @@ if test "$want_tools" = "yes" ; then
|
|
tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
|
|
if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
|
|
tools="qemu-nbd\$(EXESUF) $tools"
|
|
- tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools"
|
|
+ if test "$shm_open" = "yes" ; then
|
|
+ tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools"
|
|
+ fi
|
|
fi
|
|
fi
|
|
if test "$softmmu" = yes ; then
|
|
@@ -5114,6 +5141,9 @@ fi
|
|
if test "$fallocate_zero_range" = "yes" ; then
|
|
echo "CONFIG_FALLOCATE_ZERO_RANGE=y" >> $config_host_mak
|
|
fi
|
|
+if [ "$shm_open" = "yes" ] ; then
|
|
+ echo "CONFIG_SHM_OPEN=y" >> $config_host_mak
|
|
+fi
|
|
if test "$posix_fallocate" = "yes" ; then
|
|
echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
|
|
fi
|