Annotation of embedaddon/bmon/configure.ac, revision 1.1.1.2

1.1       misho       1: #
                      2: # configure.in      Configure Script
                      3: #
1.1.1.2 ! misho       4: # Copyright (c) 2001-2013 Thomas Graf <tgraf@suug.ch>
1.1       misho       5: #
                      6: # Permission is hereby granted, free of charge, to any person obtaining a
                      7: # copy of this software and associated documentation files (the "Software"),
                      8: # to deal in the Software without restriction, including without limitation
                      9: # the rights to use, copy, modify, merge, publish, distribute, sublicense,
                     10: # and/or sell copies of the Software, and to permit persons to whom the
                     11: # Software is furnished to do so, subject to the following conditions:
                     12: #
                     13: # The above copyright notice and this permission notice shall be included
                     14: # in all copies or substantial portions of the Software.
                     15: #
                     16: # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
                     17: # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
                     18: # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
                     19: # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
                     20: # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
                     21: # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
                     22: # DEALINGS IN THE SOFTWARE.
                     23: 
1.1.1.2 ! misho      24: AC_INIT(bmon, 3.3, [], [], [http://www.infradead.org/~tgr/bmon/])
        !            25: AC_CONFIG_HEADERS(include/bmon/defs.h)
        !            26: AC_CONFIG_AUX_DIR([build-aux])
        !            27: AC_CONFIG_MACRO_DIR([m4])
1.1       misho      28: 
1.1.1.2 ! misho      29: AC_CANONICAL_TARGET
1.1       misho      30: AC_CANONICAL_SYSTEM
                     31: 
1.1.1.2 ! misho      32: AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
        !            33: m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)], [])
1.1       misho      34: 
                     35: AC_ISC_POSIX
                     36: AC_PROG_CC
                     37: AC_PROG_CC_STDC
                     38: AC_PROG_CPP
                     39: AC_PROG_MAKE_SET
                     40: AC_PROG_INSTALL
                     41: 
                     42: AC_C_CONST
                     43: AC_C_INLINE
                     44: 
                     45: AC_HEADER_TIME
                     46: AC_HEADER_DIRENT
                     47: 
                     48: AC_TYPE_SIZE_T
                     49: AC_TYPE_SIGNAL
                     50: AC_TYPE_PID_T
                     51: 
                     52: AC_FUNC_FORK
                     53: 
                     54: AC_CHECK_HEADERS(getopt.h ncurses/ncurses.h ncurses.h curses.h)
                     55: AC_CHECK_HEADERS(dirent.h sys/utsname.h sys/sockio.h netinet6/in6.h)
1.1.1.2 ! misho      56: AC_CHECK_HEADERS(fcntl.h netdb.h netinet/in.h sysctl/ioctl.h)
1.1       misho      57: AC_CHECK_HEADERS(sys/param.h sys/socket.h)
                     58: 
                     59: AC_CHECK_TYPES(suseconds_t)
                     60: 
                     61: AC_CHECK_FUNCS(atexit gettimeofday memset pow socket strcasecmp)
                     62: AC_CHECK_FUNCS(strchr strdup strerror strncasecmp strstr strtol)
1.1.1.2 ! misho      63: AC_CHECK_FUNCS(uname getdate)
1.1       misho      64: 
1.1.1.2 ! misho      65: AX_WITH_CURSES
        !            66: if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then
        !            67:         AC_MSG_ERROR([requires an X/Open-compatible Curses library with color])
        !            68: fi
1.1       misho      69: 
1.1.1.2 ! misho      70: PKG_CHECK_MODULES([CONFUSE], [libconfuse], [], AC_MSG_ERROR([requires libconfuse]))
1.1       misho      71: 
1.1.1.2 ! misho      72: case ${target_os} in
        !            73:     linux*)
        !            74:         PKG_CHECK_MODULES([LIBNL], [libnl-3.0], [], AC_MSG_ERROR([requires libnl3-dev]))
        !            75:         PKG_CHECK_MODULES([LIBNL_ROUTE], [libnl-route-3.0], [], AC_MSG_ERROR([requires libnl3-route]))
        !            76:     ;;
        !            77: esac
