Skip to content

Commit 520ea60

Browse files
authored
Merge pull request #561 from gnustep/icu_config_fix
icu pkg-config flag issues
2 parents e0582f7 + 66a1c4a commit 520ea60

File tree

2 files changed

+139
-36
lines changed

2 files changed

+139
-36
lines changed

configure

Lines changed: 129 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,10 @@ HAVE_NEWKVO
661661
HAVE_LIBDISPATCH_RUNLOOP
662662
HAVE_LIBDISPATCH
663663
HAVE_ICU
664-
ICU_LIBS
665-
ICU_CFLAGS
664+
ICU_UC_LIBS
665+
ICU_UC_CFLAGS
666+
ICU_I18N_LIBS
667+
ICU_I18N_CFLAGS
666668
HAVE_AVAHI
667669
HAVE_MDNS
668670
HAVE_GNUTLS
@@ -880,8 +882,10 @@ XML_CFLAGS
880882
XML_LIBS
881883
XSLT_CFLAGS
882884
XSLT_LIBS
883-
ICU_CFLAGS
884-
ICU_LIBS
885+
ICU_I18N_CFLAGS
886+
ICU_I18N_LIBS
887+
ICU_UC_CFLAGS
888+
ICU_UC_LIBS
885889
DOT'
886890

887891

@@ -1647,8 +1651,13 @@ Some influential environment variables:
16471651
XML_LIBS linker flags for XML, overriding pkg-config
16481652
XSLT_CFLAGS C compiler flags for XSLT, overriding pkg-config
16491653
XSLT_LIBS linker flags for XSLT, overriding pkg-config
1650-
ICU_CFLAGS C compiler flags for ICU, overriding pkg-config
1651-
ICU_LIBS linker flags for ICU, overriding pkg-config
1654+
ICU_I18N_CFLAGS
1655+
C compiler flags for ICU_I18N, overriding pkg-config
1656+
ICU_I18N_LIBS
1657+
linker flags for ICU_I18N, overriding pkg-config
1658+
ICU_UC_CFLAGS
1659+
C compiler flags for ICU_UC, overriding pkg-config
1660+
ICU_UC_LIBS linker flags for ICU_UC, overriding pkg-config
16521661
DOT The name or full path of the graphviz dot command.
16531662

16541663
Use these variables to override the choices made by 'configure' or to help
@@ -5902,18 +5911,18 @@ then :
59025911
fi
59035912
if test "$enable_largefile,$enable_year2038" != no,no
59045913
then :
5905-
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CPPFLAGS option for large files" >&5
5906-
printf %s "checking for $CPPFLAGS option for large files... " >&6; }
5914+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5
5915+
printf %s "checking for $CC option to enable large file support... " >&6; }
59075916
if test ${ac_cv_sys_largefile_opts+y}
59085917
then :
59095918
printf %s "(cached) " >&6
59105919
else case e in #(
5911-
e) ac_save_CPPFLAGS=$CPPFLAGS
5920+
e) ac_save_CC="$CC"
59125921
ac_opt_found=no
5913-
for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1"; do
5922+
for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do
59145923
if test x"$ac_opt" != x"none needed"
59155924
then :
5916-
CPPFLAGS="$ac_save_CPPFLAGS $ac_opt"
5925+
CC="$ac_save_CC $ac_opt"
59175926
fi
59185927
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59195928
/* end confdefs.h. */
@@ -5942,12 +5951,12 @@ then :
59425951
if test x"$ac_opt" = x"none needed"
59435952
then :
59445953
# GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t.
5945-
CPPFLAGS="$CPPFLAGS -DFTYPE=ino_t"
5954+
CC="$CC -DFTYPE=ino_t"
59465955
if ac_fn_c_try_compile "$LINENO"
59475956
then :
59485957

59495958
else case e in #(
5950-
e) CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64"
5959+
e) CC="$CC -D_FILE_OFFSET_BITS=64"
59515960
if ac_fn_c_try_compile "$LINENO"
59525961
then :
59535962
ac_opt='-D_FILE_OFFSET_BITS=64'
@@ -5963,7 +5972,7 @@ fi
59635972
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
59645973
test $ac_opt_found = no || break
59655974
done
5966-
CPPFLAGS=$ac_save_CPPFLAGS
5975+
CC="$ac_save_CC"
59675976

