Various fixes suggested by Gregor Hoffleit

Add a check to configure for strdup
Remove all the '-ltermcap' checks from psql/Makefile
Have {psql,pg_dump}/Makefile modified if strdup doesn't exist on the system
This commit is contained in:
Marc G. Fournier 1997-02-09 03:23:52 +00:00
parent fd84cafb69
commit ad6bfe67bd
5 changed files with 119 additions and 108 deletions

View File

@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.13 1997/02/06 02:31:05 momjian Exp $
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/Makefile.in,v 1.1 1997/02/09 03:23:23 scrappy Exp $
#
#-------------------------------------------------------------------------
@ -15,11 +15,7 @@ SRCDIR= ../..
include ../../Makefile.global
include ../Makefile.global
OBJS= pg_dump.o common.o
ifeq ($(PORTNAME), ultrix4)
OBJS+= ../../utils/strdup.o
endif
OBJS= pg_dump.o common.o @STRDUP@
all: submake pg_dump

View File

@ -1,87 +0,0 @@
#-------------------------------------------------------------------------
#
# Makefile.inc--
# Makefile for bin/psql
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.19 1997/01/25 23:53:59 scrappy Exp $
#
#-------------------------------------------------------------------------
SRCDIR= ../..
include ../../Makefile.global
INCLUDE_OPT:= \
-I$(LIBPQDIR) \
-I../../include
CFLAGS+= $(INCLUDE_OPT)
#USE_READLINE is set in Makefile.global
#
ifeq ($(USE_READLINE), true)
CFLAGS+= $(READLINE_INC)
LD_ADD+= $(READLINE_LIB) $(CURSES_LIB)
ifeq ($(PORTNAME), ultrix4)
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), sparc)
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), linux)
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), next)
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), bsdi)
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), BSD44_derived)
LD_ADD+= -ltermcap
endif
endif
endif
endif
endif
endif
endif
OBJS= psql.o stringutils.o
ifeq ($(PORTNAME), ultrix4)
OBJS+= ../../utils/strdup.o
endif
all: submake psql
psql: $(OBJS) $(LIBPQDIR)/libpq.a
$(CC) $(LDFLAGS) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LD_ADD)
../../utils/strdup.o:
$(MAKE) -C ../../utils strdup.o
.PHONY: submake
submake:
$(MAKE) -C $(LIBPQDIR) libpq.a
install: psql
$(INSTALL) $(INSTL_EXE_OPTS) psql $(DESTDIR)$(BINDIR)/psql
depend dep:
$(CC) -MM $(INCLUDE_OPT) *.c >depend
clean:
rm -f psql $(OBJS)
ifeq (depend,$(wildcard depend))
include depend
endif

50
src/bin/psql/Makefile.in Normal file
View File

@ -0,0 +1,50 @@
#-------------------------------------------------------------------------
#
# Makefile.inc--
# Makefile for bin/psql
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.3 1997/02/09 03:23:52 scrappy Exp $
#
#-------------------------------------------------------------------------
SRCDIR= ../..
include ../../Makefile.global
INCLUDE_OPT:= -I$(LIBPQDIR) \
-I../../include
CFLAGS+= $(INCLUDE_OPT)
OBJS= psql.o stringutils.o @STRDUP@
all: submake psql
psql: $(OBJS) $(LIBPQDIR)/libpq.a
$(CC) $(LDFLAGS) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LD_ADD)
../../utils/strdup.o:
$(MAKE) -C ../../utils strdup.o
.PHONY: submake
submake:
$(MAKE) -C $(LIBPQDIR) libpq.a
install: psql
$(INSTALL) $(INSTL_EXE_OPTS) psql $(DESTDIR)$(BINDIR)/psql
depend dep:
$(CC) -MM $(INCLUDE_OPT) *.c >depend
clean:
rm -f psql $(OBJS)
ifeq (depend,$(wildcard depend))
include depend
endif

78
src/configure vendored
View File

