//
// aegis - project change supervisor
// Copyright (C) 2012 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 .
//
#include
#include
#include
#include
process_item_autoconf::~process_item_autoconf()
{
}
process_item_autoconf::process_item_autoconf(target &a_tgt) :
process_item(a_tgt, &target::process_item_autoconf)
{
}
process_item_autoconf::pointer
process_item_autoconf::create(target &a_tgt)
{
return pointer(new process_item_autoconf(a_tgt));
}
bool
process_item_autoconf::condition(const nstring &filename)
{
nstring base = filename.basename();
// pathological case
if (base == ".in")
return false;
// this is an exception
if (base == "configure.ac.in")
return false;
// the old name for the "configure.ac" file
if (base == "configure.in")
return false;
return base.ends_with(".in");
}
void
process_item_autoconf::preprocess(const nstring &fn)
{
assert(condition(fn));
data.remember_source_file(fn);
nstring fn2 = fn.trim_extension();
data.remember_dist_clean_file(fn2);
data.remember_built_sources(fn2);
data.remember_extra_dist(fn);
// now preprocess the result of the rule.
// it could be just about anything.
tgt_preprocess(fn2);
}
// vim: set ts=8 sw=4 et :