diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-07-10 22:09:15 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-07-17 17:36:19 +0000 |
commit | 85ff35126623e6f26c84d9fa8a35b6762aefb110 (patch) | |
tree | c4ddd4482f4d0f435612d4471ee0af311396cf00 /configure | |
parent | 61e621def380f28183b6ce7047e9a88a49f81f82 (diff) |
Revamp the CLOEXEC support in Qt
The pipe2/dup3/accept4 functions and SOCK_CLOEXEC are quite old nowadays
on Linux. They were introduced on Linux 2.6.28 and glibc 2.10, all from
2008. They were also picked up by uClibc in 2011 and FreeBSD as of
version 10.0. So we no longer need the runtime detection of whether the
feature is available.
Instead, if the libc has support for it, use it unconditionally and fail
at runtime if the syscall isn't implemented.
Change-Id: Ib056b47dde3341ef9a52ffff13efcc39ef8dff7d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -728,6 +728,7 @@ CFG_IPV6IFNAME=auto CFG_GETIFADDRS=auto CFG_INOTIFY=auto CFG_EVENTFD=auto +CFG_CLOEXEC=no CFG_RPATH=yes CFG_FRAMEWORK=auto CFG_USE_GOLD_LINKER=auto @@ -5869,6 +5870,11 @@ if [ "$CFG_GETIFADDRS" != "no" ]; then fi fi +# find if the platform provides thread-safe CLOEXEC support +if compileTest unix/cloexec; then + CFG_CLOEXEC=yes +fi + # detect OpenSSL if [ "$CFG_OPENSSL" != "no" ]; then if compileTest unix/openssl "OpenSSL"; then @@ -6147,6 +6153,9 @@ fi if [ "$CFG_EVENTFD" = "yes" ]; then QT_CONFIG="$QT_CONFIG eventfd" fi +if [ "$CFG_CLOEXEC" = "yes" ]; then + QT_CONFIG="$QT_CONFIG threadsafe-cloexec" +fi if [ "$CFG_LIBJPEG" = "no" ]; then CFG_JPEG="no" elif [ "$CFG_LIBJPEG" = "system" ]; then @@ -6627,6 +6636,7 @@ QMakeVar set sql-plugins "$SQL_PLUGINS" [ "$CFG_GETIFADDRS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETIFADDRS" [ "$CFG_INOTIFY" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_INOTIFY" [ "$CFG_EVENTFD" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EVENTFD" +[ "$CFG_CLOEXEC" = "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_THREADSAFE_CLOEXEC=1" [ "$CFG_NIS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NIS" [ "$CFG_OPENSSL" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENSSL" [ "$CFG_OPENSSL" = "linked" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LINKED_OPENSSL" |