#-------------------------------------------------------------------------------
# Macros which are set by configure.
#-------------------------------------------------------------------------------
# Install locations for this component's products.
HD_PREFIX="@prefix@"
HD_EXEC_PFX="@exec_prefix@"
HD_SRC="@HD_SRC@"

# Install locations for top (HEADAS-wide) products.
HD_TOP_PFX="@HD_TOP_PFX@"
HD_TOP_EXEC_PFX="@HD_TOP_EXEC_PFX@"

# Identify OS/architecture
HD_HOST="@host@"

# Identifiers for library version numbers.
AST="@AST@"
AST_DIR="@AST_DIR@"
CFITSIO="@CFITSIO@"
CFITSIO_VERS="@CFITSIO_VERS@"
CFITSIO_DIR="@CFITSIO_DIR@"
CCFITS="@CCFITS@"
CCFITS_DIR="@CCFITS_DIR@"
HEAINIT="@HEAINIT@"
HEAIO="@HEAIO@"
HEAUTILS="@HEAUTILS@"
HEASP="@HEASP@"
HOOPS="@HOOPS@"
PIL="@PIL@"
PIL_DIR="@PIL_DIR@"
READLINE="@READLINE@"
READLINE_DIR="@READLINE_DIR@"
FITSPERL="@FITSPERL@"
FITSPERL_DIR="@FITSPERL_DIR@"
PILPERL="@PILPERL@"
PILPERL_DIR="@PILPERL_DIR@"
HDUTILSPERL="@HDUTILSPERL@"
HDUTILSPERL_DIR="@HDUTILSPERL_DIR@"
HDINITPERL="@HDINITPERL@"
HDINITPERL_DIR="@HDINITPERL_DIR@"
WCSLIB="@WCSLIB@"
WCSLIB_DIR="@WCSLIB_DIR@"

#-------------------------------------------------------------------------------
# Build-related macros.
#-------------------------------------------------------------------------------
HD_LIB_STYLE="@HD_LIB_STYLE@"
HD_LIB_STYLE_F77="@HD_LIB_STYLE_F77@"
AR="@AR@"
ARCHIVE="@ARCHIVE@"
ARCHIVE_CXX="@ARCHIVE_CXX@"
BSUF="@BSUF@"
CC="@CC@"
CFLAGS="@CFLAGS@"
COPT="@COPT@"
CXX="@CXX@"
CXXFLAGS="@CXXFLAGS@"
CXXOPT="@CXXOPT@"
DEFS="@DEFS@"
DPRINTF="-Dprintf=headas_printf"
DYNPERL_SUFFIX="@DYNPERL_SUFFIX@"
EXT="@EXT@"
WCSFLAV="@WCSFLAV@"
FC="@FC@"
FC_BASENAME="@FC_BASENAME@"
FFLAGS="@FFLAGS@"
FOPT="@FOPT@"
G77="@G77@"
GCC="@GCC@"
GXX="@GXX@"
HD_LN_SYM="@HD_LN_SYM@"
MAKE="@MAKE@"
OSUF="@OSUF@"
PERL="@PERL@"
RANLIB="@RANLIB@"
SIZEOF_LONG="@SIZEOF_LONG@"
STRIP="@STRIP@"
SYSLIBS="@LIBS@"
SHLIB_LD="@SHLIB_LD@"
SHLIB_LD_CXX="@SHLIB_LD_CXX@"
SHLIB_SUFFIX="@SHLIB_SUFFIX@"
LDFLAGS_C="@LDFLAGS_C@"
LDFLAGS_CXX="@LDFLAGS_CXX@"
LDFLAGS_F="@LDFLAGS_F@"
PIL_EXTRA_CFLAGS="@PIL_EXTRA_CFLAGS@"
FV_BUILD="@fv_build@"
HD_BUILD_ARCH_32_BIT="@HD_BUILD_ARCH_32_BIT@"

#-------------------------------------------------------------------------------
# Macros which are hard-wired.
#-------------------------------------------------------------------------------
HD_COMPONENT_NAME="heacore"
HD_COMPONENT_VERS=""
HMAKE="yes"

#-------------------------------------------------------------------------------
# Macros which are derived.
#-------------------------------------------------------------------------------
HD_BLD_PFX="$HD_SRC/BLD"
HD_BLD_EXEC_PFX="$HD_BLD_PFX/$HD_HOST"
HD_BUILD_DIR="$HD_SRC/BUILD_DIR"

HD_MAKE="$MAKE"
HD_STD_MAKEFILE="$HMAKE_CONF_DIR/Makefile-std"

HD_PATH_INSTALLED="$HD_EXEC_PFX"
HD_PATH_LOCAL="$HD_BLD_EXEC_PFX"
HD_PATH="$HD_PATH_LOCAL:$HD_PATH_INSTALLED"

HD_INC_PATH=`echo "$HD_PATH/include" | sed 's%:%/include:%g'`
HD_LIB_PATH=`echo "$HD_PATH/lib" | sed 's%:%/lib:%g'`
HD_INC_PATH_LOCAL=`echo "$HD_PATH_LOCAL/include" | sed 's%:%/include:%g'`
HD_LIB_PATH_LOCAL=`echo "$HD_PATH_LOCAL/lib" | sed 's%:%/lib:%g'`

