-if test ! -r ./configure; then
- cd ..
- if test ! -r ./configure; then
- echo "Can't find configure!";
- exit 1;
- fi
-fi
-
-exec < ./configure > "lib-src/config.values.in"
-cat <<\EOF
-;;; Do not edit this file!
+
+if (! -r "./configure") {
+ chdir ".." or die "Can't chdir: $!";
+ if (! -r "./configure") {
+ die "Can't find configure!";
+ }
+}
+
+sub FileContents {
+ local $/ = undef; # Slurp mode
+ open (FILE, "< $_[0]") or die "$_[0]: $!";
+ my $contents = <FILE>;
+ close FILE or die "$_[0]: $!";
+ return $contents;
+}
+
+my $configure_contents = FileContents "./configure";
+my $cvi_contents = FileContents "lib-src/config.values.in";
+
+my $new_cvi_contents =
+";;; Do not edit this file!