Skip to content

Commit

Permalink
Initial GitHub commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
gvansickle committed Aug 31, 2015
0 parents commit 842b88e
Show file tree
Hide file tree
Showing 29 changed files with 2,829 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build
autom4te.cache
/build-aux/ar-lib
/build-aux/compile
/build-aux/config.guess
/build-aux/config.sub
/build-aux/depcomp
/build-aux/install-sh
/build-aux/missing
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Gary R. Van Sickle (grvs@users.sourceforge.net)
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

Empty file added ChangeLog
Empty file.
370 changes: 370 additions & 0 deletions INSTALL

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Top-level Makefile.am for UniversalCodeGrep
#
# Copyright 2015 Gary R. Van Sickle (grvs@users.sourceforge.net).
#
# This file is part of UniversalCodeGrep.
#
# UniversalCodeGrep is free software: you can redistribute it and/or modify it under the
# terms of version 3 of the GNU General Public License as published by the Free
# Software Foundation.
#
# UniversalCodeGrep is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# UniversalCodeGrep. If not, see <http://www.gnu.org/licenses/>.

# Make sure autotools pick up the M4 macros in the ./m4 directory, and also copy
# any third-party macros (e.g. the system-wide ax_* Autoconf Macro Archive ones
# in /usr/share/aclocal) to ./m4 so they get distributed and automatically updated.
# Only useful in the top-level Makefile.am (see http://sources.redhat.com/automake/automake.html#Rebuilding).
ACLOCAL_AMFLAGS = -I m4 --install

# The subdirectories containing the source code, docs, and tests.
# Note: The code in src depends on the libraries in third_party, so make sure the latter is always listed before the former.
# Note that we can't list these other libraries in e.g. *_DEPENDENCIES because that replaces all Automake-generated dependencies.
SUBDIRS = third_party src

# The Automake rules for the ucg executable.
bin_PROGRAMS=ucg
ucg_SOURCES=main.cpp

# Collect all the Boost libraries we need into a single variable.
BOOST_LOCAL_LIB = $(top_builddir)/third_party/$(BOOST_TARBALL_DIRNAME)/stage/lib
ALLBOOSTLIBS = $(BOOST_LOCAL_LIB)/libboost_thread.a \
$(BOOST_LOCAL_LIB)/libboost_system.a

ucg_CPPFLAGS = -I $(top_srcdir)/src \
$(BOOST_TR1_CPPFLAGS) $(BOOST_CPPFLAGS) \
$(AM_CPPFLAGS)
ucg_CFLAGS = $(AM_CFLAGS)
ucg_CXXFLAGS = $(AM_CXXFLAGS)
ucg_LDFLAGS = $(BOOST_LIBTOOL_FLAGS) $(BOOST_LDFLAGS) \
$(AM_LDFLAGS)
ucg_LDADD = ./src/libsrc.a $(ALLBOOSTLIBS)
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NEWS file for UniversalCodeGrep project.

- No news yet.
2 changes: 2 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
README file for UniversalCodeGrep project.

156 changes: 156 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# configure.ac for UniversalCodeGrep
#
# Copyright 2015 Gary R. Van Sickle (grvs@users.sourceforge.net).
#
# This file is part of UniversalCodeGrep.
#
# UniversalCodeGrep is free software: you can redistribute it and/or modify it under the
# terms of version 3 of the GNU General Public License as published by the Free
# Software Foundation.
#
# UniversalCodeGrep is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# UniversalCodeGrep. If not, see <http://www.gnu.org/licenses/>.

