Changeset 114936a


Ignore:
Timestamp:
Apr 26, 2019, 4:05:12 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
3fcbdca1
Parents:
8f194ee
Message:

google perftools are now linked in by default if available

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • configure

    r8f194ee r114936a  
    637637LIBOBJS
    638638CFA_BACKEND_CC
     639WITH_LIBTCMALLOC_FALSE
     640WITH_LIBTCMALLOC_TRUE
     641WITH_LIBPROFILER_FALSE
     642WITH_LIBPROFILER_TRUE
    639643WITH_LIBFIBRE_FALSE
    640644WITH_LIBFIBRE_TRUE
     
    1665716661
    1665816662
     16663{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ProfilingIsEnabledForAllThreads in -lprofiler" >&5
     16664$as_echo_n "checking for ProfilingIsEnabledForAllThreads in -lprofiler... " >&6; }
     16665if ${ac_cv_lib_profiler_ProfilingIsEnabledForAllThreads+:} false; then :
     16666  $as_echo_n "(cached) " >&6
     16667else
     16668  ac_check_lib_save_LIBS=$LIBS
     16669LIBS="-lprofiler  $LIBS"
     16670cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     16671/* end confdefs.h.  */
     16672
     16673/* Override any GCC internal prototype to avoid an error.
     16674   Use char because int might match the return type of a GCC
     16675   builtin and then its argument prototype would still apply.  */
     16676#ifdef __cplusplus
     16677extern "C"
     16678#endif
     16679char ProfilingIsEnabledForAllThreads ();
     16680int
     16681main ()
     16682{
     16683return ProfilingIsEnabledForAllThreads ();
     16684  ;
     16685  return 0;
     16686}
     16687_ACEOF
     16688if ac_fn_c_try_link "$LINENO"; then :
     16689  ac_cv_lib_profiler_ProfilingIsEnabledForAllThreads=yes
     16690else
     16691  ac_cv_lib_profiler_ProfilingIsEnabledForAllThreads=no
     16692fi
     16693rm -f core conftest.err conftest.$ac_objext \
     16694    conftest$ac_exeext conftest.$ac_ext
     16695LIBS=$ac_check_lib_save_LIBS
     16696fi
     16697{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_profiler_ProfilingIsEnabledForAllThreads" >&5
     16698$as_echo "$ac_cv_lib_profiler_ProfilingIsEnabledForAllThreads" >&6; }
     16699if test "x$ac_cv_lib_profiler_ProfilingIsEnabledForAllThreads" = xyes; then :
     16700  HAVE_LIBPROFILER=1
     16701else
     16702  HAVE_LIBPROFILER=0
     16703fi
     16704
     16705 if test "$HAVE_LIBPROFILER" -eq 1; then
     16706  WITH_LIBPROFILER_TRUE=
     16707  WITH_LIBPROFILER_FALSE='#'
     16708else
     16709  WITH_LIBPROFILER_TRUE='#'
     16710  WITH_LIBPROFILER_FALSE=
     16711fi
     16712
     16713
     16714{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc in -ltcmalloc" >&5
     16715$as_echo_n "checking for malloc in -ltcmalloc... " >&6; }
     16716if ${ac_cv_lib_tcmalloc_malloc+:} false; then :
     16717  $as_echo_n "(cached) " >&6
     16718else
     16719  ac_check_lib_save_LIBS=$LIBS
     16720LIBS="-ltcmalloc  $LIBS"
     16721cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     16722/* end confdefs.h.  */
     16723
     16724/* Override any GCC internal prototype to avoid an error.
     16725   Use char because int might match the return type of a GCC
     16726   builtin and then its argument prototype would still apply.  */
     16727#ifdef __cplusplus
     16728extern "C"
     16729#endif
     16730char malloc ();
     16731int
     16732main ()
     16733{
     16734return malloc ();
     16735  ;
     16736  return 0;
     16737}
     16738_ACEOF
     16739if ac_fn_c_try_link "$LINENO"; then :
     16740  ac_cv_lib_tcmalloc_malloc=yes
     16741else
     16742  ac_cv_lib_tcmalloc_malloc=no
     16743fi
     16744rm -f core conftest.err conftest.$ac_objext \
     16745    conftest$ac_exeext conftest.$ac_ext
     16746LIBS=$ac_check_lib_save_LIBS
     16747fi
     16748{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tcmalloc_malloc" >&5
     16749$as_echo "$ac_cv_lib_tcmalloc_malloc" >&6; }
     16750if test "x$ac_cv_lib_tcmalloc_malloc" = xyes; then :
     16751  HAVE_LIBTCMALLOC=1
     16752else
     16753  HAVE_LIBTCMALLOC=0
     16754fi
     16755
     16756 if test "$HAVE_LIBTCMALLOC" -eq 1; then
     16757  WITH_LIBTCMALLOC_TRUE=
     16758  WITH_LIBTCMALLOC_FALSE='#'
     16759else
     16760  WITH_LIBTCMALLOC_TRUE='#'
     16761  WITH_LIBTCMALLOC_FALSE=
     16762fi
     16763
     16764
    1665916765# Checks for header files.
    1666016766for ac_header in libintl.h malloc.h unistd.h
     
    1688916995if test -z "${WITH_LIBFIBRE_TRUE}" && test -z "${WITH_LIBFIBRE_FALSE}"; then
    1689016996  as_fn_error $? "conditional \"WITH_LIBFIBRE\" was never defined.
     16997Usually this means the macro was only invoked conditionally." "$LINENO" 5
     16998fi
     16999if test -z "${WITH_LIBPROFILER_TRUE}" && test -z "${WITH_LIBPROFILER_FALSE}"; then
     17000  as_fn_error $? "conditional \"WITH_LIBPROFILER\" was never defined.
     17001Usually this means the macro was only invoked conditionally." "$LINENO" 5
     17002fi
     17003if test -z "${WITH_LIBTCMALLOC_TRUE}" && test -z "${WITH_LIBTCMALLOC_FALSE}"; then
     17004  as_fn_error $? "conditional \"WITH_LIBTCMALLOC\" was never defined.
    1689117005Usually this means the macro was only invoked conditionally." "$LINENO" 5
    1689217006fi
  • configure.ac

    r8f194ee r114936a  
    190190AM_CONDITIONAL([WITH_LIBFIBRE], [test "$HAVE_LIBFIBRE" -eq 1])
    191191
     192AC_CHECK_LIB([profiler], [ProfilingIsEnabledForAllThreads], [HAVE_LIBPROFILER=1], [HAVE_LIBPROFILER=0])
     193AM_CONDITIONAL([WITH_LIBPROFILER], [test "$HAVE_LIBPROFILER" -eq 1])
     194
     195AC_CHECK_LIB([tcmalloc], [malloc], [HAVE_LIBTCMALLOC=1], [HAVE_LIBTCMALLOC=0])
     196AM_CONDITIONAL([WITH_LIBTCMALLOC], [test "$HAVE_LIBTCMALLOC" -eq 1])
     197
    192198# Checks for header files.
    193199AC_CHECK_HEADERS([libintl.h malloc.h unistd.h], [], [echo "Error: Missing required header"; exit 1])
  • src/Makefile.am

    r8f194ee r114936a  
    5656___driver_cfa_cpp_LDADD = -ldl                  # yywrap
    5757
     58if WITH_LIBPROFILER
     59        ___driver_cfa_cpp_LDADD += -lprofiler
     60endif
     61
     62if WITH_LIBTCMALLOC
     63        ___driver_cfa_cpp_LDADD += -ltcmalloc
     64endif
     65
    5866AM_CXXFLAGS = @HOST_FLAGS@ -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I./Parser -I$(srcdir)/Parser -I$(srcdir)/include -DYY_NO_INPUT -O2 -g -std=c++14
    5967AM_LDFLAGS  = @HOST_FLAGS@ -Xlinker -export-dynamic
  • src/Makefile.in

    r8f194ee r114936a  
    15261526        @rm BasicTypes-gen
    15271527
     1528@WITH_LIBPROFILER_TRUE@ ___driver_cfa_cpp_LDADD += -lprofiler
     1529
     1530@WITH_LIBTCMALLOC_TRUE@ ___driver_cfa_cpp_LDADD += -ltcmalloc
     1531
    15281532# Tell versions [3.59,3.63) of GNU make to not export all variables.
    15291533# Otherwise a system limit (for SysV at least) may be exceeded.
Note: See TracChangeset for help on using the changeset viewer.