Skip to content

Commit

Permalink
Merge branch 'master' into experimental/DirTree
Browse files Browse the repository at this point in the history
* master: (44 commits)
  Updated NEWS.md for issue #100.
  Comment on OSX 10.11.
  Removed OSX 10.11 from rotation due to stty issues from #103.
  Put stty raw back for linux-style script.  Trying to get travis to pull down a pcre2 for trusty.
  Travis change to add pcre2 to linux builds.
  Travis.
  Interim.
  Interim.
  Interim.
  Interim.
  Interim.
  Interim.
  Interim.
  Interim.
  Interim.
  Interim.
  testsuite, capturing intermediate files.
  script workaround for some OSX distro versions.
  Interim.
  printf portability fix.
  ...

# Conflicts:
#	src/libext/filesystem.hpp
  • Loading branch information
gvansickle committed Oct 7, 2016
2 parents d03bb00 + 1badd7f commit c1f60b6
Show file tree
Hide file tree
Showing 15 changed files with 501 additions and 372 deletions.
32 changes: 22 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
language: cpp
sudo: required
dist: trusty

os:
- osx
- linux

compiler:
- clang
- gcc
matrix:
include:
- os: osx
osx_image: beta-xcode6.1
- os: osx
osx_image: xcode7.1
# - os: osx # ==> OSX 10.11, removed until we have a fix for #103, tabs->spaces.
# osx_image: xcode7.3
# osx_image: xcode8
- os: linux
dist: trusty
sudo: required
compiler: gcc
- os: linux
dist: trusty
sudo: required
compiler: clang
#compiler:
# - clang
# - gcc

before_install:
- if [ $TRAVIS_OS_NAME == osx ]; then brew update; fi
# Travis CI has a broken libtool/sed issue in the OSX image(s) <see e.g. https://github.com/libgd/libgd/issues/266#issuecomment-234697932>.
# This is the recommended work-around until they fix it.
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew uninstall libtool && brew install libtool; fi
- if [ $TRAVIS_OS_NAME == osx ]; then brew install pcre pcre2 argp-standalone the_silver_searcher; fi
- if [ $TRAVIS_OS_NAME == osx ]; then brew tap homebrew/dupes; brew install grep; fi # Install gnu grep to test against. @todo Make things work so this can be installed only after a successful build.
# Install gnu grep to test against. @todo Make things work so this can be installed only after a successful build.
- if [ $TRAVIS_OS_NAME == osx ]; then brew tap homebrew/dupes; brew install grep; fi
- if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update -qq && sudo apt-get install -qq libpcre3-dev && sudo apt-get install -qq silversearcher-ag; fi

before_script:
Expand Down
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
### Fixed
- Cygwin now requires AC_USE_SYSTEM_EXTENSIONS for access to get_current_dir_name(). Resolves #76.
- Resolved issue with highlights on wrapped lines sometimes extending the full width of the terminal. Resolves #80.
- Resolved issue where matches spanning an eol (e.g. 'a\s+b' matching 'a\nb') would cause the program to throw an exception and terminate. Resolves #92.

- Resolved issue where matches spanning an eol (e.g. 'a\s+b' matching 'a\nb') would cause the program to throw an exception and terminate. Resolves #92.
- Resolved segfaults on some systems due to dirname() modifying its parameter. Resolves #96.
- No longer treating PCRE2 reporting no JIT support as an error. Resolves #100.

## [0.2.2] - 2016-04-09

