Changeset 8 for trunk/configure.ac

Show
Ignore:
Timestamp:
11/19/08 13:22:31 (17 years ago)
Author:
yumileroy
Message:

[svn] * Auto detect if ACE is already installed and use it.

Original author: derex_tri
Date: 2008-10-04 10:45:45-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r7 r8  
    230230AC_CHECK_FUNCS([atexit ftime gethostbyaddr gethostbyname gethostname gettimeofday memmove memset pow realpath select socket sqrt strchr strdup strerror strstr]) 
    231231 
     232## Check what to do with ACE library 
     233AC_LANG_PUSH([C++]) 
     234AC_CHECK_HEADER([ace/Reactor.h], [tri_have_ace_headers=yes], [tri_have_ace_headers=no]) 
     235AC_CHECK_LIB([ACE], [main], [tri_have_ace_lib=yes], [tri_have_ace_lib=no]) 
     236AC_LANG_POP([C++]) 
     237 
     238AC_MSG_CHECKING([whether to build ACE]) 
     239if test X$tri_have_ace_headers = Xyes -a X$tri_have_ace_lib = Xyes; 
     240then 
     241  tri_need_to_build_ace=no 
     242  ACE_LIBS="-lACE" 
     243  ACE_INCLUDES="" 
     244  AC_MSG_RESULT([no]) 
     245else 
     246  if test X$tri_have_ace_headers = Xno -a X$tri_have_ace_lib = Xno; then 
     247    tri_need_to_build_ace=yes 
     248    AC_MSG_RESULT([yes]) 
     249  else 
     250    if test X$tri_have_ace_headers = Xyes; then 
     251       AC_MSG_ERROR([looks like you have ACE headers, but you do not have ACE libs installed]) 
     252    else 
     253       tri_need_to_build_ace=yes 
     254       AC_MSG_RESULT([yes, over-install]) 
     255    fi 
     256  fi 
     257fi 
     258 
     259if test X$tri_need_to_build_ace = Xyes; then 
     260   CXXFLAGS="-I\$(top_srcdir)/dep/ACE_wrappers -I\$(top_builddir)/dep/ACE_wrappers $CXXFLAGS" 
     261   ACE_LIBS="\$(top_builddir)/dep/ACE_wrappers/ace/libACE.la" 
     262else 
     263   ACE_LIBS="-lACE" 
     264fi 
     265 
     266AM_CONDITIONAL([TRI_BUILD_ACE], [test X$tri_need_to_build_ace = Xyes]) 
     267 
    232268## Export defined variables 
    233269AC_SUBST(ZLIB) 
     
    242278AC_SUBST(MANGOSD_ENABLE_CLI) 
    243279AC_SUBST(MANGOSD_ENABLE_RA) 
     280AC_SUBST(ACE_LIBS) 
    244281 
    245282## Set output files. 
     
    270307 
    271308## Configure ACE 
    272 AC_CONFIG_SUBDIRS([dep/ACE_wrappers]) 
     309if test X$tri_need_to_build_ace = Xyes; then 
     310  AC_CONFIG_SUBDIRS([dep/ACE_wrappers]) 
     311fi 
    273312 
    274313## Disabled Makefiles, until they are ready for a successful make and