Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Interix support #7760

Closed
p5pRT opened this issue Jan 21, 2005 · 8 comments
Closed

Add Interix support #7760

p5pRT opened this issue Jan 21, 2005 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 21, 2005

Migrated from rt.perl.org#33892 (status was 'resolved')

Searchable as RT33892$

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2005

From @tvierling

Created by @tvierling

The following diff implements support for Interix (Windows Services for UNIX)
3.5, and likely 3.0 and 3.1. Shared module and libperl support is enabled.
There are probably a couple things you may find odd about this, in spite of
the diff's small size, so please feel free to ask me any questions.

Diff is against 5.8.6. Note that platform tracking info at the bottom of
this ticket reflects my mail-capable system, not Interix. 8-)

Inline Patch
--- hints/interix.sh.orig	2005-01-21 09:27:04.000000000 -0500
+++ hints/interix.sh	2005-01-21 09:27:04.000000000 -0500
@@ -0,0 +1,26 @@
+# hints/interix.sh
+#
+# Please check with tech-pkg@netbsd.org before making modifications
+# to this file.
+
+cc='gcc'
+cccdlflags="-DPIC $cccdlflags"
+ccdlflags='-Wl,-E'
+ccflags="-D_ALL_SOURCE $ccflags"
+d_poll="$undef"
+ld='gcc'
+lddlflags="-shared $lddlflags"
+rpathflag='-Wl,-R'
+sharpbang='#!'
+usenm='false'
+
+# This script UU/usethreads.cbu will get 'called-back' by Configure 
+# after it has prompted the user for whether to use threads. 
+cat > UU/usethreads.cbu <<'EOCBU' 
+case "$usethreads" in
+$define|true|[yY]*)
+	ccflags="-D_REENTRANT $ccflags"
+	libswanted="$libswanted pthread"
+        ;; 
+esac 
+EOCBU
--- lib/ExtUtils/MM_Unix.pm.orig	2005-01-21 09:24:09.000000000 -0500
+++ lib/ExtUtils/MM_Unix.pm	2005-01-21 09:25:56.000000000 -0500
@@ -12,7 +12,7 @@
 
 use vars qw($VERSION @ISA
             $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Win95  $Is_Dos $Is_VOS
-            $Is_QNX $Is_AIX $Is_OSF $Is_IRIX  $Is_NetBSD $Is_BSD
+            $Is_QNX $Is_AIX $Is_OSF $Is_IRIX  $Is_NetBSD $Is_BSD $Is_Interix
             $Is_SunOS4 $Is_Solaris $Is_SunOS
             $Verbose %pm %static
             %Config_Override
@@ -37,10 +37,11 @@
 $Is_OSF     = $^O eq 'dec_osf';
 $Is_IRIX    = $^O eq 'irix';
 $Is_NetBSD  = $^O eq 'netbsd';
+$Is_Interix = $^O eq 'interix';
 $Is_SunOS4  = $^O eq 'sunos';
 $Is_Solaris = $^O eq 'solaris';
 $Is_SunOS   = $Is_SunOS4 || $Is_Solaris;
-$Is_BSD     = $^O =~ /^(?:free|net|open)bsd|bsdos$/;
+$Is_BSD     = $^O =~ /^(?:free|net|open)bsd|bsdos|interix$/;
 
 
 =head1 NAME
@@ -1120,7 +1121,7 @@
 
     my $libs = '$(LDLOADLIBS)';
 
-    if ($Is_NetBSD) {
+    if ($Is_NetBSD || $Is_Interix) {
 	# Use nothing on static perl platforms, and to the flags needed
 	# to link against the shared libperl library on shared perl
 	# platforms.  We peek at lddlflags to see if we need -Wl,-R
--- lib/File/Find.pm.orig	2005-01-21 09:27:20.000000000 -0500
+++ lib/File/Find.pm	2005-01-21 09:27:40.000000000 -0500
@@ -1221,7 +1221,7 @@
 
 $File::Find::dont_use_nlink = 1
     if $^O eq 'os2' || $^O eq 'dos' || $^O eq 'amigaos' || $^O eq 'MSWin32' ||
-       $^O eq 'cygwin' || $^O eq 'epoc' || $^O eq 'qnx' ||
+       $^O eq 'interix' || $^O eq 'cygwin' || $^O eq 'epoc' || $^O eq 'qnx' ||
 	   $^O eq 'nto';
 
 # Set dont_use_nlink in your hint file if your system's stat doesn't
--- lib/File/Temp.pm.orig	2005-01-21 09:28:12.000000000 -0500
+++ lib/File/Temp.pm	2005-01-21 09:28:57.000000000 -0500
@@ -2012,6 +2012,7 @@
 
 {
   my $TopSystemUID = 10;
+  $TopSystemUID = 197108 if $^O eq 'interix'; # "Administrator"
   sub top_system_uid {
     my $self = shift;
     if (@_) {
--- t/io/openpid.t.orig	2005-01-21 09:29:19.000000000 -0500
+++ t/io/openpid.t	2005-01-21 09:29:28.000000000 -0500
@@ -23,6 +23,7 @@
 use Config;
 $| = 1;
 $SIG{PIPE} = 'IGNORE';
+$SIG{HUP} = 'IGNORE' if $^O eq 'interix';
 
 my $perl = which_perl();
 $perl .= qq[ "-I../lib"];
--- t/op/groups.t.orig	2005-01-21 09:29:44.000000000 -0500
+++ t/op/groups.t	2005-01-21 09:29:53.000000000 -0500
@@ -133,7 +133,7 @@
 
 print "# gr = @gr\n";
 
-if ($^O =~ /^(?:uwin|cygwin|solaris)$/) {
+if ($^O =~ /^(?:uwin|cygwin|interix|solaris)$/) {
 	# Or anybody else who can have spaces in group names.
 	$gr1 = join(' ', grep(!$did{$_}++, sort split(' ', join(' ', @gr))));
 } else {
--- Configure.orig	2005-01-21 09:22:04.000000000 -0500
+++ Configure	2005-01-21 09:22:17.000000000 -0500
@@ -7852,7 +7852,7 @@
 	solaris)
 		xxx="-R $shrpdir"
 		;;
-	freebsd|netbsd|openbsd)
+	freebsd|netbsd|openbsd|interix)
 		xxx="-Wl,-R$shrpdir"
 		;;
 	bsdos|linux|irix*|dec_osf)
--- Makefile.SH.orig	2005-01-21 09:26:16.000000000 -0500
+++ Makefile.SH	2005-01-21 09:26:48.000000000 -0500
@@ -72,6 +72,10 @@
 	netbsd*|freebsd[234]*|openbsd*)
 		linklibperl="-L. -lperl"
 		;;
+	interix*)
+		linklibperl="-L. -lperl"
+		shrpldflags="$shrpldflags -Wl,--image-base,0x57000000"
+		;;
 	aix*)
 		shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
 		case "$osvers" in
Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl v5.8.6:

Configured by tv at Wed Jan  5 15:45:11 EST 2005.

Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
  Platform:
    osname=netbsd, osvers=2.0, archname=i386-netbsd-thread-multi
    uname='netbsd server.duh.org 2.0 netbsd 2.0 (server) #4: fri dec 17 12:07:29 est 2004 tv@server.duh.org:exportsrcduhnetbsd-kernelsserver i386 '
    config_args='-sde -Dprefix=/usr/pkg -Dscriptdir=/usr/pkg/bin -Darchname=i386-netbsd -Dcc=cc -Doptimize=-O2  -pthread  -I/usr/include -Dinstallstyle=lib/perl5 -Duseshrplib -Ui_malloc -Uusemymalloc -Uinstallusrbinperl -Dman3ext=3 -Dman3dir=/usr/pkg/lib/perl5/5.8.6/man/man3 -Dsiteman3dir=/usr/pkg/lib/perl5/site_perl/man/man3 -Dman1dir=/usr/pkg/man/man1 -Dsiteprefix=/usr/pkg -Dsiteman1dir=/usr/pkg/man/man1 -Duseithreads -Dlibswanted=m crypt '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/pkg/include',
    optimize='-O2 -pthread -I/usr/include',
    cppflags='-fno-strict-aliasing -pipe -I/usr/pkg/include'
    ccversion='', gccversion='3.3.3 (NetBSD nb3 20040520)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -Wl,-R/usr/pkg/lib  -pthread  -L/usr/pkg/lib'
    libpth=/usr/pkg/lib /usr/lib
    libs=-lm -lcrypt -lpthread
    perllibs=-lm -lcrypt -lpthread
    libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E  -Wl,-R/usr/pkg/lib/perl5/5.8.6/i386-netbsd-thread-multi/CORE'
    cccdlflags='-DPIC -fPIC ', lddlflags=' -Wl,-R/usr/pkg/lib  -pthread --whole-archive -shared  -L/usr/pkg/lib'

Locally applied patches:
    


@INC for perl v5.8.6:
    /usr/pkg/lib/perl5/site_perl/5.8.6/i386-netbsd-thread-multi
    /usr/pkg/lib/perl5/site_perl/5.8.6
    /usr/pkg/lib/perl5/site_perl/5.8.5/i386-netbsd-thread-multi
    /usr/pkg/lib/perl5/site_perl/5.8.5
    /usr/pkg/lib/perl5/site_perl
    /usr/pkg/lib/perl5/5.8.6/i386-netbsd-thread-multi
    /usr/pkg/lib/perl5/5.8.6
    .


Environment for perl v5.8.6:
    HOME=/home/tv
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/tv/.bin:/usr/local/sbin:/usr/local/bin:/usr/pkg/sbin:/usr/pkg/bin:/usr/X11R6/bin:/usr/sbin:/usr/bin:/sbin:/bin
    PERL_BADLANG (unset)
    SHELL=/bin/ksh

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2005

From @Tux

On 21 Jan 2005 14​:36​:31 -0000, Todd Vierling (via RT)
<perlbug-followup@​perl.org> wrote​:

--- Configure.orig 2005-01-21 09​:22​:04.000000000 -0500
+++ Configure 2005-01-21 09​:22​:17.000000000 -0500
@​@​ -7852,7 +7852,7 @​@​
solaris)
xxx="-R $shrpdir"
;;
- freebsd|netbsd|openbsd)
+ freebsd|netbsd|openbsd|interix)
xxx="-Wl,-R$shrpdir"
;;
bsdos|linux|irix*|dec_osf)