Expand Down
20 changes: 10 additions & 10 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ AM_INIT_AUTOMAKE([
AC_USE_SYSTEM_EXTENSIONS

# Determine how many CPUs we have on the build machine.
AX_COUNT_CPUS
AX_COUNT_CPUS([], [])
AC_SUBST([CPU_COUNT])

# Set up the maintainer compiler flags.
Expand Down Expand Up @@ -128,14 +128,14 @@ AS_IF([ test "x$ac_path_ESED_found" = "x:" ],
# try to sort it out here.
AC_PATH_PROG([PROG_SCRIPT], [script], [:])
AC_MSG_CHECKING([$PROG_SCRIPT's command line type])
AS_IF([$PROG_SCRIPT -qfc "echo hello" /dev/null > /dev/null 2>&1],
AS_IF([$PROG_SCRIPT -qfc "stty raw && echo hello" /dev/null > /dev/null 2>&1],
[
AC_SUBST([PROG_SCRIPT_TYPE], [linux])
AC_SUBST([PROG_SCRIPT_PRE_TEXT], ['-qfc'])
AC_SUBST([PROG_SCRIPT_POST_TEXT], ['/dev/null'])
AC_MSG_RESULT([Linux style])
],
[$PROG_SCRIPT -q /dev/null echo "hello" > /dev/null 2>&1],
[$PROG_SCRIPT -q /dev/null $SHELL -c 'stty raw && echo "hello"' > /dev/null 2>&1],
[
AC_SUBST([PROG_SCRIPT_TYPE], [bsd])
AC_SUBST([PROG_SCRIPT_PRE_TEXT], ['-q /dev/null'])
Expand All @@ -149,7 +149,7 @@ AC_PROG_EGREP
AC_PROG_FGREP
AC_PROG_AWK
AC_PROG_LN_S
AS_IF([test "$LN_S" == 'ln -s'],
AS_IF([test "$LN_S" = 'ln -s'],
[AC_SUBST([TEST_LN_S], [$LN_S])],
[AC_SUBST([TEST_LN_S], [:])
AC_MSG_WARN([couldn't find a real 'ln -s', will not be able to run all tests])])
Expand Down Expand Up @@ -204,9 +204,10 @@ AC_PATH_PROG([PROG_PCRE2GREP], [pcre2grep], [])
###

# Python, for generation of test suite.
### @note Python >= 2.7 is actually required to run the testsuite at the moment, and hence is
### @note Python >= 2.7 is actually required to run the benchmarks in the testsuite at the moment, and hence is
### not a maintainer-only tool. My hope is that this will soon become a pre-"make distcheck" requirement.
AM_PATH_PYTHON([2.7])
AM_PATH_PYTHON([2.7],,[:])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ":"]) #<< Automake conditional for skipping tests which require python.

# Autotest needs autom4te, or 'missing's stub for it post-distribution.
AM_MISSING_PROG([AUTOM4TE], [autom4te])
Expand Down Expand Up @@ -345,16 +346,15 @@ AM_COND_IF([BUILD_X86_64_ISA_EXTENSIONS],
# optionally use some pthreads functionality, e.g. naming threads for diagnostic, logging, and other purposes.
# Macro docs: http://www.gnu.org/software/autoconf-archive/ax_pthread.html#ax_pthread
AX_PTHREAD
AS_IF([test "x$ax_pthread_ok" == xyes],
AS_IF([test "x$ax_pthread_ok" = xyes],
[
AC_MSG_NOTICE([found pthreads])
AC_MSG_CHECKING([if the C++11 underlying thread implementation is pthreads])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
#include <type_traits>
#include <thread>
#include <pthread.h>
#include <pthread.h>
],
[
static_assert(std::is_same<std::thread::native_handle_type, pthread_t>::value, "C++11 underlying thread implementation is not pthreads");
Expand Down Expand Up @@ -391,7 +391,7 @@ AC_CHECK_DECLS([std::to_string(int)],
],
[], [#include <string>])

AC_SEARCH_LIBS([argp_parse],[argp])
AC_SEARCH_LIBS([argp_parse], [argp], [], [AC_MSG_ERROR([cannot find the GNU Argp library or equivalent.])])

AC_CHECK_FUNCS([sched_setaffinity])

Expand Down
113 changes: 74 additions & 39 deletions m4/ax_count_cpus.m4
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@
#
# SYNOPSIS
#
# AX_COUNT_CPUS
# AX_COUNT_CPUS([ACTION-IF-DETECTED],[ACTION-IF-NOT-DETECTED])
#
# DESCRIPTION
#
# Attempt to count the number of processors present on the machine. If the
# detection fails, then a value of 1 is assumed.
# Attempt to count the number of logical processor cores (including
# virtual and HT cores) currently available to use on the machine and
# place detected value in CPU_COUNT variable.
#
# The value is placed in the CPU_COUNT variable.
# On successful detection, ACTION-IF-DETECTED is executed if present. If
# the detection fails, then ACTION-IF-NOT-DETECTED is triggered. The
# default ACTION-IF-NOT-DETECTED is to set CPU_COUNT to 1.
#
# LICENSE
#
# Copyright (c) 2014 Karlson2k (Evgeny Grin) <k2k@narod.ru>
# Copyright (c) 2014,2016 Karlson2k (Evgeny Grin) <k2k@narod.ru>
# Copyright (c) 2012 Brian Aker <brian@tangent.org>
# Copyright (c) 2008 Michael Paul Bailey <jinxidoru@byu.net>
# Copyright (c) 2008 Christophe Tournayre <turn3r@users.sourceforge.net>
Expand All @@ -25,42 +28,74 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 11
#serial 21

AC_DEFUN([AX_COUNT_CPUS],[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_EGREP])
AC_DEFUN([AX_COUNT_CPUS],[dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_PROG_EGREP])dnl
AC_MSG_CHECKING([the number of available CPUs])
CPU_COUNT="0"
AS_CASE([$host_os],[
*darwin*],[
AS_IF([test -x /usr/sbin/sysctl],[
sysctl_a=`/usr/sbin/sysctl -a 2>/dev/null| grep -c hw.cpu`
AS_IF([test sysctl_a],[
CPU_COUNT=`/usr/sbin/sysctl -n hw.ncpu`
])
])],[
*linux*],[
AS_IF([test "x$CPU_COUNT" = "x0" -a -e /proc/cpuinfo],[
AS_IF([test "x$CPU_COUNT" = "x0" -a -e /proc/cpuinfo],[
CPU_COUNT=`$EGREP -c '^processor' /proc/cpuinfo`
])
])],[
*mingw*],[
AS_IF([test -n "$NUMBER_OF_PROCESSORS"],[
CPU_COUNT="$NUMBER_OF_PROCESSORS"
])],[
*cygwin*],[
AS_IF([test -n "$NUMBER_OF_PROCESSORS"],[
CPU_COUNT="$NUMBER_OF_PROCESSORS"
])
])
# Try generic methods
AS_IF([test "x$CPU_COUNT" = "x0"],[
CPU_COUNT="1"
AC_MSG_RESULT( [unable to detect (assuming 1)] )
],[
AC_MSG_RESULT( $CPU_COUNT )
])
])
# 'getconf' is POSIX utility, but '_NPROCESSORS_ONLN' and
# 'NPROCESSORS_ONLN' are platform-specific
command -v getconf >/dev/null 2>&1 && \
CPU_COUNT=`getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null` || CPU_COUNT="0"
AS_IF([[test "$CPU_COUNT" -gt "0" 2>/dev/null || ! command -v nproc >/dev/null 2>&1]],[[: # empty]],[dnl
# 'nproc' is part of GNU Coreutils and is widely available
CPU_COUNT=`OMP_NUM_THREADS='' nproc 2>/dev/null` || CPU_COUNT=`nproc 2>/dev/null` || CPU_COUNT="0"
])dnl
AS_IF([[test "$CPU_COUNT" -gt "0" 2>/dev/null]],[[: # empty]],[dnl
# Try platform-specific preferred methods
AS_CASE([[$host_os]],dnl
[[*linux*]],[[CPU_COUNT=`lscpu -p 2>/dev/null | $EGREP -e '^@<:@0-9@:>@+,' -c` || CPU_COUNT="0"]],dnl
[[*darwin*]],[[CPU_COUNT=`sysctl -n hw.logicalcpu 2>/dev/null` || CPU_COUNT="0"]],dnl
[[freebsd*]],[[command -v sysctl >/dev/null 2>&1 && CPU_COUNT=`sysctl -n kern.smp.cpus 2>/dev/null` || CPU_COUNT="0"]],dnl
[[netbsd*]], [[command -v sysctl >/dev/null 2>&1 && CPU_COUNT=`sysctl -n hw.ncpuonline 2>/dev/null` || CPU_COUNT="0"]],dnl
[[solaris*]],[[command -v psrinfo >/dev/null 2>&1 && CPU_COUNT=`psrinfo 2>/dev/null | $EGREP -e '^@<:@0-9@:>@.*on-line' -c 2>/dev/null` || CPU_COUNT="0"]],dnl
[[mingw*]],[[CPU_COUNT=`ls -qpU1 /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor/ 2>/dev/null | $EGREP -e '^@<:@0-9@:>@+/' -c` || CPU_COUNT="0"]],dnl
[[msys*]],[[CPU_COUNT=`ls -qpU1 /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor/ 2>/dev/null | $EGREP -e '^@<:@0-9@:>@+/' -c` || CPU_COUNT="0"]],dnl
[[cygwin*]],[[CPU_COUNT=`ls -qpU1 /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor/ 2>/dev/null | $EGREP -e '^@<:@0-9@:>@+/' -c` || CPU_COUNT="0"]]dnl
)dnl
])dnl
AS_IF([[test "$CPU_COUNT" -gt "0" 2>/dev/null || ! command -v sysctl >/dev/null 2>&1]],[[: # empty]],[dnl
# Try less preferred generic method
# 'hw.ncpu' exist on many platforms, but not on GNU/Linux
CPU_COUNT=`sysctl -n hw.ncpu 2>/dev/null` || CPU_COUNT="0"
])dnl
AS_IF([[test "$CPU_COUNT" -gt "0" 2>/dev/null]],[[: # empty]],[dnl
# Try platform-specific fallback methods
# They can be less accurate and slower then preferred methods
AS_CASE([[$host_os]],dnl
[[*linux*]],[[CPU_COUNT=`$EGREP -e '^processor' -c /proc/cpuinfo 2>/dev/null` || CPU_COUNT="0"]],dnl
[[*darwin*]],[[CPU_COUNT=`system_profiler SPHardwareDataType 2>/dev/null | $EGREP -i -e 'number of cores:'|cut -d : -f 2 -s|tr -d ' '` || CPU_COUNT="0"]],dnl
[[freebsd*]],[[CPU_COUNT=`dmesg 2>/dev/null| $EGREP -e '^cpu@<:@0-9@:>@+: '|sort -u|$EGREP -e '^' -c` || CPU_COUNT="0"]],dnl
[[netbsd*]], [[CPU_COUNT=`command -v cpuctl >/dev/null 2>&1 && cpuctl list 2>/dev/null| $EGREP -e '^@<:@0-9@:>@+ .* online ' -c` || \
CPU_COUNT=`dmesg 2>/dev/null| $EGREP -e '^cpu@<:@0-9@:>@+ at'|sort -u|$EGREP -e '^' -c` || CPU_COUNT="0"]],dnl
[[solaris*]],[[command -v kstat >/dev/null 2>&1 && CPU_COUNT=`kstat -m cpu_info -s state -p 2>/dev/null | $EGREP -c -e 'on-line'` || \
CPU_COUNT=`kstat -m cpu_info 2>/dev/null | $EGREP -c -e 'module: cpu_info'` || CPU_COUNT="0"]],dnl
[[mingw*]],[AS_IF([[CPU_COUNT=`reg query 'HKLM\\Hardware\\Description\\System\\CentralProcessor' 2>/dev/null | $EGREP -e '\\\\@<:@0-9@:>@+$' -c`]],dnl
[[: # empty]],[[test "$NUMBER_OF_PROCESSORS" -gt "0" 2>/dev/null && CPU_COUNT="$NUMBER_OF_PROCESSORS"]])],dnl
[[msys*]],[[test "$NUMBER_OF_PROCESSORS" -gt "0" 2>/dev/null && CPU_COUNT="$NUMBER_OF_PROCESSORS"]],dnl
[[cygwin*]],[[test "$NUMBER_OF_PROCESSORS" -gt "0" 2>/dev/null && CPU_COUNT="$NUMBER_OF_PROCESSORS"]]dnl
)dnl
])dnl
AS_IF([[test "x$CPU_COUNT" != "x0" && test "$CPU_COUNT" -gt 0 2>/dev/null]],[dnl
AC_MSG_RESULT([[$CPU_COUNT]])
m4_ifvaln([$1],[$1],)dnl
],[dnl
m4_ifval([$2],[dnl
AS_UNSET([[CPU_COUNT]])
AC_MSG_RESULT([[unable to detect]])
$2
], [dnl
CPU_COUNT="1"
AC_MSG_RESULT([[unable to detect (assuming 1)]])
])dnl
])dnl
])dnl
14 changes: 10 additions & 4 deletions m4/ax_cxx_compile_stdcxx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the specified
# version of the C++ standard. If necessary, add switches to CXX to
# enable support. VERSION may be '11' (for the C++11 standard) or '14'
# (for the C++14 standard).
# version of the C++ standard. If necessary, add switches to CXX and
# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
# or '14' (for the C++14 standard).
#
# The second argument, if specified, indicates whether you insist on an
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
Expand Down Expand Up @@ -39,7 +39,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 3
#serial 4

dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
dnl (serial version number 13).
Expand Down Expand Up @@ -82,6 +82,9 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
Expand All @@ -105,6 +108,9 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
Expand Down
8 changes: 4 additions & 4 deletions m4/ax_cxx_compile_stdcxx_11.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++11
# standard; if necessary, add switches to CXX to enable support.
# standard; if necessary, add switches to CXX and CXXCPP to enable
# support.
#
# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
# macro with the version set to C++11. The two optional arguments are
Expand All @@ -32,8 +33,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 15

include([ax_cxx_compile_stdcxx.m4])
#serial 17

AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])])
4 changes: 3 additions & 1 deletion m4/ax_gcc_builtin.m4
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# The macro currently supports the following built-in functions:
#
# __builtin_assume_aligned
# __builtin_bswap16
# __builtin_bswap32
# __builtin_bswap64
# __builtin_choose_expr
Expand Down Expand Up @@ -90,7 +91,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 2
#serial 3

AC_DEFUN([AX_GCC_BUILTIN], [
AS_VAR_PUSHDEF([ac_var], [ax_cv_have_$1])
Expand All @@ -99,6 +100,7 @@ AC_DEFUN([AX_GCC_BUILTIN], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [
m4_case([$1],
[__builtin_assume_aligned], [$1("", 0)],
[__builtin_bswap16], [$1(0)],
[__builtin_bswap32], [$1(0)],
[__builtin_bswap64], [$1(0)],
[__builtin_choose_expr], [$1(0, 0, 0)],
Expand Down
5 changes: 3 additions & 2 deletions m4/ax_prog_doxygen.m4
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 19
#serial 20

## ----------##
## Defaults. ##
Expand Down Expand Up @@ -553,7 +553,8 @@ doxygen-doc: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL)
]])dnl
[DX_CLEANFILES = \\]
m4_foreach([DX_i], [DX_loop],
[[ \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag \\
[[ \$(DX_DOCDIR]DX_i[)/doxygen_sqlite3.db \\
\$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag \\
]])dnl
[ -r \\
\$(DX_CLEAN_HTML) \\
Expand Down
Loading

0 comments on commit c1f60b6

Please sign in to comment.