You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2014/09/23 22:07:00 UTC

git commit: TS-2095: replace TS_FLAG_HEADERS

Repository: trafficserver
Updated Branches:
  refs/heads/master 13a1844e6 -> 338392cec


TS-2095: replace TS_FLAG_HEADERS

TS_FLAG_HEADERS does not give any value over AC_FLAG_HEADERS, so
just remove it. Also alleviate the preprocessor warnings from the
unordered_map check.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/338392ce
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/338392ce
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/338392ce

Branch: refs/heads/master
Commit: 338392cece3434f29f4403bf43f2fc4c9f0fb7a6
Parents: 13a1844
Author: James Peach <jp...@apache.org>
Authored: Fri Sep 19 13:33:29 2014 -0700
Committer: James Peach <jp...@apache.org>
Committed: Tue Sep 23 13:07:03 2014 -0700

----------------------------------------------------------------------
 CHANGES           |  3 +++
 build/common.m4   | 16 ----------------
 build/jemalloc.m4 |  2 +-
 build/lzma.m4     |  2 +-
 build/pcre.m4     |  4 ++--
 build/xml.m4      |  2 +-
 build/zlib.m4     |  2 +-
 configure.ac      | 39 +++++++++++++++++++++------------------
 8 files changed, 30 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/338392ce/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index eb7faa9..0565e09 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.2.0
+
+  *) [TS-2095] Replace TS_FLAG_HEADERS wich AC_CHECK_HEADERS.
+
   *) [TS-2314] New config to allow unsatifiable Range: request to go straight to Origin
 
   *) [TS-3006] Add SSL extensions and examples.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/338392ce/build/common.m4
----------------------------------------------------------------------
diff --git a/build/common.m4 b/build/common.m4
index 5390288..83796c9 100644
--- a/build/common.m4
+++ b/build/common.m4
@@ -513,22 +513,6 @@ done
 
 ])dnl
 
-dnl TS_FLAG_HEADERS(header-file, [action-if-found], [action-if-not-found], [includes])
-dnl
-AC_DEFUN([TS_FLAG_HEADERS], [
-AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
-for tsc_i in $1
-do
-    ac_safe=`echo "$tsc_i" | sed 'y%./+-%__p_%'`
-    tsc_2=`echo "$tsc_i" | sed -e 's%/%_%g' -e 's/\.//g' -e 's/-//g'`
-    if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-       eval "$tsc_2=1"
-    else
-       eval "$tsc_2=0"
-    fi
-done
-])
-
 dnl
 dnl Support macro for AC_ARG_ENABLE
 dnl Arguments:

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/338392ce/build/jemalloc.m4
----------------------------------------------------------------------
diff --git a/build/jemalloc.m4 b/build/jemalloc.m4
index 55479b5..525d281 100644
--- a/build/jemalloc.m4
+++ b/build/jemalloc.m4
@@ -64,7 +64,7 @@ if test "$enable_jemalloc" != "no"; then
     [AC_SEARCH_LIBS([malloc_stats_print], [jemalloc], [jemalloc_have_libs=1])]
   )
   if test "$jemalloc_have_libs" != "0"; then
-    TS_FLAG_HEADERS(jemalloc/jemalloc.h, [jemalloc_have_headers=1])
+    AC_CHECK_HEADERS(jemalloc/jemalloc.h, [jemalloc_have_headers=1])
   fi
   if test "$jemalloc_have_headers" != "0"; then
     jemalloch=1

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/338392ce/build/lzma.m4
----------------------------------------------------------------------
diff --git a/build/lzma.m4 b/build/lzma.m4
index 0be7779..f63d09c 100644
--- a/build/lzma.m4
+++ b/build/lzma.m4
@@ -86,7 +86,7 @@ if test "$enable_lzma" != "no"; then
   fi
   AC_SEARCH_LIBS([lzma_code], [lzma], [lzma_have_libs=1])
   if test "$lzma_have_libs" != "0"; then
-    TS_FLAG_HEADERS(lzma.h, [lzma_have_headers=1])
+    AC_CHECK_HEADERS(lzma.h, [lzma_have_headers=1])
   fi
   if test "$lzma_have_headers" != "0"; then
     AC_SUBST(LIBLZMA, [-llzma])

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/338392ce/build/pcre.m4
----------------------------------------------------------------------
diff --git a/build/pcre.m4 b/build/pcre.m4
index ba7ae3a..e0eff08 100644
--- a/build/pcre.m4
+++ b/build/pcre.m4
@@ -97,8 +97,8 @@ if test "$enable_pcre" != "no"; then
   fi
   AC_SEARCH_LIBS([pcre_exec], [pcre], [pcre_have_libs=1])
   if test "$pcre_have_libs" != "0"; then
