Move packages to trunk root
This commit is contained in:
Executable
+527
@@ -0,0 +1,527 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# autotest_cgal: a script to automagically install and
|
||||
# test internal CGAL releases
|
||||
# $Revision$ $Date$
|
||||
# ----------------------------------------------------
|
||||
# You will need
|
||||
# * GNU wget and ftp
|
||||
# * or alternatively curl
|
||||
#
|
||||
# Furthermore you have to edit .autocgalrc in order to
|
||||
# cutomize it for your environment.
|
||||
# In particular you have to change the BUILHOSTS
|
||||
# variable to contain the names of your hosts and
|
||||
# set the COMPILERS_<hostname> variables to the
|
||||
# os-compilers descriptions on which you want to run
|
||||
# the testsuite.
|
||||
# ----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
|
||||
#sets the umask to 022 & 0777
|
||||
umask 022
|
||||
|
||||
|
||||
WGET="wget"
|
||||
CURL="curl"
|
||||
CURL_OPTS="--remote-name --silent --location-trusted"
|
||||
CGAL_URL="http://cgal.inria.fr/CGAL/Members/Releases"
|
||||
LATEST_LOCATION="${CGAL_URL}/LATEST"
|
||||
TAR="tar"
|
||||
GZIP="gzip"
|
||||
GUNZIP="gunzip"
|
||||
COMPRESSOR="${GZIP}"
|
||||
SENDMAIL="mail"
|
||||
CGAL_TESTER=`whoami`
|
||||
CGAL_TESTER_NAME="${CGAL_TESTER}"
|
||||
CGAL_TESTER_ADDRESS="${CGAL_TESTER}"
|
||||
CONSOLE_OUTPUT="y"
|
||||
CGAL_ROOT=`pwd`
|
||||
FTP_SERVER="ftp-sop.inria.fr"
|
||||
FTP_STORE_DIR="geometrica/Incoming"
|
||||
BUILD_HOSTS="must_be_set_in_.autocgalrc"
|
||||
MAIL_ADDRESS="must_be_set_in_.autocgalrc"
|
||||
MYSHELL="must_be_set_in_.autocgalrc"
|
||||
ACTUAL_DIR=`pwd`
|
||||
FTP="ftp"
|
||||
LOGS_DIR="${CGAL_ROOT}/AUTOTEST_LOGS"
|
||||
RSH="rsh"
|
||||
LOCK_FILE="${CGAL_ROOT}/autotest_cgal.lock"
|
||||
NICE_OPTIONS="-19"
|
||||
|
||||
# Now loading autocgalrc.
|
||||
if [ -f $HOME/.autocgalrc ]; then
|
||||
. $HOME/.autocgalrc
|
||||
else
|
||||
echo "CONFIGURATION FILE .autocgalrc NOT FOUND";
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#
|
||||
# write to logfile
|
||||
#
|
||||
|
||||
# $1 = logfile
|
||||
log()
|
||||
{
|
||||
LOGFILE=${1}
|
||||
shift
|
||||
if [ -n "${CONSOLE_OUTPUT}" ]; then
|
||||
printf "${*} ..."
|
||||
fi
|
||||
printf "\n-------------------------------------------------------\n" \
|
||||
>> ${LOGFILE}
|
||||
printf " ${*} ...\n" \
|
||||
>> ${LOGFILE}
|
||||
printf "\n-------------------------------------------------------\n" \
|
||||
>> ${LOGFILE}
|
||||
}
|
||||
|
||||
# $1 = logfile
|
||||
log_done()
|
||||
{
|
||||
if [ -n "${CONSOLE_OUTPUT}" ]; then
|
||||
printf \
|
||||
" done\n-------------------------------------------------------\n"
|
||||
fi
|
||||
printf "\n-------------------------------------------------------\n" \
|
||||
>> ${1}
|
||||
printf " **DONE**\n" \
|
||||
>> ${1}
|
||||
printf "\n-------------------------------------------------------\n" \
|
||||
>> ${1}
|
||||
}
|
||||
|
||||
#
|
||||
# produce a string containing the actual date/time
|
||||
# (used to identify files)
|
||||
#
|
||||
|
||||
datestr()
|
||||
{
|
||||
date +%d%m%Y%H%M
|
||||
}
|
||||
|
||||
#
|
||||
# function to put result files on the web
|
||||
#
|
||||
|
||||
# $1 = source filename (full path)
|
||||
# $2 = target filename (basename only)
|
||||
put_on_web()
|
||||
{
|
||||
if [ -n "${USE_CURL}" ]; then
|
||||
$CURL --upload-file ${1} --user anonymous:${MAIL_ADDRESS} \
|
||||
ftp://${FTP_SERVER}/${FTP_STORE_DIR}/${2} >> ${ACTUAL_LOGFILE} 2>&1
|
||||
else
|
||||
$FTP -n $FTP_SERVER <<EOF
|
||||
quote USER anonymous
|
||||
quote PASS ${MAIL_ADDRESS}
|
||||
binary
|
||||
put ${1} ${FTP_STORE_DIR}/${2}
|
||||
quit
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
error()
|
||||
{
|
||||
if [ -n "${CONSOLE_OUTPUT}" ]; then
|
||||
printf "\nERROR: ${*}, exiting.\n"
|
||||
fi
|
||||
printf "\nERROR: ${*}, exiting.\n" >> ${ACTUAL_LOGFILE}
|
||||
${COMPRESSOR} -9f ${ACTUAL_LOGFILE}
|
||||
FILENAME="${CGAL_RELEASE_ID}-log`datestr`.gz"
|
||||
mv ${ACTUAL_LOGFILE}.gz ${LOGS_DIR}/${FILENAME}
|
||||
if [ ! "${MAIL_ADDRESS}" = "must_be_set_in_.autocgalrc" ]; then
|
||||
for i in ${MAIL_ADDRESS}; do
|
||||
printf "ERROR\n${LOGS_DIR}/${FILENAME}\n" | \
|
||||
${SENDMAIL} -s "completed autotest" ${i}
|
||||
done
|
||||
fi
|
||||
rm -rf $LOCK_FILE;
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# function to print the value of variable $1
|
||||
#
|
||||
|
||||
value_of()
|
||||
{
|
||||
_value=`eval "printf '$'${1}"`
|
||||
eval "printf \"${_value}\""
|
||||
}
|
||||
|
||||
#
|
||||
# function for executing a command remotely
|
||||
#
|
||||
|
||||
# $1 = HOST
|
||||
# $2 = COMMAND
|
||||
remote_command()
|
||||
{
|
||||
if [ "${1}" = "localhost" ]; then
|
||||
eval $2
|
||||
else
|
||||
printf "** Logging into host ${1} **\n"
|
||||
${RSH} ${1} ${MYSHELL} \"${2}\"
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# function for building the CGAL libs
|
||||
#
|
||||
|
||||
# $1 = HOST
|
||||
build_cgal_libs()
|
||||
{
|
||||
remote_command ${1} \
|
||||
"cd ${CGAL_DIR};
|
||||
${CGAL_DIR}/install_cgal --CGAL_DIR ${CGAL_DIR} --rebuild-all;
|
||||
rm ${OLD_CGAL_DIR};
|
||||
ln -s `basename ${CGAL_DIR}` ${OLD_CGAL_DIR}" \
|
||||
>> ${ACTUAL_LOGFILE} 2>&1
|
||||
}
|
||||
|
||||
#-----------------------------------------------
|
||||
# testsuite script parallel
|
||||
#-----------------------------------------------
|
||||
# $1 = HOST
|
||||
# $2 = COMPILERS
|
||||
run_testsuite()
|
||||
{
|
||||
for i in ${2}; do
|
||||
test_script ${1} ${i}
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# ---------------------------------------------------
|
||||
# test script NEW
|
||||
# create additional directories to test in parallel
|
||||
# on multiple platforms
|
||||
# the variable PROCESSORS_electra, where electra is the
|
||||
# name of the machine, is used to specify the number of
|
||||
# processors to use
|
||||
# ---------------------------------------------------
|
||||
# $1 = HOST
|
||||
# $2 = COMPILER
|
||||
test_script()
|
||||
{
|
||||
NUMBER_OF_PROCESSORS="`value_of PROCESSORS_${1}`"
|
||||
cd ${CGAL_TEST_DIR}
|
||||
TEST_DIR_ROOT=${TEST_DIR_ROOT:-${CGAL_DIR}}
|
||||
LOCAL_TEST_DIR=${TEST_DIR_ROOT}/test_${2}
|
||||
log ${ACTUAL_LOGFILE}.${1} "Testing on ${1} with ${2}"
|
||||
if [ "${NUMBER_OF_PROCESSORS}" = "1" ] ; then
|
||||
MAKE_OPTS=""
|
||||
else
|
||||
MAKE_OPTS="-j ${NUMBER_OF_PROCESSORS}"
|
||||
fi
|
||||
remote_command ${1} \
|
||||
"CGAL_MAKEFILE=${CGAL_MAKE_DIR}/makefile_${2};
|
||||
CGAL_TESTER=${CGAL_TESTER};
|
||||
CGAL_TESTER_NAME='${CGAL_TESTER_NAME}';
|
||||
CGAL_TESTER_ADDRESS='${CGAL_TESTER_ADDRESS}';
|
||||
export CGAL_MAKEFILE;
|
||||
export CGAL_TESTER CGAL_TESTER_NAME CGAL_TESTER_ADDRESS;
|
||||
rm -rf ${LOCAL_TEST_DIR};
|
||||
cp -r ${CGAL_TEST_DIR} ${LOCAL_TEST_DIR};
|
||||
cd ${LOCAL_TEST_DIR};
|
||||
nice ${NICE_OPTIONS} make ${MAKE_OPTS};
|
||||
echo 'COLLECTING RESULTS';
|
||||
./collect_cgal_testresults;
|
||||
echo 'COPYING RESULTS';
|
||||
cp results_${CGAL_TESTER}_${2}.tar.gz results_${CGAL_TESTER}_${2}.txt ${CGAL_TEST_DIR};
|
||||
echo 'REMOVING LOCAL_TEST_DIR';
|
||||
cd ..;
|
||||
rm -rf ${LOCAL_TEST_DIR} " >> ${ACTUAL_LOGFILE}.${1} 2>&1
|
||||
log_done ${ACTUAL_LOGFILE}.${1}
|
||||
#PLATFORM=`basename $CGAL_MAKEFILE | sed -e "s/makefile_//g"`
|
||||
#
|
||||
# collect results and put them on the web
|
||||
#
|
||||
cd ${CGAL_TEST_DIR}
|
||||
log ${ACTUAL_LOGFILE}.${1} "PUTTING RESULTS ON THE WEB"
|
||||
log ${ACTUAL_LOGFILE}.${1} "RESULTS COLLECTED "${2}"-"${1}
|
||||
${TAR} cf test_results-${1}.tar "results_"$CGAL_TESTER"_"${2}".tar.gz" "results_"$CGAL_TESTER"_"${2}".txt"
|
||||
${COMPRESSOR} -9f test_results-${1}.tar
|
||||
FILENAME=${CGAL_RELEASE_ID}-test`datestr`-${2}.tar.gz
|
||||
LOGFILENAME="${CGAL_RELEASE_ID}-log`datestr`-${1}.gz"
|
||||
${COMPRESSOR} -9f ${ACTUAL_LOGFILE}.${1}
|
||||
mv ${ACTUAL_LOGFILE}.${1}.gz ${LOGS_DIR}/${LOGFILENAME}
|
||||
|
||||
put_on_web \
|
||||
test_results-${1}.tar.gz \
|
||||
${FILENAME}
|
||||
|
||||
#
|
||||
# notify the CGAL world
|
||||
#
|
||||
if [ ! "${MAIL_ADDRESS}" = "must_be_set_in_.autocgalrc" ]; then
|
||||
for i in ${MAIL_ADDRESS}; do
|
||||
printf "result collection::\n${FILENAME}\n" | ${SENDMAIL} -s "autohandle" ${i}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
# ----------------------------------------------------
|
||||
# get CGAL
|
||||
#
|
||||
|
||||
get_cgal()
|
||||
{
|
||||
log ${ACTUAL_LOGFILE} "getting CGAL"
|
||||
rm -f ${CGAL_ZIPFILE}
|
||||
if [ -n "${USE_CURL}" ]; then
|
||||
${CURL} ${CURL_OPTS} ${CGAL_LOCATION} >> ${ACTUAL_LOGFILE} 2>&1
|
||||
else
|
||||
${WGET} ${CGAL_LOCATION} >> ${ACTUAL_LOGFILE} 2>&1
|
||||
fi
|
||||
if [ ${?} != 0 ]; then
|
||||
error "Could not get CGAL"
|
||||
fi
|
||||
log_done ${ACTUAL_LOGFILE}
|
||||
}
|
||||
|
||||
|
||||
# ----------------------------------------------------
|
||||
# unzip/untar CGAL
|
||||
#
|
||||
|
||||
unzip_cgal()
|
||||
{
|
||||
cd ${CGAL_ROOT}
|
||||
log ${ACTUAL_LOGFILE} "unzipping CGAL"
|
||||
if [ "${USE_TARGZ}" = "y" ]; then
|
||||
DECOMPRESSOR="${GUNZIP}"
|
||||
log_done ${ACTUAL_LOGFILE}
|
||||
fi
|
||||
if [ "${USE_TARBZ}" = "y" ]; then
|
||||
DECOMPRESSOR="bunzip2"
|
||||
fi
|
||||
log ${ACTUAL_LOGFILE} "untarring CGAL"
|
||||
${DECOMPRESSOR} -c ${CGAL_ZIPFILE} | ${TAR} xvf - >> ${ACTUAL_LOGFILE} 2>&1
|
||||
if [ ${?} != 0 ]; then
|
||||
error "Could not untar CGAL"
|
||||
fi
|
||||
log_done ${ACTUAL_LOGFILE}
|
||||
}
|
||||
|
||||
|
||||
# ----------------------------------------------------
|
||||
# copy stuff from old CGAL installation
|
||||
#
|
||||
|
||||
copy_old_stuff()
|
||||
{
|
||||
# copy config install files
|
||||
|
||||
cd ${CGAL_DIR}
|
||||
./install_cgal --upgrade ${OLD_CGAL_DIR} >> ${ACTUAL_LOGFILE}
|
||||
|
||||
log_done ${ACTUAL_LOGFILE}
|
||||
}
|
||||
|
||||
|
||||
# ----------------------------------------------------
|
||||
# build cgal
|
||||
#
|
||||
|
||||
build_cgal()
|
||||
{
|
||||
log ${ACTUAL_LOGFILE} "building cgal libs"
|
||||
for i in ${BUILD_HOSTS}; do
|
||||
build_cgal_libs ${i}
|
||||
done
|
||||
log_done ${ACTUAL_LOGFILE}
|
||||
${COMPRESSOR} -9f ${ACTUAL_LOGFILE}
|
||||
mv ${ACTUAL_LOGFILE}.gz \
|
||||
${LOGS_DIR}/${CGAL_RELEASE_ID}-log`datestr`.gz
|
||||
}
|
||||
|
||||
|
||||
# ----------------------------------------------------
|
||||
# run the testsuites
|
||||
#
|
||||
|
||||
run_test()
|
||||
{
|
||||
log ${ACTUAL_LOGFILE} "running the testsuites"
|
||||
if [ -n "${CONSOLE_OUTPUT}" ]; then
|
||||
printf "\n-------------------------------------------------------\n"
|
||||
fi
|
||||
for i in ${BUILD_HOSTS}; do
|
||||
run_testsuite ${i} "`value_of COMPILERS_${i}`" &
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# ----------------------------------------------------
|
||||
# START OF MAIN BODY
|
||||
# ----------------------------------------------------
|
||||
|
||||
USE_TARGZ="n"
|
||||
USE_TARBZ="n"
|
||||
# logfile
|
||||
ACTUAL_LOGFILE="${CGAL_ROOT}/`basename ${0}`.log"
|
||||
|
||||
cd $CGAL_ROOT
|
||||
|
||||
CRITICAL="n"
|
||||
if [ "${MYSHELL}" = "must_be_set_in_.autocgalrc" ]; then
|
||||
log ${ACTUAL_LOGFILE} "MYSHELL must be set in .autocgalrc"
|
||||
CRITICAL="y"
|
||||
fi
|
||||
if [ "${CRITICAL}" = "y" ]; then
|
||||
error "COULD NOT DETERMINE MYSHELL!"
|
||||
fi
|
||||
|
||||
lockfile -r 5 $LOCK_FILE;
|
||||
if [ ${?} != 0 ]; then
|
||||
echo "COULD NOT AQUIRE LOCK!";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ -r "LATEST" ]; then
|
||||
rm -rf LATEST
|
||||
fi
|
||||
log ${ACTUAL_LOGFILE} "getting LATEST"
|
||||
if [ -n "${USE_CURL}" ]; then
|
||||
${CURL} ${CURL_OPTS} ${LATEST_LOCATION} >> ${ACTUAL_LOGFILE} 2>&1
|
||||
else
|
||||
${WGET} ${LATEST_LOCATION} >> ${ACTUAL_LOGFILE} 2>&1
|
||||
fi
|
||||
if [ ! -f "LATEST" ]; then
|
||||
error "COULD NOT DOWNLOAD LATEST!"
|
||||
fi
|
||||
if [ -r "RELEASE_NR" ]; then
|
||||
cmp LATEST RELEASE_NR > ${ACTUAL_LOGFILE}
|
||||
if [ ! ${?} != 0 ]; then
|
||||
rm -f $LOCK_FILE;
|
||||
exit 1;
|
||||
fi
|
||||
fi
|
||||
|
||||
for i in `cat LATEST`
|
||||
do
|
||||
CGAL_LOCATION="${CGAL_URL}/${i}";
|
||||
CGAL_ZIPFILE="${i}";
|
||||
done
|
||||
|
||||
CGAL_RELEASE_ID=`echo $CGAL_ZIPFILE | sed "s/.tar.gz//"`
|
||||
if [ ! "${CGAL_RELEASE_ID}" = "${CGAL_ZIPFILE}" ]; then
|
||||
USE_TARGZ="y"
|
||||
else
|
||||
CGAL_RELEASE_ID=`echo $CGAL_ZIPFILE | sed "s/.tar.bz2//"`
|
||||
if [ ! "${CGAL_RELEASE_ID}" = "${CGAL_ZIPFILE}" ]; then
|
||||
USE_TARBZ="y"
|
||||
fi
|
||||
fi
|
||||
|
||||
# dir for the actual release
|
||||
CGAL_DIR=${CGAL_ROOT}/${CGAL_RELEASE_ID}
|
||||
|
||||
# dir of the previous release
|
||||
# HAS TO exist !
|
||||
# (used to copy config/install files and evt. gmp stuff)
|
||||
OLD_CGAL_DIR=${CGAL_ROOT}/CGAL-I
|
||||
|
||||
# you will guess it :)
|
||||
CGAL_INCL_DIR=${CGAL_DIR}/include
|
||||
OLD_CGAL_INCL_DIR=${OLD_CGAL_DIR}/include
|
||||
CGAL_LIB_DIR=${CGAL_DIR}/lib
|
||||
OLD_CGAL_LIB_DIR=${OLD_CGAL_DIR}/lib
|
||||
CGAL_MAKE_DIR=${CGAL_DIR}/make
|
||||
CGAL_TEST_DIR=${CGAL_DIR}/test
|
||||
CGAL_RUN_TEST=${CGAL_TEST_DIR}/run_testsuite
|
||||
CGAL_COLLECT_TEST=${CGAL_TEST_DIR}/collect_cgal_testresults
|
||||
|
||||
|
||||
|
||||
# ----------------------------------------------------
|
||||
# some sanity checks
|
||||
#
|
||||
|
||||
# remove old logfile
|
||||
rm -f ${ACTUAL_LOGFILE}
|
||||
|
||||
# check, if OLD_CGAL_DIR exists and is a symbolic link
|
||||
if [ ! -r ${OLD_CGAL_DIR} -o ! -d ${OLD_CGAL_DIR} ]; then
|
||||
error "directory ${OLD_CGAL_DIR} does not exist"
|
||||
fi
|
||||
if [ ! -h ${OLD_CGAL_DIR} ]; then
|
||||
error "${OLD_CGAL_DIR} has to be a symbolic link"
|
||||
fi
|
||||
|
||||
if [ ! -r ${LOGS_DIR} ]; then
|
||||
mkdir $LOGS_DIR
|
||||
fi
|
||||
|
||||
|
||||
if [ ! "${MAIL_ADDRESS}" = "must_be_set_in_.autocgalrc" ]; then
|
||||
for i in ${MAIL_ADDRESS}; do
|
||||
printf "subject says it all\n" | \
|
||||
${SENDMAIL} -s "Started autotest" ${i}
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# do the job
|
||||
|
||||
main_procedure()
|
||||
{
|
||||
if [ "${BUILD_HOSTS}" = "must_be_set_in_.autocgalrc" ]; then
|
||||
error "BUILD_HOSTS must be set in .autocgalrc"
|
||||
else
|
||||
for i in ${BUILD_HOSTS}; do
|
||||
TEXT="`value_of COMPILERS_${i}`"
|
||||
if [ -z "${TEXT}" ]; then
|
||||
error "COMPILERS_${i} must be defined in .autocgalrc"
|
||||
else
|
||||
TEXT="`value_of PROCESSORS_${i}`"
|
||||
TEMPVAR="PROCESSORS_${i}"
|
||||
if [ -z "${TEXT}" ]; then
|
||||
log ${ACTUAL_LOGFILE} "\ngiving default 1 values TO PROCESSORS_${i} ...";
|
||||
eval $TEMPVAR="1";
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
get_cgal
|
||||
unzip_cgal
|
||||
copy_old_stuff
|
||||
build_cgal
|
||||
run_test
|
||||
}
|
||||
|
||||
|
||||
if [ "${BUILD_HOSTS}" = "localhost" ]; then
|
||||
TEXT="`value_of COMPILERS_localhost`"
|
||||
if [ -z "${TEXT}" ]; then
|
||||
# printf "\nWARNING: Only installing on localhost\n";
|
||||
get_cgal
|
||||
unzip_cgal
|
||||
copy_old_stuff
|
||||
build_cgal;
|
||||
else
|
||||
main_procedure;
|
||||
fi
|
||||
else
|
||||
main_procedure;
|
||||
fi
|
||||
|
||||
|
||||
# restore settings:
|
||||
cd ${CGAL_ROOT}
|
||||
mv LATEST RELEASE_NR
|
||||
rm -f $LOCK_FILE;
|
||||
# EOF
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env perl
|
||||
#
|
||||
# file: cgal2gml
|
||||
# author: Michael Hoffmann
|
||||
# version: $Revision$ $Date$
|
||||
# purpose: convert package dependencies (output of cgal_depend)
|
||||
# into gml graph format
|
||||
#
|
||||
|
||||
require "cgal_dependencies";
|
||||
|
||||
print "Creator \"cgal2gml\"\nVersion 1.7\ngraph [\n\nlabel \"\"\ndirected 1\n\n";
|
||||
|
||||
# nodes
|
||||
$i = 0;
|
||||
foreach $pkg (keys %depend) {
|
||||
$ind{"$pkg"} = $i;
|
||||
printf "node [\n\tid %d\n\tlabel \"$pkg\"\n\tlabelAnchor \"c\"\n\tgraphics [\n\t\tx %d\n\t\ty %d\n\t\tw 10\n\t\th 10\n\t\ttype \"rectangle\"\n\t\twidth 10\n\t]\n", $i, $i, $i*$i/2;
|
||||
print "\tLabelGraphics [\n\t\ttype \"index_label\"\n\t]\n]\n";
|
||||
++$i;
|
||||
}
|
||||
|
||||
# edges
|
||||
foreach $pkg (keys %depend) {
|
||||
foreach $dep (keys %{$depend{"$pkg"}}) {
|
||||
if ($dep ne $pkg) {
|
||||
printf "edge [\n\tsource %d\n\ttarget %d\n\tgraphics [\n\t\ttype \"line\"\n\t\tarrow \"last\"\n\t]\n]\n", $ind{"$dep"}, $ind{"$pkg"};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "]\n";
|
||||
|
||||
# EOF
|
||||
Executable
+343
@@ -0,0 +1,343 @@
|
||||
#!/usr/bin/env perl
|
||||
#
|
||||
# file: cgal_depend
|
||||
# author: Michael Hoffmann
|
||||
# version: $Revision$ $Date$
|
||||
# purpose: Scan CGAL directories for package dependencies
|
||||
#
|
||||
|
||||
$0 =~ /.*\/(.*)/;
|
||||
$thisprog = "$1";
|
||||
'$Revision$' =~ /\s(\S*)\s/;
|
||||
$thisprog_version = "$1";
|
||||
|
||||
# where to put the perl data structure containing the dependency graph
|
||||
$resultperlfile = "cgal_dependencies";
|
||||
|
||||
# the flags that makes the compiler produce all included files
|
||||
# + dependency information (not used)
|
||||
#
|
||||
# * it must start with a list of all included files indented by one space
|
||||
# per inclusion level
|
||||
# * then comes dependency information starting with "file.o:"
|
||||
# that is where the program stops parsing
|
||||
$compilerflags = "-w -MM -H -Werror";
|
||||
|
||||
# prettyprint message
|
||||
sub banner($) {
|
||||
print "--------------------------------------------------------\n";
|
||||
print "@_ ...\n";
|
||||
print "--------------------------------------------------------\n";
|
||||
}
|
||||
|
||||
# argument is a file with absolute path
|
||||
# returns path inside CGAL-directory structure
|
||||
sub cgal_basename($) {
|
||||
local $locfile = join("",@_);
|
||||
$locfile =~ "$cgaldir/(.*)";
|
||||
return $1;
|
||||
}
|
||||
|
||||
if (!defined($ARGV[0])) {
|
||||
die "usage: $thisprog <cgal-dir>\n";
|
||||
}
|
||||
if (defined($ARGV[1])) {
|
||||
$compiler = $ARGV[1];
|
||||
} else {
|
||||
$compiler = 'g++';
|
||||
}
|
||||
|
||||
# directories to scan for files:
|
||||
$cgaldir = "$ARGV[0]";
|
||||
|
||||
# get os description:
|
||||
banner "Getting OS description";
|
||||
$install_cgal = "$cgaldir/install_cgal";
|
||||
if ( ! open( ICGAL, "$install_cgal -leda -gmp -os $compiler | ")) {
|
||||
die "error in \"$install_cgal\", exiting.\n";
|
||||
}
|
||||
$cgalos = <ICGAL>;
|
||||
chomp $cgalos;
|
||||
$cgalmakefile = "$ARGV[0]/make/makefile_$cgalos";
|
||||
close ICGAL;
|
||||
|
||||
# write makefile:
|
||||
$tmakefile = "./$thisprog\_makefile";
|
||||
$tfile = "./$thisprog\_this.C";
|
||||
$tofile = "./$thisprog\_this.o";
|
||||
|
||||
if ( ! open( READMAKE, "$cgalmakefile")) {
|
||||
die "error opening \"$cgalmakefile\", exiting.\n";
|
||||
}
|
||||
if ( ! open( WRITEMAKE, ">$tmakefile")) {
|
||||
die "error opening \"$tmakefile\", exiting.\n";
|
||||
}
|
||||
while (<READMAKE>) {
|
||||
print WRITEMAKE "$_";
|
||||
}
|
||||
print WRITEMAKE "\nthis:\n\t@\$(CGAL_CXX) \$(CGAL_CXXFLAGS)";
|
||||
print WRITEMAKE " $compilerflags $tfile\n";
|
||||
close READMAKE;
|
||||
close WRITEMAKE;
|
||||
|
||||
# check directory (if e.g. there is a symbolic link involved,
|
||||
# the compiler might give different filenames)
|
||||
open( TFILE, ">$tfile") || die "\nError opening $tfile\n";
|
||||
print TFILE "\#include <CGAL/compiler_config.h>\n";
|
||||
close TFILE;
|
||||
open( MAKEPIPE, "make -f $tmakefile 2>&1 |") || die "\nError making $file\n";
|
||||
$log = <MAKEPIPE>;
|
||||
close MAKEPIPE;
|
||||
$log =~ "(.+)/include/CGAL/config/[^/]+/CGAL/compiler_config.h";
|
||||
$cgaldir = $1;
|
||||
$cgalincldir = $cgaldir . "/include";
|
||||
$cgalsrcdir = $cgaldir . "/src";
|
||||
@cgalsearchdirs = ( "$cgalincldir", "$cgalsrcdir" );
|
||||
@cgalnosearch = ( "$cgalincldir/compilers" );
|
||||
|
||||
# status information
|
||||
print "========================================================\n";
|
||||
print "CGAL_DIR\tis $cgaldir\n";
|
||||
print "CGAL_INCL_DIR\tis $cgalincldir\n";
|
||||
print "CGAL_SRC_DIR\tis $cgalsrcdir\n";
|
||||
print "COMPILER\tis $compiler\n";
|
||||
print "OS\t\tis $cgalos\n";
|
||||
print "========================================================\n";
|
||||
|
||||
# scan package information:
|
||||
|
||||
foreach $sdir (@cgalsearchdirs) {
|
||||
banner "Scanning $sdir";
|
||||
if ( ! open( FINDPIPE, "find $sdir -print | ")) {
|
||||
die "error in \"find\", exiting.\n";
|
||||
}
|
||||
$| = 1;
|
||||
while (<FINDPIPE>) {
|
||||
$file = $_;
|
||||
chomp $file;
|
||||
if ( -d "$file") { next; }
|
||||
if ( ! open( AFILE, "$file")) {
|
||||
die "error opening \"$file\", exiting.\n";
|
||||
}
|
||||
print ".";
|
||||
while (<AFILE>) {
|
||||
if ($_ =~ /^\/\/\s*[pP]ackage\s*:\s*(\S+).*/ ) {
|
||||
$package{"$file"} = "$1";
|
||||
last;
|
||||
}
|
||||
}
|
||||
if (eof) {
|
||||
print "\nWARNING(1): No package information for $file.\n";
|
||||
}
|
||||
close AFILE;
|
||||
}
|
||||
$| = 0;
|
||||
print "\n";
|
||||
close FINDPIPE;
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# generate dependencies:
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
banner "Generating dependencies";
|
||||
print "\n";
|
||||
LOOP1: foreach $file (keys %package) {
|
||||
foreach $no (@cgalnosearch) {
|
||||
if ($file =~ "^\Q$no\E/(.*)") { next LOOP1; }
|
||||
}
|
||||
$basename = &cgal_basename( $file);
|
||||
$| = 1;
|
||||
print "Compiling $basename ... ";
|
||||
$| = 0;
|
||||
open( TFILE, ">$tfile") || die "\nError opening $tfile\n";
|
||||
print TFILE "\#include \"$file\"\n";
|
||||
close TFILE;
|
||||
$compiletry = 0;
|
||||
TRYCOMPILE:
|
||||
++$compiletry;
|
||||
$| = 1;
|
||||
print "$compiletry";
|
||||
$| = 0;
|
||||
open( MAKEPIPE, "make -f $tmakefile 2>&1 |") ||
|
||||
die "\nError making $file\n";
|
||||
# start reading from the pipe to get the logfile
|
||||
@log = <MAKEPIPE>;
|
||||
close MAKEPIPE;
|
||||
$log = lc( join("",@log));
|
||||
if ( $log =~ /error(\s|:|\()/) {
|
||||
if ( $log =~ "no representation class defined" && $compiletry == 1) {
|
||||
close MAKEPIPE;
|
||||
open( TFILE, ">$tfile") || die "\nError opening $tfile\n";
|
||||
print TFILE "\#include <CGAL/Cartesian.h>\n";
|
||||
if ( $basename =~ /\.C$/) {
|
||||
print TFILE "\#include \"$file\"\n";
|
||||
} else {
|
||||
$basename =~ "include/CGAL/(.*)";
|
||||
print TFILE "\#include <CGAL/$1>\n";
|
||||
}
|
||||
close TFILE;
|
||||
goto TRYCOMPILE;
|
||||
} else {
|
||||
print "\nCompilation failed with the following error messages:\n";
|
||||
banner "@log";
|
||||
$compiletry = 99;
|
||||
}
|
||||
} else {
|
||||
print " ok.\n";
|
||||
}
|
||||
|
||||
if ( $compiletry < 99) {
|
||||
@inclpath == 0 || die "\nAssertion failed: inclpath == 0\n";
|
||||
# We start with our file, ignoring stuff e.g. generated
|
||||
# by the added #include <CGAL/Cartesian.h>
|
||||
while ( @log > 0) {
|
||||
$actual = shift @log;
|
||||
chomp $actual;
|
||||
if ( $actual eq $file) { last; }
|
||||
}
|
||||
# Now the dependency generation starts
|
||||
$inclpath[0] = &cgal_basename($actual);
|
||||
while ( @log > 0) {
|
||||
$actual = shift @log;
|
||||
# parse whitespaces
|
||||
$actual =~ s/(^\s*)(\S+)//;
|
||||
$indent = length("$1");
|
||||
$actual = "$2";
|
||||
# record include path (used to justify pkg-dependency)
|
||||
$inclpath[$indent] = &cgal_basename($actual);
|
||||
# stop when g++ starts listing dependencies
|
||||
if ( $actual =~ /$tofile:/) {
|
||||
last;
|
||||
}
|
||||
|
||||
# I don't understand the following anymore :-(
|
||||
#while ( @log > $indent + 1) {
|
||||
# pop @log;
|
||||
#}
|
||||
|
||||
# ignore everything outside CGAL
|
||||
$match = 0;
|
||||
map( $match = $match + $actual =~ /$_/, @cgalsearchdirs);
|
||||
if ( $match > 0) {
|
||||
if ( ! defined($package{"$actual"})) {
|
||||
print "WARNING(2): Could not find package for $actual.\n";
|
||||
} else {
|
||||
# check, whether our current include-path is shorter
|
||||
# than what we found so far
|
||||
if ( defined( $depend{"$package{\"$file\"}"}
|
||||
{"$package{\"$actual\"}"})
|
||||
&&
|
||||
length( @{$depend{"$package{\"$file\"}"}
|
||||
{"$package{\"$actual\"}"}})
|
||||
> $indent)
|
||||
{
|
||||
delete $depend{"$package{\"$file\"}"}
|
||||
{"$package{\"$actual\"}"};
|
||||
}
|
||||
if ( ! defined( $depend{"$package{\"$file\"}"}
|
||||
{"$package{\"$actual\"}"}))
|
||||
{
|
||||
# Did we add Cartesian.h first?
|
||||
#if ( $compiletry > 1 &&
|
||||
# "$inclpath[0]" ne "$basename") {
|
||||
# push @{$depend{"$package{\"$file\"}"}
|
||||
# {"$package{\"$actual\"}"}},
|
||||
# "$basename";
|
||||
#}
|
||||
for ($i = 0; $i <= $indent; ++$i) {
|
||||
# we only want direct dependencies
|
||||
local $afile = "$cgaldir" . "/" . "$inclpath[$i]";
|
||||
if (!defined($package{"$afile"})) {
|
||||
print "WARNING(3): Could not find package for $afile.\n";
|
||||
} elsif ($package{"$afile"} ne $package{"$file"} &&
|
||||
$package{"$afile"} ne $package{"$actual"})
|
||||
{
|
||||
delete $depend{"$package{\"$file\"}"}
|
||||
{"$package{\"$actual\"}"};
|
||||
last;
|
||||
}
|
||||
push @{$depend{"$package{\"$file\"}"}
|
||||
{"$package{\"$actual\"}"}},
|
||||
"$inclpath[$i]";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
# clear @inclpath:
|
||||
while ( @inclpath > 0) {
|
||||
pop @inclpath;
|
||||
}
|
||||
}
|
||||
system "rm -f $tfile $tmakefile";
|
||||
|
||||
foreach $pkg (keys %depend) {
|
||||
# of course it depends on itself
|
||||
delete $depend{"$pkg"}{"$pkg"};
|
||||
}
|
||||
|
||||
# do bfs to compute connected components of dependency graph
|
||||
# !change the condition if you want to have the closure!
|
||||
if (1 < 0) {
|
||||
banner "Computing connected components";
|
||||
foreach $pkg (keys %depend) {
|
||||
$visited{"$pkg"} = [ ];
|
||||
push @todo,"$pkg";
|
||||
while ( @todo > 0) {
|
||||
$actual = shift @todo;
|
||||
foreach $dp (keys %{$depend{"$actual"}}) {
|
||||
if ( ! defined($visited{"$dp"})) {
|
||||
$visited{"$dp"} = [ @{$visited{"$actual"}} ];
|
||||
if ( "$actual" ne "$pkg") {
|
||||
push @{$visited{"$dp"}}, "$actual";
|
||||
}
|
||||
push @todo,"$dp";
|
||||
if ( ! defined( $depend{"$pkg"}{"$dp"})) {
|
||||
$depend{"$pkg"}{"$dp"} = [ @{$visited{"$dp"}} ];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
# clear visited list
|
||||
foreach $dp (keys %visited) {
|
||||
delete $visited{"$dp"};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# output package dependencies
|
||||
open( PERLRES, ">$resultperlfile") ||
|
||||
die "\nError opening $resultperlfile.\n";
|
||||
print PERLRES "# CGAL Package dependencies\n";
|
||||
print PERLRES "# Automatically generated by $thisprog V$thisprog_version\n";
|
||||
print PERLRES "#\n";
|
||||
print PERLRES "# CGAL_DIR\t: $cgaldir\n";
|
||||
print PERLRES "# CGAL_INCL_DIR\t: $cgalincldir\n";
|
||||
print PERLRES "# CGAL_SRC_DIR\t: $cgalsrcdir\n";
|
||||
print PERLRES "# COMPILER\t: $compiler\n";
|
||||
print PERLRES "# OS\t\t: $cgalos\n";
|
||||
print PERLRES "#\n\n";
|
||||
print PERLRES "%depend = (\n";
|
||||
banner "These are the package dependencies";
|
||||
foreach $pkg (keys %depend) {
|
||||
print "\n--------------------------------------------\n";
|
||||
print "package: $pkg\n";
|
||||
print PERLRES "\t$pkg\t=> {\n";
|
||||
foreach $dp (keys %{$depend{"$pkg"}}) {
|
||||
print "\t$dp\n";
|
||||
#@tmpname = [ @{$depend{"$pkg"}{"$dp"}} ];
|
||||
print PERLRES "\t\t$dp\t=> [\n";
|
||||
foreach $tr (@{$depend{"$pkg"}{"$dp"}}) {
|
||||
print PERLRES "\t\t\t\"$tr\",\n";
|
||||
}
|
||||
print PERLRES "\t\t],\n";
|
||||
}
|
||||
print PERLRES "\t},\n";
|
||||
}
|
||||
print PERLRES ");\n\n# EOF\n";
|
||||
close PERLRES;
|
||||
print "\n*** ALL DONE ***\n";
|
||||
|
||||
# EOF
|
||||
+313
@@ -0,0 +1,313 @@
|
||||
# Copyright (c) 1999, 2001, 2003 Utrecht University (The Netherlands),
|
||||
# ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany),
|
||||
# INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
|
||||
# (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria),
|
||||
# and Tel-Aviv University (Israel). All rights reserved.
|
||||
#
|
||||
# This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public License as
|
||||
# published by the Free Software Foundation; version 2.1 of the License.
|
||||
# See the file LICENSE.LGPL distributed with CGAL.
|
||||
#
|
||||
# Licensees holding a valid commercial license may use this file in
|
||||
# accordance with the commercial license agreement provided with the software.
|
||||
#
|
||||
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# $Source$
|
||||
# $Revision$ $Date$
|
||||
# $Name$
|
||||
#
|
||||
# Author(s) : Geert-Jan Giezeman, Sven Schönherr
|
||||
|
||||
if test $# -ne 1
|
||||
then
|
||||
echo "usage:" >&2
|
||||
echo "$0 name" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
nameUC=`echo $1 | tr "[a-z]" "[A-Z]" `
|
||||
nameLC=`echo $1 | tr "[A-Z]" "[a-z]" `
|
||||
|
||||
if test -n "${nameUC}"
|
||||
then
|
||||
#append underscore to name
|
||||
nameUC="${nameUC}_"
|
||||
nameLC="${nameLC}_"
|
||||
fi
|
||||
|
||||
sed -e "s/XXX_/${nameUC}/g" -e "s/xxx_/${nameLC}/g" <<"EOF" \
|
||||
> "${nameLC}assertions.h"
|
||||
// Replace this remark by a proper copyright notice.
|
||||
//
|
||||
// $Source$
|
||||
// $Revision$ $Date$
|
||||
// $Name$
|
||||
//
|
||||
// Author(s) : Geert-Jan Giezeman, Sven Schönherr
|
||||
|
||||
// Generated from script create_assertions.sh
|
||||
|
||||
// macro definitions
|
||||
// =================
|
||||
// assertions
|
||||
// ----------
|
||||
|
||||
|
||||
#if defined(CGAL_XXX_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_assertion(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_assertion_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_assertion_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_assertion(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_assertion_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_assertion_code(CODE) CODE
|
||||
# define CGAL_xxx_assertions 1
|
||||
#endif // CGAL_XXX_NO_ASSERTIONS
|
||||
|
||||
#if defined(CGAL_XXX_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
|
||||
|| (!defined(CGAL_XXX_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_exactness_assertion(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_exactness_assertion_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_exactness_assertion_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_exactness_assertion(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_exactness_assertion_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_exactness_assertion_code(CODE) CODE
|
||||
# define CGAL_xxx_exactness_assertions 1
|
||||
#endif // CGAL_XXX_NO_ASSERTIONS
|
||||
|
||||
#if defined(CGAL_XXX_NO_ASSERTIONS) \
|
||||
|| defined(CGAL_NO_ASSERTIONS) \
|
||||
|| (!defined(CGAL_XXX_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_expensive_assertion(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_assertion_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_assertion_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_expensive_assertion(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_expensive_assertion_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_expensive_assertion_code(CODE) CODE
|
||||
# define CGAL_xxx_expensive_assertions 1
|
||||
#endif // CGAL_XXX_NO_ASSERTIONS
|
||||
|
||||
#if defined(CGAL_XXX_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
|
||||
|| (!defined(CGAL_XXX_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
|
||||
|| (!defined(CGAL_XXX_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_expensive_exactness_assertion(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_exactness_assertion_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_exactness_assertion_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_expensive_exactness_assertion(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_expensive_exactness_assertion_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_expensive_exactness_assertion_code(CODE) CODE
|
||||
# define CGAL_xxx_expensive_exactness_assertions 1
|
||||
#endif // CGAL_XXX_NO_ASSERTIONS
|
||||
|
||||
|
||||
// preconditions
|
||||
// -------------
|
||||
|
||||
#if defined(CGAL_XXX_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_precondition(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_precondition_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_precondition_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_precondition(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_precondition_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_precondition_code(CODE) CODE
|
||||
# define CGAL_xxx_preconditions 1
|
||||
#endif // CGAL_XXX_NO_PRECONDITIONS
|
||||
|
||||
#if defined(CGAL_XXX_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
|
||||
|| (!defined(CGAL_XXX_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_exactness_precondition(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_exactness_precondition_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_exactness_precondition_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_exactness_precondition(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_exactness_precondition_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_exactness_precondition_code(CODE) CODE
|
||||
# define CGAL_xxx_exactness_preconditions 1
|
||||
#endif // CGAL_XXX_NO_PRECONDITIONS
|
||||
|
||||
#if defined(CGAL_XXX_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
|
||||
|| (!defined(CGAL_XXX_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_expensive_precondition(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_precondition_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_precondition_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_expensive_precondition(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_expensive_precondition_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_expensive_precondition_code(CODE) CODE
|
||||
# define CGAL_xxx_expensive_preconditions 1
|
||||
#endif // CGAL_XXX_NO_PRECONDITIONS
|
||||
|
||||
#if defined(CGAL_XXX_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
|
||||
|| (!defined(CGAL_XXX_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
|
||||
|| (!defined(CGAL_XXX_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_expensive_exactness_precondition(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_exactness_precondition_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_exactness_precondition_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_expensive_exactness_precondition(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_expensive_exactness_precondition_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_expensive_exactness_precondition_code(CODE) CODE
|
||||
# define CGAL_xxx_expensive_exactness_preconditions 1
|
||||
#endif // CGAL_XXX_NO_PRECONDITIONS
|
||||
|
||||
|
||||
// postconditions
|
||||
// --------------
|
||||
|
||||
#if defined(CGAL_XXX_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_postcondition(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_postcondition_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_postcondition_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_postcondition(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_postcondition_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_postcondition_code(CODE) CODE
|
||||
# define CGAL_xxx_postconditions 1
|
||||
#endif // CGAL_XXX_NO_POSTCONDITIONS
|
||||
|
||||
#if defined(CGAL_XXX_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
|
||||
|| (!defined(CGAL_XXX_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_exactness_postcondition(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_exactness_postcondition_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_exactness_postcondition_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_exactness_postcondition(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_exactness_postcondition_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_exactness_postcondition_code(CODE) CODE
|
||||
# define CGAL_xxx_exactness_postconditions 1
|
||||
#endif // CGAL_XXX_NO_POSTCONDITIONS
|
||||
|
||||
#if defined(CGAL_XXX_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
|
||||
|| (!defined(CGAL_XXX_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_expensive_postcondition(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_postcondition_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_postcondition_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_expensive_postcondition(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_expensive_postcondition_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_expensive_postcondition_code(CODE) CODE
|
||||
# define CGAL_xxx_expensive_postconditions 1
|
||||
#endif // CGAL_XXX_NO_POSTCONDITIONS
|
||||
|
||||
#if defined(CGAL_XXX_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
|
||||
|| (!defined(CGAL_XXX_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
|
||||
|| (!defined(CGAL_XXX_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_expensive_exactness_postcondition(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_exactness_postcondition_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_exactness_postcondition_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_expensive_exactness_postcondition(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_expensive_exactness_postcondition_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_expensive_exactness_postcondition_code(CODE) CODE
|
||||
# define CGAL_xxx_expensive_exactness_postconditions 1
|
||||
#endif // CGAL_XXX_NO_POSTCONDITIONS
|
||||
|
||||
|
||||
// warnings
|
||||
// --------
|
||||
|
||||
#if defined(CGAL_XXX_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_warning(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_warning_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_warning_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_warning(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_warning_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_warning_code(CODE) CODE
|
||||
# define CGAL_xxx_warnings 1
|
||||
#endif // CGAL_XXX_NO_WARNINGS
|
||||
|
||||
#if defined(CGAL_XXX_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
|
||||
|| (!defined(CGAL_XXX_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_exactness_warning(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_exactness_warning_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_exactness_warning_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_exactness_warning(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_exactness_warning_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_exactness_warning_code(CODE) CODE
|
||||
# define CGAL_xxx_exactness_warnings 1
|
||||
#endif // CGAL_XXX_NO_WARNINGS
|
||||
|
||||
#if defined(CGAL_XXX_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
|
||||
|| (!defined(CGAL_XXX_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_expensive_warning(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_warning_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_warning_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_expensive_warning(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_expensive_warning_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_expensive_warning_code(CODE) CODE
|
||||
# define CGAL_xxx_expensive_warnings 1
|
||||
#endif // CGAL_XXX_NO_WARNINGS
|
||||
|
||||
#if defined(CGAL_XXX_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
|
||||
|| (!defined(CGAL_XXX_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
|
||||
|| (!defined(CGAL_XXX_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \
|
||||
|| defined(NDEBUG)
|
||||
# define CGAL_xxx_expensive_exactness_warning(EX) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_exactness_warning_msg(EX,MSG) (static_cast<void>(0))
|
||||
# define CGAL_xxx_expensive_exactness_warning_code(CODE)
|
||||
#else
|
||||
# define CGAL_xxx_expensive_exactness_warning(EX) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))
|
||||
# define CGAL_xxx_expensive_exactness_warning_msg(EX,MSG) \
|
||||
((EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
|
||||
# define CGAL_xxx_expensive_exactness_warning_code(CODE) CODE
|
||||
# define CGAL_xxx_expensive_exactness_warnings 1
|
||||
#endif // CGAL_XXX_NO_WARNINGS
|
||||
|
||||
|
||||
EOF
|
||||
Executable
+115
@@ -0,0 +1,115 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# =============================================================================
|
||||
# file : scripts/create_cgal_test
|
||||
# source :
|
||||
# revision : 1.1
|
||||
# revision_date : 02 Mar 1998
|
||||
# author(s) : Wieger Wesselink, Geert-Jan Giezeman
|
||||
#
|
||||
# coordinator : Utrecht University
|
||||
# =============================================================================
|
||||
#
|
||||
# This script creates a cgal_test script with entries for all .C and .cpp
|
||||
# files in the current test directory.
|
||||
|
||||
VERSION=1.1
|
||||
|
||||
header()
|
||||
{
|
||||
echo "#---------------------------------------------------------------------#"
|
||||
echo "# $1"
|
||||
echo "#---------------------------------------------------------------------#"
|
||||
}
|
||||
|
||||
create_script()
|
||||
{
|
||||
echo "#! /bin/sh"
|
||||
echo
|
||||
echo "# This is a script for the CGAL test suite. Such a script must obey"
|
||||
echo "# the following rules:"
|
||||
echo "#"
|
||||
echo "# - the name of the script is cgal_test"
|
||||
echo "# - for every target two one line messages are written to the file 'error.txt'"
|
||||
echo "# the first one indicates if the compilation was successful"
|
||||
echo "# the second one indicates if the execution was successful"
|
||||
echo "# if one of the two was not successful, the line should start with 'ERROR:'"
|
||||
echo "# - running the script should not require any user interaction"
|
||||
echo "# - the script should clean up object files and executables"
|
||||
echo
|
||||
echo "ERRORFILE=error.txt"
|
||||
echo
|
||||
header "compile_and_run <target>"
|
||||
echo
|
||||
cat << EOF
|
||||
compile_and_run()
|
||||
{
|
||||
echo "Compiling \$1 ... "
|
||||
SUCCES="y"
|
||||
if eval 'make CGAL_MAKEFILE=\$CGAL_MAKEFILE \\
|
||||
TESTSUITE_CXXFLAGS="\$TESTSUITE_CXXFLAGS" \\
|
||||
TESTSUITE_LDFLAGS="\$TESTSUITE_LDFLAGS" \$1' ; then
|
||||
echo " succesful compilation of \$1" >> \$ERRORFILE
|
||||
else
|
||||
echo " ERROR: compilation of \$1" >> \$ERRORFILE
|
||||
SUCCES=""
|
||||
fi
|
||||
|
||||
if [ -n "\${SUCCES}" ] ; then
|
||||
OUTPUTFILE=ProgramOutput.\$1.\$PLATFORM
|
||||
rm -f \$OUTPUTFILE
|
||||
COMMAND="./\$1"
|
||||
if [ -f \$1.cmd ] ; then
|
||||
COMMAND="\$COMMAND \`cat \$1.cmd\`"
|
||||
fi
|
||||
if [ -f \$1.cin ] ; then
|
||||
COMMAND="cat \$1.cin | \$COMMAND"
|
||||
fi
|
||||
echo "Executing \$1 ... "
|
||||
echo
|
||||
ulimit -t 1200
|
||||
if eval \$COMMAND > \$OUTPUTFILE 2>&1 ; then
|
||||
echo " succesful execution of \$1" >> \$ERRORFILE
|
||||
else
|
||||
echo " ERROR: execution of \$1" >> \$ERRORFILE
|
||||
fi
|
||||
else
|
||||
echo " ERROR: not executed \$1" >> \$ERRORFILE
|
||||
fi
|
||||
|
||||
eval "make CGAL_MAKEFILE=\$CGAL_MAKEFILE clean > /dev/null 2>&1 "
|
||||
}
|
||||
|
||||
EOF
|
||||
header "remove the previous error file"
|
||||
echo
|
||||
echo "rm -f \$ERRORFILE"
|
||||
echo "touch \$ERRORFILE"
|
||||
echo
|
||||
header "compile and run the tests"
|
||||
echo
|
||||
cat << EOF
|
||||
if [ \$# -ne 0 ] ; then
|
||||
for file in \$* ; do
|
||||
compile_and_run \$file
|
||||
done
|
||||
else
|
||||
EOF
|
||||
for file in `ls *.C 2>/dev/null | sort` ; do
|
||||
echo " compile_and_run `basename $file .C`"
|
||||
done
|
||||
for file in `ls *.cpp 2>/dev/null | sort` ; do
|
||||
echo " compile_and_run `basename $file .cpp`"
|
||||
done
|
||||
echo "fi"
|
||||
echo
|
||||
}
|
||||
|
||||
echo "create_cgal_test version $VERSION"
|
||||
if [ -f cgal_test ] ; then
|
||||
echo "moving cgal_test to cgal_test.bak ..."
|
||||
mv -f cgal_test cgal_test.bak
|
||||
fi
|
||||
create_script > cgal_test
|
||||
chmod 755 cgal_test
|
||||
echo "created cgal_test ..."
|
||||
+951
@@ -0,0 +1,951 @@
|
||||
#!/usr/bin/env perl
|
||||
#this script generates the modules
|
||||
|
||||
use Cwd;
|
||||
use File::Find;
|
||||
use Getopt::Std;
|
||||
|
||||
sub usage() {
|
||||
print STDERR<<"EOF";
|
||||
usage:
|
||||
$0 (-h|-r)
|
||||
[-n version number]
|
||||
[-d releasedir] [-a allpackagesdir]
|
||||
[-s scriptsdir]
|
||||
[-l lockfile] [-p packagesfile]
|
||||
|
||||
Exactly one of the options -h or -r must be present.
|
||||
-h show this message and quit
|
||||
-r release version to be created
|
||||
|
||||
-m module name
|
||||
-n version number
|
||||
-d releasedir, default releasedir is the current dir
|
||||
-a allpackagesdir, default is releasedir/All
|
||||
-s scriptsdir, default is releasedir
|
||||
-l lockfile, default is releasedir/release_creation.lock
|
||||
-p packagesfile, default is releasedir/include_in_release
|
||||
|
||||
The version number is stored in include/CGAL/version.h.
|
||||
The RELEASEDIR is the place where the new release will be created.
|
||||
The ALLPACKAGESDIR is the directory that contains the checked out packages
|
||||
from the CVS. Could be a taged version (<<current_submission>>) or some
|
||||
other version.
|
||||
The SCRIPTSDIR is the place where you have the create_makefile script.
|
||||
This script you can take it from CVS/Scripts/scripts/create_makefile.
|
||||
You need this script to create the default makefiles for examples and
|
||||
tests.
|
||||
The LOCKFILE is some file used by lockfile command as a mutex.
|
||||
The PACKAGESFILE is the file that contains a list of the packages you want
|
||||
to include in this release. In fact it is a filter for packages you have
|
||||
in ALLPACKAGESDIR. There is one file that is used to create the CGAL
|
||||
internal release in CVS/Maintenance/release_building/include_in_release.
|
||||
You can take that one too.
|
||||
|
||||
Example of how to use the script:
|
||||
>cvs -q co -P -r current_submission All
|
||||
>./create_internal_module -m CGAL-I-01 -r CGAL-I-1
|
||||
or
|
||||
>./create_internal_module -r CGAL-I-7 -d \$HOME -a \$HOME/CGALCVS/All -s \$HOME/scripts -l release_creation.lock -p include_in_release
|
||||
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
my $TEMPFILE="TEMPFILE.$$";
|
||||
|
||||
#----------------------------------------------------#
|
||||
# Initialisation #
|
||||
#----------------------------------------------------#
|
||||
|
||||
my (
|
||||
$MODULE_NAME,
|
||||
$VERSION,
|
||||
$VERSION_NR,
|
||||
$LOCKFILE,
|
||||
$ALLPACKAGESDIR,
|
||||
$RELEASEDIR,
|
||||
$MAINDIR,
|
||||
$SCRIPTSDIR,
|
||||
$LOCKCMD,
|
||||
$packages_file
|
||||
);
|
||||
|
||||
$RELEASEDIR=cwd();
|
||||
$ALLPACKAGESDIR="$RELEASEDIR/All";
|
||||
$LOCKFILE="$RELEASEDIR/release_creation.lock";
|
||||
$SCRIPTSDIR=$RELEASEDIR;
|
||||
$LOCKCMD='lockfile';
|
||||
$packages_file="$RELEASEDIR/include_in_release";
|
||||
|
||||
|
||||
|
||||
|
||||
sub termination_signal_handler {
|
||||
unlink $LOCKFILE;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
sub lock()
|
||||
{
|
||||
if (system("$LOCKCMD", "-r", '10', "$LOCKFILE") != 0) {
|
||||
print STDERR <<"TOTHIER";
|
||||
The script could not proceed because
|
||||
it could not acquire the needed lock on file $LOCKFILE.
|
||||
TOTHIER
|
||||
exit 1;
|
||||
}
|
||||
$SIG{INT} = \&termination_signal_handler;
|
||||
$SIG{TERM} = \&termination_signal_handler;
|
||||
}
|
||||
|
||||
sub unlock()
|
||||
{
|
||||
unlink $LOCKFILE;
|
||||
$SIG{INT} = 'DEFAULT';
|
||||
$SIG{TERM} = 'DEFAULT';
|
||||
}
|
||||
|
||||
sub create_packages_dir(){
|
||||
print "Creating $MODULE_NAME/Packages directory ...\n";
|
||||
chdir $RELEASEDIR or die;
|
||||
if (! -f $packages_file){
|
||||
print STDERR "$packages_file file does not exist\n";
|
||||
unlock;
|
||||
die "\n";
|
||||
}
|
||||
open PACKAGES_TO_INCLUDE, "$packages_file" or die;
|
||||
while (<PACKAGES_TO_INCLUDE>){
|
||||
chomp;
|
||||
s/\s*//g;
|
||||
next if /^$/;
|
||||
$is_permitted_package{$_}=1;
|
||||
}
|
||||
close PACKAGES_TO_INCLUDE;
|
||||
|
||||
opendir ALLPACKAGESDIR, $ALLPACKAGESDIR or die;
|
||||
while (defined($package_name = readdir(ALLPACKAGESDIR))) {
|
||||
next unless $is_permitted_package{$package_name};
|
||||
chdir "$RELEASEDIR/$MODULE_NAME" or die;
|
||||
mkdir('Packages', 0775);
|
||||
chdir 'Packages';
|
||||
mkdir($package_name, 0775);
|
||||
if (-f "$ALLPACKAGESDIR/$package_name/maintainer"){
|
||||
system('cp', "$ALLPACKAGESDIR/$package_name/maintainer", "$RELEASEDIR/$MODULE_NAME/Packages/$package_name");
|
||||
}
|
||||
if (-f "$ALLPACKAGESDIR/$package_name/version"){
|
||||
system('cp', "$ALLPACKAGESDIR/$package_name/version", "$RELEASEDIR/$MODULE_NAME/Packages/$package_name");
|
||||
}
|
||||
if (-f "$ALLPACKAGESDIR/$package_name/changes.txt"){
|
||||
system('cp', "$ALLPACKAGESDIR/$package_name/changes.txt", "$RELEASEDIR/$MODULE_NAME/Packages/$package_name");
|
||||
}
|
||||
if (-f "$ALLPACKAGESDIR/$package_name/description.txt"){
|
||||
system('cp', "$ALLPACKAGESDIR/$package_name/description.txt", "$RELEASEDIR/$MODULE_NAME/Packages/$package_name");
|
||||
}
|
||||
|
||||
}
|
||||
closedir ALLPACKAGESDIR;
|
||||
}
|
||||
|
||||
|
||||
sub install_packages() {
|
||||
my ($filename, $direc, %is_permited_package, $package_name, $tmp_package_name);
|
||||
print "Installing packages ...\n";
|
||||
chdir $RELEASEDIR or die;
|
||||
if (! -f $packages_file){
|
||||
print STDERR "$packages_file file does not exist\n";
|
||||
unlock;
|
||||
die "\n";
|
||||
}
|
||||
|
||||
|
||||
open PACKAGES_TO_INCLUDE, "$packages_file" or die;
|
||||
while (<PACKAGES_TO_INCLUDE>){
|
||||
chomp;
|
||||
s/\s*//g;
|
||||
next if /^$/;
|
||||
$is_permitted_package{$_}=1;
|
||||
}
|
||||
close PACKAGES_TO_INCLUDE;
|
||||
|
||||
opendir ALLPACKAGESDIR, $ALLPACKAGESDIR or die;
|
||||
while (defined($package_name = readdir(ALLPACKAGESDIR))) {
|
||||
next unless $is_permitted_package{$package_name};
|
||||
$dont_submit="$ALLPACKAGESDIR/$package_name/dont_submit";
|
||||
$exclude_command="--exclude-from=$dont_submit";
|
||||
chdir "$ALLPACKAGESDIR" or die;
|
||||
if(-f $dont_submit){
|
||||
system('tar', '-cf', "$RELEASEDIR/temppack.tar", '--exclude=CVS', "$exclude_command", '--exclude=TODO', '--exclude=dont_submit', '--exclude=maintainer', '--exclude=description.txt', '--exclude=wrapper.tex', '--exclude=changes.txt', '--exclude=version', '--exclude=.cvsignore', "$package_name");
|
||||
} else {
|
||||
system('tar', '-cf', "$RELEASEDIR/temppack.tar", '--exclude=CVS', '--exclude=dont_submit', '--exclude=maintainer', '--exclude=description.txt', '--exclude=changes.txt', '--exclude=TODO', '--exclude=wrapper.tex', '--exclude=version', '--exclude=.cvsignore',"$package_name");
|
||||
}
|
||||
system('mv', "$RELEASEDIR/temppack.tar", "$RELEASEDIR/$MODULE_NAME/");
|
||||
|
||||
chdir "$RELEASEDIR/$MODULE_NAME" or die;
|
||||
system('tar', '-xf', "temppack.tar");
|
||||
$tmp_package_name = "temp_${package_name}";
|
||||
system("mv", "$package_name", "$tmp_package_name");
|
||||
opendir packagename, "$tmp_package_name";
|
||||
@fichiers = readdir packagename;
|
||||
closedir packagename;
|
||||
shift @fichiers; shift @fichiers;
|
||||
foreach $fichier (@fichiers){
|
||||
system("cp", "-r", "$tmp_package_name/$fichier", "$RELEASEDIR/$MODULE_NAME");
|
||||
}
|
||||
system('rm', '-rf', "$tmp_package_name");
|
||||
}
|
||||
closedir ALLPACKAGESDIR;
|
||||
unlink 'temppack.tar', 'description.txt', 'long_description.txt', 'changes.txt', 'submission_info', 'long_description.txt.old';
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# set the version information in the include/CGAL/version.h #
|
||||
#-----------------------------------------------------------------------#
|
||||
|
||||
sub create_version_file()
|
||||
{
|
||||
chdir "$RELEASEDIR/$MODULE_NAME/include/CGAL" or die;
|
||||
open(TEMPFILE, ">tempfile") or die;
|
||||
|
||||
#if VERSION starts with CGAL-, we remove "CGAL-" from version
|
||||
#the $newver variable will store the right version
|
||||
if ($result = $VERSION =~ /CGAL-(.*)/){
|
||||
$newver = $1;
|
||||
} else {
|
||||
$newver = $VERSION;
|
||||
}
|
||||
|
||||
print TEMPFILE << 'EOF';
|
||||
// This file is automatically created by create_internal_release.
|
||||
// Do not edit manually.
|
||||
|
||||
#ifndef CGAL_VERSION_H
|
||||
#define CGAL_VERSION_H
|
||||
|
||||
EOF
|
||||
print TEMPFILE "#define CGAL_VERSION $newver\n";
|
||||
print TEMPFILE "#define CGAL_VERSION_NR $VERSION_NR\n\n#endif\n";
|
||||
|
||||
close TEMPFILE || die "Error closing temporary file: $!\n";
|
||||
system('mv', "tempfile", 'version.h');
|
||||
chdir '../..' or die;
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# set the version information in the doc_tex/version.tex #
|
||||
#-----------------------------------------------------------------------#
|
||||
|
||||
sub create_version_tex_file()
|
||||
{
|
||||
chdir "$RELEASEDIR/$MODULE_NAME/doc_tex" or die;
|
||||
open(TEMPFILE, ">tempfile") or die;
|
||||
#if VERSION starts with CGAL-, we remove "CGAL-" from version
|
||||
#the $newver variable will store the right version
|
||||
if ($result = $VERSION =~ /CGAL-(.*)/){
|
||||
$newver = $1;
|
||||
} else {
|
||||
$newver = $VERSION;
|
||||
}
|
||||
|
||||
print TEMPFILE << 'EOF';
|
||||
%% This file is automatically created by create_internal_release.
|
||||
%% Do not edit manually.
|
||||
|
||||
EOF
|
||||
print TEMPFILE "\\gdef\\cgalversion{$newver}\n";
|
||||
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||
|
||||
my @months = ( "January", "February", "March", "April",
|
||||
"May", "June", "July", "August", "September",
|
||||
"October", "November", "December" );
|
||||
|
||||
print TEMPFILE "\\gdef\\cgalversiondate{$mday $months[$mon] ", 1900 + $year, "}\n";
|
||||
|
||||
close TEMPFILE || die "Error closing temporary file: $!\n";
|
||||
system('mv', "tempfile", 'version.tex');
|
||||
chdir '../..' or die;
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub make_src_makefiles(){
|
||||
chdir "$RELEASEDIR/$MODULE_NAME" or die;
|
||||
if ( -d "src"){
|
||||
print "Creating makefiles in src ...";
|
||||
chdir 'src' or die;
|
||||
@source_files = glob("*.C");
|
||||
@object_files = map {substr($_, 0,-2) . '$(OBJ_EXT)'} @source_files;
|
||||
$, = " \\\n";
|
||||
|
||||
open MFLIB, ">makefile_lib";
|
||||
|
||||
print MFLIB <<'EOF';
|
||||
# This is the makefile for compiling the CGAL object library libCGAL.a.
|
||||
#
|
||||
# N.B. There are different makefiles for creating the object library
|
||||
# and the shared object library, because the suffix rules (in particular:
|
||||
# the compiler flags) for these libraries are different.
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# include platform specific settings
|
||||
#---------------------------------------------------------------------#
|
||||
# Choose the right include file from the <cgalroot>/make directory.
|
||||
|
||||
CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE
|
||||
include $(CGAL_MAKEFILE)
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compiler flags
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
CXXFLAGS = $(CGAL_LIB_CXXFLAGS)
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# Object files
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
CGAL_OBJECTS = \
|
||||
EOF
|
||||
|
||||
print MFLIB @object_files;
|
||||
print MFLIB "\n";
|
||||
|
||||
print MFLIB <<'EOF';
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# target entries
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
lib: lib_no_install
|
||||
mv $(CGAL_LIB) $(CGAL_LIB_DESTINATION)
|
||||
|
||||
lib_no_install: $(CGAL_OBJECTS) $(CGAL_EXTRA_OBJECTS)
|
||||
$(CGAL_LIB_CREATE)$(CGAL_LIB) \
|
||||
`ls *$(OBJ_EXT) | awk '{for (i=1; i<=NF;++i){printf "$(CGAL_OBJ_PREFIX)";print $$i}}'`\
|
||||
$(CGAL_LIB_LDFLAGS)
|
||||
$(RANLIB) $(CGAL_LIB)
|
||||
rm $(CGAL_OBJECTS) $(CGAL_EXTRA_OBJECTS)
|
||||
|
||||
|
||||
clean:
|
||||
rm -f $(CGAL_LIB) $(CGAL_OBJECTS) $(CGAL_EXTRA_OBJECTS)
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# suffix rules
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
.C$(OBJ_EXT):
|
||||
$(CGAL_CXX) $(CXXFLAGS) -c $<
|
||||
|
||||
EOF
|
||||
|
||||
close MFLIB;
|
||||
open MFSHARED, ">makefile_sharedlib";
|
||||
|
||||
print MFSHARED <<'EOF';
|
||||
# This is the makefile for compiling the CGAL shared object library libCGAL.so.
|
||||
#
|
||||
# N.B. There are different makefiles for creating the object library
|
||||
# and the shared object library, because the suffix rules (in particular:
|
||||
# the compiler flags) for these libraries are different.
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# include platform specific settings
|
||||
#---------------------------------------------------------------------#
|
||||
# Choose the right include file from the <cgalroot>/make directory.
|
||||
|
||||
CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE
|
||||
include $(CGAL_MAKEFILE)
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compiler flags
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
CXXFLAGS = $(CGAL_SHARED_LIB_CXXFLAGS)
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# object files
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
CGAL_OBJECTS = \
|
||||
EOF
|
||||
|
||||
print MFSHARED @object_files;
|
||||
print MFSHARED "\n";
|
||||
|
||||
print MFSHARED <<'EOF';
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# target entries
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
lib: $(CGAL_OBJECTS) $(CGAL_EXTRA_OBJECTS)
|
||||
$(CGAL_SHARED_LIB_CREATE)$(CGAL_SHARED_LIB) \
|
||||
`ls *$(OBJ_EXT) | awk '{for (i=1; i<=NF;++i){printf "$(CGAL_OBJ_PREFIX)";print $$i}}'`\
|
||||
$(CGAL_SHARED_LIB_LDFLAGS)
|
||||
mv $(CGAL_SHARED_LIB) '$(CGAL_LIB_DESTINATION)'
|
||||
rm $(CGAL_OBJECTS) $(CGAL_EXTRA_OBJECTS)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# suffix rules
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
.C$(OBJ_EXT):
|
||||
$(CGAL_CXX) $(CXXFLAGS) -c $<
|
||||
|
||||
EOF
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# CreateExampleTestDirs
|
||||
#---------------------------------------------------------------#
|
||||
|
||||
sub CreateExampleTestDirs()
|
||||
{
|
||||
my $DIR;
|
||||
print "Creating $MODULE_NAME/test/example directories ...\n";
|
||||
chdir "$RELEASEDIR/$MODULE_NAME" or die;
|
||||
chdir 'examples' or return;
|
||||
foreach $DIR (glob("*")) {
|
||||
if ( -d $DIR ) {
|
||||
system('cp', '-r', "$DIR", "../test/${DIR}_Examples");
|
||||
}
|
||||
}
|
||||
chdir '..';
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# CreateDemoTestDirs
|
||||
#---------------------------------------------------------------#
|
||||
|
||||
sub CreateDemoTestDirs()
|
||||
{
|
||||
my $DIR;
|
||||
print "Creating $MODULE_NAME/test/demo directories ...\n";
|
||||
chdir "$RELEASEDIR/$MODULE_NAME" or die;
|
||||
chdir 'demo' or return;
|
||||
foreach $DIR (glob("*")) {
|
||||
if ( -d $DIR ) {
|
||||
system('cp', '-r', "$DIR", "../test/${DIR}_Demo");
|
||||
open(CGAL_TEST,">../test/${DIR}_Demo/cgal_test");
|
||||
print CGAL_TEST <<'EOF';
|
||||
#! /bin/sh
|
||||
|
||||
# This is a script for the CGAL test suite. Such a script must obey
|
||||
# the following rules:
|
||||
#
|
||||
# - the name of the script is cgal_test
|
||||
# - for every target two one line messages are written to the file 'error.txt'
|
||||
# the first one indicates if the compilation was successful
|
||||
# the second one indicates if the execution was successful
|
||||
# if one of the two was not successful, the line should start with 'ERROR:'
|
||||
# - running the script should not require any user interaction
|
||||
# - the script should clean up object files and executables
|
||||
|
||||
ERRORFILE=error.txt
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compile
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
compile()
|
||||
{
|
||||
if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \
|
||||
TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \
|
||||
TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" all' >compiler_output 2>&1 ; then
|
||||
echo " succesful compilation " >> $ERRORFILE
|
||||
cat compiler_output
|
||||
else
|
||||
echo " ERROR: compilation " >> $ERRORFILE
|
||||
eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null "
|
||||
eval 'make -k CGAL_MAKEFILE=$CGAL_MAKEFILE \
|
||||
TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \
|
||||
TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" all'
|
||||
fi
|
||||
rm compiler_output
|
||||
eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null "
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# remove the previous error file
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
rm -f $ERRORFILE
|
||||
touch $ERRORFILE
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compile and run the tests
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
compile
|
||||
EOF
|
||||
close(CGAL_TEST);
|
||||
chmod 0755, "../test/${DIR}_Demo/cgal_test";
|
||||
}
|
||||
}
|
||||
chdir '..';
|
||||
}
|
||||
|
||||
|
||||
sub CreateConfigurationTestdir(){
|
||||
print "Creating $MODULE_NAME/test/Configuration directory ...\n";
|
||||
chdir "$RELEASEDIR/$MODULE_NAME" or die;
|
||||
system('cp', '-r', 'config/testfiles', 'test/Configuration');
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# CreateCoreTestDir
|
||||
#---------------------------------------------------------------#
|
||||
|
||||
sub CreateCoreTestDir()
|
||||
{
|
||||
print "Creating $MODULE_NAME/test/src_Core directory ...\n";
|
||||
chdir "$RELEASEDIR/$MODULE_NAME/" or die;
|
||||
system('cp', '-r', 'src/Core', 'test/src_Core');
|
||||
system('cp', 'test/src/cgal_test', 'test/src_Core');
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# CreateSrcTestDir
|
||||
#---------------------------------------------------------------#
|
||||
|
||||
sub CreateSrcTestDir()
|
||||
{
|
||||
print "Creating $MODULE_NAME/test/src directory ...\n";
|
||||
chdir "$RELEASEDIR/$MODULE_NAME" or die;
|
||||
system('cp', '-r', 'src', 'test');
|
||||
rename('test/src/makefile_lib','test/src/makefile');
|
||||
open(CGAL_TEST,">test/src/cgal_test");
|
||||
print CGAL_TEST <<'EOF';
|
||||
#! /bin/sh
|
||||
|
||||
# This is a script for the CGAL test suite. Such a script must obey
|
||||
# the following rules:
|
||||
#
|
||||
# - the name of the script is cgal_test
|
||||
# - for every target two one line messages are written to the file 'error.txt'
|
||||
# the first one indicates if the compilation was successful
|
||||
# the second one indicates if the execution was successful
|
||||
# if one of the two was not successful, the line should start with 'ERROR:'
|
||||
# - running the script should not require any user interaction
|
||||
# - the script should clean up object files and executables
|
||||
|
||||
ERRORFILE=error.txt
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compile_and_run <target>
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
compile()
|
||||
{
|
||||
echo "Compiling $1 ... "
|
||||
SUCCES="y"
|
||||
if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \
|
||||
TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \
|
||||
TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" -k $1' ; then
|
||||
echo " compilation of $1 succeeded" >> $ERRORFILE
|
||||
else
|
||||
echo " ERROR: compilation of $1 failed" >> $ERRORFILE
|
||||
SUCCES=""
|
||||
fi
|
||||
|
||||
eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null "
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# remove the previous error file
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
rm -f $ERRORFILE
|
||||
touch $ERRORFILE
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compile and run the tests
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
if [ $# -ne 0 ] ; then
|
||||
for file in $* ; do
|
||||
compile $file
|
||||
done
|
||||
else
|
||||
compile lib_no_install
|
||||
fi
|
||||
EOF
|
||||
|
||||
close(CGAL_TEST);
|
||||
chmod 0755, 'test/src/cgal_test';
|
||||
}
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# create cgal_test script in tests
|
||||
#---------------------------------------------------------------#
|
||||
sub create_test(){
|
||||
open(CGAL_TEST,">cgal_test");
|
||||
print CGAL_TEST <<'EOF';
|
||||
#! /bin/sh
|
||||
|
||||
# This is a script for the CGAL test suite. Such a script must obey
|
||||
# the following rules:
|
||||
#
|
||||
# - the name of the script is cgal_test
|
||||
# - for every target two one line messages are written to the file 'error.txt'
|
||||
# the first one indicates if the compilation was successful
|
||||
# the second one indicates if the execution was successful
|
||||
# if one of the two was not successful, the line should start with 'ERROR:'
|
||||
# - running the script should not require any user interaction
|
||||
# - the script should clean up object files and executables
|
||||
|
||||
ERRORFILE=error.txt
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compile_and_run <target>
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
compile_and_run()
|
||||
{
|
||||
echo "Compiling $1 ... "
|
||||
SUCCES="y"
|
||||
if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \
|
||||
TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \
|
||||
TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $1' ; then
|
||||
echo " succesful compilation of $1" >> $ERRORFILE
|
||||
else
|
||||
echo " ERROR: compilation of $1" >> $ERRORFILE
|
||||
SUCCES=""
|
||||
fi
|
||||
|
||||
if [ -n "${SUCCES}" ] ; then
|
||||
OUTPUTFILE=ProgramOutput.$1.$PLATFORM
|
||||
rm -f $OUTPUTFILE
|
||||
COMMAND="./$1"
|
||||
if [ -f $1.cmd ] ; then
|
||||
COMMAND="$COMMAND `cat $1.cmd`"
|
||||
fi
|
||||
if [ -f $1.cin ] ; then
|
||||
COMMAND="cat $1.cin | $COMMAND"
|
||||
fi
|
||||
echo "Executing $1 ... "
|
||||
echo
|
||||
ulimit -t 1200 2> /dev/null
|
||||
if eval $COMMAND > $OUTPUTFILE 2>&1 ; then
|
||||
echo " succesful execution of $1" >> $ERRORFILE
|
||||
else
|
||||
echo " ERROR: execution of $1" >> $ERRORFILE
|
||||
fi
|
||||
else
|
||||
echo " ERROR: not executed $1" >> $ERRORFILE
|
||||
fi
|
||||
|
||||
eval "make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null 2>&1 "
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# remove the previous error file
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
rm -f $ERRORFILE
|
||||
touch $ERRORFILE
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compile and run the tests
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
if [ $# -ne 0 ] ; then
|
||||
for file in $* ; do
|
||||
compile_and_run $file
|
||||
done
|
||||
else
|
||||
EOF
|
||||
close(CGAL_TEST);
|
||||
|
||||
open(CGAL_TEST,">>cgal_test");
|
||||
my $cfile;
|
||||
foreach $cfile (glob("*.C")) {
|
||||
substr($cfile, -2, 2) = "";
|
||||
print CGAL_TEST " compile_and_run $cfile\n";
|
||||
}
|
||||
print CGAL_TEST "fi\n";
|
||||
close(CGAL_TEST);
|
||||
chmod 0755, 'cgal_test';
|
||||
}
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# make_testscripts and generate makefiles in test and examples
|
||||
#---------------------------------------------------------------#
|
||||
|
||||
sub make_testscripts()
|
||||
{
|
||||
my ($DIR, $BASEDIR);
|
||||
chdir "$RELEASEDIR/$MODULE_NAME" or die;
|
||||
$BASEDIR = cwd();
|
||||
print "Creating and checking makefiles ...\n";
|
||||
|
||||
chdir 'test';
|
||||
foreach $DIR (glob("*")) {
|
||||
if ( -d $DIR ) {
|
||||
chdir $DIR;
|
||||
if ( -f 'Makefile') {
|
||||
rename 'Makefile', 'makefile';
|
||||
}
|
||||
if ( -f 'makefile' ) {
|
||||
open MAKEFILE, "makefile";
|
||||
open NEW_MAKEFILE, ">makefile.new";
|
||||
while (<MAKEFILE>) {
|
||||
s/\.o\b/\$(OBJ_EXT)/g;
|
||||
s/-g\b/\$(DEBUG_OPT)/g;
|
||||
print NEW_MAKEFILE $_;
|
||||
}
|
||||
close NEW_MAKEFILE;
|
||||
close MAKEFILE;
|
||||
rename("makefile.new","makefile");
|
||||
} else {
|
||||
my $options = '-t';
|
||||
if ( -f 'create_makefile_options') {
|
||||
if (open(OPTIONS, "<create_makefile_options")) {
|
||||
$_ = <OPTIONS>;
|
||||
chomp;
|
||||
if (/^[\w\s-]+$/) { $options = $_;
|
||||
} else {
|
||||
print STDERR "Rejected create_makefile_options in $DIR\n";
|
||||
}
|
||||
close OPTIONS;
|
||||
}
|
||||
}
|
||||
system("$SCRIPTSDIR/create_makefile", $options);
|
||||
}
|
||||
if ( ! -f 'cgal_test' ) {
|
||||
create_test();
|
||||
}
|
||||
chdir '..';
|
||||
}
|
||||
}
|
||||
chdir $BASEDIR;
|
||||
chdir 'examples';
|
||||
# Windows specific stuff
|
||||
print "Creating VC++ projects in examples ...\n";
|
||||
system("${SCRIPTSDIR}/../../wininst/developer_scripts/examples/C2vcproj", "*");
|
||||
print "Creating makefiles in examples ...\n";
|
||||
foreach $DIR (glob("*")) {
|
||||
if ( -d $DIR ) {
|
||||
chdir $DIR;
|
||||
if ( -f 'Makefile') {
|
||||
rename 'Makefile', 'makefile';
|
||||
}
|
||||
if ( -f 'makefile' ) {
|
||||
open MAKEFILE, "makefile";
|
||||
open NEW_MAKEFILE, ">makefile.new";
|
||||
while (<MAKEFILE>) {
|
||||
s/\.o\b/\$(OBJ_EXT)/g;
|
||||
s/-g\b/\$(DEBUG_OPT)/g;
|
||||
print NEW_MAKEFILE $_;
|
||||
}
|
||||
close NEW_MAKEFILE;
|
||||
close MAKEFILE;
|
||||
rename("makefile.new","makefile");
|
||||
} else {
|
||||
my $options = '-d';
|
||||
if ( -f 'create_makefile_options') {
|
||||
if (open(OPTIONS, "<create_makefile_options")) {
|
||||
$_ = <OPTIONS>;
|
||||
chomp;
|
||||
if (/^[\w\s-]+$/) { $options = $_;
|
||||
} else {
|
||||
print STDERR "Rejected create_makefile_options in $DIR\n";
|
||||
}
|
||||
close OPTIONS;
|
||||
}
|
||||
}
|
||||
system("$SCRIPTSDIR/create_makefile", $options);
|
||||
}
|
||||
chdir '..';
|
||||
}
|
||||
}
|
||||
chdir $BASEDIR;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------#
|
||||
# check_and_update_file #
|
||||
#----------------------------------------------------------------#
|
||||
|
||||
sub check_and_update_file($$)
|
||||
{
|
||||
my ($filename, $filename_with_dir) = @_;
|
||||
my $header_type = 0;
|
||||
my $lines_exceeding_length = 0;
|
||||
my $has_line_directives = 0;
|
||||
unlink $TEMPFILE;
|
||||
open SOURCE_FILE, "<$filename" || die "Error opening $filename_with_dir: $!\n";
|
||||
open TEMPFILE, ">$TEMPFILE" || die;
|
||||
while ( <SOURCE_FILE> ) {
|
||||
$header_type = 1
|
||||
if m|^Copyright \(c\) \d{4](,\s?\d{4})* The CGAL Consortium|;
|
||||
$header_type = 2
|
||||
if m|^// Copyright \(c\) \d{4}(,\s?\d{4})* The CGAL Consortium|;
|
||||
$lines_exceeding_length +=1 if length $_ > 80;
|
||||
$has_line_directives = 1 if m|^\s*#\s*line\s|;
|
||||
print TEMPFILE $_;
|
||||
}
|
||||
close SOURCE_FILE || die "Error closing $filename_with_dir: $!";
|
||||
close TEMPFILE || die "Error closing temporary file: $!\n";
|
||||
rename($TEMPFILE, $filename )
|
||||
|| system('mv', "$TEMPFILE", "$filename")
|
||||
|| warn "Could not update file $filename_with_dir\n";
|
||||
if ($header_type == 0) {
|
||||
print FILE_CHECKS "$filename_with_dir has unrecognised header.\n";
|
||||
} elsif ($header_type == 1) {
|
||||
print FILE_CHECKS "$filename_with_dir has old style header.\n";
|
||||
}
|
||||
if ($lines_exceeding_length) {
|
||||
print FILE_CHECKS "$filename_with_dir has $lines_exceeding_length",
|
||||
" lines over 80 characters.\n";
|
||||
}
|
||||
if ($has_line_directives) {
|
||||
print FILE_CHECKS "$filename_with_dir has line directives.\n";
|
||||
}
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------#
|
||||
# set_file_headers #
|
||||
#----------------------------------------------------------------#
|
||||
|
||||
sub set_file_headers()
|
||||
{
|
||||
print "Setting file headers...\n";
|
||||
chdir "$RELEASEDIR/$MODULE_NAME";
|
||||
chomp($release_date);
|
||||
open(FILE_CHECKS,">$PARENT_DIR/code_check_$VERSION");
|
||||
find(\&file_header_setting, 'include', 'src', 'examples', 'config/testfiles');
|
||||
close FILE_CHECKS;
|
||||
chdir $MAIN_DIR;
|
||||
}
|
||||
|
||||
sub file_header_setting
|
||||
{
|
||||
my ($filename,$dev,$ino,$mode,$nlink,$uid,$gid,$filetype);
|
||||
$filename = $_;
|
||||
if ( ! /\.[h|C]$/ ||
|
||||
! (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($filename)) ||
|
||||
! -f _ ) {
|
||||
return;
|
||||
}
|
||||
check_and_update_file($filename, $File::Find::name);
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------#
|
||||
# Main entry point #
|
||||
#----------------------------------------------------#
|
||||
|
||||
|
||||
sub main(){
|
||||
|
||||
getopts('hr:a:d:l:p:s:n:m:');
|
||||
if ($::opt_h ) {
|
||||
usage();
|
||||
die "\n";
|
||||
}
|
||||
if ($::opt_d){
|
||||
$RELEASEDIR = $::opt_d;
|
||||
$ALLPACKAGESDIR = "$RELEASEDIR/All";
|
||||
$SCRIPTSDIR = "$RELEASEDIR";
|
||||
$LOCKFILE="$RELEASEDIR/release_creation.lock";
|
||||
$packages_file="$RELEASEDIR/include_in_release";
|
||||
}
|
||||
|
||||
if ($::opt_m){
|
||||
$MODULE_NAME = $::opt_m;
|
||||
} else {
|
||||
$MODULE_NAME = "NEW_MODULE";
|
||||
}
|
||||
|
||||
if ($::opt_r){
|
||||
$VERSION = $::opt_r;
|
||||
if ($::opt_n){
|
||||
$VERSION_NR = $::opt_n;
|
||||
} else {
|
||||
$VERSION_NR = $VERSION;
|
||||
}
|
||||
} else {
|
||||
usage();
|
||||
die "\n";
|
||||
}
|
||||
if ($::opt_a){
|
||||
$ALLPACKAGESDIR = $::opt_a;
|
||||
}
|
||||
if ($::opt_s){
|
||||
$SCRIPTSDIR = $::opt_s;
|
||||
}
|
||||
if ($::opt_l){
|
||||
$LOCKFILE = $::opt_l;
|
||||
}
|
||||
if ($::opt_p){
|
||||
$packages_file = $::opt_p;
|
||||
}
|
||||
print "Initializing variables ...\n";
|
||||
print " Release dir: $RELEASEDIR\n";
|
||||
print " All packages dir: $ALLPACKAGESDIR\n";
|
||||
print " Scripts dir: $SCRIPTSDIR\n";
|
||||
print " Lockfile: $LOCKFILE\n";
|
||||
print " Packages file : $packages_file\n";
|
||||
umask(002);
|
||||
chdir $RELEASEDIR or die;
|
||||
if (! -d $MODULE_NAME){
|
||||
print "Creating CGAL module ${MODULE_NAME} ...\n";
|
||||
mkdir($MODULE_NAME, 0775);
|
||||
} else {
|
||||
print "$MODULE_NAME already exists in $RELEASEDIR\n";
|
||||
print "Please remove it first\n";
|
||||
exit 1;
|
||||
}
|
||||
lock;
|
||||
|
||||
create_packages_dir();
|
||||
install_packages();
|
||||
#CreateConfigurationTestdir();
|
||||
#CreateDemoTestDirs();
|
||||
#CreateExampleTestDirs();
|
||||
create_version_file();
|
||||
create_version_tex_file();
|
||||
make_testscripts();
|
||||
set_file_headers();
|
||||
make_src_makefiles();
|
||||
#CreateSrcTestDir();
|
||||
#CreateCoreTestDir();
|
||||
|
||||
|
||||
|
||||
#CLEANING UP THE MODULE
|
||||
chdir "$RELEASEDIR/$MODULE_NAME" or die;
|
||||
system("rm", "-rf", "test");
|
||||
system("rm", "-rf", "developer_scripts");
|
||||
system("rm", "-rf", "Modules");
|
||||
system("rm", "-rf", "web", "noweb");
|
||||
|
||||
@file_list_to_be_removed = glob("*");
|
||||
foreach $i (@file_list_to_be_removed){
|
||||
if ( -f $i ){
|
||||
chomp($i);
|
||||
if ( $i ne "install_cgal" ){
|
||||
system("rm -f ${i} 2>/dev/null");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unlock;
|
||||
|
||||
}
|
||||
|
||||
main();
|
||||
+993
@@ -0,0 +1,993 @@
|
||||
#!/usr/bin/env perl
|
||||
#this script generates the internal release
|
||||
|
||||
use Cwd;
|
||||
use File::Find;
|
||||
use Getopt::Std;
|
||||
|
||||
sub usage() {
|
||||
print STDERR<<"EOF";
|
||||
usage:
|
||||
$0 (-h|-r)
|
||||
[-n version number]
|
||||
[-d releasedir] [-a allpackagesdir]
|
||||
[-s scriptsdir]
|
||||
[-l lockfile] [-p packagesfile]
|
||||
|
||||
Exactly one of the options -h or -r must be present.
|
||||
-h show this message and quit
|
||||
-r release version to be created
|
||||
|
||||
-n version number (CGAL_VERSION_NR)
|
||||
-d releasedir, default releasedir is the current dir
|
||||
-a allpackagesdir, default is releasedir/All
|
||||
-s scriptsdir, default is releasedir
|
||||
-l lockfile, default is releasedir/release_creation.lock
|
||||
-p packagesfile, default is releasedir/include_in_release
|
||||
|
||||
The version number is stored in include/CGAL/version.h.
|
||||
The RELEASEDIR is the place where the new release will be created.
|
||||
The ALLPACKAGESDIR is the directory that contains the checked out packages
|
||||
from the CVS. Could be a taged version (<<current_submission>>) or some
|
||||
other version.
|
||||
The SCRIPTSDIR is the place where you have the create_makefile script.
|
||||
This script you can take it from CVS/Scripts/scripts/create_makefile.
|
||||
You need this script to create the default makefiles for examples and
|
||||
tests.
|
||||
The LOCKFILE is some file used by lockfile command as a mutex.
|
||||
The PACKAGESFILE is the file that contains a list of the packages you want
|
||||
to include in this release. In fact it is a filter for packages you have
|
||||
in ALLPACKAGESDIR. There is one file that is used to create the CGAL
|
||||
internal release in CVS/Maintenance/release_building/include_in_release.
|
||||
You can take that one too.
|
||||
|
||||
Example of how to use the script:
|
||||
>cvs -q co -P -r current_submission All
|
||||
>./create_internal_release -r CGAL-3.3-I-1
|
||||
or
|
||||
>./create_internal_release -r CGAL-3.3-I-7 -d \$HOME -a \$HOME/CGALCVS/All -s \$HOME/scripts -l release_creation.lock -p include_in_release
|
||||
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
my $TEMPFILE="TEMPFILE.$$";
|
||||
|
||||
#----------------------------------------------------#
|
||||
# Initialisation #
|
||||
#----------------------------------------------------#
|
||||
|
||||
my (
|
||||
$VERSION,
|
||||
$VERSION_NR,
|
||||
$LOCKFILE,
|
||||
$ALLPACKAGESDIR,
|
||||
$RELEASEDIR,
|
||||
$MAINDIR,
|
||||
$SCRIPTSDIR,
|
||||
$LOCKCMD,
|
||||
$packages_file
|
||||
);
|
||||
|
||||
$RELEASEDIR=cwd();
|
||||
$ALLPACKAGESDIR="$RELEASEDIR/All";
|
||||
$LOCKFILE="$RELEASEDIR/release_creation.lock";
|
||||
$SCRIPTSDIR=$RELEASEDIR;
|
||||
$LOCKCMD='lockfile';
|
||||
$packages_file="$RELEASEDIR/include_in_release";
|
||||
|
||||
|
||||
|
||||
|
||||
sub termination_signal_handler {
|
||||
unlink $LOCKFILE;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
sub lock()
|
||||
{
|
||||
if (system("$LOCKCMD", "-r", '10', "$LOCKFILE") != 0) {
|
||||
print STDERR <<"TOTHIER";
|
||||
The script could not proceed because
|
||||
it could not acquire the needed lock on file $LOCKFILE.
|
||||
TOTHIER
|
||||
exit 1;
|
||||
}
|
||||
$SIG{INT} = \&termination_signal_handler;
|
||||
$SIG{TERM} = \&termination_signal_handler;
|
||||
}
|
||||
|
||||
sub unlock()
|
||||
{
|
||||
unlink $LOCKFILE;
|
||||
$SIG{INT} = 'DEFAULT';
|
||||
$SIG{TERM} = 'DEFAULT';
|
||||
}
|
||||
|
||||
sub create_packages_dir(){
|
||||
print "Creating $VERSION/Packages directory ...\n";
|
||||
chdir $RELEASEDIR or die;
|
||||
if (! -f $packages_file){
|
||||
print STDERR "$packages_file file does not exist\n";
|
||||
unlock;
|
||||
die "\n";
|
||||
}
|
||||
open PACKAGES_TO_INCLUDE, "$packages_file" or die;
|
||||
while (<PACKAGES_TO_INCLUDE>){
|
||||
chomp;
|
||||
s/\s*//g;
|
||||
next if /^$/;
|
||||
$is_permitted_package{$_}=1;
|
||||
}
|
||||
close PACKAGES_TO_INCLUDE;
|
||||
|
||||
opendir ALLPACKAGESDIR, $ALLPACKAGESDIR or die;
|
||||
while (defined($package_name = readdir(ALLPACKAGESDIR))) {
|
||||
next unless $is_permitted_package{$package_name};
|
||||
chdir "$RELEASEDIR/$VERSION" or die;
|
||||
mkdir('Packages', 0775);
|
||||
chdir 'Packages';
|
||||
mkdir($package_name, 0775);
|
||||
if (-f "$ALLPACKAGESDIR/$package_name/maintainer"){
|
||||
system('cp', "$ALLPACKAGESDIR/$package_name/maintainer", "$RELEASEDIR/$VERSION/Packages/$package_name");
|
||||
}
|
||||
if (-f "$ALLPACKAGESDIR/$package_name/version"){
|
||||
system('cp', "$ALLPACKAGESDIR/$package_name/version", "$RELEASEDIR/$VERSION/Packages/$package_name");
|
||||
}
|
||||
if (-f "$ALLPACKAGESDIR/$package_name/changes.txt"){
|
||||
system('cp', "$ALLPACKAGESDIR/$package_name/changes.txt", "$RELEASEDIR/$VERSION/Packages/$package_name");
|
||||
}
|
||||
if (-f "$ALLPACKAGESDIR/$package_name/description.txt"){
|
||||
system('cp', "$ALLPACKAGESDIR/$package_name/description.txt", "$RELEASEDIR/$VERSION/Packages/$package_name");
|
||||
}
|
||||
|
||||
}
|
||||
closedir ALLPACKAGESDIR;
|
||||
}
|
||||
|
||||
sub create_global_makefile{
|
||||
printf("Creating the global makefile in the test dir ...\n");
|
||||
chdir "$RELEASEDIR/$VERSION" or die;
|
||||
if ( -e "test/Makefile"){
|
||||
system("rm -f Makefile");
|
||||
}
|
||||
opendir testdir, "test";
|
||||
@dirs = readdir testdir;
|
||||
closedir testdir;
|
||||
shift @dirs; shift @dirs;
|
||||
chdir "test" or die;
|
||||
open(TEMPFILE, ">tempfile") or die;
|
||||
print TEMPFILE "testsuite: ";
|
||||
foreach $dir (@dirs){
|
||||
if ( -d $dir){
|
||||
print TEMPFILE "test_$dir ";
|
||||
}
|
||||
}
|
||||
print TEMPFILE "\n";
|
||||
foreach $dir (@dirs){
|
||||
if ( -d $dir){
|
||||
print TEMPFILE "test_$dir:\n\t+ ./run_testsuite $dir\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
system('mv', "tempfile", 'Makefile');
|
||||
};
|
||||
|
||||
sub install_packages() {
|
||||
my ($filename, $direc, %is_permited_package, $package_name, $tmp_package_name);
|
||||
print "Installing packages ...\n";
|
||||
chdir $RELEASEDIR or die;
|
||||
if (! -f $packages_file){
|
||||
print STDERR "$packages_file file does not exist\n";
|
||||
unlock;
|
||||
die "\n";
|
||||
}
|
||||
|
||||
|
||||
open PACKAGES_TO_INCLUDE, "$packages_file" or die;
|
||||
while (<PACKAGES_TO_INCLUDE>){
|
||||
chomp;
|
||||
s/\s*//g;
|
||||
next if /^$/;
|
||||
$is_permitted_package{$_}=1;
|
||||
}
|
||||
close PACKAGES_TO_INCLUDE;
|
||||
|
||||
opendir ALLPACKAGESDIR, $ALLPACKAGESDIR or die;
|
||||
while (defined($package_name = readdir(ALLPACKAGESDIR))) {
|
||||
next unless $is_permitted_package{$package_name};
|
||||
$dont_submit="$ALLPACKAGESDIR/$package_name/dont_submit";
|
||||
$exclude_command="--exclude-from=$dont_submit";
|
||||
chdir "$ALLPACKAGESDIR" or die;
|
||||
if(-f $dont_submit){
|
||||
system('tar', '-cf', "$RELEASEDIR/temppack.tar", '--exclude=CVS', "$exclude_command", '--exclude=TODO', '--exclude=dont_submit', '--exclude=maintainer', '--exclude=description.txt', '--exclude=wrapper.tex', '--exclude=changes.txt', '--exclude=version', '--exclude=.cvsignore', "$package_name");
|
||||
} else {
|
||||
system('tar', '-cf', "$RELEASEDIR/temppack.tar", '--exclude=CVS', '--exclude=dont_submit', '--exclude=maintainer', '--exclude=description.txt', '--exclude=changes.txt', '--exclude=TODO', '--exclude=wrapper.tex', '--exclude=version', '--exclude=.cvsignore',"$package_name");
|
||||
}
|
||||
system('mv', "$RELEASEDIR/temppack.tar", "$RELEASEDIR/$VERSION/");
|
||||
|
||||
|
||||
chdir "$RELEASEDIR/$VERSION" or die;
|
||||
system('tar', '-xf', "temppack.tar");
|
||||
$tmp_package_name = "temp_${package_name}";
|
||||
system("mv", "$package_name", "$tmp_package_name");
|
||||
opendir packagename, "$tmp_package_name";
|
||||
@fichiers = readdir packagename;
|
||||
closedir packagename;
|
||||
shift @fichiers; shift @fichiers;
|
||||
foreach $fichier (@fichiers){
|
||||
system('cp', '-r', "$tmp_package_name/$fichier", "$RELEASEDIR/$VERSION");
|
||||
}
|
||||
system('rm', '-rf', "$tmp_package_name");
|
||||
|
||||
}
|
||||
closedir ALLPACKAGESDIR;
|
||||
unlink 'temppack.tar', 'description.txt', 'long_description.txt', 'changes.txt', 'submission_info', 'long_description.txt.old';
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# set the version information in the include/CGAL/version.h #
|
||||
#-----------------------------------------------------------------------#
|
||||
|
||||
sub create_version_file()
|
||||
{
|
||||
chdir "$RELEASEDIR/$VERSION/include/CGAL" or die;
|
||||
open(TEMPFILE, ">tempfile") or die;
|
||||
|
||||
#if VERSION starts with CGAL-, we remove "CGAL-" from version
|
||||
#the $newver variable will store the right version
|
||||
if ($result = $VERSION =~ /CGAL-(.*)/){
|
||||
$newver = $1;
|
||||
} else {
|
||||
$newver = $VERSION;
|
||||
}
|
||||
|
||||
print TEMPFILE << 'EOF';
|
||||
// Copyright (c) 2005 Utrecht University (The Netherlands),
|
||||
// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany),
|
||||
// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
|
||||
// (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria),
|
||||
// and Tel-Aviv University (Israel). All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; version 2.1 of the License.
|
||||
// See the file LICENSE.LGPL distributed with CGAL.
|
||||
//
|
||||
// Licensees holding a valid commercial license may use this file in
|
||||
// accordance with the commercial license agreement provided with the software.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : -
|
||||
|
||||
// This file is automatically created by create_internal_release.
|
||||
// Do not edit manually.
|
||||
|
||||
#ifndef CGAL_VERSION_H
|
||||
#define CGAL_VERSION_H
|
||||
|
||||
EOF
|
||||
print TEMPFILE "#define CGAL_VERSION $newver\n";
|
||||
print TEMPFILE "#define CGAL_VERSION_NR $VERSION_NR\n\n#endif\n";
|
||||
|
||||
close TEMPFILE || die "Error closing temporary file: $!\n";
|
||||
system('mv', "tempfile", 'version.h');
|
||||
chdir '../..' or die;
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# set the version information in the doc_tex/version.tex #
|
||||
#-----------------------------------------------------------------------#
|
||||
|
||||
sub create_version_tex_file()
|
||||
{
|
||||
chdir "$RELEASEDIR/$VERSION/doc_tex" or die;
|
||||
open(TEMPFILE, ">tempfile") or die;
|
||||
#if VERSION starts with CGAL-, we remove "CGAL-" from version
|
||||
#the $newver variable will store the right version
|
||||
if ($result = $VERSION =~ /CGAL-(.*)/){
|
||||
$newver = $1;
|
||||
} else {
|
||||
$newver = $VERSION;
|
||||
}
|
||||
|
||||
print TEMPFILE << 'EOF';
|
||||
%% This file is automatically created by create_internal_release.
|
||||
%% Do not edit manually.
|
||||
|
||||
EOF
|
||||
print TEMPFILE "\\gdef\\cgalversion{$newver}\n";
|
||||
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||
|
||||
my @months = ( "January", "February", "March", "April",
|
||||
"May", "June", "July", "August", "September",
|
||||
"October", "November", "December" );
|
||||
|
||||
print TEMPFILE "\\gdef\\cgalversiondate{$mday $months[$mon] ", 1900 + $year, "}\n";
|
||||
|
||||
close TEMPFILE || die "Error closing temporary file: $!\n";
|
||||
system('mv', "tempfile", 'version.tex');
|
||||
chdir '../..' or die;
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub make_src_makefiles(){
|
||||
chdir "$RELEASEDIR/$VERSION" or die;
|
||||
chdir 'src' or die;
|
||||
@source_files = glob("*.C");
|
||||
@object_files = map {substr($_, 0,-2) . '$(OBJ_EXT)'} @source_files;
|
||||
$, = " \\\n";
|
||||
|
||||
open MFLIB, ">makefile_lib";
|
||||
|
||||
print MFLIB <<'EOF';
|
||||
# This is the makefile for compiling the CGAL object library libCGAL.a.
|
||||
#
|
||||
# N.B. There are different makefiles for creating the object library
|
||||
# and the shared object library, because the suffix rules (in particular:
|
||||
# the compiler flags) for these libraries are different.
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# include platform specific settings
|
||||
#---------------------------------------------------------------------#
|
||||
# Choose the right include file from the <cgalroot>/make directory.
|
||||
|
||||
CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE
|
||||
include $(CGAL_MAKEFILE)
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compiler flags
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
CXXFLAGS = $(CGAL_LIB_CXXFLAGS)
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# Object files
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
CGAL_OBJECTS = \
|
||||
EOF
|
||||
|
||||
print MFLIB @object_files;
|
||||
print MFLIB "\n";
|
||||
|
||||
print MFLIB <<'EOF';
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# target entries
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
lib: lib_no_install
|
||||
mv $(CGAL_LIB) $(CGAL_LIB_DESTINATION)
|
||||
|
||||
lib_no_install: $(CGAL_OBJECTS) $(CGAL_EXTRA_OBJECTS)
|
||||
$(CGAL_LIB_CREATE)$(CGAL_LIB) \
|
||||
`ls *$(OBJ_EXT) | awk '{for (i=1; i<=NF;++i){printf "$(CGAL_OBJ_PREFIX)";print $$i}}'`\
|
||||
$(CGAL_LIB_LDFLAGS)
|
||||
$(RANLIB) $(CGAL_LIB)
|
||||
rm $(CGAL_OBJECTS) $(CGAL_EXTRA_OBJECTS)
|
||||
|
||||
|
||||
clean:
|
||||
rm -f $(CGAL_LIB) $(CGAL_OBJECTS) $(CGAL_EXTRA_OBJECTS)
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# suffix rules
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
.C$(OBJ_EXT):
|
||||
$(CGAL_CXX) $(CXXFLAGS) -c $<
|
||||
|
||||
EOF
|
||||
|
||||
close MFLIB;
|
||||
open MFSHARED, ">makefile_sharedlib";
|
||||
|
||||
print MFSHARED <<'EOF';
|
||||
# This is the makefile for compiling the CGAL shared object library libCGAL.so.
|
||||
#
|
||||
# N.B. There are different makefiles for creating the object library
|
||||
# and the shared object library, because the suffix rules (in particular:
|
||||
# the compiler flags) for these libraries are different.
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# include platform specific settings
|
||||
#---------------------------------------------------------------------#
|
||||
# Choose the right include file from the <cgalroot>/make directory.
|
||||
|
||||
CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE
|
||||
include $(CGAL_MAKEFILE)
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compiler flags
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
CXXFLAGS = $(CGAL_SHARED_LIB_CXXFLAGS)
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# object files
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
CGAL_OBJECTS = \
|
||||
EOF
|
||||
|
||||
print MFSHARED @object_files;
|
||||
print MFSHARED "\n";
|
||||
|
||||
print MFSHARED <<'EOF';
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# target entries
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
lib: $(CGAL_OBJECTS) $(CGAL_EXTRA_OBJECTS)
|
||||
$(CGAL_SHARED_LIB_CREATE)$(CGAL_SHARED_LIB) \
|
||||
`ls *$(OBJ_EXT) | awk '{for (i=1; i<=NF;++i){printf "$(CGAL_OBJ_PREFIX)";print $$i}}'`\
|
||||
$(CGAL_SHARED_LIB_LDFLAGS)
|
||||
mv $(CGAL_SHARED_LIB) '$(CGAL_LIB_DESTINATION)'
|
||||
rm $(CGAL_OBJECTS) $(CGAL_EXTRA_OBJECTS)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# suffix rules
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
.C$(OBJ_EXT):
|
||||
$(CGAL_CXX) $(CXXFLAGS) -c $<
|
||||
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# CreateExampleTestDirs
|
||||
#---------------------------------------------------------------#
|
||||
|
||||
sub CreateExampleTestDirs()
|
||||
{
|
||||
my $DIR;
|
||||
print "Creating $VERSION/test/example directories ...\n";
|
||||
chdir "$RELEASEDIR/$VERSION" or die;
|
||||
chdir 'examples' or return;
|
||||
foreach $DIR (glob("*")) {
|
||||
if ( -d $DIR ) {
|
||||
system('cp', '-r', "$DIR", "../test/${DIR}_Examples");
|
||||
}
|
||||
}
|
||||
chdir '..';
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# CreateDemoTestDirs
|
||||
#---------------------------------------------------------------#
|
||||
|
||||
sub CreateDemoTestDirs()
|
||||
{
|
||||
my $DIR;
|
||||
print "Creating $VERSION/test/demo directories ...\n";
|
||||
chdir "$RELEASEDIR/$VERSION" or die;
|
||||
chdir 'demo' or return;
|
||||
foreach $DIR (glob("*")) {
|
||||
if ( -d $DIR ) {
|
||||
system('cp', '-r', "$DIR", "../test/${DIR}_Demo");
|
||||
open(CGAL_TEST,">../test/${DIR}_Demo/cgal_test");
|
||||
print CGAL_TEST <<'EOF';
|
||||
#! /bin/sh
|
||||
|
||||
# This is a script for the CGAL test suite. Such a script must obey
|
||||
# the following rules:
|
||||
#
|
||||
# - the name of the script is cgal_test
|
||||
# - for every target two one line messages are written to the file 'error.txt'
|
||||
# the first one indicates if the compilation was successful
|
||||
# the second one indicates if the execution was successful
|
||||
# if one of the two was not successful, the line should start with 'ERROR:'
|
||||
# - running the script should not require any user interaction
|
||||
# - the script should clean up object files and executables
|
||||
|
||||
ERRORFILE=error.txt
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compile
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
compile()
|
||||
{
|
||||
if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \
|
||||
TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \
|
||||
TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" all' >compiler_output 2>&1 ; then
|
||||
echo " succesful compilation " >> $ERRORFILE
|
||||
cat compiler_output
|
||||
else
|
||||
echo " ERROR: compilation " >> $ERRORFILE
|
||||
eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null "
|
||||
eval 'make -k CGAL_MAKEFILE=$CGAL_MAKEFILE \
|
||||
TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \
|
||||
TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" all'
|
||||
fi
|
||||
rm compiler_output
|
||||
eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null "
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# remove the previous error file
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
rm -f $ERRORFILE
|
||||
touch $ERRORFILE
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compile and run the tests
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
compile
|
||||
EOF
|
||||
close(CGAL_TEST);
|
||||
chmod 0755, "../test/${DIR}_Demo/cgal_test";
|
||||
}
|
||||
}
|
||||
chdir '..';
|
||||
}
|
||||
|
||||
|
||||
sub CreateConfigurationTestdir(){
|
||||
print "Creating $VERSION/test/Configuration directory ...\n";
|
||||
chdir "$RELEASEDIR/$VERSION" or die;
|
||||
system('cp', '-r', 'config/testfiles', 'test/Configuration');
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# CreateSrcQtTestDir
|
||||
#---------------------------------------------------------------#
|
||||
|
||||
sub CreateSrcQtTestDir()
|
||||
{
|
||||
print "Creating $VERSION/test/src_Qt directory ...\n";
|
||||
chdir "$RELEASEDIR/$VERSION/" or die;
|
||||
system('cp', '-r', 'src/CGALQt', 'test/src_Qt');
|
||||
# Must be called after CreateSrcTestDir().
|
||||
system('cp', 'test/src/cgal_test', 'test/src_Qt');
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# CreateSrcCoreTestDir
|
||||
#---------------------------------------------------------------#
|
||||
|
||||
sub CreateSrcCoreTestDir()
|
||||
{
|
||||
print "Creating $VERSION/test/src_Core directory ...\n";
|
||||
chdir "$RELEASEDIR/$VERSION/" or die;
|
||||
system('cp', '-r', 'src/Core', 'test/src_Core');
|
||||
# Must be called after CreateSrcTestDir().
|
||||
system('cp', 'test/src/cgal_test', 'test/src_Core');
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# CreateSrcTestDir
|
||||
#---------------------------------------------------------------#
|
||||
|
||||
sub CreateSrcTestDir()
|
||||
{
|
||||
print "Creating $VERSION/test/src directory ...\n";
|
||||
chdir "$RELEASEDIR/$VERSION" or die;
|
||||
system('cp', '-r', 'src', 'test');
|
||||
rename('test/src/makefile_lib','test/src/makefile');
|
||||
open(CGAL_TEST,">test/src/cgal_test");
|
||||
print CGAL_TEST <<'EOF';
|
||||
#! /bin/sh
|
||||
|
||||
# This is a script for the CGAL test suite. Such a script must obey
|
||||
# the following rules:
|
||||
#
|
||||
# - the name of the script is cgal_test
|
||||
# - for every target two one line messages are written to the file 'error.txt'
|
||||
# the first one indicates if the compilation was successful
|
||||
# the second one indicates if the execution was successful
|
||||
# if one of the two was not successful, the line should start with 'ERROR:'
|
||||
# - running the script should not require any user interaction
|
||||
# - the script should clean up object files and executables
|
||||
|
||||
ERRORFILE=error.txt
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compile_and_run <target>
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
compile()
|
||||
{
|
||||
echo "Compiling $1 ... "
|
||||
SUCCES="y"
|
||||
if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \
|
||||
TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \
|
||||
TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" -k $1' ; then
|
||||
echo " compilation of $1 succeeded" >> $ERRORFILE
|
||||
else
|
||||
echo " ERROR: compilation of $1 failed" >> $ERRORFILE
|
||||
SUCCES=""
|
||||
fi
|
||||
|
||||
eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null "
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# remove the previous error file
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
rm -f $ERRORFILE
|
||||
touch $ERRORFILE
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compile and run the tests
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
if [ $# -ne 0 ] ; then
|
||||
for file in $* ; do
|
||||
compile $file
|
||||
done
|
||||
else
|
||||
compile lib_no_install
|
||||
fi
|
||||
EOF
|
||||
|
||||
close(CGAL_TEST);
|
||||
chmod 0755, 'test/src/cgal_test';
|
||||
}
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# create cgal_test script in tests
|
||||
#---------------------------------------------------------------#
|
||||
sub create_test(){
|
||||
open(CGAL_TEST,">cgal_test");
|
||||
print CGAL_TEST <<'EOF';
|
||||
#! /bin/sh
|
||||
|
||||
# This is a script for the CGAL test suite. Such a script must obey
|
||||
# the following rules:
|
||||
#
|
||||
# - the name of the script is cgal_test
|
||||
# - for every target two one line messages are written to the file 'error.txt'
|
||||
# the first one indicates if the compilation was successful
|
||||
# the second one indicates if the execution was successful
|
||||
# if one of the two was not successful, the line should start with 'ERROR:'
|
||||
# - running the script should not require any user interaction
|
||||
# - the script should clean up object files and executables
|
||||
|
||||
ERRORFILE=error.txt
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compile_and_run <target>
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
compile_and_run()
|
||||
{
|
||||
echo "Compiling $1 ... "
|
||||
SUCCES="y"
|
||||
if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \
|
||||
TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \
|
||||
TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $1' ; then
|
||||
echo " succesful compilation of $1" >> $ERRORFILE
|
||||
else
|
||||
echo " ERROR: compilation of $1" >> $ERRORFILE
|
||||
SUCCES=""
|
||||
fi
|
||||
|
||||
if [ -n "${SUCCES}" ] ; then
|
||||
OUTPUTFILE=ProgramOutput.$1.$PLATFORM
|
||||
rm -f $OUTPUTFILE
|
||||
COMMAND="./$1"
|
||||
if [ -f $1.cmd ] ; then
|
||||
COMMAND="$COMMAND `cat $1.cmd`"
|
||||
fi
|
||||
if [ -f $1.cin ] ; then
|
||||
COMMAND="cat $1.cin | $COMMAND"
|
||||
fi
|
||||
echo "Executing $1 ... "
|
||||
echo
|
||||
ulimit -t 1200 2> /dev/null
|
||||
if eval $COMMAND > $OUTPUTFILE 2>&1 ; then
|
||||
echo " succesful execution of $1" >> $ERRORFILE
|
||||
else
|
||||
echo " ERROR: execution of $1" >> $ERRORFILE
|
||||
fi
|
||||
else
|
||||
echo " ERROR: not executed $1" >> $ERRORFILE
|
||||
fi
|
||||
|
||||
eval "make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null 2>&1 "
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# remove the previous error file
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
rm -f $ERRORFILE
|
||||
touch $ERRORFILE
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# compile and run the tests
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
if [ $# -ne 0 ] ; then
|
||||
for file in $* ; do
|
||||
compile_and_run $file
|
||||
done
|
||||
else
|
||||
EOF
|
||||
close(CGAL_TEST);
|
||||
|
||||
open(CGAL_TEST,">>cgal_test");
|
||||
my $cfile;
|
||||
foreach $cfile (glob("*.C")) {
|
||||
substr($cfile, -2, 2) = "";
|
||||
print CGAL_TEST " compile_and_run $cfile\n";
|
||||
}
|
||||
print CGAL_TEST "fi\n";
|
||||
close(CGAL_TEST);
|
||||
chmod 0755, 'cgal_test';
|
||||
}
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# make_testscripts and generate makefiles in test and examples
|
||||
#---------------------------------------------------------------#
|
||||
|
||||
sub make_testscripts()
|
||||
{
|
||||
my ($DIR, $BASEDIR);
|
||||
chdir "$RELEASEDIR/$VERSION" or die;
|
||||
$BASEDIR = cwd();
|
||||
print "Creating and checking makefiles ...\n";
|
||||
|
||||
chdir 'test';
|
||||
foreach $DIR (glob("*")) {
|
||||
if ( -d $DIR ) {
|
||||
chdir $DIR;
|
||||
if ( -f 'Makefile') {
|
||||
rename 'Makefile', 'makefile';
|
||||
}
|
||||
if ( -f 'makefile' ) {
|
||||
open MAKEFILE, "makefile";
|
||||
open NEW_MAKEFILE, ">makefile.new";
|
||||
while (<MAKEFILE>) {
|
||||
s/\.o\b/\$(OBJ_EXT)/g;
|
||||
s/-g\b/\$(DEBUG_OPT)/g;
|
||||
print NEW_MAKEFILE $_;
|
||||
}
|
||||
close NEW_MAKEFILE;
|
||||
close MAKEFILE;
|
||||
rename("makefile.new","makefile");
|
||||
} else {
|
||||
my $options = '-t';
|
||||
if ( -f 'create_makefile_options') {
|
||||
if (open(OPTIONS, "<create_makefile_options")) {
|
||||
$_ = <OPTIONS>;
|
||||
chomp;
|
||||
if (/^[\w\s-]+$/) { $options = $_;
|
||||
} else {
|
||||
print STDERR "Rejected create_makefile_options in $DIR\n";
|
||||
}
|
||||
close OPTIONS;
|
||||
}
|
||||
}
|
||||
system("$SCRIPTSDIR/create_makefile", $options);
|
||||
}
|
||||
if ( ! -f 'cgal_test' ) {
|
||||
create_test();
|
||||
}
|
||||
chdir '..';
|
||||
}
|
||||
}
|
||||
chdir $BASEDIR;
|
||||
chdir 'examples';
|
||||
|
||||
# Windows specific stuff
|
||||
print "Creating VC++ projects in examples\n";
|
||||
system("../developer_scripts/examples/C2vcproj", glob("*"));
|
||||
|
||||
print "Creating makefiles in examples\n";
|
||||
foreach $DIR (glob("*")) {
|
||||
if ( -d $DIR ) {
|
||||
chdir $DIR;
|
||||
if ( -f 'Makefile') {
|
||||
rename 'Makefile', 'makefile';
|
||||
}
|
||||
if ( -f 'makefile' ) {
|
||||
open MAKEFILE, "makefile";
|
||||
open NEW_MAKEFILE, ">makefile.new";
|
||||
while (<MAKEFILE>) {
|
||||
s/\.o\b/\$(OBJ_EXT)/g;
|
||||
s/-g\b/\$(DEBUG_OPT)/g;
|
||||
print NEW_MAKEFILE $_;
|
||||
}
|
||||
close NEW_MAKEFILE;
|
||||
close MAKEFILE;
|
||||
rename("makefile.new","makefile");
|
||||
} else {
|
||||
my $options = '-d';
|
||||
if ( -f 'create_makefile_options') {
|
||||
if (open(OPTIONS, "<create_makefile_options")) {
|
||||
$_ = <OPTIONS>;
|
||||
chomp;
|
||||
if (/^[\w\s-]+$/) { $options = $_;
|
||||
} else {
|
||||
print STDERR "Rejected create_makefile_options in $DIR\n";
|
||||
}
|
||||
close OPTIONS;
|
||||
}
|
||||
}
|
||||
system("$SCRIPTSDIR/create_makefile", $options);
|
||||
}
|
||||
chdir '..';
|
||||
}
|
||||
}
|
||||
chdir $BASEDIR;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------#
|
||||
# check_and_update_file #
|
||||
#----------------------------------------------------------------#
|
||||
|
||||
sub check_and_update_file($$)
|
||||
{
|
||||
my ($filename, $filename_with_dir) = @_;
|
||||
my $header_type = 0;
|
||||
my $lines_exceeding_length = 0;
|
||||
my $has_line_directives = 0;
|
||||
unlink $TEMPFILE;
|
||||
open SOURCE_FILE, "<$filename" || die "Error opening $filename_with_dir: $!\n";
|
||||
open TEMPFILE, ">$TEMPFILE" || die;
|
||||
while ( <SOURCE_FILE> ) {
|
||||
$header_type = 1
|
||||
if m|^Copyright \(c\) \d{4](,\s?\d{4})* The CGAL Consortium|;
|
||||
$header_type = 2
|
||||
if m|^// Copyright \(c\) \d{4}(,\s?\d{4})* The CGAL Consortium|;
|
||||
$lines_exceeding_length +=1 if length $_ > 80;
|
||||
$has_line_directives = 1 if m|^\s*#\s*line\s|;
|
||||
print TEMPFILE $_;
|
||||
}
|
||||
close SOURCE_FILE || die "Error closing $filename_with_dir: $!";
|
||||
close TEMPFILE || die "Error closing temporary file: $!\n";
|
||||
rename($TEMPFILE, $filename )
|
||||
|| system('mv', "$TEMPFILE", "$filename")
|
||||
|| warn "Could not update file $filename_with_dir\n";
|
||||
if ($header_type == 0) {
|
||||
print FILE_CHECKS "$filename_with_dir has unrecognised header.\n";
|
||||
} elsif ($header_type == 1) {
|
||||
print FILE_CHECKS "$filename_with_dir has old style header.\n";
|
||||
}
|
||||
if ($lines_exceeding_length) {
|
||||
print FILE_CHECKS "$filename_with_dir has $lines_exceeding_length",
|
||||
" lines over 80 characters.\n";
|
||||
}
|
||||
if ($has_line_directives) {
|
||||
print FILE_CHECKS "$filename_with_dir has line directives.\n";
|
||||
}
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------#
|
||||
# set_file_headers #
|
||||
#----------------------------------------------------------------#
|
||||
|
||||
sub set_file_headers()
|
||||
{
|
||||
print "Setting file headers...\n";
|
||||
chdir "$RELEASEDIR/$VERSION";
|
||||
open(FILE_CHECKS,">$PARENT_DIR/code_check_$VERSION");
|
||||
find(\&file_header_setting, 'include', 'src', 'examples', 'config/testfiles');
|
||||
close FILE_CHECKS;
|
||||
chdir $MAIN_DIR;
|
||||
}
|
||||
|
||||
sub file_header_setting
|
||||
{
|
||||
my ($filename,$dev,$ino,$mode,$nlink,$uid,$gid,$filetype);
|
||||
$filename = $_;
|
||||
if ( ! /\.[h|C]$/ ||
|
||||
! (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($filename)) ||
|
||||
! -f _ ) {
|
||||
return;
|
||||
}
|
||||
check_and_update_file($filename, $File::Find::name);
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------#
|
||||
# Main entry point #
|
||||
#----------------------------------------------------#
|
||||
|
||||
|
||||
sub main(){
|
||||
|
||||
getopts('hr:a:d:l:p:s:n:');
|
||||
if ($::opt_h ) {
|
||||
usage();
|
||||
die "\n";
|
||||
}
|
||||
if ($::opt_d){
|
||||
$RELEASEDIR = $::opt_d;
|
||||
$ALLPACKAGESDIR = "$RELEASEDIR/All";
|
||||
$SCRIPTSDIR = "$RELEASEDIR";
|
||||
$LOCKFILE="$RELEASEDIR/release_creation.lock";
|
||||
$packages_file="$RELEASEDIR/include_in_release";
|
||||
}
|
||||
|
||||
if ($::opt_r){
|
||||
$VERSION = $::opt_r;
|
||||
if ($::opt_n){
|
||||
$VERSION_NR = $::opt_n;
|
||||
} else {
|
||||
$VERSION_NR = $VERSION;
|
||||
}
|
||||
} else {
|
||||
usage();
|
||||
die "\n";
|
||||
}
|
||||
if ($::opt_a){
|
||||
$ALLPACKAGESDIR = $::opt_a;
|
||||
}
|
||||
if ($::opt_s){
|
||||
$SCRIPTSDIR = $::opt_s;
|
||||
}
|
||||
if ($::opt_l){
|
||||
$LOCKFILE = $::opt_l;
|
||||
}
|
||||
if ($::opt_p){
|
||||
$packages_file = $::opt_p;
|
||||
}
|
||||
print "Initializing variables ...\n";
|
||||
print " Release dir: $RELEASEDIR\n";
|
||||
print " All packages dir: $ALLPACKAGESDIR\n";
|
||||
print " Scripts dir: $SCRIPTSDIR\n";
|
||||
print " Lockfile: $LOCKFILE\n";
|
||||
print " Packages file : $packages_file\n";
|
||||
umask(002);
|
||||
chdir $RELEASEDIR or die;
|
||||
if (! -d $VERSION){
|
||||
print "Creating release directory ${VERSION} ...\n";
|
||||
mkdir($VERSION, 0775);
|
||||
} else {
|
||||
print "$VERSION already exists in $RELEASEDIR\n";
|
||||
print "Please remove it first\n";
|
||||
exit 1;
|
||||
}
|
||||
lock;
|
||||
|
||||
create_packages_dir();
|
||||
install_packages();
|
||||
CreateConfigurationTestdir();
|
||||
CreateDemoTestDirs();
|
||||
CreateExampleTestDirs();
|
||||
create_version_file();
|
||||
create_version_tex_file();
|
||||
make_testscripts();
|
||||
set_file_headers();
|
||||
make_src_makefiles();
|
||||
CreateSrcTestDir();
|
||||
CreateSrcCoreTestDir(); # Must be called after CreateSrcTestDir()
|
||||
CreateSrcQtTestDir(); # Must be called after CreateSrcTestDir()
|
||||
create_global_makefile();
|
||||
|
||||
#Removing Modules directory from Installation package
|
||||
#this directory is only used to build the CGAL modules
|
||||
chdir "$RELEASEDIR/$VERSION";
|
||||
system("rm", "-rf", "Modules");
|
||||
|
||||
unlock;
|
||||
|
||||
}
|
||||
|
||||
main();
|
||||
Executable
+186
@@ -0,0 +1,186 @@
|
||||
#!/bin/sh
|
||||
|
||||
#the next variables will be overwritten by the parameters
|
||||
CVSDIR="/cygdrive/d/CGALCVS"
|
||||
MODULES_DIRECTORY="Modules"
|
||||
RELEASE_VERSION="CGAL-3.1-I-XX"
|
||||
RELEASE_NUMBER="100060003"
|
||||
UPDATING="y"
|
||||
INSTALLATION_DIR="/cygdrive/d/CGALCVS/Modules"
|
||||
CREATING_DOC="y"
|
||||
|
||||
#check the parameters
|
||||
while [ ${#} -gt 0 ]; do
|
||||
case ${*} in
|
||||
-h*|-help*|--help*)
|
||||
printf "usage: create_modules (-h|-help|--help)\n\t-d dir\tSets the CVSDIR directory. The default is /cygdrive/d/CGALCVS.\n\t-m mod\tSets the name of the Modules directory from the Installation package. The default name is Modules.\n\t-r ver\tSets the release version of CGAL which was used to build the modules (eg. CGAL-3.1-I-79).\n\t-n nr\tSets the release number of CGAL (eg. 1003004200).\n\t-u y|n\tSets the updating state. The default is y. If n is specified, the script will no longer update the packages involved.\n\t-i DIR\tSets the installation directory for the modules.\n\t-c y|n\tSets the state of the doc creation process. The default is y. If n is specified, the script will no longer create the doc of the modules.\n"
|
||||
exit
|
||||
;;
|
||||
-d*)
|
||||
CVSDIR="$2"
|
||||
shift
|
||||
;;
|
||||
-m*)
|
||||
MODULES_DIRECTORY="$2"
|
||||
shift
|
||||
;;
|
||||
-r*)
|
||||
RELEASE_VERSION="$2"
|
||||
shift
|
||||
;;
|
||||
-n*)
|
||||
RELEASE_NUMBER="$2"
|
||||
shift
|
||||
;;
|
||||
-u*)
|
||||
UPDATING="$2"
|
||||
shift
|
||||
;;
|
||||
-i*)
|
||||
INSTALLATION_DIR="$2"
|
||||
shift
|
||||
;;
|
||||
-c*)
|
||||
CREATING_DOC="$2"
|
||||
shift
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
printf "Setting CVSDIR=${CVSDIR} ...\n"
|
||||
printf "Setting MODULES_DIRECTORY=${MODULES_DIRECTORY} ...\n"
|
||||
printf "Setting INSTALLATION_DIR=${INSTALLATION_DIR} ...\n"
|
||||
printf "Setting RELEASE_VERSION=${RELEASE_VERSION} ...\n"
|
||||
printf "Setting RELEASE_NUMBER=${RELEASE_NUMBER} ...\n"
|
||||
|
||||
if [ ! -r ${CVSDIR} ]; then
|
||||
printf "Directory ${CVSDIR} does not exist ... EXITING\n"
|
||||
exit
|
||||
fi
|
||||
|
||||
#if [ ! -r create_internal_module ]; then
|
||||
# printf "create_internal_module file could not be found ... EXITING\n"
|
||||
# exit
|
||||
#fi
|
||||
|
||||
|
||||
cd ${CVSDIR} || return
|
||||
if [ "${UPDATING}" = "y" ]; then
|
||||
if [ -r "Installation" ]; then
|
||||
printf "Updating package Installation to get the modules list ...\n"
|
||||
cvs -q update -P Installation
|
||||
else
|
||||
printf "Checking out package Installation to get the modules list ...\n"
|
||||
cvs co -P Installation
|
||||
fi
|
||||
if [ -r "Scripts" ]; then
|
||||
printf "Updating package Scripts to get the right scripts ...\n"
|
||||
cvs -q update -P Scripts
|
||||
else
|
||||
printf "Checking out package Scripts to get the right scripts ...\n"
|
||||
cvs co -P Scripts
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -r "${INSTALLATION_DIR}" ]; then
|
||||
mkdir "${INSTALLATION_DIR}"
|
||||
fi
|
||||
|
||||
for i in `ls Installation/${MODULES_DIRECTORY}/*`
|
||||
do
|
||||
if [ -f "${i}" ]; then
|
||||
MAIN_NAME="`basename ${i}`"
|
||||
printf "\n\nCreating module ${MAIN_NAME}\n"
|
||||
if [ -r "${MAIN_NAME}" ]; then
|
||||
printf " Directory ${MAIN_NAME} exists, removing ...\n"
|
||||
rm -rf ${MAIN_NAME}
|
||||
fi
|
||||
if [ "${UPDATING}" = "y" ]; then
|
||||
for j in `cat ${i}`
|
||||
do
|
||||
if [ -r "${j}" ]; then
|
||||
printf " Updating package ${j} ...\n"
|
||||
cvs -q update ${j}
|
||||
else
|
||||
printf " Check out package ${j} ...\n"
|
||||
cvs co -P ${j}
|
||||
fi
|
||||
done
|
||||
fi
|
||||
${CVSDIR}/Scripts/developer_scripts/create_internal_module -m ${MAIN_NAME} -r ${RELEASE_VERSION} -n ${RELEASE_NUMBER} -a ${CVSDIR} -p ${i} -s "${CVSDIR}/Scripts/scripts"
|
||||
|
||||
|
||||
if [ "${CREATING_DOC}" = "y" ]; then
|
||||
#creating the doc of the module
|
||||
printf "Creating the cgal_manual.tex wrapper for the doc ...\n"
|
||||
|
||||
#1 creating the cgal_manual.tex wrapper the first part
|
||||
cat <<EOF >${MAIN_NAME}/doc_tex/cgal_manual.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% | cgal_manual.tex
|
||||
% | CGAL User and Reference Manual for all packages
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
\documentclass{book}
|
||||
\usepackage{cgal_manual}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\cgalchapters{
|
||||
\entryleftright{\part{Basic Library User Manual}}
|
||||
{\part{Reference Manual}}
|
||||
|
||||
\lcTex{\entryright{\listofrefpages}}
|
||||
|
||||
|
||||
EOF
|
||||
#2 creating the second part of the cgal_manual.tex wrapper
|
||||
for k in `ls ${MAIN_NAME}/doc_tex/`
|
||||
do
|
||||
if [ -d ${MAIN_NAME}/doc_tex/${k} ]; then
|
||||
_temp_var=`echo "${k}" | grep "_ref"`
|
||||
if [ -z ${_temp_var} ]; then
|
||||
printf "\t\\packageleftright{${k}}{${k}_ref}\n" >>${MAIN_NAME}/doc_tex/cgal_manual.tex
|
||||
fi
|
||||
fi
|
||||
done
|
||||
#3 creating the 3rd part of the cgal_manual.tex wrapper
|
||||
cat <<EOF >>${MAIN_NAME}/doc_tex/cgal_manual.tex
|
||||
}
|
||||
|
||||
\bibliographystyle{alpha}
|
||||
\bibliography{cgal_manual,geom}
|
||||
|
||||
\printindex
|
||||
|
||||
\end{document}
|
||||
|
||||
EOF
|
||||
#end creating the doc of the module
|
||||
|
||||
if [ -r ~/.autotest_manual_config ]; then
|
||||
printf "running latex ...\n"
|
||||
. ~/.autotest_manual_config
|
||||
_temp_dir=`pwd`
|
||||
cd ${MAIN_NAME}/doc_tex
|
||||
latex cgal_manual.tex
|
||||
bibtex cgal_manual
|
||||
latex cgal_manual.tex
|
||||
latex cgal_manual.tex
|
||||
#xdvi cgal_manual.dvi
|
||||
latex_to_html -o ../doc_html cgal_manual
|
||||
cd ${_temp_dir}
|
||||
|
||||
else
|
||||
printf "autotest_manual_config WAS NOT found in your HOME directory.\n"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
tar -cf "${MAIN_NAME}.tar" ${MAIN_NAME}
|
||||
gzip "${MAIN_NAME}.tar"
|
||||
mv "${MAIN_NAME}.tar.gz" ${INSTALLATION_DIR}
|
||||
rm -rf ${MAIN_NAME}
|
||||
fi
|
||||
|
||||
done
|
||||
Executable
+118
@@ -0,0 +1,118 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Creating a new CGAL internal/public release.
|
||||
#
|
||||
# Radu Ursu, Sylvain Pion, 2004, 2005.
|
||||
|
||||
# TODO :
|
||||
# - The public release case should pass the info to create_internal_release.
|
||||
# - Merge [some parts] into ./create_internal_release ?
|
||||
# - What is still missing is to do a checkout of the whole thing
|
||||
# so that the Name: CVS keyword is updated in each file.
|
||||
# But I'm more and more wondering if we really want that...
|
||||
# - There should be command line options to set public/internal,
|
||||
# and the major/minor/bugfix/version_file release numbers.
|
||||
|
||||
# Set the following to "y" in case of public release.
|
||||
IS_PUBLIC_RELEASE="n"
|
||||
|
||||
# Set the major/minor/bugfix release numbers
|
||||
MAJOR_NUMBER="3" # 2 digits max
|
||||
MINOR_NUMBER="2" # 2 digits max
|
||||
BUGFIX_NUMBER="0" # 1 digit max
|
||||
|
||||
# The internal release number is extracted/updated from this file :
|
||||
VERSION_FILE="version_number"
|
||||
|
||||
# Where to put the resulting tarball and where to send the announce.
|
||||
HTML_DIR="/u/bombyx/geometrica/CGAL/Members/Releases"
|
||||
URL="http://cgal.inria.fr/CGAL/Members/Releases"
|
||||
MAILTO="cgal-develop-l@postino.mpi-sb.mpg.de"
|
||||
|
||||
LOGFILEBASE="create_release.log"
|
||||
#TMPDIR="/tmp"
|
||||
TMPDIR="${HOME}/CGAL/internal_release_making"
|
||||
|
||||
PATH=$PATH:/usr/local/bin
|
||||
TAR=/usr/bin/gnu/tar
|
||||
GZIP=/usr/bin/gnu/gzip
|
||||
DIFF=/usr/bin/diff
|
||||
|
||||
CVS_TAG=""
|
||||
#CVS_TAG="-A"
|
||||
|
||||
cd ${TMPDIR} || return
|
||||
|
||||
# The internal release number is considered only in non-public mode.
|
||||
if [ $IS_PUBLIC_RELEASE = "n" ]; then
|
||||
[ -r $VERSION_FILE ] || return
|
||||
i=$(( `cat $VERSION_FILE` + 1 ))
|
||||
rm -rf $VERSION_FILE
|
||||
printf "%d\n" "${i}" >> $VERSION_FILE
|
||||
INTERNAL_STRING="-I-${i}"
|
||||
internal_nr=`printf "%4s" "${i}" | sed "y/ /0/"`
|
||||
else
|
||||
INTERNAL_STRING=""
|
||||
internal_nr="1000"
|
||||
fi
|
||||
|
||||
# Do not show the bugfix number if it is 0.
|
||||
if [ $BUGFIX_NUMBER != "0" ]; then
|
||||
BUGFIX_STRING=".$BUGFIX_NUMBER"
|
||||
else
|
||||
BUGFIX_STRING=""
|
||||
fi
|
||||
release_name="CGAL-${MAJOR_NUMBER}.${MINOR_NUMBER}${BUGFIX_STRING}${INTERNAL_STRING}"
|
||||
LOGFILE="`pwd`/${LOGFILEBASE}.${release_name}"
|
||||
echo "${release_name}" >> ${LOGFILE} 2>&1
|
||||
major_nr=`printf "%2s" "${MAJOR_NUMBER}" | sed "y/ /0/"`
|
||||
minor_nr=`printf "%2s" "${MINOR_NUMBER}" | sed "y/ /0/"`
|
||||
bugfix_nr=`printf "%1s" "${BUGFIX_NUMBER}" | sed "y/ /0/"`
|
||||
release_number="1${major_nr}${minor_nr}${bugfix_nr}${internal_nr}"
|
||||
echo "${release_number}" >> ${LOGFILE} 2>&1
|
||||
|
||||
cd All
|
||||
cvs -q update -P ${CVS_TAG} >> ${LOGFILE} 2>&1
|
||||
|
||||
cd ..
|
||||
./create_internal_release -r ${release_name} -n ${release_number} -d ${TMPDIR} >> ${LOGFILE} 2>&1
|
||||
cd ${TMPDIR}
|
||||
# Make the diff with the previous release
|
||||
${DIFF} -urN previous_release "${release_name}" > ${release_name}.diff
|
||||
${GZIP} "${release_name}.diff" >> ${LOGFILE} 2>&1
|
||||
rm -rf previous_release >> ${LOGFILE} 2>&1
|
||||
# Make the release tarball
|
||||
${TAR} -cf "${release_name}.tar" "${release_name}" >> ${LOGFILE} 2>&1
|
||||
${GZIP} "${release_name}.tar" >> ${LOGFILE} 2>&1
|
||||
mv "${release_name}" previous_release >> ${LOGFILE} 2>&1
|
||||
mv "${release_name}.diff.gz" "${release_name}.tar.gz" "${HTML_DIR}" >> ${LOGFILE} 2>&1
|
||||
echo "${release_name}.tar.gz" > "${HTML_DIR}/LATEST"
|
||||
mail -s "[automatic] ${release_name} is released" ${MAILTO} <<EOF
|
||||
|
||||
You can fetch it at :
|
||||
${URL}/${release_name}.tar.gz
|
||||
|
||||
EOF
|
||||
|
||||
# Now we tag.
|
||||
cd All
|
||||
NEW_TAG=`echo $release_name | sed -e "s/[-.]/_/g"`
|
||||
echo "Tagging All with $NEW_TAG" >> ${LOGFILE} 2>&1
|
||||
# One directory at a time otherwise the repository
|
||||
# gets locked for an hour...
|
||||
# cvs -q tag $NEW_TAG >> ${LOGFILE} 2>&1
|
||||
for dir in *
|
||||
do
|
||||
[ "$dir" != "CVS" ] && cvs -q tag $NEW_TAG $dir >> ${LOGFILE} 2>&1
|
||||
done
|
||||
|
||||
################################
|
||||
|
||||
# The module stuff is commented out on 10/11/05, because those scripts are
|
||||
# unused now, and they might make the conversion to SVN harder.
|
||||
|
||||
# We now call the create_modules script
|
||||
# The All directory is the CVSDIR directory
|
||||
|
||||
# cd ${TMPDIR}
|
||||
# ./create_modules -u n -c n -r ${release_name} -n ${release_number} -d "${TMPDIR}/All" -i "${HTML_DIR}" >> ${LOGFILE} 2>&1
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env perl
|
||||
#
|
||||
# Perl script that computes an encrypted password.
|
||||
# Taken from the book "Open Source development with CVS" by Karl Fogel.
|
||||
# It is used for the CVS server.
|
||||
# Sylvain Pion, 2000.
|
||||
|
||||
srand (time());
|
||||
my $randletter = "(int (rand(26)) + (int (rand(1) + .5) % 2 ? 65 : 97))";
|
||||
my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
|
||||
my $plaintext = shift;
|
||||
my $crypttext = crypt ($plaintext, $salt);
|
||||
|
||||
print "${crypttext}\n";
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
tmpfil=".rld$$"
|
||||
|
||||
for file in $*
|
||||
do
|
||||
if sed -e '/^#line / d' ${file} > ${tmpfil}
|
||||
then
|
||||
mv ${tmpfil} ${file}
|
||||
else
|
||||
rm -f ${tmpfil}
|
||||
fi
|
||||
done
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/perl -pi.bak -w
|
||||
|
||||
my @clib_names = (
|
||||
'fabs', 'log', 'cos', 'sin', 'ceil', 'floor',
|
||||
'abort', 'atoi',
|
||||
'sscanf', 'sprintf',
|
||||
'clock', 'clock_t',
|
||||
'isalnum', 'isdigit', 'isspace',
|
||||
'strlen', 'strcat','strcpy','strcmp');
|
||||
|
||||
foreach $name (@clib_names) {
|
||||
s/\b(std|CGAL_CLIB_STD)::$name\b/$name/g;
|
||||
s/\b$name\b/CGAL_CLIB_STD::$name/g;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user