Commit d02aaeba authored by Lynn Garren's avatar Lynn Garren
Browse files

merging changes from 2.0 branch into head

parent 469d569a
2005-04-07 Lynn Garren <garren@fnal.gov>
* configure.in: set AR and ARFLAGS
Tue Apr 05 2005 Andreas Pfeiffer <andreas.pfeiffer@cern.ch.
* On request from Geant-4 users added GlobalPhysicalConstants.h
and GlobalSystemOfUnits.h to allow users to use Units from global
namespace.
2005-02-18 Lynn Garren <garren@fnal.gov>
* configure.in, Makefile.am: Stop using libtool.
The newer releases of libtool seem to have dropped support for
Windows Visual C++.
2005-02-14 Lynn Garren <garren@fnal.gov>
* configure.in: Visual C++ flags are now "-EHsc -nologo -GR -GX -MD"
2005-02-03 Lynn Garren <garren@fnal.gov>
* configure.in: install step creates libCLHEP.a, libCLHEP.so,
and/or libCLHEP.dylib by adding a symbolic link.
2005-02-02 Andreas PFEIFFER <andreas.pfeiffer@cern.ch>
* configure.in: modified compiler flags for windows:
added "-O -GR -GX -MD" as this is needed for the multi-thread
environments used.
==============================
30.11.04 Release CLHEP-2.0.1.2
==============================
==============================
27.10.04 Release CLHEP-2.0.1.1
==============================
Fri Sep 24 2004 Lynn Garren <garren@fnal.gov>
* use AM_CXXFLAGS
* require autoconf 2.59, automake 1.9.1, and libtool 1.9b
Tue Aug 31 2004 Lynn Garren <garren@fnal.gov>
* change Solaris CC compile flags from "-O -mt" to "-O"
* libtools 1.9b or later is required for Solaris CC
==============================
23.07.04 Release CLHEP-2.0.1.0
==============================
==============================
11.05.04 Release CLHEP-2.0.0.2
==============================
......@@ -5,7 +57,7 @@
==============================
11.05.04 Release CLHEP-1.9.0.2
==============================
==============================
21.04.04 Release CLHEP-2.0.0.1
==============================
......
#-------------------------------------------------------------
# platform specific issues
#-------------------------------------------------------------
This package requires autoconf 2.59 or later and automake 1.9.1 or later.
If you bootstrap, you will probably have to build these yourself.
See "building autotools" below.
The new libtool no longer properly supports shared libraries for gcc 2.95.2.
If you build CLHEP with gcc 2.95.2, you must configure --disable-shared.
To build for Solaris CC, configure with CXX=CC CC=cc and use gmake.
#-------------------------------------------------------------
# installing from a source code tar ball
#-------------------------------------------------------------
......@@ -65,11 +78,13 @@ Now continue with directions as if you unpacked a source code tarball.
# building autotools
#-------------------------------------------------------------
If you do not have at least autoconf 2.57 and automake 1.6, you will
If you do not have at least autoconf 2.59 and automake 1.9.1, you will
need to build autoconf, automake, and libtool. On some platforms,
you may also need to build m4 and texinfo.
Download the relevant tarballs from gnu.org.
Download the relevant tarballs from gnu.org
(http://www.gnu.org/software/autoconf/, http://www.gnu.org/software/automake/,
and http://www.gnu.org/software/libtool/)
Untar them in a common source code tree.
Decide whether you want to install them in /usr/local or your own
install directory. If you use your own install directory, use
......
## Process this file with automake to produce Makefile.in
if USE_GMAKE
MAKE = gmake
endif
includedir = $(prefix)/include/CLHEP
# put . first so that CLHEP directory is built before anything else
......@@ -7,6 +11,8 @@ SUBDIRS = Units . test
# list all subdirectories - for distribution and cleaning
DIST_SUBDIRS = Units . test doc
bin_SCRIPTS = Units-config
all-local: $(top_builddir)/CLHEP
# create temporary CLHEP header tree
......@@ -58,3 +64,7 @@ docs:
install-docs:
cd doc; $(MAKE) $(AM_MAKEFLAGS) install-docs
# extra clean rule
clean-local:
rm -rf $(top_builddir)/CLHEP
#! /bin/sh
# @configure_input@
prefix=@prefix@
exec_prefix=@exec_prefix@
includedir=@includedir@
usage()
{
cat <<EOF
Usage: Units-config [OPTION]
Known values for OPTION are:
--prefix show installation prefix
--cxx print compilation command
--cppflags print pre-processor flags
--cxxflags print C++ compiler flags
--ldflags print linker flags
--libs print libraries to link against
--help display this help and exit
--version output version information
EOF
exit $1
}
if test $# -eq 0; then
usage 1
fi
while test $# -gt 0; do
case "$1" in
-*=*)
optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
;;
*)
optarg=
;;
esac
case "$1" in
--prefix=*)
prefix="$optarg"
;;
--prefix)
echo "$prefix"
;;
--version)
echo @PACKAGE@ @VERSION@
exit 0
;;
--help)
usage 0
;;
--cxx)
echo "CXX: " @CXX@
echo "CC: " @CC@
echo "CPP: " @CPP@
echo "CXXCPP: " @CXXCPP@
;;
--cppflags)
echo @CPPFLAGS@ @Units_CPPFLAGS@
;;
--cxxflags)
echo @AM_CXXFLAGS@ @CXXFLAGS@
;;
--ldflags)
echo @LDFLAGS@ @Units_LDFLAGS@
;;
--libs)
echo @LIBS@ @Units_LIBS@ -lm
;;
*)
usage
exit 1
;;
esac
shift
done
exit 0
#include "CLHEP/Units/PhysicalConstants.h"
using CLHEP::pi;
using CLHEP::twopi;
using CLHEP::halfpi;
using CLHEP::pi2;
using CLHEP::Avogadro;
using CLHEP::c_light;
using CLHEP::c_squared;
using CLHEP::h_Planck;
using CLHEP::hbar_Planck;
using CLHEP::hbarc;
using CLHEP::hbarc_squared;
using CLHEP::electron_charge;
using CLHEP::e_squared;
using CLHEP::electron_mass_c2;
using CLHEP::proton_mass_c2;
using CLHEP::neutron_mass_c2;
using CLHEP::amu_c2;
using CLHEP::amu;
using CLHEP::mu0;
using CLHEP::epsilon0;
using CLHEP::elm_coupling;
using CLHEP::fine_structure_const;
using CLHEP::classic_electr_radius;
using CLHEP::electron_Compton_length;
using CLHEP::Bohr_radius;
using CLHEP::alpha_rcl2;
using CLHEP::twopi_mc2_rcl2;
using CLHEP::k_Boltzmann;
using CLHEP::STP_Temperature;
using CLHEP::STP_Pressure;
using CLHEP::kGasThreshold;
using CLHEP::universe_mean_density;
#include "CLHEP/Units/SystemOfUnits.h"
using CLHEP::millimeter;
using CLHEP::millimeter2;
using CLHEP::millimeter3;
using CLHEP::centimeter;
using CLHEP::centimeter2;
using CLHEP::centimeter3;
using CLHEP::meter;
using CLHEP::meter2;
using CLHEP::meter3;
using CLHEP::kilometer;
using CLHEP::kilometer2;
using CLHEP::kilometer3;
using CLHEP::parsec;
using CLHEP::micrometer;
using CLHEP::nanometer;
using CLHEP::angstrom;
using CLHEP::fermi;
using CLHEP::barn;
using CLHEP::millibarn;
using CLHEP::microbarn;
using CLHEP::nanobarn;
using CLHEP::picobarn;
using CLHEP::mm;
using CLHEP::mm2;
using CLHEP::mm3;
using CLHEP::cm;
using CLHEP::cm2;
using CLHEP::cm3;
using CLHEP::m;
using CLHEP::m2;
using CLHEP::m3;
using CLHEP::km;
using CLHEP::km2;
using CLHEP::km3;
using CLHEP::pc;
using CLHEP::radian;
using CLHEP::milliradian;
using CLHEP::degree;
using CLHEP::steradian;
using CLHEP::rad;
using CLHEP::mrad;
using CLHEP::sr;
using CLHEP::deg;
using CLHEP::nanosecond;
using CLHEP::second;
using CLHEP::millisecond;
using CLHEP::microsecond;
using CLHEP::picosecond;
using CLHEP::hertz;
using CLHEP::kilohertz;
using CLHEP::megahertz;
using CLHEP::ns;
using CLHEP::s;
using CLHEP::ms;
using CLHEP::eplus;
using CLHEP::e_SI;
using CLHEP::coulomb;
using CLHEP::megaelectronvolt;
using CLHEP::electronvolt;
using CLHEP::kiloelectronvolt;
using CLHEP::gigaelectronvolt;
using CLHEP::teraelectronvolt;
using CLHEP::petaelectronvolt;
using CLHEP::joule;
using CLHEP::MeV;
using CLHEP::eV;
using CLHEP::keV;
using CLHEP::GeV;
using CLHEP::TeV;
using CLHEP::PeV;
using CLHEP::kilogram;
using CLHEP::gram;
using CLHEP::milligram;
using CLHEP::kg;
using CLHEP::g;
using CLHEP::mg;
using CLHEP::watt;
using CLHEP::newton;
using CLHEP::hep_pascal;
using CLHEP::bar;
using CLHEP::atmosphere;
using CLHEP::ampere;
using CLHEP::milliampere;
using CLHEP::microampere;
using CLHEP::nanoampere;
using CLHEP::megavolt;
using CLHEP::kilovolt;
using CLHEP::volt;
using CLHEP::ohm;
using CLHEP::farad;
using CLHEP::millifarad;
using CLHEP::microfarad;
using CLHEP::nanofarad;
using CLHEP::picofarad;
using CLHEP::weber;
using CLHEP::tesla;
using CLHEP::gauss;
using CLHEP::kilogauss;
using CLHEP::henry;
using CLHEP::kelvin;
using CLHEP::mole;
using CLHEP::becquerel;
using CLHEP::curie;
using CLHEP::gray;
using CLHEP::candela;
using CLHEP::lumen;
using CLHEP::lux;
using CLHEP::perCent;
using CLHEP::perThousand;
using CLHEP::perMillion;
## Process this file with automake to produce Makefile.in
if USE_GMAKE
MAKE = gmake
endif
includedir = $(prefix)/include/CLHEP
tempincludedir = $(TEMPDIR)/CLHEP/@PACKAGE@
pkginclude_HEADERS = \
GlobalPhysicalConstants.h \
GlobalSystemOfUnits.h \
PhysicalConstants.h \
SystemOfUnits.h \
defs.h
......
This diff is collapsed.
#! /bin/sh
# run autotool commands
set -x
# cleanup should not be necessary
# however, in some cases strange results are found if you do not start clean
rm -rf autom4te.cache
rm -f aclocal.m4
rm -f Makefile.in */Makefile.in */defs.h.in
rm -f autotools/config* autotools/depcomp autotools/install-sh autotools/m*
rm -f configure config.*
# run autotool commands
aclocal -I autotools
autoheader
automake --add-missing --copy
......
......@@ -8,14 +8,45 @@
# Identify the package and initialize the autotools:
# ----------------------------------------------------------------------
AC_PREREQ(2.57)
AC_INIT(CLHEP Units, 2.1.0.0, CLHEP@cern.ch, Units)
AC_PREREQ(2.59)
AC_INIT(CLHEP Units, 2.1.0.0, http://savannah.cern.ch/projects/clhep/, Units)
AC_CONFIG_AUX_DIR(autotools)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.6 foreign)
AC_PROG_LIBTOOL
AM_INIT_AUTOMAKE(1.9 foreign)
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB
# ----------------------------------------------------------------------
# --enable-shared and --enable-static
# both shared and static libraries are built by default
# ----------------------------------------------------------------------
AC_ARG_ENABLE(shared,
AC_HELP_STRING([--disable-shared],[do not build shared libraries]),
[case "${enableval}" in
yes) build_shared="yes";;
no) build_shared="no";;
*) build_shared="yes";;
esac],
[build_shared="yes"])
AC_ARG_ENABLE(static,
AC_HELP_STRING([--disable-static],[do not build static libraries]),
[case "${enableval}" in
yes) build_static="yes";;
no) build_static="no";;
*) build_static="yes";;
esac],
[build_static="yes"])
AC_ARG_ENABLE(gmake,
AC_HELP_STRING([--enable-gmake],[use gmake (default is make)]),
[case "${enableval}" in
yes) use_gmake="yes";;
no) use_gmake="no";;
*) use_gmake="no";;
esac],
[use_gmake="no"])
# ----------------------------------------------------------------------
# Identify the files that 'configure' is to produce:
......@@ -32,10 +63,12 @@ AC_CONFIG_FILES([test/Makefile])
AC_CONFIG_FILES([Units-deps])
AC_CONFIG_FILES([Units/copy-header.pl], [chmod +x Units/copy-header.pl])
# Configuration inquiry program/script:
AC_CONFIG_FILES([Units-config], [chmod +x Units-config])
# Test driver program/script:
AC_CONFIG_FILES([test/testUnits.sh], [chmod +x test/testUnits.sh])
# ----------------------------------------------------------------------
# Capture post-install information:
# ----------------------------------------------------------------------
......@@ -48,8 +81,6 @@ AC_SUBST(Units_CPPFLAGS)
AC_SUBST(Units_LIBS)
AC_SUBST(Units_LDFLAGS)
AC_SUBST(COPY_P)
# ----------------------------------------------------------------------
# Supply boilerplate for Units/defs.h source header:
# ----------------------------------------------------------------------
......@@ -108,72 +139,128 @@ AC_LANG(C++)
# Ensure we've found a preprocessor:
AC_REQUIRE_CPP
# worry about compiler flags
# copy and diff
case "$target" in
*-*-win32*)
case "$CXX" in
cl) CXXFLAGS="-DWIN32 -O -GX -GR -MD";COPY_P="copy -p";;
g++) CXXFLAGS="-O";COPY_P="copy -p";;
c++) CXXFLAGS="-O";COPY_P="copy -p";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
COPY_P="copy -p";DIFF_Q="diff -q -b"
;;
*-*-cygwin*)
case "$CXX" in
cl) CXXFLAGS="-DWIN32 -O -GX -GR -MD";COPY_P="cp -p";;
g++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
COPY_P="cp -p";DIFF_Q="diff -q -b"
;;
*-*-solaris*)
case "$CXX" in
CC) CXXFLAGS="-O -mt";COPY_P="cp -p";;
g++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
COPY_P="cp -p";DIFF_Q="diff -b"
use_gmake="yes"
;;
*-*-linux*)
case "$CXX" in
g++) CXXFLAGS="-O -ansi -pedantic -Wall -D_GNU_SOURCE";COPY_P="cp -p";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall -D_GNU_SOURCE";COPY_P="cp -p";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
alpha*-dec-osf*)
case "$CXX" in
cxx) CXXFLAGS="-O -std strict_ansi -timplicit_local";COPY_P="cp -p";;
g++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
*-*-hpux*)
case "$CXX" in
aCC) CXXFLAGS="-O -Aa +DAportable +Onolimit";COPY_P="cp -p";;
CC) CXXFLAGS="+O3 +DAportable +a1 -z -pta +Onolimit";COPY_P="cp -p";;
g++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
*-*-aix*)
case "$CXX" in
xlC) CXXFLAGS="-O3 -qtwolink -+";COPY_P="cp -p";;
g++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
*-*-irix*)
case "$CXX" in
CC) CXXFLAGS="-O -OPT:Olimit=0 -pta";COPY_P="cp -p";;
g++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
powerpc-apple-darwin*)
case "$CXX" in
g++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";COPY_P="cp -p";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
COPY_P="cp -p";DIFF_Q="diff -q -b"
;;
*)
COPY_P="cp -p";DIFF_Q="diff -q -b"
esac
AM_CONDITIONAL(USE_GMAKE, test x$use_gmake = xyes)
AC_SUBST(COPY_P)
AC_SUBST(DIFF_Q)
# worry about compiler flags
case "$CXX" in
g++)
case "$target" in
*-*-linux*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall -D_GNU_SOURCE"
MY_SHFLAGS="-fPIC -DPIC"; MY_SHLINK="-shared"; SHEXT=so
MY_SHNAME="-Wl,-soname,"; MY_LD="-Wl,--rpath -Wl,"
AR="ar"; ARFLAGS="cru"
;;
*-*-darwin*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall -D_GNU_SOURCE"
MY_SHFLAGS="-fPIC -DPIC"; MY_SHLINK="-dynamiclib -single_module"; SHEXT=dylib
MY_SHNAME="-Wl,-soname,"; MY_LD="-Wl,--rpath -Wl,"
AR="ar"; ARFLAGS="cru"
build_shared="no"
;;
*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall"
MY_SHFLAGS="-fPIC -DPIC"; MY_SHLINK="-shared"; SHEXT=so
MY_SHNAME="-Wl,-soname,"; MY_LD="-Wl,--rpath -Wl,"
AR="ar"; ARFLAGS="cru"
esac;;
c++)
case "$target" in
*-*-linux*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall -D_GNU_SOURCE"
MY_SHFLAGS="-fPIC -DPIC"; MY_SHLINK="-shared"; SHEXT=so
MY_SHNAME="-Wl,-soname,"; MY_LD="-Wl,--rpath -Wl,"
AR="ar"; ARFLAGS="cru"
;;
*-*-darwin*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall -D_GNU_SOURCE"
MY_SHFLAGS="-fPIC -DPIC"; MY_SHLINK="-dynamiclib -single_module"; SHEXT=dylib
MY_SHNAME="-Wl,-soname,"; MY_LD="-Wl,--rpath -Wl,"
AR="ar"; ARFLAGS="cru"
build_shared="no"
;;
*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall"
MY_SHFLAGS="-fPIC -DPIC"; MY_SHLINK="-shared"; SHEXT=so
MY_SHNAME="-Wl,-soname,"; MY_LD="-Wl,--rpath -Wl,"
AR="ar"; ARFLAGS="cru"
esac;;
cl)
AM_CXXFLAGS="-EHsc -nologo -GR -GX -MD"
AR="ar"; ARFLAGS="cru"
build_shared="no"
;;
CC)
case "$target" in
*-*-solaris*)
AM_CXXFLAGS="-O"
MY_SHFLAGS="-KPIC -DPIC"; MY_SHLINK="-G"; SHEXT=so
MY_SHNAME="-h"; MY_LD="-R"
AM_LDFLAGS="-lsunmath"
AR="CC"; ARFLAGS="-xar -o"
;;
*-*-hpux*) AM_CXXFLAGS="+O3 +DAportable +a1 -z -pta +Onolimit"
AR="ar"; ARFLAGS="cru"
build_shared="no"
;;
*-*-irix*) AM_CXXFLAGS="-O -OPT:Olimit=0 -pta"
AR="ar"; ARFLAGS="cru"
build_shared="no"
;;
*) echo UNEXPECTED CHOICE OF OPERATING SYSTEM FOR $CXX: $target
esac;;
aCC)
AM_CXXFLAGS="-O -Aa +DAportable +Onolimit"
AR="ar"; ARFLAGS="cru"
build_shared="no"
;;
cxx)
AM_CXXFLAGS="-O -std strict_ansi -timplicit_local"
AR="ar"; ARFLAGS="cru"
build_shared="no"
;;
xlC)
AM_CXXFLAGS="-O3 -qtwolink -+"
AR="ar"; ARFLAGS="cru"
build_shared="no"
;;