diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/Makefile.am | 1 | ||||
-rwxr-xr-x | contrib/get-antlr-3.4 | 4 | ||||
-rwxr-xr-x | contrib/get-authors | 10 | ||||
-rwxr-xr-x | contrib/update-copyright.pl | 30 | ||||
-rwxr-xr-x | contrib/win32-build | 95 |
5 files changed, 121 insertions, 19 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am index 0d7aa65ce..6f977caec 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -14,6 +14,7 @@ EXTRA_DIST = \ build-cudd-2.4.2-with-libtool.sh \ build-cudd-2.5.0-with-libtool.sh \ mac-build \ + win32-build \ run-script-smtcomp2012 \ theoryskel/kinds \ theoryskel/Makefile \ diff --git a/contrib/get-antlr-3.4 b/contrib/get-antlr-3.4 index 7928690fa..49b0b54a7 100755 --- a/contrib/get-antlr-3.4 +++ b/contrib/get-antlr-3.4 @@ -49,10 +49,10 @@ cd libantlr3c-3.4 if [ ${MACHINE_TYPE} == 'x86_64' ]; then # 64-bit stuff here - ./configure --enable-64bit --disable-antlrdebug --prefix=`pwd`/../.. + ./configure --enable-64bit --disable-shared --disable-antlrdebug --prefix=`pwd`/../.. $ANTLR_CONFIGURE_ARGS else # 32-bit stuff here - ./configure --disable-antlrdebug --prefix=`pwd`/../.. + ./configure --disable-shared --disable-antlrdebug --prefix=`pwd`/../.. $ANTLR_CONFIGURE_ARGS fi cp Makefile Makefile.orig diff --git a/contrib/get-authors b/contrib/get-authors index ef6abff8e..118ca4466 100755 --- a/contrib/get-authors +++ b/contrib/get-authors @@ -2,13 +2,15 @@ # # get-authors # Morgan Deters <mdeters@cs.nyu.edu> for CVC4 -# Copyright (c) 2009, 2010, 2011 The CVC4 Project +# Copyright (c) 2009-2013 The CVC4 Project # # usage: get-authors [ files... ] # -# This script uses svn to get the original author +# This script uses git to get the original author # +gituser="`git config user.name` <`git config user.email`>" + while [ $# -gt 0 ]; do f=$1 shift @@ -16,8 +18,8 @@ while [ $# -gt 0 ]; do major_contributors= minor_contributors= total_lines=`wc -l "$f" | awk '{print$1}'` - original_author=`svn log -q --incremental "$f" | tail -1 | awk '{print$3}'` - svn blame "$f" | awk '{print$2}' | sort | uniq -c | sort -n | + original_author=`git log --pretty="format:%aN <%aE>" "$f" | tail -1` + git blame --incremental "$f" | gawk '/^[0-9a-f]+ [0-9]+ [0-9]+ [0-9]+$/ {nl=$4;} /^author / {$1=""; author=$0;} /^author-mail / {mail=$2} /^filename / {while(nl--) {print author,mail}}' | sed "s,Not Committed Yet <not.committed.yet>,$gituser," | sort | uniq -c | sort -n | ( while read lines author; do pct=$((100*$lines/$total_lines)) if [ "$author" != "$original_author" ]; then diff --git a/contrib/update-copyright.pl b/contrib/update-copyright.pl index 8ac920bbf..4811a4bbe 100755 --- a/contrib/update-copyright.pl +++ b/contrib/update-copyright.pl @@ -2,7 +2,7 @@ # # update-copyright.pl # Morgan Deters <mdeters@cs.nyu.edu> for CVC4 -# Copyright (c) 2009-2012 The CVC4 Project +# Copyright (c) 2009-2013 The CVC4 Project # # usage: update-copyright [-m] [files/directories...] # update-copyright [-h | --help] @@ -16,15 +16,17 @@ # the CVC4 source tree, that means src/ in the CVC4 source tree. # # If -m is specified as the first argument, all files and directories -# are scanned, but only ones modifed in the current working directory -# are modified (i.e., those that have status M in "svn status"). +# are scanned, but only ones modified in the index or working tree +# are modified (i.e., those that have at least one status M in +# "git status -s"). # # It ignores any file/directory not starting with [a-zA-Z] -# (so, this includes . and .., vi swaps, .svn meta-info, +# (so, this includes . and .., vi swaps, .git meta-info, # .deps, etc.) # # It ignores any file not ending with one of: # .c .cc .cpp .C .h .hh .hpp .H .y .yy .ypp .Y .l .ll .lpp .L .g +# [ or those with ".in" also suffixed, e.g., .cpp.in ] # (so, this includes emacs ~-backups, CVS detritus, etc.) # # It ignores any directory matching $excluded_directories @@ -37,17 +39,17 @@ my $excluded_paths = '^(src/parser/antlr_input_imports.cpp|src/bindings/compat/. # Years of copyright for the template. E.g., the string # "1985, 1987, 1992, 1997, 2008" or "2006-2009" or whatever. -my $years = '2009-2012'; +my $years = '2009-2013'; my $standard_template = <<EOF; - ** This file is part of the CVC4 prototype. + ** This file is part of the CVC4 project. ** Copyright (c) $years New York University and The University of Iowa ** See the file COPYING in the top-level source directory for licensing ** information.\\endverbatim EOF my $public_template = <<EOF; - ** This file is part of the CVC4 prototype. + ** This file is part of the CVC4 project. ** Copyright (c) $years New York University and The University of Iowa ** See the file COPYING in the top-level source directory for licensing ** information.\\endverbatim @@ -71,7 +73,7 @@ if($#ARGV >= 0 && $ARGV[0] eq '-h' || $ARGV[0] eq '--help') { exit; } -# whether we ONLY process files with svn status "M" +# whether we ONLY process files with git status "M" my $modonly = 0; if($#ARGV >= 0 && $ARGV[0] eq '-m') { @@ -87,11 +89,12 @@ if($#ARGV == -1) { print <<EOF; Warning: this script is dangerous. It will overwrite the header comments in your source files to match the template in the script, attempting to retain file-specific -comments, but this isn't guaranteed. You should run this in an svn working directory -and run "svn diff" after to ensure everything was correctly rewritten. +comments, but this isn't guaranteed. You should run this in a git working tree +and run "git diff" after to ensure everything was correctly rewritten. The directories in which to search for and change sources is: $pwd/src + $pwd/examples $pwd/test Continue? y or n: @@ -101,7 +104,8 @@ EOF die 'aborting operation' if !( $_ eq 'y' || $_ eq 'yes' || $_ eq 'Y' || $_ eq 'YES' ); $searchdirs[0] = 'src'; - $searchdirs[1] = 'test'; + $searchdirs[1] = 'examples'; + $searchdirs[2] = 'test'; } else { @searchdirs = @ARGV; } @@ -129,9 +133,9 @@ while($#searchdirs >= 0) { sub handleFile { my ($srcdir, $file) = @_; - return if !($file =~ /\.(c|cc|cpp|C|h|hh|hpp|H|y|yy|ypp|Y|l|ll|lpp|L|g|java)$/); + return if !($file =~ /\.(c|cc|cpp|C|h|hh|hpp|H|y|yy|ypp|Y|l|ll|lpp|L|g|java)(\.in)?$/); return if ($srcdir.'/'.$file) =~ /$excluded_paths/; - return if $modonly &&`svn status "$srcdir/$file" 2>/dev/null` !~ /^M/; + return if $modonly && `git status -s "$srcdir/$file" 2>/dev/null` !~ /^(M|.M)/; print "$srcdir/$file..."; my $infile = $srcdir.'/'.$file; my $outfile = $srcdir.'/#'.$file.'.tmp'; diff --git a/contrib/win32-build b/contrib/win32-build new file mode 100755 index 000000000..65e6dd67c --- /dev/null +++ b/contrib/win32-build @@ -0,0 +1,95 @@ +#!/bin/bash +# +# win32-build script +# Morgan Deters <mdeters@cs.nyu.edu> +# Tue, 15 Jan 2013 11:11:24 -0500 +# + +if [ -z "$HOST" ]; then + HOST=i586-mingw32msvc + echo "WARNING:" + echo "WARNING: Using default HOST value: $HOST" + echo "WARNING: You should probably run this script like this:" + echo "WARNING:" + echo "WARNING: HOST=i586-mingw32msvc win32-build" + echo "WARNING:" + echo "WARNING: (replacing the i586-mingw32msvc with your build host)" + echo "WARNING: to ensure the script builds correctly." + echo "WARNING:" +fi + +GMPVERSION=5.1.0 + +if [ $# -ne 0 ]; then + echo "usage: `basename $0`" >&2 + echo >&2 + echo "This script attempts to build CVC4 for Win32 using mingw." >&2 + exit 1 +fi + +function reporterror { + echo + echo ============================================================================= + echo + echo "There was an error setting up the prerequisites. Look above for details." + echo + exit 1 +} + +function webget { + if which wget &>/dev/null; then + wget -c -O "$2" "$1" + elif which curl &>/dev/null; then + curl "$1" >"$2" + else + echo "Can't figure out how to download from web. Please install wget or curl." >&2 + exit 1 + fi +} + +for dir in antlr-3.4 gmp-$GMPVERSION boost-include; do + if [ -e "$dir" ]; then + echo "error: $dir directory exists; please move it out of the way." >&2 + exit 1 + fi +done + +echo ============================================================================= +echo +echo "Setting up ANTLR 3.4..." +echo +MACHINE_TYPE=x86 ANTLR_CONFIGURE_ARGS=--host=$HOST contrib/get-antlr-3.4 | grep -v 'Now configure CVC4 with' | grep -v '\./configure --with-antlr-dir=' +[ ${PIPESTATUS[0]} -eq 0 ] || reporterror +echo +echo ============================================================================= +echo +echo "Setting up GMP $GMPVERSION..." +echo +( set -ex + mkdir gmp-$GMPVERSION + cd gmp-$GMPVERSION + gmpprefix=`pwd` && + mkdir src && + cd src && + webget ftp://ftp.gmplib.org/pub/gmp-$GMPVERSION/gmp-$GMPVERSION.tar.bz2 gmp-$GMPVERSION.tar.bz2 && + tar xfj gmp-$GMPVERSION.tar.bz2 && + cd gmp-$GMPVERSION && + ./configure --host=$HOST --prefix="$gmpprefix" --enable-cxx && + make && + make install +) || exit 1 +echo +echo ============================================================================= +echo +echo "Setting up BOOST includes..." +echo +( mkdir boost-include && + ln -sv /usr/include/boost boost-include/boost ) || exit 1 +echo +echo ============================================================================= +echo +echo 'Now just run:' +echo " ./configure --host=$HOST LDFLAGS=\"-L`pwd`/gmp-$GMPVERSION/lib -L`pwd`/antlr-3.4/lib\" CPPFLAGS=\"-I`pwd`/gmp-$GMPVERSION/include -I`pwd`/antlr-3.4/include -I`pwd`/boost-include\" ANTLR_HOME=\"`pwd`/antlr-3.4\"" +echo ' make' +echo +echo ============================================================================= |