Skip to content

Commit e21982c

Browse files
hughmcmastersrl295
authored andcommitted
ICU-10464 Make installation of icu-config optional (unicode-org#13)
Signed-off-by: Hugh McMaster <[email protected]> Originally ICU-20030
1 parent 38463f7 commit e21982c

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

icu4c/source/Makefile.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ ALL_PKGCONFIG_SUFFIX=uc i18n
4848
DOXYGEN = @DOXYGEN@
4949
DOCZIP = icu-docs.zip
5050

51+
INSTALL_ICU_CONFIG = @INSTALL_ICU_CONFIG@
52+
5153
## Files to remove for 'make clean'
5254
CLEANFILES = *~
5355

@@ -64,7 +66,9 @@ SUBDIRS = stubdata common i18n $(LAYOUTEX) $(ICUIO) $(TOOLS) $(DATASUBDIR) $(EX
6466

6567
SECTION = 1
6668

69+
ifeq ($(INSTALL_ICU_CONFIG),true)
6770
MANX_FILES = config/icu-config.$(SECTION)
71+
endif
6872

6973
ALL_MAN_FILES = $(MANX_FILES)
7074

@@ -187,7 +191,9 @@ install-icu: $(INSTALLED_BUILT_FILES)
187191
@$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig
188192
$(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/
189193
$(INSTALL_DATA) $(top_srcdir)/../LICENSE $(DESTDIR)$(pkgdatadir)/LICENSE
194+
ifeq ($(INSTALL_ICU_CONFIG),true)
190195
$(INSTALL_SCRIPT) $(top_builddir)/config/icu-config $(DESTDIR)$(bindir)/icu-config
196+
endif
191197
$(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile.inc
192198
$(INSTALL_DATA) $(top_builddir)/config/pkgdata.inc $(DESTDIR)$(pkglibdir)/pkgdata.inc
193199
# @echo icuinfo.xml is built after make check.
@@ -350,7 +356,9 @@ config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
350356

351357
install-manx: $(MANX_FILES)
352358
$(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
359+
ifneq ($(MANX_FILES),)
353360
$(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
361+
endif
354362

355363
config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
356364
cd $(top_builddir) \

icu4c/source/configure

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ CFLAGS
716716
CC
717717
ENABLE_RELEASE
718718
ENABLE_DEBUG
719+
INSTALL_ICU_CONFIG
719720
CPPFLAGS
720721
host_os
721722
host_vendor
@@ -775,6 +776,7 @@ SHELL'
775776
ac_subst_files=''
776777
ac_user_opts='
777778
enable_option_checking
779+
enable_icu_config
778780
enable_debug
779781
enable_release
780782
with_cross_build
@@ -1443,6 +1445,7 @@ Optional Features:
14431445
--disable-option-checking ignore unrecognized --enable/--with options
14441446
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
14451447
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1448+
--enable-icu-config install icu-config
14461449
--enable-debug build debug libraries and enable the U_DEBUG define default=no
14471450
--enable-release build release libraries default=yes
14481451
--enable-strict compile with strict compiler options default=yes
@@ -2797,6 +2800,21 @@ UCONFIG_CPPFLAGS=""
27972800
# such as -std
27982801
UCONFIG_CFLAGS=""
27992802

2803+
# Check whether to install icu-config
2804+
# Check whether --enable-icu-config was given.
2805+
if test "${enable_icu_config+set}" = set; then :
2806+
enableval=$enable_icu_config; case "${enableval}" in
2807+
yes) enable_icu_config=true ;;
2808+
no) enable_icu_config=false ;;
2809+
*) as_fn_error $? "bad value '${enableval}' for --enable-icu-config" "$LINENO" 5 ;;
2810+
esac
2811+
else
2812+
enable_icu_config=true
2813+
fi
2814+
2815+
INSTALL_ICU_CONFIG=$enable_icu_config
2816+
2817+
28002818
# Check whether to build debug libraries
28012819
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build debug libraries" >&5
28022820
$as_echo_n "checking whether to build debug libraries... " >&6; }

icu4c/source/configure.ac

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ UCONFIG_CPPFLAGS=""
100100
# such as -std
101101
UCONFIG_CFLAGS=""
102102

103+
# Check whether to install icu-config
104+
AC_ARG_ENABLE([icu-config],
105+
AS_HELP_STRING([--enable-icu-config], [install icu-config]),
106+
[case "${enableval}" in
107+
yes) enable_icu_config=true ;;
108+
no) enable_icu_config=false ;;
109+
*) AC_MSG_ERROR([bad value '${enableval}' for --enable-icu-config]) ;;
110+
esac], [enable_icu_config=true])
111+
AC_SUBST(INSTALL_ICU_CONFIG, [$enable_icu_config])
112+
103113
# Check whether to build debug libraries
104114
AC_MSG_CHECKING([whether to build debug libraries])
105115
enabled=no

0 commit comments

Comments
 (0)