Skip to content

Commit ec9cc32

Browse files
committed
PHPC-757: Set compiler name and user CFLAGS/LDFLAGS earlier
libmongoc sets the CFLAG and LDFLAG constants before their own configuration files modify them.
1 parent 200257a commit ec9cc32

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

config.m4

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ PHP_ARG_WITH(openssl-dir, OpenSSL dir for mongodb,
66
PHP_ARG_WITH(system-ciphers, whether to use system default cipher list instead of hardcoded value,
77
[ --with-system-ciphers OPENSSL: Use system default cipher list instead of hardcoded value], no, no)
88

9+
dnl borrowed from libmongoc configure.ac
10+
# AS_VAR_COPY is available in AC 2.64 and on, but we only require 2.60.
11+
# If we're on an older version, we define it ourselves:
12+
m4_ifndef([AS_VAR_COPY],
13+
[m4_define([AS_VAR_COPY],
14+
[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])])
15+
16+
# Get "user-set cflags" here, before we've added the flags we use by default
17+
AS_VAR_COPY(MONGOC_USER_SET_CFLAGS, [CFLAGS])
18+
AC_SUBST(MONGOC_USER_SET_CFLAGS)
19+
20+
AS_VAR_COPY(MONGOC_USER_SET_LDFLAGS, [LDFLAGS])
21+
AC_SUBST(MONGOC_USER_SET_LDFLAGS)
22+
23+
AS_VAR_COPY(MONGOC_CC, [CC])
24+
AC_SUBST(MONGOC_CC)
25+
926
dnl borrowed from PHP acinclude.m4
1027
AC_DEFUN([PHP_BSON_BIGENDIAN],
1128
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
@@ -620,9 +637,6 @@ Please submit bugreports at:
620637
https://jira.mongodb.org/browse/PHPC
621638
622639
"])
623-
624-
AC_SUBST(MONGOC_USER_SET_CFLAGS, "'$CFLAGS'")
625-
AC_SUBST(MONGOC_USER_SET_LDFLAGS, "'$LDFLAGS'")
626640
fi
627641

628642
dnl: vim: et sw=2

0 commit comments

Comments
 (0)