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

build libCLHEP-version cleanly

parent 3bb21e92
......@@ -2,11 +2,26 @@
includedir = $(prefix)/include/CLHEP
SUBDIRS = Vector Evaluator GenericFunctions Geometry Matrix Random RandomObjects Units Utilities HepPDT HepMC StdHep
###SUBDIRS = Vector Evaluator GenericFunctions Geometry Matrix Random RandomObjects Units Utilities HepPDT HepMC StdHep
SUBDIRS = Vector Evaluator Geometry
bin_SCRIPTS = clheplib
CLEANFILES = clheplib library-list
CLEANFILES = clheplib library-list $(LTCLHEPLIB)
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
CXXFLAGS = @CXXFLAGS@
LTCLHEPLIB = libCLHEP-@VERSION@.la
CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
all-local: $(LTCLHEPLIB)
$(LTCLHEPLIB):
liblist=`$(srcdir)/getObjectList $(SUBDIRS)`; \
$(CXXLINK) -rpath $(libdir) $$liblist $(LIBS)
docs:
list='$(SUBDIRS)'; for subdir in $$list; do \
......@@ -21,5 +36,19 @@ install-docs:
clheplib: build-clheplib
build-clheplib $(SUBDIRS)
install-exec-local: install-LTCLHEPLIB
install-LTCLHEPLIB: $(LTCLHEPLIB)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libdir)
@list='$(LTCLHEPLIB)'; for p in $$list; do \
if test -f $$p; then \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \
$(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \
else :; fi; \
done
clean-local:
rm -f *-dep-list
rm -f *-library-list
......@@ -91,9 +91,9 @@ echo "else " >> clheplib
echo " pkg=\$1 " >> clheplib
echo "fi " >> clheplib
echo " " >> clheplib
echo "libdir=\"-L$uselibdir\" " >> clheplib
echo "libdir=\"$uselibdir\" " >> clheplib
echo "if test -n \"\$CLHEP_DIR\"; then " >> clheplib
echo " libdir=\"-L\$CLHEP_DIR/lib\" " >> clheplib
echo " libdir=\"\$CLHEP_DIR/lib\" " >> clheplib
echo "fi " >> clheplib
echo " " >> clheplib
echo "case "\$pkg" in " >> clheplib
......@@ -104,7 +104,12 @@ for lib in $tlist; do
clibs="$clibs -l$lib"
done
echo "all) " >> clheplib
echo " echo \$libdir $clibs" >> clheplib
echo " if test -e \$libdir/libCLHEP-@VERSION@.a || test -e \$libdir/libCLHEP-@VERSION@.so " >> clheplib
echo " then " >> clheplib
echo " echo -L\$libdir -lCLHEP-@VERSION@ " >> clheplib
echo " else " >> clheplib
echo " echo -L\$libdir $clibs" >> clheplib
echo " fi " >> clheplib
echo " ;; " >> clheplib
for sub in $sublist; do
......@@ -116,11 +121,11 @@ for sub in $sublist; do
clibs="$clibs -l$lib"
done
echo "$sub) " >> clheplib
echo " echo \$libdir $clibs" >> clheplib
echo " echo -L\$libdir $clibs" >> clheplib
echo " ;; " >> clheplib
else
echo "$sub) " >> clheplib
echo " echo \$libdir " >> clheplib
echo " echo -L\$libdir " >> clheplib
echo " ;; " >> clheplib
fi
done
......
......@@ -10,14 +10,17 @@
AC_PREREQ(2.57)
AC_INIT(CLHEP, 1.9.0.0, CLHEP@cern.ch )
AC_CANONICAL_TARGET
AC_CONFIG_SRCDIR([Vector/src/AxisAngle.cc])
AM_INIT_AUTOMAKE(1.6 foreign)
AC_PROG_LIBTOOL
# ----------------------------------------------------------------------
# subpackages
# ----------------------------------------------------------------------
AC_CONFIG_SUBDIRS(Vector Evaluator GenericFunctions Geometry Matrix Random RandomObjects Units Utilities HepPDT HepMC StdHep)
##AC_CONFIG_SUBDIRS(Vector Evaluator GenericFunctions Geometry Matrix Random RandomObjects Units Utilities HepPDT HepMC StdHep)
AC_CONFIG_SUBDIRS(Vector Evaluator Geometry)
# ----------------------------------------------------------------------
# Identify the files that 'configure' is to produce:
......@@ -32,6 +35,85 @@ AC_CONFIG_FILES([makeBinaryTar], [chmod +x makeBinaryTar])
# build clheplib
AC_CONFIG_FILES([build-clheplib], [chmod +x build-clheplib])
# ----------------------------------------------------------------------
# Check for needed programs:
# ----------------------------------------------------------------------
# Locate a C++ compiler:
AC_PROG_CXX(g++ c++ aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC gpp)
# Use it hereinafter:
AC_LANG(C++)
# Ensure we've found a preprocessor:
AC_REQUIRE_CPP
# worry about compiler flags
case "$target" in
*-*-win32*)
case "$CXX" in
cl) CXXFLAGS="-DWIN32 -O -GX -GR -MD";;
g++) CXXFLAGS="-O";;
c++) CXXFLAGS="-O";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
*-*-cygwin*)
case "$CXX" in
cl) CXXFLAGS="-DWIN32 -O -GX -GR -MD";;
g++) CXXFLAGS="-O -ansi -pedantic -Wall";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
*-*-solaris*)
case "$CXX" in
CC) CXXFLAGS="-O -mt";;
g++) CXXFLAGS="-O -ansi -pedantic -Wall";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
*-*-linux*)
case "$CXX" in
g++) CXXFLAGS="-O -ansi -pedantic -Wall -D_GNU_SOURCE";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall -D_GNU_SOURCE";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
alpha*-dec-osf*)
case "$CXX" in
cxx) CXXFLAGS="-O -std strict_ansi -timplicit_local";;
g++) CXXFLAGS="-O -ansi -pedantic -Wall";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
*-*-hpux*)
case "$CXX" in
aCC) CXXFLAGS="-O -Aa +DAportable +Onolimit";;
CC) CXXFLAGS="+O3 +DAportable +a1 -z -pta +Onolimit";;
g++) CXXFLAGS="-O -ansi -pedantic -Wall";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
*-*-aix*)
case "$CXX" in
xlC) CXXFLAGS="-O3 -qtwolink -+";;
g++) CXXFLAGS="-O -ansi -pedantic -Wall";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
*-*-irix*)
case "$CXX" in
CC) CXXFLAGS="-O -OPT:Olimit=0 -pta";;
g++) CXXFLAGS="-O -ansi -pedantic -Wall";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
powerpc-apple-darwin*)
case "$CXX" in
g++) CXXFLAGS="-O -ansi -pedantic -Wall";;
c++) CXXFLAGS="-O -ansi -pedantic -Wall";;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac;;
esac
# ----------------------------------------------------------------------
# Finish up:
......
......@@ -9,7 +9,7 @@ for subdir in "$@"
do
if test -d $subdir/src/.libs
then
thispkg=`ls $subdir/src/.libs/*.o`
thispkg=`ls $subdir/src/*.lo`
filelist="$filelist $thispkg"
fi
done
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment