Skip to content

Commit

Permalink
configure: modernize iconv use
Browse files Browse the repository at this point in the history
use library objects for all variants, and inline the tests.

Change-Id: I029f9a6655a783dab4a22abf601aadbb484c03af
Reviewed-by: Joerg Bornemann <[email protected]>
  • Loading branch information
ossilator committed Dec 19, 2018
1 parent 98689cd commit 52934d7
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 127 deletions.
54 changes: 0 additions & 54 deletions config.tests/gnu-libiconv/gnu-libiconv.cpp

This file was deleted.

1 change: 0 additions & 1 deletion config.tests/gnu-libiconv/gnu-libiconv.pro

This file was deleted.

54 changes: 0 additions & 54 deletions config.tests/iconv/iconv.cpp

This file was deleted.

2 changes: 0 additions & 2 deletions config.tests/iconv/iconv.pro

This file was deleted.

1 change: 0 additions & 1 deletion config.tests/sun-libiconv/sun-libiconv.pro

This file was deleted.

3 changes: 1 addition & 2 deletions src/corelib/codecs/codecs.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
54 changes: 41 additions & 13 deletions src/corelib/configure.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 52934d7

Please sign in to comment.