| 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 | 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=' ' |
| 35 | PATH='.:/usr/bin/' |
| 36 | # - add libgdbm_compat $libswanted |
| 37 | libswanted="$libswanted gdbm_compat" |
| 38 | test -z "$optimize" && optimize='-O3' |
| 39 | man3ext='3pm' |
| 40 | test -z "$use64bitint" && use64bitint='define' |
| 41 | test -z "$useithreads" && useithreads='define' |
| 42 | test -z "$usemymalloc" && usemymalloc='undef' |
| 43 | ccflags="$ccflags -U__STRICT_ANSI__ -D_GNU_SOURCE" |
| 44 | # - otherwise i686-cygwin |
| 45 | archname='cygwin' |
| 46 | |
| 47 | # dynamic loading |
| 48 | # - otherwise -fpic |
| 49 | cccdlflags=' ' |
| 50 | lddlflags=' --shared' |
| 51 | test -z "$ld" && ld='g++' |
| 52 | |
| 53 | case "$osvers" in |
| 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' |
| 59 | ;; |
| 60 | esac |
| 61 | |
| 62 | case "$osvers" in |
| 63 | [2-9]*|1.[6-9]*) |
| 64 | # IPv6 only since 1.7 |
| 65 | d_inetntop='define' |
| 66 | d_inetpton='define' |
| 67 | ;; |
| 68 | *) |
| 69 | # IPv6 not implemented before cygwin-1.7 |
| 70 | d_inetntop='undef' |
| 71 | d_inetpton='undef' |
| 72 | esac |
| 73 | |
| 74 | # compile Win32CORE "module" as static. try to avoid the space. |
| 75 | if test -z "$static_ext"; then |
| 76 | static_ext="Win32CORE" |
| 77 | else |
| 78 | static_ext="$static_ext Win32CORE" |
| 79 | fi |
| 80 | |
| 81 | # Win9x problem with non-blocking read from a closed pipe |
| 82 | d_eofnblk='define' |
| 83 | |
| 84 | # suppress auto-import warnings |
| 85 | ldflags="$ldflags -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base" |
| 86 | lddlflags="$lddlflags $ldflags" |
| 87 | |
| 88 | # strip exe's and dll's, better do it afterwards |
| 89 | #ldflags="$ldflags -s" |
| 90 | #ccdlflags="$ccdlflags -s" |
| 91 | #lddlflags="$lddlflags -s" |
| 92 | |
| 93 | # Seems that exporting _Thread_local doesn't work on cygwin. This 6 year old |
| 94 | # gcc bug suggests that maybe the problem really is binutils, but either way |
| 95 | # it still doesn't work, despite our probes looking good: |
| 96 | # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697 |
| 97 | d_thread_local=undef |
| 98 | |
| 99 | # Broken: https://sourceware.org/pipermail/cygwin/2022-August/252043.html */ |
| 100 | d_newlocale=undef |