Stephen J. Turnbull writes:
 Henry S. Thompson writes:
  > So the Makefile I'm using is
  > 
  >   modules/postgresql/Makefile
 That's the problem, then.  That Makefile doesn't know how to link
 xemacs, only .ells. 
 This script
     cd $builddir
     $srcdir/configure --without-modules --with-postgresql $OTHER_OPTIONS
     make distclean                # or in a fresh checkout
     make
 should Just Work[tm] due to this definition in src/Makefile.in.in:
     #if defined(HAVE_POSTGRESQL) && !defined(HAVE_SHLIB)
     postgresql_objs=$(BLDMODULES)/postgresql/postgresql.o
     #endif 
I'm still worried we're at cross-purposes here.  My top-level
configure is working just fine.  It produces the relevant Makefile
(modules/postgresql/Makefile), and make eventually uses it:
  config.status: creating modules/postgresql/Makefile.in
  . . .
  cd ./modules/postgresql && make  all
  make[1]: Entering directory `/usr/local/src/xemacs-21.5-scratch/modules/postgresql'
  gcc  -I../../src -I/usr/local/src/xemacs-21.5-scratch/modules/postgresql/../../src -c
postgresql.c
make[1]: Leaving directory `/usr/local/src/xemacs-21.5-scratch/modules/postgresql'
But that's clearly lost its context, as there are no flags being used
to speak of. . .
So, I try to do what you suggest above, but it can't possibly work,
because make distclean deletes all the Makefiles, so make just barfs.
  > In none of these do I find -Demacs, although it _is_ spread
throughout
  > the Makefiles under src and lib-src (and nt)  . . .
 This is the magic:
 MODCC=../../lib-src/ellcc
 .c.o:
 	$(MODCC) $(MODCFLAGS) -c $<
 ellcc is a special compiler control program that knows to set
 -Demacs.  So those Makefiles are only for building modules. 
OK, so that's the immediate problem alright -- 
  egrep MODCC= modules/postgresql/*ake*
modules/postgresql/GNUmakefile:MODCC=gcc
modules/postgresql/Makefile:MODCC=gcc
modules/postgresql/Makefile.in:MODCC=gcc
That line comes from modules/common/Makefile.common
MODCC=@MOD_CC@
and that's being set to gcc because. . . we said --without-modules
So we really don't want all the ellcc palaver -- if we had it, we
wouldn't get what we need, which is just a postgresql.o compiled
correctly.
So I conclude (and this works) that what we want is the following
simple patch:
diff -r 68f8d295be49 configure.ac
--- a/configure.ac      Wed Jan 23 11:48:46 2013 -0700
+++ b/configure.ac      Sat Feb 09 15:04:26 2013 +0000
@@ -3492,7 +3492,7 @@
 fi
 if test "$with_modules" != "yes"; then
   MOD_CC="$XEMACS_CC"
-  MODCFLAGS="\$(XE_CFLAGS) -I../../src -I\$(srcdir)/../../src"
+  MODCFLAGS="\$(XE_CFLAGS) -Demacs -I../../src -I\$(srcdir)/../../src"
   INSTALLPATH=""
   MOD_INSTALL_PROGRAM="true"
   OBJECT_TO_BUILD="\$(MODNAME).o"
I suspect the following is probably wanted as well, so that all the
compile-option flags get passed down and used. . .
diff -r 68f8d295be49 Makefile.in.in
--- a/Makefile.in.in    Wed Jan 23 11:48:46 2013 -0700
+++ b/Makefile.in.in    Sat Feb 09 15:04:26 2013 +0000
@@ -77,6 +77,7 @@
 CFLAGS=@CFLAGS@
 CPPFLAGS=@CPPFLAGS@
 LDFLAGS=@LDFLAGS@
+XE_CFLAGS=@XE_CFLAGS@
 ## These help us choose version- and architecture-specific
directories
 ## to install files in.
@@ -320,7 +321,7 @@
 FRC.lisp.finder-inf.el:
 ${SUBDIR}: ${SUBDIR_MAKEFILES} ${GENERATED_HEADERS} FRC
-       cd ./$@ && $(MAKE) $(RECURSIVE_MAKE_ARGS) all
+       cd ./$@ && $(MAKE) $(RECURSIVE_MAKE_ARGS)
XE_CFLAGS="$(XE_CFLAGS)" all
 ## This should be the same code as in configure.ac.
 update-version:
But I'm hacking with incomplete understanding here, so feel free to
ignore this.
ht
-- 
       Henry S. Thompson, School of Informatics, University of Edinburgh
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 650-4587, e-mail: ht(a)inf.ed.ac.uk
                       URL: 
http://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged spam]
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta