Skip to content

Commit 1c9e8e8

Browse files
committed
Remove PTHREADS_ASSIGN_VARS
This simplifies TSRM build steps a bit and avoids doing unnecessary steps: - The `PTHREADS_CHECK_COMPILE` can called inside the for loops only since this is only where the `$pthreads_checked` variable is used. - Assigning variables can be then done only in the configure.ac once. - use `m4_include()` instead of the `sinclude()` in the middle of the build steps. - The `$threads_result` variable is not used in the code or in extensions.
1 parent 30441e6 commit 1c9e8e8

File tree

2 files changed

+11
-32
lines changed

2 files changed

+11
-32
lines changed

TSRM/threads.m4

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,6 @@ dnl -qthreaded AIX cc V5
102102
dnl -threads gcc (HP-UX)
103103
dnl
104104
AC_DEFUN([PTHREADS_CHECK],[
105-
save_CFLAGS=$CFLAGS
106-
save_LIBS=$LIBS
107-
PTHREADS_ASSIGN_VARS
108-
PTHREADS_CHECK_COMPILE
109-
LIBS=$save_LIBS
110-
CFLAGS=$save_CFLAGS
111-
112105
AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
113106
ac_cv_pthreads_cflags=
114107
if test "$pthreads_working" != "yes"; then
@@ -144,25 +137,4 @@ fi
144137
if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
145138
pthreads_working="yes"
146139
fi
147-
148-
if test "$pthreads_working" = "yes"; then
149-
threads_result="POSIX-Threads found"
150-
else
151-
threads_result="POSIX-Threads not found"
152-
fi
153-
])
154-
155-
dnl
156-
dnl PTHREADS_ASSIGN_VARS
157-
dnl
158-
dnl Adds pthreads linker and compiler flags.
159-
dnl
160-
AC_DEFUN([PTHREADS_ASSIGN_VARS],[
161-
if test -n "$ac_cv_pthreads_lib"; then
162-
LIBS="$LIBS -l$ac_cv_pthreads_lib"
163-
fi
164-
165-
if test -n "$ac_cv_pthreads_cflags"; then
166-
CFLAGS="$CFLAGS $ac_cv_pthreads_cflags"
167-
fi
168140
])

configure.ac

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ m4_include([build/libtool.m4])
1010
m4_include([build/php_cxx_compile_stdcxx.m4])
1111
m4_include([build/php.m4])
1212
m4_include([build/pkg.m4])
13+
m4_include([TSRM/threads.m4])
14+
m4_include([TSRM/tsrm.m4])
1315

1416
dnl Basic autoconf initialization, generation of config.nice.
1517
dnl ----------------------------------------------------------------------------
@@ -309,12 +311,10 @@ case $host_alias in
309311
;;
310312
esac
311313

312-
dnl Include Zend and TSRM configurations.
314+
dnl Include Zend configurations.
313315
dnl ----------------------------------------------------------------------------
314316

315317
sinclude(Zend/Zend.m4)
316-
sinclude(TSRM/threads.m4)
317-
sinclude(TSRM/tsrm.m4)
318318

319319
dnl ----------------------------------------------------------------------------
320320

@@ -355,7 +355,14 @@ fi
355355

356356
dnl Force ZTS.
357357
if test "$enable_maintainer_zts" = "yes"; then
358-
PTHREADS_ASSIGN_VARS
358+
dnl Add pthreads linker and compiler flags.
359+
if test -n "$ac_cv_pthreads_lib"; then
360+
LIBS="$LIBS -l$ac_cv_pthreads_lib"
361+
fi
362+
if test -n "$ac_cv_pthreads_cflags"; then
363+
CFLAGS="$CFLAGS $ac_cv_pthreads_cflags"
364+
fi
365+
359366
PTHREADS_FLAGS
360367
fi
361368

0 commit comments

Comments
 (0)