2 # cygwin.sh - hints for building perl using the Cygwin environment for Win32
5 # not otherwise settable
7 firstmakefile='GNUmakefile'
8 case "$ldlibpthname" in
9 '') ldlibpthname=PATH ;;
13 # mandatory (overrides incorrect defaults)
14 test -z "$cc" && cc='gcc'
17 plibpth=`gcc -print-file-name=libc.a`
18 plibpth=`dirname $plibpth`
19 plibpth=`cd $plibpth && pwd`
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 test -z "$ignore_versioned_solibs" && ignore_versioned_solibs='y'
29 test -z "$usenm" && usenm='no'
30 test -z "$libc" && libc='/usr/lib/libcygwin.a'
31 test -z "$loclibpth" && loclibpth=' '
32 test -z "$glibpth" && glibpth=' '
33 test -z "$plibpth" && plibpth=' '
34 test -z "$libpth" && libpth=' '
36 # - add libgdbm_compat $libswanted
37 libswanted="$libswanted gdbm_compat"
38 test -z "$optimize" && optimize='-O3'
40 test -z "$use64bitint" && use64bitint='define'
41 test -z "$useithreads" && useithreads='define'
42 test -z "$usemymalloc" && usemymalloc='undef'
43 ccflags="$ccflags -D_GNU_SOURCE"
44 # - otherwise i686-cygwin
51 test -z "$ld" && ld='g++'
54 # Configure gets these wrong if the IPC server isn't yet running:
55 # only use for 1.5.7 and onwards
56 [2-9]*|1.[6-9]*|1.[1-5][0-9]*|1.5.[7-9]*|1.5.[1-6][0-9]*)
57 d_semctl_semid_ds='define'
58 d_semctl_semun='define'
69 # IPv6 not implemented before cygwin-1.7
76 # newlib finitel is buggy before cygwin-2.5.0
81 # compile Win32CORE "module" as static. try to avoid the space.
82 if test -z "$static_ext"; then
83 static_ext="Win32CORE"
85 static_ext="$static_ext Win32CORE"
88 # configure should not check for xlocale.h if it gets the API from locale.h
91 # Win9x problem with non-blocking read from a closed pipe
94 # suppress auto-import warnings
95 ldflags="$ldflags -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base"
96 lddlflags="$lddlflags $ldflags"
98 # strip exe's and dll's, better do it afterwards
99 #ldflags="$ldflags -s"
100 #ccdlflags="$ccdlflags -s"
101 #lddlflags="$lddlflags -s"
103 # Seems that exporting _Thread_local doesn't work on cygwin. This 6 year old
104 # gcc bug suggests that maybe the problem really is binutils, but either way
105 # it still doesn't work, despite our probes looking good:
106 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
109 # Broken: https://sourceware.org/pipermail/cygwin/2022-August/252043.html */