equal
deleted
inserted
replaced
128 # How to compile shared libraries. |
128 # How to compile shared libraries. |
129 # |
129 # |
130 |
130 |
131 if test "x$TOOLCHAIN_TYPE" = xgcc; then |
131 if test "x$TOOLCHAIN_TYPE" = xgcc; then |
132 PICFLAG="-fPIC" |
132 PICFLAG="-fPIC" |
|
133 C_FLAG_REORDER='' |
|
134 CXX_FLAG_REORDER='' |
|
135 |
|
136 if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
137 # Linking is different on MacOSX |
|
138 SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" |
|
139 SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' |
|
140 SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" |
|
141 SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1' |
|
142 SET_SHARED_LIBRARY_MAPFILE='' |
|
143 else |
|
144 # Default works for linux, might work on other platforms as well. |
|
145 SHARED_LIBRARY_FLAGS='-shared' |
|
146 SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1' |
|
147 SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN" |
|
148 SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1' |
|
149 SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1' |
|
150 fi |
|
151 elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
152 PICFLAG='' |
133 C_FLAG_REORDER='' |
153 C_FLAG_REORDER='' |
134 CXX_FLAG_REORDER='' |
154 CXX_FLAG_REORDER='' |
135 |
155 |
136 if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
156 if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
137 # Linking is different on MacOSX |
157 # Linking is different on MacOSX |
240 # fi |
260 # fi |
241 |
261 |
242 # Generate make dependency files |
262 # Generate make dependency files |
243 if test "x$TOOLCHAIN_TYPE" = xgcc; then |
263 if test "x$TOOLCHAIN_TYPE" = xgcc; then |
244 C_FLAG_DEPS="-MMD -MF" |
264 C_FLAG_DEPS="-MMD -MF" |
|
265 elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
266 C_FLAG_DEPS="-MMD -MF" |
245 elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
267 elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
246 C_FLAG_DEPS="-xMMD -xMF" |
268 C_FLAG_DEPS="-xMMD -xMF" |
247 elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
269 elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
248 C_FLAG_DEPS="-qmakedep=gcc -MF" |
270 C_FLAG_DEPS="-qmakedep=gcc -MF" |
249 fi |
271 fi |
258 CXXFLAGS_DEBUG_SYMBOLS="-g1" |
280 CXXFLAGS_DEBUG_SYMBOLS="-g1" |
259 else |
281 else |
260 CFLAGS_DEBUG_SYMBOLS="-g" |
282 CFLAGS_DEBUG_SYMBOLS="-g" |
261 CXXFLAGS_DEBUG_SYMBOLS="-g" |
283 CXXFLAGS_DEBUG_SYMBOLS="-g" |
262 fi |
284 fi |
|
285 elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
286 CFLAGS_DEBUG_SYMBOLS="-g" |
|
287 CXXFLAGS_DEBUG_SYMBOLS="-g" |
263 elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
288 elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
264 CFLAGS_DEBUG_SYMBOLS="-g -xs" |
289 CFLAGS_DEBUG_SYMBOLS="-g -xs" |
265 CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" |
290 CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" |
266 elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
291 elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
267 CFLAGS_DEBUG_SYMBOLS="-g" |
292 CFLAGS_DEBUG_SYMBOLS="-g" |
300 fi |
325 fi |
301 else |
326 else |
302 # The remaining toolchains share opt flags between CC and CXX; |
327 # The remaining toolchains share opt flags between CC and CXX; |
303 # setup for C and duplicate afterwards. |
328 # setup for C and duplicate afterwards. |
304 if test "x$TOOLCHAIN_TYPE" = xgcc; then |
329 if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
330 if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
331 # On MacOSX we optimize for size, something |
|
332 # we should do for all platforms? |
|
333 C_O_FLAG_HIGHEST="-Os" |
|
334 C_O_FLAG_HI="-Os" |
|
335 C_O_FLAG_NORM="-Os" |
|
336 C_O_FLAG_NONE="" |
|
337 else |
|
338 C_O_FLAG_HIGHEST="-O3" |
|
339 C_O_FLAG_HI="-O3" |
|
340 C_O_FLAG_NORM="-O2" |
|
341 C_O_FLAG_NONE="-O0" |
|
342 fi |
|
343 elif test "x$TOOLCHAIN_TYPE" = xclang; then |
305 if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
344 if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
306 # On MacOSX we optimize for size, something |
345 # On MacOSX we optimize for size, something |
307 # we should do for all platforms? |
346 # we should do for all platforms? |
308 C_O_FLAG_HIGHEST="-Os" |
347 C_O_FLAG_HIGHEST="-Os" |
309 C_O_FLAG_HI="-Os" |
348 C_O_FLAG_HI="-Os" |