File:  [ELWIX - Embedded LightWeight unIX -] / libaitsched / configure.in
Revision 1.59: download - view: text, annotated - select for diffs - revision graph
Mon Aug 19 13:14:46 2024 UTC (10 months, 1 week ago) by misho
Branches: MAIN
CVS tags: sched8_4, SCHED8_3, HEAD
take clear CFLAGS from env
append Debian arch detection

    1: #
    2: # $Author: misho $
    3: # $Id: configure.in,v 1.59 2024/08/19 13:14:46 misho Exp $
    4: #
    5: AC_INIT(libaitsched, 8.2, misho@elwix.org)
    6: AC_CONFIG_SRCDIR([src/aitsched.c])
    7: AC_CONFIG_HEADERS([inc/config.h])
    8: 
    9: ac_cv_func_malloc_0_nonnull="yes"
   10: ac_cv_func_realloc_0_nonnull="yes"
   11: 
   12: # Checks for programs.
   13: AC_PROG_CC
   14: AC_PROG_INSTALL
   15: AC_PROG_RANLIB
   16: 
   17: AC_CANONICAL_HOST
   18: AC_CANONICAL_TARGET
   19: 
   20: AC_CHECK_TOOL(MKDEP, mkdep, ../mkdep)
   21: AC_SUBST(MKDEP)
   22: 
   23: if test "${ac_cv_env_CFLAGS_set}" != "set"; then
   24: 	CFLAGS="-Wall -O2 -fPIC"
   25: else
   26: 	CFLAGS="${ac_cv_env_CFLAGS_value}"
   27: fi
   28: LDFLAGS="${LDFLAGS}"
   29: 
   30: 
   31: # Checks for libraries.
   32: AC_CHECK_LIB([pthread], [pthread_create])
   33: AC_CHECK_LIB([rt], [aio_read])
   34: AC_CHECK_LIB([bsd], [strlcpy])
   35: 
   36: # Checks for header files.
   37: AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/time.h unistd.h])
   38: AC_CHECK_HEADERS([bsd/string.h])
   39: 
   40: # Checks for typedefs, structures, and compiler characteristics.
   41: AC_C_INLINE
   42: AC_TYPE_SIZE_T
   43: 
   44: # Checks for library functions.
   45: AC_FUNC_MALLOC
   46: AC_CHECK_FUNCS([clock_gettime memset strerror timer_create timer_settime timer_delete strlcat strlcpy])
   47: 
   48: DEBUG=no
   49: AC_MSG_CHECKING(Debug Build)
   50: AC_ARG_ENABLE(debug,
   51: 	[  --enable-debug          Build library with debug information and additional messages],
   52: 	[ DEBUG=$enableval
   53: 		case "$enableval" in
   54: 			yes)
   55: 				AC_DEFINE(__DEBUG,, [Build libraries with debug information and additional messages])
   56: 				CFLAGS="-g ${CFLAGS}"
   57: 				;;
   58: 			*)
   59: 				AC_DEFINE(NDEBUG,, [Turn off debug asserts])
   60: 				;;
   61: 		esac ], AC_DEFINE(NDEBUG,, [Turn off debug asserts]))
   62: AC_MSG_RESULT($DEBUG)
   63: 
   64: AIO=no
   65: AC_MSG_CHECKING(AIO Builtin support)
   66: AC_ARG_ENABLE(aio,
   67: 	[  --enable-aio            Build scheduler library with AIO operations ], 
   68: 	[ AIO=$enableval
   69: 		case "$enableval" in
   70: 			yes)
   71: 				AC_DEFINE(AIO_SUPPORT,, [Build scheduler library with AIO operations])
   72: 				;;
   73: 			*)
   74: 				;;
   75: 		esac ],)
   76: AC_MSG_RESULT($AIO)
   77: 
   78: AC_DEFINE(NO_SUPPORT, 0, [select support])
   79: AC_DEFINE(KQ_SUPPORT, 1, [kqueue support])
   80: AC_DEFINE(EP_SUPPORT, 2, [epoll support])
   81: 
   82: AC_DEFINE(SUP_ENABLE, KQ_SUPPORT, [support type])
   83: 
   84: EPSUP=no
   85: AC_MSG_CHECKING(epoll support)
   86: AC_ARG_ENABLE(epoll,
   87: 	[  --enable-epoll          Enable epoll support (only under Linux) ],
   88: 	[ EPSUP=$enableval
   89: 		case "$enableval" in
   90: 			yes)
   91: 				AC_DEFINE(SUP_ENABLE, EP_SUPPORT, [support type])
   92: 				KQSUP=no
   93: 				;;
   94: 			*)
   95: 				KQSUP=yes
   96: 				;;
   97: 	 	esac ], [ KQSUP=yes ])
   98: AC_MSG_RESULT($EPSUP)
   99: 
  100: AC_MSG_CHECKING(kqueue support)
  101: AC_ARG_ENABLE(kqueue,
  102: 	[  --disable-kqueue        Disable kqueue support ],
  103: 	[ KQSUP=$enableval
  104: 		case "$enableval" in
  105: 			no)
  106: 				AC_DEFINE(SUP_ENABLE, NO_SUPPORT, [support type])
  107: 				;;
  108: 			*)
  109: 				;;
  110: 	 	esac ], )
  111: AC_MSG_RESULT($KQSUP)
  112: 
  113: KQ_EVENTS=24
  114: AC_MSG_CHECKING(How many kqueue events can scheduling at one time)
  115: AC_ARG_WITH(kq_events, 
  116: 	[  --with-kq_events        Set how many kqueue events can scheduling at one time ],
  117: 	[ KQ_EVENTS=$withval ], KQ_EVENTS=32)
  118: AC_DEFINE_UNQUOTED(KQ_EVENTS, $KQ_EVENTS, [ How many kqueue events can scheduling at one time ])
  119: AC_MSG_RESULT($KQ_EVENTS)
  120: 
  121: ELWIX=no
  122: AC_MSG_CHECKING(With libelwix Build)
  123: AC_ARG_WITH(elwix,
  124: 	[  --with-elwix          Build library with libelwix memory managemant],
  125: 	[ ELWIX=$withval
  126: 		case "$withval" in
  127: 			yes)
  128: 				AC_DEFINE(__ELWIX,, [Build libraries with libelwix memory managemant])
  129: 				LIBS="${LIBS} -lelwix"
  130: 				;;
  131: 			*)
  132: 				;;
  133: 		esac ],)
  134: AC_MSG_RESULT($ELWIX)
  135: 
  136: DEBIAN_ARCH=$target_cpu
  137: AS_IF([ test "x$target_cpu" = "xarm6l" -o "x$target_cpu" = "xarm7l" ], DEBIAN_ARCH="armhf") 
  138: AS_IF([ test "x$target_cpu" = "xaarch64" ], DEBIAN_ARCH="arm64") 
  139: AS_IF([ test "x$target_cpu" = "xi686" ], DEBIAN_ARCH="i386") 
  140: AS_IF([ test "x$target_cpu" = "xx86_64" ], DEBIAN_ARCH="amd64") 
  141: AC_SUBST(DEBIAN_ARCH)
  142: 
  143: AC_CONFIG_FILES([Makefile
  144:                  inc/Makefile
  145:                  lib/Makefile
  146:                  debian/Makefile
  147:                  debian/control
  148:                  src/Makefile])
  149: AC_OUTPUT()

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>