PhpBrew\Patches\IntlWith64bitPatch::match PHP Method

match() public method

This is due to intl/msgformat/msgformat_helpers.cpp being a C++ file and GCC not handling that case cleanly. The exact error is specifically due to GCC not linking to libstdc++. Which is, actually, kinda reasonable since it's been invoked as a plain C compiler. Anyway, you can get around the problem for now by adding "/usr/lib/gcc/i686-apple-darwin9/4.2.1/libstdc++.dylib" (if you're building with gcc-4.2) or "/usr/lib/gcc/i686-apple-darwin9/4.0.1/libstdc++.dylib" (if you're building with gcc-4.0, the default) to your LDFLAGS. That's right, WITHOUT -l or -L. I wouldn't consider this a real solution, but a better solution is pending further research into the subject. This fixes the build error: -------------- Undefined symbols: "___gxx_personality_v0", referenced from: EH_frame1 in msgformat_helpers.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 https://bugs.php.net/bug.php?id=48795 https://blog.gcos.me/2012-10-19_how-to-compile-php53-on-64bit-linux-macos.html Related Platform: - Ubuntu 11.04 http://www.serverphorums.com/read.php?7,369479 - Ubuntu 14.04 https://github.com/phpbrew/phpbrew/issues/707 - Ubuntu 12.04 - CentOS 7 x86_64 - OS X 10.5 - OS X 10.6
public match ( PhpBrew\Buildable $build, CLIFramework\Logger $logger )
$build PhpBrew\Buildable
$logger CLIFramework\Logger
    public function match(Buildable $build, Logger $logger)
    {
        return $build->isEnabledVariant('intl') && version_compare($build->getVersion(), '5.4', '<=');
    }

Usage Example

 public function testPatch()
 {
     $logger = new Logger();
     $logger->setQuiet();
     $fromVersion = '5.3.29';
     $sourceFixtureDirectory = getenv('PHPBREW_FIXTURES_PHP_DIR') . DIRECTORY_SEPARATOR . $fromVersion;
     $sourceDirectory = getenv('PHPBREW_BUILD_PHP_DIR');
     if (!is_dir($sourceDirectory)) {
         return $this->markTestSkipped("{$sourceDirectory} does not exist.");
     }
     // Copy the source Makefile to the Makefile
     // copy($sourceFixtureDirectory . '/Makefile', $sourceDirectory . '/Makefile');
     $this->setupBuildDirectory($fromVersion);
     $build = new Build($fromVersion);
     $build->setSourceDirectory($sourceDirectory);
     $build->enableVariant('intl');
     $this->assertTrue($build->hasVariant('intl'), 'intl enabled');
     $patch = new IntlWith64bitPatch();
     $matched = $patch->match($build, $logger);
     $this->assertTrue($matched, 'patch matched');
     $patchedCount = $patch->apply($build, $logger);
     $this->assertEquals(3, $patchedCount);
     $sourceExpectedDirectory = getenv('PHPBREW_EXPECTED_PHP_DIR') . DIRECTORY_SEPARATOR . $fromVersion;
     $this->assertFileEquals($sourceExpectedDirectory . '/Makefile', $sourceDirectory . '/Makefile');
 }
IntlWith64bitPatch