Re: make distcheck not working

2004-05-27 Thread Lars Gullik Bjønnes
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| [EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:
>
| | make distcheck is not working.
>
| I am getting there, slowly.

YES!

Finally!

Several small fixes... all taking ages to test.

Index: mkinstalldirs
===
RCS file: mkinstalldirs
diff -N mkinstalldirs
--- mkinstalldirs	21 Nov 2000 16:35:36 -	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -
@@ -1,32 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <[EMAIL PROTECTED]>
-# Created: 1993-05-16
-# Public domain
-
-errstatus=0
-
-for file
-do
-   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
-   shift
-
-   pathcomp=
-   for d in ${1+"$@"} ; do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
-   -* ) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
-echo "mkdir $pathcomp" 1>&2
-mkdir "$pathcomp" || errstatus=$?
- fi
-
- pathcomp="$pathcomp/"
-   done
-done
-
-exit $errstatus
-
-# mkinstalldirs ends here
Index: config/depcomp.diff
===
RCS file: config/depcomp.diff
diff -N config/depcomp.diff
--- config/depcomp.diff	22 Mar 2002 12:32:11 -	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -
@@ -1,39 +0,0 @@
-Index: depcomp
-===
-RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/depcomp,v
-retrieving revision 1.1
-diff -u -p -r1.1 depcomp
 depcomp	17 Oct 2001 15:38:58 -	1.1