dnl Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([UniversalCodeGrep], [0.1], [BUG-REPORT-ADDRESS],,[http://????.sourceforge.net/])

AC_CONFIG_SRCDIR([src/Globber.cpp])
AC_CONFIG_HEADERS([config.h])
AC_COPYRIGHT([Copyright (C) 2015 Gary R. Van Sickle])

# Use the auxilliary build tools (e.g. install-sh, config.sub, etc.) in ./build-aux.
AC_CONFIG_AUX_DIR([build-aux])

# Additional Autoconf macros are in ./m4.
AC_CONFIG_MACRO_DIR([m4])

# Clear the "user defaults" for compiler optimization and debug flags. This doesn't override any configure-time or make-time settings the
# builder may specifiy for these variables, it just makes the values empty if they're not specified at configure- or make-time.
# Otherwise, Autoconf's AC_PROG_CXX et al macros assume the builder wants to compile everything "-g -O2" by default, which overrides
# any AM_C*FLAGS.
# This otherwise-frowned-upon touching of these user variables is sanctioned by the Autoconf manual for this purpose.
# See the discussion of AC_PROG_CC in http://www.gnu.org/software/autoconf/manual/autoconf.html#C-Compiler, which reads:
# "If your package does not like this default, then it is acceptable to insert the line ': ${CFLAGS=""}' after AC_INIT and before AC_PROG_CC
# to select an empty default instead."
: ${CPPFLAGS=""} # Use an empty default.
: ${CFLAGS=""} # Don't default to "-g -O2".
: ${CXXFLAGS=""} # Don't default to "-g -O2".

AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([
subdir-objects
color-tests
std-options
-Wall
-Werror
])

# Determine how many CPUs we have on the build machine.
# We use this for building Boost in parallel with multiple jobs.
AX_COUNT_CPUS
AC_SUBST([CPU_COUNT])

###
### Manual configure options.
###

# Set up the maintainer compiler flags.
# Increase the default GCC warning level.
AC_SUBST([AM_CPPFLAGS], ["-Wall -Wextra"])
# By default, compile C and C++ with the maximum possible debugging info and least optimization for maximum debugability.
AC_SUBST([AM_CFLAGS], ["-ggdb3 -O0"])
# -Wold-style-cast
AC_SUBST([AM_CXXFLAGS], ["-ggdb3 -O3"])

AC_LANG_PUSH([C++])
# Require at least some level of C++11 support.
# This is currently known to do what we need for at least gcc 4.7.3, which has the
# support listed here: http://gcc.gnu.org/gcc-4.7/cxx0x_status.html
AX_CXX_COMPILE_STDCXX_11([], [mandatory])
# Check if the C++ compiler supports some flags we'd like to set.
# Append them to AM_CXXFLAGS if it does.
#AX_APPEND_COMPILE_FLAGS([-fno-pretty-templates],[AM_CXXFLAGS])
# Use "permissive" to work around some template issues in GraphAdapter.h with later GCCs (e.g. 4.7.1).
AX_APPEND_COMPILE_FLAGS([-fpermissive], [AM_CXXFLAGS])
# Boost generates a ton of these warnings.
AX_APPEND_COMPILE_FLAGS([-Wno-unused-local-typedefs], [AM_CXXFLAGS])
AX_APPEND_COMPILE_FLAGS([-pthread], [AM_CXXFLAGS])
AC_LANG_POP([C++])



###
### Checks for the programs
###

## Checks for the programs needed to do a build.
AC_PROG_CC
# This is required instead of AC_PROG_CC_C_O by automake's "subdir-objects" option.
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_RANLIB
# @note The following line is to work around an arguable bug in Autoconf 1.12/Libtool.
# (q.v. http://lists.gnu.org/archive/html/automake/2012-05/msg00014.html).
# Probably remove this when/if that is fixed.
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_SED

## Checks for maintainer tools.

# Autotest needs autom4te, or 'missing's stub for it.
AM_MISSING_PROG([AUTOM4TE], [autom4te])

###
### Checks for libraries
###

# The Boost source distribution's tarball.
# If the user doesn't already have a suitable Boost installation, we'll do something similar to what we do
# for DParser, and build it from the source tarball and link to it statically.
# The reason here though is more complex:
# 1. Boost (at least as of 1.48.0) wants to install into the wrong /lib directory on some systems, notably some x86_64 systems.
# 2. Neither of the Autoconf macro packages for detecting Boost that I've tried works completely correctly when
# more than one Boost installation is on a system, e.g. one in /usr/lib and one in /usr/local/lib. E.g., if an
# old copy is in /usr/include & /usr/lib and a suitable copy is in /usr/local/include and /usr/local/lib, both
# will by default find the correct paths, but ultimately make the program try to link with the libs in /usr/lib
# even though it's correctly using the headers in /usr/local/include.
GRVS_ARG_WITH_FILE([FILE_PATH_BOOST_SOURCE_TARBALL], [boost-tarball], [boost source distribution tarball],
[],[AC_MSG_WARN([No Boost source tarball specified.])])

# The list of Boost libraries we need, in a form that Boost's bootstrap.sh can understand.
AC_SUBST([REQUIRED_BOOST_LIBS],[system,thread])
# Extract the "boost_1_xx_x" part of the filename.
BOOST_TARBALL_DIRNAME=$(echo "${FILE_PATH_BOOST_SOURCE_TARBALL}" | grep -o 'boost_._.._.')
BOOST_TARBALL_TARBZ2=$(basename "${FILE_PATH_BOOST_SOURCE_TARBALL}")
BOOST_TARBALL_TAR=$(basename "${BOOST_TARBALL_TARBZ2}" .bz2)
AC_SUBST([BOOST_TARBALL_DIRNAME])
AC_SUBST([BOOST_TARBALL_TARBZ2])
AC_SUBST([BOOST_TARBALL_TAR])


# A path to a boost source tarball must be specified.
# Populate the necessary variables.
AC_SUBST([BOOST_CPPFLAGS],['-I "$(top_builddir)/third_party/$(BOOST_TARBALL_DIRNAME)"'])
AM_CPPFLAGS="$AM_CPPFLAGS $BOOST_CPPFLAGS"
AC_SUBST([BOOST_LDFLAGS],[""])
AC_SUBST([BOOST_LIBTOOL_FLAGS],[""])

###
### Checks for some library functions we need.
###
AC_SEARCH_LIBS([argp_parse],[argp])

###
### Create the Makefiles for the program.
###
AC_CONFIG_FILES([Makefile
src/Makefile
third_party/Makefile])
AC_OUTPUT

65 changes: 65 additions & 0 deletions m4/ax_append_compile_flags.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS])
#
# DESCRIPTION
#
# For every FLAG1, FLAG2 it is checked whether the compiler works with the
# flag. If it does, the flag is added FLAGS-VARIABLE
#
# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
# CFLAGS) is used. During the check the flag is always added to the
# current language's flags.
#
# If EXTRA-FLAGS is defined, it is added to the current language's default
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# NOTE: This macro depends on the AX_APPEND_FLAG and
# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
# AX_APPEND_LINK_FLAGS.
#
# LICENSE
#
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

#serial 3

AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
[AC_REQUIRE([AX_CHECK_COMPILE_FLAG])
AC_REQUIRE([AX_APPEND_FLAG])
for flag in $1; do
AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3])
done
])dnl AX_APPEND_COMPILE_FLAGS
69 changes: 69 additions & 0 deletions m4/ax_append_flag.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
#
# DESCRIPTION
#
# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
# added in between.
#
# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
# FLAG.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

#serial 2

AC_DEFUN([AX_APPEND_FLAG],
[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl
AS_VAR_SET_IF(FLAGS,
[case " AS_VAR_GET(FLAGS) " in
*" $1 "*)
AC_RUN_LOG([: FLAGS already contains $1])
;;
*)
AC_RUN_LOG([: FLAGS="$FLAGS $1"])
AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"])
;;
esac],
[AS_VAR_SET(FLAGS,["$1"])])
AS_VAR_POPDEF([FLAGS])dnl
])dnl AX_APPEND_FLAG
Loading

0 comments on commit 842b88e

Please sign in to comment.