Skip to content

Commit

Permalink
Fixed for building on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
ifsnow committed Jan 7, 2016
1 parent 42ea223 commit b18140f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
2 changes: 2 additions & 0 deletions build/_resource/Phalcon/Build/Generator/File/ConfigW32.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public function generate()

$generatedContent = preg_replace('/(\s*ADD_SOURCES\(.*?\n){1,}/', "\n", $originalContent);

$generatedContent = str_replace('EXTENSION("phalcon", "phalcon.c"', 'EXTENSION("phalcon", "phalcon.zep.c"', $generatedContent);

file_put_contents($this->outputFile, $generatedContent);
}
}
26 changes: 11 additions & 15 deletions build/_resource/Phalcon/Build/Generator/Safe.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,11 @@ class Generator_Safe
protected $phalconC;

/**
* Generator for config.m4
* Generator for config.m4 or config.w32
*
* @var Generator_File_ConfigM4
* @var Generator_File_ConfigM4|Generator_File_ConfigW32
*/
protected $configM4;

/**
* Generator for config.w32
*
* @var Generator_File_ConfigW32
*/
protected $configW32;
protected $config;

/**
* Generator for Makefile.frag
Expand All @@ -68,8 +61,12 @@ public function __construct($rootDir, $outputDir)

$this->phalconH = new Generator_File_PhalconH($this->sourceDir, $outputDir);
$this->phalconC = new Generator_File_PhalconC($rootDir, $this->sourceDir, $configDir, $outputDir);
$this->configM4 = new Generator_File_ConfigM4($this->sourceDir, $outputDir);
//$this->configW32 = new Generator_File_ConfigW32($this->sourceDir, $outputDir);

if (preg_match('/^WIN/', PHP_OS)) {
$this->config = new Generator_File_ConfigW32($this->sourceDir, $outputDir);
} else {
$this->config = new Generator_File_ConfigM4($this->sourceDir, $outputDir);
}
}

/**
Expand All @@ -93,8 +90,7 @@ protected function generateFiles()
$includedHeaderFiles = $this->phalconH->generate();
$this->phalconC->generate($includedHeaderFiles);

$this->configM4->generate();
//$this->configW32->generate();
$this->config->generate();

copy($this->sourceDir . '/php_phalcon.h', $this->outputDir . '/php_phalcon.h');
$this->processKernelGlobals();
Expand All @@ -108,7 +104,7 @@ protected function processKernelGlobals()
$lines = array();
foreach (file($this->outputDir . '/php_phalcon.h') as $line) {
if (preg_match('@^#include "(kernel/.+)"@', $line, $matches)) {
$content = file_get_contents('ext/' . $matches[1]);
$content = file_get_contents($this->sourceDir . '/' . $matches[1]);
$lines[] = $content . PHP_EOL;
} else {
$lines[] = $line;
Expand Down

0 comments on commit b18140f

Please sign in to comment.