Skip to content

Commit 42f5884

Browse files
authored
configure: detect ICU via icu-uc/icu-i18n pkg-config modules to easily build on Debian (#597)
1 parent 56baaf9 commit 42f5884

5 files changed

Lines changed: 11 additions & 19 deletions

File tree

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ jobs:
6969
sudo apt-get -q -y update
7070
sudo apt-get -q -y upgrade
7171
sudo apt-get -y install build-essential automake autoconf libtool pkg-config icu-devtools libicu-dev libxml2-dev uuid-dev fuse libfuse-dev libsnmp-dev
72-
sudo cp .github/workflows/icu-config /usr/bin/icu-config
7372
./autogen.sh
7473
./configure
7574
make

.github/workflows/icu-config

Lines changed: 0 additions & 12 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,16 +290,14 @@ You need to add `--enable-lintape` as an argument of ./configure script if you w
290290
| Ubuntu 16.04 LTS | ppc64le | OK - Not checked automatically |
291291
| Ubuntu 18.04 LTS | x86\_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-ubuntu-bionic.yml/badge.svg) |
292292
| Ubuntu 18.04 LTS | ppc64le | OK - Not checked automatically |
293-
| Ubuntu 20.04 LTS (Need icu-config) | x86\_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-ubuntu-focal.yml/badge.svg) |
293+
| Ubuntu 20.04 LTS | x86\_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-ubuntu-focal.yml/badge.svg) |
294294
| Debian 9 | x86\_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-debian9.yml/badge.svg) |
295-
| Debian 10 (Need icu-config) | x86\_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-debian10.yml/badge.svg) |
295+
| Debian 10 | x86\_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-debian10.yml/badge.svg) |
296296
| ArchLinux 2018.08.01 | x86\_64 | OK - Not checked automatically |
297297
| ArchLinux 2018.12.31 (rolling) | x86\_64 | OK - Not checked automatically |
298298

299299
Currently, automatic build checking is working on GitHub Actions and Travis CI.
300300

301-
For Ubuntu20.04 and Debian10, dummy `icu-config` is needed in the build machine. See Issue [#153](https://github.com/LinearTapeFileSystem/ltfs/issues/153).
302-
303301
### Build and install on OSX (macOS)
304302

305303
#### Recent Homedrew system setup

build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
sudo apt-get -q -y update
77
sudo apt-get -q -y upgrade
88
sudo apt-get -y install build-essential automake autoconf libtool pkg-config libicu66 icu-devtools libicu-dev libxml2-dev uuid-dev fuse libfuse-dev libsnmp-dev
9-
sudo cp .github/workflows/icu-config /usr/bin/icu-config
109
./autogen.sh
1110
./configure
1211
make

configure.ac

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,16 @@ fi
339339

340340
dnl
341341
dnl Check for ICU
342+
dnl Prefer icu-config for legacy distros; fall back to pkg-config icu-uc/icu-i18n
343+
dnl (icu-config was removed in ICU 63+ and is absent on modern Debian/Ubuntu).
342344
dnl
343345
ICU_MODULE_CFLAGS="`icu-config --cppflags 2> /dev/null`";
344346
ICU_MODULE_LIBS="`icu-config --ldflags 2> /dev/null`";
345347
if test -z "$ICU_MODULE_LIBS"
346348
then
347-
PKG_CHECK_MODULES([ICU_MODULE], [icu >= 0.21])
349+
PKG_CHECK_MODULES([ICU_MODULE], [icu-uc >= 0.21 icu-i18n >= 0.21],
350+
[],
351+
[PKG_CHECK_MODULES([ICU_MODULE], [icu >= 0.21])])
348352
fi
349353

350354
AC_MSG_CHECKING([use latest ICU])
@@ -359,6 +363,10 @@ if test "x${icu_6x}" = "xyes"
359363
then
360364
AC_MSG_CHECKING(for ICU version)
361365
ICU_MODULE_VERSION="`icu-config --version 2> /dev/null`";
366+
if test -z "$ICU_MODULE_VERSION"
367+
then
368+
ICU_MODULE_VERSION="`$PKG_CONFIG --modversion icu-uc 2> /dev/null`";
369+
fi
362370
if test "${ICU_MODULE_VERSION%%.*}" -ge "60"
363371
then
364372
AM_EXTRA_CPPFLAGS="${AM_EXTRA_CPPFLAGS} -D ICU6x"

0 commit comments

Comments
 (0)