]> git.donarmstrong.com Git - lilypond.git/commitdiff
* flower/string.cc (substitute): Take two strings or two
authorJan Nieuwenhuizen <janneke@gnu.org>
Thu, 12 May 2005 11:32:49 +0000 (11:32 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Thu, 12 May 2005 11:32:49 +0000 (11:32 +0000)
characters.  Update callers.

* flower/file-name.cc (File_name): Slashify.

* scm/lily.scm: Use gui-main iso lilypond-main on MINGW.

* scripts/GNUmakefile (SEXECUTABLES): Add lilypond-invoke-editor.

* stepmake/aclocal.m4 (STEPMAKE_WINDOWS): New function.

* configure.in (gui_b): Use it.

* lily/lilypond.rc.in: New file.

* lily/GNUmakefile[PLATFROM_WINDOWS]: Compile it into executable.

18 files changed:
ChangeLog
Documentation/user/point-and-click.itely
config.hh.in
config.make.in
configure.in
flower/file-name.cc
flower/include/string.hh
flower/string.cc
lily/GNUmakefile
lily/font-metric.cc
lily/main.cc
make/stepmake.make
make/substitute.make
scm/lily.scm
scripts/GNUmakefile
stepmake/aclocal.m4
stepmake/stepmake/c++-rules.make
stepmake/stepmake/c-rules.make

index d2a7ca4a69d5f38befd567b4acafb3a1a767efb2..8dcbd8eaadadfbfa06a173582f3c51681badef07 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2005-05-12  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * flower/string.cc (substitute): Take two strings or two
+       characters.  Update callers.
+
+2005-05-11  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * flower/file-name.cc (File_name): Slashify.
+
+       * scm/lily.scm: Use gui-main iso lilypond-main on MINGW.
+
+       * scripts/GNUmakefile (SEXECUTABLES): Add lilypond-invoke-editor.
+
+       * stepmake/aclocal.m4 (STEPMAKE_WINDOWS): New function.
+
+       * configure.in (gui_b): Use it.
+
+       * lily/lilypond.rc.in: New file.
+
+       * lily/GNUmakefile[PLATFROM_WINDOWS]: Compile it into executable.
+
 2005-05-12  Graham Percival  <gperlist@shaw.ca>
 
        * Documentation/user/advanced-notation.itely: edit of Text
@@ -32,6 +53,7 @@
        * input/test/volta-chord-names.ly: Bring the explanation up to
        date.
 
+>>>>>>> 1.3600
 2005-05-11  Heikki Junes  <hjunes@cc.hut.fi>
 
         * Documentation/topdocs/{AUTHORS.texi,INSTALL.texi,README.texi}:
index 5db84e7c7cad4c750016d0f6c089ed7881afa163..663797d7d33f7c2c9eaf3a1adde0b699fbf0ba6e 100644 (file)
@@ -35,6 +35,15 @@ lines to the @file{prefs.js}@footnote{On a typical unix system, this
 file is found in your home-directory under
 @file{.mozilla/firefox/default.trn/prefs.js}.}  
 
+@ignore
+mozilla wants us do store this in user.js:
+http://www.mozilla.org/support/firefox/edit#user
+
+location on different systems:
+http://www.mozilla.org/support/firefox/edit#profile
+
+@end ignore
+
 @example
 user_pref("network.protocol-handler.app.textedit", "lilypond-pdfpc-helper");
 user_pref("network.protocol-handler.warn-external.textedit", false);
index a0c9473de6cefe3ff12708ca34278033384a8fcb..fbf7d512bb2906254d2145890bffee18b7bbb212 100644 (file)
@@ -74,6 +74,9 @@
 #define DIRSEP '@DIRSEP@'
 #define PATHSEP '@PATHSEP@'
 
+/* define if you have some kind of windows platform */
+#define PLATFORM_WINDOWS 0
+
 /* define if you have assert.h */
 #define HAVE_ASSERT_H 0
 
index ec381e6fc4291e641081eb8f5f3c3d2292f92aa9..7a56d7bdc3d443409cf497cc913d831d6b0ceebc 100644 (file)
@@ -100,6 +100,7 @@ MSGFMT = @MSGFMT@
 PAPERSIZE=a4
 PATHSEP = @PATHSEP@
 PERL = @PERL@
+PLATFORM_WINDOWS = @PLATFORM_WINDOWS@
 PYTHON = @PYTHON@
 RANLIB = @RANLIB@
 ROOTSEP = @ROOTSEP@
@@ -107,5 +108,6 @@ SHELL = @SHELL@
 SPLITTING_MAKEINFO = @SPLITTING_MAKEINFO@
 TAR = @TAR@
 TTFTOOL_ENDIAN = @TTFTOOL_ENDIAN@
+WINDRES = @WINDRES@
 YACC = @YACC@
 ZIP = @ZIP@
index a3ca5b74af32cd0889a00c5cc1e0ce5cd8c32677..2f68128636df8a0d58bdbb67d5998ebcabd6b9f8 100644 (file)
@@ -85,6 +85,8 @@ AC_C_BIGENDIAN(TTFTOOL_ENDIAN="-DBIGENDIAN",
                TTFTOOL_ENDIAN="-DSMALLENDIAN")
 AC_SUBST(TTFTOOL_ENDIAN)
 
+STEPMAKE_WINDOWS
+
 ## Optional tools for building documentation, website, extra fonts.
 
 # guile executable for some scripts
index 12a63ba694f8c65e52ca463f04ddb6d6f630029d..dd83ac68fcd0c10dcde12de908fb5b96a16b3df8 100644 (file)
@@ -72,11 +72,14 @@ File_name::to_str0 () const
 File_name::File_name (String file_name)
 {
 #ifdef __CYGWIN__
-  /* All system functions would work, even if we don't convert to
-     posix file_name, but we'd think that \foe\bar\baz.ly is in the cwd.
-     On by default.  */
+  /* All system functions would work, even if we do not convert to
+     posix file_name, but we would think that \foe\bar\baz.ly is in
+     the cwd.  */
   file_name = dos_to_posix (file_name);
 #endif
+#ifdef __MINGW32__
+  file_name.substitute ('\\', '/');
+#endif
 
   int i = file_name.index (ROOTSEP);
   if (i >= 0)
index d4787b3a7a11a003536eab329dba0bc55a8c9916..dbe289b3ea3f2268de67ac5c06012f1d610f36c0 100644 (file)
@@ -144,7 +144,8 @@ public:
   /// convert to a double
   double to_double () const;
 
-  void substitute_char (char text, String sub);
+  void substitute (String find, String replace);
+  void substitute (char find, char replace);
 };
 
 /*
index fb270dd30db82ae5c909e40f17b895e8e0412327..0280508d671b377f881692f0402de6b77cc70ffc 100644 (file)
@@ -383,8 +383,16 @@ String::print_on (ostream &os) const
 #endif
 
 void
-String::substitute_char (char chr, String sub)
+String::substitute (String find, String replace)
 {
-  for (int i = index (chr); i > -1; i = index (chr))
-    *this = left_string (i) + sub + right_string (length () - i - 1);
+  int n = replace.length ();
+  for (int i = index (find); i > - 1; i = index (find))
+    *this = left_string (i) + find + right_string (length () - i - n);
+}
+
+void
+String::substitute (char find, char replace)
+{
+  for (int i = index (find); i > - 1; i = index (find))
+    (*this)[i] = replace;
 }
index 257a416756ffb9fed70dc83f595e8034df2def8f..8d3fb024a062e437b87e357b819797775451c0d6 100644 (file)
@@ -9,7 +9,7 @@ MODULE_INCLUDES= $(depth)/flower/include $(depth)/ttftool/include
 MODULE_CXXFLAGS=
 
 HELP2MAN_EXECS = lilypond
-STEPMAKE_TEMPLATES= c++ executable po help2man
+STEPMAKE_TEMPLATES=c c++ executable po help2man
 
 OUT_DIST_FILES=$(addprefix $(outdir)/,parser.cc parser.hh)
 
@@ -25,6 +25,16 @@ endif
 # USER_LDFLAGS += -static -lltdl -ldl
 #
 
+ifeq ($(PLATFORM_WINDOWS),yes)
+WINDRES_FLAGS += -DLilyPond=1
+O_FILES += $(outdir)/lilypond.rc.o
+$(outdir)/lilypond: $(outdir)/lilypond.rc.o
+
+$(outdir)/lilypond.rc.o: $(outdir)/lilypond.ico
+$(outdir)/lilypond.ico: $(abs-srcdir)/Documentation/pictures/lelie-logo.xpm
+       convert $< $@ 
+endif
+
 ETAGS_FLAGS += --regex='{c++}/^LY_DEFINE *(\([^,]+\)/\1/'
 ETAGS_FLAGS += --regex='{c++}/^LY_DEFINE *([^"]*"\([^"]+\)"/\1/'
 
@@ -48,3 +58,4 @@ local-po: $(outdir)/parser.cc
 ifneq ($(srcdir), .)
 .PRECIOUS: $(outdir)/lexer.cc $(outdir)/parser.cc
 endif
+
index a08589fe815261380fb99e3efc72c2d74a46f001..a3acc19d88c68fc0be9f9ef527c6d6df67148c43 100644 (file)
@@ -31,7 +31,7 @@ Font_metric::design_size () const
 Stencil
 Font_metric::find_by_name (String s) const
 {
-  s.substitute_char ('-', "M");
+  s.substitute ('-', 'M');
   int idx = name_to_index (s);
   Box b;
 
index 05cc5a9e82dfa056aab9a96d4d727eb08ed9b953..093a8a69d6f58422880b7d3474c23ec8f1ef3198 100644 (file)
@@ -596,12 +596,12 @@ main (int argc, char **argv)
   setup_localisation ();
   setup_paths ();
   parse_argv (argc, argv);
+  /* FIXME: this still needs a terminal even when using gui-main after
+     booting guile.  Maybe use a --quiet command line switch?  */
   identify (stderr);
 
   scm_boot_guile (argc, argv, main_with_guile, 0);
 
-  /*
-    If we get here, GUILE exited. This is an error.
-   */
+  /* Only reachable if GUILE exits.  That is an error.  */
   return 1;
 }
