summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--acinclude.m442
1 files changed, 38 insertions, 4 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index b76bd344a7..c25e59eef0 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -2925,17 +2925,17 @@ dnl providerdesc
dnl header-file
ac_hdrobj=$2
-dnl Add providerdesc.o into global objects when needed
+dnl Add providerdesc.o or .lo into global objects when needed
case $host_alias in
*freebsd*)
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
PHP_LDFLAGS="$PHP_LDFLAGS -lelf"
;;
*solaris*)
- PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
+ PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
;;
*linux*)
- PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
+ PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
;;
esac
@@ -2969,14 +2969,48 @@ dnl in GNU Make which causes the .d file to be overwritten (Bug 61268)
$abs_srcdir/$ac_provsrc:;
$ac_bdir[$]ac_hdrobj: $abs_srcdir/$ac_provsrc
- CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@
+ CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) -e 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@
\$(PHP_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj
+EOF
+
+ case $host_alias in
+ *solaris*|*linux*)
+ dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o"
+ dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs"
+ dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o"
+ dtrace_nolib_objs='$(PHP_DTRACE_OBJS:.lo=.o)'
+ for ac_lo in $PHP_DTRACE_OBJS; do
+ dtrace_lib_objs="[$]dtrace_lib_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`"
+ done;
+dnl Always attempt to create both PIC and non-PIC DTrace objects (Bug 63692)
+ cat>>Makefile.objects<<EOF
+$ac_bdir[$]ac_provsrc.lo: \$(PHP_DTRACE_OBJS)
+ echo "[#] Generated by Makefile for libtool" > \$[]@
+ @test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir
+ if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $abs_srcdir/$ac_provsrc $dtrace_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\]
+ echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\]
+ else [\\]
+ echo "pic_object='none'" >> \$[]@ [;\\]
+ fi
+ if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $abs_srcdir/$ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\]
+ echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\]
+ else [\\]
+ echo "non_pic_object='none'" >> \$[]@ [;\\]
+ fi
+
+EOF
+
+ ;;
+ *)
+cat>>Makefile.objects<<EOF
$ac_bdir[$]ac_provsrc.o: \$(PHP_DTRACE_OBJS)
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o \$[]@ -s $abs_srcdir/$ac_provsrc $dtrace_objs
EOF
+ ;;
+ esac
])
dnl