-    TS_FLAG_HEADERS(pcre.h, [pcre_have_headers=1])
-    TS_FLAG_HEADERS(pcre/pcre.h, [pcre_have_headers=1])
+    AC_CHECK_HEADERS(pcre.h, [pcre_have_headers=1])
+    AC_CHECK_HEADERS(pcre/pcre.h, [pcre_have_headers=1])
   fi
   if test "$pcre_have_headers" != "0"; then
     AC_DEFINE(HAVE_LIBPCRE,1,[Compiling with pcre support])

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/338392ce/build/xml.m4
----------------------------------------------------------------------
diff --git a/build/xml.m4 b/build/xml.m4
index b639054..831a15c 100644
--- a/build/xml.m4
+++ b/build/xml.m4
@@ -183,7 +183,7 @@ if test "$enable_expat" != "no"; then
   fi
   AC_SEARCH_LIBS([XML_SetUserData], [expat], [expat_have_libs=1])
   if test "$expat_have_libs" != "0"; then
-      TS_FLAG_HEADERS(expat.h, [expat_have_headers=1])
+      AC_CHECK_HEADERS(expat.h, [expat_have_headers=1])
   fi
   if test "$expat_have_headers" != "0"; then
     enable_xml=yes

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/338392ce/build/zlib.m4
----------------------------------------------------------------------
diff --git a/build/zlib.m4 b/build/zlib.m4
index b71a74a..eac1bf5 100644
--- a/build/zlib.m4
+++ b/build/zlib.m4
@@ -86,7 +86,7 @@ if test "$enable_zlib" != "no"; then
   fi
   AC_SEARCH_LIBS([compressBound], [z], [zlib_have_libs=1])
   if test "$zlib_have_libs" != "0"; then
-    TS_FLAG_HEADERS(zlib.h, [zlib_have_headers=1])
+    AC_CHECK_HEADERS(zlib.h, [zlib_have_headers=1])
   fi
   if test "$zlib_have_headers" != "0"; then
     AC_SUBST(LIBZ, [-lz])

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/338392ce/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index c3c7e0e..e3b18ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -585,7 +585,12 @@ if test "x${enable_cxx_11_support}" = "xyes" ; then
 fi
 
 # While we are in C++ mode, check for the GNU hash_map extension.
