#!/usr/bin/perl -w
######################################################################
#
# $Id: config,v 1.5 2012/01/07 07:56:13 mavrik Exp $
#
######################################################################
#
# Copyright 2007-2012 The WebJob Project, All Rights Reserved.
#
######################################################################
#
# Purpose: Create a generic Makefile.PL from Makefile.PL.in. This
#          script is typically used when building the library apart
#          from the standard WebJob configure/build process.
#
######################################################################

use 5.008;
use strict;

my $sFile = "Makefile.PL";
open(IFH, "< $sFile.in") or die "Can't open $sFile.in ($!).\n";
open(OFH, "> $sFile") or die "Can't open $sFile ($!).\n";
while (my $sLine = <IFH>)
{
  if ($sLine =~ /CONFIGURE-BEGIN/)
  {
    do { $sLine = <IFH>; } until ($sLine =~ /CONFIGURE-END/);
    next;
  }
  print OFH $sLine;
}
close(IFH);
close(OFH);
