Subject: Re: ruby18: db4 is not an acceptable, can't read y.tab.c
To: None <tech-pkg@netbsd.org>
From: Takahiro Kambe <taca@back-street.net>
List: tech-pkg
Date: 12/18/2005 18:00:03
----Next_Part(Sun_Dec_18_18_00_03_2005_300)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

In message <20051212161259.GA5685@britannica.bec.de>
	on Mon, 12 Dec 2005 17:12:59 +0100,
	joerg@britannica.bec.de wrote:
> What about patching the Makefile to correctly use TOOLS_ARGS.yacc
> instead?
I've never see TOOLS_ARGS.* except files under /usr/pkgsrc/mk.
Is there any guideline or documentation for using them?

Anyway, these patch files and update patch-aa and patch-ab solve the
problem.

-- 
Takahiro Kambe <taca@back-street.net>


----Next_Part(Sun_Dec_18_18_00_03_2005_300)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename=updates

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/ruby18-base/Makefile,v
retrieving revision 1.14
diff -u -u -r1.14 Makefile
--- Makefile	8 Dec 2005 09:52:15 -0000	1.14
+++ Makefile	18 Dec 2005 08:51:46 -0000
@@ -46,6 +46,13 @@
 FILES_SUBST+=	DATE=${DATE:Q}
 
 #
+# Use Berkley DB unless a system has real ndbm(3).
+#
+.if !exists(/usr/include/ndbm.h)
+.include "../../mk/bdb.buildlink3.mk"
+.endif
+
+#
 # IRIX work around should be fixed.
 #
 .if ${OPSYS} == "IRIX"
@@ -130,15 +137,6 @@
 	${INSTALL_DATA} ${WRKSRC}/ext/pty/${f} ${RUBY_EXAMPLESDIR}/pty
 .endfor
 
-#
-# XXX:	Ruby extconf shuld select native ndbm(3) or Berkley DB's
-#	ndbm(3) compatible support.
-#
-.if ${OPSYS} != "IRIX" && ${OPSYS} != "SunOS"
-BDB_ACCEPTED?=		db1
-.include "../../mk/bdb.buildlink3.mk"
-.endif
-
 .include "../../lang/ruby/Makefile.common"
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../security/openssl/buildlink3.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/lang/ruby18-base/distinfo,v
retrieving revision 1.8
diff -u -u -r1.8 distinfo
--- distinfo	8 Nov 2005 15:52:38 -0000	1.8
+++ distinfo	18 Dec 2005 08:51:46 -0000
@@ -3,8 +3,8 @@
 SHA1 (ruby/ruby-1.8.3.tar.gz) = 407e70377214fcb812cdbb86a3e1b735e69b7cff
 RMD160 (ruby/ruby-1.8.3.tar.gz) = b4244a288d04fca29556144636b5e093b78a8cd5
 Size (ruby/ruby-1.8.3.tar.gz) = 4227276 bytes
-SHA1 (patch-aa) = fcd7a15ed5d89e534b6de3e1ecee38bb5bc89cfb
-SHA1 (patch-ab) = 0abdff0ce4e7a926ed5422b668f7a3574152bc69
+SHA1 (patch-aa) = e008cc3603609211b51789da41776b170e56e781
+SHA1 (patch-ab) = 7649fa863d362284ab6b6f817a96a72d9d85c555
 SHA1 (patch-ac) = a9c11048b1c7d712d08a6540014eeda3569ece3f
 SHA1 (patch-ad) = acbe8fc8491c2341a951b395359009aca1afeb2f
 SHA1 (patch-ae) = dfa9c5296c75f6193c790fca8d3eb15ad4a9f228

----Next_Part(Sun_Dec_18_18_00_03_2005_300)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename=patch-aa

$NetBSD: patch-aa,v 1.3 2005/11/02 08:56:40 taca Exp $

--- configure.in.orig	2005-09-07 08:22:56.000000000 +0900
+++ configure.in
@@ -168,6 +168,11 @@ if test -z "$AR"; then
   AC_CHECK_PROGS(AR, aal, ar)
 fi
 
+# work around for bison
+case "$YACC" in
+*/bison)        YACC="$YACC -y";;
+esac
+
 case "$target_os" in
 cygwin*|mingw*)
     AC_CHECK_TOOL(NM, nm)
@@ -348,6 +353,9 @@ msdosdjgpp*)	LIBS="-lm $LIBS"
 		ac_cv_func_getpgrp_void=yes
 		ac_cv_func_setitimer=no
 		;;
+interix3*)	LIBS="-lm $LIBS"
+		ac_cv_func_getpgrp_void=yes
+		;;
 freebsd*)	LIBS="-lm $LIBS"
 		AC_CACHE_CHECK([whether -lxpg4 has to be linked],
 		  rb_cv_lib_xpg4_needed,
@@ -890,6 +898,13 @@ if test "$with_dln_a_out" != yes; then
 			    LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
 			fi
 			rb_cv_dlopen=yes ;;
+	interix3*)	: ${LDSHARED='${CC} -shared'}
+			LDFLAGS="$LDFLAGS -Wl,-E"
+			# use special random-slot linkage in 0x[56]XXXXXXX
+			DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(.TARGET) -Wl,--image-base,$$(($$RANDOM %4096/2*262144+1342177280))'
+			LIBPATHFLAG=' -L%1$-s'
+			RPATHFLAG=' -Wl,-R%1$-s'
+			rb_cv_dlopen=yes ;;
 	interix*) 	: ${LDSHARED="$CC -shared"}
 			XLDFLAGS="$XLDFLAGS -Wl,-E"
 			LIBPATHFLAG=" -L'%1\$-s'"