59685977
test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;;
59695978
esac
@@ -5987,14 +5996,16 @@ printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h
59875996

59885997
printf "%s\n" "#define _LARGE_FILES 1" >>confdefs.h
59895998
;; #(
5999+
"-n32") :
6000+
CC="$CC -n32" ;; #(
59906001
*) :
59916002
as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;;
59926003
esac
59936004

59946005
if test "$enable_year2038" != no
59956006
then :
5996-
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CPPFLAGS option for timestamps after 2038" >&5
5997-
printf %s "checking for $CPPFLAGS option for timestamps after 2038... " >&6; }
6007+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038" >&5
6008+
printf %s "checking for $CC option for timestamps after 2038... " >&6; }
59986009
if test ${ac_cv_sys_year2038_opts+y}
59996010
then :
60006011
printf %s "(cached) " >&6
@@ -14921,36 +14932,36 @@ printf "%s\n" "$as_me: Using system-provided ICU DLL (requires Windows 10 versio
1492114932
if test $HAVE_ICU = 0; then
1492214933

1492314934
pkg_failed=no
14924-
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ICU" >&5
14925-
printf %s "checking for ICU... " >&6; }
14935+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ICU_I18N" >&5
14936+
printf %s "checking for ICU_I18N... " >&6; }
1492614937

14927-
if test -n "$ICU_CFLAGS"; then
14928-
pkg_cv_ICU_CFLAGS="$ICU_CFLAGS"
14938+
if test -n "$ICU_I18N_CFLAGS"; then
14939+
pkg_cv_ICU_I18N_CFLAGS="$ICU_I18N_CFLAGS"
1492914940
elif test -n "$PKG_CONFIG"; then
1493014941
if test -n "$PKG_CONFIG" && \
1493114942
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-i18n > 49.0\""; } >&5
1493214943
($PKG_CONFIG --exists --print-errors "icu-i18n > 49.0") 2>&5
1493314944
ac_status=$?
1493414945
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1493514946
test $ac_status = 0; }; then
14936-
pkg_cv_ICU_CFLAGS=`$PKG_CONFIG --cflags "icu-i18n > 49.0" 2>/dev/null`
14947+
pkg_cv_ICU_I18N_CFLAGS=`$PKG_CONFIG --cflags "icu-i18n > 49.0" 2>/dev/null`
1493714948
test "x$?" != "x0" && pkg_failed=yes
1493814949
else
1493914950
pkg_failed=yes
1494014951
fi
1494114952
else
1494214953
pkg_failed=untried
1494314954
fi
14944-
if test -n "$ICU_LIBS"; then
14945-
pkg_cv_ICU_LIBS="$ICU_LIBS"
14955+
if test -n "$ICU_I18N_LIBS"; then
14956+
pkg_cv_ICU_I18N_LIBS="$ICU_I18N_LIBS"
1494614957
elif test -n "$PKG_CONFIG"; then
1494714958
if test -n "$PKG_CONFIG" && \
1494814959
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-i18n > 49.0\""; } >&5
1494914960
($PKG_CONFIG --exists --print-errors "icu-i18n > 49.0") 2>&5
1495014961
ac_status=$?
1495114962
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1495214963
test $ac_status = 0; }; then
14953-
pkg_cv_ICU_LIBS=`$PKG_CONFIG --libs "icu-i18n > 49.0" 2>/dev/null`
14964+
pkg_cv_ICU_I18N_LIBS=`$PKG_CONFIG --libs "icu-i18n > 49.0" 2>/dev/null`
1495414965
test "x$?" != "x0" && pkg_failed=yes
1495514966
else
1495614967
pkg_failed=yes
@@ -14971,25 +14982,25 @@ else
1497114982
_pkg_short_errors_supported=no
1497214983
fi
1497314984
if test $_pkg_short_errors_supported = yes; then
14974-
ICU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "icu-i18n > 49.0" 2>&1`
14985+
ICU_I18N_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "icu-i18n > 49.0" 2>&1`
1497514986
else
14976-
ICU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "icu-i18n > 49.0" 2>&1`
14987+
ICU_I18N_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "icu-i18n > 49.0" 2>&1`
1497714988
fi
1497814989
# Put the nasty error message in config.log where it belongs
14979-
echo "$ICU_PKG_ERRORS" >&5
14990+
echo "$ICU_I18N_PKG_ERRORS" >&5
1498014991

