Use autoconf to determine whether system has POSIX signals,

instead of relying on port's os.h to tell us.  (Needed for HPUX
where system major version is not enough info.)
configure unsets USE_TK if X libraries not found.
doc/Makefile uses gzcat or zcat as found by autoconf.
This commit is contained in:
Tom Lane 1998-11-29 05:30:25 +00:00
parent 92eacaf523
commit b10a719777
17 changed files with 435 additions and 359 deletions

View File

@ -8,7 +8,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/doc/Makefile,v 1.11 1998/10/20 23:14:35 momjian Exp $
# $Header: /cvsroot/pgsql/doc/Makefile,v 1.12 1998/11/29 05:30:13 tgl Exp $
#
#----------------------------------------------------------------------------
@ -16,6 +16,7 @@ PGDOCS= $(POSTGRESDIR)/doc
SRCDIR= ../src
TAR= tar
GZCAT= zcat
# Pick up Makefile.global from the source area
# This is the only resource from the code source area and is optional.
@ -73,6 +74,6 @@ man::
%: %.tar.gz
rm -rf ./$@ $(PGDOCS)/$*
if test ! -d $(PGDOCS)/$* ; then mkdir $(PGDOCS)/$* ; fi
zcat $< | $(TAR) xf - -C $(PGDOCS)/$*
$(GZCAT) $< | (cd $(PGDOCS)/$* ; $(TAR) xf - )
# touch ./$*

View File

@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.53 1998/10/30 04:53:55 scrappy Exp $
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.54 1998/11/29 05:30:14 tgl Exp $
#
# NOTES
# Essentially all Postgres make files include this file and use the
@ -209,14 +209,21 @@ CFLAGS_SL= @SHARED_LIB@
LDFLAGS= @LDFLAGS@ @LIBS@
DLSUFFIX= @DLSUFFIX@
LN_S= @LN_S@
TAR= @tar@
GZCAT= @GZCAT@
##############################################################################
#
# Additional platform-specific settings
#
# Name of the target platform.
PORTNAME= @PORTNAME@
# Various grungy items needed to configure some platforms.
HAVE_POSIX_SIGNALS= @HAVE_POSIX_SIGNALS@
HPUXMATHLIB= @HPUXMATHLIB@
include $(SRCDIR)/Makefile.port
##############################################################################

