so i'm trying to get xemacs to build, and configure decides it's ok to build
modules, but when it tries to build them, it throws up at the module-link stage,
with a zillion undefined references:
make[1]: Entering directory
`/src/xemacs/cygbuild/lilfix-mule/modules/postgresql'
../../lib-src/ellcc -g -Wall -Wno-switch -Winline -Wmissing-prototypes -Wpointer
-arith -Wno-sign-compare -Wshadow --mode=compile --mod-output=postgresql.o -I../
../src -I/src/xemacs/lilfix/modules/postgresql/../../src -c
/src/xemacs/lilfix/modules/postgresql/postgresql.c
ELLMAKEDOC=../../lib-src/make-docfile
../../lib-src/ellcc --mode=init --mod-output=postgresql_i.c \
--mod-name=postgresql --mod-version=1.0.0 \
--mod-title="PostgreSQL Client Interface for XEmacs"
/src/xemacs/lilfix/modules/postgresql/postgresql.c
../../lib-src/ellcc -g -Wall -Wno-switch -Winline -Wmissing-prototypes -Wpointer
-arith -Wno-sign-compare -Wshadow --mode=compile --mod-output=postgresql_i.o -I.
./../src -I/src/xemacs/lilfix/modules/postgresql/../../src -c postgresql_i.c
../../lib-src/ellcc --mode=link --mod-output=postgresql.ell postgresql.o
postgresql_i.o -L/usr/X11R6/lib -lpq
postgresql.o: In function `make_pgconn':
/src/xemacs/lilfix/modules/postgresql/postgresql.c:178: undefined reference to
`_wrap_record_1'
postgresql.o: In function `mark_pgconn':
/src/xemacs/lilfix/modules/postgresql/postgresql.c:194: undefined reference to
`_Qnil'
postgresql.o: In function `print_pgconn':
/src/xemacs/lilfix/modules/postgresql/postgresql.c:205: undefined reference to
`_error_check_pgconn'
/src/xemacs/lilfix/modules/postgresql/postgresql.c:228: undefined reference to
`_print_readably'
/src/xemacs/lilfix/modules/postgresql/postgresql.c:229: undefined reference to
`_printing_unreadable_object'
/src/xemacs/lilfix/modules/postgresql/postgresql.c:231: undefined reference to
`_write_c_string'
postgresql.o: In function `allocate_pgconn':
/src/xemacs/lilfix/modules/postgresql/postgresql.c:241: undefined reference to
`_alloc_automanaged_lcrecord'
postgresql.o: In function `finalize_pgconn':
/src/xemacs/lilfix/modules/postgresql/postgresql.c:254: undefined reference to
`_invalid_operation'
etc.
etc.
the problem, i assume, is that the ellcc front end is not passing the correct
flags to say "build a shared LIBRARY, damn it!" and instead it tries to build an
executable.
here's ellcc.h:
--------------------------------------------------------------------------------
----------------------------------------
/* DO NOT EDIT THIS FILE!!!! */
/* Most of this is required due to a bug in the GCC compiler driver
which prevents us from passing this on the command line. It also
reduces the compiler command line length, which can be a problem
on some systems. */
#ifndef ELLCC_HDR
#define ELLCC_HDR
#define ELLCC_CC "gcc"
#define ELLCC_CFLAGS
"-g -Wall -Wno-switch -Winline -Wmissing-prototypes -Wpointer-arith -Wno-sign-co
mpare -Wshadow"
#define ELLCC_CPPFLAGS ""
#define ELLCC_LDFLAGS " "
#define ELLCC_CF_GENERAL "-DHAVE_CONFIG_H -fno-caller-saves"
#define ELLCC_CF_ALL
"-DHAVE_CONFIG_H -fno-caller-saves -I/usr/X11R6/include"
#define ELLCC_LF_GENERAL ""
#define ELLCC_LF_ALL "-L/usr/X11R6/lib"
#define ELLCC_LIBS_GENERAL
"-lgdbm -lncurses -lintl -lwinmm -limm32 -lshell32 -lgdi32 -luser32 -lcomdlg32 -
lcomctl32 -lole32 -luuid -lwinspool -lmpr -lutil"
#define ELLCC_DLL_CFLAGS ""
#define ELLCC_DLL_LDFLAGS "-shared"
#define ELLCC_DLL_POST ""
#define ELLCC_DLL_LD "gcc"
#define ELLCC_DLL_LDO "-o"
#define ELLCC_CONFIG "i686-pc-cygwin"
#define ELLCC_EMACS_VER "21.5-b9"
#define ELLCC_PROGNAME "xemacs"
#define ELLCC_ARCHDIR "/usr/local/lib/xemacs-21.5-b9/i686-pc-cygwin"
#define ELLCC_MODDIR
"/usr/local/lib/xemacs-21.5-b9/i686-pc-cygwin/modules"
#define ELLCC_SITEMODS "/usr/local/lib/xemacs/site-modules"
--------------------------------------------------------------------------------
----------------------------------------
This is under the very latest of Cygwins:
/src/xemacs/lilfix/nt 2052$ uname -a
CYGWIN_NT-5.0 NEEEEEEE 1.3.13(0.62/3/2) 2002-10-13 23:15 i686 unknown
/src/xemacs/lilfix/nt 2053$ gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/specs
Configured with: /netrel/src/gcc-3.2-1/configure --enable-languages=c,c++,f77,ja
va --enable-libgcj --enable-threads=posix --with-system-zlib --enable-nls --with
out-included-gettext --enable-interpreter --disable-sjlj-exceptions --disable-ve
rsion-specific-runtime-libs --enable-shared --build=i686-pc-linux --host=i686-pc
-cygwin --target=i686-pc-cygwin --enable-haifa --prefix=/usr --exec-prefix=/usr
--sysconfdir=/etc --libdir=/usr/lib --includedir=/nonexistent/include --libexecd
ir=/usr/sbin
Thread model: posix
gcc version 3.2 20020818 (prerelease)
any module developers [jerry james?] out there have any ideas what's going on?
i confess to not understanding very well how dynamic linking and loading works.
ben