summaryrefslogtreecommitdiffstats
path: root/295.patch
blob: fbaae6b67de7c11e263a711f42c846fd44c762b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From e77fc1d145337b92d4ad940bdb212554e97eba62 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 30 Jun 2025 11:25:34 +0200
Subject: [PATCH] Fix #294 add --with-spx-assets-dir configure options

---
 Makefile.frag | 9 +++------
 config.m4     | 7 +++++++
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/Makefile.frag b/Makefile.frag
index 9f3ae0b..c899753 100644
--- a/Makefile.frag
+++ b/Makefile.frag
@@ -1,11 +1,8 @@
 
-spx_ui_assets_dir = $(INSTALL_ROOT)$(prefix)/share/misc/php-spx/assets/web-ui
-
-CFLAGS += -DSPX_HTTP_UI_ASSETS_DIR=\"$(spx_ui_assets_dir)\"
 
 install-spx-ui-assets:
-	@echo "Installing SPX web UI to: $(spx_ui_assets_dir)"
-	@mkdir -p $(spx_ui_assets_dir)
-	@cp -r assets/web-ui/* $(spx_ui_assets_dir)
+	@echo "Installing SPX web UI to: $(INSTALL_ROOT)$(PHP_SPX_ASSETS_DIR)/web-ui"
+	@mkdir -p $(INSTALL_ROOT)$(PHP_SPX_ASSETS_DIR)/web-ui
+	@cp -r assets/web-ui/* $(INSTALL_ROOT)$(PHP_SPX_ASSETS_DIR)/web-ui
 
 install: $(all_targets) $(install_targets) install-spx-ui-assets
diff --git a/config.m4 b/config.m4
index e6fc9a1..2e8d7bd 100644
--- a/config.m4
+++ b/config.m4
@@ -9,8 +9,15 @@ PHP_ARG_WITH(zlib-dir, for ZLIB,
 [  --with-zlib-dir[=DIR]   Set the path to ZLIB install prefix.], no)
 fi
 
+PHP_ARG_WITH(spx-assets-dir, for assets path,
+[  --with-spx-assets-dir[=DIR]   Set the installation path of assets.], $prefix/share/misc/php-spx/assets)
+
 if test "$PHP_SPX" = "yes"; then
     AC_DEFINE(HAVE_SPX, 1, [spx])
+    AC_MSG_CHECKING([for assets directory])
+    AC_MSG_RESULT([ $PHP_SPX_ASSETS_DIR ])
+    AC_DEFINE_UNQUOTED([SPX_HTTP_UI_ASSETS_DIR], [ "$PHP_SPX_ASSETS_DIR/web-ui" ], [path of web-ui assets directory])
+    PHP_SUBST([PHP_SPX_ASSETS_DIR])
 
     CFLAGS="-Werror -Wall -O3 -pthread -std=gnu90"