+2003-03-30 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.am (noinst_HEADERS): Add po-gram-gen2.h.
+ (BUILT_SOURCES): Add po-gram-gen2.h.
+ (DISTCLEANFILES): Remove po-gram-gen2.h.
+ (po-gram-gen2.h): Simplify rule.
+
2003-03-17 Bruno Haible <bruno@clisp.org>
Native Woe32/MSVC support.
* Makefile.msvc: New file.
* Makefile.am (EXTRA_DIST): Add it.
+ * msgfilter.c: Include <sys/time.h> only if it exists.
+ (process_string): Mark as NYI on Woe32.
+ * msgfmt.c (sigjmp_buf, sigsetjmp, siglongjmp): Provide fallback
+ definitions for Woe32.
+ * msginit.c: Include <fcntl.h>, for F_OK. Include <pwd.h> only if it
+ exists.
+ (get_user_pwd, get_user_fullname): Adapt for when <pwd.h> is missing.
+ (project_id, project_id_version, get_user_email,
+ language_team_address): Use DEV_NULL instead of "/dev/null".
+ * msggrep.c (is_string_selected): Likewise.
+ * read-java.c (execute_and_read_po_output): Likewise.
+ * read-tcl.c (msgdomain_read_tcl): Likewise.
+ * write-mo.c: Include <sys/param.h> only if it exists.
2003-03-28 Bruno Haible <bruno@clisp.org>
noinst_HEADERS = pos.h message.h po-gram.h po-hash.h po-charset.h po-lex.h \
po.h open-po.h read-po.h str-list.h write-po.h dir-list.h file-list.h \
-po-gram-gen.h po-hash-gen.h msgl-charset.h msgl-equal.h msgl-iconv.h \
-msgl-ascii.h msgl-cat.h msgl-english.h msgfmt.h msgunfmt.h read-mo.h \
-write-mo.h read-java.h write-java.h read-tcl.h write-tcl.h po-time.h \
-plural-table.h format.h xgettext.h x-c.h x-po.h x-python.h x-lisp.h \
+po-gram-gen.h po-gram-gen2.h po-hash-gen.h msgl-charset.h msgl-equal.h \
+msgl-iconv.h msgl-ascii.h msgl-cat.h msgl-english.h msgfmt.h msgunfmt.h \
+read-mo.h write-mo.h read-java.h write-java.h read-tcl.h write-tcl.h \
+po-time.h plural-table.h format.h xgettext.h x-c.h x-po.h x-python.h x-lisp.h \
x-elisp.h x-librep.h x-smalltalk.h x-java.h x-awk.h x-ycp.h x-tcl.h x-php.h \
x-rst.h x-glade.h
# Special rules for bison and flex generated files.
-BUILT_SOURCES = po-gram-gen.c po-hash-gen.c po-gram-gen.h po-hash-gen.h
+BUILT_SOURCES = \
+ po-gram-gen.c po-gram-gen.h po-gram-gen2.h \
+ po-hash-gen.c po-hash-gen.h
po-lex.o po-lex.lo: po-gram-gen2.h
po-gram-gen2.h: po-gram-gen.h
- $(SED) 's/[yY][yY]/po_gram_/g' $(srcdir)/po-gram-gen.h > $@-tmp
+ $(SED) 's/yy/po_gram_/g' $(srcdir)/po-gram-gen.h > $@-tmp
mv $@-tmp $@
x-java.c: x-java.l
$(LEX) -o$@-tmp -Px_java_yy $(srcdir)/x-java.l
test "$(LEX)" = ":" || mv $@-tmp $@
-DISTCLEANFILES += po-gram-gen2.h
-
# Special rules for installation of auxiliary programs.
datadir = $(prefix)\share
localedir = $(datadir)\locale
aliaspath =
+jardir = $(datadir)\gettext
pkgdatadir = $(datadir)\gettext
+projectsdir = $(pkgdatadir)\projects
+IIprefix = c:\\usr
+IIexec_prefix = $(IIprefix)
+IIbindir = $(IIexec_prefix)\\bin
+IIlibdir = $(IIexec_prefix)\\lib
+IIincludedir = $(IIprefix)\\include
+IIdatadir = $(IIprefix)\\share
+IIlocaledir = $(IIdatadir)\\locale
+IIaliaspath =
+IIjardir = $(IIdatadir)\\gettext
+IIpkgdatadir = $(IIdatadir)\\gettext
+IIprojectsdir = $(IIpkgdatadir)\\projects
# Programs used by "make":
OPTIMFLAGS = -D_NDEBUG -O1
!endif
-CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H
+CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H -DLOCALEDIR=\"$(IIlocaledir)\" -DLOCALE_ALIAS_PATH=\"$(IIaliaspath)\" -DGETTEXTJAR=\"$(IIjardir)\\gettext.jar\" -DLIBDIR=\"$(IIlibdir)\" -DGETTEXTDATADIR=\"$(IIpkgdatadir)\" -DPROJECTSDIR=\"$(IIprojectsdir)\"
-INCLUDES =
+INCLUDES = -I. -I.. -I..\libuniname -I..\lib -I..\intl -I..\..\gettext-runtime\intl -I..\windows -I$(includedir)
AR = lib
AR_FLAGS = /out:
msggrep_OBJECTS = msggrep.obj
msginit_OBJECTS = msginit.obj localealias.obj
msguniq_OBJECTS = msguniq.obj
+LDADD =
RESOURCES = gettextsrc.res
!else
# gettextsrc.dll and gettextsrc.lib are created together.
-gettextsrc.lib : $(OBJECTS) $(RESOURCES)
- $(CC) $(MFLAGS) -LD $(OBJECTS) $(RESOURCES)
+gettextsrc.lib : ..\windows\gettextsrc.def $(OBJECTS) $(RESOURCES)
+ $(CC) $(MFLAGS) -LD ..\windows\gettextsrc.def $(OBJECTS) ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(RESOURCES) -Fegettextsrc.dll
gettextsrc.res : ../windows/gettextsrc.rc
rc -Fo gettextsrc.res ../windows/gettextsrc.rc
# Compilation rules for $(program_OBJECTS), without $(PICFLAGS).
msgcmp.obj : msgcmp.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msgcmp.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgcmp.c
msgfmt.obj : msgfmt.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msgfmt.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgfmt.c
write-mo.obj : write-mo.c
$(CC) $(INCLUDES) $(CFLAGS) -c write-mo.c
$(CC) $(INCLUDES) $(CFLAGS) -c plural-eval.c
msgmerge.obj : msgmerge.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msgmerge.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgmerge.c
msgunfmt.obj : msgunfmt.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msgunfmt.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgunfmt.c
read-mo.obj : read-mo.c
$(CC) $(INCLUDES) $(CFLAGS) -c read-mo.c
$(CC) $(INCLUDES) $(CFLAGS) -c read-tcl.c
xgettext.obj : xgettext.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c xgettext.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c xgettext.c
x-c.obj : x-c.c
$(CC) $(INCLUDES) $(CFLAGS) -c x-c.c
$(CC) $(INCLUDES) $(CFLAGS) -c x-glade.c
msgattrib.obj : msgattrib.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msgattrib.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgattrib.c
msgcat.obj : msgcat.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msgcat.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgcat.c
msgcomm.obj : msgcomm.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msgcomm.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgcomm.c
msgconv.obj : msgconv.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msgconv.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgconv.c
msgen.obj : msgen.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msgen.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgen.c
msgexec.obj : msgexec.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msgexec.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgexec.c
msgfilter.obj : msgfilter.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msgfilter.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgfilter.c
msggrep.obj : msggrep.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msggrep.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msggrep.c
msginit.obj : msginit.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msginit.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msginit.c
localealias.obj : ..\..\gettext-runtime\intl\localealias.c
- $(CC) $(INCLUDES) $(CFLAGS) -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" -c ..\..\gettext-runtime\intl\localealias.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DLOCALE_ALIAS_PATH=\"$(IIaliaspath)\" -c ..\..\gettext-runtime\intl\localealias.c
msguniq.obj : msguniq.c
- $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(prefix)\" -DINSTALLDIR=\"$(bindir)\" -c msguniq.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msguniq.c
msgcmp.exe : $(msgcmp_OBJECTS)
- $(CC) $(msgcmp_OBJECTS) -lgettextsrc -Femsgcmp.exe
+ $(CC) $(msgcmp_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsgcmp.exe
msgfmt.exe : $(msgfmt_OBJECTS)
- $(CC) $(msgfmt_OBJECTS) -lgettextsrc -Femsgfmt.exe
+ $(CC) $(msgfmt_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsgfmt.exe
msgmerge.exe : $(msgmerge_OBJECTS)
- $(CC) $(msgmerge_OBJECTS) -lgettextsrc -Femsgmerge.exe
+ $(CC) $(msgmerge_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsgmerge.exe
msgunfmt.exe : $(msgunfmt_OBJECTS)
- $(CC) $(msgunfmt_OBJECTS) -lgettextsrc -Femsgunfmt.exe
+ $(CC) $(msgunfmt_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsgunfmt.exe
xgettext.exe : $(xgettext_OBJECTS)
- $(CC) $(xgettext_OBJECTS) ..\libuniname\uniname.lib -lgettextsrc -Fexgettext.exe
+ $(CC) $(xgettext_OBJECTS) ..\libuniname\uniname.lib gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Fexgettext.exe
msgattrib.exe : $(msgattrib_OBJECTS)
- $(CC) $(msgattrib_OBJECTS) -lgettextsrc -Femsgattrib.exe
+ $(CC) $(msgattrib_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsgattrib.exe
msgcat.exe : $(msgcat_OBJECTS)
- $(CC) $(msgcat_OBJECTS) -lgettextsrc -Femsgcat.exe
+ $(CC) $(msgcat_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsgcat.exe
msgcomm.exe : $(msgcomm_OBJECTS)
- $(CC) $(msgcomm_OBJECTS) -lgettextsrc -Femsgcomm.exe
+ $(CC) $(msgcomm_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsgcomm.exe
msgconv.exe : $(msgconv_OBJECTS)
- $(CC) $(msgconv_OBJECTS) -lgettextsrc -Femsgconv.exe
+ $(CC) $(msgconv_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsgconv.exe
msgen.exe : $(msgen_OBJECTS)
- $(CC) $(msgen_OBJECTS) -lgettextsrc -Femsgen.exe
+ $(CC) $(msgen_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsgen.exe
msgexec.exe : $(msgexec_OBJECTS)
- $(CC) $(msgexec_OBJECTS) -lgettextsrc -Femsgexec.exe
+ $(CC) $(msgexec_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsgexec.exe
msgfilter.exe : $(msgfilter_OBJECTS)
- $(CC) $(msgfilter_OBJECTS) -lgettextsrc -Femsgfilter.exe
+ $(CC) $(msgfilter_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsgfilter.exe
msggrep.exe : $(msggrep_OBJECTS)
- $(CC) $(msggrep_OBJECTS) -lgettextsrc -Femsggrep.exe
+ $(CC) $(msggrep_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsggrep.exe
msginit.exe : $(msginit_OBJECTS)
- $(CC) $(msginit_OBJECTS) ..\intl\localename.obj -lgettextsrc -Femsginit.exe
+ $(CC) $(msginit_OBJECTS) ..\intl\localename.obj gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsginit.exe
msguniq.exe : $(msguniq_OBJECTS)
- $(CC) $(msguniq_OBJECTS) -lgettextsrc -Femsguniq.exe
+ $(CC) $(msguniq_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(LDADD) -Femsguniq.exe
install : all force
-mkdir $(prefix)
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
-#include <sys/time.h>
+
+#if HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
static void
process_string (const char *str, size_t len, char **resultp, size_t *lengthp)
{
+#if defined _MSC_VER || defined __MINGW32__
+ /* Native Woe32 API. */
+ /* Not yet implemented. */
+ error (EXIT_FAILURE, 0, _("Not yet implemented."));
+#else
pid_t child;
int fd[2];
char *result;
*resultp = result;
*lengthp = length;
+#endif
}
#define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
+/* Some platforms don't have the sigjmp_buf type in <setjmp.h>. */
+#if defined _MSC_VER || defined __MINGW32__
+/* Native Woe32 API. */
+# define sigjmp_buf jmp_buf
+# define sigsetjmp(env,savesigs) setjmp (env)
+# define siglongjmp longjmp
+#endif
+
/* We use siginfo to get precise information about the signal.
But siginfo doesn't work on Irix 6.5. */
#if HAVE_SIGINFO && !defined (__sgi)
/* Open a pipe to a grep subprocess. */
child = create_pipe_out ("grep", grep_path, grep_argv[grep_pass],
- "/dev/null", false, true, fd);
+ DEV_NULL, false, true, fd);
if (full_write (fd[0], str, len) < len)
error (EXIT_FAILURE, errno,
#include <alloca.h>
#include <errno.h>
+#include <fcntl.h>
#include <getopt.h>
#include <limits.h>
#include <locale.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
-#include <pwd.h>
+
+#if HAVE_PWD_H
+# include <pwd.h>
+#endif
#if HAVE_UNISTD_H
# include <unistd.h>
argv[0] = "/bin/sh";
argv[1] = prog;
argv[2] = NULL;
- child = create_pipe_in (prog, "/bin/sh", argv, "/dev/null", false, true, fd);
+ child = create_pipe_in (prog, "/bin/sh", argv, DEV_NULL, false, true, fd);
/* Retrieve its result. */
fp = fdopen (fd[0], "r");
argv[1] = prog;
argv[2] = "yes";
argv[3] = NULL;
- child = create_pipe_in (prog, "/bin/sh", argv, "/dev/null", false, true, fd);
+ child = create_pipe_in (prog, "/bin/sh", argv, DEV_NULL, false, true, fd);
/* Retrieve its result. */
fp = fdopen (fd[0], "r");
static struct passwd *
get_user_pwd ()
{
+#if HAVE_PWD_H /* Only Unix, not native Woe32. */
const char *username;
struct passwd *userpasswd;
return userpasswd;
if (errno != 0)
error (EXIT_FAILURE, errno, "getpwuid(\"%d\")", getuid ());
+#endif
return NULL;
}
char *result;
pwd = get_user_pwd ();
- if (pwd == NULL)
- return NULL;
+#if HAVE_PWD_H
+ if (pwd != NULL)
+ {
+ /* Return the pw_gecos field, upto the first comma (if any). */
+ fullname = pwd->pw_gecos;
+ fullname_end = strchr (fullname, ',');
+ if (fullname_end == NULL)
+ fullname_end = fullname + strlen (fullname);
- /* Return the pw_gecos field, upto the first comma (if any). */
- fullname = pwd->pw_gecos;
- fullname_end = strchr (fullname, ',');
- if (fullname_end == NULL)
- fullname_end = fullname + strlen (fullname);
+ result = (char *) xmalloc (fullname_end - fullname + 1);
+ memcpy (result, fullname, fullname_end - fullname);
+ result[fullname_end - fullname] = '\0';
- result = (char *) xmalloc (fullname_end - fullname + 1);
- memcpy (result, fullname, fullname_end - fullname);
- result[fullname_end - fullname] = '\0';
+ return result;
+ }
+#endif
- return result;
+ return NULL;
}
give you feedback about the translations, and so that maintainers can contact\n\
you in case of unexpected technical problems.\n");
argv[3] = NULL;
- child = create_pipe_in (prog, "/bin/sh", argv, "/dev/null", false, true, fd);
+ child = create_pipe_in (prog, "/bin/sh", argv, DEV_NULL, false, true, fd);
/* Retrieve his answer. */
fp = fdopen (fd[0], "r");
argv[4] = (char *) catalogname;
argv[5] = (char *) language;
argv[6] = NULL;
- child = create_pipe_in (prog, "/bin/sh", argv, "/dev/null", false, true, fd);
+ child = create_pipe_in (prog, "/bin/sh", argv, DEV_NULL, false, true, fd);
/* Retrieve its result. */
fp = fdopen (fd[0], "r");
int exitstatus;
/* Open a pipe to the JVM. */
- child = create_pipe_in (progname, prog_path, prog_argv, "/dev/null", false,
+ child = create_pipe_in (progname, prog_path, prog_argv, DEV_NULL, false,
true, fd);
fp = fdopen (fd[0], "r");
}
/* Open a pipe to the Tcl interpreter. */
- child = create_pipe_in ("tclsh", "tclsh", argv, "/dev/null", false, true,
- fd);
+ child = create_pipe_in ("tclsh", "tclsh", argv, DEV_NULL, false, true, fd);
fp = fdopen (fd[0], "r");
if (fp == NULL)
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
-#include <sys/param.h>
#include <stdlib.h>
#include <string.h>
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
/* These two include files describe the binary .mo format. */
#include "gmo.h"
#include "hash-string.h"