From cfa973f0624b23a56c2f7acf0fead2630ea2015a Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Fri, 30 Aug 2013 21:20:02 +0000 Subject: [PATCH] ICU-10123 add check for elf.h before using (note, had to add U_HAVE_ELF_H) X-SVN-Rev: 34154 --- icu4c/source/configure | 16 ++++++++++++++++ icu4c/source/configure.in | 5 +++++ icu4c/source/tools/genccode/genccode.c | 4 ++-- icu4c/source/tools/toolutil/pkg_genc.c | 2 +- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/icu4c/source/configure b/icu4c/source/configure index 867be728808..df318e9094e 100755 --- a/icu4c/source/configure +++ b/icu4c/source/configure @@ -5420,6 +5420,22 @@ fi $as_echo "$enabled" >&6; } +# check if elf.h is present. +for ac_header in elf.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "elf.h" "ac_cv_header_elf_h" "$ac_includes_default" +if test "x$ac_cv_header_elf_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ELF_H 1 +_ACEOF + +fi + +done + +if test "x$ac_cv_header_elf_h" = "xyes"; then + CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_HAVE_ELF_H=1"; +fi U_ENABLE_DYLOAD=1 enable=yes diff --git a/icu4c/source/configure.in b/icu4c/source/configure.in index 457451396bd..c458ba19697 100644 --- a/icu4c/source/configure.in +++ b/icu4c/source/configure.in @@ -398,6 +398,11 @@ AC_ARG_ENABLE(tracing, AC_MSG_RESULT($enabled) AC_SUBST(U_ENABLE_TRACING) +# check if elf.h is present. +AC_CHECK_HEADERS([elf.h]) +if test "x$ac_cv_header_elf_h" = "xyes"; then + CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_HAVE_ELF_H=1"; +fi U_ENABLE_DYLOAD=1 enable=yes diff --git a/icu4c/source/tools/genccode/genccode.c b/icu4c/source/tools/genccode/genccode.c index d489fd5d9c3..3950ef57747 100644 --- a/icu4c/source/tools/genccode/genccode.c +++ b/icu4c/source/tools/genccode/genccode.c @@ -1,6 +1,6 @@ /* ******************************************************************************* - * Copyright (C) 1999-2011, International Business Machines + * Copyright (C) 1999-2013, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: gennames.c @@ -30,7 +30,7 @@ #include #endif -#if U_PLATFORM_IS_LINUX_BASED +#if U_PLATFORM_IS_LINUX_BASED && U_HAVE_ELF_H # define U_ELF #endif diff --git a/icu4c/source/tools/toolutil/pkg_genc.c b/icu4c/source/tools/toolutil/pkg_genc.c index af5026bc06e..595cb20458e 100644 --- a/icu4c/source/tools/toolutil/pkg_genc.c +++ b/icu4c/source/tools/toolutil/pkg_genc.c @@ -19,7 +19,7 @@ # endif #endif -#if U_PLATFORM_IS_LINUX_BASED +#if U_PLATFORM_IS_LINUX_BASED && U_HAVE_ELF_H # define U_ELF #endif -- 2.40.0