diff options
author | Jani Taskinen <jani@php.net> | 2010-11-13 22:22:51 +0000 |
---|---|---|
committer | Jani Taskinen <jani@php.net> | 2010-11-13 22:22:51 +0000 |
commit | 200dcee22d9790944dbb4f83efef51963a3b35bb (patch) | |
tree | 0a4f773e22b02be8b14bca2e7e2c4d15a645d2f1 /acinclude.m4 | |
parent | c95e919e3e815b77adea9e565a84f2d38c5b0242 (diff) | |
download | php-git-200dcee22d9790944dbb4f83efef51963a3b35bb.tar.gz |
- Simplified the DTrace configure macros, one is enough
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 92 |
1 files changed, 44 insertions, 48 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index c7a0a72fa8..6fed91d477 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -711,10 +711,7 @@ ifelse([$2],,,[AC_MSG_CHECKING([$2])]) AC_ARG_WITH($1,[$3],$5=[$]withval, [ $5=ifelse($4,,no,$4) - - if test "$PHP_ENABLE_ALL" && test "$6" = "yes"; then - $5=$PHP_ENABLE_ALL - fi + ifelse($6,yes,[test "$PHP_ENABLE_ALL" && $5=$PHP_ENABLE_ALL]) ]) PHP_ARG_ANALYZE($5,[$2],$6) ]) @@ -739,10 +736,7 @@ ifelse([$2],,,[AC_MSG_CHECKING([$2])]) AC_ARG_ENABLE($1,[$3],$5=[$]enableval, [ $5=ifelse($4,,no,$4) - - if test "$PHP_ENABLE_ALL" && test "$6" = "yes"; then - $5=$PHP_ENABLE_ALL - fi + ifelse($6,yes,[test "$PHP_ENABLE_ALL" && $5=$PHP_ENABLE_ALL]) ]) PHP_ARG_ANALYZE($5,[$2],$6) ]) @@ -2883,43 +2877,33 @@ main() ]) dnl -dnl Generate dtrace targets +dnl PHP_INIT_DTRACE(providerdesc, header-file, sources [, module]) dnl -AC_DEFUN([PHP_GENERATE_DTRACE],[ +AC_DEFUN([PHP_INIT_DTRACE],[ +dnl Set paths properly when called from extension + case "$4" in + ""[)] unset ac_bdir;; + /*[)] ac_bdir=$ac_srcdir;; + *[)] extdir=PHP_EXT_DIR($3); ac_bdir="$extdir/";; + esac + +dnl providerdesc + ac_provsrc=$1 old_IFS=[$]IFS IFS=. - set $ac_src + set $ac_provsrc + ac_provobj=[$]1 IFS=$old_IFS - build_target=$2 - PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS $1.o" - for src in $PHP_DTRACE_OBJS; do - case [$]build_target in - program|static) - obj="$obj `dirname $src`/`basename $src | sed 's,\.lo$,.o,'` " ;; - *) - obj="$obj `dirname $src`/.libs/`basename $src | sed 's,\.lo$,.o,'` " ;; - esac - done - cat >>Makefile.objects<<EOF -$1.o: \$(PHP_DTRACE_OBJS) - dtrace -G -o $abs_builddir/$1.o -s $abs_srcdir/$1 $obj -EOF +dnl header-file + ac_hdrobj=$2 -]) +dnl Add providerdesc.o in global objects + PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o" -dnl -dnl Link given source files with dtrace -dnl PHP_ADD_DTRACE(providerdesc, sources, module) -dnl -AC_DEFUN([PHP_ADD_DTRACE],[ - case "$3" in - ""[)] unset ac_bdir;; - /*[)] ac_bdir=$ac_srcdir;; - *[)] extdir=PHP_EXT_DIR($3); ac_bdir="$extdir/";; - esac +dnl DTrace objects old_IFS=[$]IFS - for ac_src in $2; do + for ac_src in $3; do IFS=. set $ac_src ac_obj=[$]1 @@ -2927,16 +2911,28 @@ AC_DEFUN([PHP_ADD_DTRACE],[ PHP_DTRACE_OBJS="[$]PHP_DTRACE_OBJS [$]ac_bdir[$]ac_obj.lo" done; -]) -dnl -dnl Generate platform specific dtrace header -dnl -AC_DEFUN([PHP_INIT_DTRACE], [ - dtrace -h -C -s $abs_srcdir/$1 -o $abs_builddir/$2 - if test "$?" != "0"; then - AC_MSG_ERROR([cannot create DTrace header file]) - fi - $SED -ibak 's,PHP_,DTRACE_,g' $abs_builddir/$2 -]) + case [$]php_build_target in + program|static) + dtrace_objs='$(PHP_DTRACE_OBJS:.lo=.o)' + ;; + *) + for ac_lo in $PHP_DTRACE_OBJS; do + dtrace_objs="[$]dtrace_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`" + done; + ;; + esac + +dnl Generate Makefile.objects entries + cat>>Makefile.objects<<EOF + +$ac_bdir[$]ac_hdrobj: $abs_srcdir/$ac_provsrc + dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@ && \$(SED) -ibak 's,PHP_,DTRACE_,g' \$[]@ +\$(PHP_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj + +$ac_bdir[$]ac_provsrc.o: \$(PHP_DTRACE_OBJS) + dtrace -G -o \$[]@ -s $abs_srcdir/$ac_provsrc $dtrace_objs + +EOF +]) |