new build/test system

This commit is contained in:
nlopess
2004-03-18 17:12:45 +00:00
parent 5a37e025ae
commit 4e028e6bf0
6 changed files with 228 additions and 14 deletions

7
.gitignore vendored
View File

@@ -1,3 +1,6 @@
docs/manual
docs/manual.junk
docs/*.cache
docs/Makefile
docs/config.*
docs/configure
docs/manual.xml
/templates_c

View File

@@ -1,2 +1,5 @@
manual
manual.junk
configure
Makefile
manual.xml
config.*
*.cache

41
docs/Makefile.in Executable file
View File

@@ -0,0 +1,41 @@
# +----------------------------------------------------------------------+
# | PHP Version 5 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2004 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 3.0 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available through the world-wide-web at the following url: |
# | http://www.php.net/license/3_0.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
#
#
# $Id$
#
all: html
# {{{ variables
PHP=@PHP@
LANG=@LANG@
NSGMLS=@NSGMLS@
# }}}
test:
$(NSGMLS) -i lang-$(LANG) -s ./dtds/dbxml-4.1.2/phpdocxml.dcl manual.xml
# {{{ cleanup
clean:
rm -f Makefile config.* manual.xml configure
rm -fr autom4te.cache
# }}}

View File

@@ -1,15 +1,19 @@
This directory contains the documentation for Smarty. All files are in docbook
format with an .sgml extention. The top level directory contains the english
docs, while the subdirs contain different available languages.
format with an .xml extention. Different subdirs contain different available languages.
To compile the documentation, I use the docbook utilities (available as an rpm
for redhat linux.) Compiling goes as such:
cd docs
db2html -d /path/to/html.dsl manual.sgml
NEW BUILD SYSTEM
================
Firstly issue these commands:
1) autoconf
2) ./configure --with-lang=xx [DEFAULT=en]
Be sure to edit the html.dsl file and set the path to your docbook.dsl
stylesheet file.
TEST:
* make test
This will create a subdirectory called manual/ which will contain the generated
HTML docs to view with a browser.
MAKE:
* make (to make plain html)
* make web (to make docs for website)
You should have libxml and autoconf installed in your system.
Read http://php.net/manual/howto/chapter-tools.html for more info.

145
docs/configure.in Executable file
View File

@@ -0,0 +1,145 @@
dnl $Id$
dnl autoconf initialisation
AC_INIT()
WORKDIR=`pwd`
AC_SUBST(WORKDIR)
dnl debug output
echo "file versions"
for file in $srcdir/*.in; do
fgrep '$Id' $file | head -1 | sed -e"s/^.*: //g" | sed -e"s/200.\/.*$//g"
done
echo "configure options: $@"
echo "working directory: $WORKDIR"
echo
dnl {{{ check for support programs
dnl {{{ check for nsgmls or onsgmls
AC_ARG_WITH(nsgmls,
[ --with-nsgmls=PATH look for nsgmls or onsgmls executable],[
if test $withval != "yes"; then
AC_MSG_CHECKING([for nsgmls])
if test -x $withval; then
NSGMLS=$withval
AC_MSG_RESULT($NSGMLS)
else
NSGMLS=no
AC_MSG_RESULT(no)
AC_MSG_ERROR([$withval: not an executable file])
fi
else
if test -e ../../phpdoc-tools/jade/nsgmls.exe ; then
AC_MSG_CHECKING([for nsgmls])
NSGMLS=../../phpdoc-tools/jade/nsgmls.exe
AC_MSG_RESULT($NSGMLS)
else
AC_PATH_PROG(ONSGMLS,"onsgmls",no)
if test $ONSGMLS = "no"; then
AC_PATH_PROG(NSGMLS,"nsgmls",no)
else
NSGMLS=$ONSGMLS
fi
fi
fi
],[
if test -e ../../phpdoc-tools/jade/nsgmls.exe ; then
AC_MSG_CHECKING([for nsgmls])
NSGMLS=../../phpdoc-tools/jade/nsgmls.exe
AC_MSG_RESULT($NSGMLS)
else
AC_PATH_PROG(ONSGMLS,"onsgmls",no)
if test $ONSGMLS = "no"; then
AC_PATH_PROG(NSGMLS,"nsgmls",no)
else
NSGMLS=$ONSGMLS
fi
fi
]
)
if test $NSGMLS = "no"; then
AC_MSG_ERROR([can't find nsgmls or onsgmls])
fi
AC_SUBST(NSGMLS)
dnl }}}
dnl }}}
dnl {{{ language specific stuff
AC_MSG_CHECKING(for language)
PHP_BUILD_DATE=`date '+%Y-%m-%d'`
AC_ARG_WITH(lang,
[ --with-lang=LANG choose a language to work with],[
if test "$withval" = "yes"; then
LANG=en
AC_MSG_RESULT([en (default)])
else
if test ! -d "./$withval"; then
AC_MSG_RESULT()
AC_MSG_ERROR(Language \"$withval\" not supported!)
else
LANG=$withval
AC_MSG_RESULT($LANG)
fi
PHP_BUILD_DATE=`date '+%d-%m-%Y'`
fi
],[
LANG=en
AC_MSG_RESULT([en (default)])
])
AC_SUBST(LANG)
AC_SUBST(PHP_BUILD_DATE)
dnl }}}
dnl {{{ makefile targets for configure-generated files
rm -f autogenerated_rules
(
for file in `find . -name "*.in"`; do
case "$file" in
./configure.in)
echo configure: configure.in
printf '\t autoconf'
echo
;;
./manual.xml.in)
;;
*)
echo `dirname $file`/`basename $file .in`: '$(srcdir)'/$file ./config.status
printf '\t CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status'
echo
esac
done
) > autogenerated_rules
AUTOGENERATED_RULES=autogenerated_rules
AC_SUBST_FILE(AUTOGENERATED_RULES)
rm -f autogenerated_rules
dnl }}}
dnl {{{ generate output files
dnl {{{ find all *.in files and process them with AC_OUTPUT
for infile in `find $srcdir -name "*.in"`
do
if test `basename $infile` != "configure.in"
then
outfile=`basename $infile .in`
outdir=`dirname $infile`
outdir=`echo $outdir/ | sed -e"s|$srcdir/||"`
OUTFILES="$OUTFILES ./$outdir$outfile"
fi
done
AC_OUTPUT($OUTFILES)
dnl }}}
dnl }}}

18
docs/manual.xml.in Normal file
View File

@@ -0,0 +1,18 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"./dtds/dbxml-4.1.2/docbookx.dtd" [
<!ENTITY bookinfo SYSTEM "@LANG@/bookinfo.xml">
<!ENTITY preface SYSTEM "@LANG@/preface.xml">
<!ENTITY getting.started SYSTEM "@LANG@/getting-started.xml">
<!ENTITY smarty.for.designers SYSTEM "@LANG@/designers.xml">
<!ENTITY smarty.for.programmers SYSTEM "@LANG@/programmers.xml">
<!ENTITY appendixes SYSTEM "@LANG@/appendixes.xml">
]>
<book id="index">
&bookinfo;
&preface;
&getting.started;
&smarty.for.designers;
&smarty.for.programmers;
&appendixes;
</book>