An unfortunate side-effect of Encode and Encode::Alias use'ing each
[p5sagit/p5-mst-13.2.git] / hints / cygwin.sh
1 #! /bin/sh
2 # cygwin.sh - hints for building perl using the Cygwin environment for Win32
3 #
4
5 # not otherwise settable
6 exe_ext='.exe'
7 firstmakefile='GNUmakefile'
8 case "$ldlibpthname" in
9 '') ldlibpthname=PATH ;;
10 esac
11 archobjs='cygwin.o'
12
13 # mandatory (overrides incorrect defaults)
14 test -z "$cc" && cc='gcc'
15 if test -z "$plibpth"
16 then
17     plibpth=`gcc -print-file-name=libc.a`
18     plibpth=`dirname $plibpth`
19     plibpth=`cd $plibpth && pwd`
20 fi
21 so='dll'
22 # - eliminate -lc, implied by gcc and a symlink to libcygwin.a
23 libswanted=`echo " $libswanted " | sed -e 's/ c / /g'`
24 # - eliminate -lm, symlink to libcygwin.a
25 libswanted=`echo " $libswanted " | sed -e 's/ m / /g'`
26 # - eliminate -lutil, symbols are all in libcygwin.a
27 libswanted=`echo " $libswanted " | sed -e 's/ util / /g'`
28 # - add libgdbm_compat $libswanted
29 # - libcygipc doesn't work much at all with
30 #   the Perl SysV IPC tests so not adding it --jhi 2003-08-09
31 #   (with cygwin 1.5.7, cygipc is deprecated in favor of the builtin cygserver)
32 libswanted="$libswanted gdbm_compat"
33 test -z "$optimize" && optimize='-O3'
34 man3ext='3pm'
35 test -z "$use64bitint" && use64bitint='define'
36 test -z "$usethreads" && usethreads='define'
37 test -z "$usemymalloc" && usemymalloc='define'
38 ccflags="$ccflags -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__"
39
40 # dynamic loading
41 # - otherwise -fpic
42 cccdlflags=' '
43 lddlflags=' --shared'
44 ld='g++'
45
46 case "$osvers" in
47
48 # Configure gets these wrong if the IPC server isn't yet running:
49 # only use for 1.5.7 and onwards
50 [2-9]*|1.[6-9]*|1.[1-5][0-9]*|1.5.[7-9]*|1.5.[1-6][0-9]*)
51         d_semctl_semid_ds='define'
52         d_semctl_semun='define'
53         ;;
54 esac;
55
56 # compile Win32CORE "module" as static. try to avoid the space.
57 if test -z "$static_ext"; then
58   static_ext="Win32CORE"
59 else
60   static_ext="$static_ext Win32CORE"
61 fi
62
63 # Win9x problem with non-blocking read from a closed pipe
64 d_eofnblk='define'
65
66 # suppress auto-import warnings
67 ldflags="$ldflags -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--stack,8388608 -Wl,--enable-auto-image-base"
68 lddlflags="$lddlflags $ldflags"
69
70 # strip exe's and dll's, better do it afterwards
71 #ldflags="$ldflags -s"
72 #ccdlflags="$ccdlflags -s"
73 #lddlflags="$lddlflags -s"