This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
cygwin hints
[perl5.git] / hints / cygwin.sh
CommitLineData
5aabfad6 1#! /bin/sh
2c2d71f5 2# cygwin.sh - hints for building perl using the Cygwin environment for Win32
5aabfad6 3#
f89d6eaa 4
d702ae42 5# not otherwise settable
f89d6eaa 6exe_ext='.exe'
f89d6eaa 7firstmakefile='GNUmakefile'
d702ae42
GS
8case "$ldlibpthname" in
9'') ldlibpthname=PATH ;;
10esac
5db16f6a 11archobjs='cygwin.o'
f89d6eaa 12
4fabb596 13# mandatory (overrides incorrect defaults)
c22e42be 14test -z "$cc" && cc='gcc'
4fabb596 15if test -z "$plibpth"
d702ae42 16then
4fabb596
GS
17 plibpth=`gcc -print-file-name=libc.a`
18 plibpth=`dirname $plibpth`
19 plibpth=`cd $plibpth && pwd`
d702ae42 20fi
f89d6eaa 21so='dll'
5d129265 22# - eliminate -lc, implied by gcc and a symlink to libcygwin.a
4fabb596 23libswanted=`echo " $libswanted " | sed -e 's/ c / /g'`
5d129265
EF
24# - eliminate -lm, symlink to libcygwin.a
25libswanted=`echo " $libswanted " | sed -e 's/ m / /g'`
ab9778ab
YST
26# - eliminate -lutil, symbols are all in libcygwin.a
27libswanted=`echo " $libswanted " | sed -e 's/ util / /g'`
2bf8728c
JH
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
ab9778ab 31# (with cygwin 1.5.7, cygipc is deprecated in favor of the builtin cygserver)
2bf8728c 32libswanted="$libswanted gdbm_compat"
13432c88
RU
33test -z "$optimize" && optimize='-O3'
34man3ext='3pm'
35test -z "$use64bitint" && use64bitint='define'
36test -z "$usethreads" && usethreads='define'
37test -z "$usemymalloc" && usemymalloc='define'
398a0d07 38ccflags="$ccflags -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__"
4fabb596
GS
39
40# dynamic loading
4fabb596
GS
41# - otherwise -fpic
42cccdlflags=' '
4f3b19ea
RU
43lddlflags=' --shared'
44ld='g++'
d702ae42 45
ab9778ab
YST
46case "$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 ;;
54esac;
55
13432c88
RU
56# compile Win32CORE "module" as static. try to avoid the space.
57if test -z "$static_ext"; then
58 static_ext="Win32CORE"
59else
60 static_ext="$static_ext Win32CORE"
61fi
78ff2d7b 62
5db16f6a
EF
63# Win9x problem with non-blocking read from a closed pipe
64d_eofnblk='define'
65
1867a6a3 66# suppress auto-import warnings
13432c88 67ldflags="$ldflags -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--stack,8388608 -Wl,--enable-auto-image-base"
4f3b19ea 68lddlflags="$lddlflags $ldflags"
1867a6a3 69
13432c88 70# strip exe's and dll's, better do it afterwards
d702ae42 71#ldflags="$ldflags -s"
13432c88 72#ccdlflags="$ccdlflags -s"
d702ae42 73#lddlflags="$lddlflags -s"