From: Peter Eisentraut Date: Mon, 1 Jul 2019 22:46:24 +0000 (+0100) Subject: Remove support for non-ELF BSD systems X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c72f9b9502eadb6b84c6681cdb3bff12b35d3c8a;p=postgresql Remove support for non-ELF BSD systems This is long obsolete. Discussion: https://www.postgresql.org/message-id/8eacdc0d-123f-dbca-bacf-0a68766a4889@2ndquadrant.com --- diff --git a/configure b/configure index cb3c3ae608..7a6bfc2339 100755 --- a/configure +++ b/configure @@ -658,6 +658,8 @@ PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC ax_pthread_config +EGREP +GREP SED ZIC python_additional_libs @@ -697,9 +699,6 @@ with_gnu_ld LD LDFLAGS_SL LDFLAGS_EX -ELF_SYS -EGREP -GREP with_zlib with_system_tzdata with_libxslt @@ -8306,169 +8305,6 @@ fi -# -# Elf -# - -# Assume system is ELF if it predefines __ELF__ as 1, -# otherwise believe host_os based default. -case $host_os in - freebsd1*|freebsd2*) elf=no;; - freebsd3*|freebsd4*) elf=yes;; -esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if __ELF__ - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - ELF_SYS=true -else - if test "X$elf" = "Xyes" ; then - ELF_SYS=true -else - ELF_SYS= -fi -fi -rm -f conftest* - - - # # Assignments # @@ -10055,6 +9891,137 @@ $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : diff --git a/configure.in b/configure.in index ff8e6c9b78..dde3eec89f 100644 --- a/configure.in +++ b/configure.in @@ -964,30 +964,6 @@ PGAC_ARG_BOOL(with, zlib, yes, [do not use Zlib]) AC_SUBST(with_zlib) -# -# Elf -# - -# Assume system is ELF if it predefines __ELF__ as 1, -# otherwise believe host_os based default. -case $host_os in - freebsd1*|freebsd2*) elf=no;; - freebsd3*|freebsd4*) elf=yes;; -esac - -AC_EGREP_CPP(yes, -[#if __ELF__ - yes -#endif -], -[ELF_SYS=true], -[if test "X$elf" = "Xyes" ; then - ELF_SYS=true -else - ELF_SYS= -fi]) -AC_SUBST(ELF_SYS) - # # Assignments # diff --git a/src/Makefile.global.in b/src/Makefile.global.in index b9d86acaa9..321af38b0c 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -506,10 +506,6 @@ host_tuple = @host@ host_os = @host_os@ host_cpu = @host_cpu@ -# This is mainly for use on FreeBSD, where we have both a.out and elf -# systems now. May be applicable to other systems to? -ELF_SYSTEM= @ELF_SYS@ - # Backend stack size limit has to be hard-wired on Windows (it's in bytes) WIN32_STACK_RLIMIT=4194304 diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 373d73caef..c4893edfc3 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib @@ -139,57 +139,42 @@ ifeq ($(PORTNAME), darwin) endif ifeq ($(PORTNAME), openbsd) - ifdef ELF_SYSTEM - LINK.shared = $(COMPILER) -shared - ifdef soname - LINK.shared += -Wl,-x,-soname,$(soname) - endif - BUILD.exports = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@ - exports_file = $(SHLIB_EXPORTS:%.txt=%.list) - ifneq (,$(exports_file)) - LINK.shared += -Wl,--version-script=$(exports_file) - endif - SHLIB_LINK += -lc - else - LINK.shared = $(LD) -x -Bshareable -Bforcearchive + LINK.shared = $(COMPILER) -shared + ifdef soname + LINK.shared += -Wl,-x,-soname,$(soname) endif + BUILD.exports = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@ + exports_file = $(SHLIB_EXPORTS:%.txt=%.list) + ifneq (,$(exports_file)) + LINK.shared += -Wl,--version-script=$(exports_file) + endif + SHLIB_LINK += -lc endif ifeq ($(PORTNAME), freebsd) - ifdef ELF_SYSTEM - ifdef SO_MAJOR_VERSION - shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) - endif - LINK.shared = $(COMPILER) -shared - ifdef soname - LINK.shared += -Wl,-x,-soname,$(soname) - endif - BUILD.exports = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@ - exports_file = $(SHLIB_EXPORTS:%.txt=%.list) - ifneq (,$(exports_file)) - LINK.shared += -Wl,--version-script=$(exports_file) - endif - else - ifdef SO_MAJOR_VERSION - shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) - endif - LINK.shared = $(LD) -x -Bshareable -Bforcearchive + ifdef SO_MAJOR_VERSION + shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) + endif + LINK.shared = $(COMPILER) -shared + ifdef soname + LINK.shared += -Wl,-x,-soname,$(soname) + endif + BUILD.exports = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@ + exports_file = $(SHLIB_EXPORTS:%.txt=%.list) + ifneq (,$(exports_file)) + LINK.shared += -Wl,--version-script=$(exports_file) endif endif ifeq ($(PORTNAME), netbsd) - ifdef ELF_SYSTEM - LINK.shared = $(COMPILER) -shared - ifdef soname - LINK.shared += -Wl,-x,-soname,$(soname) - endif - BUILD.exports = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@ - exports_file = $(SHLIB_EXPORTS:%.txt=%.list) - ifneq (,$(exports_file)) - LINK.shared += -Wl,--version-script=$(exports_file) - endif - else - LINK.shared = $(LD) -x -Bshareable -Bforcearchive + LINK.shared = $(COMPILER) -shared + ifdef soname + LINK.shared += -Wl,-x,-soname,$(soname) + endif + BUILD.exports = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@ + exports_file = $(SHLIB_EXPORTS:%.txt=%.list) + ifneq (,$(exports_file)) + LINK.shared += -Wl,--version-script=$(exports_file) endif endif diff --git a/src/makefiles/Makefile.freebsd b/src/makefiles/Makefile.freebsd index 98a6f50615..c462e2fd58 100644 --- a/src/makefiles/Makefile.freebsd +++ b/src/makefiles/Makefile.freebsd @@ -1,9 +1,7 @@ AROPT = cr -ifdef ELF_SYSTEM export_dynamic = -Wl,-export-dynamic rpath = -Wl,-R'$(rpathdir)' -endif DLSUFFIX = .so @@ -20,14 +18,4 @@ endef # Rule for building a shared library from a single .o file %.so: %.o -ifdef ELF_SYSTEM $(CC) $(CFLAGS) $< $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ -else - $(LD) $(LDREL) $(LDOUT) $<.obj -x $< - @echo building shared object $@ - @rm -f $@.pic - @${AR} cq $@.pic $<.obj - ${RANLIB} $@.pic - @rm -f $@ - $(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic -endif diff --git a/src/makefiles/Makefile.netbsd b/src/makefiles/Makefile.netbsd index 7bb9721fa5..15695fb65c 100644 --- a/src/makefiles/Makefile.netbsd +++ b/src/makefiles/Makefile.netbsd @@ -1,11 +1,7 @@ AROPT = cr -ifdef ELF_SYSTEM export_dynamic = -Wl,-E rpath = -Wl,-R'$(rpathdir)' -else -rpath = -Wl,-R'$(rpathdir)' -endif DLSUFFIX = .so @@ -14,14 +10,4 @@ CFLAGS_SL = -fPIC -DPIC # Rule for building a shared library from a single .o file %.so: %.o -ifdef ELF_SYSTEM $(CC) $(CFLAGS) $< $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ -else - $(LD) $(LDREL) $(LDOUT) $<.obj -x $< - @echo building shared object $@ - @rm -f $@.pic - @${AR} cq $@.pic $<.obj - ${RANLIB} $@.pic - @rm -f $@ - $(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic -endif diff --git a/src/makefiles/Makefile.openbsd b/src/makefiles/Makefile.openbsd index eda311087c..15695fb65c 100644 --- a/src/makefiles/Makefile.openbsd +++ b/src/makefiles/Makefile.openbsd @@ -1,9 +1,7 @@ AROPT = cr -ifdef ELF_SYSTEM export_dynamic = -Wl,-E rpath = -Wl,-R'$(rpathdir)' -endif DLSUFFIX = .so @@ -12,14 +10,4 @@ CFLAGS_SL = -fPIC -DPIC # Rule for building a shared library from a single .o file %.so: %.o -ifdef ELF_SYSTEM $(CC) $(CFLAGS) $< $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ -else - $(LD) $(LDREL) $(LDOUT) $<.obj -x $< - @echo building shared object $@ - @rm -f $@.pic - @${AR} cq $@.pic $<.obj - ${RANLIB} $@.pic - @rm -f $@ - $(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic -endif