@ -3002,14 +3002,63 @@ else
INET_ATON='inet_aton.o'
fi
echo $ac_n "checking for strdup""... $ac_c" 1>&6
echo "configure:3007: checking for strdup" >&5
if eval "test \"`echo '$''{'ac_cv_func_strdup'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3012 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strdup(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char strdup();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_strdup) || defined (__stub___strdup)
choke me
#else
strdup();
#endif
; return 0; }
EOF
if { (eval echo configure:3035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_strdup=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_strdup=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'strdup`\" = yes"; then
echo "$ac_t""yes" 1>&6
STRDUP='../../utils/strdup.o'
else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for cbrt""... $ac_c" 1>&6
echo "configure:3008: checking for cbrt" >&5
echo "configure:3057: checking for cbrt" >&5
if eval "test \"`echo '$''{'ac_cv_func_cbrt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3013 "configure"
#line 3062 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char cbrt(); below. */
@ -3032,7 +3081,7 @@ cbrt();
; return 0; }
EOF
if { (eval echo configure:3036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_cbrt=yes"
else
@ -3053,7 +3102,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for cbrt in -lm""... $ac_c" 1>&6
echo "configure:3057: checking for cbrt in -lm" >&5
echo "configure:3106: checking for cbrt in -lm" >&5
ac_lib_var=`echo m'_'cbrt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -3061,7 +3110,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3065 "configure"
#line 3114 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -3072,7 +3121,7 @@ int main() {
cbrt()
; return 0; }
EOF
if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -3098,12 +3147,12 @@ fi
fi
echo $ac_n "checking for rint""... $ac_c" 1>&6
echo "configure:3102: checking for rint" >&5
echo "configure:3151: checking for rint" >&5
if eval "test \"`echo '$''{'ac_cv_func_rint'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3107 "configure"
#line 3156 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char rint(); below. */
@ -3126,7 +3175,7 @@ rint();
; return 0; }
EOF
if { (eval echo configure:3130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_rint=yes"
else
@ -3147,7 +3196,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for rint in -lm""... $ac_c" 1>&6
echo "configure:3151: checking for rint in -lm" >&5
echo "configure:3200: checking for rint in -lm" >&5
ac_lib_var=`echo m'_'rint | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -3155,7 +3204,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3159 "configure"
#line 3208 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -3166,7 +3215,7 @@ int main() {
rint()
; return 0; }
EOF
if { (eval echo configure:3170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -3292,7 +3341,7 @@ done
ac_given_srcdir=$srcdir
trap 'rm -fr `echo "GNUmakefile Makefile.global backend/port/Makefile include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
trap 'rm -fr `echo "GNUmakefile Makefile.global backend/port/Makefile bin/psql/Makefile bin/pg_dump/Makefile include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@ -3352,6 +3401,7 @@ s%@ipcs@%$ipcs%g
s%@ipcrm@%$ipcrm%g
s%@LIBOBJS@%$LIBOBJS%g
s%@INET_ATON@%$INET_ATON%g
s%@STRDUP@%$STRDUP%g
CEOF
EOF
@ -3393,7 +3443,7 @@ EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile Makefile.global backend/port/Makefile"}
CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile Makefile.global backend/port/Makefile bin/psql/Makefile bin/pg_dump/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then

View File

@ -156,8 +156,10 @@ AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(isinf tzset getrusage vfork memmove sigsetjmp kill sysconf)
AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON), INET_ATON='inet_aton.o')
AC_CHECK_FUNC(strdup, STRDUP='../../utils/strdup.o')
AC_SUBST(INET_ATON)
AC_SUBST(STRDUP)
AC_CHECK_FUNC(cbrt, AC_DEFINE(HAVE_CBRT), AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT)))
AC_CHECK_FUNC(rint, AC_DEFINE(HAVE_RINT), AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT)))
AC_OUTPUT(GNUmakefile Makefile.global backend/port/Makefile)
AC_OUTPUT(GNUmakefile Makefile.global backend/port/Makefile bin/psql/Makefile bin/pg_dump/Makefile)