From 4e028e6bf044a375b810b11ff8e5bed43c591064 Mon Sep 17 00:00:00 2001 From: nlopess Date: Thu, 18 Mar 2004 17:12:45 +0000 Subject: [PATCH] new build/test system --- .gitignore | 7 ++- docs/.cvsignore | 7 ++- docs/Makefile.in | 41 +++++++++++++ docs/README | 24 ++++---- docs/configure.in | 145 +++++++++++++++++++++++++++++++++++++++++++++ docs/manual.xml.in | 18 ++++++ 6 files changed, 228 insertions(+), 14 deletions(-) create mode 100755 docs/Makefile.in create mode 100755 docs/configure.in create mode 100644 docs/manual.xml.in diff --git a/.gitignore b/.gitignore index 05aa2bb9..6b5439c1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ -docs/manual -docs/manual.junk +docs/*.cache +docs/Makefile +docs/config.* +docs/configure +docs/manual.xml /templates_c diff --git a/docs/.cvsignore b/docs/.cvsignore index eaebdc7c..f8dcc03d 100644 --- a/docs/.cvsignore +++ b/docs/.cvsignore @@ -1,2 +1,5 @@ -manual -manual.junk +configure +Makefile +manual.xml +config.* +*.cache diff --git a/docs/Makefile.in b/docs/Makefile.in new file mode 100755 index 00000000..3559c8cc --- /dev/null +++ b/docs/Makefile.in @@ -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 + +# }}} diff --git a/docs/README b/docs/README index 6eff0b1e..e962b18e 100644 --- a/docs/README +++ b/docs/README @@ -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. diff --git a/docs/configure.in b/docs/configure.in new file mode 100755 index 00000000..ca5ae9c7 --- /dev/null +++ b/docs/configure.in @@ -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 }}} diff --git a/docs/manual.xml.in b/docs/manual.xml.in new file mode 100644 index 00000000..dd495b0b --- /dev/null +++ b/docs/manual.xml.in @@ -0,0 +1,18 @@ + + + + + + +]> + + + &bookinfo; + &preface; + &getting.started; + &smarty.for.designers; + &smarty.for.programmers; + &appendixes; + \ No newline at end of file