diff --git a/README.md b/README.md index 48c3e83..edf21c7 100644 --- a/README.md +++ b/README.md @@ -137,8 +137,9 @@ The version of PHP to install from source (a git branch, tag, or commit hash). php_source_clone_dir: "~/php-src" php_source_install_path: "/opt/php" + php_source_install_gmp_path: "/usr/include/x86_64-linux-gnu/gmp.h" -Location where source will be cloned and installed, respectively. +Location where source will be cloned and installed, and the location of the GMP header file (which can be platform/distribution specific). php_source_make_command: "make" diff --git a/defaults/main.yml b/defaults/main.yml index 15049fb..38822e2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -57,6 +57,7 @@ php_install_from_source: false php_source_version: "master" php_source_clone_dir: "~/php-src" php_source_install_path: "/opt/php" +php_source_install_gmp_path: "/usr/include/x86_64-linux-gnu/gmp.h" # For faster compile time: "make --jobs=X" where X is # of cores present. php_source_make_command: "make" php_source_configure_command: > diff --git a/tasks/install-from-source.yml b/tasks/install-from-source.yml index 1719814..25c7d41 100644 --- a/tasks/install-from-source.yml +++ b/tasks/install-from-source.yml @@ -45,9 +45,11 @@ stat: path=/usr/include/gmp.h register: gmp_file + + - name: Ensure gmp.h is symlinked into a location accessible to gcc. file: - src: /usr/include/x86_64-linux-gnu/gmp.h + src: "{{ php_source_install_gmp_path }}" dest: /usr/include/gmp.h state: link when: gmp_file.stat.exists == false