Alien-Judy

 view release on metacpan or  search on metacpan

src/judy-1.0.5/configure.ac  view on Meta::CPAN

VERSION_INFO="-version-info 1:3:0"
AC_SUBST(VERSION_INFO)

dnl==========================================================================
dnl Flavors
dnl==========================================================================
dnl Judy can be compiled in one of three flavors: "product" (the default),
dnl "debug", or "cov".  We allow the user to select flavors using
dnl --enable-debug and --enable-ccover arguments to automake, which is
dnl the typical way of doing things.
dnl 
dnl Note how we perform string comparison:
dnl
dnl   if test "x$enable_debug" = xyes; then
dnl
dnl We do several odd things here:
dnl
dnl   1) We use 'test' instead of '[ ]' for shell portability.
dnl   2) We prefix strings with 'x' when comparing them, to protect against
dnl      empty strings.
dnl   3) We ALWAYS quote user-supplied shell variables, to protect against
dnl      embedded spaces.
dnl
dnl The results of this test aren't used anywhere yet.

dnl Keep the user entertained.
AC_MSG_CHECKING(which flavor to build)

dnl Process our --enable-debug argument.
AC_ARG_ENABLE(debug,
              AC_HELP_STRING([--enable-debug],
                             [enable debugging features]),
              , enable_debug=no)
if test "x$enable_debug" != xyes -a "x$enable_debug" != xno; then
   AC_MSG_ERROR(You may not pass an argument to --enable-debug)
fi

dnl Process our --enable-ccover argument.
AC_ARG_ENABLE(ccover,
              AC_HELP_STRING([--enable-ccover],
                             [enable use of ccover code coverage tools]),
              , enable_ccover=no)
if test "x$enable_ccover" != xyes -a "x$enable_ccover" != xno; then
   AC_MSG_ERROR(You may not pass an argument to --enable-ccover)
fi

dnl Determine our flavor.
if test "x$enable_debug" = xyes -a "x$enable_ccover" = xyes; then
   AC_MSG_ERROR(You may not use --enable-debug and --enable-ccover together)
elif test "x$enable_debug" = xyes; then
   FLAVOR=debug
elif test "x$enable_ccover" = xyes; then
   FLAVOR=cov
else
   FLAVOR=product
fi

dnl Define FLAVOR in our makefiles.
AC_SUBST(FLAVOR)

dnl Tell the user what flavor we've decided to build.
AC_MSG_RESULT($FLAVOR)


dnl==========================================================================
dnl Checks for Programs
dnl==========================================================================
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET

dnl==========================================================================
dnl Checks for Header Files
dnl==========================================================================
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h])

dnl==========================================================================
dnl Checks for Typedefs, Structures, and Compiler Characteristics
dnl==========================================================================

dnl Standard, boring stuff.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_C_VOLATILE
AC_CHECK_TYPES([ptrdiff_t])

dnl If we're compiling for a little-endian system, define JU_LITTLE_ENDIAN.
dnl If we can't tell what kind of system we're compling for, alert the
dnl user as described in 'info autoconf'.
AC_C_BIGENDIAN(, AC_DEFINE(JU_LITTLE_ENDIAN, 1,
			   [Define to 1 on little-endian systems.]))

dnl  Figure out if we are 32-bit or 64-bit (LP64)
AC_CHECK_SIZEOF(void *)
if test "$ac_cv_sizeof_void_p" = 8; then 
    AC_MSG_RESULT(Detected 64-bit Build Environment)
    CFLAGS="-DJU_64BIT $CFLAGS"
else 
    AC_MSG_RESULT(Detected 32-bit Build Environment)
      CFLAGS="-UJU_64BIT $CFLAGS"
fi

AC_ARG_ENABLE(32-bit, [  --enable-32-bit          Generate code for a 32-bit environment],
	      b32="$enableval", b32="no")
if test x"$b32" != "xno"; then
    AC_MSG_RESULT(Configured to Build 32-bit)
    if test x"$GCC" = xyes; then
      CFLAGS="-UJU_64BIT -m32 $CFLAGS"
    else
      CFLAGS="-UJU_64BIT $CFLAGS"
    fi
fi

AC_ARG_ENABLE(64-bit, [  --enable-64-bit          Generate code for a 64-bit environment],



( run in 0.603 second using v1.01-cache-2.11-cpan-c966e8aa7e8 )