Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-06-30 08:56:38

0001 #!/bin/sh
0002 
0003 # Print some compiler options to aid in building programs that use
0004 # JANA as a 3rd party package.
0005 
0006 # Here we have a couple of options for dealing with various user
0007 # environments. Namely, if the user has set JANA_HOME, but it is
0008 # different from the installation directory pasted into this file
0009 # during installation, then we have to decide what to go with.
0010 #
0011 # Here we check if the JANA static library file exists using the
0012 # the hardwired installation directory value. If not, then we
0013 # look for the JANA_HOME environment variable. If that is not set
0014 # then just use /usr/local.
0015 
0016 # Hardwired values. Most of this is copied from BMS/Makefile.config.in
0017 # and helps document the settings when JANA was built so there is
0018 # the possibility of reusing them if needed when building against
0019 # this JANA installation.
0020 
0021 # usage prints the help message
0022 usage() {
0023     cat <<EOF
0024 
0025 Usage:
0026      jana-config [--help,-h] [--version,-v] [--jana-only] [--cflags] [--libs] [--cxxstandard] [--osname]
0027 
0028 Print compiler options useful to help build programs using this "
0029 JANA installation.
0030 
0031   --help, -h    Display this help message.
0032 
0033   --version,-v  Display JANA2 version.
0034 
0035   --jana-only   Don't include arguments from packages JANA was built
0036                 to include support for. Use this if you wish to specify
0037                 these yourself. If you do include this option, it must
0038                 come first in the arugment list as it will only affect
0039                 options that follow it.
0040 
0041   --cxxflags    print flags needed to compile (not necessarily link)
0042                 a program against this installation of JANA.
0043 
0044   --cflags      (same as --cxxflags)
0045 
0046   --libs        print flags needed to link a program against this
0047                 installation of JANA.
0048 
0049   --cxxstandard print the c++ standard used to build JANA2
0050 
0051   --installdir  print install directory for JANA2 build
0052 
0053 EOF
0054 }
0055 
0056 # If no argument is passed, or help is requested, show usage
0057 if [ "$#" -eq 0 ]; then
0058     usage
0059     exit 0
0060 fi
0061 
0062 
0063 CMAKE_INSTALL_PREFIX="@CMAKE_INSTALL_PREFIX@"
0064 CMAKE_CXX_STANDARD="@CMAKE_CXX_STANDARD@"
0065 
0066 JANA_VERSION="@PROJECT_VERSION@"
0067 
0068 HAVE_MYSQL="@HAVE_MYSQL@"
0069 JANA2_HAVE_XERCES="@JANA2_HAVE_XERCES@"
0070 JANA2_HAVE_ROOT="@JANA2_HAVE_ROOT@"
0071 HAVE_CMSG="@HAVE_CMSG@"
0072 HAVE_CURL="@HAVE_CURL@"
0073 HAVE_CCDB="@HAVE_CCDB@"
0074 
0075 MYSQL_CFLAGS="@MYSQL_CFLAGS@"
0076 MYSQL_LDFLAGS="@MYSQL_LDFLAGS@"
0077 MYSQL_VERSION="@MYSQL_VERSION@"
0078 
0079 XERCES_CPPFLAGS="@XERCES_CPPFLAGS@"
0080 XERCES_LDFLAGS="@XERCES_LDFLAGS@"
0081 XERCES_LIBS="@XERCES_LIBS@"
0082 
0083 ROOTCFLAGS="@ROOTCFLAGS@"
0084 ROOTGLIBS="@ROOTGLIBS@"
0085 
0086 CMSG_CPPFLAGS="@CMSG_CPPFLAGS@"
0087 CMSG_LDFLAGS="@CMSG_LDFLAGS@"
0088 CMSG_LIBS="@CMSG_LIBS@"
0089 
0090 CURL_CFLAGS="@CURL_CFLAGS@"
0091 CURL_LDFLAGS="@CURL_LDFLAGS@"
0092 
0093 CCDB_CPPFLAGS="@CCDB_CPPFLAGS@"
0094 CCDB_LDFLAGS="@CCDB_LDFLAGS@"
0095 CCDB_LIBS="@CCDB_LIBS@"
0096 
0097 JANA_INSTALL_DIR="@JANA_INSTALL_DIR@"
0098 JANA_ONLY_LIBS="@JANA_ONLY_LIBS@"
0099 
0100 # Add flags and libraries from all 3rd party packages
0101 CPPFLAGS="${MYSQL_CFLAGS} ${XERCES_CPPFLAGS} ${ROOTCFLAGS} ${CMSG_CPPFLAGS} ${CURL_CFLAGS} ${CCDB_CPPFLAGS}"
0102 LDFLAGS="${MYSQL_LDFLAGS} ${XERCES_LDFLAGS} ${CMSG_LDFLAGS} ${CURL_LDFLAGS} ${CCDB_LDFLAGS}"
0103 LIBS="${XERCES_LIBS} ${ROOTGLIBS} ${CMSG_LIBS} ${CCDB_LIBS}"
0104 
0105 # If hardwired value doesn't point to libJANA.a, try JANA_HOME
0106 if [ ! -e "${JANA_INSTALL_DIR}/lib/libJANA.a" ]; then
0107         if [ -n "${JANA_HOME:+x}" ]; then
0108                 JANA_INSTALL_DIR=${JANA_HOME}
0109         else
0110                 JANA_INSTALL_DIR=/usr/local
0111         fi
0112 fi
0113 
0114 # Loop over command line arguments
0115 while test $# -gt 0; do
0116 
0117         case $1 in
0118                 --cflags|--cxxflags)
0119                         mess="$mess -I${JANA_INSTALL_DIR}/include ${CPPFLAGS}"
0120                         ;;
0121                 --version|-v)
0122                         mess="${JANA_VERSION}"
0123                         ;;
0124                 --libs)
0125                         mess="$mess -Wl,-rpath,${JANA_INSTALL_DIR}/lib -L${JANA_INSTALL_DIR}/lib -lJANA ${LDFLAGS} ${JANA_ONLY_LIBS} ${LIBS}"
0126                         ;;
0127                 --static-libs)
0128                         mess="$mess ${JANA_INSTALL_DIR}/lib/libJANA.a ${LDFLAGS} ${JANA_ONLY_LIBS} ${LIBS}"
0129                         ;;
0130                 --jana-only)
0131                         CPPFLAGS=""
0132                         LDFLAGS=""
0133                         LIBS=""
0134                         ;;
0135                 --help|-h)
0136                         usage
0137                         exit 0
0138                         ;;
0139                 --cxxstandard)
0140                         mess="$mess ${CMAKE_CXX_STANDARD}"
0141                         ;;
0142                 --installdir)
0143                         mess="$mess ${CMAKE_INSTALL_PREFIX}"
0144                         ;;
0145                 *)
0146                 mess="Unknown option: $1" >&2
0147         ;;
0148         esac
0149         shift
0150 done
0151 
0152 echo $mess