pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lang/mzscheme is not only for the platforms specified in Makefile



>> More than this. I got mzscheme compiled even under amd64 NetBSD but I
>> had to replace the libffi library included in mzscheme tarball with
>> the one from devel/libffi but it took me to do some hacks.
>>
>> Maybe I'll try to make things up and create a patch so that mzscheme
>> would be available under amd64 NetBSD as well but Linux's version is
>> working right now.
>
> Sounds like the package should depend on devel/libffi -- could you
> perhaps generate patches for that?
>

Yes.
First of all I've added .include "../../devel/libffi/buildlink3.mk" to
the makefile. And removed all the references to foreign/gcc/libffi in
the makefile templates and the configure script. Even though I don't
really understand deeply how the configure script and stuff work I
think I didn't break anything.

By that time however it still complained about libffi when linking
mzscheme. I don't know why it is so and I thought that including
libffi's buildlink3.mk must have solved the problem, so what I've done
next maybe wrong: I've added -lffi to the LIBS variable in global
configure script. After that everything compiled, installed and worked
fine to me.

So, I've run mkpatchset and make distinfo.

root@osu:/usr/pkgsrc/lang/mzscheme# cvs diff
? patches/patch-aa
? patches/patch-ac
? patches/patch-ad
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/mzscheme/Makefile,v
retrieving revision 1.21
diff -r1.21 Makefile
24a25
> ONLY_FOR_PLATFORM=    NetBSD-*-x86_64
25a27
> ONLY_FOR_PLATFORM+=   Linux-*-x86_64
39c41
< LIBTOOL_OVERRIDE=     src/lt/libtool src/foreign/gcc/libffi/libtool
---
> LIBTOOL_OVERRIDE=     src/lt/libtool
44a47
> .include "../../devel/libffi/buildlink3.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/lang/mzscheme/distinfo,v
retrieving revision 1.7
diff -r1.7 distinfo
5a6
> SHA1 (patch-aa) = 5f96fa9e24c9100481546699cbbf27697a0a2b2f
6a8,9
> SHA1 (patch-ac) = ed7e1d0a1f0d7c3e2a072b120a5c6de17eb1768f
> SHA1 (patch-ad) = e1b03c65b0d536356ecebfd88d9f984c4d1c100c
8c11
< SHA1 (patch-ak) = 2c7027b60b386dc66f51fca265718f1b68673576
---
> SHA1 (patch-ak) = eed24fdb4c68184429d366784679b854070418fd
Index: patches/patch-ak
===================================================================
RCS file: /cvsroot/pkgsrc/lang/mzscheme/patches/patch-ak,v
retrieving revision 1.3
diff -r1.3 patch-ak
3,5c3,13
< --- src/configure.orig        2007-04-24 17:57:35.000000000 +0200
< +++ src/configure     2007-04-24 18:00:25.000000000 +0200
< @@ -1648,7 +1648,7 @@
---
> --- src/configure.orig        2006-08-28 13:42:12.000000000 +0400
> +++ src/configure
> @@ -310,7 +310,6 @@ ac_includes_default="\
>  # include <unistd.h>
>  #endif"
>
> -ac_subdirs_all="$ac_subdirs_all foreign/gcc/libffi"
>  ac_subdirs_all="$ac_subdirs_all llvm/llvm"
>  ac_subdirs_all="$ac_subdirs_all wxcommon/jpeg"
>  ac_subdirs_all="$ac_subdirs_all wxxt/src/x/wbuild"
> @@ -1648,7 +1647,7 @@ else
13a22,39
> @@ -1746,7 +1745,7 @@ CGCOPTIONS=
>  GC2OPTIONS=
>  DYN_CFLAGS=
>
> -LIBS=
> +LIBS=-lffi
>
>  WXVARIANT="wx_xt"
>
> @@ -11320,8 +11319,6 @@ ac_configure="$SHELL $ac_aux_dir/configu
>
>
>
> -subdirs="$subdirs foreign/gcc/libffi "
> -
>    makefiles="$makefiles foreign/Makefile"
>    FOREIGNTARGET="foreign-stuff"
>    FOREIGN_OBJSLIB_IF_USED="\$(FOREIGN_OBJSLIB)"