This part separately committed with change #23848 on Pumpkin's request

--
H.Merijn Brand Amsterdam Perl Mongers (http​://amsterdam.pm.org/)
using Perl 5.6.2, 5.8.0, 5.8.3, & 5.9.2 on HP-UX 10.20, 11.00 & 11.11,
  AIX 4.3, SuSE 9.0 pro 2.4.21 & Win2k. http​://www.cmve.net/~merijn
Smoking perl​: smokers@​perl.org, perl QA​: http​://qa.perl.org
  reports to​: smokers-reports@​perl.org, perl-qa@​perl.org

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2005

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2005

From @rgs

Todd Vierling (via RT) wrote​:

The following diff implements support for Interix (Windows Services for UNIX)
3.5, and likely 3.0 and 3.1. Shared module and libperl support is enabled.
There are probably a couple things you may find odd about this, in spite of
the diff's small size, so please feel free to ask me any questions.

Diff is against 5.8.6. Note that platform tracking info at the bottom of
this ticket reflects my mail-capable system, not Interix. 8-)

Thanks, I've applied your patch to the development version of perl as
change #23849.

Could you test whether the development version (currently self-known as
5.9.2) compiles and runs correctly on your platform ? Usually porting
efforts are focused on the developement version (bleadperl) before being
backported on the 5.8 maintainance branch. (the instructions to get
bleadperl are documented in perlhack.pod)

