build: Remove unused release scripts for talloc
authorAndrew Bartlett <abartlet@samba.org>
Mon, 28 May 2012 02:15:05 +0000 (12:15 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 30 May 2012 02:15:11 +0000 (04:15 +0200)
These now use waf dist, and the script/librelease.sh script as a wrapper.

The mksyms.sh call in the source3/Makefile uses the copy in source3/script

Andrew Bartlett

lib/talloc/script/abi_checks.sh [deleted file]
lib/talloc/script/abi_checks_gcc.sh [deleted file]
lib/talloc/script/mksigs.pl [deleted file]
lib/talloc/script/mksyms.awk [deleted file]
lib/talloc/script/mksyms.sh [deleted file]
lib/talloc/script/release-script.sh [deleted file]

diff --git a/lib/talloc/script/abi_checks.sh b/lib/talloc/script/abi_checks.sh
deleted file mode 100755 (executable)
index 66c4e60..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/sh
-
-#
-# abi_checks.sh - check for possible abi changes
-#
-# Copyright (C) 2009 Michael Adam <obnox@samba.org>
-#
-# 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/>.
-#
-
-#
-# USAGE: abi_checks.sh LIBNAME header1 [header2 ...]
-#
-# This script creates symbol and signature lists from the provided header
-# files with the aid of the mksyms.sh and mksigs.pl scripts (saved as
-# $LIBNAME.exports.check and $LIBNAME.sigatures.check). It then compares
-# the resulting files with the files $LIBNAME.exports and $LIBNME.signatures
-# which it expects to find in the current directory.
-#
-
-LANG=C; export LANG
-LC_ALL=C; export LC_ALL
-LC_COLLATE=C; export LC_COLLATE
-
-exit_status=0
-script=$0
-dir_name=$(dirname ${script})
-
-if test x"$1" = "x" ; then
-       echo "USAGE: ${script} libname header [header ...]"
-       exit 1
-fi
-
-libname="$1"
-shift
-
-if test x"$1" = "x" ; then
-       echo "USAGE: ${script} libname header [header ...]"
-       exit 1
-fi
-
-headers="$*"
-
-exports_file=${libname}.exports
-exports_file_check=${exports_file}.check
-signatures_file=${libname}.signatures
-signatures_file_check=${signatures_file}.check
-
-
-${dir_name}/mksyms.sh awk ${exports_file_check} ${headers} 2>&1 > /dev/null
-cat ${headers} | ${dir_name}/mksigs.pl | sort| uniq > ${signatures_file_check} 2> /dev/null
-
-diff -u ${exports_file} ${exports_file_check}
-if test "x$?" != "x0" ; then
-       echo "WARNING: possible ABI change detected in exports!"
-       let exit_status++
-else
-       echo "exports check: OK"
-fi
-
-diff -u ${signatures_file} ${signatures_file_check}
-if test "x$?" != "x0" ; then
-       echo "WARNING: possible ABI change detected in signatures!"
-       let exit_status++
-else
-       echo "signatures check: OK"
-fi
-
-exit $exit_status
diff --git a/lib/talloc/script/abi_checks_gcc.sh b/lib/talloc/script/abi_checks_gcc.sh
deleted file mode 100755 (executable)
index e3d3b04..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-
-make clean
-
-mkdir abi
-ABI_CHECKS="-aux-info abi/\$@.X"
-make ABI_CHECK="$ABI_CHECKS" CC="/usr/bin/gcc"
-
-for i in abi/*.X; do cat $i | grep 'talloc\.h'; done | sort | uniq | awk -F "extern " '{ print $2 }' | sort > abi/signatures
-
-cat > abi/exports << EOF
-{
-    global:
-EOF
-cat abi/signatures | awk -F '(' '{ print $1 }' | awk -F ' ' '{ print "           "$NF";" }' | tr -d '*' | sort >> abi/exports
-# need to manually add talloc free for backward ABI compat
-echo '           talloc_free;' >> abi/exports
-cat >> abi/exports << EOF
-
-    local: *;
-};
-EOF
-
-rm -fr abi/*.X
-
-diff -u talloc.signatures abi/signatures
-if [ "$?" != "0" ]; then
-    echo "WARNING: Possible ABI Change!!"
-fi
-
-diff -u talloc.exports abi/exports
-if [ "$?" != "0" ]; then
-    echo "WARNING: Export file may be outdated!!"
-fi
diff --git a/lib/talloc/script/mksigs.pl b/lib/talloc/script/mksigs.pl
deleted file mode 100755 (executable)
index dfe36bc..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-#!/usr/bin/perl
-
-# mksigs.pl - extract signatures from C headers
-#
-# Copyright (C) Michael Adam 2009
-#
-# 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/>.
-
-# USAGE:  cat $header_files | mksigs.pl > $signature_file
-#
-# The header files to parse are read from stdin.
-# The output is in a form as produced by gcc with the -aux-info switch
-# and printed to stdout.
-
-use strict;
-use warnings;
-
-my $in_comment = 0;
-my $in_doxygen = 0;
-my $extern_C_block = 0;
-
-while (my $LINE = <>) {
-       # find end of started multi-line-comment
-       if ($in_comment) {
-               if ($LINE =~ /^.*?\*\/(.*)$/) {
-                       $LINE = $1;
-                       $in_comment = 0;
-               } else {
-                       # whole line within comment
-                       next;
-               }
-       }
-
-       # find end of DOXYGEN section
-       if ($in_doxygen) {
-               if ($LINE =~ /^#\s*else(?:\s+.*)?$/) {
-                       $in_doxygen = 0;
-               }
-               next;
-       }
-
-       # strip C++-style comments
-       $LINE =~ s/^(.*?)\/\/.*$/$1/;
-
-       # strip in-line-comments:
-       while ($LINE =~ /\/\*.*?\*\//) {
-               $LINE =~ s/\/\*.*?\*\///;
-       }
-
-       # find starts of multi-line-comments
-       if ($LINE =~ /^(.*)\/\*/) {
-               $in_comment = 1;
-               $LINE = $1;
-       }
-
-       # skip empty lines
-       next if $LINE =~ /^\s*$/;
-
-       # remove leading spaces
-       $LINE =~ s/^\s*(.*)$/$1/;
-
-       # concatenate lines split with "\" (usually macro defines)
-       while ($LINE =~ /^(.*?)\s+\\$/) {
-               my $LINE2 = <>;
-               $LINE = $1;
-               $LINE2 =~ s/^\s*(.*)$/$1/;
-               $LINE .= " " . $LINE2;
-       }
-
-        # remove DOXYGEN sections
-       if ($LINE =~ /^#\s*ifdef\s+DOXYGEN(?:\s+.*)?$/) {
-               $in_doxygen = 1;
-                next;
-       }
-
-
-       # remove all preprocessor directives
-       next if ($LINE =~ /^#/);
-
-       if ($LINE =~ /^extern\s+"C"\s+\{/) {
-               $extern_C_block = 1;
-               next;
-       }
-
-       if (($LINE =~ /^[^\{]*\}/) and $extern_C_block) {
-               $extern_C_block = 0;
-               next;
-       }
-
-       $LINE =~ s/^extern\s//;
-
-       # concatenate braces stretched over multiple lines
-       # (from structs or enums)
-       my $REST = $LINE;
-       my $braces = 0;
-       while (($REST =~ /[\{\}]/) or ($braces)) {
-               while ($REST =~ /[\{\}]/) {
-                       # collect opening
-                       while ($REST =~ /^[^\{\}]*\{(.*)$/) {
-                               $braces++;
-                               $REST = $1;
-                       }
-
-                       # collect closing
-                       while ($REST =~ /^[^\{\}]*\}(.*)$/) {
-                               $braces--;
-                               $REST = $1;
-                       }
-               }
-
-               # concatenate if not balanced
-               if ($braces) {
-                       if (my $LINE2 = <>) {
-                               $LINE2 =~ s/^\s*(.*)$/$1/;
-                               chomp($LINE);
-                               $LINE .= " " . $LINE2;
-                               chomp $REST;
-                               $REST .= " " . $LINE2;
-                       } else {
-                               print "ERROR: unbalanced braces ($braces)\n";
-                               last;
-                       }
-               }
-       }
-
-       # concetenate function prototypes that stretch over multiple lines
-       $REST = $LINE;
-       my $parenthesis = 0;
-       while (($REST =~ /[\(\)]/) or ($parenthesis)) {
-               while ($REST =~ /[\(\)]/) {
-                       # collect opening
-                       while ($REST =~ /^[^\(\)]*\((.*)$/) {
-                               $parenthesis++;
-                               $REST = $1;
-                       }
-
-                       # collect closing
-                       while ($REST =~ /^[^\(\)]*\)(.*)$/) {
-                               $parenthesis--;
-                               $REST = $1;
-                       }
-               }
-
-               # concatenate if not balanced
-               if ($parenthesis) {
-                       if (my $LINE2 = <>) {
-                               $LINE2 =~ s/^\s*(.*)$/$1/;
-                               chomp($LINE);
-                               $LINE .= " " . $LINE2;
-                               chomp($REST);
-                               $REST .= " " . $LINE2;
-                       } else {
-                               print "ERROR: unbalanced parantheses ($parenthesis)\n";
-                               last;
-                       }
-               }
-       }
-
-       next if ($LINE =~ /^typedef\s/);
-       next if ($LINE =~ /^enum\s+[^\{\(]+\s+\{/);
-       next if ($LINE =~ /^struct\s+[^\{\(]+\s+\{.*\}\s*;/);
-       next if ($LINE =~ /^struct\s+[a-zA-Z0-9_]+\s*;/);
-
-       # remove trailing spaces
-       $LINE =~ s/(.*?)\s*$/$1/;
-
-       $LINE =~ s/^(.*\))\s+PRINTF_ATTRIBUTE\([^\)]*\)(\s*[;,])/$1$2/;
-       $LINE =~ s/^(.*\))\s*[a-zA-Z0-9_]+\s*;$/$1;/;
-
-       # remove parameter names - slightly too coarse probably
-       $LINE =~ s/([\s\(]\*?)[_0-9a-zA-Z]+\s*([,\)])/$1$2/g;
-
-       # remedy (void) from last line
-       $LINE =~ s/\(\)/(void)/g;
-
-       # normalize spaces
-       $LINE =~ s/\s*\)\s*/)/g;
-       $LINE =~ s/\s*\(\s*/ (/g;
-       $LINE =~ s/\s*,\s*/, /g;
-
-       # normalize unsigned
-       $LINE =~ s/([\s,\(])unsigned([,\)])/$1unsigned int$2/g;
-
-       # normalize bool
-       $LINE =~ s/(\b)bool(\b)/_Bool/g;
-
-       print $LINE . "\n";
-}
diff --git a/lib/talloc/script/mksyms.awk b/lib/talloc/script/mksyms.awk
deleted file mode 100644 (file)
index 83497a7..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# mksyms.awk
-#
-# Extract symbols to export from C-header files.
-# output in version-script format for linking shared libraries.
-#
-# Copyright (C) 2008 Micheal Adam <obnox@samba.org>
-#
-BEGIN {
-       inheader=0;
-       indoxygen=0;
-}
-
-END {
-}
-
-{
-       if (inheader) {
-               if (match($0,"[)][^()]*[;][ \t]*$")) {
-                       inheader = 0;
-               }
-               next;
-       }
-       if (indoxygen) {
-               if (match($0,"^#[ \t]*else[ \t]*.*$")) {
-                       indoxygen = 0;
-               }
-               next;
-       }
-}
-
-/^static/ || /^[ \t]*typedef/ || !/^[a-zA-Z\_\#]/ {
-       next;
-}
-
-/^extern[ \t]+[^()]+[;][ \t]*$/ {
-       gsub(/[^ \t]+[ \t]+/, "");
-       sub(/[;][ \t]*$/, "");
-       printf "           %s;\n", $0;
-       next;
-}
-
-/^#[ \t]*ifdef[ \t]*DOXYGEN[ \t]*.*$/ {
-       indoxygen=1;
-       next;
-}
-
-# look for function headers:
-{
-       gotstart = 0;
-       if ($0 ~ /^[A-Za-z_][A-Za-z0-9_]+/) {
-               gotstart = 1;
-       }
-       if(!gotstart) {
-               next;
-       }
-}
-
-/[_A-Za-z0-9]+[ \t]*[(].*[)][^()]*;[ \t]*$/ {
-       sub(/[(].*$/, "");
-       gsub(/[^ \t]+[ \t]+/, "");
-       gsub(/^[*]+/, "");
-       printf "           %s;\n",$0;
-       next;
-}
-
-/[_A-Za-z0-9]+[ \t]*[(]/ {
-       inheader=1;
-       sub(/[(].*$/, "");
-       gsub(/[^ \t]+[ \t]+/, "");
-       gsub(/^[*]/, "");
-       printf "           %s;\n",$0;
-       next;
-}
-
diff --git a/lib/talloc/script/mksyms.sh b/lib/talloc/script/mksyms.sh
deleted file mode 100755 (executable)
index 089344f..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#! /bin/sh
-
-#
-# mksyms.sh
-#
-# Extract symbols to export from C-header files.
-# output in version-script format for linking shared libraries.
-#
-# This is the shell wrapper for the mksyms.awk core script.
-#
-# Copyright (C) 2008 Micheal Adam <obnox@samba.org>
-#
-
-LANG=C; export LANG
-LC_ALL=C; export LC_ALL
-LC_COLLATE=C; export LC_COLLATE
-
-if [ $# -lt 2 ]
-then
-  echo "Usage: $0 awk output_file header_files"
-  exit 1
-fi
-
-awk="$1"
-shift
-
-symsfile="$1"
-shift
-symsfile_tmp="$symsfile.$$.tmp~"
-
-proto_src="`echo $@ | tr ' ' '\n' | sort | uniq `"
-
-echo creating $symsfile
-
-mkdir -p `dirname $symsfile`
-
-#Write header
-cat > $symsfile_tmp << EOF
-# This file is autogenerated, please DO NOT EDIT
-{
-    global:
-EOF
-
-#loop on each header
-for i in $proto_src; do
-${awk} -f `dirname $0`/mksyms.awk $i | sort >> $symsfile_tmp
-done;
-
-#Write tail
-cat >> $symsfile_tmp << EOF
-
-    local: *;
-};
-EOF
-
-if cmp -s $symsfile $symsfile_tmp 2>/dev/null
-then
-  echo "$symsfile unchanged"
-  rm $symsfile_tmp
-else
-  mv $symsfile_tmp $symsfile
-fi
diff --git a/lib/talloc/script/release-script.sh b/lib/talloc/script/release-script.sh
deleted file mode 100755 (executable)
index 4b8aac7..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-
-LNAME=talloc
-LINCLUDE=talloc.h
-
-if [ "$1" = "" ]; then
-    echo "Please provide version string, eg: 1.2.0"
-    exit 1
-fi
-
-if [ ! -d "lib/${LNAME}" ]; then
-    echo "Run this script from the samba base directory."
-    exit 1
-fi
-
-curbranch=`git branch |grep "^*" | tr -d "* "`
-
-version=$1
-strver=`echo ${version} | tr "." "-"`
-
-# Checkout the release tag
-git branch -f ${LNAME}-release-script-${strver} ${LNAME}-${strver}
-if [ ! "$?" = "0" ];  then
-    echo "Unable to checkout ${LNAME}-${strver} release"
-    exit 1
-fi
-
-function cleanquit {
-    #Clean up
-    git checkout $curbranch
-    git branch -d ${LNAME}-release-script-${strver}
-    exit $1
-}
-
-# NOTE: use cleanquit after this point
-git checkout ${LNAME}-release-script-${strver}
-
-# Test configure agrees with us
-confver=`grep "^AC_INIT" lib/${LNAME}/configure.ac | tr -d "AC_INIT(${LNAME}, " | tr -d ")"`
-if [ ! "$confver" = "$version" ]; then
-    echo "Wrong version, requested release for ${version}, found ${confver}"
-    cleanquit 1
-fi
-
-# Check exports and signatures are up to date
-pushd lib/${LNAME}
-./script/abi_checks.sh ${LNAME} ${LINCLUDE}
-abicheck=$?
-popd
-if [ ! "$abicheck" = "0" ]; then
-    echo "ERROR: ABI Checks produced warnings!"
-    cleanquit 1
-fi
-
-git clean -f -x -d lib/${LNAME}
-git clean -f -x -d lib/replace
-
-# Now build tarball
-cp -a lib/${LNAME} ${LNAME}-${version}
-cp -a lib/replace ${LNAME}-${version}/libreplace
-pushd ${LNAME}-${version}
-./autogen.sh
-popd
-tar cvzf ${LNAME}-${version}.tar.gz ${LNAME}-${version}
-rm -fr ${LNAME}-${version}
-
-cleanquit 0
-