#!/bin/sh # ------------------------------------------------------------------------- # $Id$ # # ace-diff-config script - use to compare ACE macro definitions in # ACE configuration headers # # ------------------------------------------------------------------------- # Copyright (C) 1998 Ossama Othman # # All Rights Reserved # # This library is free software; you can redistribute it and/or # modify it under the current ACE distribution terms. # # This library 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. # This is a script that can be used to determine differences between two ACE # configuration headers. The file `ACE.ifnames' contains a list of all of the # identifiers used in ACE's preprocessor conditionals (generated with # GNU Autoconf's "ifnames" program). The script will go through the list in # ACE.ifnames and determine if the given macro was defined in only one of the # two headers being headers being compared. # # The C++ pre-processor is used when comparing so that macros from "#included" # headers will also be checked. set -e INCLUDES="@top_srcdir@" CXXCPP="@CXXCPP@ -I. -I$INCLUDES" MACRO_LIST_FILE="ACE.ifnames" RESULTS_FILE=ace-diff-config.results TEST_FILE="ace-diff-config.test.cpp" usage() { cat <> $RESULTS_FILE echo "but not in $2" >> $RESULTS_FILE echo "-------------------------------------------------------" >> $RESULTS_FILE list=`cat $MACRO_LIST_FILE`; for p in $list; do # Provide some output echo -n "." cat > $TEST_FILE </dev/null; then defined=true else defined=false fi # now check if it is defined in header #2 if test $defined = true; then cat > $TEST_FILE </dev/null; then defined=true else defined=false fi # if "defined" is false then, the first header is the only header that # defines the macro. if test $defined = false; then echo $p >> $RESULTS_FILE fi fi done # Process the second header echo "" echo -n "Processing $2 " echo "" >> $RESULTS_FILE echo "Macros that are defined in $2" >> $RESULTS_FILE echo "but not in $1" >> $RESULTS_FILE echo "-------------------------------------------------------" >> $RESULTS_FILE list=`cat $MACRO_LIST_FILE`; for p in $list; do # Provide some output echo -n "." cat > $TEST_FILE </dev/null; then defined=true else defined=false fi # now check if it is defined in header #1 if test $defined = true; then cat > $TEST_FILE </dev/null; then defined=true else defined=false fi # if "defined" is false then, the second header is the only header that # defines the macro. if test $defined = false; then echo $p >> $RESULTS_FILE fi fi done rm $TEST_FILE echo "" echo "Results are in $RESULTS_FILE." echo ""