summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorChristopher Jones <sixd@php.net>2013-08-16 10:40:50 -0700
committerChristopher Jones <sixd@php.net>2013-08-16 10:40:50 -0700
commit0ebef462ceb50094e64a8d48bf705594175f86ab (patch)
tree1ef3b1a0db8c1797c6aabc7ec638abec40696a59 /acinclude.m4
parentba30c78d5ca1edfa593c32bfa203cf6ea7f942b2 (diff)
downloadphp-git-0ebef462ceb50094e64a8d48bf705594175f86ab.tar.gz
With --enable-dtrace, the correct PIC/non-PIC .o files on Solaris and
Linux are now used. DTrace is part of Oracle Linux. See https://oss.oracle.com/projects/DTrace/ This patch does not change DTrace linking for non-Solaris/Linux platforms. For SystemTap users on Linux, this patch removes the compilation warning: Warning: Linking the shared library libphp5.la against the non-libtool objects Zend/zend_dtrace.d.o is not portable!
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m442
1 files changed, 38 insertions, 4 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index f7da55ce58..448659f920 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,12 +2969,46 @@ 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
])