#!/bin/bash

# This script can be used to run Makefile.PL 
# Note that is relies on $0 to tell where lib/ is; typically
#   you should call it as ../../miniperl_top
# This script replaces lib/buildcustomize.pl functionality
# Check write_buildcustomize.pl for the list of modules to include here

top=`dirname "$0"`
if [ -f $top/lib/buildcustomize.pl ]; then
	# buildcustomize.pl silently overrides all -I options below
	echo "Remove $top/lib/buildcustomize.pl before running miniperl_top" >&2
	exit 1
fi
exec $top/miniperl\
	-I$top/cnf/stub\
	-I$top/cnf/cpan\
	-I$top/lib\
	-I$top/cpan/AutoLoader/lib\
	-I$top/dist/Cwd -I$top/dist/Cwd/lib\
	-I$top/dist/ExtUtils-Command/lib\
	-I$top/dist/ExtUtils-Install/lib\
	-I$top/cpan/ExtUtils-MakeMaker/lib\
	-I$top/dist/ExtUtils-Manifest/lib\
	-I$top/cpan/File-Path/lib\
	-I$top/ext/re\
	-I$top/cpan/ExtUtils-Constant/lib\
	-I$top/dist/ExtUtils-ParseXS/lib\
	-I$top/dist/constant/lib\
	-I$top/cpan/Getopt-Long/lib\
	-I$top/cpan/Text-Tabs/lib\
	-I$top/dist/Carp/lib\
	"$@"