-TS_FLAG_HEADERS([unordered_map unordered_set])
+AC_CHECK_HEADERS([unordered_map unordered_set], [], [],
+[[#ifdef HAVE_UNORDERED_MAP
+#include <unordered_map>
+#endif
+]])
+
 AC_MSG_CHECKING([for <ext/hash_map>])
 AC_COMPILE_IFELSE([
   AC_LANG_PROGRAM([
@@ -604,7 +609,6 @@ if test "x${have_gnu_cxx_hash_map}" = "xyes" ; then
 fi
 
 # And check for std::shared_ptr vs std::tr1::shared_ptr
-TS_FLAG_HEADERS([unordered_map unordered_set])
 AC_MSG_CHECKING([for std::shared_ptr])
 AC_COMPILE_IFELSE([
   AC_LANG_PROGRAM([
@@ -1177,7 +1181,7 @@ AC_CHECK_FUNCS([clock_gettime kqueue epoll_ctl posix_memalign posix_fadvise posi
 AC_CHECK_FUNCS([lrand48_r srand48_r port_create strlcpy strlcat sysconf getpagesize])
 
 # Check for eventfd() and sys/eventfd.h (both must exist ...)
-TS_FLAG_HEADERS([sys/eventfd.h], [
+AC_CHECK_HEADERS([sys/eventfd.h], [
   AS_IF([test "x$enable_eventfd" = "xyes"], [
     AC_CHECK_FUNCS([eventfd])
   ]
@@ -1188,7 +1192,7 @@ AC_CHECK_FUNCS(eventfd)
 #
 # Check for mcheck_pedantic(3)
 #
-TS_FLAG_HEADERS(mcheck.h)
+AC_CHECK_HEADERS(mcheck.h)
 AC_CHECK_FUNCS(mcheck_pedantic)
 
 #
@@ -1201,7 +1205,7 @@ fi
 
 has_backtrace=0
 # Check for backtrace() support
-TS_FLAG_HEADERS([execinfo.h], [has_backtrace=1],[])
+AC_CHECK_HEADERS([execinfo.h], [has_backtrace=1],[])
 if test "${has_backtrace}" = "1"; then
   # FreeBSD requires '/usr/ports/devel/libexecinfo' for gdb style backtrace() support
   AC_SEARCH_LIBS([backtrace], [execinfo], [have_backtrace_lib=yes])
@@ -1382,7 +1386,7 @@ AC_SUBST(use_hwloc)
 enable_maxmind_geoip=no
 TS_SEARCH_LIBRARY([GeoIP_id_by_code], [GeoIP], [
   GEOIP_LIBS=$ts_cv_search_GeoIP_id_by_code
-  TS_FLAG_HEADERS([GeoIP.h], [ enable_maxmind_geoip=yes ])
+  AC_CHECK_HEADERS([GeoIP.h], [ enable_maxmind_geoip=yes ])
 ])
 
 AC_SUBST(GEOIP_LIBS)
@@ -1422,7 +1426,7 @@ fi
 # -----------------------------------------------------------------------------
 # 5. CHECK FOR HEADER FILES
 
-TS_FLAG_HEADERS([sys/types.h \
+AC_CHECK_HEADERS([sys/types.h \
                   sys/uio.h \
                   sys/mman.h \
                   sys/epoll.h \
@@ -1509,28 +1513,28 @@ AC_SUBST(net_ppp_defsh)
 AC_SUBST(ifaddrsh)
 AC_SUBST(readline_readlineh)
 
-TS_FLAG_HEADERS([sys/statfs.h sys/statvfs.h sys/disk.h sys/disklabel.h])
-TS_FLAG_HEADERS([linux/hdreg.h linux/fs.h linux/major.h])
+AC_CHECK_HEADERS([sys/statfs.h sys/statvfs.h sys/disk.h sys/disklabel.h])
+AC_CHECK_HEADERS([linux/hdreg.h linux/fs.h linux/major.h])
 
-TS_FLAG_HEADERS([sys/sysctl.h], [], [],
+AC_CHECK_HEADERS([sys/sysctl.h], [], [],
                  [[#ifdef HAVE_SYS_PARAM_H
                     #include <sys/param.h>
                    #endif
                  ]])
 
-TS_FLAG_HEADERS([sys/cpuset.h], [], [],
+AC_CHECK_HEADERS([sys/cpuset.h], [], [],
                  [[#ifdef HAVE_SYS_PARAM_H
                     #include <sys/param.h>
                    #endif
                  ]])
 
-TS_FLAG_HEADERS([sys/mount.h], [], [],
+AC_CHECK_HEADERS([sys/mount.h], [], [],
                  [[#ifdef HAVE_SYS_PARAM_H
                     #include <sys/param.h>
                    #endif
                  ]])
 
-TS_FLAG_HEADERS([arpa/inet.h], [], [],
+AC_CHECK_HEADERS([arpa/inet.h], [], [],
                  [[#ifdef HAVE_SYS_TYPES_H
                     #include <sys/types.h>
                    #endif
@@ -1539,7 +1543,7 @@ TS_FLAG_HEADERS([arpa/inet.h], [], [],
                    #endif
                  ]])
 
-TS_FLAG_HEADERS([netinet/ip.h], [], [],
+AC_CHECK_HEADERS([netinet/ip.h], [], [],
                  [[#ifdef HAVE_SYS_TYPES_H
                     #include <sys/types.h>
                    #endif
@@ -1551,7 +1555,7 @@ TS_FLAG_HEADERS([netinet/ip.h], [], [],
                    #endif
                  ]])
 
-TS_FLAG_HEADERS([netinet/ip_icmp.h], [], [],
+AC_CHECK_HEADERS([netinet/ip_icmp.h], [], [],
                  [[#ifdef HAVE_SYS_TYPES_H
                     #include <sys/types.h>
                    #endif
@@ -1653,7 +1657,7 @@ if test "x${ac_cv_member_struct_sockaddr_in6_sin6_len}" = xyes; then
 fi
 
 if test "x${with_profiler}" = "xyes"; then
-TS_FLAG_HEADERS([google/profiler.h \
+AC_CHECK_HEADERS([google/profiler.h \
                   ], [], [])
 fi
 
@@ -1914,8 +1918,7 @@ AC_CONFIG_FILES([
   tools/tsxs
 ])
 
-
-TS_FLAG_HEADERS([mysql/mysql.h], [has_mysql=1],[has_mysql=0])
+AC_CHECK_HEADERS([mysql/mysql.h], [has_mysql=1],[has_mysql=0])
 AC_CHECK_LIB([mysqlclient],[mysql_info],[AC_SUBST([LIB_MYSQLCLIENT],["-lmysqlclient"])],[has_mysql=0])
 AC_SUBST(has_mysql)
 AM_CONDITIONAL([HAS_MYSQL], [ test "x${has_mysql}" = "x1" ])