14981-
HAVE_ICU=0
14992+
HAVE_ICU_I81N=0
1498214993
elif test $pkg_failed = untried; then
1498314994
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
1498414995
printf "%s\n" "no" >&6; }
14985-
HAVE_ICU=0
14996+
HAVE_ICU_I81N=0
1498614997
else
14987-
ICU_CFLAGS=$pkg_cv_ICU_CFLAGS
14988-
ICU_LIBS=$pkg_cv_ICU_LIBS
14998+
ICU_I18N_CFLAGS=$pkg_cv_ICU_I18N_CFLAGS
14999+
ICU_I18N_LIBS=$pkg_cv_ICU_I18N_LIBS
1498915000
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1499015001
printf "%s\n" "yes" >&6; }
1499115002

14992-
for ac_header in unicode/uloc.h unicode/ulocdata.h unicode/ucol.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h unicode/unorm2.h unicode/unum.h unicode/udat.h unicode/udatpg.h unicode/ustring.h unicode/usearch.h unicode/ucnv.h unicode/utext.h unicode/ubrk.h unicode/utypes.h
15003+
for ac_header in unicode/uloc.h unicode/ulocdata.h unicode/ucol.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h unicode/unorm2.h unicode/unum.h unicode/udat.h unicode/udatpg.h unicode/ustring.h unicode/usearch.h unicode/ucnv.h unicode/ubrk.h unicode/utypes.h
1499315004
do :
1499415005
as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | sed "$as_sed_sh"`
1499515006
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -14998,11 +15009,96 @@ then :
1499815009
cat >>confdefs.h <<_ACEOF
1499915010
#define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1
1500015011
_ACEOF
15001-
HAVE_ICU=1
15012+
HAVE_ICU_I18N=1
1500215013
fi
1500315014

1500415015
done
1500515016
fi
15017+
15018+
pkg_failed=no
15019+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ICU_UC" >&5
15020+
printf %s "checking for ICU_UC... " >&6; }
15021+
15022+
if test -n "$ICU_UC_CFLAGS"; then
15023+
pkg_cv_ICU_UC_CFLAGS="$ICU_UC_CFLAGS"
15024+
elif test -n "$PKG_CONFIG"; then
15025+
if test -n "$PKG_CONFIG" && \
15026+
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc > 49.0\""; } >&5
15027+
($PKG_CONFIG --exists --print-errors "icu-uc > 49.0") 2>&5
15028+
ac_status=$?
15029+
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15030+
test $ac_status = 0; }; then
15031+
pkg_cv_ICU_UC_CFLAGS=`$PKG_CONFIG --cflags "icu-uc > 49.0" 2>/dev/null`
15032+
test "x$?" != "x0" && pkg_failed=yes
15033+
else
15034+
pkg_failed=yes
15035+
fi
15036+
else
15037+
pkg_failed=untried
15038+
fi
15039+
if test -n "$ICU_UC_LIBS"; then
15040+
pkg_cv_ICU_UC_LIBS="$ICU_UC_LIBS"
15041+
elif test -n "$PKG_CONFIG"; then
15042+
if test -n "$PKG_CONFIG" && \
15043+
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc > 49.0\""; } >&5
15044+
($PKG_CONFIG --exists --print-errors "icu-uc > 49.0") 2>&5
15045+
ac_status=$?
15046+
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15047+
test $ac_status = 0; }; then
15048+
pkg_cv_ICU_UC_LIBS=`$PKG_CONFIG --libs "icu-uc > 49.0" 2>/dev/null`
15049+
test "x$?" != "x0" && pkg_failed=yes
15050+
else
15051+
pkg_failed=yes
15052+
fi
15053+
else
15054+
pkg_failed=untried
15055+
fi
15056+
15057+
15058+
15059+
if test $pkg_failed = yes; then
15060+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
15061+
printf "%s\n" "no" >&6; }
15062+
15063+
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
15064+
_pkg_short_errors_supported=yes
15065+
else
15066+
_pkg_short_errors_supported=no
15067+
fi
15068+
if test $_pkg_short_errors_supported = yes; then
15069+
ICU_UC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "icu-uc > 49.0" 2>&1`
15070+
else
15071+
ICU_UC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "icu-uc > 49.0" 2>&1`
15072+
fi
15073+
# Put the nasty error message in config.log where it belongs
15074+
echo "$ICU_UC_PKG_ERRORS" >&5
15075+
15076+
HAVE_ICU_UC=0
15077+
elif test $pkg_failed = untried; then
15078+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
15079+
printf "%s\n" "no" >&6; }
15080+
HAVE_ICU_UC=0
15081+
else
15082+
ICU_UC_CFLAGS=$pkg_cv_ICU_UC_CFLAGS
15083+
ICU_UC_LIBS=$pkg_cv_ICU_UC_LIBS
15084+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15085+
printf "%s\n" "yes" >&6; }
15086+
15087+
for ac_header in unicode/utext.h
15088+
do :
15089+
ac_fn_c_check_header_compile "$LINENO" "unicode/utext.h" "ac_cv_header_unicode_utext_h" "$ac_includes_default"
15090+
if test "x$ac_cv_header_unicode_utext_h" = xyes
15091+
then :
15092+
printf "%s\n" "#define HAVE_UNICODE_UTEXT_H 1" >>confdefs.h
15093+
HAVE_ICU_UC=1
15094+
fi
15095+
15096+
done
15097+
fi
15098+
if test $HAVE_ICU_I18N = 1; then
15099+
ICU_LIBS="$ICU_I18N_LIBS $ICU_UC_LIBS"
15100+
HAVE_ICU=1
15101+
fi
1500615102
fi
1500715103
if test $HAVE_ICU = 0; then
1500815104
as_fn_error $? "No useable ICU installation found" "$LINENO" 5

configure.ac

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3617,9 +3617,16 @@ AS_IF([test "x$enable_icu" = "xyes"], [
36173617
;;
36183618
esac
36193619
if test $HAVE_ICU = 0; then
3620-
PKG_CHECK_MODULES([ICU], [icu-i18n > 49.0], [
3621-
AC_CHECK_HEADERS([unicode/uloc.h unicode/ulocdata.h unicode/ucol.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h unicode/unorm2.h unicode/unum.h unicode/udat.h unicode/udatpg.h unicode/ustring.h unicode/usearch.h unicode/ucnv.h unicode/utext.h unicode/ubrk.h unicode/utypes.h],
3622-
HAVE_ICU=1)], [HAVE_ICU=0])
3620+
PKG_CHECK_MODULES([ICU_I18N], [icu-i18n > 49.0], [
3621+
AC_CHECK_HEADERS([unicode/uloc.h unicode/ulocdata.h unicode/ucol.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h unicode/unorm2.h unicode/unum.h unicode/udat.h unicode/udatpg.h unicode/ustring.h unicode/usearch.h unicode/ucnv.h unicode/ubrk.h unicode/utypes.h],
3622+
HAVE_ICU_I18N=1)], [HAVE_ICU_I81N=0])
3623+
PKG_CHECK_MODULES([ICU_UC], [icu-uc > 49.0], [
3624+
AC_CHECK_HEADERS([unicode/utext.h],
3625+
HAVE_ICU_UC=1)], [HAVE_ICU_UC=0])
3626+
if test $HAVE_ICU_I18N = 1; then
3627+
ICU_LIBS="$ICU_I18N_LIBS $ICU_UC_LIBS"
3628+
HAVE_ICU=1
3629+
fi
36233630
fi
36243631
if test $HAVE_ICU = 0; then
36253632
AC_MSG_ERROR([No useable ICU installation found])

0 commit comments

Comments
 (0)