# This file is a shell script fragment that supplies the information
# necessary for a configure script to process the program in
# this directory.  For more information, look at ../configure.

configdirs="stl tests"
srctrigger=complext.ccI
srcname="ANSI C++ library"
package_makefile_frag=Make.pack

# per-host:

# per-target:

echo "# Warning: this fragment is automatically generated" > temp.mt
frags=

# If they didn't specify --enable-shared, don't generate shared libs.
if [ "${enable_shared}" = "yes" ]; then
  case "${target}" in
    hppa*-*-*)		frags=../../libio/config/mt-papic ;;
    i[345]86-*-*)	frags=../../libio/config/mt-x86pic ;;
    *-*-*) 		frags=../../libio/config/mt-${target_cpu}pic ;;
  esac
  case "${target}" in
    *-dec-osf*)		frags="${frags} dec-osf.ml";;
    *-*-hpux*)		frags="${frags} hpux.ml" ;;
    *-*-irix5*)		frags="${frags} irix5.ml" ;;
    *-*-linuxelf*)	frags="${frags} elf.ml" ;;
    *-*-sysv4*)		frags="${frags} elf.ml" ;;
    *-*-solaris*)	frags="${frags} elfshlibm.ml" ;;
    *-*-sunos4*)	frags="${frags} sunos4.ml" ;;
  esac
fi

for frag in ${frags}; do
  frag=${srcdir}/config/$frag
  if [ -f ${frag} ]; then
    echo "Appending ${frag} to target-mkfrag"
    echo "# Following fragment copied from ${frag}" >> temp.mt
    cat ${frag} >> temp.mt
  fi
done

target_makefile_frag=target-mkfrag
${moveifchange} temp.mt target-mkfrag

LIBDIR=yes
TO_TOPDIR=../
ALL='libs'
CXXINCLUDES="-I${srcdir} -I${TO_TOPDIR}libio -I${srcdir}/${TO_TOPDIR}libio"
MOSTLYCLEAN='*.o core $(MOSTLYCLEAN_JUNK)'
CLEAN='$(CLEAN_JUNK)'

(. ${srcdir}/${TO_TOPDIR}libio/config.shared) >${package_makefile_frag}

# post-target:

# If cross-compiling, we install in $(tooldir).
if [ ${host} != ${target} ] ; then
    rm -f Makefile.tem
    sed \
        -e 's|INSTALLDIR.*=.*$|INSTALLDIR = $(tooldir)/lib|' \
        Makefile >Makefile.tem
    mv -f Makefile.tem Makefile
fi