index 71dde6f7f8940545c24dae69154970129f927c47..9b1767fa06a5b082add1e2160f149164a683276a 100644 (file)
@@ -35,6 +35,8 @@ endif
 endif
 
 include $(depth)/make/toplevel-version.make
+MICRO_VERSION=$(PATCH_LEVEL)
+BUILD_VERSION=1
 
 # Use alternate configurations alongside eachother:
 #
index e45f57c72e51a7deec4101ed0068207a1f4d40fb..289856b0f287efbeccd12dee810f25797970ad1e 100644 (file)
@@ -6,10 +6,15 @@ include $(stepdir)/substitute-rules.make
 
 ATVARIABLES = \
   BASH\
+  BUILD_VERSION\
   DATE\
   FONTFORGE\
   GUILE\
+  MICRO_VERSION\
+  MAJOR_VERSION\
+  MINOR_VERSION\
   PACKAGE\
+  PATCH_LEVEL\
   PATHSEP\
   PERL\
   PYTHON\
@@ -23,9 +28,11 @@ ATVARIABLES = \
   local_lilypond_datadir\
   local_lilypond_libdir\
   localedir\
+  outdir\
   package\
   prefix\
   program_prefix\
   program_suffix\
   sharedstatedir\
+  srcdir\
   step-bindir\