HD_IFLAGS=`echo "-I./ -I$HD_INC_PATH" | sed 's%:% -I%g'`
HD_LFLAGS=`echo "-L./ -L$HD_LIB_PATH" | sed 's%:% -L%g'`
HD_IFLAGS_LOCAL=`echo "-I./ -I$HD_INC_PATH_LOCAL" | sed 's%:% -I%g'`
HD_LFLAGS_LOCAL=`echo "-L./ -L$HD_LIB_PATH_LOCAL" | sed 's%:% -L%g'`

HD_STD_LIBS="-l${HEAINIT} -l${HEAUTILS} -l${PIL} -l${CFITSIO} -l${READLINE} -l${HEAIO}"

HD_STD_CFLAGS="$COPT $CFLAGS $HD_IFLAGS $DEFS"
HD_STD_CLIBS="$HD_LFLAGS $HD_STD_LIBS $SYSLIBS"
HD_STD_CFLAGS_LOCAL="$COPT $CFLAGS $HD_IFLAGS_LOCAL $DEFS"
HD_STD_CLIBS_LOCAL="$HD_LFLAGS_LOCAL $HD_STD_LIBS $SYSLIBS"

HD_STD_FFLAGS="$FOPT $FFLAGS"

HD_STD_CXXFLAGS="$CXXOPT $CXXFLAGS $HD_IFLAGS $DEFS"
HD_STD_CXXLIBS="$HD_LFLAGS -l${CCFITS} $HD_STD_LIBS $SYSLIBS"
HD_STD_CXXFLAGS_LOCAL="$CXXOPT $CXXFLAGS $HD_IFLAGS_LOCAL $DEFS"
HD_STD_CXXLIBS_LOCAL="$HD_STD_CLIBS_LOCAL"

VPATH="$HD_INC_PATH:$HD_LIB_PATH"
VPATH_LOCAL="$HD_INC_PATH_LOCAL:$HD_LIB_PATH_LOCAL"

#-------------------------------------------------------------------------------
# Export all necessary variables.
#-------------------------------------------------------------------------------
export HD_PREFIX
export HD_EXEC_PFX
export HD_SRC

export HD_TOP_PFX
export HD_TOP_EXEC_PFX
export HD_HOST

export AST
export AST_DIR
export CFITSIO
export CFITSIO_VERS
export CFITSIO_DIR
export CCFITS
export CCFITS_DIR
export HEAINIT
export HEAIO
export HEAUTILS
export HEASP
export HOOPS
export PIL
export PIL_DIR
export READLINE
export READLINE_DIR
export FITSPERL
export FITSPERL_DIR
export PILPERL
export PILPERL_DIR
export HDUTILSPERL
export HDUTILSPERL_DIR
export HDINITPERL
export HDINITPERL_DIR
export WCSLIB
export WCSLIB_DIR

export HD_LIB_STYLE
export HD_LIB_STYLE_F77
export AR
export ARCHIVE
export ARCHIVE_CXX
export BSUF
export CC
export CFLAGS
export COPT
export CXX
export CXXFLAGS
export CXXOPT
export DEFS
export DPRINTF
export DYNPERL_SUFFIX
export EXT
export WCSFLAV
export FC
export FC_BASENAME
export FFLAGS
export FOPT
export G77
export GCC
export GXX
export HD_LN_SYM
export MAKE
export OSUF
export PERL
export RANLIB
export SIZEOF_LONG
export STRIP
export SYSLIBS
export SHLIB_LD
export SHLIB_LD_CXX
export SHLIB_SUFFIX
export LDFLAGS_C
export LDFLAGS_CXX
export LDFLAGS_F
export PIL_EXTRA_CFLAGS
export FV_BUILD

# Note: do NOT export the following:
# export HD_COMPONENT_NAME
# export HD_COMPONENT_VERS
export HMAKE

export HD_BLD_PFX
export HD_BLD_EXEC_PFX
export HD_BUILD_DIR

export HD_MAKE
export HD_STD_MAKEFILE

# No need to export the following; they are used just to compute other macros:
# export HD_PATH
# export HD_INC_PATH
# export HD_LIB_PATH

export HD_IFLAGS
export HD_LFLAGS
export HD_IFLAGS_LOCAL
export HD_LFLAGS_LOCAL

export HD_STD_LIBS

export HD_STD_CFLAGS
export HD_STD_CLIBS
export HD_STD_FFLAGS
export HD_STD_CXXFLAGS
export HD_STD_CXXLIBS
export HD_STD_CFLAGS_LOCAL
export HD_STD_CLIBS_LOCAL
export HD_STD_CXXFLAGS_LOCAL
export HD_STD_CXXLIBS_LOCAL

export HD_STD_CXXFLAGS
export HD_STD_CXXLIBS

export VPATH
export VPATH_LOCAL
