annotate configure @ 326:09aaa2e774cd

- configure: * allow --target="macos" as alias for "MacOSX" or "Darwin" in configure * typo
author Tassilo Philipp
date Fri, 22 Nov 2019 23:03:01 +0100
parents d2c8ea3ef2ed
children fe31a2e3ac90
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
1 #!/bin/sh
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
2
256
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
3 usage() {
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
4 cat <<EOF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
5 usage: $0 --<option>=<value> <var>=<value> ..
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
7 --prefix=<dir>
326
09aaa2e774cd - configure:
Tassilo Philipp
parents: 307
diff changeset
8 --target=<platform> uname/special targets: macos,iOS,iPhoneSimulator
30
c16bc7736bb4 - added configure (only sh-version) option to display list of settable targets
cslag
parents: 5
diff changeset
9 use "?" to get a list of explicitly specifiable
c16bc7736bb4 - added configure (only sh-version) option to display list of settable targets
cslag
parents: 5
diff changeset
10 targets
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
11 --sdk=<version> Mac OS X/iOS SDK version (e.g. '6.1' or '10.9.3')
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
12 Tested iOS SDK versions: 4.3, 6.1, 8.1
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
13 --sdkroot=<dir>
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
14
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
15 Useful variables CC, CXX, CFLAGS, CXXFLAGS, etc..
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
16
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
17 EOF
256
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
18 }
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
19
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
20 C=Makefile.config
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
21
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
22 # get full path to this file (portable way), and set where to build
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
23 SRCTOP="`cd \`dirname "$0"\` && pwd`"
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
24 BLDTOP="$PWD"
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
25
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
26
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
27 printf "# auto-generated by $0\n" >$C
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
28
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
29 while [ $# -gt 0 ]; do
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
30 X=$1
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
31 shift 1
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
32 case $X in
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
33 # Shell common:
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
34 --help|-h|-?)
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
35 usage
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
36 exit 1
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
37 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
38 # GNU Compatibility:
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
39 --prefix=*)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
40 PREFIX=`printf -- "${X}" | cut -c 10-`
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
41 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
42 --target=*)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
43 TARGET=`printf -- "${X}" | cut -c 10-`
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
44 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
45 --sdk=*)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
46 SDK=`printf -- "${X}" | cut -c 7-`
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
47 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
48 --sdkroot=*)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
49 SDKROOT=`printf -- "${X}" | cut -c 11-`
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
50 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
51 # Environment variables:
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
52 [A-Za-z_]*=*)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
53 printf "${X}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
54 k=`printf "${X}" | cut -d = -f 1`
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
55 v=`printf "${X}" | cut -d = -f 2`
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
56 export $k="$v"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
57 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
58 # Others fail:
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
59 *)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
60 printf "error: invalid option ${X}\n" >&2
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
61 exit 1
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
62 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
63 esac
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
64 done
256
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
65
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
66 printf "PREFIX=${PREFIX:=/usr/local}\n" >>$C
256
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
67
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
68 case ${TARGET:=`uname`} in
253
5cfe4322c500 - improved support for older OS versions for dynloads dlGetLibraryPath
Tassilo Philipp
parents: 222
diff changeset
69 Linux|GNU/kFreeBSD)
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
70 if [ -z "${CFLAGS}" ]; then
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
71 printf "CFLAGS=-fPIC\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
72 fi
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
73 printf "LDLIBS=-lm -ldl\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
74 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
75 OpenBSD)
253
5cfe4322c500 - improved support for older OS versions for dynloads dlGetLibraryPath
Tassilo Philipp
parents: 222
diff changeset
76 if [ -z "${CFLAGS}" ]; then
5cfe4322c500 - improved support for older OS versions for dynloads dlGetLibraryPath
Tassilo Philipp
parents: 222
diff changeset
77 # dl_iterate_phdr() got introduced in 3.7, so for older versions force DL_DLADDR_TO_LIBPATH
5cfe4322c500 - improved support for older OS versions for dynloads dlGetLibraryPath
Tassilo Philipp
parents: 222
diff changeset
78 if (uname -r | grep '^\([0-2]\.\|3\.[0-6]\)' > /dev/null); then
5cfe4322c500 - improved support for older OS versions for dynloads dlGetLibraryPath
Tassilo Philipp
parents: 222
diff changeset
79 printf "CFLAGS=-fPIC -DDL_DLADDR_TO_LIBPATH\n" >>$C
5cfe4322c500 - improved support for older OS versions for dynloads dlGetLibraryPath
Tassilo Philipp
parents: 222
diff changeset
80 else
5cfe4322c500 - improved support for older OS versions for dynloads dlGetLibraryPath
Tassilo Philipp
parents: 222
diff changeset
81 printf "CFLAGS=-fPIC\n" >>$C
5cfe4322c500 - improved support for older OS versions for dynloads dlGetLibraryPath
Tassilo Philipp
parents: 222
diff changeset
82 fi
5cfe4322c500 - improved support for older OS versions for dynloads dlGetLibraryPath
Tassilo Philipp
parents: 222
diff changeset
83 fi
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
84 printf "LDLIBS=-lm\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
85 ;;
253
5cfe4322c500 - improved support for older OS versions for dynloads dlGetLibraryPath
Tassilo Philipp
parents: 222
diff changeset
86 NetBSD|DragonFly)
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
87 if [ -z "${CFLAGS}" ]; then
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
88 printf "CFLAGS=-fPIC\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
89 fi
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
90 printf "LDLIBS=-lm\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
91 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
92 FreeBSD)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
93 if [ -z "${CFLAGS}" ]; then
298
b69f328cdfe6 - simpler ./configure check if freebsd/mips platform is hard-float
Tassilo Philipp
parents: 296
diff changeset
94 if [ `uname -m` = "mips" ] && make -V MACHINE_ARCH | grep 'hf$' >/dev/null 2>&1; then
326
09aaa2e774cd - configure:
Tassilo Philipp
parents: 307
diff changeset
95 # FBSD12-CURRENT/mipshf needs to be told explicitly to use -mhard-float (at least as of may 2018)
296
e6bd998b0308 - FBSD12-CURRENT/mipshf needs to be told explicitly to use -mhard_float (at least as of may 2018)
Tassilo Philipp
parents: 294
diff changeset
96 printf "CFLAGS=-fPIC -mhard-float\n" >>$C
e6bd998b0308 - FBSD12-CURRENT/mipshf needs to be told explicitly to use -mhard_float (at least as of may 2018)
Tassilo Philipp
parents: 294
diff changeset
97 else
e6bd998b0308 - FBSD12-CURRENT/mipshf needs to be told explicitly to use -mhard_float (at least as of may 2018)
Tassilo Philipp
parents: 294
diff changeset
98 printf "CFLAGS=-fPIC\n" >>$C
e6bd998b0308 - FBSD12-CURRENT/mipshf needs to be told explicitly to use -mhard_float (at least as of may 2018)
Tassilo Philipp
parents: 294
diff changeset
99 fi
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
100 fi
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
101 printf "LDLIBS=-lm\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
102 printf "RM=rm -f\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
103 ;;
326
09aaa2e774cd - configure:
Tassilo Philipp
parents: 307
diff changeset
104 MacOSX|macos|Darwin)
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
105 # if Apple's libtool (not to be confused with GNU's) is available, which is according to libtool(1) "with -static [...] intended
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
106 # to replace ar(5) and ranlib", use it - if it is shadowed by some install of GNU's libtool assume that a foreign environment is
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
107 # intentionally used, and fall back to using 'ar rs' (the equivalent to 'libtool -static'), for compatibility:
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
108 if libtool -V >/dev/null 2>/dev/null; then # Apple's libtool has -V for version, which GNU does not.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
109 printf "AR=libtool\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
110 printf "ARFLAGS=-static -o\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
111 else
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
112 printf "AR=ar\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
113 printf "ARFLAGS=rs\n" >>$C # 's' is crucial for universal binary archives
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
114 fi
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
115 if [ `uname -n` = 'iPhone' ]; then # building on iPhone itself, uname yields Darwin (gcc setup for current/correct arch)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
116 printf "CC=gcc\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
117 elif [ -z ${SDK} ]; then
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
118 case `sw_vers -productVersion` in
307
d2c8ea3ef2ed better MacOS Mojave support in ./configure (Mojave dropped i386 builds)
Tassilo Philipp
parents: 298
diff changeset
119 10.4.*) # == tiger (10.4.*)
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
120 ARCHS="-arch ppc -arch i386 -arch x86_64"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
121 ;;
307
d2c8ea3ef2ed better MacOS Mojave support in ./configure (Mojave dropped i386 builds)
Tassilo Philipp
parents: 298
diff changeset
122 10.5.*) # == leopard (10.5.*)
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
123 ARCHS="-arch i386 -arch x86_64 -arch ppc"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
124 ;;
307
d2c8ea3ef2ed better MacOS Mojave support in ./configure (Mojave dropped i386 builds)
Tassilo Philipp
parents: 298
diff changeset
125 10.6.*) # == snow leopard (10.6.*)
d2c8ea3ef2ed better MacOS Mojave support in ./configure (Mojave dropped i386 builds)
Tassilo Philipp
parents: 298
diff changeset
126 ARCHS="-arch i386 -arch x86_64" # no more ppc
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
127 ;;
307
d2c8ea3ef2ed better MacOS Mojave support in ./configure (Mojave dropped i386 builds)
Tassilo Philipp
parents: 298
diff changeset
128 10.[789].*|10.1[0123].*|10.1[0123]) # >= lion (10.7.*), <= high sierra (10.13.*)
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
129 ARCHS="-arch x86_64 -arch i386"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
130 ;;
307
d2c8ea3ef2ed better MacOS Mojave support in ./configure (Mojave dropped i386 builds)
Tassilo Philipp
parents: 298
diff changeset
131 10.1?.*|10.1?) # >= mojave (10.14.*)
d2c8ea3ef2ed better MacOS Mojave support in ./configure (Mojave dropped i386 builds)
Tassilo Philipp
parents: 298
diff changeset
132 ARCHS="-arch x86_64" # mojave is final os to run x86 code, but removed build support for it
d2c8ea3ef2ed better MacOS Mojave support in ./configure (Mojave dropped i386 builds)
Tassilo Philipp
parents: 298
diff changeset
133 ;;
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
134 esac
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
135 printf "ASFLAGS=${ARCHS}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
136 printf "CFLAGS=${ARCHS}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
137 printf "CXXFLAGS=${ARCHS}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
138 else
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
139 if [ -z ${SDKROOT} ]; then
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
140 SDKROOT="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${SDK}.sdk"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
141 fi
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
142 printf "CFLAGS=-isysroot ${SDKROOT}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
143 printf "CXXFLAGS=-isysroot ${SDKROOT}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
144 fi
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
145 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
146 iPhoneOS|iOS)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
147 if [ -z ${SDKROOT} ]; then
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
148 SDKROOT="`xcode-select -print-path`/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDK}.sdk"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
149 fi
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
150 if [ -z "${ARCHS}" ]; then
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
151 case "${SDK}" in
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
152 [45].*)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
153 ARCHS="-arch armv6"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
154 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
155 [67].*)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
156 ARCHS="-arch armv7"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
157 ;;
294
1032015f77ee - ./configure arch detection support for newer iOS SDK versions (10+)
Tassilo Philipp
parents: 267
diff changeset
158 [89].*|1[0-9].*)
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
159 ARCHS="-arch armv7 -arch arm64"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
160 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
161 esac
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
162 fi
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
163 printf "ARFLAGS=rs\n" >>$C # 's' is crucial for universal binary archives
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
164 printf "ASFLAGS=${ARCHS} -isysroot ${SDKROOT}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
165 printf "CFLAGS=${ARCHS} -isysroot ${SDKROOT}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
166 printf "CXXFLAGS=${ARCHS} -isysroot ${SDKROOT}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
167 printf "LDFLAGS=-Wl,-syslibroot ${SDKROOT}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
168 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
169 iPhoneSimulator)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
170 if [ -z ${SDKROOT} ]; then
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
171 SDKROOT="`xcode-select -print-path`/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator${SDK}.sdk"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
172 fi
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
173 ARCHS="-arch i386"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
174 printf "ASFLAGS=${ARCHS} -isysroot ${SDKROOT}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
175 printf "CFLAGS=${ARCHS} -isysroot ${SDKROOT}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
176 printf "CXXFLAGS=${ARCHS} -isysroot ${SDKROOT}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
177 printf "LDFLAGS=-Wl,-syslibroot ${SDKROOT}\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
178 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
179 SunOS)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
180 # open distributions often don't come with default cc and CC, check for common alternatives.
170
ee0de14d5da0 - fixed configure on SunOS
cslag
parents: 66
diff changeset
181 printf "CC=` (which cc gcc clang ) | grep -v '^no ' | head -1`\n" >>$C
ee0de14d5da0 - fixed configure on SunOS
cslag
parents: 66
diff changeset
182 printf "CXX=`(which CC g++ clang++) | grep -v '^no ' | head -1`\n" >>$C # C++ compiler traditionally named CC
ee0de14d5da0 - fixed configure on SunOS
cslag
parents: 66
diff changeset
183 printf "CCC=\${CXX}\n" >>$C # Sun make's rules use CCC for c++ compiler
253
5cfe4322c500 - improved support for older OS versions for dynloads dlGetLibraryPath
Tassilo Philipp
parents: 222
diff changeset
184 printf "LDLIBS=-lm -ldl\n" >>$C
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
185 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
186 Minix)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
187 printf "CC=gcc\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
188 printf "CXX=g++\n">>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
189 printf "AR=ar\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
190 ;;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
191 PSP)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
192 SDKROOT="`psp-config --pspsdk-path`"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
193 printf "CC=psp-gcc\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
194 printf "CXX=psp-gcc\n">>$C # don't use psp-g++, buggy
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
195 printf "AR=psp-ar\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
196 printf "CFLAGS=-I${SDKROOT}/include/\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
197 printf "CXXFLAGS=-I${SDKROOT}/include/\n" >>$C
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
198 # Pulling in dyncall libs below is a hack, for some reason psp-ld is super-picky about order.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
199 # Use your C lib of choice, from the PSPSDK, or...
256
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
200 #printf "LDLIBS=-L${SDKROOT}/lib/ -L${SRCTOP}/dyncall -L${SRCTOP}/dyncallback -ldyncall_s -ldyncallback_s -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lstdc++ -lpsplibc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser \n" >>$C
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
201 # ... newlib.
256
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
202 printf "LDLIBS=-L${SDKROOT}/lib/ -L${SRCTOP}/dyncall -L${SRCTOP}/dyncallback -ldyncall_s -ldyncallback_s -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lstdc++ -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser \n" >>$C
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
203 ;;
30
c16bc7736bb4 - added configure (only sh-version) option to display list of settable targets
cslag
parents: 5
diff changeset
204 ?)
c16bc7736bb4 - added configure (only sh-version) option to display list of settable targets
cslag
parents: 5
diff changeset
205 cat $0 | awk '/^esac$/{b=0}/^ [A-Za-z0-9|]+\)/{if(b==1) print substr($1,1,length($1)-1)}BEGIN{b=0}/^case.*TARGET.*uname.*in$/{b=1}' | tr '|' '\n'
c16bc7736bb4 - added configure (only sh-version) option to display list of settable targets
cslag
parents: 5
diff changeset
206 exit 0
c16bc7736bb4 - added configure (only sh-version) option to display list of settable targets
cslag
parents: 5
diff changeset
207 ;;
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
208 esac
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
209
256
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
210
267
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
211 # removed, b/c platform support not consistent and ELF flags checked often not having any result
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
212 #
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
213 ## Assure objects not asking for an execstack (or binary that links dyncall might end
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
214 ## up with one, for no reason).
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
215 #
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
216 ## .s.o/.S.o rules often use ${CC} which then invokes the tools needed. GCC and
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
217 ## others might (annoyingly) assume that an executable stack may be required for
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
218 ## those sources, if not told explicitly that it isn't.
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
219 ## Neither specifying this per source (e.g. via .section .note.GNU-stack,"",...), nor
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
220 ## per toolchain flags (e.g. as' --noexecstack) turned out to be portable across our
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
221 ## supported platforms, toolchains, and different versions of the latter (some even
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
222 ## producing the opposite result).
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
223 ## Find needed build flags by running a few tests; use default if none result in "rw-".
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
224 #
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
225 #RWXTESTPREFIX="rwxtest" # @@@ put this maybe all in Makefile.generic? out of source builds?
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
226 #for s in S s ; do (
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
227 # cd "$BLDTOP"
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
228 # # asm test file, with main and _main for portability.
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
229 # (echo '.text';(echo '.globl main';echo 'main:') | sed 'p;s/m/_m/') > $RWXTESTPREFIX.$s
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
230 #
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
231 # # Check var to be used, which depends on inference rules of this platform. E.g. ASFLAGS is only common on GNU, and
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
232 # # on some other platforms only CFLAGS is the only one used, others use AFLAGS with cc and thus need -Wa,... Check
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
233 # # makes use of the config written so far, so use '+=' to not overwrite vars.
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
234 # for f in "" "ASFLAGS+=-Wa,--noexecstack" "ACFLAGS+=-Wa,--noexecstack" "AFLAGS+=--noexecstack" "AFLAGS+=-Wa,--noexecstack" "CFLAGS+=-Wa,--noexecstack"; do
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
235 # # dummy makefile triggering inference rules, reflecting dyncall's build
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
236 # make -f - <<MAKEFILE
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
237 #include $C
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
238 #$f
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
239 ## Force dependency via .o, to avoid .[sS].out rules that might be set - also set command as not all platforms set .o.out
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
240 #$RWXTESTPREFIX.out: $RWXTESTPREFIX.o
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
241 # \${CC} \${CFLAGS} \${LDFLAGS} $RWXTESTPREFIX.o \${LDLIBS} -o $RWXTESTPREFIX.out
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
242 #MAKEFILE
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
243 #
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
244 # # Check what stack of a built test binary would result in.
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
245 ## @@@ add xxd hexdump based versions for when objdump is not available; also check for those if we deal with ELF files
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
246 ## @@@ maybe also limit to ELF files
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
247 # STACKFLAGS=`(which objdump && objdump -p $RWXTESTPREFIX.out) | sed -e '/STACK/bx' -e 'd' -e ':x' -e 'N' -e 's/^.*flags[ \t]\([^ \t]*\).*/\1/'`
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
248 # rm $RWXTESTPREFIX.out $RWXTESTPREFIX.o
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
249 # if [ "$STACKFLAGS" = "rw-" ]; then
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
250 # printf "$f\n"
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
251 # break
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
252 # fi
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
253 #
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
254 # done
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
255 #
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
256 # rm $RWXTESTPREFIX.$s
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
257 #
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
258 #) done 2>&1 | grep '^[ASC]\+FLAGS.*noexecstack$' | uniq >>$C
258
943c182692e2 - configure: noexecstack flag check/search now reflecting what dyncall build needs/does
Tassilo Philipp
parents: 257
diff changeset
259
256
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
260
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
261
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
262 # Generate all makefiles needed
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
263
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
264 FILES=`( cd $SRCTOP ; find . -name "Makefile.generic" )`
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
265 for FILE in $FILES ; do
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
266 SRCFILE="$SRCTOP/$FILE"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
267 BLDFILE="$BLDTOP/$FILE"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
268 SRCDIR=`dirname $SRCFILE`
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
269 BLDDIR=`dirname $BLDFILE`
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
270 mkdir -p "$BLDDIR"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
271 cat <<EOF >$BLDDIR/Makefile
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
272 VPATH = $SRCDIR
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
273 include $BLDTOP/Makefile.config
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
274 include \${VPATH}/Makefile.generic
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
275 EOF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
276 done
256
7520e2260097 - added to configure some detection on how to compile .s/.S with --noexecstack (or similar), as compilers' defaults are often insane
Tassilo Philipp
parents: 253
diff changeset
277
267
f8fe0f87b7c1 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c:
Tassilo Philipp
parents: 266
diff changeset
278 echo "Configuration written to $C"
258
943c182692e2 - configure: noexecstack flag check/search now reflecting what dyncall build needs/does
Tassilo Philipp
parents: 257
diff changeset
279