27136
# If compiler will take -Wl,--as-needed then add that to LDFLAGS.
27137
# This is much easier than trying to filter LIBS to the minimum for each
27138
# executable. (Note that shared library links won't use this switch, though.)
27136
# If compiler will take -Wl,--as-needed (or various platform-specific
27137
# spellings thereof) then add that to LDFLAGS. This is much easier than
27138
# trying to filter LIBS to the minimum for each executable.
27139
# (Note that shared library links won't use this switch, though.)
27139
27140
# On (at least) some Red-Hat-derived systems, this switch breaks linking to
27140
27141
# libreadline; therefore we postpone testing it until we know what library
27141
27142
# dependencies readline has. The test code will try to link with $LIBS.
27145
27146
link_test_func=exit
27147
if test "$PORTNAME" != "darwin"; then
27149
if test "$PORTNAME" = "darwin"; then
27150
{ echo "$as_me:$LINENO: checking if $CC supports -Wl,-dead_strip_dylibs" >&5
27151
echo $ECHO_N "checking if $CC supports -Wl,-dead_strip_dylibs... $ECHO_C" >&6; }
27152
pgac_save_LDFLAGS=$LDFLAGS
27153
LDFLAGS="$pgac_save_LDFLAGS -Wl,-dead_strip_dylibs"
27154
if test "$cross_compiling" = yes; then
27155
LDFLAGS="$pgac_save_LDFLAGS"
27156
{ echo "$as_me:$LINENO: result: assuming no" >&5
27157
echo "${ECHO_T}assuming no" >&6; }
27159
cat >conftest.$ac_ext <<_ACEOF
27162
cat confdefs.h >>conftest.$ac_ext
27163
cat >>conftest.$ac_ext <<_ACEOF
27164
/* end confdefs.h. */
27165
extern void $link_test_func (); void (*fptr) () = $link_test_func;
27174
rm -f conftest$ac_exeext
27175
if { (ac_try="$ac_link"
27176
case "(($ac_try" in
27177
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27178
*) ac_try_echo=$ac_try;;
27180
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
27181
(eval "$ac_link") 2>&5
27183
echo "$as_me:$LINENO: \$? = $ac_status" >&5
27184
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
27185
{ (case "(($ac_try" in
27186
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27187
*) ac_try_echo=$ac_try;;
27189
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
27190
(eval "$ac_try") 2>&5
27192
echo "$as_me:$LINENO: \$? = $ac_status" >&5
27193
(exit $ac_status); }; }; then
27194
{ echo "$as_me:$LINENO: result: yes" >&5
27195
echo "${ECHO_T}yes" >&6; }
27197
echo "$as_me: program exited with status $ac_status" >&5
27198
echo "$as_me: failed program was:" >&5
27199
sed 's/^/| /' conftest.$ac_ext >&5
27201
( exit $ac_status )
27202
LDFLAGS="$pgac_save_LDFLAGS"
27203
{ echo "$as_me:$LINENO: result: no" >&5
27204
echo "${ECHO_T}no" >&6; }
27206
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
27211
elif test "$PORTNAME" = "openbsd"; then
27212
{ echo "$as_me:$LINENO: checking if $CC supports -Wl,-Bdynamic" >&5
27213
echo $ECHO_N "checking if $CC supports -Wl,-Bdynamic... $ECHO_C" >&6; }
27214
pgac_save_LDFLAGS=$LDFLAGS
27215
LDFLAGS="$pgac_save_LDFLAGS -Wl,-Bdynamic"
27216
if test "$cross_compiling" = yes; then
27217
LDFLAGS="$pgac_save_LDFLAGS"
27218
{ echo "$as_me:$LINENO: result: assuming no" >&5
27219
echo "${ECHO_T}assuming no" >&6; }
27221
cat >conftest.$ac_ext <<_ACEOF
27224
cat confdefs.h >>conftest.$ac_ext
27225
cat >>conftest.$ac_ext <<_ACEOF
27226
/* end confdefs.h. */
27227
extern void $link_test_func (); void (*fptr) () = $link_test_func;
27236
rm -f conftest$ac_exeext
27237
if { (ac_try="$ac_link"
27238
case "(($ac_try" in
27239
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27240
*) ac_try_echo=$ac_try;;
27242
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
27243
(eval "$ac_link") 2>&5
27245
echo "$as_me:$LINENO: \$? = $ac_status" >&5
27246
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
27247
{ (case "(($ac_try" in
27248
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27249
*) ac_try_echo=$ac_try;;
27251
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
27252
(eval "$ac_try") 2>&5
27254
echo "$as_me:$LINENO: \$? = $ac_status" >&5
27255
(exit $ac_status); }; }; then
27256
{ echo "$as_me:$LINENO: result: yes" >&5
27257
echo "${ECHO_T}yes" >&6; }
27259
echo "$as_me: program exited with status $ac_status" >&5
27260
echo "$as_me: failed program was:" >&5
27261
sed 's/^/| /' conftest.$ac_ext >&5
27263
( exit $ac_status )
27264
LDFLAGS="$pgac_save_LDFLAGS"
27265
{ echo "$as_me:$LINENO: result: no" >&5
27266
echo "${ECHO_T}no" >&6; }
27268
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
27148
27274
{ echo "$as_me:$LINENO: checking if $CC supports -Wl,--as-needed" >&5
27149
27275
echo $ECHO_N "checking if $CC supports -Wl,--as-needed... $ECHO_C" >&6; }
27150
27276
pgac_save_LDFLAGS=$LDFLAGS
27210
# On Darwin it's spelled -Wl,-dead_strip_dylibs, but don't try that elsewhere
27211
{ echo "$as_me:$LINENO: checking if $CC supports -Wl,-dead_strip_dylibs" >&5
27212
echo $ECHO_N "checking if $CC supports -Wl,-dead_strip_dylibs... $ECHO_C" >&6; }
27213
pgac_save_LDFLAGS=$LDFLAGS
27214
LDFLAGS="$pgac_save_LDFLAGS -Wl,-dead_strip_dylibs"
27215
if test "$cross_compiling" = yes; then
27216
LDFLAGS="$pgac_save_LDFLAGS"
27217
{ echo "$as_me:$LINENO: result: assuming no" >&5
27218
echo "${ECHO_T}assuming no" >&6; }
27220
cat >conftest.$ac_ext <<_ACEOF
27223
cat confdefs.h >>conftest.$ac_ext
27224
cat >>conftest.$ac_ext <<_ACEOF
27225
/* end confdefs.h. */
27226
extern void $link_test_func (); void (*fptr) () = $link_test_func;
27235
rm -f conftest$ac_exeext
27236
if { (ac_try="$ac_link"
27237
case "(($ac_try" in
27238
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27239
*) ac_try_echo=$ac_try;;
27241
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
27242
(eval "$ac_link") 2>&5
27244
echo "$as_me:$LINENO: \$? = $ac_status" >&5
27245
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
27246
{ (case "(($ac_try" in
27247
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27248
*) ac_try_echo=$ac_try;;
27250
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
27251
(eval "$ac_try") 2>&5
27253
echo "$as_me:$LINENO: \$? = $ac_status" >&5
27254
(exit $ac_status); }; }; then
27255
{ echo "$as_me:$LINENO: result: yes" >&5
27256
echo "${ECHO_T}yes" >&6; }
27258
echo "$as_me: program exited with status $ac_status" >&5
27259
echo "$as_me: failed program was:" >&5
27260
sed 's/^/| /' conftest.$ac_ext >&5
27262
( exit $ac_status )
27263
LDFLAGS="$pgac_save_LDFLAGS"
27264
{ echo "$as_me:$LINENO: result: no" >&5
27265
echo "${ECHO_T}no" >&6; }
27267
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext