All pastes #210183 Raw Edit

Untitled

public text v1 · immutable
#210183 ·published 2006-10-19 15:58 UTC
rendered paste body
#!/usr/bin/perl -w
use strict;

my $flag;
my $linker = "/usr/bin/ldd";
my $lib = "./libs/libphp4.so";
my $make = "/usr/bin/make";
my $config = "./configure --prefix=/usr/local/data/php --with-apxs=/usr/local/data/apache/bin/apxs";
my $configString = "--enable-force-cgi-redirect --disable-debug --enable-pic --enable-inline-optimization --with-bz2 --with-curl=/usr/local/data/curl --with-db3 --with-dom=/usr/local/data/libxml --with-freetype-dir=/usr --with-gd --with-gdbm --with-gettext --with-gmp=/usr/local/data/gmp --with-iconv --with-jpeg-dir=/usr --with-mm --with-openssl=/usr/local/data/openssl --with-png --with-regex=system --with-ttf --with-xml --with-expat-dir=/usr --with-zlib --with-layout=GNU --enable-bcmath --enable-debugger --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --without-oci8 --with-kerberos=share,/usr --with-ldap=shared,/usr --with-mysql=shared,/usr --with-pspell=/usr/local/data/pspell";
my $rightSSLlocation = "openssl";
my @flagArr = (split(/ /,$configString));
my $newConfFlag;
my $badBoy;

while (@flagArr){
        if ( system("$linker $lib | grep -q $rightSSLlocation") == 0 ){
                print "________________________________________________\nProblematic flag: ".$badBoy."\n".$newConfFlag."\n";
                exit;
                } else {
                        $newConfFlag = join(" ",@flagArr);
                        print "Configuring with: " . $newConfFlag . "\n";
                        system("$make clean >makelog && $config $newConfFlag >conflog && $make >makelog");
                        $badBoy = @flagArr[-1];
                        print "Removingi: " . @flagArr[-1] . "\n";
                        pop(@flagArr);
                        }
}