@@ -970,7 +985,11 @@ if test "$with_dln_a_out" != yes; then
        [enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
   if test "$enable_rpath" = yes; then
     LIBPATHFLAG=" -L'%1\$-s'"
-    RPATHFLAG=" -Wl,-R'%1\$-s'"
+    if test "$GCC" = yes; then
+       RPATHFLAG=" -Wl,-R'%1\$-s'"
+    else
+       RPATHFLAG=" -R'%1\$-s'"
+    fi
   fi
 fi
 AC_SUBST(LINK_SO)
@@ -1251,6 +1270,14 @@ if test "$enable_shared" = 'yes'; then
 	LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
 	LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib'
 	;;
+    interix3*)
+	SOLIBS='$(LIBS)'
+	LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
+	# link explicitly to 0x48000000
+	LIBRUBY_DLDFLAGS='-Wl,-h,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) -Wl,--image-base,1207959552'
+	LIBRUBYARG_SHARED='-Wl,-R -Wl,${libdir} -L${libdir} -L. -l$(RUBY_SO_NAME)'
+	LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so'
+ 	;;
     interix*)
 	LIBRUBYARG_SHARED='-L${libdir} -L. -l$(RUBY_SO_NAME)'
 	;;

----Next_Part(Sun_Dec_18_18_00_03_2005_300)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename=patch-ab

$NetBSD: patch-ab,v 1.3 2005/11/02 08:56:40 taca Exp $

--- configure.orig	2005-09-21 09:10:31.000000000 +0900
+++ configure
@@ -3246,6 +3246,11 @@ test -n "$AR" || AR="ar"
 
 fi
 
+# work around for bison
+case "$YACC" in
+*/bison)        YACC="$YACC -y";;
+esac
+
 case "$target_os" in
 cygwin*|mingw*)
     if test -n "$ac_tool_prefix"; then
@@ -9295,6 +9300,9 @@ msdosdjgpp*)	LIBS="-lm $LIBS"
 		ac_cv_func_getpgrp_void=yes
 		ac_cv_func_setitimer=no
 		;;
+interix3*)	LIBS="-lm $LIBS"
+		ac_cv_func_getpgrp_void=yes
+		;;
 freebsd*)	LIBS="-lm $LIBS"
 		echo "$as_me:$LINENO: checking whether -lxpg4 has to be linked" >&5
 echo $ECHO_N "checking whether -lxpg4 has to be linked... $ECHO_C" >&6
@@ -14305,6 +14313,13 @@ echo $ECHO_N "checking whether OS depend
 			    LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
 			fi
 			rb_cv_dlopen=yes ;;
+	interix3*)	: ${LDSHARED='${CC} -shared'}
+			LDFLAGS="$LDFLAGS -Wl,-E"
+			# use special random-slot linkage in 0x[56]XXXXXXX
+			DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(.TARGET) -Wl,--image-base,$$(($$RANDOM %4096/2*262144+1342177280))'
+			LIBPATHFLAG=' -L%1$-s'
+			RPATHFLAG=' -Wl,-R%1$-s'
+			rb_cv_dlopen=yes ;;
 	interix*) 	: ${LDSHARED="$CC -shared"}
 			XLDFLAGS="$XLDFLAGS -Wl,-E"
 			LIBPATHFLAG=" -L'%1\$-s'"
@@ -14390,7 +14405,11 @@ else
 fi;
   if test "$enable_rpath" = yes; then
     LIBPATHFLAG=" -L'%1\$-s'"
-    RPATHFLAG=" -Wl,-R'%1\$-s'"
+    if test "$GCC" = yes; then
+       RPATHFLAG=" -Wl,-R'%1\$-s'"
+    else
+       RPATHFLAG=" -R'%1\$-s'"
+    fi
   fi
 fi
 
@@ -15088,6 +15107,14 @@ if test "$enable_shared" = 'yes'; then
 	LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
 	LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib'
 	;;
+    interix3*)
+	SOLIBS='$(LIBS)'
+	LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
+	# link explicitly to 0x48000000
+	LIBRUBY_DLDFLAGS='-Wl,-h,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) -Wl,--image-base,1207959552'
+	LIBRUBYARG_SHARED='-Wl,-R -Wl,${libdir} -L${libdir} -L. -l$(RUBY_SO_NAME)'
+	LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so'
+ 	;;
     interix*)
 	LIBRUBYARG_SHARED='-L${libdir} -L. -l$(RUBY_SO_NAME)'
 	;;

----Next_Part(Sun_Dec_18_18_00_03_2005_300)----