Re: Patch to makefile-temp

2014-06-03 Thread Vincent Belaïche
Hello Roland,

The 1st question should be why I don't simply use only forward slashes
under MSYS. As you know forward slashes are supported by MSWindows. This
is a separate issue from converting from an MSYS path like (call it /p/ ):

/c/Programme/GNU/installation/bbdb-git/bbdb/lisp

to a MSWindows path like (call it p:/ )

c:/Programme/GNU/installation/bbdb-git/bbdb/lisp

but also for purists (call it p:\ ):

c:\Programme\GNU\installation\bbdb-git\bbdb\lisp


EMACS does not understand /p/ paths, so I need to convert to p:\ or
p:/. Using p:/ would have been simpler and was supposed to work all the
same, however, the thing is that when I used the p:/ way instead of the
p:\ way, then I got this message:

Saving file 
c:/Programme/GNU/installation/emacs-install/emacs/trunk/lisp/c;c:msys.0ProgrammeGNUinstallatiobdb-gibdblisbdb-loaddefs.el...
Wrote 
c:/Programme/GNU/installation/emacs-install/emacs/trunk/lisp/c;c:msys.0ProgrammeGNUinstallatiobdb-gibdblisbdb-loaddefs.el

which shows that the generated bbdb-loaddefs.el seems not to go to the
right place. It seems therefore that my EMACS does some path processing
that interpretes the p:/ absolute path of the bbdb-loaddefs.el like a
unix list of pathes...

Maybe there is something wrong with my EMACS version, this is a build
from source that is approximately one year old. I know that there has
been changes in EMACS so that the build under MSWindows is made with
MSYS --- before there was some DOS batch to do that. Maybe this problem
that calls for p:\ instead of simply using p:/ would not happen with a
more recent or older version of EMACS.

Anyway, you are right in mentioning that my patch has some border effect
on other systems than MSYS. Please find herein attached an updated
patch.

  Vincent

Roland Winkler a écrit :
 On Mon Jun 2 2014 Vincent Belaïche wrote:
 ---eval '(setq generated-autoload-file '`pwd`/$@')' \
 +--eval '(setq generated-autoload-file $(cur_dir)\\$@)' \

 How is the backslash supposed to work on unix-like systems?
 Am I missing something?


diff --git a/lisp/makefile-temp b/lisp/makefile-temp
index 48daf1d..c2ad518 100644
--- a/lisp/makefile-temp
+++ b/lisp/makefile-temp
@@ -23,6 +23,17 @@
 # This file can compile BBDB's lisp code on most systems.  Yet it is not
 # intended to be foolproof!
 
+# For building under MSYS export OSTYPE to msys
+
+ifeq ($(OSTYPE),msys)
+# file separator must be escaped for lisp strings
+  cur_dir=$(shell pwd -W | sed 's!/!!g')
+  fs=\\
+else
+  cur_dir=$(CURDIR)
+  fs=/
+endif
+
 srcdir = .
 prefix = /usr/local
 lispdir = $(DESTDIR)/usr/local/share/emacs/site-lisp/bbdb
@@ -87,9 +98,9 @@ bbdb-loaddefs.el: $(SRCS)
 #	Generated autoload-file must have an absolute path,
 #	$(srcdir) can be relative.
 	$(emacs) -l autoload \
-		--eval '(setq generated-autoload-file '`pwd`/$@')' \
+		--eval '(setq generated-autoload-file $(cur_dir)$(fs)$@)' \
 		--eval '(setq make-backup-files nil)' \
-		-f batch-update-autoloads `pwd`
+		-f batch-update-autoloads $(cur_dir)
 
 .PHONY: no-bbdb-loaddefs
 no-bbdb-loaddefs:
--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Re: Patch to makefile-temp

2014-06-03 Thread Roland Winkler
On Tue Jun 3 2014 Vincent Belaïche wrote:
 Anyway, you are right in mentioning that my patch has some border
 effect on other systems than MSYS. Please find herein attached an
 updated patch.

I am sorry, I am still not excited about this.

The idea about lisp/makefile-temp has been to keep it plain and
simple (as compared with the autotools stuff that has its own
twists).  Yet your code uses syntax specific for GNU Make (ifeq and
CURDIR).  Sure, it's possible to work around it and turn this file
into a fancy Makefile with all bells and whistles that cover all
possibilities.  But that has Not been the goal here and I do not
want to get lost in such an effort.

I am sorry!

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/