[plt-scheme] Small glitch in mzc
Dear All,
I've stumbled accross a small glitch in mzc on Linux:
######################################################################################################
cp mzgtk2.i.h mzgtk2.i
swig -DSWIGGTK=20400 -mzscheme -declaremodule mzgtk2.i
mzc -v ++ccf -I. ++ccf -I/home/hans/local/include ++ccf
-I/home/hans/local/bin/include ++ccf -DXTHREADS ++ccf -D_REENTRANT ++ccf
-DXUSE_MTSAFE_API ++ccf -I/usr/include/gtk-2.0 ++ccf
-I/usr/lib/gtk-2.0/include ++ccf -I/usr/X11R6/include ++ccf
-I/usr/include/atk-1.0 ++ccf -I/usr/include/pango-1.0 ++ccf
-I/usr/include/freetype2 ++ccf -I/usr/include/freetype2/config ++ccf
-I/usr/include/glib-2.0 ++ccf -I/usr/lib/glib-2.0/include ++ccf
-DMZGTK2_DEBUG ++ccf -DMZGTK2_MALLOC ++ccf -DLinux --cc mzgtk2_wrap.c
MzScheme compiler (mzc) version 299.100, Copyright (c) 2005 PLT Scheme, Inc.
"mzgtk2_wrap.c":
compile-extension: (/usr/bin/gcc -c -O2 -fPIC -I.
-I/home/hans/local/include -I/home/hans/local/bin/include -DXTHREADS
-D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0
-I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0
-I/usr/include/pango-1.0 -I/usr/include/freetype2
-I/usr/include/freetype2/config -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -DMZGTK2_DEBUG -DMZGTK2_MALLOC -DLinux
-I/home/hans/local/include mzgtk2_wrap.c -o ./mzgtk2_wrap.o)
[output to "./mzgtk2_wrap.o"]
gcc -c -I. -I$HOME/local/include -I/home/hans/local/bin/include
-DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0
-I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0
-I/usr/include/pango-1.0 -I/usr/include/freetype2
-I/usr/include/freetype2/config -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -DMZGTK2_DEBUG -DMZGTK2_MALLOC -DLinux
convert_enums.c
mkdir -p compiled/native/i386-linux
mzc -v ++ldf -Wl,--export-dynamic ++ldf -lgtk-x11-2.0 ++ldf
-lgdk-x11-2.0 ++ldf -latk-1.0 ++ldf -lgdk_pixbuf-2.0 ++ldf -lm ++ldf
-lpangoxft-1.0 ++ldf -lpangox-1.0 ++ldf -lpango-1.0 ++ldf -lgobject-2.0
++ldf -lgmodule-2.0 ++ldf -ldl ++ldf -lglib-2.0 --ld mzgtk2wrap.so
mzgtk2_wrap.o mzgtk2.o btree.o convert_enums.o
MzScheme compiler (mzc) version 299.100, Copyright (c) 2005 PLT Scheme, Inc.
"mzgtk2_wrap.o" "mzgtk2.o" "btree.o" "convert_enums.o":
link-extension: (/usr/bin/ld -shared -Wl,--export-dynamic -lgtk-x11-2.0
-lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0
-lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 mzgtk2_wrap.o
mzgtk2.o btree.o convert_enums.o /home/hans/local/lib/mzdyn.o -o
mzgtk2wrap.so)
/usr/bin/ld: unrecognized option '-Wl,--export-dynamic'
/usr/bin/ld: use the --help option for usage information
link-extension: command failed
make: *** [compiled/native/i386-linux/mzgtk2wrap.so] Error 1
######################################################################################################
Looks like mzc is "thinking" gcc is called instead of ld. When I issue:
######################################################################################################
ld -shared --export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
-lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0
-lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 mzgtk2_wrap.o mzgtk2.o
btree.o convert_enums.o /home/hans/local/lib/mzdyn.o -o
compiled/native/i386-linux/mzgtk2wrap.so
######################################################################################################
It works.
I've compiled mzscheme 299.100 from sources. Note however, Pedro Kroger
has had the same problem with mzscheme 209.
Best whishes,
--Hans