]> granicus.if.org Git - php/commitdiff
Welcome PHP_ARG_ENABLE and PHP_ARG_WITH. They are there to replace the common
authorSascha Schumann <sas@php.net>
Mon, 27 Mar 2000 23:33:38 +0000 (23:33 +0000)
committerSascha Schumann <sas@php.net>
Mon, 27 Mar 2000 23:33:38 +0000 (23:33 +0000)
AC_MSG_CHECKING, AC_ARG_[ENABLE,WITH], AC_MSG_RESULT trio.

acinclude.m4
ext/dbase/config.m4
ext/ext_skel
ext/filepro/config.m4
ext/ftp/config.m4
ext/session/config.m4
ext/wddx/config.m4

index 0ee6b9e1d6d26ae06a4df29f52ff61bfa8aff915..aba4a80df826eef87a95e83d632337ffee21121c 100644 (file)
@@ -2,6 +2,18 @@ dnl $Id$
 dnl
 dnl This file contains local autoconf functions.
 
+AC_DEFUN(PHP_ARG_WITH,[
+AC_MSG_CHECKING($2)
+AC_ARG_WITH($1,[$3],PHP_[]translit($1,a-z-,A-Z_)=[$]withval,PHP_[]translit($1,a-z-,A-Z_)=ifelse($4,,no,$4))
+AC_MSG_RESULT([$]PHP_[]translit($1,a-z-,A-Z_))
+])
+
+AC_DEFUN(PHP_ARG_ENABLE,[
+AC_MSG_CHECKING($2)
+AC_ARG_ENABLE($1,[$3],PHP_[]translit($1,a-z-,A-Z_)=[$]enableval,PHP_[]translit($1,a-z-,A-Z_)=ifelse($4,,no,$4))
+AC_MSG_RESULT([$]PHP_[]translit($1,a-z-,A-Z_))
+])
+
 AC_DEFUN(PHP_MODULE_PTR,[
   EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS $1,"
 ])
index b8746c68254402c3f2146d805d9a42787192499a..8723b2e9f4f9688c296660b19594ba420636fa0e 100644 (file)
@@ -1,18 +1,13 @@
 dnl $Id$
 
-AC_MSG_CHECKING(whether to include the bundled dbase library)
-AC_ARG_WITH(dbase,
-[  --with-dbase            Include the bundled dbase library],
-[
-  if test "$withval" = "yes"; then
-       AC_MSG_RESULT(yes)
-       AC_DEFINE(DBASE,1,[ ])
-       PHP_EXTENSION(dbase)
-  else
-       AC_MSG_RESULT(no)
-       AC_DEFINE(DBASE,0,[ ])
-  fi
-],[
-  AC_MSG_RESULT(no)
+AC_ARG_WITH(dbase,[],[enable_dbase=$withval])
+
+PHP_ARG_ENABLE(dbase,whether to enable the bundled dbase library,
+[  --enable-dbase          Enable the bundled dbase library])
+
+if test "$PHP_DBASE" = "yes"; then
+  AC_DEFINE(DBASE,1,[ ])
+  PHP_EXTENSION(dbase)
+else
   AC_DEFINE(DBASE,0,[ ])
-])
+fi
index cf5d22242c2d30b8fd19958e01283340bd7c1d3f..7e5fb40501c34f1f3ac6e5ec2fb9af0760b52eb3 100755 (executable)
@@ -44,27 +44,15 @@ dnl don't forget to call PHP_EXTENSION($extname)
 
 dnl If your extension references something external, use with:
 
-AC_MSG_CHECKING(whether to include $extname support)
-AC_MSG_WITH($extname,
+PHP_ARG_WITH($extname, for $extname support,
 dnl Make sure that the comment is aligned:
-[  --with-$extname             Include $extname support.],[
-  PHP_$EXTNAME=\$withval
-],[
-  PHP_$EXTNAME=no
-])
-AC_MSG_RESULT(\$PHP_$EXTNAME)
+[  --with-$extname             Include $extname support])
 
 dnl Otherwise use enable:
 
-AC_MSG_CHECKING(whether to enable $extname)
-AC_MSG_ENABLE($extname,
+PHP_ARG_ENABLE($extname, whether to enable $extname support,
 dnl Make sure that the comment is aligned:
-[  --enable-$extname           Include $extname support.],[
-  PHP_$EXTNAME=\$enableval
-],[
-  PHP_$EXTNAME=no
-])
-AC_MSG_RESULT(\$PHP_$EXTNAME)
+[  --enable-$extname           Enable $extname support])
 
 if test "\$PHP_$EXTNAME" != "no"; then
   dnl Action..
index a0036668b2e33708dad0c7ae9055d1aa8f1a54e7..cb0452526975bcc620990dda6fb5bad1c7f186dd 100644 (file)
@@ -1,17 +1,13 @@
 dnl $Id$
 
