From 6c0a242bac0f7b3538adce970b5543cc415b46c4 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 2 May 2005 12:39:28 +0000 Subject: [PATCH] * flower/include/international.hh: Bugfix: include "string.hh". * flower/include/libc-extension.hh (memrev): Rename from strrev. * configure.in: Search for mingw wcrtomb library. --- ChangeLog | 10 ++++++++++ config.hh.in | 27 +++++++++++++++++++++------ configure.in | 7 ++++--- cygwin/mknetrel | 7 ++++--- flower/include/international.hh | 2 ++ flower/include/libc-extension.hh | 7 ++++++- flower/libc-extension.cc | 2 +- flower/string.cc | 2 +- lily/general-scheme.cc | 2 +- lily/include/font-metric.hh | 2 +- lily/include/lily-guile.hh | 6 +++++- lily/lily-guile.cc | 18 ++++++++++-------- lily/main.cc | 14 ++++++++++++-- lily/open-type-font.cc | 7 +++---- lily/source-file.cc | 4 ++-- po/nl.po | 4 ++-- 16 files changed, 85 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ab9f1e581..fc6a9bc049 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-05-02 Jan Nieuwenhuizen + + * flower/include/international.hh: Bugfix: include "string.hh". + + * lily/include/mingw-compatibility.hh: New file. + + * flower/include/libc-extension.hh (memrev): Rename from strrev. + + * configure.in: Search for mingw wcrtomb library. + 2005-05-02 Mats Bengtsson * scripts/convert-ly.py: Bug fix diff --git a/config.hh.in b/config.hh.in index bd0e19a252..a0c9473de6 100644 --- a/config.hh.in +++ b/config.hh.in @@ -10,6 +10,9 @@ /* default lilypond locale dir */ #define LOCALEDIR "@LOCALEDIR@" +/* define if you have chroot */ +#define HAVE_CHROOT 0 + /* define if you have fopencookie */ #define HAVE_FOPENCOOKIE 0 @@ -19,27 +22,36 @@ /* define if you have gettext */ #define HAVE_GETTEXT 0 +/* define if you have isinf */ +#define HAVE_ISINF 0 + +/* define if you have lrint */ +#define HAVE_LRINT 0 + /* define if you have memmem */ #define HAVE_MEMMEM 0 +/* define if you have mbrtowc */ +#define HAVE_MBRTOWC 0 + /* define if you have snprintf */ #define HAVE_SNPRINTF 0 /* define if you have vsnprintf */ #define HAVE_VSNPRINTF 0 +/* define if you have wcrtomb */ +#define HAVE_WCRTOMB 0 + /* define if you have yyFlexLexer.yy_current_buffer */ #undef HAVE_FLEXLEXER_YY_CURRENT_BUFFER -/* define if you have isinf */ -#define HAVE_ISINF 0 - -/* define if you have lrint */ -#define HAVE_LRINT 0 - /* define if you want KPATHSEA */ #define KPATHSEA @KPATHSEA@ +/* define if you have grp header */ +#define HAVE_GRP_H 0 + /* define if you have kpatsea header */ #define HAVE_KPATHSEA_KPATHSEA_H 0 @@ -49,6 +61,9 @@ /* define if you have kpse_find_tfm */ #define HAVE_KPSE_FIND_TFM 0 +/* define if you have pwd header */ +#define HAVE_PWD_H 0 + /* define if you have Python.h header */ #define HAVE_PYTHON_H 0 diff --git a/configure.in b/configure.in index 8de34b0d97..bfa2d26df3 100644 --- a/configure.in +++ b/configure.in @@ -32,7 +32,7 @@ STEPMAKE_COMPILE STEPMAKE_KPATHSEA -STEPMAKE_PYTHON(REQUIRED,2.1) +STEPMAKE_PYTHON(REQUIRED, 2.1) STEPMAKE_GCC(REQUIRED, 2.8) STEPMAKE_CXX(REQUIRED) STEPMAKE_GXX(REQUIRED, 3.0.5) @@ -59,15 +59,16 @@ STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, OPTIONAL, 8.14) STEPMAKE_PROGS(MFTRACE, mftrace, REQUIRED, 1.1.1) STEPMAKE_PATH_PROG(FONTFORGE, fontforge, REQUIRED, 20041208) -AC_CHECK_HEADERS([assert.h libio.h sys/stat.h]) +AC_CHECK_HEADERS([assert.h grp.h libio.h pwd.h sys/stat.h wchar.h]) AC_LANG_PUSH(C++) AC_CHECK_HEADERS([sstream]) AC_LANG_POP(C++) AC_HEADER_STAT AC_FUNC_MEMCMP AC_FUNC_VPRINTF -AC_CHECK_FUNCS([fopencookie funopen gettext isinf memmem snprintf vsnprintf]) +AC_CHECK_FUNCS([chroot fopencookie funopen gettext isinf mbrtowc memmem snprintf vsnprintf wcrtomb]) AC_CHECK_HEADERS([utf8/wchar.h], LIBS="$LIBS -lutf8") +AC_SEARCH_LIBS(wcrtomb, [mingwex msvcp60]) STEPMAKE_PROGS(PKG_CONFIG, pkg-config, REQUIRED, 0.9.0) if test "$gui_b" = "yes"; then diff --git a/cygwin/mknetrel b/cygwin/mknetrel index 5de8c13443..47c3a5733e 100644 --- a/cygwin/mknetrel +++ b/cygwin/mknetrel @@ -104,10 +104,11 @@ exit 0 EOF chmod 755 i686-cygwin-guile-config PATH=$(pwd):$PATH - export PKG_CONFIG_PATH=$cygwin_root/usr/lib/pkgconfig + export PKG_CONFIG_PATH=$cygwin_prefix/lib/pkgconfig export PKG_CONFIG="pkg-config \ ---define-variable prefix=$cygwin_root \ ---define-variable includedir=$cygwin_root/usr/include" +--define-variable prefix=$cygwin_prefix \ +--define-variable includedir=$cygwin_prefix/include \ +--define-variable libdir=$cygwin_prefix/lib" fi export CFLAGS="-DKPSE_DLL" } diff --git a/flower/include/international.hh b/flower/include/international.hh index 5d1d27f40e..095e47b43e 100644 --- a/flower/include/international.hh +++ b/flower/include/international.hh @@ -9,6 +9,8 @@ #ifndef INTERNATIONAL_HH #define INTERNATIONAL_HH +#include "string.hh" + /** Internationalisation: _i ("to be translated") gets an entry in the POT file gettext () must be invoked explicitely to do the actual "translation". diff --git a/flower/include/libc-extension.hh b/flower/include/libc-extension.hh index 62e5a5a2b8..3ee0fe426c 100644 --- a/flower/include/libc-extension.hh +++ b/flower/include/libc-extension.hh @@ -107,8 +107,13 @@ extern "C" { } /* extern "C" */ #endif +#if ! HAVE_MEMRCHR unsigned char *memrchr (unsigned char const *p, int n, char c); -unsigned char *strrev (unsigned char *byte, int length_i); +#endif + +#if ! HAVE_MEMREV +unsigned char *memrev (unsigned char *byte, int length_i); +#endif double my_round (double); diff --git a/flower/libc-extension.cc b/flower/libc-extension.cc index 3fa6e9b2d8..51aabebe05 100644 --- a/flower/libc-extension.cc +++ b/flower/libc-extension.cc @@ -121,7 +121,7 @@ my_swap (T &t1, T &t2, T &tmp) } unsigned char * -strrev (unsigned char *byte, int length) +memrev (unsigned char *byte, int length) { unsigned char tmp_byte; unsigned char *left = byte; diff --git a/flower/string.cc b/flower/string.cc index b191804013..fb270dd30d 100644 --- a/flower/string.cc +++ b/flower/string.cc @@ -348,7 +348,7 @@ String::to_lower () void String::reverse () { - strrev (get_bytes (), length ()); + memrev (get_bytes (), length ()); } int diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index 830cd6eaca..7b9233fd10 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -9,7 +9,6 @@ #include "config.hh" -#include /* gettext on MacOS X */ #include /* isinf */ #include #include /* memset */ @@ -19,6 +18,7 @@ #include /* wcrtomb */ #endif +#include "international.hh" #include "libc-extension.hh" #include "lily-guile.hh" #include "string.hh" diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index 48d16b8316..a8846aa568 100644 --- a/lily/include/font-metric.hh +++ b/lily/include/font-metric.hh @@ -10,8 +10,8 @@ #define FONT_METRIC_HH #include "box.hh" -#include "smobs.hh" #include "lily-proto.hh" +#include "smobs.hh" class Font_metric { diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index ec63fdcce8..dd28743ccf 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -9,10 +9,14 @@ #ifndef LILY_GUILE_HH #define LILY_GUILE_HH +#if __MINGW32__ +#include "mingw-compatibility.hh" +#endif + #include -#include "interval.hh" #include "guile-compatibility.hh" +#include "interval.hh" #include "lily-guile-macros.hh" #include "ly-module.hh" diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index e485c86fec..a7b3511a63 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -7,25 +7,27 @@ Han-Wen Nienhuys */ +#include "lily-guile.hh" + #include #include #include /* strdup, strchr */ #include -#include // gettext on macos x #include "config.hh" -#include "version.hh" -#include "lily-guile.hh" + +#include "dimensions.hh" +#include "direction.hh" +#include "file-path.hh" +#include "international.hh" #include "libc-extension.hh" #include "main.hh" -#include "file-path.hh" -#include "warn.hh" -#include "direction.hh" +#include "misc.hh" #include "offset.hh" #include "pitch.hh" -#include "dimensions.hh" #include "source-file.hh" -#include "misc.hh" +#include "version.hh" +#include "warn.hh" // #define TEST_GC diff --git a/lily/main.cc b/lily/main.cc index 690f1d70f2..cf6f9fd2c0 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -13,13 +13,17 @@ #include #include #include -#include -#include #include #include #include "config.hh" +#if HAVE_GRP_H +#include +#endif +#if HAVE_PWD_H +#include +#endif #if HAVE_GETTEXT #include #endif @@ -152,7 +156,9 @@ static Long_option_init options_static[] {_i ("DIR"), "include", 'I', _i ("add DIR to search path")}, {_i ("FILE"), "init", 'i', _i ("use FILE as init file")}, {_i ("FILE"), "output", 'o', _i ("write output to FILE (suffix will be added)")}, +#if HAVE_CHROOT {_i ("USER,GROUP,JAIL,DIR"), "jail", 'j', _i ("chroot to JAIL, become USER:GROUP\n and cd into DIR")}, +#endif {0, "no-print", 0, _i ("do not generate printed output")}, {0, "preview", 'p', _i ("generate a preview of the first system")}, {0, "safe-mode", 's', _i ("run in safe mode")}, @@ -284,6 +290,7 @@ prepend_load_path (String dir) void init_global_tweak_registry (); void init_fontconfig (); +#if HAVE_CHROOT static void do_chroot_jail () { @@ -366,6 +373,7 @@ do_chroot_jail () exit (3); } } +#endif void test_pango (); @@ -440,8 +448,10 @@ main_with_guile (void *, int, char **) exit (2); } +#if HAVE_CHROOT if (! jail_spec.is_empty ()) do_chroot_jail (); +#endif SCM result = scm_call_1 (ly_lily_module_constant ("lilypond-main"), files); (void) result; diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index f978dd20bc..ddde7dcfab 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -6,15 +6,14 @@ (c) 2004--2005 Han-Wen Nienhuys */ -#include -#include +#include "open-type-font.hh" #include +#include -#include "warn.hh" -#include "open-type-font.hh" #include "dimensions.hh" #include "modified-font-metric.hh" +#include "warn.hh" FT_Byte * load_table (char const *tag_str, FT_Face face, FT_ULong *length) diff --git a/lily/source-file.cc b/lily/source-file.cc index c904838124..2d3e70a317 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -12,9 +12,9 @@ #include "config.hh" #if HAVE_UTF8_WCHAR_H -#include /* wcrtomb */ +#include /* mbrtowc */ #else -#include /* wcrtomb */ +#include /* mbrtowc */ #endif #include diff --git a/po/nl.po b/po/nl.po index c0321eccb8..2f2eeb0d30 100644 --- a/po/nl.po +++ b/po/nl.po @@ -12,7 +12,7 @@ msgstr "" "Project-Id-Version: lilypond 2.2.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2005-04-19 22:41+0200\n" -"PO-Revision-Date: 2005-04-19 23:28+0200\n" +"PO-Revision-Date: 2005-04-25 21:59+0200\n" "Last-Translator: Jan Nieuwenhuizen \n" "Language-Team: Dutch \n" "MIME-Version: 1.0\n" @@ -1242,7 +1242,7 @@ msgstr "schrijf uitvoer naar BESTAND (extensie wordt toegevoegd)" #: main.cc:150 msgid "USER,GROUP,JAIL,DIR" -msgstr "GEBRU,GROUP,GEVANG,DIR" +msgstr "GEBR,GROEP,GEVANG,DIR" #: main.cc:150 msgid "" -- 2.39.5