Skip to content
Snippets Groups Projects
Commit e051fae3 authored by Fons Rademakers's avatar Fons Rademakers
Browse files

root-config has new options --arch and --has-<feature> where feature can be

any of the ./configure --has-<features>, e.g. root-config --has-mysql
returns "yes" if mysql was enabled during the ROOT installation and
"no" otherwise. By Christian Holm.


git-svn-id: http://root.cern.ch/svn/root/trunk@4222 27541ba8-7e3a-0410-8455-c3a389f83636
parent f7468547
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
arch=@architecture@ arch=@architecture@
libdir=@libdir@ libdir=@libdir@
incdir=@incdir@ incdir=@incdir@
features="@features@"
if test "$arch" = "win32gdk"; then if test "$arch" = "win32gdk"; then
arch="win32" arch="win32"
fi fi
...@@ -268,7 +269,20 @@ win32) ...@@ -268,7 +269,20 @@ win32)
;; ;;
esac esac
### end of machine dependent settings ###
### compiler dependent settings ###
case $arch in
*kcc)
for f in $features ; do
if test "x$f" = "xthread" ; then
auxcflags="--thread_safe $auxcflags"
auxldflags="--thread_safe $auxldflags"
fi
done
esac
### end of machine and compiler dependent settings ###
prefix=@prefix@ prefix=@prefix@
...@@ -285,7 +299,7 @@ noauxcflags=no ...@@ -285,7 +299,7 @@ noauxcflags=no
noldflags=no noldflags=no
usage="\ usage="\
Usage: root-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--new] [--nonew] [--libs] [--glibs] [--libdir] [--incdir] [--noauxcflags] [--noauxlibs] [--noldflags] [--help]" Usage: root-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--new] [--nonew] [--libs] [--glibs] [--libdir] [--incdir] [--noauxcflags] [--noauxlibs] [--noldflags] [--has-<feature>] [--arch] [--help]"
if test $# -eq 0; then if test $# -eq 0; then
echo "${usage}" 1>&2 echo "${usage}" 1>&2
...@@ -301,6 +315,24 @@ while test $# -gt 0; do ...@@ -301,6 +315,24 @@ while test $# -gt 0; do
esac esac
case $1 in case $1 in
--arch)
### Output the arcitecture
out="$out $arch"
;;
--has-*)
### Check for feature
f=`echo $1 | sed 's/--has-//'`
for c in $features ; do
if test "x$c" = "x$f" ; then
out="$out yes"
break
fi
c=""
done
if test "x$c" = "x" ; then
out="$out no"
fi
;;
--prefix=*) --prefix=*)
### Set the prefix ### Set the prefix
if test "$arch" = "win32"; then if test "$arch" = "win32"; then
...@@ -470,6 +502,7 @@ while test $# -gt 0; do ...@@ -470,6 +502,7 @@ while test $# -gt 0; do
### Print a help message ### Print a help message
echo "Usage: `basename $0` [options]" echo "Usage: `basename $0` [options]"
echo "" echo ""
echo " --arch Print the architecture"
echo " --prefix[=dir] Print or set prefix" echo " --prefix[=dir] Print or set prefix"
echo " --exec-prefix[=dir] Print or set execution prefix" echo " --exec-prefix[=dir] Print or set execution prefix"
echo " --libs Print regular ROOT libraries" echo " --libs Print regular ROOT libraries"
...@@ -483,6 +516,7 @@ while test $# -gt 0; do ...@@ -483,6 +516,7 @@ while test $# -gt 0; do
echo " --noauxlibs Do not print auxiliary/system libraries" echo " --noauxlibs Do not print auxiliary/system libraries"
echo " --noauxcflags Do not print auxiliary compiler flags" echo " --noauxcflags Do not print auxiliary compiler flags"
echo " --noldflags Do not print linker flags" echo " --noldflags Do not print linker flags"
echo " --has-<feature> Test if <feature> is compiled in"
echo " --version Print the ROOT version" echo " --version Print the ROOT version"
exit 0 exit 0
;; ;;
......
...@@ -41,6 +41,12 @@ enable_ttf=yes ...@@ -41,6 +41,12 @@ enable_ttf=yes
enable_venus=yes enable_venus=yes
show_pkglist=no show_pkglist=no
options="enable_afs enable_cern enable_mysql enable_opengl enable_pgsql \
enable_pythia enable_pythia6 enable_rfio enable_dcache enable_rpath \
enable_sapdb enable_shadowpw enable_shared enable_soversion \
enable_srp enable_star enable_thread enable_ttf enable_venus \
enable_krb5"
###################################################################### ######################################################################
# #
...@@ -295,6 +301,7 @@ confhelp() { ...@@ -295,6 +301,7 @@ confhelp() {
echo " dcache dCache support, requires dcap library from DESY" echo " dcache dCache support, requires dcap library from DESY"
echo " srp SRP support, requires SRP source tree" echo " srp SRP support, requires SRP source tree"
echo " afs AFS support, requires AFS libs and objects" echo " afs AFS support, requires AFS libs and objects"
echo " krb5 Kerberos5 support, requires Kerberos libs"
echo " shadowpw Shadow password support" echo " shadowpw Shadow password support"
echo " pythia Pythia5 EG support, requires libPythia" echo " pythia Pythia5 EG support, requires libPythia"
echo " pythia6 Pythia6 EG support, requires libPythia6" echo " pythia6 Pythia6 EG support, requires libPythia6"
...@@ -324,6 +331,7 @@ confhelp() { ...@@ -324,6 +331,7 @@ confhelp() {
echo " srp-incdir SRP support, location header of t_server.h" echo " srp-incdir SRP support, location header of t_server.h"
echo " srp-libdir SRP support, location header of libsrp.a" echo " srp-libdir SRP support, location header of libsrp.a"
echo " afs AFS support, location of AFS distribution" echo " afs AFS support, location of AFS distribution"
echo " krb5 Kerberos5 support, location of Kerberos distribution"
echo " sys-iconpath Extra icon path" echo " sys-iconpath Extra icon path"
echo "" echo ""
cat config/ARCHS cat config/ARCHS
...@@ -415,46 +423,30 @@ if test $# -gt 0 ; then ...@@ -415,46 +423,30 @@ if test $# -gt 0 ; then
# Enable/disable to turn on/off third party software linkage and # Enable/disable to turn on/off third party software linkage and
# features # features
# #
--enable-shared) enable_shared=yes ;; --enable-*)
--disable-shared) enable_shared=no ;; f=`echo $1 | sed -e 's/--//' -e 's/-/_/'`
--enable-rpath) enable_rpath=yes ;; eval $f=yes
--disable-rpath) enable_rpath=no ;; for c in $options ; do
--enable-star) enable_star=yes ;; if test "x$c" = "x$f" ; then
--disable-star) enable_star=no ;; f=""
--enable-ttf) enable_ttf=yes ;; fi
--disable-ttf) enable_ttf=no ;; done
--enable-opengl) enable_opengl=yes ;; if test "x$f" != "x" ; then
--disable-opengl) enable_opengl=no ;; echo "Invalid option '$1'. Try $0 --help" ; exit 1 ;
--enable-cern) enable_cern=yes ;; fi
--disable-cern) enable_cern=no ;; ;;
--enable-mysql) enable_mysql=yes ;; --disable-*)
--disable-mysql) enable_mysql=no ;; f=`echo $1 | sed -e 's/--disable/enable/' -e 's/-/_/'`
--enable-pgsql) enable_pgsql=yes ;; eval $f=no
--disable-pgsql) enable_pgsql=no ;; for c in $options ; do
--enable-sapdb) enable_sapdb=yes ;; if test "x$c" = "x$f" ; then
--disable-sapdb) enable_sapdb=no ;; f=""
--enable-rfio) enable_rfio=yes ;; fi
--disable-rfio) enable_rfio=no ;; done
--enable-dcache) enable_dcache=yes ;; if test "x$f" != "x" ; then
--disable-dcache) enable_dcache=no ;; echo "Invalid option '$1'. Try $0 --help" ; exit 1 ;
--enable-thread) enable_thread=yes ;; fi
--disable-thread) enable_thread=no ;; ;;
--enable-srp) enable_srp=yes ;;
--disable-srp) enable_srp=no ;;
--enable-afs) enable_afs=yes ;;
--disable-afs) enable_afs=no ;;
--enable-krb5) enable_krb5=yes ;;
--disable-krb5) enable_krb5=no ;;
--enable-shadowpw) enable_shadowpw=yes ;;
--disable-shadowpw) enable_shadowpw=no ;;
--enable-pythia) enable_pythia=yes ;;
--disable-pythia) enable_pythia=no ;;
--enable-pythia6) enable_pythia6=yes ;;
--disable-pythia6) enable_pythia6=no ;;
--enable-venus) enable_venus=yes ;;
--disable-venus) enable_venus=no ;;
--enable-soversion) enable_soversion=yes ;;
--disable-soversion) enable_soversion=no ;;
################################################################ ################################################################
# #
# Build steering option # Build steering option
...@@ -1392,10 +1384,19 @@ if test "$prefix2" = "\$(ROOTSYS)" ; then ...@@ -1392,10 +1384,19 @@ if test "$prefix2" = "\$(ROOTSYS)" ; then
libdir2=\$ROOTSYS/lib libdir2=\$ROOTSYS/lib
incdir2=\$ROOTSYS/include incdir2=\$ROOTSYS/include
fi fi
features=""
for f in $options ; do
bar="$`echo $f`"
if test "x`eval echo $bar`" = "xyes" ; then
feat=`echo $f | sed 's/enable_//'`
features="$features $feat"
fi
done
sed -e "s|@architecture@|$arch|" \ sed -e "s|@architecture@|$arch|" \
-e "s|@prefix@|$prefix2|" \ -e "s|@prefix@|$prefix2|" \
-e "s|@incdir@|$incdir2|" \ -e "s|@incdir@|$incdir2|" \
-e "s|@libdir@|$libdir2|" \ -e "s|@libdir@|$libdir2|" \
-e "s|@features@|$features|" \
< root-config.tmp > $RCONFOUT < root-config.tmp > $RCONFOUT
rm -f root-config.tmp rm -f root-config.tmp
chmod 755 $RCONFOUT chmod 755 $RCONFOUT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment