#!/bin/sh # # Copyright by The HDF Group. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in # the COPYING file, which can be found at the root of the source code # distribution tree, or in https://www.hdfgroup.org/licenses. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # # Switch AM_MAINTAINER_MODE value in configure.ac # Usage: See USAGE() USAGE() { cat < EOF } MODE="notset" CONFIG_AC_PATH= # Display help/usage if any options were passed in while [ $# -gt 0 ]; do case "$1" in -enable) MODE="enable" ;; -disable) MODE="disable" ;; -help) USAGE exit 0 ;; *) CONFIG_AC_PATH="$1" ;; esac shift done # Did we get a file path? if test -z $CONFIG_AC_PATH ; then USAGE exit 1 fi # Did we get a mode? if test -z $MODE ; then USAGE exit 1 fi # Run perl over configure.ac if test "X-$MODE" = "X-enable" ; then perl -pi -e 's/^(AM_MAINTAINER_MODE\(\[)([a-z]+)(\]\))/$1enable$3/g' $CONFIG_AC_PATH fi if test "X-$MODE" = "X-disable" ; then perl -pi -e 's/^(AM_MAINTAINER_MODE\(\[)([a-z]+)(\]\))/$1disable$3/g' $CONFIG_AC_PATH fi