Commit 9f93e9ec authored by Lynn Garren's avatar Lynn Garren
Browse files

adding config for backwards compatibility

parent 6e814710
Tue Jun 29 2004 Lynn Garren <garren@fnal.gov>
* add config for backwards compatibility (CLHEP/config/CLHEP.h)
Wed Jun 23 2004 Lynn Garren <garren@fnal.gov>
* HepMC version is 1.01.00
......
......@@ -2,7 +2,7 @@
includedir = $(prefix)/include/CLHEP
SUBDIRS = Units Vector Evaluator GenericFunctions Geometry \
SUBDIRS = config Units Vector Evaluator GenericFunctions Geometry \
Random Matrix RandomObjects HepPDT HepMC StdHep \
RefCount Cast Exceptions
......
Makefile.in
configure
aclocal.m4
autom4te.cache
config.h.in
## Process this file with automake to produce Makefile.in
includedir = $(prefix)/include/CLHEP
# put . first so that CLHEP directory is built before anything else
SUBDIRS = config . test
# list all subdirectories - for distribution and cleaning
DIST_SUBDIRS = config . test
all-local: $(top_builddir)/CLHEP
# create temporary CLHEP header tree
# we only copy headers for packages listed in @PACKAGE@-deps
# search for header directories in the following order:
# 1. $(top_builddir)/this-package
# 2. $(top_builddir)/../other-packages
# 3. $(CLHEPSOURCE_DIR)/CLHEP
# 4. $(CLHEP_DIR)/include/CLHEP
#
# abs_ => absolute path
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
COPY_P = @COPY_P@
$(top_builddir)/CLHEP: temp-package-dirs
@list="`cat @PACKAGE@-deps | sed s/CLHEP-@PACKAGE@-@VERSION@// | sed s/CLHEP-// | sed s/-@VERSION@//`"; \
for pkg in $$list; do \
if test -d "$$pkg" ; then \
(cd $$pkg && $(MAKE) $(AM_MAKEFLAGS) TEMPDIR=$(abs_top_builddir) install-tmpHEADERS) || exit 1 ; \
else \
if test -d ../"$$pkg"/"$$pkg" ; then \
(cd ../$$pkg/$$pkg && $(MAKE) $(AM_MAKEFLAGS) TEMPDIR=$(abs_top_builddir) install-tmpHEADERS) || exit 1 ; \
else \
if test -d $(CLHEPSOURCE_DIR)/CLHEP/"$$pkg"/"$$pkg"; then \
hdrs=`ls $(CLHEPSOURCE_DIR)/CLHEP/$$pkg/$$pkg`; \
for hdr in $$hdrs; do $(COPY_P) $(CLHEPSOURCE_DIR)/CLHEP/$$pkg/$$pkg/$$hdr $(abs_top_builddir)/CLHEP/$$pkg/$$hdr; done; \
else \
if test -n "$(CLHEP_DIR)" && test -d $(CLHEP_DIR)/include/CLHEP; then \
if test -d $(CLHEP_DIR)/include/CLHEP/"$$pkg"; then \
hdrs=`ls $(CLHEP_DIR)/include/CLHEP/$$pkg`; \
for hdr in $$hdrs; do $(COPY_P) $(CLHEP_DIR)/include/CLHEP/$$pkg/$$hdr $(abs_top_builddir)/CLHEP/$$pkg/$$hdr; done; \
fi; \
fi; \
fi; \
fi; \
fi; \
done;
temp-package-dirs:
$(mkinstalldirs) $(abs_top_builddir)/CLHEP;
@list="`cat @PACKAGE@-deps | sed s/CLHEP-@PACKAGE@-@VERSION@// | sed s/CLHEP-// | sed s/-@VERSION@//`"; \
for pkg in $$list; do \
$(mkinstalldirs) $(abs_top_builddir)/CLHEP/$$pkg; \
done;
CLHEP/config is provided for backwards compatibility.
This directory will only be available in CLHEP 1.9.
You should convert your code to use the defs.h files in each package
include area instead of CLHEP/config/CLHEP.h.
config.sub
config.guess
depcomp
install-sh
missing
mkinstalldirs
This diff is collapsed.
#! /bin/sh
# run autotool commands
set -x
aclocal -I autotools
autoheader
automake --add-missing --copy
autoconf
# ready to make a source code distribution tarball
CLHEP-@PACKAGE@-@VERSION@ CLHEP-@PACKAGE@-@VERSION@
Makefile.in
defs.h.in
// -*- C++ -*-
// $Id: CLHEP.h,v 1.1.2.1 2004/06/30 15:22:26 garren Exp $
// ---------------------------------------------------------------------------
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
//
// This file contains definitions of some usefull utilities and macros.
//
#ifndef _CLHEP_H_
#define _CLHEP_H_
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include "CLHEP/config/defs.h"
/// as of CLHEP 1.8, these are unnecessary
#define FORTRAN_PPU 1
#define HEP_USE_STD_STL 1
#define HEP_USE_STD 1
#define HEP_HAVE_IOSFWD 1
#define HepSTL std
#define HepStd std
// this is no longer used since it was always on
#define HEP_CC_NEED_SUB_WITHOUT_CONST 1
// names have been changed to protect the innocent
// These will be unneccessary after CLHEP 1.9 since gcc 2.95.2
// will no longer be supported
#ifdef HAVE_SSTREAM
#define HEP_HAVE_SSTREAM
#endif
#ifdef HAVE_IOS_BASE
#define HEP_USE_IOS_BASE
#endif
// CLASSDOC OFF
// **** You should probably not touch anything below this line: ****
typedef double HepDouble;
typedef int HepInt;
typedef float HepFloat;
typedef bool HepBoolean;
#ifdef HEP_SHORT_NAMES
typedef HepBoolean Boolean;
#endif
// use the pi mass information in Units/PhysicalConstants.h instead
#ifndef M_PI_2
#define M_PI_2 1.57079632679489661923
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifndef M_2PI
#define M_2PI 6.28318530717958647692
#endif
#ifdef HEP_DEBUG_INLINE
#define HEP_NO_INLINE_IN_DECLARATION
#endif
#ifdef HEP_NO_INLINE_IN_DECLARATION
#define HEP_NO_INLINE_IN_TEMPLATE_DECLARATION
#endif
// Default to generate random matrix
//
#ifndef HEP_USE_RANDOM
#define HEP_USE_RANDOM
#endif
// Default to have assigment from three vector and rotation to matrix
//
#ifndef HEP_USE_VECTOR_MODULE
#define HEP_USE_VECTOR_MODULE
#endif
// GNU g++ compiler can optimize when returning an object.
// However g++ on HP cannot deal with this.
//
#undef HEP_GNU_OPTIMIZED_RETURN
#endif /* _CLHEP_H_ */
## Process this file with automake to produce Makefile.in
includedir = $(prefix)/include/CLHEP
tempincludedir = $(TEMPDIR)/CLHEP/@PACKAGE@
pkginclude_HEADERS = \
CLHEP.h \
fstream.h \
iomanip.h \
iosfwd.h \
iostream.h \
sstream.h \
StringStream.h \
strstream.h \
TemplateFunctions.h \
defs.h
# Identify generated file(s) to be removed when 'make clean' is requested:
CLEANFILES = defs.h
# copy headers into $(tempincludedir)
install-tmpHEADERS:
@echo " install headers in $(tempincludedir) "
@list='$(pkginclude_HEADERS)'; \
if test $(tempincludedir); then \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f="`echo $$p | sed -e 's|^.*/||'`"; \
./copy-header.pl $$d$$p $(tempincludedir)/$$f; \
done; \
fi; test -z "$$fail"
/* This is part of libio/iostream, providing -*- C++ -*- input/output.
Copyright (C) 2000 Free Software Foundation
This file is part of the GNU IO Library. This library is free
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option)
any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, if you link this library with files
compiled with a GNU compiler to produce an executable, this does not cause
the resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
/* Written by Magnus Fromreide (magfr@lysator.liu.se). */
#ifndef __SSTREAM__
#define __SSTREAM__
#include <string>
#include <iostream.h>
#include <streambuf.h>
namespace std
{
class stringbuf : public streambuf
{
public:
typedef char char_type;
typedef int int_type;
typedef streampos pos_type;
typedef streamoff off_type;
explicit stringbuf(int which=ios::in|ios::out) :
streambuf(which), buf(), mode(static_cast<ios::open_mode>(which)),
rpos(0), bufsize(1)
{ }
explicit stringbuf(const std::string &s, int which=ios::in|ios::out) :
streambuf(which), buf(s), mode(static_cast<ios::open_mode>(which)),
bufsize(1)
{
if(mode & ios::in)
{
setg(&defbuf, &defbuf + bufsize, &defbuf + bufsize);
}
if(mode & ios::out)
{
setp(&defbuf, &defbuf + bufsize);
}
rpos = (mode & ios::ate ? s.size() : 0);
}
std::string str() const
{
const_cast<stringbuf*>(this)->sync(); // Sigh, really ugly hack
return buf;
};
void str(const std::string& s)
{
buf = s;
if(mode & ios::in)
{
gbump(egptr() - gptr());
}
if(mode & ios::out)
{
pbump(pbase() - pptr());
}
rpos = (mode & ios::ate ? s.size() : 0);
}
protected:
inline virtual int sync();
inline virtual int overflow(int = EOF);
inline virtual int underflow();
private:
std::string buf;
ios::open_mode mode;
std::string::size_type rpos;
streamsize bufsize;
char defbuf;
};
class stringstreambase : virtual public ios {
protected:
stringbuf __my_sb;
public:
std::string str() const
{
return dynamic_cast<stringbuf*>(_strbuf)->str();
}
void str(const std::string& s)
{
clear();
dynamic_cast<stringbuf*>(_strbuf)->str(s);
}
stringbuf* rdbuf()
{
return &__my_sb;
}
protected:
stringstreambase(int which) :
__my_sb(which)
{
init (&__my_sb);
}
stringstreambase(const std::string& s, int which) :
__my_sb(s, which)
{
init (&__my_sb);
}
};
class istringstream : public stringstreambase, public istream {
public:
istringstream(int which=ios::in) :
stringstreambase(which)
{ }
istringstream(const std::string& s, int which=ios::in) :
stringstreambase(s, which)
{ }
};
class ostringstream : public stringstreambase, public ostream {
public:
ostringstream(int which=ios::out) :
stringstreambase(which)
{ }
ostringstream(const std::string& s, int which=ios::out) :
stringstreambase(s, which)
{ }
};
class stringstream : public stringstreambase, public iostream {
public:
stringstream(int which=ios::in|ios::out) :
stringstreambase(which)
{ }
stringstream(const std::string &s, int which=ios::in|ios::out) :
stringstreambase(s, which)
{ }
};
}
inline int std::stringbuf::sync()
{
if((mode & ios::out) == 0)
return EOF;
streamsize n = pptr() - pbase();
if(n)
{
buf.replace(rpos, std::string::npos, pbase(), n);
if(buf.size() - rpos != (std::string::size_type)n) // WEB: added cast
return EOF;
rpos += n;
pbump(-n);
gbump(egptr() - gptr());
}
return 0;
}
inline int std::stringbuf::overflow(int ch)
{
if((mode & ios::out) == 0)
return EOF;
streamsize n = pptr() - pbase();
if(n && sync())
return EOF;
if(ch != EOF)
{
std::string::size_type oldSize = buf.size();
buf.replace(rpos, std::string::npos, ch);
if(buf.size() - oldSize != 1)
return EOF;
++rpos;
}
return 0;
}
inline int std::stringbuf::underflow()
{
sync();
if((mode & ios::in) == 0)
{
return EOF;
}
if(rpos >= buf.size())
{
return EOF;
}
std::string::size_type n = egptr() - eback();
std::string::size_type s;
s = buf.copy(eback(), n, rpos);
pbump(pbase() - pptr());
gbump(eback() - gptr());
int res = (0377 & buf[rpos]);
rpos += s;
return res;
}
#endif /* not __STRSTREAM__ */
#include "CLHEP/config/defs.h"
#ifdef ENABLE_BACKWARDS_COMPATIBILITY
// -*- C++ -*-
// CLASSDOC OFF
// $Id: TemplateFunctions.h,v 1.1.2.1 2004/06/30 15:22:26 garren Exp $
// ---------------------------------------------------------------------------
// CLASSDOC ON
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
//
// This file contains template definitions of some usefull functions.
//
// sqr was already replaced by sqrt in CLHEP 1.8 so we do not include it here
//
#ifndef HEP_TEMPLATEFUNCTIONS_H
#define HEP_TEMPLATEFUNCTIONS_H
#include <algorithm> // for min() and max()
#include <cmath> // double abs()
#include <stdlib.h> // int abs()
using namespace std;
#endif /* HEP_TEMPLATEFUNCTIONS_H */
#endif // ENABLE_BACKWARDS_COMPATIBILITY
#!/usr/bin/env perl
#
# copy a header into the temporary CLHEP header tree if
# a) the header is not already there
# b) the source is newer
#
if ($#ARGV != 1) {
print "mungeit requires two arguments - exit\n";
exit;
} else {
$source_header=$ARGV[0];
$dest_header=$ARGV[1];
&check_header;
}
exit;
sub check_header {
# make sure source exists
if ( ! -e $source_header ) {
print "$source_header does not exist - exit\n";
exit;
}
# copy if not already there - otherwise, check the time stamp
if ( ! -e $dest_header ) {
$cmd = "cp -p ".$source_header." ".$dest_header;
print "$cmd\n";
system($cmd);
} else {
$source_header_time = -M $source_header;
$dest_header_time = -M $dest_header;
# copy only if source is newer
if( $source_header_time < $dest_header_time ) {
$cmd = "cp -p ".$source_header." ".$dest_header;
print "$cmd\n";
system($cmd);
}
}
}
#include "CLHEP/config/defs.h"
#ifdef ENABLE_BACKWARDS_COMPATIBILITY
// -*- C++ -*-
// CLASSDOC OFF
// $Id: fstream.h,v 1.1.2.1 2004/06/30 15:22:26 garren Exp $
// ---------------------------------------------------------------------------
// CLASSDOC ON
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
//
#ifndef HEP_FSTREAM_H
#define HEP_FSTREAM_H
#include <fstream>
#endif /* HEP_FSTREAM_H */
#endif // ENABLE_BACKWARDS_COMPATIBILITY
#include "CLHEP/config/defs.h"
#ifdef ENABLE_BACKWARDS_COMPATIBILITY
// -*- C++ -*-
// CLASSDOC OFF
// $Id: iomanip.h,v 1.1.2.1 2004/06/30 15:22:26 garren Exp $
// ---------------------------------------------------------------------------
// CLASSDOC ON
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
//
#ifndef HEP_IOMANIP_H
#define HEP_IOMANIP_H
#include <iomanip>
#endif /* HEP_IOMANIP_H */
#endif // ENABLE_BACKWARDS_COMPATIBILITY
#include "CLHEP/config/defs.h"
#ifdef ENABLE_BACKWARDS_COMPATIBILITY
// -*- C++ -*-
// CLASSDOC OFF
// $Id: iosfwd.h,v 1.1.2.1 2004/06/30 15:22:26 garren Exp $
// ---------------------------------------------------------------------------
// CLASSDOC ON
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
//
// Work around compiler annoyance with <iosfwd>
//
#ifndef HEP_IOSFWD_H
#define HEP_IOSFWD_H
#include <iosfwd>
#endif /* HEP_IOSFWD_H */
#endif // ENABLE_BACKWARDS_COMPATIBILITY
#include "CLHEP/config/defs.h"
#ifdef ENABLE_BACKWARDS_COMPATIBILITY
// -*- C++ -*-
// CLASSDOC OFF
// $Id: iostream.h,v 1.1.2.1 2004/06/30 15:22:26 garren Exp $
// ---------------------------------------------------------------------------
// CLASSDOC ON
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
//
#ifndef HEP_IOSTREAM_H
#define HEP_IOSTREAM_H
#include <iostream>
#endif /* HEP_IOSTREAM_H */
#endif // ENABLE_BACKWARDS_COMPATIBILITY
#include "CLHEP/config/defs.h"
#ifdef ENABLE_BACKWARDS_COMPATIBILITY
// -*- C++ -*-
// CLASSDOC OFF
// $Id: sstream.h,v 1.1.2.1 2004/06/30 15:22:26 garren Exp $
// ---------------------------------------------------------------------------
// CLASSDOC ON
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.