Commit 4fa56c1b authored by Håvard Moås's avatar Håvard Moås

Add (u_)intxx data type defines to configure script to prepare for using...

Add (u_)intxx data type defines to configure script to prepare for using config.h in ipfixflib. havard.mork@gmail.com

git-svn-id: file:///home/svn/mapi/trunk@706 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 340fa5e1
...@@ -21,7 +21,145 @@ AC_PROG_LIBTOOL ...@@ -21,7 +21,145 @@ AC_PROG_LIBTOOL
# Checks for C headers # Checks for C headers
AC_MSG_NOTICE([header files ------------------------------------------------]) AC_MSG_NOTICE([header files ------------------------------------------------])
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/socket.h sys/time.h syslog.h unistd.h]) AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/socket.h sys/time.h syslog.h unistd.h zlib.h sys/ethernet.h net/ethernet.h])
# Checks for data types
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short int, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long int, 4)
AC_CHECK_SIZEOF(long long int, 8)
AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
[ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
[ ac_cv_have_intxx_t="yes" ],
[ ac_cv_have_intxx_t="no" ]
)
])
if test "x$ac_cv_have_intxx_t" = "xyes" ; then
AC_DEFINE(HAVE_INT8_T, 1, [Data type])
AC_DEFINE(HAVE_INT16_T, 1, [Data type])
AC_DEFINE(HAVE_INT32_T, 1, [Data type])
have_intxx_t=1
fi
if (test -z "$have_intxx_t" && test "x$ac_cv_header_stdint_h" = "xyes")
then
AC_MSG_CHECKING([for intXX_t types in stdint.h])
AC_TRY_COMPILE(
[ #include <stdint.h> ],
[ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
[
AC_DEFINE(HAVE_INT8_T, 1, [Data type])
AC_DEFINE(HAVE_INT16_T, 1, [Data type])
AC_DEFINE(HAVE_INT32_T, 1, [Data type])
AC_MSG_RESULT(yes)
],
[ AC_MSG_RESULT(no) ]
)
fi
AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
[ int64_t a; a = 1;],
[ ac_cv_have_int64_t="yes" ],
[ ac_cv_have_int64_t="no" ]
)
])
if test "x$ac_cv_have_int64_t" = "xyes" ; then
AC_DEFINE(HAVE_INT64_T, 1, [Data type])
have_int64_t=1
fi
if test -z "$have_int64_t" ; then
AC_MSG_CHECKING([for int64_t type in sys/socket.h])
AC_TRY_COMPILE(
[ #include <sys/socket.h> ],
[ int64_t a; a = 1],
[
AC_DEFINE(HAVE_INT64_T, 1, [Data type])
AC_MSG_RESULT(yes)
],
[ AC_MSG_RESULT(no) ]
)
fi
AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
[ ac_cv_have_u_intxx_t="yes" ],
[ ac_cv_have_u_intxx_t="no" ]
)
])
if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
AC_DEFINE(HAVE_U_INT8_T, 1, [Data type])
AC_DEFINE(HAVE_U_INT16_T, 1, [Data type])
AC_DEFINE(HAVE_U_INT32_T, 1, [Data type])
have_u_intxx_t=1
fi
if test -z "$have_u_intxx_t" ; then
AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
AC_TRY_COMPILE(
[ #include <sys/socket.h> ],
[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
[
AC_DEFINE(HAVE_U_INT8_T, 1, [Data type])
AC_DEFINE(HAVE_U_INT16_T, 1, [Data type])
AC_DEFINE(HAVE_U_INT32_T, 1, [Data type])
AC_MSG_RESULT(yes)
],
[ AC_MSG_RESULT(no) ]
)
fi
AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
[ u_int64_t a; a = 1;],
[ ac_cv_have_u_int64_t="yes" ],
[ ac_cv_have_u_int64_t="no" ]
)
])
if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
AC_DEFINE(HAVE_U_INT64_T, 1, [Data type])
have_u_int64_t=1
fi
if test -z "$have_u_intxx_t" ; then
AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
[ ac_cv_have_uintxx_t="yes" ],
[ ac_cv_have_uintxx_t="no" ]
)
])
if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
AC_DEFINE(HAVE_UINT8_T, 1, [Data type])
AC_DEFINE(HAVE_UINT16_T, 1, [Data type])
AC_DEFINE(HAVE_UINT32_T, 1, [Data type])
fi
fi
if test -z "$have_uintxx_t" ; then
AC_MSG_CHECKING([for uintXX_t types in stdint.h])
AC_TRY_COMPILE(
[ #include <stdint.h> ],
[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
[
AC_DEFINE(HAVE_UINT8_T, 1, [Data type])
AC_DEFINE(HAVE_UINT16_T, 1, [Data type])
AC_DEFINE(HAVE_UINT32_T, 1, [Data type])
AC_MSG_RESULT(yes)
],
[ AC_MSG_RESULT(no) ]
)
fi
# $prefix stores the value of the --prefix command line option, or NONE if # $prefix stores the value of the --prefix command line option, or NONE if
# the option wasn't set. In the latter case, set it to the default, so that # the option wasn't set. In the latter case, set it to the default, so that
...@@ -91,6 +229,7 @@ esac], [trackflib=false]) ...@@ -91,6 +229,7 @@ esac], [trackflib=false])
AM_CONDITIONAL(BINARY_TRACKFLIB, test x$trackflib = xtrue) AM_CONDITIONAL(BINARY_TRACKFLIB, test x$trackflib = xtrue)
if test x$trackflib = xtrue; then if test x$trackflib = xtrue; then
MAPI_FUNC_LIBS="${MAPI_FUNC_LIBS}:trackflib.so" MAPI_FUNC_LIBS="${MAPI_FUNC_LIBS}:trackflib.so"
AC_DEFINE(TRACKFLIB_COMPILED, 1, [trackflib is enabled in the build])
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
else else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment