libpipecolors/configure.ac

171 lines
5.8 KiB
Plaintext
Raw Normal View History

2015-07-01 07:44:53 -07:00
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
m4_define([pipecolors_version_major],[0])
m4_define([pipecolors_version_minor],[1])
m4_define([pipecolors_version_micro],[0])
2015-07-01 15:17:12 -07:00
m4_define([pipecolors_version_beta], [])
2015-07-01 07:44:53 -07:00
m4_define([pipecolors_version_base], [pipecolors_version_major.pipecolors_version_minor.pipecolors_version_micro])
m4_define([pipecolors_version],
[ifelse(pipecolors_version_beta, [], [pipecolors_version_base], [pipecolors_version_base.pipecolors_version_beta])])
AC_INIT([pipecolors], [pipecolors_version])
AC_SUBST(PIPECOLORS_VERSION_BASE, pipecolors_version_base)
AC_SUBST(PIPECOLORS_VERSION_BETA, pipecolors_version_beta)
AC_SUBST([PIPECOLORS_VERSION_MAJOR], [pipecolors_version_major])
AC_SUBST([PIPECOLORS_VERSION_MINOR], [pipecolors_version_minor])
AC_SUBST([PIPECOLORS_VERSION_MICRO], [pipecolors_version_micro])
AC_SUBST([PIPECOLORS_VERSION], [pipecolors_version])
PKG_INSTALLDIR
AC_CONFIG_SRCDIR([libpipecolors.cpp])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([config])
2015-07-07 15:09:36 -07:00
AC_CANONICAL_TARGET
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
PKG_PROG_PKG_CONFIG
2015-07-02 20:20:18 -07:00
AM_INIT_AUTOMAKE([gnu dist-bzip2 dist-zip std-options])
2015-07-07 15:09:36 -07:00
2015-07-02 20:20:18 -07:00
AM_SILENT_RULES
2015-07-01 07:44:53 -07:00
AC_GNU_SOURCE
2015-07-02 20:20:18 -07:00
AC_PROG_INSTALL
2015-07-01 07:44:53 -07:00
AC_PROG_CXXCPP
2015-07-01 15:17:12 -07:00
AM_PROG_AR
2015-07-01 07:44:53 -07:00
AC_PROG_LIBTOOL
2015-07-02 20:20:18 -07:00
AC_PROG_LN_S
2015-07-01 15:17:12 -07:00
2015-07-01 07:44:53 -07:00
LT_INIT
AC_LANG_CPLUSPLUS
2015-07-01 15:17:12 -07:00
AC_PREFIX_DEFAULT([/usr])
2015-07-06 15:29:02 -07:00
2015-07-01 07:44:53 -07:00
# Checks for programs.
2015-07-02 20:20:18 -07:00
2015-07-01 07:44:53 -07:00
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([LIBTOOL_DEPS])
gcc_full_vers=`g++ -dumpversion`
gcc_major_vers=`echo ${gcc_full_vers} | cut -f1 -d.`
gcc_minor_vers=`echo ${gcc_full_vers} | cut -f2 -d.`
gcc_micro_vers=`echo ${gcc_full_vers} | cut -f3 -d.`
2015-07-08 11:08:47 -07:00
#AC_MSG_CHECKING([${CXX-c++} version])
#if test "${gcc_minor_vers}" -lt 9; then
# AC_MSG_ERROR([GCC >= 4.9 is required, you have version ${gcc_full_vers}])
#else
# AC_MSG_RESULT([${gcc_full_vers} ... acceptable])
#fi
2015-07-07 15:09:36 -07:00
AC_CHECK_FUNCS([vasprintf], [], [AC_MSG_ERROR([Why don't you have this? Install basic c++ header files.])])
2015-07-06 15:29:02 -07:00
AC_CHECK_HEADERS([stdarg.h stdlib.h unistd.h string iostream map],[],[AC_MSG_ERROR([We couldn't find one or more of the required headers.])])
2015-07-06 06:59:54 -07:00
AC_CHECK_HEADER([boost/regex.hpp],[],[AC_MSG_ERROR([Please install the libboost-regex header library.])])
2015-07-07 15:09:36 -07:00
AC_CHECK_LIB([boost_regex], [main], [], [AC_MSG_ERROR([Please install the libboost-regex libs on your system.])])
2015-07-01 07:44:53 -07:00
AC_CHECK_TYPES([std::string], [], [], [[
#include <iostream>
2015-07-02 20:20:18 -07:00
#include <string>
2015-07-01 07:44:53 -07:00
]])
2015-07-07 15:09:36 -07:00
AC_ARG_ENABLE([pipe-stripping],
[AC_HELP_STRING([--disable-pipe-stripping], [strip invalid pipe codes [default=no]])],
[], [disable_pipe_stripping=no])
AM_CONDITIONAL([PC_REMOVE_INVALID], [test "x$disable_pipe_stripping" = "xno"])
2015-07-14 15:24:08 -07:00
2015-07-07 15:09:36 -07:00
AM_COND_IF([PC_REMOVE_INVALID],
2015-07-14 15:24:08 -07:00
[AC_MSG_NOTICE([Invalid pipe codes will be filtered.])],
[AC_MSG_NOTICE([Invalid pipe codes will not be filtered.])])
AC_ARG_ENABLE([btree],
[AC_HELP_STRING([--enable-btree], [enable googles btree instead of stl map [default=no]])],
[enable_btree=yes])
AM_CONDITIONAL([BUILD_WITH_BTREE], [test "x$enable_btree" = "xyes"])
if test "x$enable_btree" == "xyes"; then
AC_CHECK_TOOL([MERCURIAL], [hg], [no])
AM_CONDITIONAL([HAVE_HG_BIN], [test "x${MERCURIAL}" = "xhg"])
AC_MSG_CHECKING([for ${srcdir}/cpp-btree/btree.h])
AM_CONDITIONAL([HAVE_BTREE_H], [test -f ${srcdir}/cpp-btree/btree.h])
AM_COND_IF([HAVE_BTREE_H],
[AC_MSG_RESULT([found])
have_btree_h=1],
[AC_MSG_RESULT([no])])
if test x$have_btree_h = x1 && ! test ${HAVE_HG_BIN}; then
AC_VERBOSE([Using already existing btree.])
AM_CONDITIONAL([BUILD_WITH_BTREE], [true])
elif ${HAVE_HG_BIN} && test x$have_btree_h != x1; then
AC_VERBOSE([Downloading btree headers with mercurial])
$(which hg) clone https://code.google.com/p/cpp-btree/
else
AC_VERBOSE([
* Could not find hg in $PATH
* Building with STL maps instead of Google Btree
])
AM_CONDITIONAL([BUILD_WITH_BTREE], [false])
fi
fi
2015-07-01 07:44:53 -07:00
AC_ARG_ENABLE([the-force],
[AC_HELP_STRING([--enable-the-force], [use the force [default=no]])],
[], [enable_the_force=no])
AM_CONDITIONAL([ENABLE_THE_FORCE], [test "x$enable_the_force" = "xyes"])
2015-07-07 15:09:36 -07:00
AC_CONFIG_FILES([Makefile libpipecolors.pc:libpipecolors.pc.in libpipecolors.h:libpipecolors.h.in],[],[APIVERSION=PIPECOLORS_VERSION])
2015-07-03 00:56:32 -07:00
AC_CONFIG_COMMANDS([timestamp], [date >timestamp])
2015-07-01 07:44:53 -07:00
AC_OUTPUT
2015-07-07 15:09:36 -07:00
resetc=$(tput sgr0);
green=$(tput bold; tput setaf 2)
blue=$(tput bold; tput setaf 4)
cyan=$(tput bold; tput setaf 6)
white=$(tput bold; tput setaf 7)
if test "x$disable_pipe_stripping" == "xno" ; then
cat << EOF
${reset}
${green}* ${white}Prefix ${resetc}: ${cyan}${prefix}
${green}* ${white}Exec Prefix ${resetc}: ${cyan}${exec_prefix}
${green}* ${white}Library ${resetc}: ${cyan}${libdir}
${green}* ${white}Include ${resetc}: ${cyan}${includedir}
${green}* ${resetc}Configure finished type '${cyan}make${resetc}' to build and '${cyan}make install${resetc}' to install.
${green}* ${resetc}Invalid pipe codes will be filtered
${green}* ${resetc} e.g. ('${white}|41${resetc}Hello World' will show as 'Hello World' instead of '${white}|41${resetc}Hello World')
${green}* ${resetc} You can change this behavior by using the ${white}--disable-pipe-stripping ${resetc}configure flag.
EOF
else
cat << EOF
${reset}
${green}* ${white}Prefix ${resetc}: ${cyan}${prefix}
${green}* ${white}Exec Prefix ${resetc}: ${cyan}${exec_prefix}
${green}* ${white}Library ${resetc}: ${cyan}${libdir}
${green}* ${white}Include ${resetc}: ${cyan}${includedir}
${green}* ${resetc}Configure finished type '${cyan}make${resetc}' to build and '${cyan}make install${resetc}' to install.
${green}* ${resetc}Invalid pipe codes will not be filtered.
${green}* ${resetc} e.g. ('${white}|41${resetc}Hello World' will show as '${white}|41${resetc}Hello World' instead of 'Hello World')
${green}* ${resetc} You can change this behavior by removing the ${white}--disable-pipe-stripping ${resetc}configure flag.
EOF
fi