Ticket #12314: ruby_universal_without_autoconf_dependency.diff

File ruby_universal_without_autoconf_dependency.diff, 9.9 KB (added by eloy.de.enige@…, 17 years ago)
  • lang/ruby/files/patch-configure.in

     
    1 --- configure.in.orig   2006-08-07 19:37:43.000000000 -0700
    2 +++ configure.in        2006-09-20 16:57:30.000000000 -0700
    3 @@ -1533,9 +1533,28 @@
    4  AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
    5  AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}")
    6  
    7 +AC_ARG_WITH(vendordir,
    8 +           [  --with-vendordir=DIR      vendor libraries in DIR [PREFIX/lib/ruby/vendor_ruby]],
    9 +            [vendordir=$withval],
    10 +            [vendordir='${prefix}/lib/ruby/vendor_ruby'])
    11 +VENDOR_DIR="`eval \"echo ${vendordir}\"`"
    12 +case "$target_os" in
    13 +  cygwin*|mingw*|*djgpp*|os2_emx*)
    14 +    RUBY_VENDOR_LIB_PATH="`expr "$VENDOR_DIR" : "$prefix\(/.*\)"`" ||
    15 +    RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
    16 +  *)
    17 +    RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
    18 +esac
    19 +RUBY_VENDOR_LIB_PATH2="${RUBY_VENDOR_LIB_PATH}/${MAJOR}.${MINOR}"
    20 +
    21 +AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, "${RUBY_VENDOR_LIB_PATH}")
    22 +AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB2, "${RUBY_VENDOR_LIB_PATH2}")
    23 +
    24  AC_SUBST(arch)dnl
    25  AC_SUBST(sitearch)dnl
    26 +AC_SUBST(vendorarch)dnl
    27  AC_SUBST(sitedir)dnl
    28 +AC_SUBST(vendordir)dnl
    29  
    30  configure_args=$ac_configure_args
    31  AC_SUBST(configure_args)dnl
    32 @@ -1548,6 +1567,8 @@
    33  
    34      AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
    35                   "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
    36 +    AC_DEFINE_UNQUOTED(RUBY_VENDOR_THIN_ARCHLIB,
    37 +                 "${RUBY_VENDOR_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
    38      AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
    39  else
    40      arch="${target_cpu}-${target_os}"
    41 @@ -1555,12 +1576,15 @@
    42  fi
    43  
    44  case "$target_os" in
    45 -  mingw*) sitearch="i386-$rb_cv_msvcrt" ;;
    46 -  *) sitearch="${arch}" ;;
    47 +  mingw*) sitearch="i386-$rb_cv_msvcrt"
    48 +                 vendorarch="i386-$rb_cv_msvcrt" ;;
    49 +  *) sitearch="${arch}"
    50 +     vendorarch="${arch}" ;;
    51  esac
    52  
    53  AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH}/${arch}")
    54  AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}")
    55 +AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, "${RUBY_VENDOR_LIB_PATH2}/${vendorarch}")
    56  
    57  AC_ARG_WITH(search-path,
    58                 [  --with-search-path=DIR specify the additional search path],
  • lang/ruby/files/patch-universal

     
     1--- configure.orig      2007-07-19 16:03:30.000000000 +0200
     2+++ configure   2007-07-19 16:03:46.000000000 +0200
     3@@ -16709,7 +16709,7 @@
     4        ;;
     5     darwin*)
     6        LIBRUBY_SO='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib'
     7-       LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace'
     8+       LIBRUBY_LDSHARED='cc $(CFLAGS) -dynamiclib -undefined suppress -flat_namespace'
     9        LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
     10        LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib'
     11        ;;
     12@@ -16987,7 +16987,8 @@
     13 _ACEOF
     14 
     15 else
     16-    arch="${target_cpu}-${target_os}"
     17+    darwin_version=`sysctl -n kern.sysv.shmseg`
     18+    arch="universal-darwin${darwin_version}.0"
     19     cat >>confdefs.h <<_ACEOF
     20 #define RUBY_PLATFORM "${arch}"
     21 _ACEOF
     22
     23--- lib/mkmf.rb.orig    2007-07-13 11:10:23.000000000 +0200
     24+++ lib/mkmf.rb 2007-07-13 11:10:47.000000000 +0200
     25@@ -286,7 +286,7 @@
     26 
     27 def cpp_command(outfile, opt="")
     28   Config::expand("$(CPP) #$INCFLAGS #$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}",
     29-                CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote))
     30+                CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote)).gsub(/-arch \w+/, '')
     31 end
     32 
     33 def libpathflag(libpath=$DEFLIBPATH|$LIBPATH)
     34--- defines.h.orig      2007-07-17 09:29:34.000000000 +0200
     35+++ defines.h   2007-07-17 09:31:42.000000000 +0200
     36@@ -102,6 +102,16 @@
     37 #endif
     38 #endif
     39
     40+#if defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)
     41+/* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may
     42+   result in a different endian.  Instead trust __BIG_ENDIAN__ and
     43+   __LITTLE_ENDIAN__ which are set correctly by -arch. */
     44+#undef WORDS_BIGENDIAN
     45+#ifdef __BIG_ENDIAN__
     46+#define WORDS_BIGENDIAN
     47+#endif
     48+#endif
     49+
     50 #ifdef __NeXT__
     51 /* NextStep, OpenStep, Rhapsody */
     52 #ifndef S_IRUSR
     53@@ -155,13 +165,6 @@
     54 #ifndef S_ISREG
     55 #define S_ISREG(mode)  (((mode) & (0170000)) == (0100000))
     56 #endif
     57-/* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may
     58-   result in a different endian.  Instead trust __BIG_ENDIAN__ and
     59-   __LITTLE_ENDIAN__ which are set correctly by -arch. */
     60-#undef WORDS_BIGENDIAN
     61-#ifdef __BIG_ENDIAN__
     62-#define WORDS_BIGENDIAN
     63-#endif
     64 #ifndef __APPLE__
     65 /* NextStep, OpenStep (but not Rhapsody) */
     66 #ifndef GETPGRP_VOID
  • lang/ruby/files/patch-configure

     
     1--- configure.orig      2007-07-19 15:54:10.000000000 +0200
     2+++ configure   2007-07-19 15:55:01.000000000 +0200
     3@@ -746,7 +746,9 @@
     4 MAKEFILES
     5 arch
     6 sitearch
     7+vendorarch
     8 sitedir
     9+vendordir
     10 configure_args
     11 NROFF
     12 MANTYPE
     13@@ -1370,6 +1372,7 @@
     14   --with-dln-a-out        use dln_a_out if possible
     15   --with-static-linked-ext link external modules statically
     16   --with-sitedir=DIR      site libraries in DIR PREFIX/lib/ruby/site_ruby
     17+  --with-vendordir=DIR      vendor libraries in DIR PREFIX/lib/ruby/vendor_ruby
     18   --with-search-path=DIR specify the additional search path
     19   --with-mantype=TYPE specify man page type; TYPE is one of man and doc
     20 
     21@@ -12983,13 +12986,11 @@
     22 cat confdefs.h >>conftest.$ac_ext
     23 cat >>conftest.$ac_ext <<_ACEOF
     24 /* end confdefs.h.  */
     25-#include <sys/types.h> /* for off_t */
     26-     #include <stdio.h>
     27+#include <stdio.h>
     28 int
     29 main ()
     30 {
     31-int (*fp) (FILE *, off_t, int) = fseeko;
     32-     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
     33+return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
     34   ;
     35   return 0;
     36 }
     37@@ -13029,13 +13030,11 @@
     38 cat >>conftest.$ac_ext <<_ACEOF
     39 /* end confdefs.h.  */
     40 #define _LARGEFILE_SOURCE 1
     41-#include <sys/types.h> /* for off_t */
     42-     #include <stdio.h>
     43+#include <stdio.h>
     44 int
     45 main ()
     46 {
     47-int (*fp) (FILE *, off_t, int) = fseeko;
     48-     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
     49+return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
     50   ;
     51   return 0;
     52 }
     53@@ -16938,6 +16937,33 @@
     54 
     55 
     56 
     57+# Check whether --with-vendordir was given.
     58+if test "${with_vendordir+set}" = set; then
     59+  withval=$with_vendordir; vendordir=$withval
     60+else
     61+  vendordir='${prefix}/lib/ruby/vendor_ruby'
     62+fi
     63+
     64+VENDOR_DIR="`eval \"echo ${vendordir}\"`"
     65+case "$target_os" in
     66+  cygwin*|mingw*|*djgpp*|os2_emx*)
     67+    RUBY_VENDOR_LIB_PATH="`expr "$VENDOR_DIR" : "$prefix\(/.*\)"`" ||
     68+    RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
     69+  *)
     70+    RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
     71+esac
     72+RUBY_VENDOR_LIB_PATH2="${RUBY_VENDOR_LIB_PATH}/${MAJOR}.${MINOR}"
     73+
     74+cat >>confdefs.h <<_ACEOF
     75+#define RUBY_VENDOR_LIB "${RUBY_VENDOR_LIB_PATH}"
     76+_ACEOF
     77+
     78+cat >>confdefs.h <<_ACEOF
     79+#define RUBY_VENDOR_LIB2 "${RUBY_VENDOR_LIB_PATH2}"
     80+_ACEOF
     81+
     82+
     83+
     84 configure_args=$ac_configure_args
     85 
     86 if test "$fat_binary" != no ; then
     87@@ -16953,6 +16979,10 @@
     88 _ACEOF
     89 
     90     cat >>confdefs.h <<_ACEOF
     91+#define RUBY_VENDOR_THIN_ARCHLIB "${RUBY_VENDOR_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}"
     92+_ACEOF
     93+
     94+    cat >>confdefs.h <<_ACEOF
     95 #define RUBY_PLATFORM __ARCHITECTURE__ "-${target_os}"
     96 _ACEOF
     97 
     98@@ -16965,8 +16995,10 @@
     99 fi
     100 
     101 case "$target_os" in
     102-  mingw*) sitearch="i386-$rb_cv_msvcrt" ;;
     103-  *) sitearch="${arch}" ;;
     104+  mingw*) sitearch="i386-$rb_cv_msvcrt"
     105+                 vendorarch="i386-$rb_cv_msvcrt" ;;
     106+  *) sitearch="${arch}"
     107+     vendorarch="${arch}" ;;
     108 esac
     109 
     110 cat >>confdefs.h <<_ACEOF
     111@@ -16977,6 +17009,10 @@
     112 #define RUBY_SITE_ARCHLIB "${RUBY_SITE_LIB_PATH2}/${sitearch}"
     113 _ACEOF
     114 
     115+cat >>confdefs.h <<_ACEOF
     116+#define RUBY_VENDOR_ARCHLIB "${RUBY_VENDOR_LIB_PATH2}/${vendorarch}"
     117+_ACEOF
     118+
     119 
     120 
     121 # Check whether --with-search-path was given.
     122@@ -17886,14 +17922,16 @@
     123 MAKEFILES!$MAKEFILES$ac_delim
     124 arch!$arch$ac_delim
     125 sitearch!$sitearch$ac_delim
     126+vendorarch!$vendorarch$ac_delim
     127 sitedir!$sitedir$ac_delim
     128+vendordir!$vendordir$ac_delim
     129 configure_args!$configure_args$ac_delim
     130 NROFF!$NROFF$ac_delim
     131 MANTYPE!$MANTYPE$ac_delim
     132 LTLIBOBJS!$LTLIBOBJS$ac_delim
     133 _ACEOF
     134 
     135-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 42; then
     136+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 44; then
     137     break
     138   elif $ac_last_try; then
     139     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
  • lang/ruby/Portfile

     
    3030                                port:ncurses
    3131                               
    3232patchfiles              patch-Makefile.in \
    33                                 patch-configure.in \
     33                                patch-configure \
    3434                                patch-instruby.rb \
    3535                                patch-mkconfig.rb \
    3636                                patch-mkmf.rb \
    3737                                patch-ruby.c
    3838
    39 use_autoconf    yes
    40 
    4139configure.args  --enable-shared \
    4240                                --mandir="${prefix}/share/man" \
    4341                                --enable-pthread \
     
    8280
    8381default_variants        +thread_hooks
    8482
     83# universal support
     84pre-patch {
     85        if {[variant_isset universal]} {
     86                patchfiles-append       patch-universal
     87        }
     88}
     89# some checks in mkmf.rb choke on the sysroot flag, which causes the openssl extension to not build
     90configure.universal_cflags -arch i386 -arch ppc
     91configure.universal_cxxflags -arch i386 -arch ppc
     92
    8593livecheck.check regex
    8694livecheck.url   http://www.ruby-lang.org/en/downloads/
    8795livecheck.regex {>Ruby (.*?)</a> \(md5:}