/*
 * srecord - manipulate eprom load files
 * Copyright (C) 1998, 2002, 2003, 2006, 2007, 2009, 2010, 2013 Peter Miller
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */


/*
 * This file is generated by autoconf.
 * It is architecture specific.
 * If it is not found (not cooked yet) the following
 * symbols will be undefined.
 *
 *      Must be included *after* the search_list is defined.
 */
#include-cooked-nowarn [arch]/etc/Howto.conf
if [not [defined prefix]] then
    prefix = /usr/local;
if [not [defined exec_prefix]] then
    exec_prefix = [prefix];
if [not [defined yacc]] then
    yacc = yacc;
if [not [defined libs]] then
    libs = ;
if [not [defined cxx]] then
    cxx = ['if' [find_command g++] 'then' g++ 'else' c++];


configure: etc/configure.ac install-sh(exists)
{
    function if_quiet Generate;

    if [not [exists install-sh]] then
    {
        /*
         * Cook says it is up-to-date, so it must be in the
         * baseline; autoconf needs it in the current directory.
         */
        cat [resolve install-sh] > install-sh
            set clearstat;
        chmod a+rx install-sh;
    }
    autoconf [resolve etc/configure.ac] > [target];
    chmod 755 [target];
}

/*
 * The install-sh script can come from a huge range of places, depending
 * on what distribution you have installed (or whether you built it from
 * the tarball).
 */
loop install-sh-maybe =
    /usr/share/autoconf/install-sh
    [glob /usr/share/automake*/install-sh]
    /usr/local/share/autoconf/install-sh
    [glob /usr/local/share/automake*/install-sh]
{
    if [exists [install-sh-maybe]] then
    {
        install-sh = [install-sh-maybe];
        loopstop;
    }
}
if [not [install-sh]] then
    fail "Can't locate the \"install-sh\" script from GNU automake";

install-sh: [install-sh]
{
    cat [need] > [target];
    cooktime -m 2-jan-1970 [target];
    chmod 755 [target];
}


[arch]/config.status: configure install-sh(exists)
{
    if [not [exists install-sh]] then
    {
        /*
         * Cook says it is up-to-date, so it must be in the
         * baseline; autoconf needs it in the current directory.
         */
        cat [resolve install-sh]  > install-sh
            set clearstat;
        chmod a+rx install-sh;
    }
    ./[resolve configure] --cache-file\=/dev/null
        ['if' [quiet] 'then' --quiet 'else' --verbose]
        --no-create
        ;
    mv config.status [arch]/config.status;
    if [exists config.log] then
        mv config.log [arch]/config.log;
}

srecord/config.h.in: etc/configure.ac
{
    function if_quiet Generate;

    autoheader [resolve etc/configure.ac] > [target];
}


[arch]/%0%.h: %0%.h.in [arch]/config.status
    single-thread conftest.subs
{
    function if_quiet Generate;
    CONFIG_FILES\= CONFIG_HEADERS\=[target]\:[resolve %0%.h.in]
        [resolve [arch]/config.status]
        ['if' [quiet] 'then' --quiet]
        ;
}

[arch]/%0%: %0%.in [arch]/config.status
    single-thread conftest.subs
{
    function if_quiet Generate;
    CONFIG_FILES\=[target]\:[resolve %0%.in] CONFIG_HEADERS\=
        [resolve [arch]/config.status]
        ['if' [quiet] 'then' --quiet]
        ;
}

/* Sigh */
cascade srecord/vsnprintf.cc = [arch]/srecord/config.h;
cascade etc/srecord.lsm = etc/version.so;


/* vim: set ts=8 sw=4 et : */
