libpipecolors/configure.ac

103 lines
3.2 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])
2015-07-16 13:47:06 -07:00
m4_define([pipecolors_version_major],[1])
2015-07-15 08:27:11 -07:00
m4_define([pipecolors_version_minor],[2])
2015-07-16 13:47:06 -07:00
m4_define([pipecolors_version_patch],[0])
2015-07-01 07:44:53 -07:00
2015-07-16 13:47:06 -07:00
m4_define([pipecolors_version], [pipecolors_version_major.pipecolors_version_minor.pipecolors_version_patch])
2015-07-01 07:44:53 -07:00
AC_INIT([pipecolors], [pipecolors_version])
AC_SUBST([PIPECOLORS_VERSION_MAJOR], [pipecolors_version_major])
AC_SUBST([PIPECOLORS_VERSION_MINOR], [pipecolors_version_minor])
2015-07-16 13:47:06 -07:00
AC_SUBST([PIPECOLORS_VERSION_PATCH], [pipecolors_version_patch])
2015-07-01 07:44:53 -07:00
AC_SUBST([PIPECOLORS_VERSION], [pipecolors_version])
PKG_INSTALLDIR
2015-07-15 10:46:41 -07:00
AC_CONFIG_SRCDIR([src/libpipecolors.cc])
AC_CONFIG_HEADERS([src/config.h])
2015-07-01 07:44:53 -07:00
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-15 11:35:30 -07:00
AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
#AC_GNU_SOURCE
# Checks for programs.
2015-07-02 20:20:18 -07:00
AC_PROG_INSTALL
2015-07-15 11:35:30 -07:00
AC_PROG_CXX
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
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([LIBTOOL_DEPS])
2015-07-15 11:35:30 -07:00
# Check for functions
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-15 11:35:30 -07:00
# Check for Headers
2015-07-16 13:47:06 -07:00
AC_CHECK_HEADERS([cstdio iostream cstring cstdlib cstdarg unistd.h],[],[AC_MSG_ERROR([We couldn't find one or more of the required headers.])])
2015-07-07 15:09:36 -07:00
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.])])
2015-07-15 10:46:41 -07:00
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile src/libpipecolors.pc:src/libpipecolors.pc.in src/libpipecolors.h:src/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)
2015-07-15 08:27:11 -07:00
under=$(tput smul)
underoff=$(tput rmul)
2015-07-07 15:09:36 -07:00
cat << EOF
2015-07-15 08:27:11 -07:00
${resetc}
2015-07-07 15:09:36 -07:00
${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.
EOF
2015-07-15 08:27:11 -07:00
if test "x$disable_pipe_stripping" == "xno" ; then
cat << EOF
${green}* ${resetc}Invalid pipe codes ${white}${under}will${resetc}${underoff} be filtered.
EOF
2015-07-07 15:09:36 -07:00
else
cat << EOF
2015-07-15 08:27:11 -07:00
${green}* ${resetc}Invalid pipe codes ${white}${under}will not${resetc}${underoff} be filtered.
EOF
fi
cat << EOF
${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.
2015-07-07 15:09:36 -07:00
EOF