From 52934d74be7d882f3f584a348ce29bedff7fa7a7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 16 Jul 2018 14:10:42 +0200 Subject: configure: modernize iconv use use library objects for all variants, and inline the tests. Change-Id: I029f9a6655a783dab4a22abf601aadbb484c03af Reviewed-by: Joerg Bornemann --- config.tests/gnu-libiconv/gnu-libiconv.cpp | 54 ------------------------------ config.tests/gnu-libiconv/gnu-libiconv.pro | 1 - config.tests/iconv/iconv.cpp | 54 ------------------------------ config.tests/iconv/iconv.pro | 2 -- config.tests/sun-libiconv/sun-libiconv.pro | 1 - src/corelib/codecs/codecs.pri | 3 +- src/corelib/configure.json | 54 +++++++++++++++++++++++------- 7 files changed, 42 insertions(+), 127 deletions(-) delete mode 100644 config.tests/gnu-libiconv/gnu-libiconv.cpp delete mode 100644 config.tests/gnu-libiconv/gnu-libiconv.pro delete mode 100644 config.tests/iconv/iconv.cpp delete mode 100644 config.tests/iconv/iconv.pro delete mode 100644 config.tests/sun-libiconv/sun-libiconv.pro diff --git a/config.tests/gnu-libiconv/gnu-libiconv.cpp b/config.tests/gnu-libiconv/gnu-libiconv.cpp deleted file mode 100644 index fe4b87b923..0000000000 --- a/config.tests/gnu-libiconv/gnu-libiconv.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -int main(int, char **) -{ - iconv_t x = iconv_open("", ""); - - const char *inp; - char *outp; - size_t inbytes, outbytes; - iconv(x, &inp, &inbytes, &outp, &outbytes); - - iconv_close(x); - - return 0; -} diff --git a/config.tests/gnu-libiconv/gnu-libiconv.pro b/config.tests/gnu-libiconv/gnu-libiconv.pro deleted file mode 100644 index e4e020cffb..0000000000 --- a/config.tests/gnu-libiconv/gnu-libiconv.pro +++ /dev/null @@ -1 +0,0 @@ -SOURCES = gnu-libiconv.cpp diff --git a/config.tests/iconv/iconv.cpp b/config.tests/iconv/iconv.cpp deleted file mode 100644 index be4236436f..0000000000 --- a/config.tests/iconv/iconv.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -int main(int, char **) -{ - iconv_t x = iconv_open("", ""); - - char *inp; - char *outp; - size_t inbytes, outbytes; - iconv(x, &inp, &inbytes, &outp, &outbytes); - - iconv_close(x); - - return 0; -} diff --git a/config.tests/iconv/iconv.pro b/config.tests/iconv/iconv.pro deleted file mode 100644 index 70af0d2eb2..0000000000 --- a/config.tests/iconv/iconv.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = iconv.cpp -mac|mingw|openbsd|qnx|haiku:LIBS += -liconv diff --git a/config.tests/sun-libiconv/sun-libiconv.pro b/config.tests/sun-libiconv/sun-libiconv.pro deleted file mode 100644 index d0881b732a..0000000000 --- a/config.tests/sun-libiconv/sun-libiconv.pro +++ /dev/null @@ -1 +0,0 @@ -SOURCES = ../gnu-libiconv/gnu-libiconv.cpp diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri index f1bbde1d69..5d500ce521 100644 --- a/src/corelib/codecs/codecs.pri +++ b/src/corelib/codecs/codecs.pri @@ -56,8 +56,7 @@ qtConfig(textcodec) { qtConfig(iconv) { HEADERS += codecs/qiconvcodec_p.h SOURCES += codecs/qiconvcodec.cpp - qtConfig(gnu-libiconv): \ - QMAKE_USE_PRIVATE += iconv + QMAKE_USE_PRIVATE += iconv } win32 { diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 3b33e6158b..a22a7459bd 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -47,14 +47,52 @@ { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" } ] }, + "posix_iconv": { + "label": "POSIX iconv", + "export": "iconv", + "test": { + "main": [ + "iconv_t x = iconv_open(\"\", \"\");", + "char *inp, *outp;", + "size_t inbytes, outbytes;", + "iconv(x, &inp, &inbytes, &outp, &outbytes);", + "iconv_close(x);" + ] + }, + "headers": "iconv.h", + "sources": [ + { "libs": "-liconv", "condition": "config.openbsd || config.haiku" }, + { "libs": "", "condition": "!(config.openbsd || config.haiku)" } + ] + }, "gnu_iconv": { "label": "GNU libiconv", "export": "iconv", - "test": "gnu-libiconv", + "test": { + "main": [ + "iconv_t x = iconv_open(\"\", \"\");", + "const char *inp;", + "char *outp;", + "size_t inbytes, outbytes;", + "iconv(x, &inp, &inbytes, &outp, &outbytes);", + "iconv_close(x);" + ] + }, + "headers": "iconv.h", "sources": [ "-liconv" ] }, + "sun_iconv": { + "label": "SUN libiconv", + "export": "iconv", + "test": { + "inherit": "gnu_iconv" + }, + "sources": [ + "" + ] + }, "icu": { "label": "ICU", "test": { @@ -336,16 +374,6 @@ ] } }, - "posix-iconv": { - "label": "POSIX iconv", - "type": "compile", - "test": "iconv" - }, - "sun-iconv": { - "label": "SUN libiconv", - "type": "compile", - "test": "sun-libiconv" - }, "inotify": { "label": "inotify", "type": "compile", @@ -576,14 +604,14 @@ "label": "POSIX iconv", "enable": "input.iconv == 'posix'", "disable": "input.iconv == 'sun' || input.iconv == 'gnu' || input.iconv == 'no'", - "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && tests.posix-iconv", + "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && libs.posix_iconv", "output": [ "privateFeature" ] }, "sun-libiconv": { "label": "SUN iconv", "enable": "input.iconv == 'sun'", "disable": "input.iconv == 'posix' || input.iconv == 'gnu' || input.iconv == 'no'", - "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && tests.sun-iconv" + "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && libs.sun_iconv" }, "gnu-libiconv": { "label": "GNU iconv", -- cgit v1.2.3