#!/bin/sh

#*********************************************************************#
#                                                                     #
#                              Htmlc                                  #
#                                                                     #
#            Pierre Weis, projet Cristal, INRIA Rocquencourt          #
#                                                                     #
#  Copyright 2001, 2009                                               #
#  Institut National de Recherche en Informatique et en Automatique.  #
#  Distributed under the QPL licence.                                 #
#                                                                     #
#*********************************************************************#

# $Id: unconfigure,v 1.3 2013-04-24 07:40:37 fclement Exp $

SCRIPT=`basename $0`
TRACE=false

#
# PREFIXINSTALLDIR
#

MKFILE=config/Makefile.prefixinstalldir

if test -r $MKFILE; then
    . $MKFILE
else
    # Nothing to unconfigure.
    exit 0
fi

make clean_all

if $PRIVATE_TOOL; then
    HERE="$PWD"
    case "$MIMIC_INSTALL_ROOT_DIR" in
    ( $HERE )
        echo "Error:" \
             "a private tool cannot mimic its installation in itself." >&2
        exit 2
        ;;
    ( */private ) :;;
    ( * )
        echo "Error: no \"/private\" suffix" \
             "in mimic installation root directory" \
             "\"$MIMIC_INSTALL_ROOT_DIR\"." >&2
        exit 2
        ;;
    esac
    LINK_ROOT_DIR="$MIMIC_INSTALL_ROOT_DIR"
    rm -fr "$LINK_ROOT_DIR"
fi

rm -f $MKFILE

exit 0
