YACC = @YACC@
MAINT = @MAINT@
APXS = @APXS@
-APXS_LDFLAGS = @RPATHS@ $(EXTRA_LIBS) $(LIBS)
+APXS_LDFLAGS = $(EXTRA_LIBS) $(LIBS)
WARNING_LEVEL = @WARNING_LEVEL@
SOURCE = main.c internal_functions.c snprintf.c php3_sprintf.c \
# Apache 1.3 shared module
libphp4.so: $(srcdir)/mod_php4.c libmodphp4-so.a @REGEX_LIB@
-@test -f mod_php4.c || test -L mod_php4.c || $(LN_S) $(srcdir)/mod_php4.c mod_php4.c
- $(APXS) $(INCLUDE) -c -o libphp4.so mod_php4.c libmodphp4-so.a $(APXS_LDFLAGS)
+ $(APXS) $(INCLUDE) -c -o libphp4.so @RPATHS@ mod_php4.c libmodphp4-so.a $(APXS_LDFLAGS)
regex/libregex.a:
(cd regex; $(MAKE) lib)
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
+ if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then
$2="$1"
+ else
+ $2="`pwd`/$1"
fi
])
AC_ARG_WITH(system-regex,
[ --with-system-regex Do not use the bundled regex library],
[
- REGEX_LIB=
- HSREGEX=no
- AC_MSG_RESULT(no)
- AC_DEFINE(REGEX,0)
+ if test -n "$APXS"; then
+ if test -z "`$APXS -q CFLAGS | grep USE_HSREGEX`"; then
+ HSREGEX=yes
+ else
+ HSREGEX=no
+ fi
+ else
+ if test "$withval" = "no"; then
+ HSREGEX=yes
+ else
+ HSREGEX=no
+ fi
+ fi
],[
- REGEX_LIB=regex/libregex.a
- EXTRA_LIBS="-L$abs_builddir/regex -lregex $EXTRA_LIBS"
- HSREGEX=yes
- AC_MSG_RESULT(yes)
- AC_DEFINE(HSREGEX)
- AC_DEFINE(REGEX,1)
+ if test -n "$APXS"; then
+ if test -z "`$APXS -q CFLAGS | grep USE_HSREGEX`"; then
+ HSREGEX=yes
+ else
+ HSREGEX=no
+ fi
+ else
+ HSREGEX=yes
+ fi
])
+AC_MSG_RESULT($HSREGEX)
+
+if test "$HSREGEX" = "yes"; then
+ REGEX_LIB=regex/libregex.a
+ EXTRA_LIBS="-L$abs_builddir/regex -lregex $EXTRA_LIBS"
+ AC_DEFINE(HSREGEX)
+ AC_DEFINE(REGEX,1)
+else
+ REGEX_LIB=
+ AC_DEFINE(REGEX,0)
+fi
+
AC_SUBST(REGEX_LIB)
AC_SUBST(HSREGEX)