diff options
author | Sascha Schumann <sas@php.net> | 1999-06-20 18:52:46 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 1999-06-20 18:52:46 +0000 |
commit | 43a466a076ccae658c468615f7b05a93188bc897 (patch) | |
tree | 051cb80ce73069834f4aa3d1565ccf017613b4ee /acinclude.m4 | |
parent | 2b97cb1f88f745897e91cc966c7faad3a097b635 (diff) | |
download | php-git-43a466a076ccae658c468615f7b05a93188bc897.tar.gz |
Introduce AC_ADD_* macros
The use of AC_EXPAND_PATH makes it possible to continue
to use relative paths when configuring PHP.
(e.g. --with-apache=../apache-1.3.x works again)
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index e116f9542d..3863030f1a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -2,6 +2,84 @@ dnl $Id$ dnl dnl This file contains local autoconf functions. +dnl +dnl AC_PHP_ONCE(namespace, variable, code) +dnl +dnl execute code, if variable is not set in namespace +dnl +AC_DEFUN(AC_PHP_ONCE,[ + unique=`echo $ac_n "$2$ac_c" | tr -c a-zA-Z0-9 x` + cmd="echo $ac_n \"\$$1$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then + eval "$1$unique=set" + $3 + fi +]) + +dnl +dnl AC_EXPAND_PATH(path, variable) +dnl +dnl expands path to an absolute path and assigns it to variable +dnl +AC_DEFUN(AC_EXPAND_PATH,[ + if echo "$1" | grep -v '^/' >/dev/null ; then + $2="`pwd`/$1" + else + $2="$1" + fi + eval "echo \"made from $1 \$$2\"" +]) + +dnl +dnl AC_ADD_LIBPATH(path) +dnl +dnl add a library to linkpath/runpath +dnl +AC_DEFUN(AC_ADD_LIBPATH,[ + AC_EXPAND_PATH($1, ai_p) + AC_PHP_ONCE(LIBPATH, $ai_p, [ + EXTRA_LIBS="$EXTRA_LIBS -L$ai_p" + if test -n "$APXS" ; then + RPATHS="$RPATHS ${apxs_runpath_switch}$ai_p'" + else + RPATHS="$RPATHS ${ld_runpath_switch}$ai_p" + fi + ]) +]) + +dnl +dnl AC_ADD_INCLUDE(path) +dnl +dnl add a include path +dnl +AC_DEFUN(AC_ADD_INCLUDE,[ + AC_EXPAND_PATH($1, ai_p) + AC_PHP_ONCE(INCLUDEPATH, $ai_p, [ + INCLUDES="$INCLUDES -I$ai_p" + ]) +]) + +dnl +dnl AC_ADD_LIBRARY(library) +dnl +dnl add a library to the link line +dnl +AC_DEFUN(AC_ADD_LIBRARY,[ + AC_PHP_ONCE(LIBRARY, $1, [ + EXTRA_LIBS="$EXTRA_LIBS -l$1" + ]) +]) + +dnl +dnl AC_ADD_LIBRARY_WITH_PATH(library, path) +dnl +dnl add a library to the link line and path to linkpath/runpath +dnl +AC_DEFUN(AC_ADD_LIBRARY_WITH_PATH,[ + AC_ADD_LIBPATH($2) + AC_ADD_LIBRARY($1) +]) + dnl dnl Check for cc option |