652
src/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -416,8 +416,7 @@ AC_ARG_WITH(CXX,
[ AC_PROG_CXX])
AC_SUBST(HAVECXX)
INSTALLPATH="`echo /usr/ucb:$PATH | sed 's/:/ /g'`"
AC_PATH_PROGS(INSTALL, ginstall installbsd bsdinst scoinst install, NONE, $INSTALLPATH )
AC_PATH_PROGS(INSTALL, ginstall installbsd bsdinst scoinst install, NONE, /usr/ucb:$PATH )
if test "$INSTALL" = "NONE"
then
# fall back on our own script
@ -481,6 +480,7 @@ AC_PATH_PROG(xargs, xargs)
AC_PATH_PROG(ipcs, ipcs)
AC_PATH_PROG(ipcrm, ipcrm)
AC_PATH_PROGS(TR, trbsd tr, NOT_FOUND)
AC_PATH_PROGS(GZCAT, gzcat zcat, gzcat)
dnl Check tr flags to convert from lower to upper case
TRSTRINGS="`echo ABCdef | $TR '[[a-z]]' '[[A-Z]]' 2>/dev/null | grep ABCDEF`"
@ -754,16 +754,39 @@ AC_SUBST(STRCASECMP)
AC_CHECK_FUNC(cbrt,
AC_DEFINE(HAVE_CBRT),
AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT)))
# On HPUX 9, rint() is not in regular libm.a but in /lib/pa1.1/libm.a;
# this hackery with HPUXMATHLIB allows us to cope.
HPUXMATHLIB=""
AC_CHECK_FUNC(rint,
AC_DEFINE(HAVE_RINT),
[
# On HPUX 9, rint() is not in regular libm.a but in /lib/pa1.1/libm.a
SPECIALMATHLIB=""
if [[ -r /lib/pa1.1/libm.a ]] ; then
SPECIALMATHLIB="-L /lib/pa1.1 -lm"
HPUXMATHLIB="-L /lib/pa1.1 -lm"
fi
AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $SPECIALMATHLIB)
AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $HPUXMATHLIB)
])
AC_SUBST(HPUXMATHLIB)
dnl Check to see if platform has POSIX signal interface.
dnl NOTE: if this test fails then POSIX signals definitely don't work.
dnl It could be that the test compiles but the POSIX routines don't
dnl really work ... in that case the platform-specific port files
dnl can unset USE_POSIX_SIGNALS and HAVE_POSIX_SIGNALS. (The former
dnl goes into config.h, the latter into Makefile.global.)
AC_MSG_CHECKING(for POSIX signal interface)
AC_TRY_LINK([#include <signal.h>],
[struct sigaction act, oact;
sigemptyset(&act.sa_mask);
act.sa_flags = SA_RESTART;
sigaction(0, &act, &oact);],
[AC_DEFINE(USE_POSIX_SIGNALS)
HAVE_POSIX_SIGNALS="1"
AC_MSG_RESULT(yes)],
[HAVE_POSIX_SIGNALS=""
AC_MSG_RESULT(no)])
AC_SUBST(HAVE_POSIX_SIGNALS)
dnl Check for Tcl configuration script tclConfig.sh
@ -858,11 +881,13 @@ if test "$USE_X" = true; then
X11_LIBS=""
AC_CHECK_LIB(X11, XOpenDisplay, X11_LIBS="-lX11",,${X_PRE_LIBS})
if test "$X11_LIBS" = ""; then
dnl Not having X may be fatal. Let the user fix this.
AC_MSG_WARN([The X11 library '-lX11' could not be found.
Please use the configure options '--x-includes=DIR'
and '--x-libraries=DIR' to specify the X location.
See the file 'config.log' for further diagnostics.])
dnl Not having X is bad news for pgtksh. Let the user fix this.
AC_MSG_WARN([The X11 library '-lX11' could not be found,
so TK support will be disabled. To enable TK support,
please use the configure options '--x-includes=DIR'
and '--x-libraries=DIR' to specify the X location.
See the file 'config.log' for further diagnostics.])
USE_TK=
fi
AC_SUBST(X_LIBS)
AC_SUBST(X11_LIBS)

View File

@ -263,6 +263,9 @@ extern void srandom(int seed);
/* Define as the base type of the last arg to accept */
#undef SOCKET_SIZE_TYPE
/* Define if POSIX signal interface is available */
#undef USE_POSIX_SIGNALS
/*
* Code below this point should not require changes
*/

View File

@ -1,5 +1,4 @@
#define USE_POSIX_TIME
#define USE_POSIX_SIGNALS
#define CLASS_CONFLICT
#define DISABLE_XOPEN_NLS
#define HAVE_ANSI_CPP

View File

@ -1,5 +1,4 @@
#define USE_POSIX_TIME
#define USE_POSIX_SIGNALS
#define DISABLE_XOPEN_NLS
#define HAS_LONG_LONG
#define HAS_TEST_AND_SET

View File

@ -1,4 +1,3 @@
#define USE_POSIX_SIGNALS
#define USE_POSIX_TIME
#ifndef BIG_ENDIAN

View File

@ -1,11 +1,5 @@
#define JMP_BUF
#define USE_POSIX_TIME
/* HPUX 10 has full POSIX signal functionality.
* On HPUX 9, we rely on BSD-compatible signal() in libBSD.
*/
#ifdef HPUX_10
#define USE_POSIX_SIGNALS
#endif
#define HAS_TEST_AND_SET
typedef struct
{

View File

@ -1,5 +1,4 @@
#define USE_POSIX_TIME
#define USE_POSIX_SIGNALS
#define NO_EMPTY_STMTS
#define SYSV_DIRENT
#define HAS_TEST_AND_SET

View File

@ -6,7 +6,6 @@
*/
#define JMP_BUF
#define USE_POSIX_TIME
#define USE_POSIX_SIGNALS
#define HAS_TEST_AND_SET
#if defined(PPC)

View File

@ -1,5 +1,4 @@
#define USE_POSIX_TIME
#define USE_POSIX_SIGNALS
#define NO_EMPTY_STMTS
#define SYSV_DIRENT
#define HAS_TEST_AND_SET

View File

@ -1,5 +1,4 @@
#define USE_POSIX_TIME
#define USE_POSIX_SIGNALS
#define NO_EMPTY_STMTS
#define SYSV_DIRENT
#define HAS_TEST_AND_SET

View File

@ -1,5 +1,4 @@
#define USE_POSIX_TIME
#define USE_POSIX_SIGNALS
#define NO_EMPTY_STMTS
#define SYSV_DIRENT

View File

@ -1,6 +1,5 @@
#define USE_POSIX_TIME
#define NO_EMPTY_STMTS
#define USE_POSIX_SIGNALS
#define SYSV_DIRENT
#define HAS_TEST_AND_SET

View File

@ -1,6 +1,5 @@
#define USE_POSIX_TIME
#define NO_EMPTY_STMTS
#define USE_POSIX_SIGNALS
#define SYSV_DIRENT
#define HAS_TEST_AND_SET

View File

@ -1,46 +1,26 @@
HPUX_MAJOR= $(shell uname -r|sed 's/^[^.]*\.\([^.]*\).*/\1/')
# Distinguish HPUX 10 (and later) from HPUX 9
ifneq ($(HPUX_MAJOR), 09)
CFLAGS+= -DHPUX_10
# HP-UX 10 has a select() in libcurses, so we need to get the libc version,
# which we do by linking -lc before -lcurses. (Unfortunately we can't
# just not use libcurses.) This also ensures that we get the POSIX signal
# routines in libc, not the BSD-like ones in libBSD.
LDFLAGS:= -lc $(LDFLAGS)
# On the other hand, if we don't have POSIX signals, we need to use the
# libBSD signal routines. (HPUX 9 and early HPUX 10 releases don't have
# POSIX signals.) Make sure libBSD comes before libc in that case.
ifeq ($(HAVE_POSIX_SIGNALS),)
LDFLAGS:= -lBSD $(LDFLAGS)
endif
# HP-UX 10 has a select() in libcurses, so we need to get the libc version first
# We also want to be sure we get the POSIX signal routines in libc,
# not the BSD-like ones in libBSD.
ifneq ($(HPUX_MAJOR), 09)
LDFLAGS:= -Wl,-E -lc $(LDFLAGS)
endif
# HP-UX 09 provides rint() only in PA1.1 version of libm, so add -L command
# to get that version. (CAUTION: you need PHSS_4630 to have a working version
# of rint()!) Also, libPW exists on this platform but is not helpful, so
# delete it from LDFLAGS.
# NOTE: libBSD must be loaded before libc to get BSD signal() semantics.
ifeq ($(HPUX_MAJOR), 09)
LDFLAGS:= -Wl,-E -L /lib/pa1.1 $(LDFLAGS:-lPW=)
# On HPUX 9, rint() is provided only in the PA1.1 version of libm.
# If configure found it necessary to link against /lib/pa1.1 to find rint,
# add -L command to make that happen.
# (CAUTION: you need PHSS_4630 to have a working version of rint() on 9!)
ifneq ($(HPUXMATHLIB),)
LDFLAGS:= -L /lib/pa1.1 $(LDFLAGS)
endif
# On all HPUX versions, embed LIBDIR as the shared library search path
# so that the executables don't need SHLIB_PATH to be set, and enable -z
# to catch null pointer dereferences.
LDFLAGS+= -Wl,+b -Wl,$(LIBDIR) -Wl,-z
# Does anyone use this stuff?
#ifdef ENFORCE_ALIGNMENT
# CFLAGS+= -DNOFIXADE
#else
# ifeq ($(HPUX_MAJOR), 08)
# CFLAGS+= +u -DHP_S500_ALIGN
# LDFLAGS+= +u
# else
# ifeq ($(HPUX_MAJOR), 09)
# ifeq ($(CC), cc)
# CFLAGS+= +u4
# LDFLAGS+= +u4
# endif
# endif
# endif
#endif
%.sl: %.o
$(LD) -b -o $@ $<
# so that the executables don't need SHLIB_PATH to be set, specify -z
# to catch null pointer dereferences, and specify -E to make all symbols
# visible to dynamically linked shared libraries.
LDFLAGS+= -Wl,+b -Wl,$(LIBDIR) -Wl,-z -Wl,-E