llvm.org GIT mirror llvm / b2bc6e4
Add some fixes to the configure script for isInf and add --enable-libcpp to projects/sample. Patch by Dmitri Shubin with additional fixes by me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153425 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 7 years ago
9 changed file(s) with 54 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
1818
1919 AC_SINGLE_CXX_CHECK([ac_cv_func_std_isinf_in_cmath],
2020 [std::isinf], [],
21 [float f; std::isinf(f)}])
21 [float f; std::isinf(f);])
2222 if test "$ac_cv_func_std_isinf_in_cmath" = "yes" ; then
2323 AC_DEFINE([HAVE_STD_ISINF_IN_CMATH],1,[Set to 1 if the std::isinf function is found in ])
2424 fi
55 AC_CACHE_CHECK([for HUGE_VAL sanity], [ac_cv_huge_val_sanity],[
66 AC_LANG_PUSH([C++])
77 ac_save_CXXFLAGS=$CXXFLAGS
8 CXXFLAGS=-pedantic
8 CXXFLAGS+=" -pedantic"
99 AC_RUN_IFELSE(
1010 AC_LANG_PROGRAM(
1111 [#include ],
1636016360 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
1636116361
1636216362 ac_save_CXXFLAGS=$CXXFLAGS
16363 CXXFLAGS=-pedantic
16363 CXXFLAGS+=" -pedantic"
1636416364 if test "$cross_compiling" = yes; then
1636516365 ac_cv_huge_val_sanity=yes
1636616366 else
1998619986 int
1998719987 main ()
1998819988 {
19989 float f; std::isinf(f)}
19989 float f; std::isinf(f);
1999019990 ;
1999119991 return 0;
1999219992 }
181181 # These are options that can either be enabled here, or can be enabled on the
182182 # make command line (ie, make ENABLE_PROFILING=1):
183183
184 # When ENABLE_LIBCPP is enabled, LLVM uses libc++ by default to build.
185 #ENABLE_LIBCPP = 0
186 ENABLE_LIBCPP = @ENABLE_LIBCPP@
187
184188 # When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
185189 # into the "Release" directories. Otherwise, LLVM code is not optimized and
186190 # output is put in the "Debug" directories.
242242 LD.Flags += -g
243243 KEEP_SYMBOLS := 1
244244 endif
245 endif
246
247 ifeq ($(ENABLE_LIBCPP),1)
248 CXX.Flags += -stdlib=libc++
249 LD.Flags += -stdlib=libc++
245250 endif
246251
247252 ifeq ($(ENABLE_PROFILING),1)
359359 dnl===
360360 dnl===-----------------------------------------------------------------------===
361361
362 dnl --enable-libcpp : check whether or not to use libc++ on the command line
363 AC_ARG_ENABLE(libcpp,
364 AS_HELP_STRING([--enable-libcpp],
365 [Use libc++ if available (default is NO)]),,
366 enableval=default)
367 case "$enableval" in
368 yes) AC_SUBST(ENABLE_LIBCPP,[1]) ;;
369 no) AC_SUBST(ENABLE_LIBCPP,[0]) ;;
370 default) AC_SUBST(ENABLE_LIBCPP,[0]);;
371 *) AC_MSG_ERROR([Invalid setting for --enable-libcpp. Use "yes" or "no"]) ;;
372 esac
373
362374 dnl --enable-optimized : check whether they want to do an optimized build:
363375 AC_ARG_ENABLE(optimized, AS_HELP_STRING(
364376 --enable-optimized,[Compile with optimizations enabled (default is NO)]),,enableval=$optimize)
1818
1919 AC_SINGLE_CXX_CHECK([ac_cv_func_std_isinf_in_cmath],
2020 [std::isinf], [],
21 [float f; std::isinf(f)}])
21 [float f; std::isinf(f);])
2222 if test "$ac_cv_func_std_isinf_in_cmath" = "yes" ; then
2323 AC_DEFINE([HAVE_STD_ISINF_IN_CMATH],1,[Set to 1 if the std::isinf function is found in ])
2424 fi
55 AC_CACHE_CHECK([for HUGE_VAL sanity], [ac_cv_huge_val_sanity],[
66 AC_LANG_PUSH([C++])
77 ac_save_CXXFLAGS=$CXXFLAGS
8 CXXFLAGS=-pedantic
8 CXXFLAGS+=" -pedantic"
99 AC_RUN_IFELSE(
1010 AC_LANG_PROGRAM(
1111 [#include ],
681681 BUILD_EXEEXT
682682 BUILD_CXX
683683 CVSBUILD
684 ENABLE_LIBCPP
684685 ENABLE_OPTIMIZED
685686 ENABLE_PROFILING
686687 DISABLE_ASSERTIONS
13721373 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
13731374 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
13741375 --enable-polly Use polly if available (default is YES)
1376 --enable-libcpp Use libc++ if available (default is NO)
13751377 --enable-optimized Compile with optimizations enabled (default is NO)
13761378 --enable-profiling Compile with profiling enabled (default is NO)
13771379 --enable-assertions Compile with assertion checks enabled (default is
49124914 fi
49134915
49144916
4917 # Check whether --enable-libcpp was given.
4918 if test "${enable_libcpp+set}" = set; then
4919 enableval=$enable_libcpp;
4920 else
4921 enableval=default
4922 fi
4923
4924 case "$enableval" in
4925 yes) ENABLE_LIBCPP=1
4926 ;;
4927 no) ENABLE_LIBCPP=0
4928 ;;
4929 default) ENABLE_LIBCPP=0
4930 ;;
4931 *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-libcpp. Use \"yes\" or \"no\"" >&5
4932 echo "$as_me: error: Invalid setting for --enable-libcpp. Use \"yes\" or \"no\"" >&2;}
4933 { (exit 1); exit 1; }; } ;;
4934 esac
4935
49154936 # Check whether --enable-optimized was given.
49164937 if test "${enable_optimized+set}" = set; then
49174938 enableval=$enable_optimized;
1026810289 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1026910290 lt_status=$lt_dlunknown
1027010291 cat > conftest.$ac_ext <
10271 #line 10272 "configure"
10292 #line 10293 "configure"
1027210293 #include "confdefs.h"
1027310294
1027410295 #if HAVE_DLFCN_H
1592915950 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
1593015951
1593115952 ac_save_CXXFLAGS=$CXXFLAGS
15932 CXXFLAGS=-pedantic
15953 CXXFLAGS+=" -pedantic"
1593315954 if test "$cross_compiling" = yes; then
1593415955 ac_cv_huge_val_sanity=yes
1593515956 else
1955419575 int
1955519576 main ()
1955619577 {
19557 float f; std::isinf(f)}
19578 float f; std::isinf(f);
1955819579 ;
1955919580 return 0;
1956019581 }
2160021621 BUILD_EXEEXT!$BUILD_EXEEXT$ac_delim
2160121622 BUILD_CXX!$BUILD_CXX$ac_delim
2160221623 CVSBUILD!$CVSBUILD$ac_delim
21624 ENABLE_LIBCPP!$ENABLE_LIBCPP$ac_delim
2160321625 ENABLE_OPTIMIZED!$ENABLE_OPTIMIZED$ac_delim
2160421626 ENABLE_PROFILING!$ENABLE_PROFILING$ac_delim
2160521627 DISABLE_ASSERTIONS!$DISABLE_ASSERTIONS$ac_delim
2161421636 ENABLE_THREADS!$ENABLE_THREADS$ac_delim
2161521637 ENABLE_PTHREADS!$ENABLE_PTHREADS$ac_delim
2161621638 ENABLE_PIC!$ENABLE_PIC$ac_delim
21617 ENABLE_SHARED!$ENABLE_SHARED$ac_delim
2161821639 _ACEOF
2161921640
2162021641 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
2165621677 ac_delim='%!_!# '
2165721678 for ac_last_try in false false false false false :; do
2165821679 cat >conf$$subs.sed <<_ACEOF
21680 ENABLE_SHARED!$ENABLE_SHARED$ac_delim
2165921681 ENABLE_EMBED_STDCXX!$ENABLE_EMBED_STDCXX$ac_delim
2166021682 ENABLE_TIMESTAMPS!$ENABLE_TIMESTAMPS$ac_delim
2166121683 TARGETS_TO_BUILD!$TARGETS_TO_BUILD$ac_delim
2174621768 LTLIBOBJS!$LTLIBOBJS$ac_delim
2174721769 _ACEOF
2174821770
21749 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 88; then
21771 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then
2175021772 break
2175121773 elif $ac_last_try; then
2175221774 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5