From: fred Date: Tue, 26 Mar 2002 21:28:17 +0000 (+0000) Subject: lilypond-1.1.0 X-Git-Tag: release/1.5.59~2819 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a9438d0aa333a56e5e0cb327e5cfe11b88b44bad;p=lilypond.git lilypond-1.1.0 --- diff --git a/Documentation/man/GNUmakefile b/Documentation/man/GNUmakefile index 6f2e9d4b4a..5fd71fb083 100644 --- a/Documentation/man/GNUmakefile +++ b/Documentation/man/GNUmakefile @@ -2,7 +2,7 @@ depth = ../.. -STEPMAKE_TEMPLATES=documentation +STEPMAKE_TEMPLATES=documentation install-out SECTION=1 MANTXT = $(addprefix $(outdir)/, $(addsuffix .txt,$(basename $(TEXINFO_FILES) .texinfo))) MANGROFF = $(addprefix $(outdir)/, $(addsuffix .$(SECTION),$(basename $(YO_FILES) .yo))) @@ -16,8 +16,6 @@ default: $(MANGROFF) INSTALLATION_OUT_FILES=$(MANGROFF) INSTALLATION_OUT_DIR=$(mandir)/man$(SECTION) -include $(stepdir)/install-outfiles.make - local-WWW: $(MANGROFF:.1=.html) $(PYTHON) $(step-bindir)/ls-latex.py --package=$(topdir) --title 'Manual pages for LilyPond' $(YO_FILES) \ | sed "s!$(outdir)/!!g" > $(outdir)/index.html diff --git a/Documentation/topdocs/PATCHES.yo b/Documentation/topdocs/PATCHES.yo index 87a328b11f..1b20b7c37a 100644 --- a/Documentation/topdocs/PATCHES.yo +++ b/Documentation/topdocs/PATCHES.yo @@ -40,10 +40,16 @@ verb( Then, from the top of Lily's source tree, type verb( + make dist make diff ) -which leaves your patch as file(./lilypond-0.1.73.jcn1.diff). +which rolls the tarball file(../releases/lilypond-0.1.73.tar.gz) +and leaves your patch as file(./lilypond-0.1.73.jcn1.diff). +footnote('Make diff' generates a patch between two tarballs. For +more info type 'make diff help=='. We assume that there is a tarball +file(lilypond-0.1.73.tar.gz) in the directory file(../releases). + If you didn't configure Lily using --srcdir, you can do: diff --git a/aclocal.m4 b/aclocal.m4 index 5844b69dcf..1671ff15ef 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,5 @@ dnl WARNING WARNING WARNING WARNING -dnl do not edit! this is aclocal.m4, generated from stepmake/stepmake/../aclocal.m4 +dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4 dnl aclocal.m4 -*-shell-script-*- dnl StepMake subroutines for configure.in @@ -155,6 +155,16 @@ AC_DEFUN(AC_STEPMAKE_GXX, [ fi ]) +AC_DEFUN(AC_STEPMAKE_GUILE, [ + # urg, must check for different functions in libguile + # to force new check iso reading from cache + AC_CHECK_LIB(guile, scm_shell, \ + LIBS="-lguile $LIBS" AC_DEFINE(HAVE_LIBGUILE), \ + AC_CHECK_LIB(readline, readline) \ + AC_CHECK_LIB(dl, dlopen) \ + AC_CHECK_LIB(guile, scm_boot_guile)) +]) + AC_DEFUN(AC_STEPMAKE_INIT, [ . $srcdir/VERSION @@ -169,16 +179,44 @@ AC_DEFUN(AC_STEPMAKE_INIT, [ package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'` changequote([, ])dnl + # No versioning on directory names of sub-packages + # urg, urg + stepmake=${datadir}/stepmake + presome=${prefix} + if test "$prefix" = "NONE"; then + presome=${ac_default_prefix} + fi + stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"` + if test "x$PACKAGE" = "xSTEPMAKE"; then echo Stepmake package! (cd stepmake; rm -f stepmake; ln -s ../stepmake .) (cd stepmake; rm -f bin; ln -s ../bin .) AC_CONFIG_AUX_DIR(bin) + stepmake=stepmake else echo Package: $PACKAGE - AC_CONFIG_AUX_DIR(stepmake/bin) + # Check for installed stepmake + if test -d $stepmake; then + echo Using installed stepmake: $stepmake + else + stepmake='$(depth)'/stepmake + echo Using local stepmake: $datadir/stepmake not found + fi + AC_CONFIG_AUX_DIR(\ + $HOME/usr/local/share/stepmake/bin\ + $HOME/usr/local/lib/stepmake/bin\ + $HOME/usr/share/stepmake/bin\ + $HOME/usr/lib/stepmake/bin\ + /usr/local/share/stepmake/bin\ + /usr/local/lib/stepmake/bin\ + /usr/share/stepmake/bin\ + /usr/lib/stepmake/bin\ + stepmake/bin\ + ) fi + AC_SUBST(stepmake) AC_SUBST(package) AC_SUBST(PACKAGE) AC_SUBST(PACKAGE_NAME) @@ -193,10 +231,6 @@ AC_DEFUN(AC_STEPMAKE_INIT, [ absolute_builddir="`pwd`" AC_SUBST(absolute_builddir) - # No versioning on directory names of sub-packages - stepmake=stepmake - AC_SUBST(stepmake) - STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null` if test "x$STATE_VECTOR" != "x"; then STATE_VECTOR="\$(depth)/$STATE_VECTOR" @@ -251,14 +285,14 @@ dnl fi DOTEXE=.exe DIRSEP='\\' PATHSEP=';' - INSTALL="\$(stepdir)/../bin/install-dot-exe.sh -c" + INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c" else DIRSEP='/' PATHSEP=':' LN=ln LN_S='ln -s' ZIP="zip -r -9" - INSTALL="\$(stepdir)/../bin/install-sh -c" + INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c" fi AC_SUBST(DOTEXE) AC_SUBST(ZIP) @@ -463,11 +497,13 @@ AC_DEFUN(AC_STEPMAKE_YODL, [ AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl) AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl) AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl) + YODL2LESS_DIR='$(bindir)/' else AC_SUBST(STRIPROFF) AC_SUBST(YODL) AC_SUBST(YODL2HTML) AC_SUBST(YODL2LATEX) + AC_SUBST(YODL2LESS_DIR) AC_SUBST(YODL2MAN) AC_SUBST(YODL2MSLESS) AC_SUBST(YODL2TEXINFO) diff --git a/config.make.in b/config.make.in index 292783aab0..a2a43b481f 100644 --- a/config.make.in +++ b/config.make.in @@ -59,6 +59,7 @@ TROFF = @TROFF@ YODL= @YODL@ YODL2HTML= @YODL2HTML@ YODL2LATEX= @YODL2LATEX@ +YODL2LESS_DIR= @YODL2LESS_DIR@ YODL2MAN= @YODL2MAN@ YODL2MSLESS= @YODL2MSLESS@ YODL2TEXINFO= @YODL2TEXINFO@ diff --git a/configure b/configure index 9588ac798a..942a6f482c 100755 --- a/configure +++ b/configure @@ -79,8 +79,6 @@ ac_help="$ac_help enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)" ac_help="$ac_help enable-printing turn on debug printing. Default: off" -ac_help="$ac_help - enable-guile link in GUILE. Default: off" ac_help="$ac_help with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale " ac_help="$ac_help @@ -607,6 +605,15 @@ fi PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'` package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'` + # No versioning on directory names of sub-packages + # urg, urg + stepmake=${datadir}/stepmake + presome=${prefix} + if test "$prefix" = "NONE"; then + presome=${ac_default_prefix} + fi + stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"` + if test "x$PACKAGE" = "xSTEPMAKE"; then echo Stepmake package! (cd stepmake; rm -f stepmake; ln -s ../stepmake .) @@ -630,10 +637,38 @@ ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + stepmake=stepmake else echo Package: $PACKAGE + # Check for installed stepmake + if test -d $stepmake; then + echo Using installed stepmake: $stepmake + else + stepmake='$(depth)'/stepmake + echo Using local stepmake: $datadir/stepmake not found + fi ac_aux_dir= -for ac_dir in stepmake/bin $srcdir/stepmake/bin; do +for ac_dir in \ + $HOME/usr/local/share/stepmake/bin\ + $HOME/usr/local/lib/stepmake/bin\ + $HOME/usr/share/stepmake/bin\ + $HOME/usr/lib/stepmake/bin\ + /usr/local/share/stepmake/bin\ + /usr/local/lib/stepmake/bin\ + /usr/share/stepmake/bin\ + /usr/lib/stepmake/bin\ + stepmake/bin\ + $srcdir/\ + $HOME/usr/local/share/stepmake/bin\ + $HOME/usr/local/lib/stepmake/bin\ + $HOME/usr/share/stepmake/bin\ + $HOME/usr/lib/stepmake/bin\ + /usr/local/share/stepmake/bin\ + /usr/local/lib/stepmake/bin\ + /usr/share/stepmake/bin\ + /usr/lib/stepmake/bin\ + stepmake/bin\ + ; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" @@ -645,7 +680,27 @@ for ac_dir in stepmake/bin $srcdir/stepmake/bin; do fi done if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in stepmake/bin $srcdir/stepmake/bin" 1>&2; exit 1; } + { echo "configure: error: can not find install-sh or install.sh in \ + $HOME/usr/local/share/stepmake/bin\ + $HOME/usr/local/lib/stepmake/bin\ + $HOME/usr/share/stepmake/bin\ + $HOME/usr/lib/stepmake/bin\ + /usr/local/share/stepmake/bin\ + /usr/local/lib/stepmake/bin\ + /usr/share/stepmake/bin\ + /usr/lib/stepmake/bin\ + stepmake/bin\ + $srcdir/\ + $HOME/usr/local/share/stepmake/bin\ + $HOME/usr/local/lib/stepmake/bin\ + $HOME/usr/share/stepmake/bin\ + $HOME/usr/lib/stepmake/bin\ + /usr/local/share/stepmake/bin\ + /usr/local/lib/stepmake/bin\ + /usr/share/stepmake/bin\ + /usr/lib/stepmake/bin\ + stepmake/bin\ + " 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub @@ -656,6 +711,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + cat >> confdefs.h </dev/null` if test "x$STATE_VECTOR" != "x"; then STATE_VECTOR="\$(depth)/$STATE_VECTOR" @@ -705,7 +757,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:709: checking host system type" >&5 +echo "configure:761: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -730,7 +782,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:734: checking for $ac_word" >&5 +echo "configure:786: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -764,7 +816,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:768: checking for $ac_word" >&5 +echo "configure:820: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -801,7 +853,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:805: checking for $ac_word" >&5 +echo "configure:857: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -835,7 +887,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:839: checking for $ac_word" >&5 +echo "configure:891: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_BASH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -868,7 +920,7 @@ test -n "$BASH" || BASH="/bin/sh" # Extract the first word of "${PYTHON:-python}", so it can be a program name with args. set dummy ${PYTHON:-python}; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:872: checking for $ac_word" >&5 +echo "configure:924: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PYTHON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -937,14 +989,14 @@ fi DOTEXE=.exe DIRSEP='\\' PATHSEP=';' - INSTALL="\$(stepdir)/../bin/install-dot-exe.sh -c" + INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c" else DIRSEP='/' PATHSEP=':' LN=ln LN_S='ln -s' ZIP="zip -r -9" - INSTALL="\$(stepdir)/../bin/install-sh -c" + INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c" fi @@ -1084,7 +1136,7 @@ EOF # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1088: checking for $ac_word" >&5 +echo "configure:1140: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1113,7 +1165,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1117: checking for $ac_word" >&5 +echo "configure:1169: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1161,7 +1213,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1165: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1217: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1171,11 +1223,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1195,12 +1247,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1199: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1251: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1204: checking whether we are using GNU C" >&5 +echo "configure:1256: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1209,7 +1261,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1224,7 +1276,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1228: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1280: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1265,20 +1317,12 @@ fi # AC_HAVE_HEADERS(limits.h malloc.h string.h unistd.h values.h) printing_b=no -guile_b=no # Check whether --enable-printing or --disable-printing was given. if test "${enable_printing+set}" = set; then enableval="$enable_printing" printing_b=$enableval fi -# Check whether --enable-guile or --disable-guile was given. -if test "${enable_guile+set}" = set; then - enableval="$enable_guile" - guile_b=$enableval -fi - - if test "$optimise_b" = yes; then DEFINES="$DEFINES -DSTRING_UTILS_INLINED" @@ -1289,7 +1333,7 @@ EOF fi echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:1293: checking how to run the C++ preprocessor" >&5 +echo "configure:1337: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1302,12 +1346,12 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1355: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1338,7 +1382,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1342: checking for $ac_word" >&5 +echo "configure:1386: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1369,7 +1413,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1373: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1417: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1379,11 +1423,11 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1403,12 +1447,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1407: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1451: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1412: checking whether we are using GNU C++" >&5 +echo "configure:1456: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1417,7 +1461,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1432,7 +1476,7 @@ if test $ac_cv_prog_gxx = yes; then ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1436: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1480: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1462,17 +1506,17 @@ fi ac_safe=`echo "FlexLexer.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for FlexLexer.h""... $ac_c" 1>&6 -echo "configure:1466: checking for FlexLexer.h" >&5 +echo "configure:1510: checking for FlexLexer.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1522,12 +1566,12 @@ fi echo $ac_n "checking whether explicit instantiation is needed""... $ac_c" 1>&6 -echo "configure:1526: checking whether explicit instantiation is needed" >&5 +echo "configure:1570: checking whether explicit instantiation is needed" >&5 if eval "test \"`echo '$''{'lily_cv_need_explicit_instantiation'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < struct foo { static int baz; }; @@ -1537,7 +1581,7 @@ int main() { return foo::baz; ; return 0; } EOF -if { (eval echo configure:1541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* lily_cv_need_explicit_instantiation=no else @@ -1564,7 +1608,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1568: checking for $ac_word" >&5 +echo "configure:1612: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1606,7 +1650,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1610: checking for $ac_word" >&5 +echo "configure:1654: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1640,7 +1684,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1644: checking for $ac_word" >&5 +echo "configure:1688: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1707,7 +1751,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1711: checking for $ac_word" >&5 +echo "configure:1755: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1739,7 +1783,7 @@ test -n "$AR" || AR="error" # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1743: checking for $ac_word" >&5 +echo "configure:1787: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1794,7 +1838,7 @@ fi echo $ac_n "checking language""... $ac_c" 1>&6 -echo "configure:1798: checking language" >&5 +echo "configure:1842: checking language" >&5 case "$language" in En* | en* | Am* | am* | US* | us*) lang=English;; @@ -1830,7 +1874,7 @@ EOF echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:1834: checking for gettext in -lintl" >&5 +echo "configure:1878: checking for gettext in -lintl" >&5 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1838,7 +1882,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1882,12 +1926,12 @@ fi for ac_func in gettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1886: checking for $ac_func" >&5 +echo "configure:1930: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1945,7 +1989,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1949: checking for $ac_word" >&5 +echo "configure:1993: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1975,7 +2019,7 @@ done test -n "$MSGFMT" || MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh " echo $ac_n "checking whether msgfmt accepts -o""... $ac_c" 1>&6 -echo "configure:1979: checking whether msgfmt accepts -o" >&5 +echo "configure:2023: checking whether msgfmt accepts -o" >&5 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`" if test "$msgfmt_output" = ""; then echo "$ac_t""yes" 1>&6 @@ -2002,7 +2046,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2006: checking for $ac_word" >&5 +echo "configure:2050: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_METAFONT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2037,7 +2081,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2041: checking for $ac_word" >&5 +echo "configure:2085: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MFONT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2074,7 +2118,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2078: checking for $ac_word" >&5 +echo "configure:2122: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_METAPOST'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2109,7 +2153,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2113: checking for $ac_word" >&5 +echo "configure:2157: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MPOST'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2152,7 +2196,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2156: checking for $ac_word" >&5 +echo "configure:2200: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIPROFF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2186,7 +2230,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2190: checking for $ac_word" >&5 +echo "configure:2234: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2220,7 +2264,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2224: checking for $ac_word" >&5 +echo "configure:2268: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2HTML'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2254,7 +2298,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2258: checking for $ac_word" >&5 +echo "configure:2302: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2LATEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2287,7 +2331,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2291: checking for $ac_word" >&5 +echo "configure:2335: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2MAN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2321,7 +2365,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2325: checking for $ac_word" >&5 +echo "configure:2369: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2MSLESS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2355,7 +2399,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2359: checking for $ac_word" >&5 +echo "configure:2403: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2TEXINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2389,7 +2433,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2393: checking for $ac_word" >&5 +echo "configure:2437: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2TXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2418,6 +2462,7 @@ test -n "$YODL2TXT" && break done test -n "$YODL2TXT" || YODL2TXT="-echo no yodl" + YODL2LESS_DIR='$(bindir)/' else @@ -2427,6 +2472,7 @@ test -n "$YODL2TXT" || YODL2TXT="-echo no yodl" + export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT fi if test "x$YODL" = "-echo no yodl"; then @@ -2437,12 +2483,10 @@ test -n "$YODL2TXT" || YODL2TXT="-echo no yodl" fi - - -case $guile_b in - yes) + # urg, must check for different functions in libguile + # to force new check iso reading from cache echo $ac_n "checking for scm_shell in -lguile""... $ac_c" 1>&6 -echo "configure:2446: checking for scm_shell in -lguile" >&5 +echo "configure:2490: checking for scm_shell in -lguile" >&5 ac_lib_var=`echo guile'_'scm_shell | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2450,7 +2494,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lguile $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + \ + LIBS="-lguile $LIBS" cat >> confdefs.h <<\EOF +#define HAVE_LIBGUILE 1 +EOF + +else + echo "$ac_t""no" 1>&6 +\ + echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 +echo "configure:2536: checking for readline in -lreadline" >&5 +ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lreadline $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo readline | sed -e 's/^a-zA-Z0-9_/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + \ + echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 +echo "configure:2586: checking for dlopen in -ldl" >&5 +ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2479,7 +2619,57 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo guile | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/^a-zA-Z0-9_/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + \ + echo $ac_n "checking for scm_boot_guile in -lguile""... $ac_c" 1>&6 +echo "configure:2636: checking for scm_boot_guile in -lguile" >&5 +ac_lib_var=`echo guile'_'scm_boot_guile | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lguile $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo guile | sed -e 's/^a-zA-Z0-9_/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi +fi + + + - ;; -esac - echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:2500: checking for 8-bit clean memcmp" >&5 +echo "configure:2691: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2504,7 +2695,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -2535,12 +2726,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2539: checking for vprintf" >&5 +echo "configure:2730: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2590,12 +2781,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2594: checking for _doprnt" >&5 +echo "configure:2785: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -2648,12 +2839,12 @@ fi for ac_func in memmem snprintf vsnprintf gettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2652: checking for $ac_func" >&5 +echo "configure:2843: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2718,7 +2909,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2722: checking for $ac_word" >&5 +echo "configure:2913: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2888,13 +3079,13 @@ s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g +s%@stepmake@%$stepmake%g s%@package@%$package%g s%@PACKAGE@%$PACKAGE%g s%@PACKAGE_NAME@%$PACKAGE_NAME%g s%@package_depth@%$package_depth%g s%@AUTOGENERATE@%$AUTOGENERATE%g s%@absolute_builddir@%$absolute_builddir%g -s%@stepmake@%$stepmake%g s%@STATE_VECTOR@%$STATE_VECTOR%g s%@CONFIGSUFFIX@%$CONFIGSUFFIX%g s%@host@%$host%g @@ -2944,6 +3135,7 @@ s%@YODL2MAN@%$YODL2MAN%g s%@YODL2MSLESS@%$YODL2MSLESS%g s%@YODL2TEXINFO@%$YODL2TEXINFO%g s%@YODL2TXT@%$YODL2TXT%g +s%@YODL2LESS_DIR@%$YODL2LESS_DIR%g s%@LIBOBJS@%$LIBOBJS%g s%@MAKEINFO@%$MAKEINFO%g diff --git a/configure.in b/configure.in index 69f8966897..b0277039b6 100644 --- a/configure.in +++ b/configure.in @@ -16,14 +16,9 @@ AC_STEPMAKE_COMPILE # AC_HAVE_HEADERS(limits.h malloc.h string.h unistd.h values.h) printing_b=no -guile_b=no AC_ARG_ENABLE(printing, [ enable-printing turn on debug printing. Default: off], [printing_b=$enableval]) -AC_ARG_ENABLE(guile, - [ enable-guile link in GUILE. Default: off], - [guile_b=$enableval]) - if test "$optimise_b" = yes; then DEFINES="$DEFINES -DSTRING_UTILS_INLINED" @@ -42,19 +37,12 @@ AC_STEPMAKE_MSGFMT AC_STEPMAKE_TEXMF # AC_STEPMAKE_TEXMF_DIRS AC_STEPMAKE_YODL - +AC_STEPMAKE_GUILE dnl should check out -print dnl huh? dnl AC_CHECK_SEARCH_RESULT($FIND, find, Please use --enable-tex-dir) -case $guile_b in - yes) - AC_CHECK_LIB(guile, scm_shell) - - ;; -esac - AC_FUNC_MEMCMP AC_FUNC_VPRINTF AC_CHECK_FUNCS(memmem snprintf vsnprintf gettext) diff --git a/dstreamrc b/dstreamrc index d8e7b6a65b..2d4ef5938b 100644 --- a/dstreamrc +++ b/dstreamrc @@ -34,6 +34,7 @@ Beam 0 Bow 1 Bezier_bow 1 Change_iterator 1 +Change_translator 1 Chord 1 Chord_iterator 1 Clef_item 1 @@ -50,8 +51,10 @@ Engraver_group_engraver 0 General_script_def 1 Graphical_element 1 Group_change_req 1 +Guile 1 Head_column 0 Horizontal_align_item 1 +Horizontal_group_item 1 Idealspacing 1 Identifier 1 Ineq_constrained_qp 1 @@ -113,6 +116,7 @@ Symtable 1 Symtables 1 Text_def 1 +Text_item 1 Text_req 1 Time_description 1 Translation_property 0 diff --git a/init/GNUmakefile b/init/GNUmakefile index a9a23da2da..7b213816c7 100644 --- a/init/GNUmakefile +++ b/init/GNUmakefile @@ -8,10 +8,8 @@ INI_FILES = $(FLY_FILES) $(LY_FILES) INSTALLATION_DIR=$(datadir)/ly/ INSTALLATION_FILES=$(INI_FILES) +STEPMAKE_TEMPLATES=install LOCALSTEPMAKE_TEMPLATES=mutopia include $(depth)/make/stepmake.make - -include $(stepdir)/installfiles.make - diff --git a/init/declarations.ly b/init/declarations.ly index d28a53c62f..c1bc0fd333 100644 --- a/init/declarations.ly +++ b/init/declarations.ly @@ -35,5 +35,7 @@ nobreak = { \penalty = -10000; } \include "property.ly" +\include "scm.ly" + % music = "\melodic\relative c" diff --git a/init/scm.ly b/init/scm.ly new file mode 100644 index 0000000000..bd27dec6f4 --- /dev/null +++ b/init/scm.ly @@ -0,0 +1,341 @@ +% scm.ly -- implement Scheme output routines for TeX and PostScript +% +% source file of the GNU LilyPond music typesetter +% +% (c) 1998 Jan Nieuwenhuizen + +\scm " + +;;; graphical lisp element +(define (add-column p) (display \"adding column (in guile): \") (display p) (newline)) + +;;; library funtions +(define + (numbers->string l) + (apply string-append + (map (lambda (n) (string-append (number->string n) \" \")) l))) + +(define (number->octal-string x) + (let* ((n (inexact->exact x)) + (n64 (quotient n 64)) + (n8 (quotient (- n (* n64 64)) 8))) + (string-append + (number->string n64) + (number->string n8) + (number->string (remainder (- n (+ (* n64 64) (* n8 8))) 8))))) + +(define (inexact->string x radix) + (let ((n (inexact->exact x))) + (number->string n radix))) + +(define + (number->dim-tex x) + (string-append + (number->string x) \"pt \")) + +(define + (control->string c) + (string-append + (string-append (number->string (car c)) \" \") + (string-append (number->string (cadr c)) \" \"))) + +(define + (invoke-output o s) + (eval-string (string-append s \"-\" o))) + +;;; output definitions +(define + (char o n) + ((invoke-output o \"char\") n)) + +(define + (char-ps n) + (string-append + \"(\\\\\" (inexact->string n 8) \") show\")) + +(define + (char-tex n) + (string-append + \"\\\\char\" (inexact->string n 10))) + +(define + (dashed-slur o thick dash l) + ((invoke-output o \"dashed-slur\") thick dash l)) + +(define + (dashed-slur-ps thick dash l) + (string-append + (apply string-append (map control->string l)) + (number->string thick) + \" [ \" + (if (> 1 dash) (number->string (- (* thick dash) thick)) \"0\") \" \" + (number->string (* 2 thick)) + \" ] 0 draw_dashed_slur\")) + +(define + (dashed-slur-tex thick dash l) + (string-append + \"\\\\embeddedps{\" + (dashed-slur-ps thick dash l) + \"}\")) + +(define + (empty o) + ((invoke-output o \"empty\"))) + +(define + (empty-ps) + \"\n empty\n\") + +(define + (empty-tex) + \"%\n\\\\empty%\n\") + +(define + (end-output o) + ((invoke-output o \"end-output\"))) + +(define + (end-output-ps) + \"\nshowpage\n\") + +(define + (end-output-tex) + \"\n\\\\EndLilyPondOutput\") + +(define + (experimental-on o) + ((invoke-output o \"experimental-on\"))) + +(define + (experimental-on-ps) \"\") + +(define + (experimental-on-tex) \"\\\\turnOnExperimentalFeatures\") + +(define + (finishbar o h) (empty o)) + +(define + (font i) + (string-append + \"font\" + (make-string 1 (integer->char (+ (char->integer #\\A) i))) + )) + +(define + (font-def o i s) + (empty o)) +; ((invoke-output o \"font-def\") i s)) + +(define + (font-def-ps i s) + (string-append + \"\n/\" (font i) \" {/\" + (substring s 0 (- (string-length s) 3)) + \" findfont 12 scalefont setfont} bind def\n\")) + +(define + (font-def-tex i s) + (string-append + \"\\\\font\" (font-switch-tex i) \"=\" s \"\n\")) + +(define + (font-switch o i) + ((invoke-output o \"font-switch\") i)) + +(define + (font-switch-ps i) + (string-append (font i) \" \")) + +(define + (font-switch-tex i) + (string-append + \"\\\\\" (font i) \"\n\")) + +(define + (generalmeter o num den) + ((invoke-output o \"generalmeter\") num den)) + +(define + (generalmeter-ps num den) + (string-append num \" \" den \" generalmeter \")) + +(define + (generalmeter-tex num den) + (string-append + \"\\\\generalmeter{\" num \"}{\" den \"}\")) + +(define + (header o creator generate) + ((invoke-output o \"header\") creator generate)) + +(define + (header-ps creator generate) + (string-append + \"%!PS-Adobe-3.0\n\" + \"%%Creator: \" creator generate \"\n\")) + +(define + (header-tex creator generate) + (string-append + \"%created by: \" creator generate \"\n\")) + +(define + (header-end o) + ((invoke-output o \"header-end\"))) + +(define + (header-end-ps) \"\") + +(define + (header-end-tex) \"\\\\turnOnPostScript\") + +(define + (lily-def o key val) + ((invoke-output o \"lily-def\") key val)) + +(define + (lily-def-ps key val) + (string-append + \"/\" key \" {\" val \"} bind def\n\")) + +(define + (lily-def-tex key val) + (string-append + \"\\\\def\\\\\" key \"{\" val \"}\n\")) + +(define + (maatstreep o h) + ((invoke-output o \"maatstreep\") h)) + +(define + (maatstreep-ps h) + (string-append + (number->string h) \" maatstreep \" )) + +(define + (maatstreep-tex h) + (string-append + \"\n\\\\maatstreep{\" (number->dim-tex h) \"}\")) + +(define + (pianobrace o h) (empty o)) + +(define + (placebox o x y b) + ((invoke-output o \"placebox\") x y (b o))) + +(define + (placebox-ps x y s) + (string-append + (number->string x) \" \" (number->string y) \" {\" s \"} placebox \")) + +(define + (placebox-tex x y s) + (string-append + \"\\\\placebox{\" + (number->dim-tex y) \"}{\" (number->dim-tex x) \"}{\" s \"}\")) + +(define + (repeatbar o h) (empty o)) + +(define + (rulesym o x y) + ((invoke-output o \"rulesym\") x y)) + +(define + (rulesym-ps x y) + (string-append + (number->string x) \" \" + (number->string y) \" \" + \"rulesym\")) + +(define + (rulesym-tex x y) + (string-append + \"\\\\rulesym{\" (number->dim-tex x) \"}{\" (number->dim-tex y) \"}\")) + +(define + (setitalic o s) (empty o)) + +(define + (settext o s) (empty o)) + +(define + (slur o l) + ((invoke-output o \"slur\") l)) + +(define + (slur-ps l) + (string-append + (apply string-append (map control->string l)) + \" draw_slur\")) + +(define + (slur-tex l) + (string-append + \"\\\\embeddedps{\" + (slur-ps l) + \"}\")) + +(define + (stem o kern width height depth) + ((invoke-output o \"stem\") kern width height depth)) + +(define + (stem-ps kern width height depth) + (string-append (numbers->string (list kern width height depth)) + \"draw_stem\" )) + +(define + (stem-tex kern width height depth) + (string-append + \"\\\\kern\" (number->dim-tex kern) + \"\\\\vrule width \" (number->dim-tex width) + \"depth \" (number->dim-tex depth) + \"height \" (number->dim-tex height) \" \")) + +(define + (start-line o) + ((invoke-output o \"start-line\"))) + +(define + (start-line-ps) + (string-append + (urg-fix-font-ps) + \"\nstart_line {\n\")) + +(define + (start-line-tex) + (string-append + (urg-fix-font-tex) + \"\\\\hbox{%\n\")) + +(define + (stop-line o) + ((invoke-output o \"stop-line\"))) + +(define + (stop-line-ps) + \"}\nstop_line\n\") + +(define + (stop-line-tex) + \"}\\\\interscoreline\") + +(define + (urg-fix-font-ps) + \"/fontA { /feta20 findfont 12 scalefont setfont} bind def fontA\n\") + +(define + (urg-fix-font-tex) + \"\\\\font\\\\fontA=feta20.afm\\\\fontA\n\") + +(define + (urg-font-switch-ps i) + \"\n/feta20 findfont 12 scalefont setfont \n\") + +"; + + diff --git a/init/script.ly b/init/script.ly index 2a7cd50bcc..7c96a45122 100644 --- a/init/script.ly +++ b/init/script.ly @@ -3,6 +3,7 @@ % indexstring follow_into_staff same_dir_as_stem above_below_staff symbol_can_beinverted priority } % +thumb = \script { "thumb" 0 0 1 0 0 } accent = \script { "sforzato" 0 -1 0 0 0 } marcato = \script { "marcato" 0 -1 0 1 0 } staccatissimo = \script { "staccatissimo" 0 -1 0 1 0 } diff --git a/input/GNUmakefile b/input/GNUmakefile index ad59365a5b..16b785ec2d 100644 --- a/input/GNUmakefile +++ b/input/GNUmakefile @@ -5,7 +5,7 @@ depth = .. SUBDIRS=test bugs examples=example-3 twinkle-pop praeludium-fuga-E twinkle -flexamples=example-1 example-2 +flexamples=example-1 example-2 LOCALSTEPMAKE_TEMPLATES=mutopia diff --git a/input/test/thumb.ly b/input/test/thumb.ly new file mode 100644 index 0000000000..7b4a3a3807 --- /dev/null +++ b/input/test/thumb.ly @@ -0,0 +1,22 @@ +\header{ + title="CELLO-THUMBS"; + enteredby="Maarten Storm"; +} + + +% the thumb-script is used in cello music to indicate a note that should +% be played with your thumb. + +\version "1.0.7"; + +\score { \notes \relative c'' { + <[ a8_\thumb a'8-3(> <)b_\thumb b'-3> + <)d_\thumb d'-3]> + } + \paper{ + linewidth = 80.\mm; + castingalgorithm = \Wordwrap; + } +} + + diff --git a/lily/atom.cc b/lily/atom.cc index 76b59197d3..2d8f11e78e 100644 --- a/lily/atom.cc +++ b/lily/atom.cc @@ -29,7 +29,7 @@ Atom::check_infinity_b ()const if (abs (off_[ax]) >= 100 CM) { warning (_f ("ridiculous dimension: %s, %s", axis_name_str (ax), - global_lookup_l->print_dimen (off_[ax]))); + print_dimen (off_[ax]))); if (experimental_features_global_b) assert (false); @@ -76,12 +76,14 @@ Atom::Atom () But Atom is used as a simple type *everywhere*, and we don't have virtual contructors. */ - str_ = global_lookup_l->unknown_str (); + lambda_ = 0; + str_ = "unknown\n"; } Atom::Atom (String s, Box b) : dim_ (b) { + lambda_ = 0; str_ = s; } diff --git a/lily/dimensions.cc b/lily/dimensions.cc new file mode 100644 index 0000000000..1023450ee4 --- /dev/null +++ b/lily/dimensions.cc @@ -0,0 +1,19 @@ +// dimensions.cc + +#include "dimensions.hh" +#include "debug.hh" +#include "string.hh" + +String +print_dimen (Real r) +{ + String s = to_str (r, "%.3f"); + if (s.index_i ("NaN") != -1) + { + warning (_ ("NaN")); + s = "0.0"; + } + s += "pt"; + return s; +} + diff --git a/lily/include/atom.hh b/lily/include/atom.hh index 0d88e7ce31..f9621382bc 100644 --- a/lily/include/atom.hh +++ b/lily/include/atom.hh @@ -9,17 +9,19 @@ #ifndef ATOM_HH #define ATOM_HH +#include "lily-guile.hh" #include "string.hh" #include "box.hh" #include "lily-proto.hh" - /// a symbol which can be translated, and freely copied class Atom { Offset off_; public: + // urg, only used as a temp buffer String str_; String font_; + SCM lambda_; Box dim_; Offset offset () const; diff --git a/lily/include/dimensions.hh b/lily/include/dimensions.hh index 777d80e89c..65629f03d5 100644 --- a/lily/include/dimensions.hh +++ b/lily/include/dimensions.hh @@ -14,5 +14,7 @@ const Real PT_TO_PT =1.0; #define CM *CM_TO_PT #define INCH *INCH_TO_PT +String print_dimen (Real); + #endif // DIMENSIONS_HH diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 1ea707038e..56ce820c7e 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -11,6 +11,10 @@ #include "config.hh" +#ifdef __cplusplus +extern "C" { +#endif + #ifdef HAVE_LIBGUILE extern "C" { #include @@ -18,4 +22,22 @@ extern "C" { #else typedef long SCM; #endif + +SCM ly_append (SCM a, SCM b); +SCM ly_eval (SCM a); +SCM ly_func_o (char const* name); +SCM ly_lambda_o (); +SCM ly_list1 (SCM a); +SCM ly_list2(SCM a, SCM b); +SCM ly_quote (); + +#ifdef __cplusplus +} +#endif + +#include "array.hh" +#include "scalar.hh" +SCM lambda_scm (String str, Array args_arr); +SCM lambda_scm (String str, Array args_arr); + #endif // LILY_GUILE_HH diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 7efe60bb7e..6b7047651d 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -27,53 +27,33 @@ public: Lookup (); Lookup (Lookup const&); Lookup (Symtables const&); - virtual ~Lookup (); + ~Lookup (); Atom accidental (int) const; void add (String, Symtable*); - virtual Atom afm_find (String s) const = 0; - Atom afm_find (String, String) const; - virtual Atom* atom_p (String, int, Box) const = 0; + Atom afm_find (String) const; Atom ball (int) const; Atom bar (String, Real height) const; - String base_output_str () const; Atom beam (Real,Real, Real) const; - virtual String character_str (int i) const; Atom clef (String) const; - virtual Atom dashed_slur (Array controls, Real thick, Real dash) const = 0; + Atom dashed_slur (Array controls, Real thick, Real dash) const; Atom dots () const; Atom dynamic (String) const; Atom fill (Box b) const; Atom flag (int, Direction) const; - virtual Atom hairpin (Real width, bool decresc, bool continued) const = 0; - virtual Lookup* lookup_p (Lookup const&) const = 0; - virtual Lookup* lookup_p (Symtables const&) const = 0; - virtual Paper_outputter* paper_outputter_p (Paper_stream*, Paper_def*, Scope*, String) const = 0; - virtual Paper_stream* paper_stream_p () const = 0; - virtual Atom plet (Real dy, Real dx, Direction dir) const = 0; + Atom hairpin (Real width, bool decresc, bool continued) const; + Atom plet (Real dy, Real dx, Direction dir) const; void print () const; - virtual Atom ps_beam (Real slope, Real width, Real thick) const = 0; - virtual String print_dimen (Real) const; + Atom ps_beam (Real slope, Real width, Real thick) const; Atom rest (int, bool outside) const; Atom rule_symbol (Real height, Real width) const; Atom script (String idx) const; - /** paratime_signature substitution in lookup strings. - this function provides a simple macro mechanism: - - if source == "tex%bla%", then - substitute_args (source, {"X","Y"}) == "texXblaY" - */ - String substitute_args (String source, Array args) const; - /// paratime_signature substitution in lookup strings - String substitute_args (String source, Array args) const; - virtual Atom stem (Real y1_pos, Real y2_pos) const = 0; - Atom stem (Real y1_pos, Real y2_pos, String) const; - virtual Atom slur (Array controls) const = 0; + Atom stem (Real y1_pos, Real y2_pos) const; + Atom slur (Array controls) const; Atom streepje (int type) const; - virtual Atom text (String style, String text) const; - virtual String unknown_str () const = 0; + Atom text (String style, String text) const; Atom vbrace (Real &dy) const; - virtual Atom vbracket (Real &dy) const = 0; + Atom vbracket (Real &dy) const; Atom special_time_signature (String, Array) const; Atom time_signature (Array) const; diff --git a/lily/include/main.hh b/lily/include/main.hh index 072813b2f1..68b1b21363 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -24,7 +24,7 @@ extern bool no_timestamps_global_b; extern bool find_quarts_global_b; extern int exit_status_i_; extern bool experimental_features_global_b; -extern Lookup* global_lookup_l; +extern char const* output_global_ch; extern bool dependency_global_b; extern bool version_ignore_global_b; diff --git a/lily/include/paper-def.hh b/lily/include/paper-def.hh index 87bfe54573..0ae3a6981e 100644 --- a/lily/include/paper-def.hh +++ b/lily/include/paper-def.hh @@ -38,7 +38,6 @@ class Paper_def : public Music_output_def { Assoc *lookup_p_assoc_p_; static int default_count_i_; - bool ps_b_; protected: VIRTUAL_COPY_CONS(Paper_def,Music_output_def); @@ -92,9 +91,12 @@ public: Real arithmetic_constant (Moment minimal_mom) const; Real arithmetic_spacing (Moment mom,Real constant) const; virtual int get_next_default_count () const; - //urg - String tex_output_settings_str () const; - String ps_output_settings_str () const; + + void output_settings (Paper_outputter*) const; + Paper_outputter* paper_outputter_p (Paper_stream*, Scope*, String) const; + Paper_stream* paper_stream_p () const; + String base_output_str () const; + // urg friend int yyparse (void*); }; diff --git a/lily/include/paper-outputter.hh b/lily/include/paper-outputter.hh index 5fa1204b2f..e88e6fa5c6 100644 --- a/lily/include/paper-outputter.hh +++ b/lily/include/paper-outputter.hh @@ -13,6 +13,7 @@ #include "lily-proto.hh" #include "array.hh" #include "string.hh" +#include "lily-guile.hh" /** Abstract interface for a Score_element to output itself. @@ -21,13 +22,18 @@ class Paper_outputter { public: Paper_outputter (Paper_stream *); - virtual ~Paper_outputter (); - - virtual void output_molecule (Molecule const *, Offset, char const *)=0; - void output_molecule (Molecule const *, Offset, char const *, String); - virtual void start_line ()=0; - virtual void stop_line ()=0; - virtual void switch_to_font (String fontname)=0; + ~Paper_outputter (); + + void output_font_def (int i, String str); + void output_font_switch (int i); + void output_header (); + void output_molecule (Molecule const *, Offset, char const *); + void output_comment (String s); + void output_scheme (SCM scm); + void output_string (String s); + void start_line (); + void stop_line (); + void switch_to_font (String fontname); Array font_arr_; String current_font_; diff --git a/lily/include/paper-stream.hh b/lily/include/paper-stream.hh index dc5b08541e..e5429511f6 100644 --- a/lily/include/paper-stream.hh +++ b/lily/include/paper-stream.hh @@ -21,13 +21,12 @@ public: /// open a file for writing Paper_stream (String filename); - virtual void header () = 0; /// delegate conversion to scalar class - virtual Paper_stream &operator <<(Scalar); + Paper_stream &operator <<(Scalar); /// close the file - virtual ~Paper_stream(); + ~Paper_stream(); private: Paper_stream (Paper_stream const&); diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc new file mode 100644 index 0000000000..daa7588554 --- /dev/null +++ b/lily/lily-guile.cc @@ -0,0 +1,99 @@ +/* + lily-guile.cc -- implement assorted guile functions + + source file of the GNU LilyPond music typesetter + + (c) 1998 Jan Nieuwenhuizen +*/ + +#include +#include "libc-extension.hh" +#include "lily-guile.hh" +#include "main.hh" + +#ifdef __cplusplus +extern "C" { +#endif + +SCM +ly_append (SCM a, SCM b) +{ + return gh_call2 (gh_eval_str ("append"), a, b); +} + +SCM +ly_list1 (SCM a) +{ + return gh_call1 (gh_eval_str ("list"), a); +} + +SCM +ly_list2(SCM a, SCM b) +{ + return gh_call2 (gh_eval_str ("list"), a, b); +} + +SCM +ly_quote () +{ + return gh_eval_str ("'quote"); +} + +SCM +ly_eval (SCM a) +{ + return gh_call1 (gh_eval_str ("eval"), a); +} + +SCM +ly_lambda_o () +{ + return gh_eval_str ("'(lambda (o))"); +} + +SCM +ly_func_o (char const* name) +{ + char buf[200]; + snprintf (buf, 200, "'(%s o)", name); + return gh_eval_str (buf); +} + +#ifdef __cplusplus +} +#endif + +SCM +lambda_scm (String str, Array args_arr) +{ + if (str.empty_b ()) + { + str = "empty"; + args_arr.clear (); + } + SCM args_scm = SCM_EOL; + for (int i = args_arr.size () - 1; i >= 0; i--) + args_scm = gh_cons (gh_str02scm (args_arr[i].ch_l ()), args_scm); + SCM scm = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o (str.ch_l ()), args_scm))); + return scm; +} + +SCM +lambda_scm (String str, Array args_arr) +{ + if (str.empty_b ()) + { + str = "empty"; + args_arr.clear (); + } + SCM args_scm = SCM_EOL; + for (int i = args_arr.size () - 1; i >= 0; i--) + args_scm = gh_cons (gh_double2scm (args_arr[i]), args_scm); + SCM scm = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o (str.ch_l ()), args_scm))); + return scm; +} + diff --git a/lily/lookup.cc b/lily/lookup.cc index 8ba88483f5..9d85d63ba9 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -20,6 +20,7 @@ #include "paper-def.hh" #include "string-convert.hh" #include "main.hh" +#include "lily-guile.hh" Lookup::Lookup () { @@ -65,7 +66,7 @@ Lookup::add (String s, Symtable*p) } Atom -Lookup::afm_find (String s, String str) const +Lookup::afm_find (String s) const { if (!afm_p_) { @@ -83,7 +84,9 @@ Lookup::afm_find (String s, String str) const a.dim_ = m.B_; a.dim_[X_AXIS] *= 1 / 1000.0; a.dim_[Y_AXIS] *= 1 / 1000.0; - a.str_ = String_convert::form_str (str.ch_C (), m.code ()); + Array arr; + arr.push (m.code ()); + a.lambda_ = lambda_scm ("char", arr); a.font_ = font_; return a; } @@ -100,29 +103,13 @@ Lookup::ball (int j) const Atom Lookup::bar (String str, Real h) const { - Array a; - a.push (print_dimen (h)); - Atom s = (*symtables_p_) ("bars")->lookup (str); - s.str_ = substitute_args (s.str_, a); - s.dim_.y () = Interval (-h/2, h/2); - s.font_ = font_; - return s; -} - -String -Lookup::base_output_str () const -{ - assert (paper_l_); - String str = paper_l_->get_default_output (); - - if (str.empty_b ()) - { - str = default_outname_base_global; - int def = paper_l_->get_next_default_count (); - if (def) - str += "-" + to_str (def); - } - return str; + Array arr; + arr.push (h); + Atom a = (*symtables_p_) ("bars")->lookup (str); + a.lambda_ = lambda_scm (a.str_, arr); + a.dim_.y () = Interval (-h/2, h/2); + a.font_ = font_; + return a; } Atom @@ -138,16 +125,38 @@ Lookup::beam (Real slope, Real width, Real thick) const return a; } -String -Lookup::character_str (int i) const +Atom +Lookup::clef (String st) const { - return to_str (i); + return afm_find (String ("clefs") + String ("-") + st); } Atom -Lookup::clef (String st) const +Lookup::dashed_slur (Array controls, Real thick, Real dash) const { - return afm_find (String ("clefs") + String ("-") + st); + assert (controls.size () == 8); + + Real dx = controls[3].x () - controls[0].x (); + Real dy = controls[3].y () - controls[0].y (); + + Atom a; + a.font_ = font_; + a.dim_[X_AXIS] = Interval (0, dx); + a.dim_[Y_AXIS] = Interval (0 ? dy); + + // (lambda (o) (dashed-slur o '((0.1 0.2) (1.1 1.2) (2.1 2.2) (3.1 3.2)))) + a.lambda_ = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o ("dashed-slur"), + gh_cons (gh_double2scm (thick), gh_cons (gh_double2scm (dash), + ly_list1 (ly_list2 (ly_quote (), + gh_cons (ly_list2 (gh_double2scm (controls[1].x ()), gh_double2scm (controls[1].y ())), + gh_cons (ly_list2 (gh_double2scm (controls[2].x ()), gh_double2scm (controls[2].y ())), + gh_cons (ly_list2 (gh_double2scm (controls[3].x ()), gh_double2scm (controls[3].y ())), + gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())), + SCM_EOL))))))))))); + + return a; } Atom @@ -187,18 +196,6 @@ Lookup::print () const #endif } -String -Lookup::print_dimen (Real r) const -{ - String s = to_str (r, "%.3f"); - if (s.index_i ("NaN") != -1) - { - warning (_ ("NaN")); - s = "0.0"; - } - return s; -} - Atom Lookup::rest (int j, bool o) const { @@ -210,10 +207,10 @@ Atom Lookup::rule_symbol (Real height, Real width) const { Atom bs= (*symtables_p_) ("param")->lookup ("rule"); - Array args; - args.push (print_dimen (height)); - args.push (print_dimen (width)); - bs.str_ = substitute_args (bs.str_, args); + Array args; + args.push (height); + args.push (width); + bs.lambda_ = lambda_scm (bs.str_, args); bs.dim_.x () = Interval (0, width); bs.dim_.y () = Interval (0, height); return bs; @@ -228,8 +225,9 @@ Lookup::script (String str) const Atom Lookup::special_time_signature (String s, Array arr) const { +#if 0 String symbolname = "timesig-"+s+"%/%"; - Atom a (afm_find (substitute_args (symbolname, arr))); + Atom a (afm_find (lambda_scm (symbolname, arr))); if (!a.empty ()) return a; // Try if the full name was given @@ -237,39 +235,12 @@ Lookup::special_time_signature (String s, Array arr) const if (!a.empty ()) return a; // Resort to default layout with numbers +#endif return time_signature (arr); } -static void -substitute_arg (String& r, String arg) -{ - int p = r.index_i ('%'); - if (p < 0) - return ; - - r = r.left_str (p) + arg + r.right_str (r.length_i () - p - 1); -} - -String -Lookup::substitute_args (String source, Array args) const -{ - String str (source); - for (int i = 0 ; i < args.size (); i++) - substitute_arg (str, args[i]); - return str; -} - -String -Lookup::substitute_args (String source, Array args) const -{ - Array sv; - for (int i = 0 ; i < args.size (); i++) - sv.push (args[i]); - return substitute_args (source, sv); -} - Atom -Lookup::stem (Real y1, Real y2, String str) const +Lookup::stem (Real y1, Real y2) const { if (y1 > y2) { @@ -282,15 +253,15 @@ Lookup::stem (Real y1, Real y2, String str) const s.dim_.x () = Interval (0,0); s.dim_.y () = Interval (y1,y2); - Array a; + Array a; Real stem_width = paper_l_->get_var ("stemthickness"); - a.push (print_dimen (-stem_width /2)); - a.push (print_dimen (stem_width)); - a.push (print_dimen (y2)); - a.push (print_dimen (-y1)); + a.push (-stem_width /2); + a.push (stem_width); + a.push (y2); + a.push (-y1); - s.str_ = substitute_args (str, a); + s.lambda_ = lambda_scm ("stem", a); s.font_ = font_; return s; } @@ -307,11 +278,11 @@ Lookup::streepje (int type) const Atom Lookup::text (String style, String text) const { - Array a; + Array a; a.push (text); Atom s = (*symtables_p_) ("style")->lookup (style); - s.str_ = substitute_args (s.str_,a); + s.lambda_ = lambda_scm (s.str_, a); s.font_ = font_; return s; @@ -321,7 +292,7 @@ Atom Lookup::time_signature (Array a) const { Atom s ((*symtables_p_) ("param")->lookup ("time_signature")); - s.str_ = substitute_args (s.str_, a); + s.lambda_ = lambda_scm (s.str_, a); return s; } @@ -354,16 +325,112 @@ Lookup::vbrace (Real &y) const int idx = int (rint ( (y- min_y)/step)) + 1; - { - Array a; - a.push (character_str (idx)); - brace.str_ = substitute_args (brace.str_,a); - brace.dim_[Y_AXIS] = Interval (-y/2,y/2); - } + Array a; + a.push (idx); + brace.lambda_ = lambda_scm (brace.str_, a); + brace.dim_[Y_AXIS] = Interval (-y/2,y/2); brace.font_ = font_; return brace; } +Atom +Lookup::hairpin (Real width, bool decresc, bool continued) const +{ + Atom a; + Real height = paper_l_->staffheight_f () / 6; + String ps; + ps += to_str (width) + " " + + to_str (height) + " " + + to_str (continued ? height/2 : 0) + + + " draw_" + String (decresc ? "de" : "") + "cresc\n"; + a.str_ = ps; + + + a.dim_.x () = Interval (0, width); + a.dim_.y () = Interval (-2*height, 2*height); + a.font_ = font_; + return a; +} + +Atom +Lookup::plet (Real dy , Real dx, Direction dir) const +{ + String ps; + + + ps += String_convert::double_str (dx) + " " + + String_convert::double_str (dy) + " " + + String_convert::int_str ( (int)dir) + + " draw_plet "; + + Atom s; + s.str_ = ps; + return s; +} + +Atom +Lookup::ps_beam (Real slope, Real width, Real thick) const +{ + String ps; + ps += to_str (width) + " "+ to_str (slope) + " " + to_str (thick) + + " draw_beam "; + + Atom s; + s.str_ = ps; + return s; +} + +Atom +Lookup::slur (Array controls) const +{ + assert (controls.size () == 8); + + String ps; + + Real dx = controls[3].x () - controls[0].x (); + Real dy = controls[3].y () - controls[0].y (); + Atom a; + + // (lambda (o) (slur o '((0.1 0.2) (1.1 1.2) (2.1 2.2) (3.1 3.2) .. ))) + a.lambda_ = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o ("slur"), + ly_list1 (ly_list2 (ly_quote (), + gh_cons (ly_list2 (gh_double2scm (controls[5].x ()), gh_double2scm (controls[5].y ())), + gh_cons (ly_list2 (gh_double2scm (controls[6].x ()), gh_double2scm (controls[6].y ())), + gh_cons (ly_list2 (gh_double2scm (controls[7].x ()), gh_double2scm (controls[7].y ())), + gh_cons (ly_list2 (gh_double2scm (controls[4].x ()), gh_double2scm (controls[4].y ())), + gh_cons (ly_list2 (gh_double2scm (controls[1].x ()), gh_double2scm (controls[1].y ())), + gh_cons (ly_list2 (gh_double2scm (controls[2].x ()), gh_double2scm (controls[2].y ())), + gh_cons (ly_list2 (gh_double2scm (controls[3].x ()), gh_double2scm (controls[3].y ())), + gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())), + SCM_EOL))))))))))))); + + a.dim_[X_AXIS] = Interval (0, dx); + a.dim_[Y_AXIS] = Interval (0 ? dy); + a.font_ = font_; + return a; +} + +Atom +Lookup::vbracket (Real &y) const +{ + Atom a; + Real min_y = paper_l_->staffheight_f (); + if (y < min_y) + { + warning (_ ("bracket") + + " " + _ ("too small") + " (" + print_dimen (y) + ")"); +// y = min_y; + } + Array arr; + arr.push (y); + a.lambda_ = lambda_scm ("bracket", arr); + a.dim_[Y_AXIS] = Interval (-y/2,y/2); + a.dim_[X_AXIS] = Interval (0,4 PT); + return a; +} + diff --git a/lily/main.cc b/lily/main.cc index 5b541eb29f..d9a7a0afc0 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -10,6 +10,8 @@ #include #include #include +#include "lily-guile.hh" + #include "proto.hh" #include "dimensions.hh" #include "plist.hh" @@ -21,8 +23,6 @@ #include "config.hh" #include "file-results.hh" #include "debug.hh" -#include "ps-lookup.hh" -#include "tex-lookup.hh" #include "lily-guile.hh" #if HAVE_GETTEXT @@ -34,14 +34,15 @@ bool version_ignore_global_b = false; bool no_paper_global_b = false; bool no_timestamps_global_b = false; bool find_quarts_global_b = false; + +char const* output_global_ch = "tex"; +// temporarily default to ps, because tex is even more broken +//char const* output_global_ch = "ps"; + String default_outname_base_global = "lelie"; int default_count_global; File_path global_path; -Ps_lookup ps_lookup; -Tex_lookup tex_lookup; -Lookup* global_lookup_l = &tex_lookup; - bool experimental_features_global_b = false; bool dependency_global_b = false; @@ -63,6 +64,7 @@ Long_option_init theopts[] = { {0, "no-timestamps", 'T'}, {0, "find-fourths", 'Q'}, {0, "ignore-version", 'V'}, + {1, "output-format", 'f'}, {0,0,0} }; @@ -85,13 +87,16 @@ usage () " -d, --dependencies write Makefile dependencies for every input file\n" ); cout << _ ( - " -I, --include=DIR add DIR to search path\n" + " -h, --help this help\n" ); cout << _ ( - " -i, --init=FILE use FILE as init file\n" + " -f, --output-format=X use output format X\n" ); cout << _ ( - " -h, --help this help\n" + " -I, --include=DIR add DIR to search path\n" + ); + cout << _ ( + " -i, --init=FILE use FILE as init file\n" ); cout << _ ( " -M, --no-paper produce midi output only\n" @@ -186,15 +191,6 @@ identify () *mlog << get_version_str () << endl; } -void -guile_init () -{ -#ifdef HAVE_LIBGUILE - gh_eval_str ("(define (add-column p) (display \"adding column (in guile): \") (display p) (newline))"); -#endif -} - - void setup_paths () { @@ -237,11 +233,9 @@ setup_paths () } - -int +void main_prog (int argc, char **argv) { - guile_init (); identify (); call_constructors (); debug_init (); // should be first @@ -258,7 +252,7 @@ main_prog (int argc, char **argv) { case 't': experimental_features_global_b = true; - global_lookup_l = &ps_lookup; + *mlog << "*** enabling experimental features, you're on your own now ***\n"; break; case 'o': outname_str = oparser.optional_argument_ch_C_; @@ -267,6 +261,9 @@ main_prog (int argc, char **argv) notice (); exit (0); break; + case 'f': + output_global_ch = oparser.optional_argument_ch_C_; + break; case 'Q': find_quarts_global_b = true; break; @@ -344,8 +341,18 @@ main_prog (int argc, char **argv) default_outname_base_global = outname_str; do_one_file (i, default_outname_base_global); } +} +int +main (int argc, char **argv) +{ +#ifdef HAVE_LIBGUILE + gh_enter (argc, argv, (void(*)())main_prog); return exit_status_i_; +#else + main_prog (argc, argv); + return exit_status_i_; +#endif } /* @@ -385,19 +392,3 @@ distill_inname_str (String name_str, String& ext_r) return str; } - -#ifdef HAVE_LIBGUILE -int -main (int argc, char **argv) -{ - gh_enter (argc, argv, (void(*)())main_prog); - return exit_status_i_; -} - -#else -int main (int argc, char **argv) -{ - return main_prog (argc, argv); -} - -#endif diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index 82948a3067..4c7d05a9a2 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -55,6 +55,7 @@ static Keyword_ent the_key_tab[]={ {"pt", PT_T}, {"relative", RELATIVE}, {"remove", REMOVE}, + {"scm", SCHEME}, {"score", SCORE}, {"script", SCRIPT}, {"shape", SHAPE}, diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 8593add910..5ce8b04cd9 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -13,8 +13,6 @@ #include "paper-def.hh" #include "debug.hh" #include "lookup.hh" -#include "ps-lookup.hh" -#include "tex-lookup.hh" #include "assoc-iter.hh" #include "score-engraver.hh" #include "p-score.hh" @@ -22,6 +20,9 @@ #include "main.hh" #include "scope.hh" #include "dictionary-iter.hh" +#include "file-results.hh" // urg? header_global_p +#include "paper-outputter.hh" +#include "paper-stream.hh" Paper_def::Paper_def () { @@ -45,7 +46,7 @@ Paper_def::Paper_def (Paper_def const&s) lookup_p_assoc_p_ = new Assoc; for (Assoc_iter ai(*s.lookup_p_assoc_p_); ai.ok (); ai++) { - Lookup * l = global_lookup_l->lookup_p (*ai.val ()); + Lookup * l = new Lookup (*ai.val ()); l->paper_l_ = this; set_lookup (ai.key(), l); } @@ -209,35 +210,113 @@ Paper_def::lookup_l (int i) const IMPLEMENT_IS_TYPE_B1 (Paper_def, Music_output_def); -String -Paper_def::ps_output_settings_str () const +int Paper_def::default_count_i_ = 0; + +int +Paper_def::get_next_default_count () const { - String s ("\n "); - for (Dictionary_iter i (*scope_p_); i.ok (); i++) - s += String ("/mudelapaper") + i.key () - + "{" + i.val ()->str () + "} bind def\n"; - s += *scope_p_->elem ("pssetting")->access_String (); - return s; + return default_count_i_ ++; } -String -Paper_def::tex_output_settings_str () const +//urg +extern char const* lily_version_number_sz (); + +void +output_def (Paper_outputter* p, String key, String val) +{ + SCM args_scm = + gh_cons (gh_str02scm (key.ch_l ()), gh_cons (gh_str02scm (val.ch_l ()), SCM_EOL)); + SCM scm = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o ("lily-def"), args_scm))); + p->output_scheme (scm); +} + +void +output_header (Paper_outputter* p, Scope *head) +{ + if (!head) + return; + + String id_str = "Lily was here"; + if (no_timestamps_global_b) + id_str += "."; + else + id_str += String (", ") + lily_version_number_sz (); + output_def (p, "lily_id_string", id_str); + + for (Dictionary_iter i (*head); i.ok (); i++) + { + if (!i.val ()->access_String_identifier ()) + continue; + + String val = *i.val()->access_String_identifier ()->data_p_; + output_def (p, i.key (), val); + } +} + +void +Paper_def::output_settings (Paper_outputter* p) const { - String s ("\n "); for (Dictionary_iter i (*scope_p_); i.ok (); i++) - s += String ("\\def\\mudelapaper") + i.key () - + "{" + i.val ()->str () + "}\n"; - s += *scope_p_->elem ("texsetting")->access_String (); - return s; + output_def (p, String ("mudelapaper") + i.key (), i.val ()->str ()); + p->output_string (*scope_p_->elem (String (output_global_ch) + "setting")->access_String ()); } -int Paper_def::default_count_i_ = 0; +Paper_outputter* +Paper_def::paper_outputter_p (Paper_stream* os_p, Header* header_l, String origin_str) const +{ + Paper_outputter* p = new Paper_outputter (os_p); -int -Paper_def::get_next_default_count () const + output_header (p, header_global_p); + p->output_comment (_ ("outputting Score, defined at: ")); + p->output_comment (origin_str); + + output_header (p, header_l); + + output_settings (p); + + SCM scm = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o ("experimental-on"), SCM_EOL))); + + p->output_scheme (scm); + + scm = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o ("header-end"), SCM_EOL))); + + p->output_scheme (scm); + + return p; +} + +Paper_stream* +Paper_def::paper_stream_p () const { - return default_count_i_ ++; + String outname = base_output_str (); + + if (outname != "-") + outname += String (".") + output_global_ch; + *mlog << _f ("Paper output to %s...", + outname == "-" ? String ("") : outname ) << endl; + target_str_global_array.push (outname); + return new Paper_stream (outname); } +String +Paper_def::base_output_str () const +{ + String str = get_default_output (); + + if (str.empty_b ()) + { + str = default_outname_base_global; + int def = get_next_default_count (); + if (def) + str += "-" + to_str (def); + } + return str; +} diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 1e8d450c7b..9e2b0978a6 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -7,6 +7,7 @@ Jan Nieuwenhuizen */ +#include #include "paper-outputter.hh" #include "paper-stream.hh" #include "molecule.hh" @@ -20,14 +21,58 @@ Paper_outputter::Paper_outputter (Paper_stream *s) { outstream_l_ = s; + output_header (); } Paper_outputter::~Paper_outputter () { + SCM scm = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o ("end-output"), SCM_EOL))); + + output_scheme (scm); } void -Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm, String s) +Paper_outputter::output_header () +{ + String creator; + if (no_timestamps_global_b) + creator = "GNU LilyPond\n"; + else + creator = get_version_str (); + String generate; + if (no_timestamps_global_b) + generate = "."; + else + { + generate = _ (", at "); + time_t t (time (0)); + generate += ctime (&t); + //urg + } + + SCM args_scm = + gh_cons (gh_str02scm (creator.ch_l ()), + gh_cons (gh_str02scm (generate.ch_l ()), SCM_EOL)); + +#ifndef NPRINT + DOUT << "output_header\n"; + if (check_debug && !monitor->silent_b ("Guile")) + { + gh_display (args_scm); gh_newline (); + } +#endif + + SCM scm = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o ("header"), args_scm))); + + output_scheme (scm); +} + +void +Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm) { if (check_debug) *outstream_l_ << String ("\n%start: ") << nm << "\n"; @@ -37,15 +82,153 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm, St Offset a_off = i->offset (); a_off += o; + if (!i->lambda_) + { + // urg + i->lambda_ = + ly_append (ly_lambda_o (), + ly_list1 (ly_func_o ("empty"))); + } + switch_to_font (i->font_); - Array a; - String r; - - a.push (global_lookup_l->print_dimen (a_off.y())); - a.push (global_lookup_l->print_dimen (a_off.x())); - a.push (i->str_); - r += global_lookup_l->substitute_args (s, a); - *outstream_l_ << r; +#ifndef NPRINT + if (check_debug && !monitor->silent_b ("Guile")) + { + gh_display (i->lambda_); gh_newline (); + } +#endif + + SCM args_scm = + gh_cons (gh_double2scm (a_off.x ()), + gh_cons (gh_double2scm (a_off.y ()), + gh_cons (i->lambda_, SCM_EOL))); + +#ifndef NPRINT + if (check_debug && !monitor->silent_b ("Guile")) + { + gh_display (args_scm); gh_newline (); + } +#endif + + SCM box_scm = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o ("placebox"), args_scm))); + + output_scheme (box_scm); + } +} + +void +Paper_outputter::output_comment (String str) +{ + // urg + *outstream_l_ << "% " << str << "\n"; +} + + +void +Paper_outputter::output_scheme (SCM scm) +{ + String o = String ("\'") + output_global_ch; +#ifndef NPRINT + if (check_debug && !monitor->silent_b ("Guile")) + { + gh_display (scm); gh_newline (); } +#endif + SCM str_scm = gh_call1 (ly_eval (scm), gh_eval_str (o.ch_l ())); + char* c = gh_scm2newstr (str_scm, NULL); +#ifndef NPRINT + if (check_debug && !monitor->silent_b ("Guile")) + { + gh_display (str_scm); gh_newline (); + } +#endif + *outstream_l_ << c; + free (c); +} + +void +Paper_outputter::output_string (String str) +{ + // urg + *outstream_l_ << str; +} + +void +Paper_outputter::switch_to_font (String fontname) +{ + if (fontname.length_i () && (fontname != current_font_)) + { + current_font_ = fontname; + int i=0; + bool new_b = false; + for (; i< font_arr_.size (); i++) + if (font_arr_[i] == fontname) + { + new_b = true; + break; + } + + if (new_b) + { + font_arr_.push (fontname); + output_font_def (i, fontname); + } + output_font_switch (i); + } + return; +} + +void +Paper_outputter::start_line () +{ + SCM scm = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o ("start-line"), SCM_EOL))); + + output_scheme (scm); +} + +/* + 26 fonts ought to be enough for anyone. +*/ +void +Paper_outputter::output_font_def (int i, String str) +{ + //urg, broken with guile-1.3 + //return; + SCM scm = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o ("font-def"), + gh_cons (gh_int2scm (i), gh_cons (gh_str02scm (str.ch_l ()), SCM_EOL))))); + + output_scheme (scm); +} + +void +Paper_outputter::output_font_switch (int i) +{ + //urg, broken with guile-1.2, 1.3 + //return; + SCM scm = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o ("font-switch"), + gh_cons (gh_int2scm (i), SCM_EOL)))); + + output_scheme (scm); +} + +void +Paper_outputter::stop_line () +{ + SCM scm = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o ("stop-line"), SCM_EOL))); + + output_scheme (scm); + + current_font_ = ""; + font_arr_.clear (); } diff --git a/lily/paper-stream.cc b/lily/paper-stream.cc index 72d14a69b5..91ff01041c 100644 --- a/lily/paper-stream.cc +++ b/lily/paper-stream.cc @@ -7,7 +7,6 @@ */ #include -#include #include "main.hh" #include "paper-stream.hh" @@ -27,7 +26,6 @@ Paper_stream::Paper_stream (String filename) nest_level = 0; line_len_i_ = 0; outputting_comment=false; - // header (); } Paper_stream::~Paper_stream () @@ -99,6 +97,8 @@ Paper_stream::operator << (Scalar s) break; } } + //urg, for debugging only!! + *os << flush; return *this; } diff --git a/lily/parser.yy b/lily/parser.yy index bf82af8ec4..ccca7e4942 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -10,14 +10,13 @@ */ #include +#include "lily-guile.hh" #include "notename-table.hh" #include "scalar.hh" #include "translation-property.hh" #include "script-def.hh" #include "symtable.hh" #include "lookup.hh" -#include "ps-lookup.hh" -#include "tex-lookup.hh" #include "misc.hh" #include "my-lily-lexer.hh" #include "paper-def.hh" @@ -96,7 +95,6 @@ Paper_def* current_paper = 0; #define yyerror THIS->parser_error #define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f("expecting %d arguments", s)) - %} @@ -195,6 +193,7 @@ yylex (YYSTYPE *s, void * v_l) %token PT_T %token RELATIVE %token REMOVE +%token SCHEME /* token vs typedef; can't be named SCM */ %token SCORE %token SCRIPT %token SHAPE @@ -321,8 +320,18 @@ toplevel_expression: Midi_def_identifier ($1, MIDI_IDENTIFIER); THIS->lexer_p_->set_identifier ("$defaultmidi", id) } + | embedded_scm { + } ; +embedded_scm: + SCHEME STRING ';' { + #ifdef HAVE_LIBGUILE + gh_eval_str ($2->ch_l ()); + #endif + delete $2; + }; + check_version: VERSION STRING ';' { Mudela_version ver (*$2); @@ -589,7 +598,7 @@ paper_def_body: $$ = p; } | paper_def_body int '=' symtables { // ugh, what a syntax - Lookup * l = global_lookup_l->lookup_p (*$4); + Lookup * l = new Lookup (*$4); $$->set_lookup ($2, l); } | paper_def_body assignment ';' { @@ -1450,13 +1459,15 @@ symtable_body: symboldef: STRING unsigned box { - $$ = global_lookup_l->atom_p (*$1, $2, *$3); + // ignore #args + $$ = new Atom (*$1, *$3); delete $1; delete $3; } | STRING unsigned { Box b (Interval (0,0), Interval (0,0)); - $$ = global_lookup_l->atom_p (*$1, $2, b); + // ignore #args + $$ = new Atom (*$1, b); delete $1; } ; diff --git a/lily/scores.cc b/lily/scores.cc index f41666b0ad..5ac2645737 100644 --- a/lily/scores.cc +++ b/lily/scores.cc @@ -17,7 +17,6 @@ #include "file-results.hh" #include "my-lily-parser.hh" #include "source.hh" -#include "lookup.hh" Sources* source_global_l = 0; Array inclusion_global_array; @@ -125,16 +124,6 @@ do_one_file (String init_str, String file_str) parser.set_version_check (version_ignore_global_b); parser.parse_file (init_str, file_str); - /* - urg - when calling {Ps,Tex}_lookup::paper_stream_p (), - it *appears* (aaargh, latest gdb on ppc is gdb 4.16.97) - that (global_lookup_l's) - paper_l_ is invalid but not NULL - (deleted without being reset maybe?) - */ - global_lookup_l->paper_l_ = parser.default_paper_p (); - if (parser.error_level_i_) { exit_status_i_ = 1; diff --git a/lily/super-element.cc b/lily/super-element.cc index 419618ed4c..89168838b7 100644 --- a/lily/super-element.cc +++ b/lily/super-element.cc @@ -10,7 +10,7 @@ #include "line-of-score.hh" #include "p-score.hh" #include "string.hh" -#include "tex-outputter.hh" +#include "paper-outputter.hh" Super_element::Super_element() diff --git a/make/stepmake.make b/make/stepmake.make index 44f7d3e405..07d293704e 100644 --- a/make/stepmake.make +++ b/make/stepmake.make @@ -23,7 +23,7 @@ else outdir=out endif -stepdir = $(depth)/$(stepmake)/stepmake +stepdir = $(stepmake)/stepmake STEPMAKE_TEMPLATES := generic $(STEPMAKE_TEMPLATES) LOCALSTEPMAKE_TEMPLATES:= generic $(LOCALSTEPMAKE_TEMPLATES) diff --git a/mf/GNUmakefile b/mf/GNUmakefile index dfc37de8c9..88c89cdeff 100644 --- a/mf/GNUmakefile +++ b/mf/GNUmakefile @@ -2,9 +2,9 @@ depth = .. -STEPMAKE_TEMPLATES=metafont metapost +STEPMAKE_TEMPLATES=metafont metapost install install-out -EXTRA_DIST_FILES += TODO README feta.mp mfmp.ini +EXTRA_DIST_FILES += TODO README feta.mp mfplain.ini FET_FILES = $(wildcard feta[0-9]*.mf) @@ -19,34 +19,23 @@ ALL_GEN_FILES=$(LYTABLES) $(TEXTABLES) $(LOG_FILES) $(AFM_FILES) OUT_DIST_FILES += $(AFM_FILES) -include $(depth)/make/stepmake.make - -default: $(ALL_GEN_FILES) - - -$(outdir)/%.afm $(outdir)/%.ly $(outdir)/%.tex $(outdir)/%.dep: $(outdir)/%.log - $(PYTHON) $(buildscripts)/mf-to-table.py --package=$(topdir) --outdir=$(outdir) --dep $(outdir)/$( +% (c) 1997, 1998 Han-Wen Nienhuys % Jan Nieuwenhuizen % % these macros help create ascii logging output diff --git a/mf/feta-beum.mf b/mf/feta-beum.mf index 7097d68d3c..1288d6f20d 100644 --- a/mf/feta-beum.mf +++ b/mf/feta-beum.mf @@ -3,7 +3,7 @@ % % source file of LilyPond's pretty-but-neat music font % -% (c) 1997 Jan Nieuwenhuizen +% (c) 1997, 1998 Jan Nieuwenhuizen % mode_setup; diff --git a/mf/feta-bolletjes.mf b/mf/feta-bolletjes.mf index 8a48d4bfc7..6b3e9890ba 100644 --- a/mf/feta-bolletjes.mf +++ b/mf/feta-bolletjes.mf @@ -3,7 +3,7 @@ % % source file of LilyPond's pretty-but-neat music font % -% (c) 1997 Jan Nieuwenhuizen +% (c) 1997, 1998 Jan Nieuwenhuizen % & Han-Wen Nienhuys % diff --git a/mf/feta-braces16.mf b/mf/feta-braces16.mf index c5748c1aba..60dc071186 100644 --- a/mf/feta-braces16.mf +++ b/mf/feta-braces16.mf @@ -4,7 +4,7 @@ % % source file of the Feta (Font-En-Tja) music font % -% (c) 1997 Han-Wen Nienhuys +% (c) 1997, 1998 Han-Wen Nienhuys % font_identifier:="feta-braces16"; diff --git a/mf/feta-braces20.mf b/mf/feta-braces20.mf index 5ee256430f..9aae3d5379 100644 --- a/mf/feta-braces20.mf +++ b/mf/feta-braces20.mf @@ -3,7 +3,7 @@ % % source file of the Feta (Font-En-Tja) music font % -% (c) 1997 Han-Wen Nienhuys +% (c) 1997, 1998 Han-Wen Nienhuys % font_identifier:="feta-braces20"; diff --git a/mf/feta-eindelijk.mf b/mf/feta-eindelijk.mf index 0670ea351b..f3c26b669b 100644 --- a/mf/feta-eindelijk.mf +++ b/mf/feta-eindelijk.mf @@ -1,6 +1,10 @@ -% eindelijk.mf -% LilyPond's own rest(s) - +% feta-eindelijk.mf -- implement rest symbols +% +% part of LilyPond's pretty-but-neat music font +% +% source file of the Feta (not the Font-En-Tja) music font +% +% (c) 1997, 1998 Jan Nieuwenhuizen fet_begingroup("rests"); diff --git a/mf/feta-generic.mf b/mf/feta-generic.mf index 6b3bdda090..41729fe324 100644 --- a/mf/feta-generic.mf +++ b/mf/feta-generic.mf @@ -4,7 +4,7 @@ % source file of the Feta (defintively not an abbreviation for Font-En-Tja) % music font % -% (c) 1997 Han-Wen Nienhuys +% (c) 1997, 1998 Han-Wen Nienhuys % diff --git a/mf/feta-klef.mf b/mf/feta-klef.mf index cccaef43fd..2e846acb43 100644 --- a/mf/feta-klef.mf +++ b/mf/feta-klef.mf @@ -1,14 +1,13 @@ -% % feta-klef.mf -- implement Clefs % -% source file of the Feta (Font-En-Tja) music font +% part of LilyPond's pretty-but-neat music font +% +% source file of the Feta (not the Font-En-Tja) music font % -% (c) 1997 Han-Wen Nienhuys , +% (c) 1997, 1998 Han-Wen Nienhuys , % Jan Nieuwenhuizen - - fet_begingroup("clefs"); % diff --git a/mf/feta-nummer.mf b/mf/feta-nummer.mf index c35ee4c2f2..66a4649ac1 100644 --- a/mf/feta-nummer.mf +++ b/mf/feta-nummer.mf @@ -1,5 +1,10 @@ -% feta-nummer.mf +% feta-nummer.mf -- implement bold Orator numerals +% % part of LilyPond's pretty-but-neat music font +% +% source file of the Feta (not the Font-En-Tja) music font +% +% (c) 1997, 1998 Jan Nieuwenhuizen fet_begingroup("nummer") code := 47; diff --git a/mf/feta-schrift.mf b/mf/feta-schrift.mf index 7257a45277..2c314efb6e 100644 --- a/mf/feta-schrift.mf +++ b/mf/feta-schrift.mf @@ -4,7 +4,7 @@ % source file of the Feta (defintively not an abbreviation for Font-En-Tja) % music font % -% (c) 1997 Han-Wen Nienhuys +% (c) 1997, 1998 Han-Wen Nienhuys % Jan Nieuwenhuizen % @@ -58,6 +58,37 @@ fet_beginchar("fermata down", "dfermata", "dfermata") y_mirror_char; fet_endchar; +% +% Thumbs are used in cello music. +% TODO : thumbs should look like the finger-font and should be placed in +% the same way in the score. +% + +fet_beginchar("Thumb", "thumb", "thumb") + save thin, height, width, thick; + height# = 5/4 width#; + height# = interline#; + thin = 1.2 stafflinethickness; + thick = 1.4 thin; + set_char_box(width#/2, width#/2, height#/2, height#/2); + + penpos1(thick, 0); + penpos2(thin, 90); + z1r = (w, 0); + z2r = (0, h); + penlabels(1,2); + penstroke z1e{up} .. {left}z2e; + addto currentpicture also currentpicture xscaled -1; + addto currentpicture also currentpicture yscaled -1; + + pickup pencircle scaled thin; + save x,y; + z3r = (0, -h); + z4 = (0, -2h); + penlabels(3,4); + draw z3r -- z4; +fet_endchar; + % % FIXME: rounded endings @@ -179,6 +210,7 @@ fet_beginchar("marcato down", "dmarcato", "dmarcato") xy_mirror_char; fet_endchar; + % % used in french horn music todo % diff --git a/mf/feta-sleur.mf b/mf/feta-sleur.mf index e612937728..6d98d4dfc7 100644 --- a/mf/feta-sleur.mf +++ b/mf/feta-sleur.mf @@ -3,7 +3,7 @@ % % source file of LilyPond's pretty-but-neat music font % -% (c) 1997 Jan Nieuwenhuizen +% (c) 1997, 1998 Jan Nieuwenhuizen % & Han-Wen Nienhuys % % see Documentation/fonts.tex diff --git a/mf/feta-toevallig.mf b/mf/feta-toevallig.mf index 7da404d0c7..b9c9a0ebbe 100644 --- a/mf/feta-toevallig.mf +++ b/mf/feta-toevallig.mf @@ -3,7 +3,7 @@ % % source file of the Feta (Font-En-Tja) music font % -% (c) 1997 Han-Wen Nienhuys +% (c) 1997, 1998 Han-Wen Nienhuys % diff --git a/mf/mfplain.ini b/mf/mfplain.ini new file mode 100644 index 0000000000..7ad4dfd71e --- /dev/null +++ b/mf/mfplain.ini @@ -0,0 +1,3 @@ +\input plain.mf +\input modes.mf +\dump mfplain diff --git a/ps/GNUmakefile b/ps/GNUmakefile index d4353253c4..a94b37ef8a 100644 --- a/ps/GNUmakefile +++ b/ps/GNUmakefile @@ -2,14 +2,12 @@ depth = .. - PS_FILES = $(wildcard *.ps) +STEPMAKE_TEMPLATES=install EXTRA_DIST_FILES = $(PS_FILES) INSTALLATION_DIR=$(datadir)/ps/ INSTALLATION_FILES=$(PS_FILES) include $(depth)/make/stepmake.make -include $(stepdir)/installfiles.make - diff --git a/scripts/mudela-book.py b/scripts/mudela-book.py index 596119c3dd..3faa60d238 100644 --- a/scripts/mudela-book.py +++ b/scripts/mudela-book.py @@ -1,23 +1,46 @@ #!@PYTHON@ - -# TODO: center option - +# All non-english comments are NOT in swedish, they are norwegian! + +# TODO: center option (??) +# * clean up handling of filename of inputfile +# * steal Props class from ly2dvi? +# * \onecolumn, \twocolumn +# * fontsize change with commandline parameters +# * the verbatim option should not be visible in the created latex file +# * what the h.. does castingalgorithm do/mean??? +# * compile all regular expressions +# * the following fails because mudelabook doesn't care that the +# last } after \end{mudela} finishes the marginpar: +# \marginpar{ +# \begin{mudela}[fragment] +# c d e f g +# \end{mudela}} +# * Command line parameter that force all inline mudela to be verbatim, and +# one that forces all to be printed # log: # 0.3: # rewrite in Python. +# 0.4: +# much rewritten by new author. I think the work has been split more +# logical between different classes. +# import os import string import re import getopt import sys +import regsub -outdir = 'out/' -program_version = '0.3' - - +outdir = 'out' +program_version = '0.4' +default_paper_size_global = 'a4' +default_mudela_fontsize = '16pt' +force_mudela_fontsize_b = 0 +fontsize_i2a = {11:'eleven', 13:'thirteen', 16:'sixteen', 20:'twenty', 26:'twentysix'} +fontsize_pt2i = {'11pt':11, '13pt':13, '16pt':16, '20pt':20, '26pt':26} def file_exist_b(name): try: @@ -27,208 +50,317 @@ def file_exist_b(name): f.close () return 1 +def ps_dimention(fname): + fd = open(fname) + lines = fd.readlines() + reg = re.compile('%%BoundingBox: ([0-9]*) ([0-9]*) ([0-9]*) ([0-9]*)') + for line in lines: + s = reg.search(line) + if s: + break + return (int(s.groups()[2])-int(s.groups()[0]), + int(s.groups()[3])-int(s.groups()[1])) + + class CompileStatus: - pass + pass def file_mtime (name): return os.stat (name)[8] #mod time - -def compile (command, infile, outfile): - indate = file_mtime (infile) - try: - outdate = file_mtime (outfile) - recompile = indate > outdate - - except os.error: - recompile = 1 - - if recompile: - sys.stderr.write ('invoking `%s\'\n' % command) - - status = os.system (command) - if status: - raise CompileStatus +# +# executes os.system(command) if infile is newer than +# outfile or outfile don't exist +# +def compile (command, workingdir, infile, outfile): + indate = file_mtime (workingdir+infile) + try: + outdate = file_mtime (outfile) + recompile = indate > outdate + + except os.error: + recompile = 1 + + if recompile: + sys.stderr.write ('invoking `%s\'\n' % command) + if workingdir == '': + status = os.system (command) + else: + status = os.system ('cd %s; %s' %(workingdir, command)) + if status: + raise CompileStatus + + +class PaperDef: + __onecolumn_linewidth = { + 'a4':{'10pt': 345, '11pt': 360, '12pt':390}, + 'a5':{'10pt': 276, '11pt': 276, '12pt':276}, + 'b5':{'10pt': 345, '11pt': 356, '12pt':356}, + 'letter':{'10pt': 345, '11pt': 360, '12pt':390}, + 'legal':{'10pt': 345, '11pt': 360, '12pt':390}, + 'executive':{'10pt': 345, '11pt': 360, '12pt':379} + } + __twocolumn_linewidth = { + 'a4':{'10pt': 167, '11pt': 175, '12pt':190}, + 'a5':{'10pt': 133, '11pt': 133, '12pt':133}, + 'b5':{'10pt': 167, '11pt': 173, '12pt':173}, + 'letter':{'10pt': 167, '11pt': 175, '12pt':190}, + 'legal':{'10pt': 167, '11pt': 175, '12pt':190}, + 'executive':{'10pt': 167, '11pt': 175, '12pt':184} + } + __numcolumn = 1 + __fontsize = '11pt' + # + # init + # + def __init__(self): + self.__papersize = default_paper_size_global + def set_papersize (self, p): + if not self.__onecolumn_linewidth.has_key(p): + print "warning:unsupported papersize", p, \ + "will use", default_paper_size_global + self.__papersize = default_paper_size_global + else: + self.__papersize = p + def set_fontsize(self, pt): + self.__fontsize = pt + def get_linewidth (self): + if self.__numcolumn == 1: + return self.__onecolumn_linewidth[self.__papersize][self.__fontsize] + else: + return self.__twocolumn_linewidth[self.__papersize][self.__fontsize] + def onecolumn (slef): + self.__numcolumn = 1 + def twocolumn (self): + self.__numcolumn = 2 class Mudela_output: - def __init__ (self): - self.basename = '' - self.fragment = 0 - self.size = 16 - - def open (self, basename): - self.basename = basename - self.temp_file = "%s/%s" %(outdir, 'mudela-temp.ly') - self.file = open (self.temp_file, 'w') - self.file.write ('\\include \"paper%d.ly\"\n' % self.size) - if self.size == 16: - s = 'sixteen' - else: - s = 'twenty' - - self.file.write ('default_paper = \\paper { \\paper_%s\n linewidth = -15.\\cm; }\n' % s) - - if self.fragment: - self.file.write ('\\score { \\notes { ') - - def write (self,s): - self.file.write (s) - - def close (self): - if self.fragment: - self.file.write ( - '}\n \\paper { linewidth = -1.0\\cm;\n' + - 'castingalgorithm = \\Wordwrap; } }\n') - - - self.file.close () - - inf=self.basename + '.ly' - outf = self.basename + '.tex' - if not file_exist_b (inf): - status = 1 - else: -# print 'invoking %s' %('diff %s %s' % (self.temp_file, inf)) - status = os.system ('diff -q %s %s' % (self.temp_file, inf)) -# print 'status %d' % status - - if status: - os.rename (self.temp_file, inf) - - compile ('lilypond -o %s %s'% (self.basename, inf), inf, outf) -# os.rename (self.basename + '.tex', outdir +) - - + def __init__ (self, basename): + self.basename = basename + # it's an integer! + self.feta_pt_size = fontsize_pt2i[default_mudela_fontsize] + self.temp_filename = "%s/%s" %(outdir, 'mudela-temp.ly') + self.file = open (self.temp_filename, 'w') + # 'tex' or 'eps' + self.graphic_type = 'tex' + self.fragment = 0 + def write (self, line): + # match only if there is nothing but whitespace before \begin + if re.search('^\s*\\\\begin{mudela}', line): + self.scan_begin_statement(line) + self.write_red_tape() + else: + self.file.write (line) + def scan_begin_statement(self, line): + r = begin_mudela_opts_re.search(line) + if r: + o = r.group()[1:][:-1] + optlist = re.compile('[ ,]*').split(o) + else: + optlist = [] + if 'floating' in optlist: + self.graphic_type = 'eps' + else: + self.graphic_type = 'tex' + if 'fragment' in optlist: + self.fragment = 1 + else: + self.fragment = 0 + for pt in fontsize_pt2i.keys(): + if pt in optlist: + self.feta_pt_size = fontsize_pt2i[pt] + def write_red_tape(self): + self.file.write ('\\include \"paper%d.ly\"\n' % self.feta_pt_size) + s = fontsize_i2a[self.feta_pt_size] + if self.fragment: + self.file.write("default_paper = \\paper {" + + "\\paper_%s\n linewidth = -1.\\pt;" % s + + "castingalgorithm = \Wordwrap; indent = 2.\cm; \n}") + self.file.write("\\score{\n\\notes") #HACK + else: + self.file.write ("default_paper = \\paper {" + + "\\paper_%s\n linewidth = %i.\\pt;" % \ + (s, Paper.get_linewidth()) \ + + "castingalgorithm = \Wordwrap; indent = 2.\cm;\n}") + def close (self): + if self.fragment: + self.file.write ('\\paper { \\default_paper; } }\n') + self.file.close () + + inf = self.basename + '.ly' + outf = self.basename + '.tex' + if not file_exist_b (inf): + status = 1 + else: + status = os.system ('diff -q %s %s' % (self.temp_filename, inf)) + + if status: + os.rename (self.temp_filename, inf) + compile ('lilypond -o %s %s;'% (self.basename, inf), '', inf, outf) + if self.graphic_type == 'eps': + bname = self.basename[string.rfind(self.basename, '/')+1:] + tex_name = bname+'.tex' + dvi_name = bname+'.dvi' + eps_name = bname+'.eps' + compile ('tex %s' % tex_name, outdir, tex_name, dvi_name) + compile ('dvips -E -o %s %s' % (eps_name, dvi_name), outdir, dvi_name, eps_name) + def insert_me_string(self): + "Returns a string that can be used directly in latex." + if self.graphic_type == 'tex': + return '\\preMudelaExample\\input %s\n\postMudelaExample\n' % self.basename + elif self.graphic_type == 'eps': + ps_dim = ps_dimention('%s.eps' % self.basename) + return '\\parbox{%ipt}{\includegraphics{%s.eps}}' % (ps_dim[0], self.basename) + else: + print "Unsupported graphic type '%s'" % self.graphic_type + sys.exit(1) class Tex_output: - def __init__ (self, name): - self.output_fn = '%s/%s' % (outdir, name) - self.mudela = 0 - self.file = open (self.output_fn , 'w') - self.verbatim = 0 - def open_mudela (self, basename): - self.mudela_basename =basename - if self.verbatim: - self.file.write ('\\begin{verbatim}\n') - self.mudela = 1 - - def write (self, s): - self.file.write (s) - - def write_mudela (self, s): - if self.verbatim: - self.file.write (s) - - def close_mudela (self): - if self.verbatim: - self.file.write ('\\end{verbatim}\n') - self.verbatim = 0 - - self.file.write ( - '\\preMudelaExample\\input %s\n\postMudelaExample' %(self.mudela_basename)) - self.mudela = 0 - - - - + def __init__ (self, name): + self.output_fn = '%s/%s' % (outdir, name) + self.file = open (self.output_fn , 'w') + def open_mudela (self, basename): + self.mudela_basename = basename + def open_verbatim (self): + self.file.write ('\\begin{verbatim}\n') + def close_verbatim (self): + self.file.write ('\\end{verbatim}\n') + def write (self, s): + self.file.write (s) begin_mudela_re = re.compile ('^ *\\\\begin{mudela}') -begin_mudela_opts_re = re.compile ('^ *\\\\begin{mudela}\[(.*)\]') +begin_mudela_opts_re = re.compile('\[[^\]]*\]') end_mudela_re = re.compile ('^ *\\\\end{mudela}') section_re = re.compile ('\\\\section') chapter_re = re.compile ('\\\\chapter') -input_re = re.compile ('^\\\\input[ \t\n]+(.*)$') +input_re = re.compile ('^\\\\input{([^}]*)') +include_re = re.compile ('^\\\\include{([^}]*)') +begin_document_re = re.compile ('^ *\\\\begin{document}') +documentclass_re = re.compile('\\\\documentclass') +twocolumn_re = re.compile('\\\\twocolumn') +onecolumn_re = re.compile('\\\\onecolumn') class Tex_input: - def __init__ (self,name): - if not re.search ('\\.[^/\\\\]+',name): - name = name + '.tex' - print 'opening %s' % name - self.filename = name - self.infile = open (name) + def __init__ (self,name): + # HACK + if (name[-4:] != '.tex') and (name[-4:] != '.doc'): + name = name + '.tex' + self.filename = name + self.infile = open (name) - def get_lines (self): - lines = self.infile.readlines () - (retlines, retdeps) = ([],[self.filename]) - for line in lines: - m = input_re.search (line) - if m: - t = Tex_input (m.group (1)) - ls =t.get_lines () - retlines = retlines + ls[0] - retdeps = retdeps + ls[1] - else: - retlines.append (line) - - return (retlines, retdeps) + def get_lines (self): + lines = self.infile.readlines () + (retlines, retdeps) = ([],[self.filename]) + for line in lines: + r = input_re.search (line) + ri = include_re.search (line) + if r: + t = Tex_input (r.groups()[0]) + ls =t.get_lines () + retlines = retlines + ls[0] + retdeps = retdeps + ls[1] + elif ri: + t = Tex_input (ri.groups()[0]) + ls =t.get_lines () + ls[0].insert(0, '\\newpage') + ls[0].append('\\newpage') + retlines = retlines + ls[0] + retdeps = retdeps + ls[1] + else: + retlines.append (line) + return (retlines, retdeps) + class Main_tex_input(Tex_input): - def __init__ (self, name, outname): + def __init__ (self, name, outname): - Tex_input.__init__ (self, name) # ugh - - self.outname = outname - self.chapter = 0 - self.section = 0 - self.fine_count =0 - self.mudtex = Tex_output (self.outname) - self.mudela = None - self.deps = [] - def set_sections (self, l): - if section_re.search (l): - self.section = self.section + 1 - if chapter_re.search (l): - self.section = 0 - self.chapter = self.chapter + 1 - - - def gulp_mudela (self): - pass - - def gen_basename (self): - return '%s/%s-%d.%d.%d' % (outdir, self.outname,self.chapter,self.section,self.fine_count) - - def do_it(self): - (lines, self.deps) = self.get_lines () - for line in lines: - if begin_mudela_re.search (line): - m =begin_mudela_opts_re.search (line) - if m: - opts = m.group (1) - else: - opts = '' - optlist = string.split (opts, ',') - self.mudela = Mudela_output () - if 'fragment' in optlist: - self.mudela.fragment = 1 - if '16pt' in optlist: - self.mudela.size = 16 - if '20pt' in optlist: - self.mudela.size = 20 - - if 'verbatim' in optlist: - self.mudtex.verbatim = 1 - - b = self.gen_basename () - self.mudtex.open_mudela (b) - self.mudela.open (b) - - - continue - elif end_mudela_re.search (line): - self.mudela.close () - self.mudtex.close_mudela () - self.mudela = None - self.fine_count = self.fine_count + 1 - continue - - if self.mudela: - self.mudela.write (line) - self.mudtex.write_mudela (line) - else: - self.mudtex.write (line) - self.set_sections(line) - del self.mudtex + Tex_input.__init__ (self, name) # ugh + + self.outname = outname + self.chapter = 0 + self.section = 0 + self.fine_count =0 + self.mudtex = Tex_output (self.outname) + self.mudela = None + self.deps = [] + self.verbatim = 0 + # set to 'mudela' when we are processing mudela code, + # both verbatim and graphic-to-be + self.mode = 'latex' + def set_sections (self, l): + if section_re.search (l): + self.section = self.section + 1 + if chapter_re.search (l): + self.section = 0 + self.chapter = self.chapter + 1 + + def gen_basename (self): + return '%s/%s-%d.%d.%d' % (outdir, self.outname,self.chapter,self.section,self.fine_count) + + def extract_papersize_from_documentclass(self, line): + pre = re.search('\\\\documentclass[\[, ]*(\w*)paper[\w ,]*\]\{\w*\}', line) + if not pre: + return default_paper_size_global + return pre.groups()[0] + def extract_fontsize_from_documentclass(self, line): + if re.search('\\\\documentclass\[[^\]]*\]\{[^\}]*\}', line): + r = re.search('[ ,\[]*([0-9]*pt)', line) + if r: + return r.groups()[0] + return '10pt' + def do_it(self): + (lines, self.deps) = self.get_lines () + for line in lines: + if documentclass_re.search (line): + Paper.set_papersize (self.extract_papersize_from_documentclass (line) ) + Paper.set_fontsize (self.extract_fontsize_from_documentclass (line) ) + elif twocolumn_re.search (line): + Paper.twocolumn () + elif onecolumn_re.search (line): + Paper.onecolumn () + elif begin_document_re.search (line): + self.mudtex.write ('\\def\\preMudelaExample{}\n') + self.mudtex.write ('\\def\\postMudelaExample{}\n') + elif begin_mudela_re.search (line): + if __debug__: + if self.mode == 'mudela': + raise AssertionError + self.mode = 'mudela' + r = begin_mudela_opts_re.search (line) + if r: + o = r.group()[1:][:-1] + optlist = re.compile('[ ,]*').split(o) + else: + optlist = [] + if 'verbatim' in optlist: + self.verbatim = 1 + self.mudtex.open_verbatim () + else: + self.verbatim = 0 + self.mudela = Mudela_output (self.gen_basename ()) + + elif end_mudela_re.search (line): + if __debug__: + if self.mode != 'mudela': + raise AssertionError + if self.mudela: + self.mudela.close () + self.mudtex.write (self.mudela.insert_me_string()) + del self.mudela + self.mudela = None + self.fine_count = self.fine_count + 1 + else: + self.mudtex.write (line) + self.mudtex.close_verbatim () + self.mode = 'latex' + continue + + if self.mode == 'mudela' and not self.verbatim: + self.mudela.write (line) + else: + self.mudtex.write (line) + self.set_sections(line) + del self.mudtex def help(): @@ -236,32 +368,14 @@ def help(): + "Generate hybrid LaTeX input from Latex + mudela" + "Options:\n" + " -h, --help print this help\n" - + " -d, --outdir=DIR prefix directory\n" + + " -d, --outdir=DIR directory to put generated files\n" + " -o, --outname=FILE prefix for filenames\n" + + " --mudela-fontsize=??pt default fontsize when no parameter for \\begin{mudela}\n" + + " --force-mudela-fontsize=??pt force fontsize for all inline mudela\n" ) sys.exit (0) - -sys.stderr.write ('This is %s version %s\n' % ('mudela-book', program_version)) - -outname = '' -(options, files) = getopt.getopt( - sys.argv[1:], 'hd:o:', [ 'outdir=', 'outname=', 'help', 'dependencies']) - -do_deps = 0 -for opt in options: - o = opt[0] - a = opt[1] - if o == '--outname' or o == '-o': - outname = a - if o == '--outdir' or o == '-d': - outdir = a - if o == '--help' or o == '-h': - help () - if o == '--dependencies': - do_deps = 1 - def write_deps (fn, out, deps): out_fn = outdir + '/' + fn print '\`writing \`%s\'\n\'' % out_fn @@ -271,18 +385,64 @@ def write_deps (fn, out, deps): reduce (lambda x,y: x + ' '+ y, deps))) f.close () - -for f in files: - my_outname = outname - if not my_outname: - my_outname = regsub.sub ('\\(.*\\)\\.doc', '\\1', f) - - my_depname = my_outname + '.dep' - - inp = Main_tex_input (f, my_outname) - inp.do_it () - - if do_deps: +def identify(): + sys.stderr.write('*** Lokal versjon av mudela-book ***\n') + sys.stderr.write ('This is %s version %s\n' % ('mudela-book', program_version)) + +def main(): + global default_mudela_fontsize, outdir + outname = '' + try: + (options, files) = getopt.getopt( + sys.argv[1:], 'hd:o:', ['outdir=', 'outname=', 'mudela-fontsize=', + 'force-mudela-fontsize=', 'help', 'dependencies']) + except getopt.error, msg: + print "error:", msg + sys.exit(1) + + do_deps = 0 + for opt in options: + o = opt[0] + a = opt[1] + if o == '--outname' or o == '-o': + outname = a + if o == '--outdir' or o == '-d': + outdir = a + if o == '--help' or o == '-h': + help () + if o == '--dependencies': + do_deps = 1 + if o == '--mudela-fontsize': + default_mudela_fontsize = a + if o == '--force-mudela-fontsize': + default_mudela_fontsize = a + force_mudela_fontsize_b = 1 + + if outdir[-1:] != '/': + outdir = outdir + '/' + + if not file_exist_b(outdir): + os.system('mkdir %s' % outdir) + + if not fontsize_pt2i.has_key(default_mudela_fontsize): + print "warning: fontsize %s is not supported using 16pt" % default_mudela_fontsize + default_mudela_fontsize = '16pt' + + for f in files: + my_outname = outname + if not my_outname: + my_outname = regsub.sub ('\\(.*\\)\\.doc', '\\1', f) + + my_depname = my_outname + '.dep' + + inp = Main_tex_input (f, my_outname) + inp.do_it () + + if do_deps: write_deps (my_depname, my_outname, inp.deps) + +identify() +Paper = PaperDef() +main() diff --git a/stepmake/Documentation/GNUmakefile b/stepmake/Documentation/GNUmakefile index c49eec6022..4f6e24b7ff 100644 --- a/stepmake/Documentation/GNUmakefile +++ b/stepmake/Documentation/GNUmakefile @@ -5,10 +5,11 @@ depth = .. OUTTXT_FILES = $(OUTYO_FILES:.yo=.txt) $(OUTIN_FILES:.yo=.txt) EXTRA_DIST_FILES = -SUBDIRS=topdocs +OUT_DIST_FILES=$(OUTTXT_FILES) +SUBDIRS=topdocs -STEPMAKE_TEMPLATES=documentation +STEPMAKE_TEMPLATES=documentation install install-out include $(depth)/make/stepmake.make @@ -22,3 +23,9 @@ check-doc-deps: do-doc doc: do-doc +INSTALLATION_DIR=$(datadir)/Documentation +INSTALLATION_FILES=$(DIST_FILES) + +INSTALLATION_OUT_DIR=$(datadir)/Documentation/out +INSTALLATION_OUT_FILES=$(OUTTXT_FILES) + diff --git a/stepmake/Documentation/topdocs/GNUmakefile b/stepmake/Documentation/topdocs/GNUmakefile index d12c14370e..f01c12573d 100644 --- a/stepmake/Documentation/topdocs/GNUmakefile +++ b/stepmake/Documentation/topdocs/GNUmakefile @@ -8,8 +8,16 @@ AT_FILES = $(BLURBS) # at-dir = $(doc-dir)/ at-ext = .in BLURBS=BLURB COPERTINA FLAPTEKST +OUT_DIST_FILES=$(OUTTXT_FILES) -STEPMAKE_TEMPLATES=documentation yolily-topdoc +STEPMAKE_TEMPLATES=documentation yolily-topdoc install install-out include $(depth)/make/stepmake.make +INSTALLATION_DIR=$(datadir)/Documentation/topdocs +INSTALLATION_FILES=$(DIST_FILES) +POST_INSTALL=-mkdir $(INSTALLATION_DIR)/out + +INSTALLATION_OUT_DIR=$(datadir)/Documentation/topdocs/out +INSTALLATION_OUT_FILES=$(OUTTXT_FILES) + diff --git a/stepmake/NEWS b/stepmake/NEWS index 3b27f3db08..7e0a1e72bf 100644 --- a/stepmake/NEWS +++ b/stepmake/NEWS @@ -1,3 +1,20 @@ +pl 59 + - bf: package-diff (remove missing automatic) + - install templates, (urg) INSTALL*1,2 INSTALL_OUT*1,2 + +pl 58 + - distribute formatted txt files: no yodl needed for operation! + - guile 1.2 and 1.3 support + +pl 57 + - yodl first build script fixes + - uninstall fixes, but, urg, still have to uninstall twice + to get rid of all subdirs + - installed stepmake + * install not required + * only installs on explicit make install from toplevel stepdir + * rather urg, 'make dist' needs absolute distdir! + pl 56 - crude metapost stuff diff --git a/stepmake/VERSION b/stepmake/VERSION index 57fd582a8e..e24ec2af87 100644 --- a/stepmake/VERSION +++ b/stepmake/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=StepMake MAJOR_VERSION=0 MINOR_VERSION=1 -PATCH_LEVEL=56 +PATCH_LEVEL=59 MY_PATCH_LEVEL= # use the above to send patches, always empty for released version: diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index ebbe27e3c7..8041121141 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -153,6 +153,16 @@ AC_DEFUN(AC_STEPMAKE_GXX, [ fi ]) +AC_DEFUN(AC_STEPMAKE_GUILE, [ + # urg, must check for different functions in libguile + # to force new check iso reading from cache + AC_CHECK_LIB(guile, scm_shell, \ + LIBS="-lguile $LIBS" AC_DEFINE(HAVE_LIBGUILE), \ + AC_CHECK_LIB(readline, readline) \ + AC_CHECK_LIB(dl, dlopen) \ + AC_CHECK_LIB(guile, scm_boot_guile)) +]) + AC_DEFUN(AC_STEPMAKE_INIT, [ . $srcdir/VERSION @@ -167,16 +177,44 @@ AC_DEFUN(AC_STEPMAKE_INIT, [ package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'` changequote([, ])dnl + # No versioning on directory names of sub-packages + # urg, urg + stepmake=${datadir}/stepmake + presome=${prefix} + if test "$prefix" = "NONE"; then + presome=${ac_default_prefix} + fi + stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"` + if test "x$PACKAGE" = "xSTEPMAKE"; then echo Stepmake package! (cd stepmake; rm -f stepmake; ln -s ../stepmake .) (cd stepmake; rm -f bin; ln -s ../bin .) AC_CONFIG_AUX_DIR(bin) + stepmake=stepmake else echo Package: $PACKAGE - AC_CONFIG_AUX_DIR(stepmake/bin) + # Check for installed stepmake + if test -d $stepmake; then + echo Using installed stepmake: $stepmake + else + stepmake='$(depth)'/stepmake + echo Using local stepmake: $datadir/stepmake not found + fi + AC_CONFIG_AUX_DIR(\ + $HOME/usr/local/share/stepmake/bin\ + $HOME/usr/local/lib/stepmake/bin\ + $HOME/usr/share/stepmake/bin\ + $HOME/usr/lib/stepmake/bin\ + /usr/local/share/stepmake/bin\ + /usr/local/lib/stepmake/bin\ + /usr/share/stepmake/bin\ + /usr/lib/stepmake/bin\ + stepmake/bin\ + ) fi + AC_SUBST(stepmake) AC_SUBST(package) AC_SUBST(PACKAGE) AC_SUBST(PACKAGE_NAME) @@ -191,10 +229,6 @@ AC_DEFUN(AC_STEPMAKE_INIT, [ absolute_builddir="`pwd`" AC_SUBST(absolute_builddir) - # No versioning on directory names of sub-packages - stepmake=stepmake - AC_SUBST(stepmake) - STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null` if test "x$STATE_VECTOR" != "x"; then STATE_VECTOR="\$(depth)/$STATE_VECTOR" @@ -249,14 +283,14 @@ dnl fi DOTEXE=.exe DIRSEP='\\' PATHSEP=';' - INSTALL="\$(stepdir)/../bin/install-dot-exe.sh -c" + INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c" else DIRSEP='/' PATHSEP=':' LN=ln LN_S='ln -s' ZIP="zip -r -9" - INSTALL="\$(stepdir)/../bin/install-sh -c" + INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c" fi AC_SUBST(DOTEXE) AC_SUBST(ZIP) @@ -461,11 +495,13 @@ AC_DEFUN(AC_STEPMAKE_YODL, [ AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl) AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl) AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl) + YODL2LESS_DIR='$(bindir)/' else AC_SUBST(STRIPROFF) AC_SUBST(YODL) AC_SUBST(YODL2HTML) AC_SUBST(YODL2LATEX) + AC_SUBST(YODL2LESS_DIR) AC_SUBST(YODL2MAN) AC_SUBST(YODL2MSLESS) AC_SUBST(YODL2TEXINFO) diff --git a/stepmake/bin/GNUmakefile b/stepmake/bin/GNUmakefile index 36d16462ca..4ca8cd1a8f 100644 --- a/stepmake/bin/GNUmakefile +++ b/stepmake/bin/GNUmakefile @@ -1,10 +1,11 @@ # bin/Makefile depth = .. - EXTRA_DIST_FILES = install-sh config.sub config.guess -STEPMAKE_TEMPLATES=script +STEPMAKE_TEMPLATES=script install include $(depth)/make/stepmake.make - +POST_INSTALL=chmod 755 $(datadir)/bin/* +INSTALLATION_DIR=$(datadir)/bin +INSTALLATION_FILES=$(DIST_FILES) diff --git a/stepmake/bin/package-diff.py b/stepmake/bin/package-diff.py index 0d1aba2820..e8e28f1bab 100644 --- a/stepmake/bin/package-diff.py +++ b/stepmake/bin/package-diff.py @@ -35,7 +35,7 @@ def help (): sys.stdout.write ( 'Generate a patch to go to current version\n' ' -f, --from=FROM old is FROM\n' - ' -h, --help print this help\n' + ' -h, --help print this help\n' ' -p, --package=DIR specify package\n' ' -r, --release diff against latest release\n' ' -t, --to=TO to version TO\n' @@ -58,7 +58,10 @@ def remove_automatic (dirnames): for d in dirs: files = files + multiple_find (['*'], [d]) for f in files: - os.remove (f) + try: + os.remove (f) + except: + sys.stderr.write ("can't remove: `" + f + "'\n'") def dirname (v): # urg, again? diff --git a/stepmake/config.make.in b/stepmake/config.make.in index 292783aab0..a2a43b481f 100644 --- a/stepmake/config.make.in +++ b/stepmake/config.make.in @@ -59,6 +59,7 @@ TROFF = @TROFF@ YODL= @YODL@ YODL2HTML= @YODL2HTML@ YODL2LATEX= @YODL2LATEX@ +YODL2LESS_DIR= @YODL2LESS_DIR@ YODL2MAN= @YODL2MAN@ YODL2MSLESS= @YODL2MSLESS@ YODL2TEXINFO= @YODL2TEXINFO@ diff --git a/stepmake/configure b/stepmake/configure index 13f46dff90..34691c9722 100755 --- a/stepmake/configure +++ b/stepmake/configure @@ -593,6 +593,15 @@ fi PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'` package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'` + # No versioning on directory names of sub-packages + # urg, urg + stepmake=${datadir}/stepmake + presome=${prefix} + if test "$prefix" = "NONE"; then + presome=${ac_default_prefix} + fi + stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"` + if test "x$PACKAGE" = "xSTEPMAKE"; then echo Stepmake package! (cd stepmake; rm -f stepmake; ln -s ../stepmake .) @@ -616,10 +625,38 @@ ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + stepmake=stepmake else echo Package: $PACKAGE + # Check for installed stepmake + if test -d $stepmake; then + echo Using installed stepmake: $stepmake + else + stepmake='$(depth)'/stepmake + echo Using local stepmake: $datadir/stepmake not found + fi ac_aux_dir= -for ac_dir in stepmake/bin $srcdir/stepmake/bin; do +for ac_dir in \ + $HOME/usr/local/share/stepmake/bin\ + $HOME/usr/local/lib/stepmake/bin\ + $HOME/usr/share/stepmake/bin\ + $HOME/usr/lib/stepmake/bin\ + /usr/local/share/stepmake/bin\ + /usr/local/lib/stepmake/bin\ + /usr/share/stepmake/bin\ + /usr/lib/stepmake/bin\ + stepmake/bin\ + $srcdir/\ + $HOME/usr/local/share/stepmake/bin\ + $HOME/usr/local/lib/stepmake/bin\ + $HOME/usr/share/stepmake/bin\ + $HOME/usr/lib/stepmake/bin\ + /usr/local/share/stepmake/bin\ + /usr/local/lib/stepmake/bin\ + /usr/share/stepmake/bin\ + /usr/lib/stepmake/bin\ + stepmake/bin\ + ; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" @@ -631,7 +668,27 @@ for ac_dir in stepmake/bin $srcdir/stepmake/bin; do fi done if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in stepmake/bin $srcdir/stepmake/bin" 1>&2; exit 1; } + { echo "configure: error: can not find install-sh or install.sh in \ + $HOME/usr/local/share/stepmake/bin\ + $HOME/usr/local/lib/stepmake/bin\ + $HOME/usr/share/stepmake/bin\ + $HOME/usr/lib/stepmake/bin\ + /usr/local/share/stepmake/bin\ + /usr/local/lib/stepmake/bin\ + /usr/share/stepmake/bin\ + /usr/lib/stepmake/bin\ + stepmake/bin\ + $srcdir/\ + $HOME/usr/local/share/stepmake/bin\ + $HOME/usr/local/lib/stepmake/bin\ + $HOME/usr/share/stepmake/bin\ + $HOME/usr/lib/stepmake/bin\ + /usr/local/share/stepmake/bin\ + /usr/local/lib/stepmake/bin\ + /usr/share/stepmake/bin\ + /usr/lib/stepmake/bin\ + stepmake/bin\ + " 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub @@ -642,6 +699,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + cat >> confdefs.h </dev/null` if test "x$STATE_VECTOR" != "x"; then STATE_VECTOR="\$(depth)/$STATE_VECTOR" @@ -691,7 +745,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:695: checking host system type" >&5 +echo "configure:749: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -716,7 +770,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:720: checking for $ac_word" >&5 +echo "configure:774: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -750,7 +804,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:754: checking for $ac_word" >&5 +echo "configure:808: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -787,7 +841,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:791: checking for $ac_word" >&5 +echo "configure:845: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -821,7 +875,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:825: checking for $ac_word" >&5 +echo "configure:879: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_BASH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -854,7 +908,7 @@ test -n "$BASH" || BASH="/bin/sh" # Extract the first word of "${PYTHON:-python}", so it can be a program name with args. set dummy ${PYTHON:-python}; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:858: checking for $ac_word" >&5 +echo "configure:912: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PYTHON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -923,14 +977,14 @@ fi DOTEXE=.exe DIRSEP='\\' PATHSEP=';' - INSTALL="\$(stepdir)/../bin/install-dot-exe.sh -c" + INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c" else DIRSEP='/' PATHSEP=':' LN=ln LN_S='ln -s' ZIP="zip -r -9" - INSTALL="\$(stepdir)/../bin/install-sh -c" + INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c" fi @@ -1004,7 +1058,7 @@ fi echo $ac_n "checking language""... $ac_c" 1>&6 -echo "configure:1008: checking language" >&5 +echo "configure:1062: checking language" >&5 case "$language" in En* | en* | Am* | am* | US* | us*) lang=English;; @@ -1037,7 +1091,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1041: checking for $ac_word" >&5 +echo "configure:1095: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIPROFF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1071,7 +1125,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1075: checking for $ac_word" >&5 +echo "configure:1129: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1105,7 +1159,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1109: checking for $ac_word" >&5 +echo "configure:1163: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2HTML'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1139,7 +1193,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1143: checking for $ac_word" >&5 +echo "configure:1197: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2LATEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1172,7 +1226,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1176: checking for $ac_word" >&5 +echo "configure:1230: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2MAN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1206,7 +1260,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1210: checking for $ac_word" >&5 +echo "configure:1264: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2MSLESS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1240,7 +1294,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1244: checking for $ac_word" >&5 +echo "configure:1298: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2TEXINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1274,7 +1328,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1278: checking for $ac_word" >&5 +echo "configure:1332: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2TXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1303,6 +1357,7 @@ test -n "$YODL2TXT" && break done test -n "$YODL2TXT" || YODL2TXT="-echo no yodl" + YODL2LESS_DIR='$(bindir)/' else @@ -1312,6 +1367,7 @@ test -n "$YODL2TXT" || YODL2TXT="-echo no yodl" + export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT fi if test "x$YODL" = "-echo no yodl"; then @@ -1330,7 +1386,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1334: checking for $ac_word" >&5 +echo "configure:1390: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1493,13 +1549,13 @@ s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g +s%@stepmake@%$stepmake%g s%@package@%$package%g s%@PACKAGE@%$PACKAGE%g s%@PACKAGE_NAME@%$PACKAGE_NAME%g s%@package_depth@%$package_depth%g s%@AUTOGENERATE@%$AUTOGENERATE%g s%@absolute_builddir@%$absolute_builddir%g -s%@stepmake@%$stepmake%g s%@STATE_VECTOR@%$STATE_VECTOR%g s%@CONFIGSUFFIX@%$CONFIGSUFFIX%g s%@host@%$host%g @@ -1528,6 +1584,7 @@ s%@YODL2MAN@%$YODL2MAN%g s%@YODL2MSLESS@%$YODL2MSLESS%g s%@YODL2TEXINFO@%$YODL2TEXINFO%g s%@YODL2TXT@%$YODL2TXT%g +s%@YODL2LESS_DIR@%$YODL2LESS_DIR%g s%@MAKEINFO@%$MAKEINFO%g CEOF diff --git a/stepmake/make/GNUmakefile b/stepmake/make/GNUmakefile index c204b04dc2..fab275e872 100644 --- a/stepmake/make/GNUmakefile +++ b/stepmake/make/GNUmakefile @@ -1,7 +1,7 @@ # file make/Makefile depth = .. -STEPMAKE_TEMPLATES=makedir +STEPMAKE_TEMPLATES=makedir install BLURBS=BLURB # COPERTINA FLAPTEKST ifneq ($(strip $(state-vector)),) @@ -10,4 +10,5 @@ endif include $(depth)/make/stepmake.make - +INSTALLATION_DIR=$(datadir)/make +INSTALLATION_FILES=$(DIST_FILES) diff --git a/stepmake/make/toplevel.make.in b/stepmake/make/toplevel.make.in index 4541064055..f471aaee77 100644 --- a/stepmake/make/toplevel.make.in +++ b/stepmake/make/toplevel.make.in @@ -8,11 +8,11 @@ depth = . # descent order into subdirectories: # +ifeq ($(PACKAGE),STEPMAKE) SUBDIRS = bin make stepmake Documentation -# - -# bootstrap stepmake: -# +else +SUBDIRS = +endif # # list of distribution files: @@ -22,7 +22,6 @@ README_FILES = NEWS README TODO README_TXT_FILES = AUTHORS.txt INSTALL.txt EXTRA_DIST_FILES = $(IN_FILES) VERSION $(README_FILES) $(SCRIPTS) NON_ESSENTIAL_DIST_FILES = $(README_TXT_FILES) - # # bootstrap stepmake: @@ -31,3 +30,21 @@ STEPMAKE_TEMPLATES=toplevel include $(depth)/make/stepmake.make # +# descent order into subdirectories: +# +ifeq ($(PACKAGE),STEPMAKE) +SUBDIRS = bin make stepmake Documentation +else +SUBDIRS = +endif +# + +#urg urg +stepmake/aclocal.m4: + -$(LN) aclocal.m4 $@ + +ifeq ($(PACKAGE),STEPMAKE) +INSTALLATION_DIR=$(datadir) +INSTALLATION_FILES=$(DIST_FILES) $(NON_ESSENTIAL_DIST_FILES) GNUmakefile config.make config.status +include $(stepdir)/install-targets.make +endif diff --git a/stepmake/stepmake/GNUmakefile b/stepmake/stepmake/GNUmakefile index 72d8b8047a..7bdbd3c278 100644 --- a/stepmake/stepmake/GNUmakefile +++ b/stepmake/stepmake/GNUmakefile @@ -10,9 +10,12 @@ depth = .. SUBDIRS = # -STEPMAKE_TEMPLATES=makedir - +STEPMAKE_TEMPLATES=makedir install # bootstrap stepmake: # -include $(depth)/make/stepmake.make + +INSTALLATION_DIR=$(datadir)/stepmake +INSTALLATION_FILES=GNUmakefile $(MAKE_FILES) + diff --git a/stepmake/stepmake/documentation-targets.make b/stepmake/stepmake/documentation-targets.make index 862eebf7f7..59c1b1ecc0 100644 --- a/stepmake/stepmake/documentation-targets.make +++ b/stepmake/stepmake/documentation-targets.make @@ -30,7 +30,7 @@ $(outdir)/$(package).info: $(outdir)/topinfo.texinfo $(OUTTEXINFO_FILES) # what to do here? ifneq ($(strip $(INFO_FILES)),) -INFOINSTALL=$(MAKE) INSTALLATION_OUT_DIR=$(infodir) depth=$(depth) INSTALLATION_OUT_FILES="$(INFO_FILES)" -f $(stepdir)/install-outfiles.sub.make $@ +INFOINSTALL=$(MAKE) INSTALLATION_OUT_DIR=$(infodir) depth=$(depth) INSTALLATION_OUT_FILES="$(INFO_FILES)" -f $(stepdir)/install-out.sub.make $@ localinstall: # $(INFO_FILES) -$(INSTALL) -d $(infodir) diff --git a/stepmake/stepmake/generic-targets.make b/stepmake/stepmake/generic-targets.make index 3ca5d629f1..1d368b0a4b 100644 --- a/stepmake/stepmake/generic-targets.make +++ b/stepmake/stepmake/generic-targets.make @@ -86,6 +86,9 @@ doc++: local-dist: $(DIST_FILES) $(OUT_DIST_FILES) $(NON_ESSENTIAL_DIST_FILES) +# echo topdir=$(topdir) +# echo distdir=$(distdir) +# echo locladir=$(localdir) mkdir -p $(distdir)/$(localdir) $(LN) $(DIST_FILES) $(distdir)/$(localdir) @@ -99,7 +102,9 @@ local-dist: $(DIST_FILES) $(OUT_DIST_FILES) $(NON_ESSENTIAL_DIST_FILES) mkdir $(distdir)/$(localdir)/out; \ $(LN) $(OUT_DIST_FILES) $(distdir)/$(localdir)/out;; \ esac - $(foreach i, $(SUBDIRS), $(MAKE) distdir=../$(distdir) localdir=$(localdir)/$(i) -C $(i) local-dist &&) true +# $(foreach i, $(SUBDIRS), $(MAKE) distdir=../$(distdir) localdir=$(localdir)/$(i) -C $(i) local-dist &&) true +# absolute for installed stepmake + $(foreach i, $(SUBDIRS), $(MAKE) topdir=$(topdir) distdir=$(distdir) localdir=$(localdir)/$(notdir $(i)) -C $(i) local-dist &&) true @@ -118,7 +123,7 @@ $(outdir)/VERSION: $(depth)/VERSION cp $< $@ $(outdir)/version.hh: $(outdir)/VERSION - sh ./$(step-bindir)/make-version.sh $< > $@ + sh $(step-bindir)/make-version.sh $< > $@ # should this be in Rules? configure: configure.in aclocal.m4 diff --git a/stepmake/stepmake/install-out-rules.make b/stepmake/stepmake/install-out-rules.make new file mode 100644 index 0000000000..841db19676 --- /dev/null +++ b/stepmake/stepmake/install-out-rules.make @@ -0,0 +1,2 @@ + +#empty diff --git a/stepmake/stepmake/install-out-targets.make b/stepmake/stepmake/install-out-targets.make new file mode 100644 index 0000000000..eb445927a9 --- /dev/null +++ b/stepmake/stepmake/install-out-targets.make @@ -0,0 +1,41 @@ +# install-out-targets.make + +localinstall: localinstall-files localinstall-outfiles + +localinstall-files: + +# urg, parameterise +localinstall-outfiles: $(INSTALLATION_OUT_FILES) $(INSTALLATION_OUT_FILES1) $(INSTALLATION_OUT_FILES2) + -$(INSTALL) -d $(INSTALLATION_OUT_DIR) + $(foreach i, $(INSTALLATION_OUT_FILES), \ + $(INSTALL) -m 644 $(i) $(INSTALLATION_OUT_DIR) && )true +ifneq ($(strip $(INSTALLATION_OUT_FILES1)),) + -$(INSTALL) -d $(INSTALLATION_OUT_DIR1) + $(foreach i, $(INSTALLATION_OUT_FILES1), \ + $(INSTALL) -m 644 $(i) $(INSTALLATION_OUT_DIR1) && )true +endif +ifneq ($(strip $(INSTALLATION_OUT_FILES2)),) + -$(INSTALL) -d $(INSTALLATION_OUT_DIR2) + $(foreach i, $(INSTALLATION_OUT_FILES2), \ + $(INSTALL) -m 644 $(i) $(INSTALLATION_OUT_DIR2) && )true +endif + +localuninstall: localuninstall-outfiles localuninstall-files + +localuninstall-files: + +localuninstall-outfiles: + $(foreach i, $(notdir $(INSTALLATION_OUT_FILES)), \ + rm -f $(INSTALLATION_OUT_DIR)/$(i) && ) true + -rmdir $(INSTALLATION_OUT_DIR) +ifneq ($(strip $(INSTALLATION_OUT_FILES1)),) + $(foreach i, $(notdir $(INSTALLATION_OUT_FILES1)), \ + rm -f $(INSTALLATION_OUT_DIR1)/$(i) && ) true + -rmdir $(INSTALLATION_OUT_DIR1) +endif +ifneq ($(strip $(INSTALLATION_OUT_FILES2)),) + $(foreach i, $(notdir $(INSTALLATION_OUT_FILES2)), \ + rm -f $(INSTALLATION_OUT_DIR2)/$(i) && ) true + -rmdir $(INSTALLATION_OUT_DIR2) +endif +# -(cd $(INSTALLATION_OUT_DIR)/..; dir=`dirname \`pwd\`` cd ..; rmdir $$dir) diff --git a/stepmake/stepmake/install-out-vars.make b/stepmake/stepmake/install-out-vars.make new file mode 100644 index 0000000000..841db19676 --- /dev/null +++ b/stepmake/stepmake/install-out-vars.make @@ -0,0 +1,2 @@ + +#empty diff --git a/stepmake/stepmake/install-out.sub.make b/stepmake/stepmake/install-out.sub.make new file mode 100644 index 0000000000..cd95c35f5b --- /dev/null +++ b/stepmake/stepmake/install-out.sub.make @@ -0,0 +1,5 @@ +# install-out.sub.make + +include $(depth)/make/stepmake.make +include $(stepdir)/install-out-targets.make + diff --git a/stepmake/stepmake/install-rules.make b/stepmake/stepmake/install-rules.make new file mode 100644 index 0000000000..841db19676 --- /dev/null +++ b/stepmake/stepmake/install-rules.make @@ -0,0 +1,2 @@ + +#empty diff --git a/stepmake/stepmake/install-targets.make b/stepmake/stepmake/install-targets.make new file mode 100644 index 0000000000..aa648c3541 --- /dev/null +++ b/stepmake/stepmake/install-targets.make @@ -0,0 +1,49 @@ +# install-targets.make + +localinstall: localinstall-files localinstall-outfiles + +localinstall-outfiles: + +# urg, parameterise +localinstall-files: + $(PRE_INSTALL) + -$(INSTALL) -d $(INSTALLATION_DIR) + $(foreach i, $(INSTALLATION_FILES),\ + $(INSTALL) -m 644 $(i) $(INSTALLATION_DIR) &&)true + $(POST_INSTALL) +ifneq ($(strip $(INSTALLATION_FILES1)),) + $(PRE_INSTALL1) + -$(INSTALL) -d $(INSTALLATION_DIR1) + $(foreach i, $(INSTALLATION_FILES1),\ + $(INSTALL) -m 644 $(i) $(INSTALLATION_DIR1) &&)true + $(POST_INSTALL1) +endif +ifneq ($(strip $(INSTALLATION_FILES2)),) + $(PRE_INSTALL2) + -$(INSTALL) -d $(INSTALLATION_DIR2) + $(foreach i, $(INSTALLATION_FILES2),\ + $(INSTALL) -m 644 $(i) $(INSTALLATION_DIR2) &&)true + $(POST_INSTALL2) +endif + +localuninstall: localuninstall-outfiles localuninstall-files + +localuninstall-outfiles: + +localuninstall-files: + $(foreach i, $(INSTALLATION_FILES),\ + rm -f $(INSTALLATION_DIR)/$(i) && ) true + -$(foreach i, $(SUBDIRS), rmdir $(INSTALLATION_DIR)/$(i); ) + -rmdir $(INSTALLATION_DIR) +ifneq ($(strip $(INSTALLATION_FILES1)),) + $(foreach i, $(INSTALLATION_FILES1),\ + rm -f $(INSTALLATION_DIR1)/$(i) && ) true + -$(foreach i, $(SUBDIRS), rmdir $(INSTALLATION_DIR1)/$(i); ) + -rmdir $(INSTALLATION_DIR1) +endif +ifneq ($(strip $(INSTALLATION_FILES2)),) + $(foreach i, $(INSTALLATION_FILES2),\ + rm -f $(INSTALLATION_DIR2)/$(i) && ) true + -$(foreach i, $(SUBDIRS), rmdir $(INSTALLATION_DIR2)/$(i); ) + -rmdir $(INSTALLATION_DIR2) +endif diff --git a/stepmake/stepmake/install-vars.make b/stepmake/stepmake/install-vars.make new file mode 100644 index 0000000000..841db19676 --- /dev/null +++ b/stepmake/stepmake/install-vars.make @@ -0,0 +1,2 @@ + +#empty diff --git a/stepmake/stepmake/install.sub.make b/stepmake/stepmake/install.sub.make new file mode 100644 index 0000000000..7a4dc59e2b --- /dev/null +++ b/stepmake/stepmake/install.sub.make @@ -0,0 +1,5 @@ +# install.sub.make + +include $(depth)/make/stepmake.make +include $(stepdir)/install-targets.make + diff --git a/stepmake/stepmake/metapost-rules.make b/stepmake/stepmake/metapost-rules.make index 866786d15b..a33b8cdd52 100644 --- a/stepmake/stepmake/metapost-rules.make +++ b/stepmake/stepmake/metapost-rules.make @@ -4,7 +4,7 @@ $(outdir)/%.pfa: %.mf # i've got no idea what this scaling could be for, on both sides... # it seems that 'low_res', which should be all we ever need according # to the metapost mfplain guru, really does 200dpi, iso 600dpi (minimun) - $(METAPOST) "&mfplain \mode=lowres; \mag=100.0; batchmode; input $<" + -$(METAPOST) "&mfplain \mode=lowres; \mag=100.0; batchmode; input $<" # -$(METAPOST) "&mfmp \mode=ljfour; \mag=100.0; batchmode; input $<" $(PYTHON) $(depth)/buildscripts/ps-to-pfa.py $< rm -f $(basename $(@F)).[0-9]* diff --git a/stepmake/stepmake/toplevel-targets.make b/stepmake/stepmake/toplevel-targets.make index b5423aa25d..32e734cba2 100644 --- a/stepmake/stepmake/toplevel-targets.make +++ b/stepmake/stepmake/toplevel-targets.make @@ -13,9 +13,10 @@ local-maintainerclean: GNUmakefile: make/toplevel.make.in $(MAKE) INFILE=$< OUTFILE=$@ -f $(stepdir)/automatically-generated.sub.make -aclocal.m4: $(stepdir)/../aclocal.m4 +ifneq ($(PACKAGE),STEPMAKE) +aclocal.m4: $(stepmake)/aclocal.m4 $(MAKE) INFILE=$< OUTFILE=$@ LINECOMMENT=dnl -f $(stepdir)/automatically-generated.sub.make - +endif local-WWW: #index.html @@ -35,7 +36,7 @@ dist: # ugh. # Can't compare "stage1" dist with "stage2" dist in this way? -ln -f $(depth)/$(outdir)/$(distname).tar.gz $(release-dir) - rm -rf ./$(distdir)/ + rm -rf $(distdir)/ local-help: @echo -e "\ diff --git a/tex/GNUmakefile b/tex/GNUmakefile index 86bf7797b0..1befb1f496 100644 --- a/tex/GNUmakefile +++ b/tex/GNUmakefile @@ -6,10 +6,10 @@ depth = .. TEX_FILES = $(wildcard *.tex) EXTRA_DIST_FILES = $(TEX_FILES) lilyponddefs.ps +STEPMAKE_TEMPLATES=install INSTALLATION_DIR=$(datadir)/tex/ INSTALLATION_FILES=$(TEX_FILES) include $(depth)/make/stepmake.make -include $(stepdir)/installfiles.make diff --git a/tex/lilyponddefs.ps b/tex/lilyponddefs.ps index b3ba94564e..467dc4589a 100644 --- a/tex/lilyponddefs.ps +++ b/tex/lilyponddefs.ps @@ -15,7 +15,8 @@ { /object exch def gsave - exch translate + %exch translate + translate 0 0 moveto object grestore @@ -67,7 +68,7 @@ stafflinethickness 1.6 mul widthbar } bind def -/maatstreep +/maatstreep % height { thinbar } bind def @@ -77,8 +78,9 @@ thickbar } bind def -/generalmeter +/generalmeter % num den { + pop pop } bind def /pianobrace @@ -110,7 +112,8 @@ yoffset staffheight 8 mul sub /yoffset exch def } bind def -/unknown {} bind def +/unknown { (U) show} bind def +/empty {(E) show} bind def /turnOnExperimentalFeatures { } bind def