1N/A# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. 1N/A# This script builds and installs perl into the same location as when shipped 1N/A# This script should be run from within a perl source directory, 1N/A# and needs to be setuid-root. 1N/A# Global config variables. 1N/A# Globals for File::Find callbacks below. 1N/A# File::Find callback for finding files touched after Start 1N/A# and saving them in Fh. Uses globals $Start and $Fh. 1N/A # Ignore directories and object files. 1N/A return if (-d $f || $f =~ m{\.(?:a|o|so)$}); 1N/A # atime, mtime, ctime. 1N/A my ($a, $m, $c) = (lstat($f))[8, 9, 10]; 1N/A $a = $m if ($m > $a); 1N/A $a = $c if ($c > $a); 1N/A# File::Find callback for finding all .packlist files and saving their 1N/A# contents in $Fh. Uses global $Fh. 1N/A # Ignore everything except .packlist files. 1N/A # Open .packlist, save into $Fh. 1N/A# This is all rather dangerous... 1N/A# Basic environment check. 1N/Adie("Not a perl build directory\n") 1N/Adie("Needs to be run as root or setuid root\n") 1N/A# Prefix for perl installation. 1N/A# Compiler and flags. 1N/A# Clean up, delete any old configuration files. 1N/A# Run Configure with the correct flags to give the required config files, 1N/A# then remove the record of the Configure command-line and extra whitespace. 1N/A# Finally, expand config.sh into the generated files used during the build. 1N/A# Note: due to the fact that '-D' options confuse Configure, ccflags are 1N/Ased -e
"s/^config_args=.*/config_args=''/" \\
1N/A -e
"s/^config_argc=.*/config_argc=0/" \\
1N/A -e
"/^config_arg[1-9][0-9]*=/d" \\
1N/A -e
"s/ threads threads\\/shared//" \\
1N/A# Get the start time of the build. 1N/A# Expand the configure-generated files. 1N/A# Stop here if just configuring. 1N/A# Make and test perl. 1N/A# Install perl (needs to be root!) 1N/A# Find all the .packlist files, cat them together