-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/windows build #2
Open
eisberg
wants to merge
13
commits into
libgeos:master
Choose a base branch
from
ModelTech:feature/windows-build
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
31335cf
Fix variable type
faytekin 297aa28
Fix test for 7.4 (int vs integer)
faytekin eb1cabc
Fix error message with php 7+
faytekin 21c3f97
Update README.md
faytekin 26b70fe
Update README.md
faytekin 4000429
Add build config for Windows
eisberg c704c6b
Fix error compile RC.
eisberg f8749f4
Update windows compile instruction
eisberg 2371e35
Update windows build config
eisberg 559ea14
php8 compatibility : TSRMLS* & arginfo_void
e90d102
ste PHP_GEOS_VERSION
bba201f
add AC_DEFINE for vars HAVE_GEOS* on Windows build
e4f9578
define GEOS_PREC_NO_TOPO & GEOS_PREC_KEEP_COLLAPSED to 1 for win build
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
geos | ||
Sandro Santilli <[email protected]> - GEOS | ||
J Smith <[email protected]> <[email protected]> - PHP packaging | ||
Sandro Santilli [email protected] - GEOS | ||
J Smith [email protected] [email protected] - PHP packaging | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,102 @@ | ||
PHP module for GEOS | ||
=================== | ||
# PHP module for GEOS | ||
|
||
[![build status] | ||
(https://drone.osgeo.org/api/badges/geos/php-geos/status.svg?branch=master)] | ||
(https://drone.osgeo.org/geos/php-geos?branch=master) | ||
[![build status](https://dronie.osgeo.org/api/badges/geos/php-geos/status.svg?branch=master)](https://github.com/libgeos/php-geos/tree/master) | ||
|
||
The code in this directory provides a PHP module to make use | ||
of functionalities of the [GEOS library] (http://geos.osgeo.org). | ||
of functionalities of the [GEOS library](http://geos.osgeo.org). | ||
|
||
The bindings are linked to the C-API, for betters stability. | ||
|
||
# Building | ||
## Building (UNIX) | ||
|
||
## Requirements | ||
### Requirements | ||
|
||
You need: | ||
|
||
- PHP development files | ||
( often found in packages named something like 'php5-dev' ) | ||
- PHP development files | ||
( often found in packages named something like 'php5-dev' ) | ||
|
||
- GEOS development files | ||
( often found in packages named something like 'libgeos-dev' ) | ||
- GEOS development files | ||
( often found in packages named something like 'libgeos-dev' ) | ||
|
||
## Procedure | ||
### Procedure | ||
|
||
git clone https://git.osgeo.org/gitea/geos/php-geos.git | ||
git clone https://github.com/libgeos/php-geos.git | ||
eisberg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cd php-geos | ||
./autogen.sh | ||
./configure | ||
make # generates modules/geos.so | ||
|
||
# Testing | ||
## Building (Windows) | ||
|
||
### Requirements | ||
|
||
- PHP source files: download [zip](http://windows.php.net/download/) or clone from [github](https://github.com/php/php-src) | ||
- PHP SDK ( https://github.com/Microsoft/php-sdk-binary-tools ) | ||
- Visual C++: | ||
* Visual C++ 14.0 (Visual Studio 2015) for PHP 7.0 or PHP 7.1. | ||
* Visual C++ 15.0 (Visual Studio 2017) for PHP 7.2, PHP 7.3 or PHP 7.4. | ||
* Visual C++ 16.0 (Visual Studio 2019) for master. | ||
- GEOS Windows binaries (binary dll, includes and lib): | ||
* As part of [OSGeo4W](http://osgeo4w.osgeo.org/) as part of the geos package. | ||
* As part of [MS4W](https://ms4w.com/) | ||
|
||
### Configure | ||
|
||
Official instructions for compiling PHP extensions: https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2 | ||
|
||
1. Install OSGeo4w in `C:\OSGeo4W64` and PHP-SDK in `C:/php-sdk.` | ||
2. Invoke the starter script, for example for Visual Studio 2015 64-bit build, invoke phpsdk-vc15-x64.bat | ||
3. Run the phpsdk_buildtree batch script which will create the desired directory structure: | ||
|
||
phpsdk_buildtree phpdev | ||
|
||
The phpsdk_buildtree script will create the path according to the currently VC++ version used and switch into the newly created directory | ||
4. Extract the PHP source code to `C:\php-sdk\phpdev\vX##\x##`, where: | ||
|
||
vX## is the compiler version you are using (eq vc15 or vs16) | ||
x## is your architecture (x86 or x64) | ||
For example: `C:\php-sdk\phpdev\vc15\x64\php-7.4.11-src` | ||
In the same directory where you extracted the PHP source there is a deps directory. | ||
For example: `C:\php-sdk\phpdev\vc15\x64\deps` | ||
|
||
5. Copy GEOS binaries from `C:\OSGeo4W64` (`bin`, `include` and `lib` subdir) to `C:\php-sdk\phpdev\vc15\x64\deps\` | ||
6. Copy (clone) code from this repository to `C:\php-sdk\phpdev\vc15\x64\php-7.4.11-src\ext\geos` | ||
|
||
|
||
### Compile | ||
|
||
Run next commands to compile ([see official php instruction](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2)): | ||
|
||
c:\php-sdk\phpsdk-vc15-x64.bat | ||
cd C:\php-sdk\phpdev\vc15\x64\php-7.4.11-src | ||
buildconf | ||
configure --disable-all --enable-cli --with-geos | ||
nmake | ||
|
||
|
||
|
||
## Testing | ||
|
||
Automated testing is executed on 'make check'. | ||
|
||
You'll need phpunit installed for this to work. To install: | ||
|
||
pear install --force --alldeps phpunit/phpunit | ||
|
||
# Installing | ||
## Installing | ||
|
||
### Unix | ||
|
||
As root (or owner with write access to the directory | ||
returned by php-config --extension-dir), run: | ||
|
||
make install | ||
|
||
# Using | ||
### Window | ||
Copy php_geos.dll to extension directory and enable it in php.ini | ||
|
||
## Using | ||
|
||
... TODO ... | ||
(reference some automatically built doc?) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// vim:ft=javascript | ||
|
||
ARG_WITH("geos", "geos support", "yes"); | ||
|
||
if (PHP_GEOS != "no") { | ||
if (CHECK_LIB("geos_c.lib", "geos", PHP_GEOS) && | ||
CHECK_HEADER_ADD_INCLUDE("geos_c.h", "CFLAGS_GEOS", PHP_GEOS)) { | ||
|
||
EXTENSION("geos", "geos.c", 1); | ||
geos_c = "geos_c.lib"; | ||
|
||
CHECK_LIB(geos_c, "initGEOS_r", PHP_GEOS) && !PHP_GEOS && WARNING("Unable to build the GEOS: a newer libgeos is required"); | ||
|
||
|
||
} else { | ||
WARNING("geos support can't be enabled, libraries or headers are missing") | ||
PHP_GEOS = "no"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this format change ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of < > The RC resource compiler crashes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds like an upstream bug. The current one does not crash, right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes the current version compiles without errors