From 8f32e34734832013da9be7a2d794ca2125113a7e Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sat, 29 Apr 2017 19:52:43 +0200 Subject: Fix build for -no-feature-icu -no-feature-textcodec Change-Id: Ibb19e5bce3da81518f0967ae7677f42de80ec73e Reviewed-by: Thiago Macieira --- src/corelib/configure.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/configure.json') diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 2b3efbeb15..6399e4d3c4 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -241,7 +241,7 @@ "label": "iconv", "purpose": "Provides internationalization on Unix.", "section": "Internationalization", - "condition": "!features.icu && (features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv)", + "condition": "!features.icu && features.textcodec && (features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv)", "output": [ "privateFeature", "feature" ] }, "posix-libiconv": { -- cgit v1.2.3 From a3b5020a1aee9f8d505b82ba70700518e5786686 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 31 Jul 2017 11:42:44 +0200 Subject: configure: prune dead tests::journald libraries::journald is the actually used one. Change-Id: I2da4ae106dd1041cdb269e05def93523ed5011b2 Reviewed-by: Thiago Macieira --- src/corelib/configure.json | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/corelib/configure.json') diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 6399e4d3c4..0cbb35e688 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -167,11 +167,6 @@ "type": "compile", "test": "unix/ipc_posix" }, - "journald": { - "label": "journald", - "type": "compile", - "test": "unix/journald" - }, "ppoll": { "label": "ppoll()", "type": "compile", -- cgit v1.2.3 From acf75d733708f2275cc363566c2457f5c4486362 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 31 Jul 2017 12:17:09 +0200 Subject: configure: standardize handling of 64 bit atomics replace the custom QT_NO_STD_ATOMIC64 with a regular public feature, and give libatomic an empty source rather than using a separate config test. Change-Id: Iaf4a7f4c4874f61bf93aa58fe41843a86baf1ab7 Reviewed-by: Thiago Macieira --- src/corelib/configure.json | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/corelib/configure.json') diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 0cbb35e688..67a1a2ad4b 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -69,9 +69,10 @@ ] }, "libatomic": { - "label": "64 bit atomics in libatomic", + "label": "64 bit atomics", "test": "common/atomic64", "sources": [ + "", "-latomic" ] }, @@ -116,11 +117,6 @@ }, "tests": { - "atomic64": { - "label": "64 bit atomics", - "type": "compile", - "test": "common/atomic64" - }, "atomicfptr": { "label": "working std::atomic for function pointers", "type": "compile", @@ -284,13 +280,8 @@ }, "std-atomic64": { "label": "64 bit atomic operations", - "condition": "tests.atomic64 || libs.libatomic", - "output": [ { "type": "define", "negative": true, "name": "QT_NO_STD_ATOMIC64" } ] - }, - "libatomic": { - "label": "64 bit atomic operations in libatomic", - "condition": "!tests.atomic64 && libs.libatomic", - "output": [ "privateFeature" ] + "condition": "libs.libatomic", + "output": [ "publicFeature" ] }, "mimetype": { "label": "Mimetype handling", -- cgit v1.2.3 From f54f7d847099db448223fd630c5416b6fbd84c9e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 1 Aug 2017 18:30:33 +0200 Subject: configure: Add a feature to write tests in the .json file We're adding a lot of unnecessary files that end up later as cargo-cult, for at most a handful of lines. So instead move the testcases directly into the .json file. The following sources were not inlined, because multiple tests share them, and the inlining infra does not support that (yet): - avx512 - openssl - gnu-libiconv/sun-libiconv (there is also a command line option to select the exact variant, which makes it hard/impossible to properly coalesce the library sources) The following sources were not inlined because of "complications": - verifyspec contains a lengthy function in the project file - stl contains lots of code in the source file - xlocalescanprint includes a private header from the source tree via a relative path, which we can't do, as the test's physical location is variable. - corewlan uses objective c++, which the inline system doesn't support reduce_relocs and reduce_exports now create libraries with main(), which is weird enough, but doesn't hurt. Done-with: Oswald Buddenhagen Change-Id: Ic3a088f9f08a4fd7ae91fffd14ce8a262021cca0 Reviewed-by: Oswald Buddenhagen --- src/corelib/configure.json | 220 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 199 insertions(+), 21 deletions(-) (limited to 'src/corelib/configure.json') diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 67a1a2ad4b..5596280250 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -22,14 +22,26 @@ "libraries": { "doubleconversion": { "label": "DoubleConversion", - "test": "unix/doubleconversion", + "test": { + "include": "double-conversion/double-conversion.h", + "main": "(void) double_conversion::StringToDoubleConverter::NO_FLAGS;" + }, "sources": [ "-ldouble-conversion" ] }, "glib": { "label": "GLib", - "test": "unix/glib", + "test": { + "head": "typedef struct _GMainContext GMainContext;", + "include": "glib.h", + "main": [ + "g_thread_init(NULL);", + "(void) g_main_context_default();", + "(void) g_source_new(0, 0);", + "g_source_add_poll(NULL, NULL);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" } ] @@ -44,7 +56,22 @@ }, "icu": { "label": "ICU", - "test": "unix/icu", + "test": { + "include": [ "unicode/utypes.h", "unicode/ucol.h", "unicode/ustring.h" ], + "main": [ + "UErrorCode status = U_ZERO_ERROR;", + "UCollator *collator = ucol_open(\"ru_RU\", &status);", + "if (!U_FAILURE(status))", + " ucol_close(collator);" + ], + "qmake": [ + "CONFIG += build_all", + "CONFIG(debug, debug|release): \\", + " LIBS += $$LIBS_DEBUG", + "else: \\", + " LIBS += $$LIBS_RELEASE" + ] + }, "sources": [ { "builds": { @@ -62,7 +89,10 @@ }, "journald": { "label": "journald", - "test": "unix/journald", + "test": { + "include": [ "systemd/sd-journal.h", "syslog.h" ], + "main": "sd_journal_send(\"PRIORITY=%i\", LOG_INFO, NULL);" + }, "sources": [ { "type": "pkgConfig", "args": "libsystemd" }, { "type": "pkgConfig", "args": "libsystemd-journal" } @@ -70,7 +100,26 @@ }, "libatomic": { "label": "64 bit atomics", - "test": "common/atomic64", + "test": { + "include": [ "atomic", "cstdint" ], + "tail": [ + "void test(volatile std::atomic &a)", + "{", + " std::int64_t v = a.load(std::memory_order_acquire);", + " while (!a.compare_exchange_strong(v, v + 1,", + " std::memory_order_acq_rel,", + " std::memory_order_acquire)) {", + " v = a.exchange(v - 1);", + " }", + " a.store(v + 1, std::memory_order_release);", + "}" + ], + "main": [ + "void *ptr = (void*)0xffffffc0; // any random pointer", + "test(*reinterpret_cast *>(ptr));" + ], + "qmake": "CONFIG += c++11" + }, "sources": [ "", "-latomic" @@ -78,7 +127,10 @@ }, "libdl": { "label": "dlopen()", - "test": "unix/dlopen", + "test": { + "include": "dlfcn.h", + "main": "dlopen(0, 0);" + }, "sources": [ "", "-ldl" @@ -86,7 +138,10 @@ }, "librt": { "label": "clock_gettime()", - "test": "unix/clock-gettime", + "test": { + "include": [ "unistd.h", "time.h" ], + "main": "timespec ts; clock_gettime(CLOCK_REALTIME, &ts);" + }, "sources": [ "", "-lrt" @@ -94,21 +149,38 @@ }, "pcre2": { "label": "PCRE2", - "test": "unix/pcre2", + "test": { + "head": "#define PCRE2_CODE_UNIT_WIDTH 16", + "include": "pcre2.h", + "tail": [ + "#if (PCRE2_MAJOR < 10) || ((PCRE2_MAJOR == 10) && (PCRE2_MINOR < 20))", + "# error This PCRE version is not supported", + "#endif" + ] + }, "sources": [ "-lpcre2-16" ] }, "pps": { "label": "PPS", - "test": "unix/pps", + "test": { + "include": "sys/pps.h", + "main": [ + "pps_decoder_t decoder;", + "pps_decoder_initialize(&decoder, NULL);" + ] + }, "sources": [ "-lpps" ] }, "slog2": { "label": "slog2", - "test": "unix/slog2", + "test": { + "include": "slog2.h", + "main": "slog2_set_default_buffer((slog2_buffer_t)-1);" + }, "export": "", "sources": [ "-lslog2" @@ -120,23 +192,77 @@ "atomicfptr": { "label": "working std::atomic for function pointers", "type": "compile", - "test": "common/atomicfptr" + "test": { + "include": "atomic", + "tail": [ + "typedef void (*fptr)(int);", + "typedef std::atomic atomicfptr;", + "void testfunction(int) { }", + "void test(volatile atomicfptr &a)", + "{", + " fptr v = a.load(std::memory_order_acquire);", + " while (!a.compare_exchange_strong(v, &testfunction,", + " std::memory_order_acq_rel,", + " std::memory_order_acquire)) {", + " v = a.exchange(&testfunction);", + " }", + " a.store(&testfunction, std::memory_order_release);", + "}" + ], + "main": [ + "atomicfptr fptr(testfunction);", + "test(fptr);" + ], + "qmake": "CONFIG += c++11" + } }, "clock-monotonic": { "label": "POSIX monotonic clock", "type": "compile", - "test": "unix/clock-monotonic", + "test": { + "include": [ "unistd.h", "time.h" ], + "main": [ + "#if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)", + "timespec ts;", + "clock_gettime(CLOCK_MONOTONIC, &ts);", + "#else", + "# error Feature _POSIX_MONOTONIC_CLOCK not available", + "#endif" + ] + }, "use": "librt" }, "cloexec": { "label": "O_CLOEXEC", "type": "compile", - "test": "unix/cloexec" + "test": { + "head": "#define _GNU_SOURCE 1", + "include": [ "sys/types.h", "sys/socket.h", "fcntl.h", "unistd.h" ], + "main": [ + "int pipes[2];", + "(void) pipe2(pipes, O_CLOEXEC | O_NONBLOCK);", + "(void) fcntl(0, F_DUPFD_CLOEXEC, 0);", + "(void) dup3(0, 3, O_CLOEXEC);", + "#if defined(__NetBSD__)", + "(void) paccept(0, 0, 0, NULL, SOCK_CLOEXEC | SOCK_NONBLOCK);", + "#else", + "(void) accept4(0, 0, 0, SOCK_CLOEXEC | SOCK_NONBLOCK);", + "#endif" + ] + } }, "eventfd": { "label": "eventfd", "type": "compile", - "test": "unix/eventfd" + "test": { + "include": "sys/eventfd.h", + "main": [ + "eventfd_t value;", + "int fd = eventfd(0, EFD_CLOEXEC);", + "eventfd_read(fd, &value);", + "eventfd_write(fd, value);" + ] + } }, "posix-iconv": { "label": "POSIX iconv", @@ -151,37 +277,89 @@ "inotify": { "label": "inotify", "type": "compile", - "test": "unix/inotify" + "test": { + "include": "sys/inotify.h", + "main": [ + "inotify_init();", + "inotify_add_watch(0, \"foobar\", IN_ACCESS);", + "inotify_rm_watch(0, 1);" + ] + } }, "ipc_sysv": { "label": "SysV IPC", "type": "compile", - "test": "unix/ipc_sysv" + "test": { + "include": [ "sys/types.h", "sys/ipc.h", "sys/sem.h", "sys/shm.h", "fcntl.h" ], + "main": [ + "key_t unix_key = ftok(\"test\", 'Q');", + "semctl(semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL), 0, IPC_RMID, 0);", + "shmget(unix_key, 0, 0666 | IPC_CREAT | IPC_EXCL);", + "shmctl(0, 0, (struct shmid_ds *)(0));" + ] + } }, "ipc_posix": { "label": "POSIX IPC", "type": "compile", - "test": "unix/ipc_posix" + "test": { + "include": [ "sys/types.h", "sys/mman.h", "semaphore.h", "fcntl.h" ], + "main": [ + "sem_close(sem_open(\"test\", O_CREAT | O_EXCL, 0666, 0));", + "shm_open(\"test\", O_RDWR | O_CREAT | O_EXCL, 0666);", + "shm_unlink(\"test\");" + ], + "qmake": "linux: LIBS += -lpthread -lrt" + } }, "ppoll": { "label": "ppoll()", "type": "compile", - "test": "unix/ppoll" + "test": { + "include": [ "signal.h", "poll.h" ], + "main": [ + "struct pollfd pfd;", + "struct timespec ts;", + "sigset_t sig;", + "ppoll(&pfd, 1, &ts, &sig);" + ] + } }, "pollts": { "label": "pollts()", "type": "compile", - "test": "unix/pollts" + "test": { + "include": [ "poll.h", "signal.h", "time.h" ], + "main": [ + "struct pollfd pfd;", + "struct timespec ts;", + "sigset_t sig;", + "pollts(&pfd, 1, &ts, &sig);" + ] + } }, "poll": { "label": "poll()", "type": "compile", - "test": "unix/poll" + "test": { + "include": "poll.h", + "main": [ + "struct pollfd pfd;", + "poll(&pfd, 1, 0);" + ] + } }, "syslog": { "label": "syslog", "type": "compile", - "test": "unix/syslog" + "test": { + "include": "syslog.h", + "main": [ + "openlog(\"qt\", 0, LOG_USER);", + "syslog(LOG_INFO, \"configure\");", + "closelog();" + ] + } }, "xlocalescanprint": { "label": "xlocale.h (or equivalents)", -- cgit v1.2.3 From b0060d1056d6d1752d91652261de97db909c7862 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 31 Jul 2017 12:51:38 +0200 Subject: configure: un-namespace remaining non-inline configure tests only few tests remain, and many of these were mis-classified anyway. Change-Id: Ic3bc96928a0c79fe77b9ec10e6508d4822f18df2 Reviewed-by: Thiago Macieira --- src/corelib/configure.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/corelib/configure.json') diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 5596280250..91f7bb4fd6 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -49,7 +49,7 @@ "gnu_iconv": { "label": "GNU libiconv", "export": "iconv", - "test": "unix/gnu-libiconv", + "test": "gnu-libiconv", "sources": [ "-liconv" ] @@ -267,12 +267,12 @@ "posix-iconv": { "label": "POSIX iconv", "type": "compile", - "test": "unix/iconv" + "test": "iconv" }, "sun-iconv": { "label": "SUN libiconv", "type": "compile", - "test": "unix/sun-libiconv" + "test": "sun-libiconv" }, "inotify": { "label": "inotify", @@ -364,7 +364,7 @@ "xlocalescanprint": { "label": "xlocale.h (or equivalents)", "type": "compile", - "test": "common/xlocalescanprint" + "test": "xlocalescanprint" } }, @@ -774,7 +774,7 @@ You need to use libdouble-conversion for double/string conversion." "condition": "!tests.atomicfptr", "message": "detected a std::atomic implementation that fails for function pointers. Please apply the patch corresponding to your Standard Library vendor, found in - qtbase/config.tests/common/atomicfptr" + qtbase/config.tests/atomicfptr" } ], -- cgit v1.2.3