Skip to content

Commit 9db49fc

Browse files
committed
autoconf: Move export_dynamic determination to configure
Previously export_dynamic was set in src/makefiles/Makefile.$port. For solaris this required exporting with_gnu_ld. The determination of with_gnu_ld would be nontrivial to copy for meson PGXS compatibility. It's also nice to delete libtool.m4. This uses -Wl,--export-dynamic on all platforms, previously all platforms but FreeBSD used -Wl,-E. The likelihood of a name conflict seems lower with the longer spelling. Discussion: https://postgr.es/m/[email protected]
1 parent 8018ffb commit 9db49fc

12 files changed

+108
-276
lines changed

aclocal.m4

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ m4_include([config/c-compiler.m4])
44
m4_include([config/c-library.m4])
55
m4_include([config/check_decls.m4])
66
m4_include([config/general.m4])
7-
m4_include([config/libtool.m4])
87
m4_include([config/llvm.m4])
98
m4_include([config/perl.m4])
109
m4_include([config/pkg.m4])

config/c-compiler.m4

+17-8
Original file line numberDiff line numberDiff line change
@@ -468,29 +468,38 @@ AC_DEFUN([PGAC_PROG_CXX_CFLAGS_OPT],
468468

469469

470470

471-
# PGAC_PROG_CC_LDFLAGS_OPT
471+
# PGAC_PROG_CC_LD_VARFLAGS_OPT
472472
# ------------------------
473473
# Given a string, check if the compiler supports the string as a
474-
# command-line option. If it does, add the string to LDFLAGS.
474+
# command-line option. If it does, add to the given variable.
475475
# For reasons you'd really rather not know about, this checks whether
476476
# you can link to a particular function, not just whether you can link.
477477
# In fact, we must actually check that the resulting program runs :-(
478-
AC_DEFUN([PGAC_PROG_CC_LDFLAGS_OPT],
479-
[define([Ac_cachevar], [AS_TR_SH([pgac_cv_prog_cc_ldflags_$1])])dnl
480-
AC_CACHE_CHECK([whether $CC supports $1], [Ac_cachevar],
478+
AC_DEFUN([PGAC_PROG_CC_LD_VARFLAGS_OPT],
479+
[define([Ac_cachevar], [AS_TR_SH([pgac_cv_prog_cc_$1_$2])])dnl
480+
AC_CACHE_CHECK([whether $CC supports $2, for $1], [Ac_cachevar],
481481
[pgac_save_LDFLAGS=$LDFLAGS
482-
LDFLAGS="$pgac_save_LDFLAGS $1"
483-
AC_RUN_IFELSE([AC_LANG_PROGRAM([extern void $2 (); void (*fptr) () = $2;],[])],
482+
LDFLAGS="$pgac_save_LDFLAGS $2"
483+
AC_RUN_IFELSE([AC_LANG_PROGRAM([extern void $3 (); void (*fptr) () = $3;],[])],
484484
[Ac_cachevar=yes],
485485
[Ac_cachevar=no],
486486
[Ac_cachevar="assuming no"])
487487
LDFLAGS="$pgac_save_LDFLAGS"])
488488
if test x"$Ac_cachevar" = x"yes"; then
489-
LDFLAGS="$LDFLAGS $1"
489+
$1="${$1} $2"
490490
fi
491491
undefine([Ac_cachevar])dnl
492+
])# PGAC_PROG_CC_LD_VARFLAGS_OPT
493+
494+
# PGAC_PROG_CC_LDFLAGS_OPT
495+
# ------------------------
496+
# Convenience wrapper around PGAC_PROG_CC_LD_VARFLAGS_OPT that adds to
497+
# LDFLAGS.
498+
AC_DEFUN([PGAC_PROG_CC_LDFLAGS_OPT],
499+
[PGAC_PROG_CC_LD_VARFLAGS_OPT(LDFLAGS, [$1], [$2])
492500
])# PGAC_PROG_CC_LDFLAGS_OPT
493501

502+
494503
# PGAC_HAVE_GCC__SYNC_CHAR_TAS
495504
# ----------------------------
496505
# Check if the C compiler understands __sync_lock_test_and_set(char),

config/libtool.m4

-119
This file was deleted.

0 commit comments

Comments
 (0)