-+++ depcomp	22 Mar 2002 12:18:23 -
-@@ -198,14 +198,28 @@ aix)
-   ;;
- 
- tru64)
--   # The Tru64 AIX compiler uses -MD to generate dependencies as a side
-+   # The Tru64 DEC compiler uses -MD to generate dependencies as a side
-# effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
-# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 
-# dependencies in `foo.d' instead, so we check for that too.
-# Subdirectories are respected.
- 
--   tmpdepfile1="$object.d"
--   tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` 
-+   # This is incorrect as it assumes that $object has a .o extension when
-+   # it could well have a .lo one.
-+   #tmpdepfile1="$object.d"
-+   # This is just bad sed. The /.o$/ should be /\.o/, nonwithstanding the
-+   # flawed logic, described above.
-+   #tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
-+
-+   # The correct way:
-+   # Strip the (.o, or .lo) extension from $object
-+   # (Same piece of sed magic as used for the AIX compiler above.)
-+   stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
-+   # Tru64 compiler dependency file.
-+   tmpdepfile1="$stripped.o.d"
-+   # Compaq CCC V6.2 dependency file.
-+   tmpdepfile2="$stripped.d"
-+
-if test "$libtool" = yes; then
-   "$@" -Wc,-MD
-else
Index: config/gettext.m4.patch
===
RCS file: config/gettext.m4.patch
diff -N config/gettext.m4.patch
--- config/gettext.m4.patch	8 Jan 2000 21:06:59 -	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -
@@ -1,16 +0,0 @@
 /usr/share/aclocal/gettext.m4	Thu Sep 23 05:05:24 1999
-+++ gettext.m4	Sat Jan  8 04:12:49 2000
-@@ -227,7 +227,12 @@
-  else
-AC_MSG_CHECKING(for catalogs to be installed)
-NEW_LINGUAS=
--   for lang in ${LINGUAS=$ALL_LINGUAS}; do
-+dnl == Fix is here! ==
-+dnl Some sh do not like substitution in bounds of for loops
-+dnlfor lang in ${LINGUAS=$ALL_LINGUAS}; do
-+tmplinguas=${LINGUAS=$ALL_LINGUAS}
-+for lang in ${tmplinguas}; do
-+dnl  end of fix
-  case "$ALL_LINGUAS" in
-   *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
-  esac
Index: lib/Makefile.am
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/Makefile.am,v
retrieving revision 1.53
diff -u -p -b -r1.53 Makefile.am
--- lib/Makefile.am	1 Apr 2004 08:09:14 -	1.53
+++ lib/Makefile.am	28 May 2004 06:44:33 -
@@ -4,38 +4,910 @@ DISTCLEANFILES = *.orig *.rej *~ *.bak c
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
 SUBDIRS = reLyX
 
-CHMOD=chmod
-
-BIND = bind/*.bind
-CLIPART = clipart/*.eps
-DOCDIST = doc/LyXConfig.lyx*
-DOCINST = doc/*.lyx doc/*.eps doc/*.lyx.in
-EXAMPLES = examples/*.lyx examples/*.fen
-IMAGES = images/*.xpm images/*.ppm images/math/*.xpm
-KBD = kbd/*.kmap kbd/*.cdef
-LAYOUT = layouts/*.layout layouts/*.inc
-LYXSCRIPTS = configure configure.cmd scripts/* lyx2lyx/*
-TEMPL = templates/*.lyx
-TEXSUPPORT = tex/*.cls tex/*.sty
-UI = ui/*.ui
-
-LIBINSTFILES = $(BIND) $(CLIPART) $(DOCINST) $(EXAMPLES) $(IMAGES) \
-	$(KBD) $(LAYOUT) $(TEMPL) $(TEXSUPPORT) $(UI)
+EXTRA_DIST = CREDITS chkconfig.ltx configure.cmd lyxrc.example \
+	external_templates bind clipart doc/LaTeXConfig.lyx.in doc/LyXConfig.lyx.in examples images \
+	kb

Re: make distcheck not working

2004-05-27 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:


| lyx2lyx
| already has one by the way.

Does it?

-- 
Lgb



Re: make distcheck not working

2004-05-27 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjønnes wrote:
>
>> [EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:
>> 
>> | make distcheck is not working.
>> 
>> I am getting there, slowly. Doing a "make distcheck" takes time...
>> and for a lot of the distcheck stuff you have to run it to
>> completeion and from the beginning for everything you fix/test.
>> 
>> Anyway, it seems most of my problems are solved now. Albeit I have
>> only tested for xforms.
>> 
>> This are the changes I have done to my tree so far:
>
| Yuch. What a pain.

Ok, some of the changes in lib/Makefile.am is not strictly needed, but
it is the way to do it with automake, and not fiddle with automake
internals.

| Given that lib/Makefile.am is now so big, I think
| it makes more sense to have per-subdirectory Makefile.am s. lyx2lyx
| already has one by the way. The lyx2lyx_DATA etc should certainly be
| moved in there.

Hmm... why is the install/dist done from parent dir then?
Hmm da hmm...

| Index: src/frontends/xforms/forms/Makefile.am
| -$(SHELL) $(SCRIPT) $<
| +$(LN_S) $< .
| +$(SHELL) $(SCRIPT) `basename $<`
>
| Won't this fail (ln -s) if build dir == src dir?

sure the ln -s will fail, but the rest will not. But sure it is not
nice... so I should add a check for srcdir != builddir.

-- 
Lgb



Re: make distcheck not working

2004-05-27 Thread Angus Leeming
Lars Gullik Bjønnes wrote:

> [EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:
> 
> | make distcheck is not working.
> 
> I am getting there, slowly. Doing a "make distcheck" takes time...
> and for a lot of the distcheck stuff you have to run it to
> completeion and from the beginning for everything you fix/test.
> 
> Anyway, it seems most of my problems are solved now. Albeit I have
> only tested for xforms.
> 
> This are the changes I have done to my tree so far:

Yuch. What a pain. Given that lib/Makefile.am is now so big, I think
it makes more sense to have per-subdirectory Makefile.am s. lyx2lyx
already has one by the way. The lyx2lyx_DATA etc should certainly be
moved in there.


Index: src/frontends/xforms/forms/Makefile.am
-$(SHELL) $(SCRIPT) $<
+$(LN_S) $< .
+$(SHELL) $(SCRIPT) `basename $<`

Won't this fail (ln -s) if build dir == src dir?

-- 
Angus



Re: doc in lyx-devel or out or in ...

2004-05-27 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjønnes wrote:
>> I know I brought this up the last time... but what was the
>> conclusion of the discussion?
>> 
>> To move do inside lyx-devel? Or to keep it as a separate module that
>> is not disted with lyx-x.tar.gz?
>> 
>> The motivation is to get rid of the cvs commands done when doing a
>> "make dist"
>> 
>
| Given that docs is half the size of po (which I guess is distributed
| with the generated files)...
>
| $ du -ks docs devel; for dir in devel/*; do test -d $dir && du -ks
| $dir; done

[disk stats snipped]

So what you are saying is: "Sure why not put docs in lyx-devel, won't
make much of a difference anyway."?

I do not think I will do any cvs magic to copy the files over, just
make a doc dir (we have it already) and copy the doc files there. We
will loose history for those files, but otoh we will still have
lyx-doc. (and we should never use HEAD there again only the existing
release tags/branches).

Does anyone oppose this move?
 
| However, don't you think that it would be nice to distribute
| per-language rpms containing just the po file and any translated
| docs?

Sure, and too would be easier if we had the documentation _in_
lyx-devel

| Given that there should really be a en.po now that JMarc has
| ASCIIfied the translatable strings, it would even be consistent to
| have a lyx_en.rpm

lyx-lang-en.rpm would be my preference.

-- 
Lgb



Re: doc in lyx-devel or out or in ...

2004-05-27 Thread Angus Leeming
Lars Gullik Bjønnes wrote:
> I know I brought this up the last time... but what was the
> conclusion of the discussion?
> 
> To move do inside lyx-devel? Or to keep it as a separate module that
> is not disted with lyx-x.tar.gz?
> 
> The motivation is to get rid of the cvs commands done when doing a
> "make dist"
> 

Given that docs is half the size of po (which I guess is distributed
with the generated files)...

$ du -ks docs devel; for dir in devel/*; do test -d $dir && du -ks
$dir; done
10820   docs
53716   devel
6508devel/boost
676 devel/config
20  devel/CVS
540 devel/development
568 devel/images
500 devel/intl
7124devel/lib
212 devel/m4
488 devel/patches
20568   devel/po
76  devel/sourcedoc
12684   devel/src

However, don't you think that it would be nice to distribute
per-language rpms containing just the po file and any translated
docs? Given that there should really be a en.po now that JMarc has
ASCIIfied the translatable strings, it would even be consistent to
have a lyx_en.rpm

-- 
Angus



Re: make distcheck not working

2004-05-27 Thread Lars Gullik Bjønnes
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| make distcheck is not working.

I am getting there, slowly. Doing a "make distcheck" takes time... and
for a lot of the distcheck stuff you have to run it to completeion and
from the beginning for everything you fix/test.

Anyway, it seems most of my problems are solved now. Albeit I have
only tested for xforms.

This are the changes I have done to my tree so far:

Index: mkinstalldirs
===
RCS file: mkinstalldirs
diff -N mkinstalldirs
--- mkinstalldirs	21 Nov 2000 16:35:36 -	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -
@@ -1,32 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <[EMAIL PROTECTED]>
-# Created: 1993-05-16
-# Public domain
-
-errstatus=0
-
-for file
-do
-   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
-   shift
-
-   pathcomp=
-   for d in ${1+"$@"} ; do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
-   -* ) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
-echo "mkdir $pathcomp" 1>&2
-mkdir "$pathcomp" || errstatus=$?
- fi
-
- pathcomp="$pathcomp/"
-   done
-done
-
-exit $errstatus
-
-# mkinstalldirs ends here
Index: config/depcomp.diff
===
RCS file: config/depcomp.diff
diff -N config/depcomp.diff
--- config/depcomp.diff	22 Mar 2002 12:32:11 -	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -
@@ -1,39 +0,0 @@
-Index: depcomp
-===
-RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/depcomp,v
-retrieving revision 1.1
-diff -u -p -r1.1 depcomp
 depcomp	17 Oct 2001 15:38:58 -	1.1
-+++ depcomp	22 Mar 2002 12:18:23 -
-@@ -198,14 +198,28 @@ aix)
-   ;;
- 
- tru64)
--   # The Tru64 AIX compiler uses -MD to generate dependencies as a side
-+   # The Tru64 DEC compiler uses -MD to generate dependencies as a side
-# effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
-# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 
-# dependencies in `foo.d' instead, so we check for that too.
-# Subdirectories are respected.
- 
--   tmpdepfile1="$object.d"
--   tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` 
-+   # This is incorrect as it assumes that $object has a .o extension when
-+   # it could well have a .lo one.
-+   #tmpdepfile1="$object.d"
-+   # This is just bad sed. The /.o$/ should be /\.o/, nonwithstanding the
-+   # flawed logic, described above.
-+   #tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
-+
-+   # The correct way:
-+   # Strip the (.o, or .lo) extension from $object
-+   # (Same piece of sed magic as used for the AIX compiler above.)
-+   stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
-+   # Tru64 compiler dependency file.
-+   tmpdepfile1="$stripped.o.d"
-+   # Compaq CCC V6.2 dependency file.
-+   tmpdepfile2="$stripped.d"
-+
-if test "$libtool" = yes; then
-   "$@" -Wc,-MD
-else
Index: config/gettext.m4.patch
===
RCS file: config/gettext.m4.patch
diff -N config/gettext.m4.patch
--- config/gettext.m4.patch	8 Jan 2000 21:06:59 -	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -
@@ -1,16 +0,0 @@
 /usr/share/aclocal/gettext.m4	Thu Sep 23 05:05:24 1999
-+++ gettext.m4	Sat Jan  8 04:12:49 2000
-@@ -227,7 +227,12 @@
-  else
-AC_MSG_CHECKING(for catalogs to be installed)
-NEW_LINGUAS=
--   for lang in ${LINGUAS=$ALL_LINGUAS}; do
-+dnl == Fix is here! ==
-+dnl Some sh do not like substitution in bounds of for loops
-+dnlfor lang in ${LINGUAS=$ALL_LINGUAS}; do
-+tmplinguas=${LINGUAS=$ALL_LINGUAS}
-+for lang in ${tmplinguas}; do
-+dnl  end of fix
-  case "$ALL_LINGUAS" in
-   *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
-  esac
Index: lib/Makefile.am
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/Makefile.am,v
retrieving revision 1.53
diff -u -p -r1.53 Makefile.am
--- lib/Makefile.am	1 Apr 2004 08:09:14 -	1.53
+++ lib/Makefile.am	27 May 2004 16:56:50 -
@@ -4,38 +4,910 @@ DISTCLEANFILES = *.orig *.rej *~ *.bak c
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
 SUBDIRS = reLyX
 
-CHMOD=chmod
-
-BIND = bind/*.bind
-CLIPART = clipart/*.eps
-DOCDIST = doc/LyXConfig.lyx*
-DOCINST = doc/*.lyx doc/*.eps doc/*.lyx.in
-EXAMPLES = examples/*.lyx examples/*.fen
-IMAGES = images/*.xpm images/*.ppm images/math/*.xpm
-KBD = kbd/*.kmap kbd/*.cdef
-LAYOUT = layouts/*.layout layouts/*.inc
-LYXSCRIPTS = configure configure.cmd scripts/* lyx2lyx/*
-TEMPL = templates/*.lyx
-TEXSUPPORT = tex/*.cls tex/*.sty
-UI = ui/*.ui
-
-LIBINSTFILES = $(BIND) $(CLIPART) $(DOCINST) $(EXAMPLES) $(IMAGES) \
-	$(KBD) $(LAYOUT) $(TEMPL) $(TE

doc in lyx-devel or out or in ...

2004-05-27 Thread Lars Gullik Bjønnes

I know I brought this up the last time... but what was the conclusion
of the discussion?

To move do inside lyx-devel? Or to keep it as a separate module that
is not disted with lyx-x.tar.gz?

The motivation is to get rid of the cvs commands done when doing a
"make dist"

-- 
Lgb


Re: fdesign -convert is buggy

2004-05-27 Thread Angus Leeming
Lars Gullik Bjønnes wrote:
> | } else
> | strcpy(fname, filename);
> | }
> | strcat(fname, ext);
> | }
> 
> It almost seems to me that the else clause should just be
> 
>strcpy(fname, filename_only(filename));

I think you're correct. Thanks.

> | build_fname(fname, "foo/bar/baz", ".h");
> 
> If my above method was used this would produce just baz.h. but the
> old way would produce foo/bar/baz.h

Correct. 

The test program seems to work exactly as you want.

Jean-Marc, are you happy with the change?

Index: fdesign/fd_printC.c
===
RCS file: /cvsroot/xforms/xforms/fdesign/fd_printC.c,v
retrieving revision 1.8
diff -u -p -r1.8 fd_printC.c
--- fdesign/fd_printC.c 27 Nov 2003 18:15:00 -  1.8
+++ fdesign/fd_printC.c 27 May 2004 16:50:46 -
@@ -82,7 +82,7 @@ build_fname(char * fname, char const * f
strcat(fname, "/");
strcat(fname, filename_only(filename));
 } else
-   strcpy(fname, filename);
+   strcpy(fname, filename_only(filename));
 strcat(fname, ext);
 }


-- 
Angus#include 
#include 
#include 

typedef struct {
	char * output_dir;
} FD_Opt;

FD_Opt fdopt;

static char const *
filename_only(char const * filename)
{
	char const * ptr = strrchr(filename, '/');
	if (ptr)
		return ptr+1;
	return filename;
}

/* Given 'filename' (no extension) and 'ext', generate 'fname' */
static void
build_fname(char * fname, char const * filename, char const * ext)
{
	if (fdopt.output_dir) {
		strcpy(fname, fdopt.output_dir);
		if (fname[strlen(fdopt.output_dir) - 1] != '/')
			strcat(fname, "/");
		strcat(fname, filename_only(filename));
	} else
		strcpy(fname, filename_only(filename));
	strcat(fname, ext);
}

int main(int argc, char * argv[])
{
	char fname[PATH_MAX + 1];

	fdopt.output_dir = 0;
	if (argc > 1) {
		fdopt.output_dir = (char *)malloc(strlen(argv[1]) + 1);
		strcpy(fdopt.output_dir, argv[1]);
	}

	build_fname(fname, "foo/bar/baz", ".h");

	printf("Output fname is \"%s\"\n", fname);
	return 0;
}	


Re: fdesign -convert is buggy

2004-05-27 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:

| I believe that we achieve what you're looking for with
| -} else
| -   strcpy(fname, filename);
| +} else {
| +   size_t const buffer_size = 512;
| +   char buffer[buffer_size];
| +   char * cwd = getcwd(buffer, buffer_size);
| +   if (cwd) {
| +   strcpy(fname, cwd);
| +   strcat(fname, "/");
| +   strcat(fname, filename_only(filename));
| +   } else
| +   strcpy(fname, filename);

Why isn't filename_only used here?

| static char const *
| filename_only(char const * filename)
| {
|   char const * ptr = strrchr(filename, '/');
|   if (ptr)
|   return ptr+1;
|   return filename;
| }
>
| /* Given 'filename' (no extension) and 'ext', generate 'fname' */
| static void
| build_fname(char * fname, char const * filename, char const * ext)
| {
|   if (fdopt.output_dir) {
|   strcpy(fname, fdopt.output_dir);
|   if (fname[strlen(fdopt.output_dir) - 1] != '/')
|   strcat(fname, "/");
|   strcat(fname, filename_only(filename));
|   } else {
|   size_t const buffer_size = 512;
|   char buffer[buffer_size];
|   char * cwd = getcwd(buffer, buffer_size);
|   if (cwd) {
|   strcpy(fname, cwd);
|   strcat(fname, "/");
|   strcat(fname, filename_only(filename));
|   } else
|   strcpy(fname, filename);
|   }
|   strcat(fname, ext);
| }

It almost seems to me that the else clause should just be

   strcpy(fname, filename_only(filename));

and that you don't have to fiddle with getcwd at all?

| int main(int argc, char * argv[])
| {
|   char fname[512];

Is this big enough?
(I have no idea what the actual value in xforms is, but PATH_MAX is a
nice value)

|   fdopt.output_dir = 0;
|   if (argc > 1) {
|   fdopt.output_dir = (char *)malloc(strlen(argv[1]) + 1);
|   strcpy(fdopt.output_dir, argv[1]);
|   }
>
|   build_fname(fname, "foo/bar/baz", ".h");

If my above method was used this would produce just baz.h. but the old
way would produce foo/bar/baz.h

-- 
Lgb



Re: fdesign -convert is buggy

2004-05-27 Thread Angus Leeming
Angus Leeming wrote:

> Lars Gullik Bjønnes wrote:
>> (and I am not saying that -dir should be removed, I am saying that
>> fdesign should output to pwd (unless -dir is specified of course.))
> 
> Ok, understood. You want me to mess around with malloc just before
> we try and get XForms 1.1 out of the door. Bad man!
> 
> I'll have a look.

This is the current code.

static char const *
filename_only(char const * filename)
{
char const * ptr = strrchr(filename, '/');
if (ptr)
return ptr+1;
return filename;
}

/* Given 'filename' (no extension) and 'ext', generate 'fname' */
static void
build_fname(char * fname, char const * filename, char const * ext)
{
if (fdopt.output_dir) {
strcpy(fname, fdopt.output_dir);
if (fname[strlen(fdopt.output_dir) - 1] != '/')
strcat(fname, "/");
strcat(fname, filename_only(filename));
} else
strcpy(fname, filename);
strcat(fname, ext);
}

I believe that we achieve what you're looking for with
-} else
-   strcpy(fname, filename);
+} else {
+   size_t const buffer_size = 512;
+   char buffer[buffer_size];
+   char * cwd = getcwd(buffer, buffer_size);
+   if (cwd) {
+   strcpy(fname, cwd);
+   strcat(fname, "/");
+   strcat(fname, filename_only(filename));
+   } else
+   strcpy(fname, filename);
+}

Test code attached. I'm pretty sure that this is safe, but would value
second opinions...

-- 
Angus#include 
#include 
#include 

typedef struct {
	char * output_dir;
} FD_Opt;

FD_Opt fdopt;

static char const *
filename_only(char const * filename)
{
	char const * ptr = strrchr(filename, '/');
	if (ptr)
		return ptr+1;
	return filename;
}

/* Given 'filename' (no extension) and 'ext', generate 'fname' */
static void
build_fname(char * fname, char const * filename, char const * ext)
{
	if (fdopt.output_dir) {
		strcpy(fname, fdopt.output_dir);
		if (fname[strlen(fdopt.output_dir) - 1] != '/')
			strcat(fname, "/");
		strcat(fname, filename_only(filename));
	} else {
		size_t const buffer_size = 512;
		char buffer[buffer_size];
		char * cwd = getcwd(buffer, buffer_size);
		if (cwd) {
			strcpy(fname, cwd);
			strcat(fname, "/");
			strcat(fname, filename_only(filename));
		} else
			strcpy(fname, filename);
	}
	strcat(fname, ext);
}

int main(int argc, char * argv[])
{
	char fname[512];

	fdopt.output_dir = 0;
	if (argc > 1) {
		fdopt.output_dir = (char *)malloc(strlen(argv[1]) + 1);
		strcpy(fdopt.output_dir, argv[1]);
	}

	build_fname(fname, "foo/bar/baz", ".h");

	printf("Output fname is \"%s\"\n", fname);
	return 0;
}	


Re: fdesign -convert is buggy

2004-05-27 Thread Angus Leeming
Lars Gullik Bjønnes wrote:
> (and I am not saying that -dir should be removed, I am saying that
> fdesign should output to pwd (unless -dir is specified of course.))

Ok, understood. You want me to mess around with malloc just before we
try and get XForms 1.1 out of the door. Bad man!

I'll have a look.

-- 
Angus



Re: fdesign -convert is buggy

2004-05-27 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:

| Jean-Marc Lasgouttes wrote:
>> Lars> Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:
>> Lars> | This would break compatibility with older versions of
>> fdesign.
>> 
>> Lars> Would it really?
>> 
>> Lars> Older versions of fdesign only works with the *.fd file in the
>> Lars> same dir as where fdesign is run...
>> 
>> Lars> So I see no compatibility problems.
>> 
>> Good remark, it seems you are right.
>> 
>> Angus, this probably means that we can/should get rid of the -dir
>> argument.
>
| We would merely be swapping one semantic that works for another one
| which is not yet proven. I don't see what it gains us. As I see it I
| can do:

Note that the old semantic is kept as well.

Only if you do something that was not possible with old fdesign the
semantics change.

>
| $ cd $HOME
| $ fdesign -dir destdir -convert foo/bar.fd
>
| which seems more flexible to me than Lars' proposal.

surely not.

(and I am not saying that -dir should be removed, I am saying that
fdesign should output to pwd (unless -dir is specified of course.))

-- 
Lgb



Re: fdesign -convert is buggy

2004-05-27 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:

| Man page attached, but my conclusion is that uic is just different.
| Nonetheless, the sematics that we have now have similar power to
| those of uic.

Except for the surprising behaviour that fdesign output files to the
same dir there the .fd file is located.

Sure, keep -dir, but make fdesign output to pwd not to the .fd files
dir.

-- 
Lgb



Re: fdesign -convert is buggy

2004-05-27 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:

>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> Angus> We would merely be swapping one semantic that works for
> another Angus> one which is not yet proven. I don't see what it
> gains us. As I Angus> see it I can do:
> 
> Angus> $ cd $HOME $ fdesign -dir destdir -convert foo/bar.fd
> 
> Angus> which seems more flexible to me than Lars' proposal.
> 
> What does uic do?
> 
> JMarc

1. It produces only one file per invocation, either .h or .C:

   Generate declaration:
uic  [options]  

   Generate implementation:
uic  [options] -impl  
   :name of the declaration file

fdesign produces both .h and .c file in the same step.

GENERAL OPTIONS
   -o file
  Write output to file rather than to stdout.

Man page attached, but my conclusion is that uic is just different.
Nonetheless, the sematics that we have now have similar power to
those of uic.

-- 
Angus

uic.1.gz
Description: GNU Zip compressed data


Re: fdesign -convert is buggy

2004-05-27 Thread Jean-Marc Lasgouttes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> We would merely be swapping one semantic that works for another
Angus> one which is not yet proven. I don't see what it gains us. As I
Angus> see it I can do:

Angus> $ cd $HOME $ fdesign -dir destdir -convert foo/bar.fd

Angus> which seems more flexible to me than Lars' proposal.

What does uic do?

JMarc


Re: fdesign -convert is buggy

2004-05-27 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:
> Lars> Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:
> Lars> | This would break compatibility with older versions of
> fdesign.
> 
> Lars> Would it really?
> 
> Lars> Older versions of fdesign only works with the *.fd file in the
> Lars> same dir as where fdesign is run...
> 
> Lars> So I see no compatibility problems.
> 
> Good remark, it seems you are right.
> 
> Angus, this probably means that we can/should get rid of the -dir
> argument.

We would merely be swapping one semantic that works for another one
which is not yet proven. I don't see what it gains us. As I see it I
can do:

$ cd $HOME
$ fdesign -dir destdir -convert foo/bar.fd

which seems more flexible to me than Lars' proposal.

-- 
Angus



Re: fdesign -convert is buggy

2004-05-27 Thread Angus Leeming
Lars Gullik Bjønnes wrote:

> Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> | @@ -610,8 +600,14 @@ pre_connect(int ac, char *av[])
> |  
> |  for (s = i; s < ac; s++)
> |  {
> | -   if (load_forms(FALSE, av[s], 0) >= 0)
> | -   save_forms(av[s]);
> | +   if (load_forms(FALSE, av[s], 0) < 0) {
> | +   fprintf(stderr, "Unable to load %s\n", av[s]);
> | +   exit(1);
> | +   }
> | +   if (!save_forms(av[s])) {
> | +   fprintf(stderr, "Unable to convert %s\n", av[s]);
> | +   exit(1);
> | +   }
> 
> What if save_forms fails becuase it is unable to create the new
> files? But conversion proper when just ok?

The routine is misnamed. It does both (any necessary) saving and
conversion.

> 
> | @@ -780,22 +771,8 @@ main(int ac, char *av[])
> |  fd_buttonLabelSize = fl_cntl.buttonFontSize;
> |  fl_cntl.buttonFontSize = 0;
> |  
> | -
> |  /* Initialize stuff */
> |  init_classes();
> | -
> | -if (fdopt.conv_only)
> | -{
> | -   if (ac == 1)
> | -   fprintf(stderr, "%s: -convert requires arguments\n", av[0]);
> | -
> | -   for (s = 1; s < ac; s++)
> | -   {
> | -   load_forms(FALSE, av[s], 0);
> | -   save_forms(av[s]);
> | -   }
> | -   exit(0);
> | -}
> 
> Isn't this removing functionality?

No. This code is never reached.

-- 
Angus



Re: fdesign -convert is buggy

2004-05-27 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:

Lars> Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:
Lars> | This would break compatibility with older versions of fdesign.

Lars> Would it really?

Lars> Older versions of fdesign only works with the *.fd file in the
Lars> same dir as where fdesign is run...

Lars> So I see no compatibility problems.

Good remark, it seems you are right. 

Angus, this probably means that we can/should get rid of the -dir
argument.

JMarc


Re: fdesign -convert is buggy

2004-05-27 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:

>> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:
>
| Lars> | Moreover, running (again from the builddir != src dir):
>>>
| Lars> | fdesign -dir . -convert |
| Lars> /home/angus/lyx/devel/src/frontends/xforms/forms/form_external.fd
>
| Lars> is the -dir . needed? IMHO it shouldn't be. fdesign should just
| Lars> output its files to PWD
>
| This would break compatibility with older versions of fdesign.

Would it really?

Older versions of fdesign only works with the *.fd file in the same
dir as where fdesign is run...

So I see no compatibility problems.

-- 
Lgb



Re: fdesign -convert is buggy

2004-05-27 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:

Lars> | Moreover, running (again from the builddir != src dir):
>>
Lars> | fdesign -dir . -convert |
Lars> /home/angus/lyx/devel/src/frontends/xforms/forms/form_external.fd

Lars> is the -dir . needed? IMHO it shouldn't be. fdesign should just
Lars> output its files to PWD

This would break compatibility with older versions of fdesign.

JMarc


Re: fdesign -convert is buggy

2004-05-27 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:

| @@ -610,8 +600,14 @@ pre_connect(int ac, char *av[])
|  
|   for (s = i; s < ac; s++)
|   {
| - if (load_forms(FALSE, av[s], 0) >= 0)
| - save_forms(av[s]);
| + if (load_forms(FALSE, av[s], 0) < 0) {
| + fprintf(stderr, "Unable to load %s\n", av[s]);
| + exit(1);
| + }
| + if (!save_forms(av[s])) {
| + fprintf(stderr, "Unable to convert %s\n", av[s]);
| + exit(1);
| + }

What if save_forms fails becuase it is unable to create the new files?
But conversion proper when just ok?

| @@ -780,22 +771,8 @@ main(int ac, char *av[])
|  fd_buttonLabelSize = fl_cntl.buttonFontSize;
|  fl_cntl.buttonFontSize = 0;
|  
| -
|  /* Initialize stuff */
|  init_classes();
| -
| -if (fdopt.conv_only)
| -{
| - if (ac == 1)
| - fprintf(stderr, "%s: -convert requires arguments\n", av[0]);
| -
| - for (s = 1; s < ac; s++)
| - {
| - load_forms(FALSE, av[s], 0);
| - save_forms(av[s]);
| - }
| - exit(0);
| -}

Isn't this removing functionality?

-- 
Lgb



Re: fdesign -convert is buggy

2004-05-27 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:

| Do you have xforms cvs?

no (and that is probably good since I now caught the problem myself,
and didn't have to debug somebody elses problem)

| If my testing doesn't throw up any problems,
| I'm going to commit the attached patch. It gives you improved
| diagnostics.

nice

>
| The cvs version of fdesign will already enable you to run
| $ fdesign -dir  -convert form_aboutlyx.fd
>
| For example:
>
| Testing shows that running the cvs version of fdesign from the build
| dir (!= src dir) so:
| fdesign -convert
| /home/angus/lyx/devel/src/frontends/xforms/forms/form_external.fd
>
| works, shoving form_external.[ch] in the same directory as the .fd
| file.

I don't agree with that behaviour.

>
| Moreover, running (again from the builddir != src dir):
>
| fdesign -dir . -convert
| /home/angus/lyx/devel/src/frontends/xforms/forms/form_external.fd

is the -dir . needed? IMHO it shouldn't be.
fdesign should just output its files to PWD

| shoves form_external.[ch] in the build dir.
>
| Ie, current cvs does all that you want of it.

Good. But until we require xforms 1.1 we will need the work-around.

-- 
Lgb



Re: fdesign -convert is buggy

2004-05-27 Thread Angus Leeming
Lars Gullik Bjnnes wrote:

> Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> | Lars Gullik Bjnnes wrote:
>>> It seems that fdesign returns 0 even if something went wrong.
> 
> I forgot to say "when using -convert"
> 
> | Wrong list...
> 
> I know... but this is where I have the problem...
> 
> | Both load_forms and save_forms return whether they were successful
> | or not, so this could easily be changed to:
>>
> | for (s = 1; s < ac; s++)
> | {
> | if (!load_forms(FALSE, av[s], 0))
> | exit(1);
> | if (!save_forms(av[s]))
> | exit(1);
> | }
>>
> | Thanks for the heads up.
> 
> Sure.
> 
> But some kind of error handling and a message to the user would be
> nice.
> 
> And that it failes when the fd file is called as ./foo.fd is a bit
> strange...

Do you have xforms cvs? If my testing doesn't throw up any problems,
I'm going to commit the attached patch. It gives you improved
diagnostics.

The cvs version of fdesign will already enable you to run
$ fdesign -dir  -convert form_aboutlyx.fd

For example:

Testing shows that running the cvs version of fdesign from the build
dir (!= src dir) so:
fdesign -convert
/home/angus/lyx/devel/src/frontends/xforms/forms/form_external.fd

works, shoving form_external.[ch] in the same directory as the .fd
file.

Moreover, running (again from the builddir != src dir):

fdesign -dir . -convert
/home/angus/lyx/devel/src/frontends/xforms/forms/form_external.fd

shoves form_external.[ch] in the build dir.

Ie, current cvs does all that you want of it.

-- 
AngusIndex: fdesign/fd_main.c
===
RCS file: /cvsroot/xforms/xforms/fdesign/fd_main.c,v
retrieving revision 1.10
diff -u -p -r1.10 fd_main.c
--- fdesign/fd_main.c	18 May 2004 13:57:11 -	1.10
+++ fdesign/fd_main.c	27 May 2004 12:09:10 -
@@ -86,12 +86,10 @@ FD_Opt fdopt;
 Conv convertor[MAX_CONVERTOR + 1];
 
 int fd_cntlborder;
-int help;			/* if convert only */
 int fd_bwidth;
 int is_pasting;
 int fd_trackgeometry = 1;
 int fd_show_palette;
-int fd_pversion;
 int fd_buttonLabelSize;
 int fd_helpfontsize = 14;
 int fd_align_fontsize = FL_TINY_SIZE;
@@ -587,15 +585,7 @@ pre_connect(int ac, char *av[])
 
 if (fdopt.conv_only)
 {
-	fl_set_app_name(av[0], "Fdesign");	/* resource routine want this
-
-
-
-
-
-
-
-		 */
+	fl_set_app_name(av[0], "Fdesign");  /* resource routine wants this */
 	fl_init_fl_context();
 	create_the_forms();
 	init_classes();
@@ -610,8 +600,14 @@ pre_connect(int ac, char *av[])
 
 	for (s = i; s < ac; s++)
 	{
-	if (load_forms(FALSE, av[s], 0) >= 0)
-		save_forms(av[s]);
+	if (load_forms(FALSE, av[s], 0) < 0) {
+		fprintf(stderr, "Unable to load %s\n", av[s]);
+		exit(1);
+	}
+	if (!save_forms(av[s])) {
+		fprintf(stderr, "Unable to convert %s\n", av[s]);
+		exit(1);
+	}
 	}
 	exit(0);
 }
@@ -721,7 +717,9 @@ main(int ac, char *av[])
 
 initialize();
 
-/* For conversion and usage help, we don't need a connection */
+/* For conversion, version and usage help, we don't need a connection.
+   pre_connect will exit in such circumstances.
+*/
 pre_connect(ac, av);
 
 /* force fdesign to come up in default visual */
@@ -741,19 +739,12 @@ main(int ac, char *av[])
 fl_get_app_resources(fdres, Nropt);
 fl_add_signal_callback(SIGINT, interrupted, 0);
 
-if (fd_pversion)
-	print_version(1);
-
-if (help)
-	usage(av[0], 1);
-
 if (av[1] && av[1][0] == '-')
 {
 	fprintf(stderr, " Unknown option: %s\n", av[1]);
 	usage(av[0], 1);
 }
 
-
 fl_cntl.coordUnit = FL_COORD_PIXEL;
 fdopt.unit = unit_val(fd_sunit);
 fdopt.language = lang_val(fd_slanguage);
@@ -780,22 +771,8 @@ main(int ac, char *av[])
 fd_buttonLabelSize = fl_cntl.buttonFontSize;
 fl_cntl.buttonFontSize = 0;
 
-
 /* Initialize stuff */
 init_classes();
-
-if (fdopt.conv_only)
-{
-	if (ac == 1)
-	fprintf(stderr, "%s: -convert requires arguments\n", av[0]);
-
-	for (s = 1; s < ac; s++)
-	{
-	load_forms(FALSE, av[s], 0);
-	save_forms(av[s]);
-	}
-	exit(0);
-}
 
 fl_set_counter_bounds(fd_align->snapobj, 0.0, 500.0);
 fl_set_counter_step(fd_align->snapobj, 1.0, 5.0);


Re: fdesign -convert is buggy

2004-05-27 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjønnes wrote:
>> It seems that fdesign returns 0 even if something went wrong.

I forgot to say "when using -convert"

| Wrong list...

I know... but this is where I have the problem... 

| Both load_forms and save_forms return whether they were successful or
| not, so this could easily be changed to:
>
| for (s = 1; s < ac; s++)
| {
| if (!load_forms(FALSE, av[s], 0))
| exit(1);
| if (!save_forms(av[s]))
| exit(1);
| }
>
| Thanks for the heads up.

Sure.

But some kind of error handling and a message to the user would be
nice.

And that it failes when the fd file is called as ./foo.fd is a bit
strange...

-- 
Lgb



Re: [patch] unneeded files

2004-05-27 Thread Lars Gullik Bjønnes
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| -dir destdir is not really needed, what is needed is the argument to
|  -convert to be any file with path.

And fdesign to output to current working dir.

-- 
Lgb



Re: [patch] unneeded files

2004-05-27 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjønnes wrote:
>> The distcheck target in newer automake is a bit stricter than in
>> previous versions. Among others it requires that when doing a VPATH
>> build, _nothing_ should change outside the build dir.
>> 
>> The scripts in xforms/forms does not ahere to this rule.
>
| Hmmm. I guess that this is the problem then:
>
| (cd ${DIRNAME} && ${FDESIGN} -convert ${FDFILE}) ||
| {
| echo "\"${FDESIGN} -convert ${FDFILE}}\" failed. Please investigate."
| exit 1
| }
>
| IIRC, fdesign must be run in the directory containing the .fd file.
| That changes with XForms 1.1, allowing '-dir destdir' to be passed to
| fdesign so that it outputs all generated files in destdir. That's no
| help here of course because we still support XForms 1.0.

-dir destdir is not really needed, what is needed is the argument to
 -convert to be any file with path.

| So I guess that you'll have to copy ${FDFILE} over to the build tree
| if build tree != src tree. You'll then be able to run fdesign in the
| build directory.

Not if I use ./*.fd ...

This should also be fixed in fdesign I guess.

-- 
Lgb



Re: fdesign -convert is buggy

2004-05-27 Thread Angus Leeming
Lars Gullik Bjønnes wrote:
> And the arguemnt to convert _must_ be _just_ a file. Not even ./ is
> allowed in front of the filename.

I know. Crappy isn't it.

-- 
Angus



Re: fdesign -convert is buggy

2004-05-27 Thread Angus Leeming
Lars Gullik Bjønnes wrote:
> It seems that fdesign returns 0 even if something went wrong.
> 
> (writing the files f.ex.)

Wrong list...

In general, you're wrong. fdesign will exit early and return 1 in lots
of places:

if (!(fd_display = fl_initialize(&ac, av, 0, fd_cmdopt, Ncopt)))
exit(1);

Also, it calls 'usage' in lots of places. the '1' leads to exit(1).

if (help)
usage(av[0], 1);

But in this specific conversion case you're right, fdesign always
returns 0:

if (fdopt.conv_only)
{
if (ac == 1)
fprintf(stderr, "%s: -convert requires arguments\n", av[0]);

for (s = 1; s < ac; s++)
{
load_forms(FALSE, av[s], 0);
save_forms(av[s]);
}
exit(0);
}

Both load_forms and save_forms return whether they were successful or
not, so this could easily be changed to:

for (s = 1; s < ac; s++)
{
if (!load_forms(FALSE, av[s], 0))
exit(1);
if (!save_forms(av[s]))
exit(1);
}

Thanks for the heads up.

-- 
Angus



Re: fdesign -convert is buggy

2004-05-27 Thread Lars Gullik Bjønnes
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| It seems that fdesign returns 0 even if something went wrong.
>
| (writing the files f.ex.)

And the arguemnt to convert _must_ be _just_ a file. Not even ./ is
allowed in front of the filename.

-- 
Lgb



Re: [patch] unneeded files

2004-05-27 Thread Angus Leeming
Lars Gullik Bjønnes wrote:
> The distcheck target in newer automake is a bit stricter than in
> previous versions. Among others it requires that when doing a VPATH
> build, _nothing_ should change outside the build dir.
> 
> The scripts in xforms/forms does not ahere to this rule.

Hmmm. I guess that this is the problem then:

(cd ${DIRNAME} && ${FDESIGN} -convert ${FDFILE}) ||
{
echo "\"${FDESIGN} -convert ${FDFILE}}\" failed. Please investigate."
exit 1
}

IIRC, fdesign must be run in the directory containing the .fd file.
That changes with XForms 1.1, allowing '-dir destdir' to be passed to
fdesign so that it outputs all generated files in destdir. That's no
help here of course because we still support XForms 1.0.

So I guess that you'll have to copy ${FDFILE} over to the build tree
if build tree != src tree. You'll then be able to run fdesign in the
build directory.

-- 
Angus



fdesign -convert is buggy

2004-05-27 Thread Lars Gullik Bjønnes

It seems that fdesign returns 0 even if something went wrong.

(writing the files f.ex.)

-- 
Lgb


Re: [patch] unneeded files

2004-05-27 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjønnes wrote:
>> It would be nice if people could try this patch (the mkinstalldirs
>> part really) and see if they have any problems.
>
| Lars,
>
| I've had no problems at all installing in /home/angus/testing
| following 'make maintainer-clean'. This with a stock FC 1.

Good. Now I need to fix up the "distcheck" target.

The distcheck target in newer automake is a bit stricter than in
previous versions. Among others it requires that when doing a VPATH
build, _nothing_ should change outside the build dir.

The scripts in xforms/forms does not ahere to this rule.

-- 
Lgb



Re: [patch] unneeded files

2004-05-27 Thread Angus Leeming
Lars Gullik Bjønnes wrote:
> It would be nice if people could try this patch (the mkinstalldirs
> part really) and see if they have any problems.

Lars,

I've had no problems at all installing in /home/angus/testing
following 'make maintainer-clean'. This with a stock FC 1.

Angus

-- 
Angus



Re: Why does 'make' trigger 'msgmerge'?

2004-05-27 Thread Angus Leeming
Lars Gullik Bjønnes wrote:
> Angus Leeming <[EMAIL PROTECTED]> writes:
> | It's never done this before. We've always needed 'make dist' or
> | suchlike.
> 
> Newer gettext work a bit differently. The merge is triggered when
> lyx.pot is created and since we don't have it in CVS...

Good oh. Glad to hear that all is going according to plan, for some
meaning of plan.

-- 
Angus



Re: Why does 'make' trigger 'msgmerge'?

2004-05-27 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:

| It's never done this before. We've always needed 'make dist' or
| suchlike.

Newer gettext work a bit differently. The merge is triggered when
lyx.pot is created and since we don't have it in CVS...

>
| This is this morning (so I've got Lars nt_defines.h patch) on a stock
| FC1 after:
>
| $ make maintainer-clean
| $ cd ..
| $ cvs -q up
| $ ./autogen.sh
| $ mkdir build && cd build
| $ ../configure --prefix=/home/angus/testing --enable-maintainer-mode
| --with-version-suffix --with-included-gettext --with-frontend='xforms
| qt gtk'
| $ make
>
| Fortunately, subsequent 'make's don't trigger 'msgmerge.

As designed by the gettext system.

-- 
Lgb



Why does 'make' trigger 'msgmerge'?

2004-05-27 Thread Angus Leeming
It's never done this before. We've always needed 'make dist' or
suchlike.

This is this morning (so I've got Lars nt_defines.h patch) on a stock
FC1 after:

$ make maintainer-clean
$ cd ..
$ cvs -q up
$ ./autogen.sh
$ mkdir build && cd build
$ ../configure --prefix=/home/angus/testing --enable-maintainer-mode
--with-version-suffix --with-included-gettext --with-frontend='xforms
qt gtk'
$ make

Fortunately, subsequent 'make's don't trigger 'msgmerge.

Still building. Will report back later whether I installed
successfully in /home/angus/testing.

-- 
Angus



[patch] unneeded files

2004-05-27 Thread Lars Gullik Bjønnes

It would be nice if people could try this patch (the mkinstalldirs
part really) and see if they have any problems.

My testing so far shows no problems.

(OTOH I know of a problem in POTFILES.in generation...
src/support/path_defines.C is not always there... and should thus be
excluded from POTFILES.in but isn't)

? Config
? counter-2.diff
? counter-3.diff
? counter.diff
? deptherror.diff
? deptherror.lyx
? dispatch-2.diff
? dispatch-3.diff
? dispatch-4.diff
? end.lyx
? kystskipper-a-1.lyx
? morectrs.lyx
? refenum.lyx
? unneeded.diff
Index: mkinstalldirs
===
RCS file: mkinstalldirs
diff -N mkinstalldirs
--- mkinstalldirs	21 Nov 2000 16:35:36 -	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -
@@ -1,32 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <[EMAIL PROTECTED]>
-# Created: 1993-05-16
-# Public domain
-
-errstatus=0
-
-for file
-do
-   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
-   shift
-
-   pathcomp=
-   for d in ${1+"$@"} ; do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
-   -* ) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
-echo "mkdir $pathcomp" 1>&2
-mkdir "$pathcomp" || errstatus=$?
- fi
-
- pathcomp="$pathcomp/"
-   done
-done
-
-exit $errstatus
-
-# mkinstalldirs ends here
Index: config/depcomp.diff
===
RCS file: config/depcomp.diff
diff -N config/depcomp.diff
--- config/depcomp.diff	22 Mar 2002 12:32:11 -	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -
@@ -1,39 +0,0 @@
-Index: depcomp
-===
-RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/depcomp,v
-retrieving revision 1.1
-diff -u -p -r1.1 depcomp
 depcomp	17 Oct 2001 15:38:58 -	1.1
-+++ depcomp	22 Mar 2002 12:18:23 -
-@@ -198,14 +198,28 @@ aix)
-   ;;
- 
- tru64)
--   # The Tru64 AIX compiler uses -MD to generate dependencies as a side
-+   # The Tru64 DEC compiler uses -MD to generate dependencies as a side
-# effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
-# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 
-# dependencies in `foo.d' instead, so we check for that too.
-# Subdirectories are respected.
- 
--   tmpdepfile1="$object.d"
--   tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` 
-+   # This is incorrect as it assumes that $object has a .o extension when
-+   # it could well have a .lo one.
-+   #tmpdepfile1="$object.d"
-+   # This is just bad sed. The /.o$/ should be /\.o/, nonwithstanding the
-+   # flawed logic, described above.
-+   #tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
-+
-+   # The correct way:
-+   # Strip the (.o, or .lo) extension from $object
-+   # (Same piece of sed magic as used for the AIX compiler above.)
-+   stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
-+   # Tru64 compiler dependency file.
-+   tmpdepfile1="$stripped.o.d"
-+   # Compaq CCC V6.2 dependency file.
-+   tmpdepfile2="$stripped.d"
-+
-if test "$libtool" = yes; then
-   "$@" -Wc,-MD
-else
Index: config/gettext.m4.patch
===
RCS file: config/gettext.m4.patch
diff -N config/gettext.m4.patch
--- config/gettext.m4.patch	8 Jan 2000 21:06:59 -	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -
@@ -1,16 +0,0 @@
 /usr/share/aclocal/gettext.m4	Thu Sep 23 05:05:24 1999
-+++ gettext.m4	Sat Jan  8 04:12:49 2000
-@@ -227,7 +227,12 @@
-  else
-AC_MSG_CHECKING(for catalogs to be installed)
-NEW_LINGUAS=
--   for lang in ${LINGUAS=$ALL_LINGUAS}; do
-+dnl == Fix is here! ==
-+dnl Some sh do not like substitution in bounds of for loops
-+dnlfor lang in ${LINGUAS=$ALL_LINGUAS}; do
-+tmplinguas=${LINGUAS=$ALL_LINGUAS}
-+for lang in ${tmplinguas}; do
-+dnl  end of fix
-  case "$ALL_LINGUAS" in
-   *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
-  esac
Index: po/.cvsignore
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/.cvsignore,v
retrieving revision 1.10
diff -u -p -r1.10 .cvsignore
--- po/.cvsignore	26 May 2004 16:53:46 -	1.10
+++ po/.cvsignore	27 May 2004 08:24:59 -
@@ -14,3 +14,4 @@ xforms_l10n.pot
 default_ui_l10n.pot
 languages_l10n.pot
 ui_l10n.pot
+remove-potcdate.sed
Index: po/POTFILES.in
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/POTFILES.in,v
retrieving revision 1.391
diff -u -p -r1.391 POTFILES.in
--- po/POTFILES.in	26 May 2004 20:26:09 -	1.391
+++ po/POTFILES.in	27 May 2004 08:24:59 -
@@ -188,6 +188,7 @@ src/output_plaintext.C
 src/paragraph.C
 src/rowpainter.C
 src/support/globbing.C
+src/support/path_defines.C
 s

Re: The real solution to the Cygwin compile problems

2004-05-27 Thread Lars Gullik Bjønnes
"Kayvan A. Sylvan" <[EMAIL PROTECTED]> writes:

| I got tired of wrestling with the config mechanism.
>
| Please apply this (support/nt_defines.h is not used) and then
| "cvs remove" the support/nt_defines.h file.

I'll handle this one.

-- 
Lgb



The real solution to the Cygwin compile problems

2004-05-27 Thread Kayvan A. Sylvan
I got tired of wrestling with the config mechanism.

Please apply this (support/nt_defines.h is not used) and then
"cvs remove" the support/nt_defines.h file.

Thanks.

-- 
Kayvan A. Sylvan  
Sylvan Associates, Inc.   
http://sylvan.com/~kayvan
Index: ChangeLog
===
RCS file: /cvs/lyx/lyx-devel/ChangeLog,v
retrieving revision 1.964
diff -u -r1.964 ChangeLog
--- ChangeLog   2004/05/26 23:03:07 1.964
+++ ChangeLog   2004/05/27 07:07:02
@@ -1,3 +1,9 @@
+2004-05-27  Kayvan Sylvan <[EMAIL PROTECTED]>
+
+   * configure.ac: Remove reference to support/nt_defines.h
+
+   * config/acconfig.h: Remove reference to support/nt_defines.h
+
 2004-05-26  Lars Gullik Bjonnes  <[EMAIL PROTECTED]>
 
* autogen.sh (ACLOCAL): make all aclocal find m4
Index: configure.ac
===
RCS file: /cvs/lyx/lyx-devel/configure.ac,v
retrieving revision 1.19
diff -u -r1.19 configure.ac
--- configure.ac2004/05/26 16:53:44 1.19
+++ configure.ac2004/05/27 07:07:02
@@ -361,10 +361,6 @@
 #include "support/os2_defines.h"
 #endif
 
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
-#include "support/nt_defines.h"
-#endif
-
 #if defined(HAVE_OSTREAM) && defined(HAVE_LOCALE) && defined(HAVE_SSTREAM)
 #define USE_BOOST_FORMAT 1
 #else
Index: config/acconfig.h
===
RCS file: /cvs/lyx/lyx-devel/config/acconfig.h,v
retrieving revision 1.2
diff -u -r1.2 acconfig.h
--- config/acconfig.h   2002/11/24 15:20:31 1.2
+++ config/acconfig.h   2004/05/27 07:07:02
@@ -78,10 +78,6 @@
 #include "support/os2_defines.h"
 #endif
 
-#if defined(__CYGWIN__) || defined( __CYGWIN32__)
-#include "support/nt_defines.h"
-#endif
-
 /* Some support for the boost library. */
 /*
  * #ifndef HAVE_LIMITS
Index: src/support/ChangeLog
===
RCS file: /cvs/lyx/lyx-devel/src/support/ChangeLog,v
retrieving revision 1.253
diff -u -r1.253 ChangeLog
--- src/support/ChangeLog   2004/05/20 09:35:30 1.253
+++ src/support/ChangeLog   2004/05/27 07:07:02
@@ -1,3 +1,7 @@
+2004-05-27  Kayvan Sylvan <[EMAIL PROTECTED]>
+
+   * Makefile.am: remove reference to nt_defines.h
+
 2004-05-20  Angus Leeming  <[EMAIL PROTECTED]>
 
* debugstream.h: wrap the definition of debug_trait::DEBUG with
Index: src/support/Makefile.am
===
RCS file: /cvs/lyx/lyx-devel/src/support/Makefile.am,v
retrieving revision 1.73
diff -u -r1.73 Makefile.am
--- src/support/Makefile.am 2004/01/06 19:32:05 1.73
+++ src/support/Makefile.am 2004/05/27 07:07:02
@@ -51,7 +51,6 @@
lyxtime.h \
lyxsum.C \
mkdir.C \
-   nt_defines.h \
os.C \
os.h \
os2_defines.h \


Re: Questions on Instant Preview in 1.3.5

2004-05-27 Thread Jose' Matos
On Wednesday 26 May 2004 16:47, Jean-Marc Lassitude's wrote:
>
> Angus> The python script does all the manipulation using pure python
> Angus> code, so it should "just work" if you have python installed.
>
> Do you think it works with ancient python like 1.5?

   From what I remember from the code the answer is yes.

> JMarc

PS: I don't know when this message will hit the list, but here it goes 
nevertheless.

-- 
José Abílio

LyX and docbook, a perfect match. :-)