#!/bin/sh

# 
# Sample script to accept licenses for the IBM vacpp and xlf compilers
# For AIX:
#    do nothing, license accepted with installp -Y flag
# For Linux:
#    Assumes all compiler software has been installed


OS=`uname`
if [ $OS != "AIX" ]; then
    cd $installroot/
    vacpp_script=`find opt/ibmcmp/vacpp -name new_install -print`
    xlf_script=`find opt/ibmcmp/xlf -name new_install -print`

    if [ $NODESETSTATE == "install" ] || [ $NODESETSTATE == "boot" ]; then
    #  Being run from a stateful install postscript
       if [ -n "$vacpp_script" ] ; then
           echo 1 | $vacpp_script
       fi
       if [ -n "$xlf_script" ] ; then
           echo 1 | $xlf_script
       fi
    fi

    if [ $NODESETSTATE == "genimage" ]; then
    # Being called from <image>.postinstall script
    # Assume we are on the same machine
       if [ -n "$vacpp_script" ] ; then
           echo 1 | chroot $installroot /$vacpp_script
       fi
       if [ -n "$xlf_script" ] ; then
           echo 1 | chroot $installroot /$xlf_script
       fi
    fi
fi  