index 31d482a17e55663059bfac1affa63042868d5cb3..7a7e47cc56579aa50fb6ae999b1e001f02a78c97 100644 (file)
@@ -15,8 +15,9 @@
             (ice-9 safe)
              (ice-9 optargs)
             (oop goops)
-            (srfi srfi-1)  ;; lists
-            (srfi srfi-13)) ;; strings
+            (srfi srfi-1)
+            (srfi srfi-13)
+            (srfi srfi-14))
 
 
 ;; my display
@@ -343,6 +344,7 @@ The syntax is the same as `define*-public'."
         (log-file (open-file log-name "w")))
     (display "# -*-compilation-*-" log-file)
     (newline log-file)
+    ;; Ugh, this opens a terminal
     (ly:message (_ "Redirecting output to ~a...") log-name)
     (ly:port-move (fileno (current-error-port)) log-file)
     (if (null? (lilypond-all files))
@@ -361,5 +363,22 @@ The syntax is the same as `define*-public'."
         (cmd (get-editor-command ly 0 0)))
     (system cmd)))
 
-;; FIXME
-;; (define lilypond-main gui-main)
+
+;; Mingw
+;; #(Windows XP HOSTNAME build 2600 5.01 Service Pack 1 i686)
+
+;; Cygwin
+;; #(CYGWIN_NT-5.1 Hostname 1.5.12(0.116/4/2) 2004-11-10 08:34 i686)
+
+;; Debian
+;; #(Linux hostname 2.4.27-1-686 #1 Fri Sep 3 06:28:00 UTC 2004 i686)
+
+(case (string->symbol
+       (string-downcase
+       (car (string-tokenize (vector-ref (uname) 0) char-set:letter))))
+  ((linux) #t)
+  ;; On mingw, use gui-main
+  ((windows) (define lilypond-main gui-main)))
+
+;;(if (ly:get-option 'quiet)
+;;    (define lilypond-main gui-main))
index 90ff74929cb23ec23d6acb58af28298829122401..30ffc7f87046a9e0a7dcc4850738b180a14ad53a 100644 (file)
@@ -1,6 +1,6 @@
 depth = ..
 
-SEXECUTABLES=convert-ly lilypond-book abc2ly etf2ly mup2ly midi2ly lilypond-ps2png lilypond-pdfpc-helper
+SEXECUTABLES=convert-ly lilypond-book abc2ly etf2ly mup2ly midi2ly lilypond-ps2png lilypond-pdfpc-helper lilypond-invoke-editor
 
 STEPMAKE_TEMPLATES=script help2man po
 LOCALSTEPMAKE_TEMPLATES = lilypond
index fbd6dbc19ec0aaa0662f50218c1ed08cc0f800a7..3d25be295d2ef227a43a5f63428518cf10fe7274 100644 (file)
@@ -25,8 +25,7 @@ AC_DEFUN(STEPMAKE_GET_VERSION, [
     ##
     ## -V: Workaround for python
 
-    changequote(<<, >>)dnl
-    ##set -x
+    changequote(<<, >>)#dnl
     ## Assume and hunt for dotted version multiplet.
     ## use eval trickery, because we cannot use multi-level $() instead of ``
     ## for compatibility reasons.
@@ -42,8 +41,7 @@ AC_DEFUN(STEPMAKE_GET_VERSION, [
            | sed -e 's/^[^.0-9]*//' -e 's/[^.0-9]*$//'\`\"
     fi
     echo "$_ver"
-    ##set +x
-    changequote([, ])dnl
+    changequote([, ])#dnl
 ])
 
 # Calculate simplistic numeric version from version string ($1)
@@ -519,11 +517,11 @@ AC_DEFUN(STEPMAKE_GUILE_DEVEL, [
     AC_SUBST(GUILE_CONFIG)
     
     guile_version="$ver"
-    changequote(<<, >>)dnl
+    changequote(<<, >>)#dnl
     GUILE_MAJOR_VERSION=`expr $guile_version : '\([0-9]*\)'`
     GUILE_MINOR_VERSION=`expr $guile_version : '[0-9]*\.\([0-9]*\)'`
     GUILE_PATCH_LEVEL=`expr $guile_version : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
-    changequote([, ])dnl
+    changequote([, ])#dnl
     STEPMAKE_GUILE_FLAGS
     save_CPPFLAGS="$CPPFLAGS"
     save_LIBS="$LIBS"
@@ -570,10 +568,10 @@ AC_DEFUN(STEPMAKE_INIT, [
     fi
     export MAJOR_VERSION MINOR_VERSION PATCH_LEVEL
     # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
-    changequote(<<, >>)dnl
+    changequote(<<, >>)#dnl
     PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
     package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
-    changequote([, ])dnl
+    changequote([, ])#dnl
 
     # No versioning on directory names of sub-packages 
     # urg, urg
@@ -708,26 +706,16 @@ AC_DEFUN(STEPMAKE_INIT, [
            # STEPMAKE_WARN($warn)
            STEPMAKE_ADD_ENTRY(REQUIRED, $warn)
         fi
-    fi 
-
-    if test "$OSTYPE" = "cygwin" -o "$OSTYPE" = "cygwin32" -o "$OSTYPE" = "Windows_NT"; then
-       LN=cp # hard link does not work under cygnus-nt
-       LN_S='cp -r' # symbolic link does not work for native nt
-       ZIP="zip -r -9" #
-       program_suffix=.exe
-       ROOTSEP=':'
-        DIRSEP='/'
-       PATHSEP=':'
-       INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
-    else
-       ROOTSEP=':'
-       DIRSEP='/'
-       PATHSEP=':'
-       LN=ln
-       LN_S='ln -s'
-       ZIP="zip -r -9"
-        INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
     fi
+
+    ROOTSEP=':'
+    DIRSEP='/'
+    PATHSEP=':'
+    LN=ln
+    LN_S='ln -s'
+    ZIP="zip -r -9"
+    INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
+
     AC_SUBST(program_prefix)
     AC_SUBST(program_suffix)
     AC_SUBST(ZIP)
@@ -971,11 +959,11 @@ AC_DEFUN(STEPMAKE_PYTHON, [
 AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
     unset PYTHON_HEADER PYTHON_INCLUDE
     if test -n "$PYTHON"; then
-       changequote(<<, >>)dnl
+       changequote(<<, >>)#dnl
        # alternatively, for python >= 2.0
        # 'import sys, distutils.sysconfig; sys.stdout.write (distutils.sysconfig.get_python_inc ())'
        PYTHON_INCLUDE=`$PYTHON -c 'import sys; sys.stdout.write ("%s/include/python%s" % (sys.prefix, sys.version[:3]))'`
-       changequote([, ])dnl
+       changequote([, ])#dnl
     fi
     
     ##AC_CHECK_HEADERS([Python.h],[PYTHON_HEADER=yes])
@@ -1178,3 +1166,31 @@ AC_DEFUN(STEPMAKE_FONTCONFIG, [
        STEPMAKE_ADD_ENTRY($2, ["$r >= $3 (installed: $ver)"])
     fi
 ])
+
+AC_DEFUN(STEPMAKE_WINDOWS, [
+    AC_CYGWIN
+    AC_MINGW32
+
+    if test "$CYGWIN" == "yes"; then
+       LN_S='cp -r' # Cygwin symbolic links do not work for native apps.
+       program_suffix=.exe
+       INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
+    elif test "$MINGW" == "yes"; then
+       LN='cp -r'
+       LN_S='cp -r'
+       program_suffix=.exe
+       INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
+       PATHSEP=';'
+    fi
+    
+    AC_MSG_CHECKING([for some flavor of Windows])
+    if test "$CYGWIN$MINGW32" == "nono"; then
+        PLATFORM_WINDOWS=no
+    else
+        PLATFORM_WINDOWS=yes
+    fi
+    AC_MSG_RESULT([$PLATFORM_WINDOWS])
+    AC_SUBST(PLATFORM_WINDOWS)
+    STEPMAKE_PROGS(WINDRES, $target-windres windres, x)
+    AC_SUBST(WINDRES)
+])
index 2f561180c9cab78f8ef653435daa0c6ea0ca8f16..061f6305d8fd92d6a69bf029a94f1db67be10d31 100644 (file)
@@ -26,3 +26,6 @@ $(outdir)/%.hh: %.yy
 
 $(outdir)/%.cc: %.ll
        $(FLEX) -Cfe -p -p -o$@ $< 
+
+$(outdir)/%-rc.o: $(outdir)/%.rc
+       $(WINDRES) $(WINDRES_FLAGS) -o$@ $<
index 289e6c24850cda7bce55432263e6a901c43aab4b..d6d6a9b36dca995054d655829e55126ea9a16611 100644 (file)
@@ -26,3 +26,5 @@ $(outdir)/%.c: %.l
 # could be faster:
 #      $(FLEX) -8 -Cf -o$@ $< 
 
+$(outdir)/%.rc.o: $(outdir)/%.rc
+       $(WINDRES) $(WINDRES_FLAGS) -o$@ $<