Configure now tests gcvt() more thoroughly.
[p5sagit/p5-mst-13.2.git] / hints / os2.sh
index d4fb71d..91138f4 100644 (file)
@@ -1,3 +1,4 @@
+#! /bin/sh
 # hints/os2.sh
 # This file reflects the tireless work of
 # Ilya Zakharevich <ilya@math.ohio-state.edu>
@@ -5,7 +6,7 @@
 # Trimmed and comments added by 
 #     Andy Dougherty  <doughera@lafcol.lafayette.edu>
 #     Exactly what is required beyond a standard OS/2 installation?
-#     There are notes about "patched pdksh" I don't understand.
+#     There are notes about "patched pdksh" I do not understand.
 
 # Note that symbol extraction code gives wrong answers (sometimes?) on
 # gethostent and setsid.
 # Note that during the .obj compile you need to move the perl.dll file
 # to LIBPATH :-(
 
+bin_sh=`../UU/loc sh.exe /bin c:/bin d:/bin e:/bin f:/bin g:/bin h:/bin /bin`
+echo "####### Shell found at $bin_sh #############" >&4
+sh="$bin_sh"
+startsh="#!$bin_sh"
+
 #osname="OS/2"
 sysman=`../UU/loc . /man/man1 c:/man/man1 c:/usr/man/man1 d:/man/man1 d:/usr/man/man1 e:/man/man1 e:/usr/man/man1 f:/man/man1 f:/usr/man/man1 g:/man/man1 g:/usr/man/man1 /usr/man/man1`
 cc='gcc'
@@ -30,17 +36,39 @@ so='dll'
 firstmakefile='GNUmakefile'
 exe_ext='.exe'
 
+# We provide it
+i_dlfcn='define'
+
+aout_d_shrplib='undef'
+aout_obj_ext='.o'
+aout_lib_ext='.a'
+aout_ar='ar'
+aout_plibext='.a'
+aout_d_fork='define'
+aout_lddlflags='-Zdll'
+aout_ldflags='-Zexe'
+aout_ccflags='-DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS'
+aout_cppflags='-DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I. -DPACK_MALLOC =DDEBUGGING_MSTATS'
+aout_use_clib='c'
+aout_usedl='undef'
+aout_archobjs="os2.o dl_os2.o"
+
+# variable which have different values for aout compile
+used_aout='d_shrplib plibext lib_ext obj_ext ar plibext d_fork lddlflags ldflags ccflags use_clib usedl archobjs cppflags'
+
 if [ "$emxaout" != "" ]; then
-    d_shrplib='undef'
-    obj_ext='.o'
-    lib_ext='.a'
-    ar='ar'
-    plibext='.a'
-    d_fork='define'
-    lddlflags='-Zdll'
-    ldflags='-Zexe'
-    ccflags='-DDOSISH -DNO_SYS_ALLOC -DOS2=2 -DEMBED -I.'
-    use_clib='c'
+    d_shrplib="$aout_d_shrplib"
+    obj_ext="$aout_obj_ext"
+    lib_ext="$aout_lib_ext"
+    ar="$aout_ar"
+    plibext="$aout_plibext"
+    d_fork="$aout_d_fork"
+    lddlflags="$aout_lddlflags"
+    ldflags="$aout_ldflags"
+    ccflags="$aout_ccflags"
+    cppflags="$aout_cppflags"
+    use_clib="$aout_use_clib"
+    usedl="$aout_usedl"
 else
     d_shrplib='define'
     obj_ext='.obj'
@@ -48,10 +76,12 @@ else
     ar='emxomfar'
     plibext='.lib'
     d_fork='undef'
-    lddlflags='-Zdll -Zomf -Zcrtdll'
-    ldflags='-Zexe -Zomf -Zcrtdll'
-    ccflags='-Zomf -DDOSISH -DOS2=2 -DEMBED -I.'
+    lddlflags='-Zdll -Zomf -Zmt -Zcrtdll'
+    # Recursive regmatch may eat 2.5M of stack alone.
+    ldflags='-Zexe -Zomf -Zmt -Zcrtdll -Zstack 32000'
+    ccflags='-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS'
     use_clib='c_import'
+    usedl='define'
 fi
 
 # To get into config.sh (should start at the beginning of line)
@@ -69,18 +99,17 @@ fi
 # [Maybe we should just remove c from $libswanted ?]
 
 libs='-lsocket -lm'
-archobjs="os2$obj_ext"
+archobjs="os2$obj_ext dl_os2$obj_ext"
 
 # Run files without extension with sh - feature of patched ksh
 # [???]
-NOHASHBANG=sh
+# NOHASHBANG=sh
 # Same with newer ksh
 EXECSHELL=sh
 
 cccdlflags='-Zdll'
-dlsrc='dl_os2.xs'
+dlsrc='dl_dlopen.xs'
 ld='gcc'
-usedl='define'
 
 #cppflags='-DDOSISH -DOS2=2 -DEMBED -I.'
 
@@ -122,13 +151,12 @@ lns='cp'
 
 nm_opt='-p'
 
-####### All the rest is commented
+####### We define these functions ourselves
 
-# I do not have these:
-#dynamic_ext='Fcntl GDBM_File SDBM_File POSIX Socket UPM REXXCALL'
-#dynamic_ext='Fcntl POSIX Socket SDBM_File Devel/DProf'
-#extensions='Fcntl GDBM_File SDBM_File POSIX Socket UPM REXXCALL'
-#extensions='Fcntl SDBM_File POSIX Socket Devel/DProf'
+d_getprior='define'
+d_setprior='define'
+
+####### All the rest is commented
 
 # The next two are commented. pdksh handles #!
 # sharpbang='extproc '
@@ -136,3 +164,35 @@ nm_opt='-p'
 
 # Commented:
 #startsh='extproc ksh\\n#! sh'
+
+# Now install the external modules. We are in the ./hints directory.
+
+cd ../os2/OS2
+
+if ! test -d ../../ext/OS2 ; then
+   mkdir ../../ext/OS2
+fi
+
+cp -rfu * ../../ext/OS2/
+
+# Install tests:
+
+for xxx in * ; do
+       if $test -d $xxx/t; then
+               cp -uf $xxx/t/*.t ../../t/lib
+       else
+               if $test -d $xxx; then
+                       cd $xxx
+                       for yyy in * ; do
+                               if $test -d $yyy/t; then
+                                   cp -uf $yyy/t/*.t ../../t/lib
+                               fi
+                       done
+                       cd ..
+               fi
+       fi
+done
+
+
+# Now go back
+cd ../../hints