Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2473cb9

Browse files
committed
autoconf: Rely on ar supporting index creation
This way we don't need RANLIB anymore, making it a bit simpler for the meson build to generate Makefile.global for PGXS compatibility. FreeBSD, NetBSD, OpenBSD, the only platforms where we didn't use AROPT=crs, all have supported the 's' option for a long time. On macOS we ran ranlib after installing a static library. This was added a long time ago, in 58ad65e. I cannot reproduce an issue in more recent macOS versions. This is removed now. Based on discussion with Tom, I left the 'touch' at the end of static libraries generation, added in 826eff5, in place. While it looks like current versions of Apple's ar/ranlib don't need it, it was needed not too long ago. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/20221005200710.luvw5evhwf6clig6@awork3.anarazel.de
1 parent 614a406 commit 2473cb9

13 files changed

+2
-120
lines changed

configure

-93
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,6 @@ AR
692692
STRIP_SHARED_LIB
693693
STRIP_STATIC_LIB
694694
STRIP
695-
RANLIB
696695
with_gnu_ld
697696
LD
698697
LDFLAGS_SL
@@ -9557,98 +9556,6 @@ with_gnu_ld=$ac_cv_prog_gnu_ld
95579556

95589557

95599558

9560-
if test -n "$ac_tool_prefix"; then
9561-
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
9562-
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
9563-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9564-
$as_echo_n "checking for $ac_word... " >&6; }
9565-
if ${ac_cv_prog_RANLIB+:} false; then :
9566-
$as_echo_n "(cached) " >&6
9567-
else
9568-
if test -n "$RANLIB"; then
9569-
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
9570-
else
9571-
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9572-
for as_dir in $PATH
9573-
do
9574-
IFS=$as_save_IFS
9575-
test -z "$as_dir" && as_dir=.
9576-
for ac_exec_ext in '' $ac_executable_extensions; do
9577-
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9578-
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
9579-
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9580-
break 2
9581-
fi
9582-
done
9583-
done
9584-
IFS=$as_save_IFS
9585-
9586-
fi
9587-
fi
9588-
RANLIB=$ac_cv_prog_RANLIB
9589-
if test -n "$RANLIB"; then
9590-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
9591-
$as_echo "$RANLIB" >&6; }
9592-
else
9593-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9594-
$as_echo "no" >&6; }
9595-
fi
9596-
9597-
9598-
fi
9599-
if test -z "$ac_cv_prog_RANLIB"; then
9600-
ac_ct_RANLIB=$RANLIB
9601-
# Extract the first word of "ranlib", so it can be a program name with args.
9602-
set dummy ranlib; ac_word=$2
9603-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9604-
$as_echo_n "checking for $ac_word... " >&6; }
9605-
if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
9606-
$as_echo_n "(cached) " >&6
9607-
else
9608-
if test -n "$ac_ct_RANLIB"; then
9609-
ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
9610-
else
9611-
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9612-
for as_dir in $PATH
9613-
do
9614-
IFS=$as_save_IFS
9615-
test -z "$as_dir" && as_dir=.
9616-
for ac_exec_ext in '' $ac_executable_extensions; do
9617-
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9618-
ac_cv_prog_ac_ct_RANLIB="ranlib"
9619-
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9620-
break 2
9621-
fi
9622-
done
9623-
done
9624-
IFS=$as_save_IFS
9625-
9626-
fi
9627-
fi
9628-
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
9629-
if test -n "$ac_ct_RANLIB"; then
9630-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
9631-
$as_echo "$ac_ct_RANLIB" >&6; }
9632-
else
9633-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9634-
$as_echo "no" >&6; }
9635-
fi
9636-
9637-
if test "x$ac_ct_RANLIB" = x; then
9638-
RANLIB=":"
9639-
else
9640-
case $cross_compiling:$ac_tool_warned in
9641-
yes:)
9642-
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
9643-
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
9644-
ac_tool_warned=yes ;;
9645-
esac
9646-
RANLIB=$ac_ct_RANLIB
9647-
fi
9648-
else
9649-
RANLIB="$ac_cv_prog_RANLIB"
9650-
fi
9651-
96529559

96539560
if test -n "$ac_tool_prefix"; then
96549561
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.

configure.ac

-1
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,6 @@ AC_ARG_VAR(LDFLAGS_SL, [extra linker flags for linking shared libraries only])
11311131
PGAC_PROG_LD
11321132
AC_SUBST(LD)
11331133
AC_SUBST(with_gnu_ld)
1134-
AC_PROG_RANLIB
11351134
PGAC_CHECK_STRIP
11361135
AC_CHECK_TOOL(AR, ar, ar)
11371136
if test "$PORTNAME" = "win32"; then