These patches were generated:
patch-aa:

$NetBSD$

--- src/foreign/Makefile.in.orig        2009-05-22 12:53:25.000000000 +0400
+++ src/foreign/Makefile.in
@@ -5,19 +5,13 @@ builddir = @builddir@
 CC = @CC@
 CFLAGS = @CFLAGS@ @COMPFLAGS@ @PREFLAGS@ @PROFFLAGS@ @OPTIONS@ @MZOPTIONS@ \
          -I$(builddir)/../mzscheme \
-         -I$(srcdir)/../mzscheme/include -I$(srcdir)/../mzscheme/src \
-         -Igcc/libffi/include
+         -I$(srcdir)/../mzscheme/include -I$(srcdir)/../mzscheme/src
+
 ARFLAGS = @ARFLAGS@

 # compile sub-libraries & foreign.c
 all:
        $(MAKE) foreign.@LTO@
-       $(MAKE) gcc/libffi/libffi@FOREIGN_CONVENIENCE@.la
-
-# Causes objects to be generated in gcc/libffi/src/
-#  in inconvenience mode:
-gcc/libffi/libffi@FOREIGN_CONVENIENCE@.la:
-       cd gcc/libffi; $(MAKE) libffi@FOREIGN_CONVENIENCE@.la

 foreign.@LTO@: $(srcdir)/foreign.c \
            $(srcdir)/../mzscheme/include/scheme.h \
@@ -27,4 +21,3 @@ foreign.@LTO@: $(srcdir)/foreign.c \

 clean:
        rm -f foreign.@LTO@
-       cd gcc/libffi; $(MAKE) clean

patch-ac:

$NetBSD$

--- src/mzscheme/Makefile.in.orig       2009-05-22 12:51:53.000000000 +0400
+++ src/mzscheme/Makefile.in
@@ -27,8 +27,8 @@ MZSRC = $(srcdir)/src

 FOREIGN_DIR = ../foreign
 FOREIGN_OBJ = $(FOREIGN_DIR)/foreign.@LTO@
-FOREIGN_OBJS = $(FOREIGN_OBJ) $(FOREIGN_DIR)/gcc/libffi/src/*.@LTO@
$(FOREIGN_DIR)/gcc/libffi/src/*/*.@LTO@
-FOREIGN_LIB = $(FOREIGN_OBJ)
../foreign/gcc/libffi/libffi@FOREIGN_CONVENIENCE@.la
+FOREIGN_OBJS = $(FOREIGN_OBJ)
+FOREIGN_LIB = $(FOREIGN_OBJ)
 FOREIGN_OBJSLIB = @FOREIGN_OBJSLIB@
 # Dependency always uses FOREIGN_LIB, but linker uses FOREIGN_OBJSLIB. The
 #  FOREIGN_OBJSLIB expansion has too many "*"s to be a valid make target,

patch-ad:

$NetBSD$

--- src/mzscheme/configure.ac.orig      2009-05-22 12:52:26.000000000 +0400
+++ src/mzscheme/configure.ac
@@ -281,7 +281,7 @@ CGCOPTIONS=
 GC2OPTIONS=
 DYN_CFLAGS=

-LIBS=
+LIBS= -lffi

 WXVARIANT="wx_xt"

@@ -1312,8 +1312,6 @@ FOREIGNTARGET=
 FOREIGN_OBJSLIB_IF_USED=
 FOREIGN_LIB_IF_USED=
 if test -d "${srcdir}/foreign" && test "${enable_foreign}" = "yes" ; then
-  AC_CONFIG_AUX_DIR( foreign/gcc )
-  AC_CONFIG_SUBDIRS( foreign/gcc/libffi )
   makefiles="$makefiles foreign/Makefile"
   FOREIGNTARGET="foreign-stuff"
   FOREIGN_OBJSLIB_IF_USED="\$(FOREIGN_OBJSLIB)"

--
Alexey Lebedev


Home | Main Index | Thread Index | Old Index