Commit | Line | Data |
---|---|---|
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 | 6 | exe_ext='.exe' |
f89d6eaa | 7 | firstmakefile='GNUmakefile' |
d702ae42 GS |
8 | case "$ldlibpthname" in |
9 | '') ldlibpthname=PATH ;; | |
10 | esac | |
5db16f6a | 11 | archobjs='cygwin.o' |
f89d6eaa | 12 | |
4fabb596 | 13 | # mandatory (overrides incorrect defaults) |
c22e42be | 14 | test -z "$cc" && cc='gcc' |
4fabb596 | 15 | if test -z "$plibpth" |
d702ae42 | 16 | then |
4fabb596 GS |
17 | plibpth=`gcc -print-file-name=libc.a` |
18 | plibpth=`dirname $plibpth` | |
19 | plibpth=`cd $plibpth && pwd` | |
d702ae42 | 20 | fi |
f89d6eaa | 21 | so='dll' |
5d129265 | 22 | # - eliminate -lc, implied by gcc and a symlink to libcygwin.a |
4fabb596 | 23 | libswanted=`echo " $libswanted " | sed -e 's/ c / /g'` |
5d129265 EF |
24 | # - eliminate -lm, symlink to libcygwin.a |
25 | libswanted=`echo " $libswanted " | sed -e 's/ m / /g'` | |
ab9778ab YST |
26 | # - eliminate -lutil, symbols are all in libcygwin.a |
27 | libswanted=`echo " $libswanted " | sed -e 's/ util / /g'` | |
2bf8728c | 28 | # - add libgdbm_compat $libswanted |
2bf8728c | 29 | libswanted="$libswanted gdbm_compat" |
13432c88 RU |
30 | test -z "$optimize" && optimize='-O3' |
31 | man3ext='3pm' | |
32 | test -z "$use64bitint" && use64bitint='define' | |
d0a4cc40 | 33 | test -z "$useithreads" && useithreads='define' |
fd998cbf | 34 | ccflags="$ccflags -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE" |
7c65b8e2 RU |
35 | # - otherwise i686-cygwin |
36 | archname='cygwin' | |
4fabb596 GS |
37 | |
38 | # dynamic loading | |
4fabb596 GS |
39 | # - otherwise -fpic |
40 | cccdlflags=' ' | |
4f3b19ea | 41 | lddlflags=' --shared' |
2653dd3c | 42 | test -z "$ld" && ld='g++' |
d702ae42 | 43 | |
ab9778ab | 44 | case "$osvers" in |
2653dd3c RU |
45 | # Configure gets these wrong if the IPC server isn't yet running: |
46 | # only use for 1.5.7 and onwards | |
47 | [2-9]*|1.[6-9]*|1.[1-5][0-9]*|1.5.[7-9]*|1.5.[1-6][0-9]*) | |
ab9778ab YST |
48 | d_semctl_semid_ds='define' |
49 | d_semctl_semun='define' | |
50 | ;; | |
2653dd3c RU |
51 | esac |
52 | ||
53 | case "$osvers" in | |
54 | [2-9]*|1.[6-9]*) | |
55 | # IPv6 only since 1.7 | |
56 | d_inetntop='define' | |
57 | d_inetpton='define' | |
58 | ;; | |
59 | *) | |
60 | # IPv6 not implemented before cygwin-1.7 | |
61 | d_inetntop='undef' | |
62 | d_inetpton='undef' | |
63 | esac | |
ab9778ab | 64 | |
13432c88 RU |
65 | # compile Win32CORE "module" as static. try to avoid the space. |
66 | if test -z "$static_ext"; then | |
67 | static_ext="Win32CORE" | |
68 | else | |
69 | static_ext="$static_ext Win32CORE" | |
70 | fi | |
78ff2d7b | 71 | |
5db16f6a EF |
72 | # Win9x problem with non-blocking read from a closed pipe |
73 | d_eofnblk='define' | |
74 | ||
1867a6a3 | 75 | # suppress auto-import warnings |
c0a149a9 | 76 | ldflags="$ldflags -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base" |
4f3b19ea | 77 | lddlflags="$lddlflags $ldflags" |
1867a6a3 | 78 | |
13432c88 | 79 | # strip exe's and dll's, better do it afterwards |
d702ae42 | 80 | #ldflags="$ldflags -s" |
13432c88 | 81 | #ccdlflags="$ccdlflags -s" |
d702ae42 | 82 | #lddlflags="$lddlflags -s" |