Changeset 3188


Ignore:
Timestamp:
Apr 22, 2007, 10:57:48 AM (18 years ago)
Author:
bird
Message:

Applied patch from Paul (aka Creeping).

Location:
trunk/essentials/dev-lang/perl
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/essentials/dev-lang/perl/MANIFEST

    r3187 r3188  
    22412241os2/OS2/REXX/t/rx_cmprt.t       DLL access module
    22422242os2/OS2/REXX/t/rx_dllld.t       DLL access module
    2243 os2/OS2/REXX/t/rx_emxrv.t       DLL access module
    22442243os2/OS2/REXX/t/rx_objcall.t     DLL access module
    22452244os2/OS2/REXX/t/rx_sql.test      DLL access module
  • trunk/essentials/dev-lang/perl/configpm

    r3187 r3188  
    475475    print CONFIG <<'ENDOFSET';
    476476my %preconfig;
    477 if ($OS2::is_aout) {
    478     my ($value, $v) = $Config_SH_expanded =~ m/^used_aout='(.*)'\s*$/m;
    479     for (split ' ', $value) {
    480         ($v) = $Config_SH_expanded =~ m/^aout_$_='(.*)'\s*$/m;
    481         $preconfig{$_} = $v eq 'undef' ? undef : $v;
    482     }
    483 }
    484 $preconfig{d_fork} = undef unless $OS2::can_fork; # Some funny cases can't
     477#if ($OS2::is_aout) {
     478#    my ($value, $v) = $Config_SH_expanded =~ m/^used_aout='(.*)'\s*$/m;
     479#    for (split ' ', $value) {
     480#        ($v) = $Config_SH_expanded =~ m/^aout_$_='(.*)'\s*$/m;
     481#        $preconfig{$_} = $v eq 'undef' ? undef : $v;
     482#    }
     483#}
     484#$preconfig{d_fork} = undef unless $OS2::can_fork; # Some funny cases can't
    485485sub TIEHASH { bless {%preconfig} }
    486486ENDOFSET
  • trunk/essentials/dev-lang/perl/ext/Devel/DProf/DProf.xs

    r3187 r3188  
    7676#    endif
    7777#  endif
    78 #  ifdef OS2                            /* times() has significant overhead */
     78#  if defined(OS2)&&!defined(__KLIBC__) /* times() has significant overhead */
    7979#    define Times(ptr) (dprof_times(aTHX_ ptr))
    8080#    define INCL_DOSPROFILE
     
    132132    U32         default_perldb;
    133133    UV          depth;
    134 #ifdef OS2
     134#  if defined(OS2)&&!defined(__KLIBC__)
    135135    ULONG       frequ;
    136136    long long   start_cnt;
     
    171171#  define g_THX                 g_prof_state.my_perl
    172172#endif
    173 #ifdef OS2
     173#  if defined(OS2)&&!defined(__KLIBC__)
    174174#  define g_frequ               g_prof_state.frequ
    175175#  define g_start_cnt           g_prof_state.start_cnt
     
    179179dprof_times(pTHX_ struct tms *t)
    180180{
    181 #ifdef OS2
     181#  if defined(OS2)&&!defined(__KLIBC__)
    182182    ULONG rc;
    183183    QWORD cnt;
  • trunk/essentials/dev-lang/perl/ext/DynaLoader/dl_dlopen.xs

    r3187 r3188  
    219219    void *sym;
    220220    CODE:
    221 #ifdef DLSYM_NEEDS_UNDERSCORE
     221#if defined(DLSYM_NEEDS_UNDERSCORE)||defined(__KLIBC__)
    222222    symbolname = Perl_form_nocontext("_%s", symbolname);
    223223#endif
  • trunk/essentials/dev-lang/perl/hints/os2.sh

    r3187 r3188  
    2727case "X$optimize" in
    2828  X)
    29         optimize="-O2 -fomit-frame-pointer -malign-loops=2 -malign-jumps=2 -malign-functions=2 -s"
     29        optimize="-O2 -fomit-frame-pointer -falign-loops=2 -falign-jumps=2 -falign-functions=2 -s"
    3030        ld_dll_optimize="-s"
    3131        ;;
     
    147147
    148148aout_d_fork='define'
    149 aout_ccflags="-DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I. $_defemxcrtrev -D__ST_MT_ERRNO__"
    150 aout_cppflags="-DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I. $_defemxcrtrev -D__ST_MT_ERRNO__"
     149aout_ccflags="-DDOSISH -DOS2=2 -DEMBED -I. $_defemxcrtrev "
     150aout_cppflags="-DDOSISH -DOS2=2 -DEMBED -I. $_defemxcrtrev "
    151151aout_use_clib='c'
    152152aout_usedl='undef'
     
    177177    d_shrplib='define'
    178178    useshrplib='true'
    179     obj_ext='.obj'
     179    obj_ext='.o'
    180180    lib_ext='.lib'
    181181    ar='emxomfar'
     
    186186        d_fork='undef'
    187187    fi
    188     lddlflags="-Zdll -Zomf -Zmt -Zcrtdll -Zlinker /e:2"
     188    lddlflags="-Zdll -Zomf "
    189189    # Recursive regmatch may eat 2.5M of stack alone.
    190     ldflags='-Zexe -Zomf -Zmt -Zcrtdll -Zstack 32000 -Zlinker /e:2'
     190    ldflags='-Zexe -Zomf -Zstack 32000 '
    191191    if [ $emxcrtrev -ge 50 ]; then
    192192        ccflags="-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I. $_defemxcrtrev"
     
    218218
    219219# Test would pick up wrong rand, so we hardwire the value for random()
    220 libs='-lsocket -lm -lbsd'
     220libs='-lsocket'
    221221randbits=31
    222222archobjs="os2$obj_ext dl_os2$obj_ext"
     
    278278d_usleep='define'
    279279d_usleepproto='define'
     280
     281d_link='undef'
     282dont_use_nlink='define'
     283# no posix (aka hard) links for us!
    280284
    281285# The next two are commented. pdksh handles #!, extproc gives no path part.
  • trunk/essentials/dev-lang/perl/lib/ExtUtils/Mksymlists.pm

    r3187 r3188  
    103103    print DEF "DATA LOADONCALL NONSHARED MULTIPLE\n";
    104104    print DEF "EXPORTS\n  ";
    105     print DEF join("\n  ",@{$data->{DL_VARS}}, "\n") if @{$data->{DL_VARS}};
    106     print DEF join("\n  ",@{$data->{FUNCLIST}}, "\n") if @{$data->{FUNCLIST}};
     105    my @syms;
     106    # Export public symbols both with and without underscores to
     107    # ensure compatibility between DLLs from different compilers
     108    # NOTE: DynaLoader itself only uses the names without underscores,
     109    # so this is only to cover the case when the extension DLL may be
     110    # linked to directly from C. GSAR 97-07-10
     111    if ($Config::Config{'cc'} =~ /^bcc/i) {
     112        for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}}) {
     113            push @syms, "_$_", "$_ = _$_";
     114        }
     115    }
     116    else {
     117        for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}}) {
     118            push @syms, "_$_";
     119        }
     120    }
     121    print DEF join("\n  ",@syms, "\n") if @syms;
     122#    print DEF join("\n  ",@{$data->{DL_VARS}}, "\n ") if @{$data->{DL_VARS}};
     123#    print DEF join("\n  ",@{$data->{FUNCLIST}}, "\n") if @{$data->{FUNCLIST}};
    107124    if (%{$data->{IMPORTS}}) {
    108125        print DEF "IMPORTS\n";
  • trunk/essentials/dev-lang/perl/mg.c

    r3187 r3188  
    631631             }
    632632#else
    633 #ifdef OS2
     633#if defined(OS2)&&!defined(__KLIBC__)
    634634             if (!(_emx_env & 0x200)) { /* Under DOS */
    635635                  sv_setnv(sv, (NV)errno);
  • trunk/essentials/dev-lang/perl/os2/Makefile.SHs

    r3187 r3188  
    4343SO_CCCMD        = \$(CC) $ccflags \$(OPTIMIZE)
    4444
    45 LD_OPT          = \$(OPTIMIZE)
    46 PERL_DLL_LD_OPT = -Zmap -Zlinker /map/li
     45LD_OPT          =
     46PERL_DLL_LD_OPT = -Zdll -Zmap -Zargs-wild
    4747
    4848PERL_DLL_BASE   = perl$dll_post
     
    7272
    7373libperl_dllmain.imp: imp_version
    74         echo    'main   $(PERL_DLL_BASE)        dll_perlmain    ?' >> $@
     74        echo    '_main  $(PERL_DLL_BASE)        _dll_perlmain   ?' >> $@
    7575
    7676libperl_dllmain.lib: libperl_dllmain.imp
     
    144144
    145145miniperl: $(obj) perl$(OBJ_EXT) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT)
    146         $(CC) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) `echo $(obj)|sed -e 's/\bop\./opmini./g'` $(libs) -Zmap -Zlinker /map/PM:VIO
     146        $(CC) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) `echo $(obj)|sed -e 's/\bop\./opmini./g'` $(libs) -Zmap -Zargs-wild
    147147        @./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
    148148
     
    171171
    172172perl___$(EXE_EXT) perl___: $& libperl_dllmain$(LIB_EXT)
    173         $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl___ libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO
    174         $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 8192 -o perl___8 libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO
    175         $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 4096 -o perl___4 libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO
    176         $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 2048 -o perl___2 libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO
    177         $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 1024 -o perl___1 libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO
    178         $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 512 -o perl___05 libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO
    179         $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 320 -o perl___03 libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO
     173        $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl___ libperl_dllmain$(LIB_EXT)
     174        $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 8192 -o perl___8 libperl_dllmain$(LIB_EXT)
     175        $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 4096 -o perl___4 libperl_dllmain$(LIB_EXT)  
     176        $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 2048 -o perl___2 libperl_dllmain$(LIB_EXT)
     177        $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 1024 -o perl___1 libperl_dllmain$(LIB_EXT)
     178        $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 512 -o perl___05 libperl_dllmain$(LIB_EXT)
     179        $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 320 -o perl___03 libperl_dllmain$(LIB_EXT)
    180180
    181181# This one is compiled -Zsys, so cannot do many things:
     
    187187
    188188perl_stat perl_stat$(EXE_EXT): $& libperl_dllmain$(LIB_EXT)
    189         $(SHRPENV) $(CC) $(STAT_CLDFLAGS) $(CCDLFLAGS) -o perl_stat libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO
     189        $(SHRPENV) $(CC) $(STAT_CLDFLAGS) $(CCDLFLAGS) -o perl_stat libperl_dllmain$(LIB_EXT)  
    190190
    191191# Remove -Zcrtdll, add -Zsys
     
    195195
    196196perl_sys perl_sys$(EXE_EXT): $& libperl_dllmain$(LIB_EXT)
    197         $(SHRPENV) $(CC) $(SYS_CLDFLAGS) $(CCDLFLAGS) -o perl_sys libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO
     197        $(SHRPENV) $(CC) $(SYS_CLDFLAGS) $(CCDLFLAGS) -o perl_sys libperl_dllmain$(LIB_EXT)  
    198198
    199199installcmd :
     
    269269
    270270perl__$(EXE_EXT) perl__: $& libperl_dllmain$(LIB_EXT)
    271         $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl__ libperl_dllmain$(LIB_EXT) -Zlinker /PM:PM
     271        $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl__ libperl_dllmain$(LIB_EXT) -Zlinker /PM:PM 
    272272
    273273# Forking dynamically loaded perl:
     
    293293
    294294# Remove -Zexe, add -Zdll -Zso.  No stack needed
    295 SO_CLDFLAGS = -Zdll -Zso -Zomf -Zmt -Zsys
     295SO_CLDFLAGS = -Zdll -Zomf
    296296
    297297# A callable-from-REXX DLL
     
    304304        echo    "DESCRIPTION '@#perl5-porters@perl.org:`miniperl -Ilib -MConfig -e 'print \$$]'`#@ REXX to Perl `miniperl -Ilib -MConfig -e 'print \$$Config{version}'` interface'" >> $@
    305305        echo    "EXPORTS"                                       >> $@
    306         echo    '  "PERL"'                                      >> $@
    307         echo    '  "PERLTERM"'                                  >> $@
    308         echo    '  "PERLINIT"'                                  >> $@
    309         echo    '  "PERLEXIT"'                                  >> $@
    310         echo    '  "PERLEVAL"'                                  >> $@
    311         echo    '  "PERLLASTERROR"'                             >> $@
    312         echo    '  "PERLEVALSUBCOMMAND"'                        >> $@
    313         echo    '  "PERLEXPORTALL"'                             >> $@
    314         echo    '  "PERLDROPALL"'                               >> $@
    315         echo    '  "PERLDROPALLEXIT"'                           >> $@
     306        echo    '  "_PERL"'                                     >> $@
     307        echo    '  "_PERLTERM"'                                 >> $@
     308        echo    '  "_PERLINIT"'                                 >> $@
     309        echo    '  "_PERLEXIT"'                                 >> $@
     310        echo    '  "_PERLEVAL"'                                 >> $@
     311        echo    '  "_PERLLASTERROR"'                            >> $@
     312        echo    '  "_PERLEVALSUBCOMMAND"'                       >> $@
     313        echo    '  "_PERLEXPORTALL"'                            >> $@
     314        echo    '  "_PERLDROPALL"'                              >> $@
     315        echo    '  "_PERLDROPALLEXIT"'                          >> $@
    316316
    317317
  • trunk/essentials/dev-lang/perl/os2/OS2/Process/Process.xs

    r3187 r3188  
    221221    PIB *pib;
    222222   
     223#ifndef __KLIBC__
    223224    if (!(_emx_env & 0x200)) return (char*)ptypes[1]; /* not OS/2. */
     225#endif
    224226    if (CheckOSError(DosGetInfoBlocks(&tib, &pib)))
    225227        return NULL;
     
    234236    ULONG apptype;
    235237   
     238#ifndef __KLIBC__
    236239    if (!(_emx_env & 0x200))
    237240        croak("file_type not implemented on DOS"); /* not OS/2. */
     241#endif
    238242    if (CheckOSError(DosQueryAppType(path, &apptype))) {
    239243#if 0
     
    481485         HSWITCH hSwitch;   
    482486
     487#ifndef __KLIBC__
    483488         if (!(_emx_env & 0x200))
    484489             croak("switch_entry not implemented on DOS"); /* not OS/2. */
     490#endif
    485491         if (CheckWinError(hSwitch =
    486492                           myWinQuerySwitchHandle(hwnd, pid)))
     
    683689    SWENTRY swentry;
    684690
     691#ifndef __KLIBC__
    685692    if (!(_emx_env & 0x200))
    686693             croak("process_swentry not implemented on DOS"); /* not OS/2. */
     694#endif
     695
    687696    fill_swentry(&swentry, hwnd, pid);
    688697    return newSVpvn((char*)&swentry, sizeof(swentry));
     
    697706    SV *sv = newSVpvn("",0);
    698707
     708#ifndef __KLIBC__
    699709    if (!(_emx_env & 0x200))
    700710             croak("swentries_list not implemented on DOS"); /* not OS/2. */
     711#endif
    701712    if (!pWinQuerySwitchList)
    702713        AssignFuncPByORD(pWinQuerySwitchList, ORD_WinQuerySwitchList);
     
    759770    ULONG rc;                   /* For CheckOSError */
    760771
     772#ifndef __KLIBC__
    761773    if (!(_emx_env & 0x200))
    762774             croak("change_entry() not implemented on DOS"); /* not OS/2. */
     775#endif
    763776    if (!pWinChangeSwitchEntry)
    764777        AssignFuncPByORD(pWinChangeSwitchEntry, ORD_WinChangeSwitchEntry);
  • trunk/essentials/dev-lang/perl/os2/OS2/REXX/REXX.xs

    r3187 r3188  
    1515#endif
    1616
     17#ifndef __KLIBC__
    1718extern ULONG _emx_exception (   EXCEPTIONREPORTRECORD *,
    1819                                EXCEPTIONREGISTRATIONRECORD *,
    1920                                CONTEXTRECORD *,
    2021                                void *);
     22#endif
    2123
    2224static RXSTRING * strs;
     
    158160{
    159161    dTHX;
     162#ifndef __KLIBC__
    160163    EXCEPTIONREGISTRATIONRECORD xreg = { NULL, _emx_exception };
     164#endif
    161165    int i, rc;
    162166    unsigned long len;
  • trunk/essentials/dev-lang/perl/os2/dl_os2.c

    r3187 r3188  
    150150
    151151        fail[0] = 0;
    152         rc = DosQueryProcAddr((HMODULE)handle, 0, symbol, &addr);
     152
     153    rc = DosQueryProcAddr((HMODULE)handle, 0, symbol, &addr);
    153154        if (rc == 0) {
    154155                rc = DosQueryProcType((HMODULE)handle, 0, symbol, &type);
     
    157158                rc = ERROR_WRONG_PROCTYPE;
    158159        }
     160
    159161        retcode = rc;
    160162        return NULL;
  • trunk/essentials/dev-lang/perl/os2/os2.c

    r3187 r3188  
    2020 * Various Unix compatibility functions for OS/2
    2121 */
     22
     23#ifdef __KLIBC__
     24#define INSTALL_PREFIX "u:/perl"
     25#endif
    2226
    2327#include <stdio.h>
     
    661665    PIB *pib;
    662666   
     667#ifndef __KLIBC__
    663668    if (!(_emx_env & 0x200)) return 1; /* not OS/2. */
     669#endif
    664670    if (CheckOSError(DosGetInfoBlocks(&tib, &pib)))
    665671        return -1;
     
    675681    PIB *pib;
    676682   
     683#ifndef __KLIBC__
    677684    if (!(_emx_env & 0x200))
    678685        Perl_croak_nocontext("Can't set type on DOS"); /* not OS/2. */
     686#endif
    679687    if (CheckOSError(DosGetInfoBlocks(&tib, &pib)))
    680688        croak_with_os2error("Error getting info blocks");
     
    833841  ULONG rc, prio = sys_prio(pid);
    834842
     843#ifndef __KLIBC__
    835844  if (!(_emx_env & 0x200)) return 0; /* Nop if not OS/2. */
     845#endif
    836846  if (priors[(32 - val) >> 5] + 1 == (prio >> 8)) {
    837847      /* Do not change class. */
     
    867877  ULONG ret;
    868878
     879#ifndef __KLIBC__
    869880  if (!(_emx_env & 0x200)) return 0; /* Nop if not OS/2. */
     881#endif
    870882  ret = sys_prio(pid);
    871883  if (ret == PRIO_ERR) {
     
    952964    ULONG apptype;
    953965   
     966#ifndef __KLIBC__
    954967    if (!(_emx_env & 0x200))
    955968        Perl_croak_nocontext("file_type not implemented on DOS"); /* not OS/2. */
     969#endif
    956970    if (CheckOSError(DosQueryAppType(path, &apptype))) {
    957971        switch (rc) {
     
    973987/* global PL_Argv[] contains arguments. */
    974988
     989#ifndef __KLIBC__
    975990extern ULONG _emx_exception (   EXCEPTIONREPORTRECORD *,
    976991                                EXCEPTIONREGISTRATIONRECORD *,
    977992                                CONTEXTRECORD *,
    978993                                void *);
     994#endif
    979995
    980996int
     
    10161032      reread:
    10171033        force_shell = 0;
     1034#ifndef __KLIBC__
    10181035        if (_emx_env & 0x200) { /* OS/2. */
     1036#else
     1037         {
     1038#endif
    10191039            int type = file_type(real_name);
    10201040          type_again:
     
    12541274                           
    12551275                            if (!shell)
     1276#ifndef __KLIBC__
    12561277                                shell = ((_emx_env & 0x200)
    12571278                                         ? "c:/os2/cmd.exe"
    12581279                                         : "c:/command.com");
     1280#else
     1281                                shell = "c:/os2/cmd.exe";
     1282#endif
    12591283                            nargs = shell_opt ? 2 : 1;  /* shell file args */
    12601284                            exec_args[0] = shell;
     
    20562080        int number = SvTRUE(get_sv("OS2::nsyserror", TRUE));
    20572081
     2082#ifndef __KLIBC__
    20582083        if (!(_emx_env & 0x200)) return ""; /* Nop if not OS/2. */
     2084#endif
    20592085        if (rc == 0)
    20602086                return "";
     
    22622288                    to = dllname2buffer(aTHX_ b, bl);
    22632289                } else {                                /* No Perl present yet */
     2290
    22642291                    HMODULE self = find_myself();
    22652292                    APIRET rc = DosQueryModuleName(self, bl, b);
     
    22722299                            *to = '/';
    22732300                    to = b;
     2301
    22742302                }
    22752303                break;
     
    26182646  APIRET badrc;
    26192647
     2648#ifndef __KLIBC__
    26202649  if (!(_emx_env & 0x200))      /* DOS */
    26212650    return !_sleep2(ms);
    2622 
     2651#endif
    26232652  os2cp_croak(DosCreateEventSem(NULL,        /* Unnamed */
    26242653                                &hevEvent1,  /* Handle of semaphore returned */
     
    39984027        GV *gv;
    39994028
     4029#ifndef __KLIBC__
    40004030        if (_emx_env & 0x200) { /* OS/2 */
     4031#else
     4032            {
     4033#endif
    40014034            newXS("File::Copy::syscopy", XS_File__Copy_syscopy, file);
    40024035            newXS("Cwd::extLibpath", XS_Cwd_extLibpath, file);
     
    40554088        GvMULTI_on(gv);
    40564089        sv_setiv(GvSV(gv), exe_is_aout());
     4090#ifndef __KLIBC__
    40574091        gv = gv_fetchpv("OS2::emx_rev", TRUE, SVt_PV);
     4092#endif
    40584093        GvMULTI_on(gv);
     4094#ifndef __KLIBC__
    40594095        sv_setiv(GvSV(gv), _emx_rev);
    40604096        sv_setpv(GvSV(gv), _emx_vprt);
     4097#endif
    40614098        SvIOK_on(GvSV(gv));
     4099#ifndef __KLIBC__
    40624100        gv = gv_fetchpv("OS2::emx_env", TRUE, SVt_PV);
     4101#endif
    40634102        GvMULTI_on(gv);
     4103#ifndef __KLIBC__
    40644104        sv_setiv(GvSV(gv), _emx_env);
     4105#endif
    40654106        gv = gv_fetchpv("OS2::os_ver", TRUE, SVt_PV);
    40664107        GvMULTI_on(gv);
     
    40734114}
    40744115
     4116#ifndef __KLIBC__
    40754117extern void _emx_init(void*);
     4118#endif
    40764119
    40774120static void jmp_out_of_atexit(void);
     
    40804123#define FORCE_EMX_INIT_INSTALL_ATEXIT   2
    40814124
     4125#ifndef __KLIBC__
    40824126static void
    40834127my_emx_init(void *layout) {
     
    40954139                "popf\n" : : "r" (layout), "m" (old_esp)        );
    40964140}
    4097 
     4141#endif
    40984142struct layout_table_t {
    40994143    ULONG text_base;
     
    41154159};
    41164160
     4161#ifndef __KLIBC__
    41174162static ULONG
    41184163my_os_version() {
     
    41304175    return osv_res;
    41314176}
    4132 
     4177#endif
     4178
     4179#ifndef __KLIBC__
    41334180static void
    41344181force_init_emx_runtime(EXCEPTIONREGISTRATIONRECORD *preg, ULONG flags)
     
    42354282        exit(56);
    42364283}
    4237 
     4284#endif
    42384285static void
    42394286jmp_out_of_atexit(void)
     
    42824329#include <emx/startup.h>
    42834330
     4331#ifndef __KLIBC__
    42844332extern ULONG __os_version();            /* See system.doc */
    4285 
     4333#endif
     4334
     4335#ifndef __KLIBC__
    42864336void
    42874337check_emx_runtime(char **env, EXCEPTIONREGISTRATIONRECORD *preg)
     
    43394389        initialized either.  Uninitialized EMX.DLL returns 0 in the low
    43404390        nibble of __os_version().  */
     4391
    43414392    v_emx = my_os_version();
    43424393
     
    43504401    v_crt = (_osmajor | _osminor);
    43514402
     4403#ifndef __KLIBC__
    43524404    if ((_emx_env & 0x200) && !(v_emx & 0xFFFF)) {      /* OS/2, EMX uninit. */
    43534405        force_init_emx_runtime( preg,
    43544406                                FORCE_EMX_INIT_CONTRACT_ARGV
    43554407                                | FORCE_EMX_INIT_INSTALL_ATEXIT );
     4408#endif
    43564409        emx_wasnt_initialized = 1;
    43574410        /* Update CRTL data basing on now-valid EMX runtime data */
     
    43924445        DosReleaseMutexSem(hmtx_emx_init);
    43934446}
    4394 
     4447#endif
    43954448#define ENTRY_POINT 0x10000
    43964449
     
    44304483    MALLOC_INIT;
    44314484
     4485#ifndef __KLIBC__
    44324486    check_emx_runtime(env, (EXCEPTIONREGISTRATIONRECORD *)preg);
    4433 
     4487#endif
    44344488    settmppath();
    44354489    OS2_Perl_data.xs_init = &Xs_OS2_init;
     
    44424496        Newx(PL_sh_path, strlen(SH_PATH) + 1, char);
    44434497        strcpy(PL_sh_path, SH_PATH);
     4498#ifndef __KLIBC__
    44444499        PL_sh_path[0] = shell[0];
     4500#endif
    44454501    } else if ( (shell = getenv("PERL_SH_DIR")) ) {
    44464502        int l = strlen(shell), i;
     
    44514507        strncpy(PL_sh_path, shell, l);
    44524508        strcpy(PL_sh_path + l, "/sh.exe");
     4509#ifndef __KLIBC__
    44534510        for (i = 0; i < l; i++) {
    44544511            if (PL_sh_path[i] == '\\') PL_sh_path[i] = '/';
    44554512        }
     4513#endif
    44564514    }
    44574515#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
     
    44944552    static ULONG max_fh = 0;
    44954553
     4554#ifndef __KLIBC__
    44964555    if (!(_emx_env & 0x200)) return 1;          /* not OS/2. */
     4556#endif
    44974557    if (fd >= max_fh) {                         /* Renew */
    44984558        LONG delta = 0;
     
    46294689   MUTEX_UNLOCK(&perlos2_state_mutex);
    46304690  }
     4691#ifndef __KLIBC__
    46314692  if (!(_emx_env & 0x200) || !use_my_flock)
    46324693    return flock(handle, o);    /* Delegate to EMX. */
     4694#endif
    46334695 
    46344696                                        /* is this a file? */
     
    47694831}
    47704832
     4833#ifndef __KLIBC__
    47714834void
    47724835setgrent(void)
     
    47874850  return getgrgid(0);
    47884851}
    4789 
     4852#endif
    47904853#undef getpwuid
    47914854#undef getpwnam
  • trunk/essentials/dev-lang/perl/os2/os2ish.h

    r3187 r3188  
    2323#define HAS_WAIT
    2424#define HAS_DLERROR
     25#ifndef __KLIBC__
    2526#define HAS_WAITPID_RUNTIME (_emx_env & 0x200)
     27#else
     28#define HAS_WAITPID_RUNTIME 1
     29#endif
    2630
    2731/* HAS_PASSWD
     
    314318FILE *my_tmpfile (void);
    315319char *my_tmpnam (char *);
     320#ifndef __KLIBC__
    316321int my_mkdir (__const__ char *, long);
     322#endif
    317323int my_rmdir (__const__ char *);
    318324struct passwd *my_getpwent (void);
     
    348354#endif
    349355
     356#ifndef __KLIBC__
    350357struct group *getgrent (void);
    351358void setgrent (void);
    352359void endgrent (void);
    353 
     360#endif
    354361struct passwd *my_getpwuid (uid_t);
    355362struct passwd *my_getpwnam (__const__ char *);
     
    395402
    396403#include <stdlib.h>     /* before the following definitions */
     404#ifndef __KLIBC__
    397405#include <unistd.h>     /* before the following definitions */
     406#endif
    398407#include <fcntl.h>
    399408#include <sys/stat.h>
     
    411420#endif
    412421
     422#ifndef __KLIBC__
    413423#define PERLIO_IS_BINMODE_FD(fd) _PERLIO_IS_BINMODE_FD(fd)
     424#endif
    414425
    415426#ifdef __GNUG__
     
    422433
    423434#include <emx/io.h> /* for _fd_flags() prototype */
    424 
     435#ifndef __KLIBC__
    425436static inline bool
    426437_PERLIO_IS_BINMODE_FD(int fd)
     
    430441    return pflags && (*pflags) & O_BINARY;
    431442}
    432 
     443#endif
    433444/* ctermid is missing from emx0.9d */
    434445char *ctermid(char *s);
     
    536547#define OS2_XS_init() (*OS2_Perl_data.xs_init)(aTHX)
    537548
    538 #if _EMX_CRT_REV_ >= 60
     549#ifndef __KLIBC__
     550#if (_EMX_CRT_REV_ >= 60)
    539551# define os2_setsyserrno(rc)    (Perl_rc = rc, errno = errno_isOS2_set, \
    540552                                _setsyserrno(rc))
     
    542554# define os2_setsyserrno(rc)    (Perl_rc = rc, errno = errno_isOS2)
    543555#endif
     556#else
     557# define os2_setsyserrno(rc)    (Perl_rc = rc, errno = errno_isOS2)
     558#endif /* __KLIBC__ */
    544559
    545560/* The expressions below return true on error. */
     
    781796my_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
    782797{
     798#ifndef __KLIBC__
    783799  if (nfds == 0 && timeout && (_emx_env & 0x200)) {
     800#else
     801  if (nfds == 0 && timeout) {
     802#endif
    784803    if (async_mssleep(1000 * timeout->tv_sec + (timeout->tv_usec + 500)/1000, 500))
    785804      return 0;
     
    800819int os2_stat(const char *name, struct stat *st);
    801820int fork_with_resources();
     821#ifndef __KLIBC__
    802822int setpriority(int which, int pid, int val);
    803823int getpriority(int which /* ignored */, int pid);
     824#endif
    804825
    805826void croak_with_os2error(char *s) __attribute__((noreturn));
  • trunk/essentials/dev-lang/perl/perl.h

    r3187 r3188  
    9595 * __bsdi__ for BSD/OS
    9696 */
    97 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(PERL_DARWIN) || defined(__bsdi__) || defined(BSD41) || defined(BSD42) || defined(BSD43) || defined(BSD44)
     97#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(PERL_DARWIN) || defined(__bsdi__) || defined(BSD41) || defined(BSD42) || defined(BSD43) || defined(BSD44) 
    9898#   ifndef BSDish
    9999#       define BSDish
     
    160160
    161161#ifndef PERL_UNUSED_DECL
    162 #  ifdef HASATTRIBUTE_UNUSED
     162#  if defined(HASATTRIBUTE_UNUSED) 
    163163#    define PERL_UNUSED_DECL __attribute__unused__
    164164#  else
  • trunk/essentials/dev-lang/perl/t/io/fs.t

    r3187 r3188  
    2323
    2424my $has_link            = $Config{d_link};
     25
    2526my $accurate_timestamps =
    2627    !($^O eq 'MSWin32' || $^O eq 'NetWare' ||
     
    3738    }
    3839}
     40
     41if ($^O eq 'os2') {
     42            $has_link            = 0;}
    3943
    4044my $needs_fh_reopen =
  • trunk/essentials/dev-lang/perl/util.h

    r3187 r3188  
    2727         || ((f)[0] == '\\' && (f)[1] == '\\')  /* UNC path */  \
    2828         ||     ((f)[3] == ':'))                                /* volume name, currently only sys */
    29 #  else         /* !NETWARE */
    30 #    if defined( DOSISH) || defined(EPOC)
     29#  else         /* !__NETWARE */
     30#    if defined( __KLIBC__)
     31#      define PERL_FILE_IS_ABSOLUTE(f) \
     32        (*(f) == '/' || *(f) == '\\'    \
     33         || ((f)[1] == ':' && (f)[2] == '/') || ((f)[1] == ':' && (f)[2] == '\\'))              /* drive name */
     34#  else         /* !__KLIBC__ */
     35#    if defined( DOSISH) || defined(EPOC)
    3136#      define PERL_FILE_IS_ABSOLUTE(f) \
    3237        (*(f) == '/'                                                    \
     
    4045#    endif      /* DOSISH */
    4146#   endif       /* NETWARE */
     47#   endif       /* __KLIBC__ */
    4248#  endif        /* WIN32 */
    4349#endif          /* VMS */
Note: See TracChangeset for help on using the changeset viewer.