#-------------------------------------------------------------------------------
# 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.
AHFITS="@AHFITS@"
AHGEN="@AHGEN@"
AHLOG="@AHLOG@"
AST="@AST@"
AST_DIR="@AST_DIR@"
AST_VERS="@AST_VERS@"
AST_LIBS="@AST_LIBS@"
CFITSIO="@CFITSIO@"
CFITSIO_VERS="@CFITSIO_VERS@"
CFITSIO_DIR="@CFITSIO_DIR@"
CCFITS="@CCFITS@"
CCFITS_DIR="@CCFITS_DIR@"
HEAAPP="@HEAAPP@"
HEAINIT="@HEAINIT@"
HEAIO="@HEAIO@"
HEAUTILS="@HEAUTILS@"
HEASP="@HEASP@"
HOOPS="@HOOPS@"
PIL="@PIL@"
PIL_DIR="@PIL_DIR@"
READLINE="@READLINE@"
READLINE_DIR="@READLINE_DIR@"
ST_STREAM="@ST_STREAM@"
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@"
LYNX_DIR="@LYNX_DIR@"

#-------------------------------------------------------------------------------
# Build-related macros.
#-------------------------------------------------------------------------------
AR="@AR@"
ARCHIVE="@ARCHIVE@"
ARCHIVE_CXX="@ARCHIVE_CXX@"
AST_CFLAGS="@AST_CFLAGS@"
AST_LDFLAGS="@AST_LDFLAGS@"
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@"
FC="@FC@"
FC_BASENAME="@FC_BASENAME@"
FFLAGS="@FFLAGS@"
FOPT="@FOPT@"
FV_BUILD="@fv_build@"
G77="@G77@"
GCC="@GCC@"
GXX="@GXX@"
HD_BUILD_ARCH_32_BIT="@HD_BUILD_ARCH_32_BIT@"
HD_LIB_STYLE="@HD_LIB_STYLE@"
HD_LIB_STYLE_F77="@HD_LIB_STYLE_F77@"
HD_LN_SYM="@HD_LN_SYM@"
LDFLAGS_C="@LDFLAGS_C@"
LDFLAGS_C_EXT="@LDFLAGS_C_EXT@"
LDFLAGS_C_BIN="@LDFLAGS_C_BIN@"
LDFLAGS_CXX="@LDFLAGS_CXX@"
LDFLAGS_CXX_BIN="@LDFLAGS_CXX_BIN@"
LDFLAGS_CXX_PY="@LDFLAGS_CXX_PY@"
LDFLAGS_F="@LDFLAGS_F@"
LDFLAGS_F_BIN="@LDFLAGS_F_BIN@"
MAKE="@MAKE@"
OSUF="@OSUF@"
PERL="@PERL@"
PERL_OTHERLDFLAGS="@PERL_OTHERLDFLAGS@"
PIL_EXTRA_CFLAGS="@PIL_EXTRA_CFLAGS@"
PYTHON_INC="@PYTHON_INC@"
PYTHON_LIB="@PYTHON_LIB@"
PY_SHLIB_SUFFIX="@PY_SHLIB_SUFFIX@"
RANLIB="@RANLIB@"
SHLIB_LD="@SHLIB_LD@"
SHLIB_LD_CXX="@SHLIB_LD_CXX@"
SHLIB_SUFFIX="@SHLIB_SUFFIX@"
SIZEOF_LONG="@SIZEOF_LONG@"
STRIP="@STRIP@"
SYSLIBS="@LIBS@"
WCSFLAV="@WCSFLAV@"

#-------------------------------------------------------------------------------
# Macros which are hard-wired.
#-------------------------------------------------------------------------------
AHT="aht"
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 AHFITS
export AHGEN
export AHLOG
export AST
export AST_DIR
export AST_VERS
export CFITSIO
export CFITSIO_VERS
export CFITSIO_DIR
export CCFITS
export CCFITS_DIR
export HEAAPP
export HEAINIT
export HEAIO
export HEAUTILS
export HEASP
export HOOPS
export PIL
export PIL_DIR
export READLINE
export READLINE_DIR
export ST_STREAM
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 LYNX_DIR

export AR
export ARCHIVE
export ARCHIVE_CXX
export AST_CFLAGS
export AST_LDFLAGS
export BSUF
export CC
export CFLAGS
export COPT
export CXX
export CXXFLAGS
export CXXOPT
export DEFS
export DPRINTF
export DYNPERL_SUFFIX
export EXT
export FC
export FC_BASENAME
export FFLAGS
export FOPT
export FV_BUILD
export G77
export GCC
export GXX
export HD_LIB_STYLE
export HD_LIB_STYLE_F77
export HD_LN_SYM
export LDFLAGS_C
export LDFLAGS_C_EXT
export LDFLAGS_C_BIN
export LDFLAGS_CXX
export LDFLAGS_CXX_BIN
export LDFLAGS_CXX_PY
export LDFLAGS_F
export LDFLAGS_F_BIN
export MAKE
export OSUF
export PERL
export PERL_OTHERLDFLAGS
export PIL_EXTRA_CFLAGS
export PYTHON_INC
export PYTHON_LIB
export PY_SHLIB_SUFFIX
export RANLIB
export SHLIB_LD
export SHLIB_LD_CXX
export SHLIB_SUFFIX
export SIZEOF_LONG
export STRIP
export SYSLIBS
export WCSFLAV

export AHT
# 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