1.1       misho      78: 
1.1.1.2 ! misho      79: AC_CHECK_LIB(m, pow, [], AC_MSG_ERROR([requires libm]))
1.1       misho      80: 
1.1.1.2 ! misho      81: BMON_LIB=""
1.1       misho      82: 
                     83: #####################################################################
                     84: ##
                     85: ## libcurses check
                     86: ##
                     87: #####################################################################
                     88: CURSES="No "
                     89: AC_CHECK_LIB(ncurses, initscr, [
                     90:   AC_DEFINE_UNQUOTED(HAVE_NCURSES, "1", [have ncurses])
                     91:   LCURSES="ncurses"
                     92:   CURSES="Yes"
                     93: ],[
                     94:        AC_CHECK_LIB(curses,initscr, [
                     95:                AC_DEFINE_UNQUOTED(HAVE_CURSES, "1", [have curses])
                     96:                LCURSES="curses"
                     97:                  CURSES="Yes"
                     98:        ],[
                     99:                echo
                    100:                echo "*** Warning: Building bmon w/o curses support ***"
                    101:                echo
                    102:        ])
                    103: ])
                    104: 
                    105: LIBCURSES="-l$LCURSES"
                    106: 
                    107: AC_CHECK_LIB($LCURSES, redrawwin, [
                    108:        AC_DEFINE_UNQUOTED(HAVE_REDRAWWIN, "1", [have redrawwin])
                    109: ])
                    110: 
                    111: AC_CHECK_LIB($LCURSES, use_default_colors, [
                    112:          AC_DEFINE_UNQUOTED(HAVE_USE_DEFAULT_COLORS, "1", [have udc])
                    113: ])
                    114: 
                    115: #####################################################################
                    116: ##
                    117: ## interface counter overflow workaround
                    118: ##
                    119: #####################################################################
                    120: AC_ARG_ENABLE(cnt-workaround,
                    121: [  --disable-cnt-workaround Disables interface counter overflow workaround],[
                    122:        if test x$enableval = xno; then
                    123:                AC_DEFINE_UNQUOTED(DISABLE_OVERFLOW_WORKAROUND,"1",[no overflow workaround])
                    124:        fi
                    125: ])
                    126: 
                    127: #####################################################################
                    128: ##
                    129: ## curses
                    130: ##
                    131: #####################################################################
                    132: AC_ARG_ENABLE(curses,
                    133: [  --disable-curses        Disables curses output],[
                    134:        if test x$enableval = xno; then
                    135:                CURSES="No "
                    136:        fi
                    137: ])
                    138: 
                    139: #####################################################################
                    140: ##
                    141: ## debug check
                    142: ##
                    143: #####################################################################
                    144: DEBUG=0
                    145: AC_ARG_ENABLE(debug,
                    146: [  --enable-debug          Enable debug mode (default disabled)],[
                    147:        if test x$enableval = xyes; then
1.1.1.2 ! misho     148:                AC_DEFINE_UNQUOTED(DEBUG, "1", [enable debugging])
1.1       misho     149:                DEBUG=1;
                    150:        fi
                    151: ])
                    152: 
                    153: #####################################################################
                    154: ##
                    155: ## target os eval
                    156: ##
                    157: #####################################################################
                    158: case ${target_os} in
                    159:     linux*)
                    160:        AC_DEFINE_UNQUOTED(SYS_LINUX, "1", [operating system])
                    161:     ;;
                    162: 
                    163:     *solaris*)
                    164:        AC_DEFINE_UNQUOTED(SYS_SUNOS, "1", [operating system])
                    165:     ;;
                    166: 
                    167:     *bsd*)
                    168:        AC_DEFINE_UNQUOTED(SYS_BSD, "1", [operating system])
                    169:     ;;
                    170: 
                    171:     *darwin*)
                    172:        AC_DEFINE_UNQUOTED(SYS_BSD, "1", [operating system])
                    173:     ;;
                    174: 
                    175:     *)
                    176:        AC_DEFINE_UNQUOTED(SYS_OTHER, "1", [operating system])
                    177:     ;;
                    178: esac
                    179: 
                    180: #####################################################################
                    181: ##
                    182: ## export variables
                    183: ##
                    184: #####################################################################
                    185: AC_SUBST(DEBUG)
                    186: AC_SUBST(STATIC)
                    187: AC_SUBST(SYS)
                    188: AC_SUBST(ARCH)
                    189: 
                    190: AC_SUBST(CURSES)
                    191: 
1.1.1.2 ! misho     192: AC_CONFIG_FILES([
        !           193: Makefile
        !           194: include/Makefile
        !           195: src/Makefile
        !           196: man/Makefile
        !           197: examples/Makefile
        !           198: ])
1.1       misho     199: 
1.1.1.2 ! misho     200: AC_OUTPUT

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