#18794 [Opn->Fbk]: inappropriate if logic in configure --with-nsapi
| From: | kalowsky@php.net | Date: | Wed, 14 Aug 2002 00:16:16 +0000 |
| Subject: | #18794 [Opn->Fbk]: inappropriate if logic in configure --with-nsapi | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-16662@lists.php.net to get a copy of this message | ||
ID: 18794
Updated by: kalowsky@php.net
Reported By: vlb@gene.com
-Status: Open
+Status: Feedback
Bug Type: *Configuration Issues
Operating System: Tru64 Unix (but n/a)
PHP Version: 4.2.2
New Comment:
There is a check for the header file nsapi.h in both sections.
Also my brief (albiet limited) understanding is that nsapi v4 uses only
the plugins/include/ directory, nsapi v3 usrs just the includes
directory. Thus the OR between them.
Anyways if you can test this patch to the config.m4 (you'll need to run
cvsclean and buildconf) I'd appriciate it
Index: config.m4
===================================================================
RCS file: /repository/php4/sapi/nsapi/config.m4,v
retrieving revision 1.12
diff -u -u -r1.12 config.m4
--- config.m4 8 Aug 2002 05:52:15 -0000 1.12
+++ config.m4 14 Aug 2002 00:15:19 -0000
@@ -20,11 +20,13 @@
NSAPI_INCLUDE=$PHP_NSAPI/include
AC_MSG_RESULT(Netscape-Enterprise/3.x style)
AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
- elif test -d $PHP_NSAPI/plugins/include ; then
- NSAPI_INCLUDE=$PHP_NSAPI/plugins/include
+ fi
+ if test -d $PHP_NSAPI/plugins/include ; then
+ NSAPI_INCLUDE="$NSAPI_INCLUDE $PHP_NSAPI/plugins/include"
AC_MSG_RESULT(iPlanet/4.x style)
AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
- else
+ fi
+ if test "$NSAPI_INCLUDE" = ""; then
AC_MSG_ERROR(Please check you have nsapi.h in either
$PHP_NSAPI/include or $PHP_NSAPI/plugins/include)
fi
PHP_ADD_INCLUDE($NSAPI_INCLUDE)
Previous Comments:
------------------------------------------------------------------------
[2002-08-13 13:04:19] vlb@gene.com
The changed if logic still assumes that it should look for n
$PHP_NSAPI/include and then for $PHP_NSAPI/plugins/include ONLY if
$PHP_NSAPI/plugins/include did not exist. This is not appropriate
logic. Both directories exist.
Check for the existence of the file; don't do an if/else on the
directories. If you feel you must do a directory check, look for
$PHP_NSAPI/plugins/include first; it would be for the newer version of
iPlanet.
It's all very nice to test that including the .h works (or doesn't) but
this is inconsequential if you don't first check for the existence of
the file.
------------------------------------------------------------------------
[2002-08-08 01:52:59] kalowsky@php.net
Changes made to the configure script. Can you please test this later
in a little bit with a new snapshot from http://snaps.php.net
Thank you.
------------------------------------------------------------------------
[2002-08-07 17:00:01] vlb@gene.com
Configure options
configure --with-nsapi=/usr/prop/netscape/server4/
configure succeeds; make exits with
cc: Severe: nsapi.c, line 50: Cannot find file "nsapi.h" specified in
#include directive. (noinclfilef)
#include "nsapi.h"
-^
Reason:
Configure script contains this if block:
if test -d $PHP_NSAPI/include ; then
NSAPI_INCLUDE=$PHP_NSAPI/include
echo "$ac_t""Netscape-Enterprise/3.x style" 1>&6
elif test -d $PHP_NSAPI/plugins/include ; then
NSAPI_INCLUDE=$PHP_NSAPI/plugins/include
echo "$ac_t""iPlanet/4.x style" 1>&6
else
{ echo "configure: error: Please check you have nsapi.h in either
DIR/include
DIR/plugins/include" 1>&2; exit 1; }
fi
There are two things wrong here:
1) it is inappropriate to check for $PHP_NSAPI/include; the appropriate
test should be for the _file_ $PHP_NSAPI/include/nsapi.h
In our case, both $PHP_NSAPI/include and $PHP_NSAPI/plugins/include
exist (this has also been the case for at least one of the other bugs
filed; see #5233).
Configure should not assume a file exists simply because a directory it
might be in happens to exist.
2) In the error message, `DIR' is meaningless. The error should use
$PHP_NSAPI, not the literal string `DIR'.
See also bug 11446 and several others, closed as "bogus" or "not a bug
in PHP". While that is technically true, the bug is nonetheless in the
PHP configuration script, and it should be addressed by the php team.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18794&edit=1