src/Makefile.global.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ ZIC = @ZIC@
284284
# Linking
285285

286286
AR = @AR@
287+
AROPT = crs
287288
LIBS = @LIBS@
288289
LDAP_LIBS_FE = @LDAP_LIBS_FE@
289290
LDAP_LIBS_BE = @LDAP_LIBS_BE@
@@ -318,7 +319,6 @@ LDFLAGS_EX = @LDFLAGS_EX@
318319
LDFLAGS_SL += @LDFLAGS_SL@
319320
LDREL = -r
320321
LDOUT = -o
321-
RANLIB = @RANLIB@
322322
WINDRES = @WINDRES@
323323
X = @EXEEXT@
324324

src/Makefile.shlib

+1-6
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,14 @@ all-static-lib: $(stlib)
252252
all-shared-lib: $(shlib)
253253

254254
# In this rule, "touch $@" works around a problem on some platforms wherein
255-
# ranlib updates the library file's mod time with a value calculated to
255+
# ar updates the library file's mod time with a value calculated to
256256
# seconds precision. If the filesystem has sub-second timestamps, this can
257257
# cause the library file to appear older than its input files, triggering
258258
# parallel-make problems.
259259
ifndef haslibarule
260260
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
261261
rm -f $@
262262
$(LINK.static) $@ $^
263-
$(RANLIB) $@
264263
touch $@
265264
endif #haslibarule
266265

@@ -394,10 +393,6 @@ install-lib-pc: lib$(NAME).pc installdirs-lib
394393

395394
install-lib-static: $(stlib) installdirs-lib
396395
$(INSTALL_STLIB) $< '$(DESTDIR)$(libdir)/$(stlib)'
397-
ifeq ($(PORTNAME), darwin)
398-
cd '$(DESTDIR)$(libdir)' && \
399-
$(RANLIB) $(stlib)
400-
endif
401396

402397
install-lib-shared: $(shlib) installdirs-lib
403398
ifdef soname

src/makefiles/Makefile.aix

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
# symbol names to tell them what to export/import.
33
MAKE_EXPORTS= true
44

5-
RANLIB= touch
6-
AROPT = crs
7-
85
# -blibpath must contain ALL directories where we should look for libraries
96
libpath := $(shell echo $(subst -L,:,$(filter -L/%,$(LDFLAGS))) | sed -e's/ //g'):/usr/lib:/lib
107

src/makefiles/Makefile.cygwin

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ endif
1010
# (see http://sources.redhat.com/cygwin/faq/faq.html#SEC110)
1111
LIBS:=$(filter-out -lm -lc, $(LIBS))
1212

13-
AROPT = crs
14-
1513
override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT)
1614

1715
ifneq (,$(findstring backend,$(subdir)))

src/makefiles/Makefile.darwin

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
AROPT = crs
2-
31
# env var name to use in place of LD_LIBRARY_PATH
42
ld_library_path_var = DYLD_LIBRARY_PATH
53

src/makefiles/Makefile.freebsd

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
AROPT = cr
2-
31
export_dynamic = -Wl,-export-dynamic
42
rpath = -Wl,-R'$(rpathdir)'
53

src/makefiles/Makefile.linux

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
AROPT = crs
2-
31
export_dynamic = -Wl,-E
42
# Use --enable-new-dtags to generate DT_RUNPATH instead of DT_RPATH.
53
# This allows LD_LIBRARY_PATH to still work when needed.

src/makefiles/Makefile.netbsd

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
AROPT = cr
2-
31
export_dynamic = -Wl,-E
42
rpath = -Wl,-R'$(rpathdir)'
53

src/makefiles/Makefile.openbsd

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
AROPT = cr
2-
31
export_dynamic = -Wl,-E
42
rpath = -Wl,-R'$(rpathdir)'
53

src/makefiles/Makefile.solaris

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# src/makefiles/Makefile.solaris
2-
3-
AROPT = crs
42
rpath = -Wl,-rpath,'$(rpathdir)'
53

64
ifeq ($(with_gnu_ld), yes)

src/makefiles/Makefile.win32

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ endif
1010

1111
override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT)
1212

13-
AROPT = crs
14-
1513
ifneq (,$(findstring backend,$(subdir)))
1614
ifeq (,$(findstring conversion_procs,$(subdir)))
1715
ifeq (,$(findstring libpqwalreceiver,$(subdir)))

0 commit comments

Comments
 (0)