Improve the life of external extension maintainers by

not plaguing them with "./" in absolute paths.

Requested by: Andrei, Wez
This commit is contained in:
Sascha Schumann 2002-04-06 13:42:40 +00:00
parent e537d2bd7d
commit 8fae36cbd1
3 changed files with 15 additions and 11 deletions

View File

@ -100,9 +100,11 @@ dnl used directly.
dnl dnl
AC_DEFUN(PHP_ADD_SOURCES_X,[ AC_DEFUN(PHP_ADD_SOURCES_X,[
dnl relative to source- or build-directory? dnl relative to source- or build-directory?
dnl ac_srcdir/ac_bdir include trailing slash
case $1 in case $1 in
/*[)] ac_srcdir=`echo $ac_n "$1$ac_c"|cut -c 2-`; ac_bdir=$ac_srcdir ;; "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
*[)] ac_srcdir="$abs_srcdir/$1"; ac_bdir=$1 ;; /*[)] ac_srcdir=`echo $ac_n "$1$ac_c"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
*[)] ac_srcdir="$abs_srcdir/$1/"; ac_bdir="$1/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
esac esac
dnl how to build .. shared or static? dnl how to build .. shared or static?
@ -118,18 +120,18 @@ dnl remove the suffix
ac_obj=[$]1 ac_obj=[$]1
IFS=$old_IFS IFS=$old_IFS
dnl append to the array which has been dynamically chosen dnl append to the array which has been dynamically chosen at m4 time
$4="[$]$4 [$]ac_bdir/[$]ac_obj.lo" $4="[$]$4 [$]ac_bdir[$]ac_obj.lo"
dnl choose the right compiler/flags/etc. for the source-file dnl choose the right compiler/flags/etc. for the source-file
case $ac_src in case $ac_src in
*.c[)] ac_comp="$b_c_pre $3 -I$abs_srcdir/$ac_bdir -I$abs_builddir/$ac_bdir $b_c_meta -c $ac_srcdir/$ac_src -o $ac_bdir/$ac_obj.$b_lo $6$b_c_post" ;; *.c[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
*.cpp[)] ac_comp="$b_cxx_pre $3 -I$abs_srcdir/$ac_bdir -I$abs_builddir/$ac_bdir $b_cxx_meta -c $ac_srcdir/$ac_src -o $ac_bdir/$ac_obj.$b_lo $6$b_cxx_post" ;; *.cpp[)] ac_comp="$b_cxx_pre $3 $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_cxx_post" ;;
esac esac
dnl create a rule for the object/source combo dnl create a rule for the object/source combo
cat >>Makefile.objects<<EOF cat >>Makefile.objects<<EOF
$ac_bdir/[$]ac_obj.lo: $ac_srcdir/[$]ac_src $ac_bdir[$]ac_obj.lo: $ac_srcdir[$]ac_src
$ac_comp $ac_comp
EOF EOF
done done
@ -1152,7 +1154,7 @@ AC_DEFUN(PHP_NEW_EXTENSION,[
if test "$3" != "shared" && test "$3" != "yes" && test "$4" != "cli"; then if test "$3" != "shared" && test "$3" != "yes" && test "$4" != "cli"; then
dnl ---------------------------------------------- Static module dnl ---------------------------------------------- Static module
PHP_ADD_SOURCES($ext_builddir,$2,$ac_extra,) PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,)
EXT_STATIC="$EXT_STATIC $1" EXT_STATIC="$EXT_STATIC $1"
if test "$3" != "nocli"; then if test "$3" != "nocli"; then
EXT_CLI_LTLIBS="$EXT_CLI_LTLIBS $abs_builddir/$ext_builddir/lib$1.la" EXT_CLI_LTLIBS="$EXT_CLI_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
@ -1161,7 +1163,7 @@ dnl ---------------------------------------------- Static module
else else
if test "$3" = "shared" || test "$3" = "yes"; then if test "$3" = "shared" || test "$3" = "yes"; then
dnl ---------------------------------------------- Shared module dnl ---------------------------------------------- Shared module
PHP_ADD_SOURCES_X($ext_builddir,$2,$ac_extra,shared_objects_$1,yes) PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir) PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir)
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module) AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module)
fi fi
@ -1170,10 +1172,10 @@ dnl ---------------------------------------------- Shared module
if test "$3" != "shared" && test "$3" != "yes" && test "$4" = "cli"; then if test "$3" != "shared" && test "$3" != "yes" && test "$4" = "cli"; then
dnl ---------------------------------------------- CLI static module dnl ---------------------------------------------- CLI static module
if test "$PHP_SAPI" = "cgi"; then if test "$PHP_SAPI" = "cgi"; then
PHP_ADD_SOURCES($ext_builddir,$2,$ac_extra,) PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,)
EXT_STATIC="$EXT_STATIC $1" EXT_STATIC="$EXT_STATIC $1"
else else
PHP_ADD_SOURCES($ext_builddir,$2,$ac_extra,cli) PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,cli)
fi fi
EXT_CLI_LTLIBS="$EXT_CLI_LTLIBS $abs_builddir/$ext_builddir/lib$1.la" EXT_CLI_LTLIBS="$EXT_CLI_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
EXT_CLI_STATIC="$EXT_CLI_STATIC $1" EXT_CLI_STATIC="$EXT_CLI_STATIC $1"

View File

@ -41,6 +41,7 @@ VERSION="4.3.0-dev"
dnl Define where extension directories are located in the configure context dnl Define where extension directories are located in the configure context
AC_DEFUN(PHP_EXT_BUILDDIR,[ext/$1])dnl AC_DEFUN(PHP_EXT_BUILDDIR,[ext/$1])dnl
AC_DEFUN(PHP_EXT_DIR,[ext/$1])dnl
AC_DEFUN(PHP_EXT_SRCDIR,[$abs_srcdir/ext/$1])dnl AC_DEFUN(PHP_EXT_SRCDIR,[$abs_srcdir/ext/$1])dnl
AC_DEFUN(PHP_ALWAYS_SHARED,[])dnl AC_DEFUN(PHP_ALWAYS_SHARED,[])dnl

View File

@ -28,6 +28,7 @@ AC_DEFUN(PHP_WITH_PHP_CONFIG,[
]) ])
dnl dnl
AC_DEFUN(PHP_EXT_BUILDDIR,[.])dnl AC_DEFUN(PHP_EXT_BUILDDIR,[.])dnl
AC_DEFUN(PHP_EXT_DIR,[""])dnl
AC_DEFUN(PHP_EXT_SRCDIR,[$abs_srcdir])dnl AC_DEFUN(PHP_EXT_SRCDIR,[$abs_srcdir])dnl
AC_DEFUN(PHP_ALWAYS_SHARED,[ AC_DEFUN(PHP_ALWAYS_SHARED,[
ext_output="yes, shared" ext_output="yes, shared"