Annotation of libelwix/configure.in, revision 1.71.2.3

1.1       misho       1: #
                      2: # $Author: misho $
1.71.2.3! misho       3: # $Id: configure.in,v 1.71.2.2 2024/08/19 12:56:06 misho Exp $
1.1       misho       4: #
1.71.2.1  misho       5: AC_INIT(libelwix, 6.1, misho@elwix.org)
1.1       misho       6: AC_CONFIG_SRCDIR([src/elwix.c])
                      7: AC_CONFIG_HEADERS([inc/config.h])
                      8: 
1.4       misho       9: ac_cv_func_malloc_0_nonnull="yes"
                     10: ac_cv_func_realloc_0_nonnull="yes"
                     11: 
1.1       misho      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: 
1.30      misho      20: AC_CHECK_TOOL(MKDEP, mkdep, ../mkdep)
1.1       misho      21: AC_SUBST(MKDEP)
                     22: 
1.71.2.2  misho      23: if test "${ac_cv_env_CFLAGS_set}" != "set"; then
1.71.2.3! misho      24:        CFLAGS="-Wall -O2"
1.71.2.2  misho      25: else
                     26:        CFLAGS="${ac_cv_env_CFLAGS_value}"
                     27: fi
1.71.2.3! misho      28: if test "${ac_cv_env_LDFLAGS_set}" = "set"; then
        !            29:        LDFLAGS="${ac_cv_env_LDFLAGS_value}"
        !            30: fi
1.1       misho      31: 
                     32: AC_CHECK_LIB([pthread], [pthread_mutex_init])
                     33: 
                     34: # Checks for header files.
                     35: AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h termios.h unistd.h])
                     36: 
                     37: # Checks for typedefs, structures, and compiler characteristics.
                     38: AC_C_INLINE
                     39: 
                     40: # Checks for library functions.
                     41: AC_FUNC_MALLOC
                     42: AC_FUNC_REALLOC
1.65      misho      43: AC_CHECK_FUNCS([memset regcomp strchr strerror link_addr strlcpy strlcat])
1.1       misho      44: 
                     45: DEBUG=no
                     46: AC_MSG_CHECKING(Debug Build)
                     47: AC_ARG_ENABLE(debug,
                     48:        [  --enable-debug          Build library with debug information and additional messages],
                     49:        [ DEBUG=$enableval
                     50:                case "$enableval" in
                     51:                        yes)
                     52:                                CFLAGS="-g ${CFLAGS}"
                     53:                                ;;
                     54:                        *)
1.66      misho      55:                                AC_DEFINE(NDEBUG,, [Build w/o assert() support])
1.1       misho      56:                                ;;
                     57:                esac ],)
                     58: AC_MSG_RESULT($DEBUG)
                     59: 
1.27      misho      60: MEMMGR="elwix"
                     61: AC_MSG_CHECKING(Memory management)
                     62: AC_ARG_WITH(memmgr,
                     63:        [  --with-memmgr=<mm>      Memory manager for ELWIX (elwix|system)], 
                     64:        [ case "$withval" in
                     65:                sys|system)
                     66:                        MEMMGR="system"
                     67:                        AC_DEFINE(MEMMGR, ELWIX_SYSM, [ELWIX memory manager])
                     68:                        ;;
                     69:                *)
                     70:                        MEMMGR="elwix"
                     71:                        AC_DEFINE(MEMMGR, ELWIX_MPOOL, [ELWIX memory manager])
                     72:                        ;;
                     73:          esac ], AC_DEFINE(MEMMGR, ELWIX_MPOOL, [ELWIX memory manager]))
                     74: AC_MSG_RESULT($MEMMGR)
                     75: 
1.70      misho      76: MPOOL_MEM_ZERO=no
                     77: AC_MSG_CHECKING(MPoll zeroing allocated memory)
                     78: AC_ARG_ENABLE(mpool-mem-zero, 
                     79:              [  --enable-mpool-mem-zero MPool zeroing allocated memory], 
                     80:              [ case "$enableval" in 
                     81:                        yes)
                     82:                                AC_DEFINE(MPOOL_MEM_ZERO,, [MPool zeroing memory])
                     83:                                MPOOL_MEM_ZERO=yes
                     84:                                ;;
                     85:                        *)
                     86:                                MPOOL_MEM_ZERO=no
                     87:                                ;;
                     88:                  esac ],)
                     89: AC_MSG_RESULT($MPOOL_MEM_ZERO)
                     90: 
1.65      misho      91: PATRICIA=no
                     92: AC_MSG_CHECKING(Patricia support)
                     93: AC_ARG_ENABLE(patricia, 
                     94:              [  --enable-patricia       Patricia support for ELWIX], 
                     95:              [ case "$enableval" in 
                     96:                        yes)
                     97:                                AC_DEFINE(PATRICIA_SUPPORT,, [Patricia support])
                     98:                                PATRICIA=yes
                     99:                                ;;
                    100:                        *)
                    101:                                ;;
                    102:                  esac ],)
                    103: AC_MSG_RESULT($PATRICIA)
                    104: 
                    105: PELCO=no
                    106: AC_MSG_CHECKING(Pelco support)
                    107: AC_ARG_ENABLE(pelco, 
                    108:              [  --enable-pelco          Pelco support for ELWIX], 
                    109:              [ case "$enableval" in 
                    110:                        yes)
                    111:                                AC_DEFINE(PELCO_SUPPORT,, [Pelco support])
                    112:                                PELCO=yes
                    113:                                ;;
                    114:                        *)
                    115:                                ;;
                    116:                  esac ],)
                    117: AC_MSG_RESULT($PELCO)
                    118: 
1.69      misho     119: DEBIAN_ARCH=$target_cpu
                    120: AS_IF([ test "x$target_cpu" = "xarm6l" -o "x$target_cpu" = "xarm7l" ], DEBIAN_ARCH="armhf") 
                    121: AS_IF([ test "x$target_cpu" = "xaarch64" ], DEBIAN_ARCH="arm64") 
                    122: AS_IF([ test "x$target_cpu" = "xi686" ], DEBIAN_ARCH="i386") 
                    123: AS_IF([ test "x$target_cpu" = "xx86_64" ], DEBIAN_ARCH="amd64") 
                    124: AC_SUBST(DEBIAN_ARCH)
                    125: 
                    126: 
1.1       misho     127: AC_CONFIG_FILES([Makefile
                    128:                  inc/Makefile
                    129:                  lib/Makefile
1.67      misho     130:                 debian/Makefile
1.69      misho     131:                 debian/control
1.1       misho     132:                  src/Makefile])
                    133: AC_OUTPUT

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