-AC_MSG_CHECKING(whether to include the bundled filePro support)
-AC_ARG_WITH(filepro,
-[  --with-filepro          Include the bundled read-only filePro support],[
-  if test "$withval" != "no"; then
-    AC_DEFINE(HAVE_FILEPRO, 1, [ ])
-    AC_MSG_RESULT(yes)
-    PHP_EXTENSION(filepro)
-  else
-    AC_DEFINE(HAVE_FILEPRO, 0, [ ])
-    AC_MSG_RESULT(no)
-  fi
-],[
+AC_ARG_WITH(filepro,[],[enable_filepro=$withval])
+
+PHP_ARG_ENABLE(filepro,whether to enable the bundled filePro support,
+[  --enable-filepro        Enable the bundled read-only filePro support])
+
+if test "$PHP_FILEPRO" = "yes"; then
+  AC_DEFINE(HAVE_FILEPRO, 1, [ ])
+  PHP_EXTENSION(filepro)
+else
   AC_DEFINE(HAVE_FILEPRO, 0, [ ])
-  AC_MSG_RESULT(no)
-]) 
+fi
index ce5d6af78c9ef7bc311e9800fd92f67e35367e19..0c29da61d8122b0c07918170ba938bdb3c76d357 100644 (file)
@@ -2,17 +2,10 @@ dnl $Id$
 dnl config.m4 for extension ftp
 dnl don't forget to call PHP_EXTENSION(ftp)
 
-AC_MSG_CHECKING(for FTP support)
-AC_ARG_WITH(ftp,
-[  --with-ftp              Include FTP support.],
-[
-  if test "$withval" != "no"; then
-    AC_DEFINE(HAVE_FTP,1,[ ])
-    PHP_EXTENSION(ftp)
-    AC_MSG_RESULT(yes)
-  else
-    AC_MSG_RESULT(no)
-  fi
-],[
-  AC_MSG_RESULT(no)
-])
+PHP_ARG_ENABLE(ftp,whether to enable FTP support,
+[  --enable-ftp            Enable FTP support])
+
+if test "$PHP_FTP" = "yes"; then
+  AC_DEFINE(HAVE_FTP,1,[Whether you want FTP support])
+  PHP_EXTENSION(ftp)
+fi
index 11496f4a60adf0b1a6e7267776a2f4684631638a..89017871aee1ab983840658948831175ad503348 100644 (file)
@@ -1,31 +1,13 @@
 dnl $Id$
 
-AC_MSG_CHECKING(for mm support)
-AC_ARG_WITH(mm,
-[  --with-mm[=DIR]         Include mm support for session storage],[
-  PHP_MM=$withval
-],[
-  PHP_MM=no
-])
-AC_MSG_RESULT($PHP_MM)
-
-AC_MSG_CHECKING(whether to enable session support)
-AC_ARG_ENABLE(session,
-[  --disable-session       Disable session support],[
-  PHP_SESSION=$enableval
-],[
-  PHP_SESSION=yes
-])
-AC_MSG_RESULT($PHP_SESSION)
-
-AC_MSG_CHECKING(whether to enable transparent session id propagation)
-AC_ARG_ENABLE(trans-sid,
-[  --enable-trans-sid      Enable transparent session id propagation],[
-  PHP_TRANS_SID=$enableval
-],[
-  PHP_TRANS_SID=no
-])
-AC_MSG_RESULT($PHP_TRANS_SID)
+PHP_ARG_WITH(mm,for mm support,
+[  --with-mm[=DIR]         Include mm support for session storage])
+
+PHP_ARG_ENABLE(session, whether to enable session support,
+[  --disable-session       Disable session support], yes)
+
+PHP_ARG_ENABLE(trans-sid,whether to enable transparent session id propagation,
+[  --enable-trans-sid      Enable transparent session id propagation])
 
 if test "$PHP_MM" != "no"; then
   for i in /usr/local /usr $PHP_MM; do
index 9e599b0c8fa3592366df9a61e46e107f11555dd2..2dbd479ab55f07494a1abde6fb397458d6d6cd69 100644 (file)
@@ -1,20 +1,14 @@
 dnl $Id$
 dnl config.m4 for extension wddx
 
-AC_MSG_CHECKING(whether to include WDDX support)
-AC_ARG_ENABLE(wddx,
-[  --enable-wddx           Include WDDX support],[
-  if test "$enableval" = "yes"; then
-    if test "${enable_xml+set}" != "set" -o "$enable_xml" = "no"; then
-               AC_MSG_ERROR(WDDX requires --enable-xml)
-    else
-        AC_DEFINE(HAVE_WDDX, 1, [ ])
-        AC_MSG_RESULT(yes)
-        PHP_EXTENSION(wddx)
-    fi
-  else
-    AC_MSG_RESULT(no)
+PHP_ARG_ENABLE(wddx,whether to enable WDDX support,
+[  --enable-wddx           Enable WDDX support])
+
+if test "$PHP_WDDX" = "yes"; then
+  if test "$enable_xml" = "no"; then
+    AC_MSG_WARN(Activating XML)
+    enable_xml=yes
   fi
-],[
-  AC_MSG_RESULT(no)
-]) 
+  AC_DEFINE(HAVE_WDDX, 1, [ ])
+  PHP_EXTENSION(wddx)
+fi