php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #38856 configure fails in phpdoc
Submitted: 2006-09-16 23:04 UTC Modified: 2006-09-21 03:58 UTC
From: maya dot negeta+php at gmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: FreeBSD 6.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: maya dot negeta+php at gmail dot com
New email:
PHP Version: OS:

 

 [2006-09-16 23:04 UTC] maya dot negeta+php at gmail dot com
Description:
------------
I checked out phpdoc-ja from cvs.php.net.
And I run ./configure to generate Makefile.
But it returns error.
Just maybe is it only work with bash?

Reproduce code:
---------------
% autoconf259
% ./configure --with-lang=ja
file versions
Makefile.in,v 1.172
configure.in,v 1.236
(snip)
checking for php... /usr/local/bin/php
checking php version... 5.1.6 cli
checking for php.ini path... ./scripts
checking for openjade... /usr/local/bin/openjade
./configure.lineno: 1606: Syntax error: Bad substitution


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-17 00:05 UTC] takagi@php.net
I tried it on bash, zsh, tcsh, csh, and ksh.
But it worked well every time.

% uname -sr
Linux 2.6.9-34.0.2.EL
% autoconf --version
autoconf (GNU Autoconf) 2.59

Could you please try the following patch?

Index: configure.in
===================================================================
RCS file: /repository/phpdoc/configure.in,v
retrieving revision 1.236
diff -u -r1.236 configure.in
--- configure.in        14 Sep 2006 14:58:35 -0000      1.236
+++ configure.in        16 Sep 2006 23:48:29 -0000
@@ -150,13 +150,7 @@
 if test $JADE = "no"; then
   AC_MSG_ERROR([can't find jade or openjade])
 fi
-if test ${JADE:0:15} = "../phpdoc-tools"; then
-  WINJADE=1
-else
-  WINJADE=0
-fi
 AC_SUBST(JADE)
-AC_SUBST(WINJADE)

 dnl }}}


 [2006-09-17 08:09 UTC] maya dot negeta+php at gmail dot com
Sorry, I said 'bash' as '/bin/sh is a link of bash.'

Thank you for your patch.
It solves ./configure problem.
 [2006-09-20 03:10 UTC] takagi@php.net
> I said 'bash' as '/bin/sh is a link of bash.'
OK, I got it.
I found that the pure Bourne Shell (not bash) can't recognize ${parameter:offset:length} style syntax.

I'm sorry to bother you again but could you please try this patch?

# I can't try it by myself because
#  % ls -l /bin/sh
#  lrwxrwxrwx  1 root root 4 Sep  1 09:59 /bin/sh -> bash
# :-(

Index: configure.in
===================================================================
RCS file: /repository/phpdoc/configure.in,v
retrieving revision 1.236
diff -u -r1.236 configure.in
--- configure.in        14 Sep 2006 14:58:35 -0000      1.236
+++ configure.in        20 Sep 2006 02:00:57 -0000
@@ -150,7 +150,7 @@
 if test $JADE = "no"; then
   AC_MSG_ERROR([can't find jade or openjade])
 fi
-if test ${JADE:0:15} = "../phpdoc-tools"; then
+if test `expr substr $JADE 1 15` = "../phpdoc-tools"; then
   WINJADE=1
 else
   WINJADE=0

 [2006-09-20 04:28 UTC] maya dot negeta+php at gmail dot com
Thank you for your reply and patch.
FreeBSD has no GNU expr, and it doesn't have 'substr'.
http://www.freebsd.org/cgi/man.cgi?query=expr&apropos=0&sektion=0&manpath=FreeBSD+6.1-RELEASE&format=html

I changed your patch followings and it seems work.
Is it work on Linux and other OS?

Index: configure.in
===================================================================
RCS file: /repository/phpdoc/configure.in,v
retrieving revision 1.236
diff -u -r1.236 configure.in
--- configure.in        14 Sep 2006 14:58:35 -0000      1.236
+++ configure.in        20 Sep 2006 04:21:36 -0000
@@ -150,7 +150,7 @@
 if test $JADE = "no"; then
   AC_MSG_ERROR([can't find jade or openjade])
 fi
-if test ${JADE:0:15} = "../phpdoc-tools"; then
+if test `expr $JADE : ^../phpdoc-tools`; then
   WINJADE=1
 else
   WINJADE=0
 [2006-09-21 03:08 UTC] takagi@php.net
Thank you. I tried your patch and found two problems.

1. When I use `^' as the first character of the pattern,
   I got the following warning.

     % expr abcde : ^abc
     expr: warning: unportable BRE: `^abc': using `^' as the first character
     of the basic regular expression is not portable; it is being ignored
     3

   According to the man page you spotted,
     The regular expression is anchored to
     the beginning of the string with an implicit ``^''.
   so I removed `^' from the pattern.

     % expr abcde : abc
     3

2. The exit status of "text `expr $string : $pattern`"
   seems to be always 0.

     % test `expr abcde : abc`; echo $?
     0
     % test `expr abcde : xxx`; echo $?
     0

   so I changed it to check whether the return value
   of `expr' equals to zero.

     % expr abcde : abc
     3
     % expr abcde : xxx
     0

     % test `expr abcde : abc` -ne 0; echo $?
     0
     % test `expr abcde : xxx` -ne 0; echo $?
     1

I made another patch again. I tested it on the following machines, and both work well.
  % uname -a
  Linux host1.example.com 2.6.9-34.0.2.EL #1 Fri Jul 7 19:24:57 CDT 2006 i686 i686 i386 GNU/Linux
  % uname -a
  SunOS host2.example.com 5.6 Generic_105182-25 i86pc i386 i86pc

Could you please try it again?

Index: configure.in
===================================================================
RCS file: /repository/phpdoc/configure.in,v
retrieving revision 1.236
diff -u -r1.236 configure.in
--- configure.in        14 Sep 2006 14:58:35 -0000      1.236
+++ configure.in        21 Sep 2006 02:17:37 -0000
@@ -150,7 +150,7 @@
 if test $JADE = "no"; then
   AC_MSG_ERROR([can't find jade or openjade])
 fi
-if test ${JADE:0:15} = "../phpdoc-tools"; then
+if test `expr $JADE : ../phpdoc-tools` -ne 0; then
   WINJADE=1
 else
   WINJADE=0

 [2006-09-21 03:51 UTC] maya dot negeta+php at gmail dot com
Your patch works on FreeBSD too.
+ expr /usr/local/bin/openjade : ../phpdoc-tools
+ test 0 -ne 0
+ WINJADE=0

Thank you very much!
 [2006-09-21 03:58 UTC] takagi@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

Thank you for your assitance!
 http://news.php.net/php.doc/969374068

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Aug 04 06:00:03 2025 UTC