# Copyright (C) 2010-2013, International Business Machines Corporation. All Rights Reserved.
+# CFLAGS contains only anything end users should set
+CFLAGS = @UCONFIG_CFLAGS@
+# CXXFLAGS contains only anything end users should set
+CXXFLAGS = @UCONFIG_CXXFLAGS@
+# DEFS only contains those UCONFIG_CPPFLAGS which are not auto-set by platform.h
+DEFS = @UCONFIG_CPPFLAGS@
prefix = @prefix@
exec_prefix = @exec_prefix@
#bindir = @bindir@
# include <unistd.h>
#endif"
-ac_subst_vars='LTLIBOBJS
+ac_subst_vars='UCONFIG_CXXFLAGS
+UCONFIG_CFLAGS
+UCONFIG_CPPFLAGS
+LTLIBOBJS
LIBOBJS
LIBCXXFLAGS
LIBCFLAGS
# with, for example, "#define U_DISABLE_RENAMING 1"
# Example: ICU configuration stuff
UCONFIG_CPPFLAGS=""
+# UCONFIG_CFLAGS: contains a copy of anything that needs to be set by end users
+# such as -std
+UCONFIG_CFLAGS=""
# Check whether to build debug libraries
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build debug libraries" >&5
if [ $cxx11_okay = yes ]; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Adding CXXFLAGS option --std=c++0x" >&5
$as_echo "$as_me: Adding CXXFLAGS option --std=c++0x" >&6;}
+ UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} --std=c++0x"
else
CXXFLAGS="$OLD_CXXFLAGS"
fi
CXXFLAGS="${CXXFLAGS} -mt"
if test x"`${CXX} ${CXXFLAGS} 2>&1`" != x""; then
CXXFLAGS="${OLD_CXXFLAGS}"
- fi
+ else
+ UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -mt"
+ fi
;;
esac
;;
CFLAGS="${OLD_CFLAGS}"
CXXFLAGS="${OLD_CXXFLAGS}"
else
+ UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -qutf"
CHECK_UTF16_STRING_RESULT="-qutf"
fi
fi
CXXFLAGS="${OLD_CXXFLAGS}"
else
CHECK_UTF16_STRING_RESULT="-xustr=ascii_utf16_ushort"
-
+ UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -xustr=ascii_utf16_ushort"
+ UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -xustr=ascii_utf16_ushort"
# Since we can't detect the availability of this UTF-16 syntax at compile time,
# we depend on configure telling us that we can use it.
# Since we can't ensure ICU users use -xustr=ascii_utf16_ushort,
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$CC_UTF16_STRING" = 1; then
+ UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -std=gnu99"
CHECK_UTF16_STRING_RESULT="C only";
else
CFLAGS="${OLD_CFLAGS}"
$as_echo "too old or test failed - try upgrading GNU Make" >&6; }
fi
+
if test -n "$UCONFIG_CPPFLAGS"; then
HDRFILE="uconfig.h.prepend"
echo "*** WARNING: You must set the following flags before code compiled against this ICU will function properly:"
echo '--------------- end ' "${HDRFILE}"
fi
+
+if test -n "$UCONFIG_CFLAGS"; then
+ echo "C apps may want to build with CFLAGS = ${UCONFIG_CFLAGS}"
+fi
+
+if test -n "$UCONFIG_CXXFLAGS"; then
+ echo "C++ apps may want to build with CXXFLAGS = ${UCONFIG_CXXFLAGS}"
+fi
+
if test "$tools" = false;
then
echo "## Note: you have disabled ICU's tools. This ICU cannot build its own data or tests."
# with, for example, "#define U_DISABLE_RENAMING 1"
# Example: ICU configuration stuff
UCONFIG_CPPFLAGS=""
+# UCONFIG_CFLAGS: contains a copy of anything that needs to be set by end users
+# such as -std
+UCONFIG_CFLAGS=""
# Check whether to build debug libraries
AC_MSG_CHECKING([whether to build debug libraries])
AC_MSG_RESULT($cxx11_okay)
if [[ $cxx11_okay = yes ]]; then
AC_MSG_NOTICE([Adding CXXFLAGS option --std=c++0x])
+ UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} --std=c++0x"
else
CXXFLAGS="$OLD_CXXFLAGS"
fi
CXXFLAGS="${CXXFLAGS} -mt"
if test x"`${CXX} ${CXXFLAGS} 2>&1`" != x""; then
CXXFLAGS="${OLD_CXXFLAGS}"
- fi
+ else
+ UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -mt"
+ fi
;;
esac
;;
CFLAGS="${OLD_CFLAGS}"
CXXFLAGS="${OLD_CXXFLAGS}"
else
+ UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -qutf"
CHECK_UTF16_STRING_RESULT="-qutf"
fi
fi
CXXFLAGS="${OLD_CXXFLAGS}"
else
CHECK_UTF16_STRING_RESULT="-xustr=ascii_utf16_ushort"
-
+ UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -xustr=ascii_utf16_ushort"
+ UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -xustr=ascii_utf16_ushort"
# Since we can't detect the availability of this UTF-16 syntax at compile time,
# we depend on configure telling us that we can use it.
# Since we can't ensure ICU users use -xustr=ascii_utf16_ushort,
static const char16_t test[] = u"This is a UTF16 literal string.";
]], [[]])],[CC_UTF16_STRING=1],[CC_UTF16_STRING=0])
if test "$CC_UTF16_STRING" = 1; then
+ UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -std=gnu99"
CHECK_UTF16_STRING_RESULT="C only";
else
CFLAGS="${OLD_CFLAGS}"
AC_MSG_RESULT([too old or test failed - try upgrading GNU Make])
fi
+AC_SUBST(UCONFIG_CPPFLAGS)
if test -n "$UCONFIG_CPPFLAGS"; then
HDRFILE="uconfig.h.prepend"
echo "*** WARNING: You must set the following flags before code compiled against this ICU will function properly:"
echo '--------------- end ' "${HDRFILE}"
fi
+AC_SUBST(UCONFIG_CFLAGS)
+if test -n "$UCONFIG_CFLAGS"; then
+ echo "C apps may want to build with CFLAGS = ${UCONFIG_CFLAGS}"
+fi
+AC_SUBST(UCONFIG_CXXFLAGS)
+if test -n "$UCONFIG_CXXFLAGS"; then
+ echo "C++ apps may want to build with CXXFLAGS = ${UCONFIG_CXXFLAGS}"
+fi
+
if test "$tools" = false;
then
echo "## Note: you have disabled ICU's tools. This ICU cannot build its own data or tests."