I've also bumped the version numbers of File​::Temp and ExtUtils​::MM_Unix
since these modules also exist on CPAN.

--
He proves by algebra that Hamlet's grandson is Shakespeare's grandfather
and that he himself is the ghost of his own father.
  -- Ulysses

@p5pRT p5pRT closed this as completed Jan 21, 2005
@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2005

@rgs - Status changed from 'open' to 'resolved'

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2005

From @tvierling

On Fri, 21 Jan 2005, Rafael Garcia-Suarez via RT wrote​:

Thanks, I've applied your patch to the development version of perl as
change #23849.

Could you test whether the development version (currently self-known as
5.9.2) compiles and runs correctly on your platform ?

Wow, that was fast. I'll do that and respond again to this ticket within
the week.

--
-- Todd Vierling <tv@​duh.org> <tv@​pobox.com>

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2005

From @tvierling

On Fri, 21 Jan 2005, Rafael Garcia-Suarez via RT wrote​:

Thanks, I've applied your patch to the development version of perl as
change #23849.

Could you test whether the development version (currently self-known as
5.9.2) compiles and runs correctly on your platform ?

With one additional change (see below), I've verified that "make test" on
current sources using default options, with or without shared libperl,
mostly works, with one failure in ext/IO/t/io_sock​:

ext/IO/t/io_sock..........................FAILED at test 18

I'm trying to track that one down and understand it, but this failure
doesn't appear in an Interix-buildable 5.8.6.

Inline Patch
--- hints/interix.sh.orig	Fri Jan 21 14:34:38 2005
+++ hints/interix.sh	Fri Jan 21 14:34:55 2005
@@ -12,6 +12,7 @@
 lddlflags="-shared $lddlflags"
 rpathflag='-Wl,-R'
 sharpbang='#!'
+usemymalloc='false'
 usenm='false'

 # This script UU/usethreads.cbu will get 'called-back' by Configure

-- 

-- Todd Vierling <tv@​duh.org> <tv@​pobox.com>

@p5pRT
Copy link
Author

p5pRT commented Jan 24, 2005

From @rgs

Todd Vierling wrote​:

On Fri, 21 Jan 2005, Rafael Garcia-Suarez via RT wrote​:

Could you test whether the development version (currently self-known as
5.9.2) compiles and runs correctly on your platform ?

With one additional change (see below), I've verified that "make test" on
current sources using default options, with or without shared libperl,
mostly works, with one failure in ext/IO/t/io_sock​:

ext/IO/t/io_sock..........................FAILED at test 18

I'm trying to track that one down and understand it, but this failure
doesn't appear in an Interix-buildable 5.8.6.

--- hints/interix.sh.orig Fri Jan 21 14​:34​:38 2005
+++ hints/interix.sh Fri Jan 21 14​:34​:55 2005
@​@​ -12,6 +12,7 @​@​
lddlflags="-shared $lddlflags"
rpathflag='-Wl,-R'
sharpbang='#!'
+usemymalloc='false'

Thanks, applied as change #23870 to bleadperl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant