Commit f8ff1ee5 authored by Peter Eisentraut's avatar Peter Eisentraut

Move DLSUFFIX, AROPT, and CFLAGS_SL settings from template to

Makefile.port, since they are of no use to configure and much of the
library magic happens in Makefile.port anyway.

Use __alpha, not __alpha__, since the former is universally available.
Remove -DNOFIXADE from the compile command line and put it in the port
include file.
parent 0968601b
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -115,16 +115,15 @@ AC_LINK_FILES([src/makefiles/Makefile.${template}], [src/Makefile.port])
# Pick right test-and-set (TAS) code. Most platforms have inline
# assembler code in src/include/storage/s_lock.h, so we just use
# a dummy file here.
tas_file=dummy.s
need_tas=no
case $host in
*-*-hpux*) need_tas=yes; tas_file=hpux.s ;;
sparc-*-solaris*) need_tas=yes; tas_file=solaris_sparc.s ;;
i?86-*-solaris) need_tas=yes; tas_file=solaris_i386.s ;;
*) need_tas=no; tas_file=dummy.s ;;
esac
AC_LINK_FILES([src/backend/port/tas/${tas_file}], [src/backend/port/tas.s])
if test "$need_tas" = yes ; then
AC_LINK_FILES([src/backend/port/tas/${tas_file}], [src/backend/port/tas.s])
TAS=tas.o
fi
AC_SUBST(TAS)
......@@ -249,12 +248,7 @@ AC_PROG_CC_WORKS
AC_EXEEXT
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
AC_SUBST(GCC)
AC_SUBST(AROPT)
AC_SUBST(SHARED_LIB)
AC_SUBST(DLSUFFIX)
AC_SUBST(DL_LIB)
# Create compiler version string
if test x"$GCC" = x"yes" ; then
......
# -*-makefile-*-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.102 2000/10/20 23:57:33 petere Exp $
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.103 2000/10/21 22:36:11 petere Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
......@@ -137,7 +137,6 @@ override CPPFLAGS += $(sort -I$(top_srcdir)/src/include -I$(top_builddir)/src/in
CC = @CC@
GCC = @GCC@
CFLAGS = @CFLAGS@
CFLAGS_SL = @SHARED_LIB@
ifeq ($(GCC), yes)
CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations
endif
......@@ -158,7 +157,6 @@ FLEXFLAGS = @FLEXFLAGS@ $(LFLAGS)
# Linking
AROPT = @AROPT@
LIBS = @LIBS@
LD = @LD@
with_gnu_ld = @with_gnu_ld@
......@@ -166,7 +164,6 @@ LDFLAGS = @LDFLAGS@ $(LIBS)
KRB_LIBS = @KRB_LIBS@
LDREL = -r
LDOUT = -o
DLSUFFIX = @DLSUFFIX@
RANLIB = @RANLIB@
LORDER = @LORDER@
X = @EXEEXT@
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.32 2000/10/07 14:39:07 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.33 2000/10/21 22:36:11 petere Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -17,7 +17,7 @@
#include <pwd.h>
#include <unistd.h>
#if defined(__alpha__) && !defined(linux)
#if defined(__alpha) && !defined(linux)
#include <sys/sysinfo.h>
#include "machine/hal_sysinfo.h"
#define ASSEMBLER
......@@ -43,7 +43,7 @@ main(int argc, char *argv[])
{
int len;
#if defined(__alpha__)
#if defined(__alpha)
#ifdef NOFIXADE
int buffer[] = {SSIN_UACPROC, UAC_SIGBUS};
......@@ -71,7 +71,7 @@ main(int argc, char *argv[])
syscall(SYS_sysmips, MIPS_FIXADE, 0, NULL, NULL, NULL);
#endif
#if defined(__alpha__)
#if defined(__alpha)
if (setsysinfo(SSI_NVPAIRS, buffer, 1, (caddr_t) NULL,
(unsigned long) NULL) < 0)
elog(NOTICE, "setsysinfo failed: %d\n", errno);
......
#define NOFIXADE
#define USE_POSIX_TIME
#define DISABLE_XOPEN_NLS
#define HAS_TEST_AND_SET
......@@ -5,8 +6,3 @@
/*typedef msemaphore slock_t;*/
#include <alpha/builtins.h>
typedef volatile long slock_t;
/* some platforms define __alpha, but not __alpha__ */
#if defined(__alpha) && !defined(__alpha__)
#define __alpha__
#endif
#define NOFIXADE
#define USE_POSIX_TIME
#define NEED_STRDUP
......
......@@ -4,6 +4,19 @@ MAKE_EXPORTS= true
RANLIB= touch
MK_NO_LORDER= true
AROPT = crs
DLSUFFIX = .so
ifneq ($(GCC), yes)
ifeq ($(host_os), aix3.2.5)
CFLAGS_SL = -e _nostart
endif
ifeq ($(host_os), aix4.1)
CFLAGS_SL = -bnoentry
endif
endif
CFLAGS_SL += -lc
EXPSUFF= .exp
IMPSUFF= .imp
......
MK_NO_LORDER=true
AROPT = crs
ifdef ELF_SYSTEM
export_dynamic = -Wl,-E
endif
DLSUFFIX = .so
CFLAGS_SL = -fpic -DPIC
%.so: %.o
ln -fs $(top_srcdir)/src/backend/postgres _APP_
$(CC) -nostart -Xlinker -soname=$@ -o $@ _APP_ $<
# for bsdi 4.0 ELF
# if we defined .so in template/bsdi_4.0
AROPT = cq
# bsdi 4.0 and later is ELF
DLSUFFIX = .so
ifeq ($(host_os), bsdi2.0)
DLSUFFIX = .o
endif
ifeq ($(host_os), bsdi2.1)
DLSUFFIX = .o
endif
ifeq ($(findstring bsdi3, $(host_os)), bsdi3)
DLSUFFIX = .o
endif
ifeq ($(DLSUFFIX), .so)
CFLAGS_SL = -fpic
export_dynamic = -export-dynamic
else
CFLAGS_SL =
endif
%.so: %.o
......
AROPT = crs
DLSUFFIX = .so
CFLAGS_SL = -fpic
%.so: %.o
$(CC) -shared -o $@ $<
AROPT = cq
ifdef ELF_SYSTEM
export_dynamic = -export-dynamic
endif
DLSUFFIX = .so
CFLAGS_SL = -fpic -DPIC
%.so: %.o
ifdef ELF_SYSTEM
$(LD) -x -shared -o $@ $<
......@@ -14,4 +19,3 @@ else
@rm -f $@
$(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic
endif
......@@ -26,6 +26,15 @@ endif
LDFLAGS+= -Wl,+b -Wl,$(libdir) -Wl,-z
export_dynamic = -Wl,-E
AROPT = crs
DLSUFFIX = .sl
ifeq ($(GCC), yes)
CFLAGS_SL = -fPIC
else
CFLAGS_SL = +z
endif
# Rule for building shared libs (currently used only for regression test
# shlib ... should go away, since this is not really enough knowledge)
%.sl: %.o
......
# RANLIB is not used on IRIX 5
RANLIB= touch
MK_NO_LORDER= true
AROPT = crs
DLSUFFIX = .so
CFLAGS_SL =
%.so: %.o
$(LD) -G -Bdynamic -shared -o $@ $<
......
AROPT = crs
export_dynamic = -export-dynamic
MK_NO_LORDER= true
DLSUFFIX = .so
CFLAGS_SL = -fpic
%.so: %.o
$(CC) -shared -o $@ $<
AROPT = cq
ifdef ELF_SYSTEM
export_dynamic = -Wl,-E
endif
DLSUFFIX = .so
CFLAGS_SL = -fpic -DPIC
%.so: %.o
ifdef ELF_SYSTEM
$(LD) -x -Bshareable -o $@ $<
......
AROPT = cq
ifdef ELF_SYSTEM
export_dynamic = -Wl,-E
endif
DLSUFFIX = .so
CFLAGS_SL = -fpic -DPIC
%.so: %.o
ifdef ELF_SYSTEM
$(LD) -x -Bshareable -o $@ $<
......
AROPT = crs
DLSUFFIX = .so
CFLAGS_SL =
%.so: %.o
$(LD) -shared -expect_unresolved '*' -o $@ $<
LDFLAGS += -rpath $(libdir)
MK_NO_LORDER= true
CXXFLAGS+= -I/usr/local/lib/gcc-lib/i386-pc-qnx4/egcs-2.91.60/include/g++
AR= ar
AROPT = cr
LD= $(AR)
LDREL= $(AROPT)
LDOUT=
LIBS= -lunix
LDFLAGS= $(LIBS)
DLSUFFIX = .so
CFLAGS_SL =
%$(DLSUFFIX): %.o
@echo Cannot make shared library $@ from $*.o
@echo 'cannot make shared object $@ from $<'
override CFLAGS += -dy
export_dynamic = -W l,-Bexport
AROPT = cq
DLSUFFIX = .so
CFLAGS_SL = -K PIC
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
# $Header: /cvsroot/pgsql/src/makefiles/Makefile.solaris,v 1.2 2000/10/20 23:57:34 petere Exp $
# $Header: /cvsroot/pgsql/src/makefiles/Makefile.solaris,v 1.3 2000/10/21 22:36:13 petere Exp $
AROPT = crs
ifeq ($(with_gnu_ld), yes)
export_dynamic = -Wl,-E
endif
DLSUFFIX = .so
ifeq ($(GCC), yes)
CFLAGS_SL = -fPIC
else
CFLAGS_SL = -KPIC
endif
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
AROPT = cr
DLSUFFIX = .so
ifeq ($(GCC), yes)
CFLAGS_SL = -fPIC
else
CFLAGS_SL = -PIC
endif
%.so: %.o
$(LD) -dc -dp -Bdynamic -o $@ $<
......@@ -4,6 +4,8 @@
LDFLAGS+= -lc /usr/ucblib/libucb.a -LD-Blargedynsym
DLSUFFIX = .so
CFLAGS_SL =
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
SHELL=/bin/sh5
AROPT = crs
#
DLSUFFIX = .so
# "-G 0" works for both DEC cc and GNU cc.
#
CFLAGS_SL = -G 0
%.so: %.c
$(CC) -c -G 0 $(CPPFLAGS) $(CFLAGS) -o $@ $<
LDFLAGS+= -lc89
AROPT = crs
export_dynamic = -Wl,-Bexport
DLSUFFIX = .so
CFLAGS_SL = -K PIC
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
INSTALL= /usr/ucb/install
AROPT = crs
export_dynamic = -Wl,-Bexport
DLSUFFIX = .so
CFLAGS_SL = -K PIC
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
INSTALL= /usr/ucb/install
# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.6 2000/10/20 21:04:13 petere Exp $
# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.7 2000/10/21 22:36:13 petere Exp $
LDFLAGS+= -g
DLLTOOL= dlltool
DLLWRAP= dllwrap
......@@ -11,12 +11,15 @@ SHLIB_LINK=$(DLLLIBS)
# (see http://sources.redhat.com/cygwin/faq/faq.html#SEC110)
LIBS:=$(filter-out -lm -lc, $(LIBS))
AROPT = crs
DLSUFFIX = .dll
CFLAGS_SL =
%.dll: %.o
$(DLLTOOL) --export-all --output-def $*.def $<
$(DLLWRAP) -o $@ --def $*.def $< $(top_builddir)/src/utils/dllinit.o $(DLLLIBS)
rm -f $*.def
curdir:=$(shell pwd)
ifeq ($(findstring backend,$(curdir)), backend)
ifeq ($(findstring backend,$(subdir)), backend)
override CPPFLAGS+= -DBUILDING_DLL=1
endif
AROPT=crs
DLSUFFIX=.so
if test "$GCC" = yes ; then
CFLAGS=-pipe
CXXFLAGS=-pipe
SHARED_LIB=-lc
else # not GCC
case $host_os in
aix3.2.5)
CFLAGS='-qchars=signed -qmaxmem=8192 -qhalt=w -qsrcmsg'
SHARED_LIB='-e _nostart -lc'
;;
aix4.1)
CFLAGS='-qchars=signed -qmaxmem=8192 -qhalt=w -qsrcmsg -qcheck=divzero'
SHARED_LIB='-bnoentry -lc'
;;
aix4.2 | aix4.3)
CFLAGS='-qmaxmem=16384 -qhalt=w -qsrcmsg -qlanglvl=extended -qlonglong'
SHARED_LIB='-lc'
;;
esac
fi # not GCC
AROPT=crs
SHARED_LIB='-fpic -DPIC'
CFLAGS='-O2'
DLSUFFIX=.so
AROPT=cq
CFLAGS='-O2 -pipe'
case $host_cpu in
......@@ -11,12 +10,6 @@ esac
case $host_os in
bsdi2.0 | bsdi2.1 | bsdi3*)
SHARED_LIB=
DLSUFFIX=.o
CC=gcc2
;;
*)
SHARED_LIB=-fpic
DLSUFFIX=.so
;;
esac
AROPT=crs
CFLAGS=
SHARED_LIB=-fpic
DLSUFFIX=.so
AROPT=cq
SHARED_LIB='-fpic -DPIC'
CFLAGS='-O2 -m486 -pipe'
DLSUFFIX=.so
AROPT=crs
DLSUFFIX=.sl
if test "$GCC" = yes ; then
CFLAGS=-O2
SHARED_LIB=-fPIC
DL_LIB=/usr/lib/libdld.sl
CCC=g++
else
CFLAGS=-Ae
SHARED_LIB=+z
CPP='cc -E -Ae'
CCC=aCC
fi
AROPT=crs
CFLAGS=
SHARED_LIB=
DLSUFFIX=.so
AROPT=crs
CFLAGS=-O2
SHARED_LIB=-fpic
DLSUFFIX=.so
case $host_cpu in
mips*) CFLAGS="$CFLAGS -mips2";;
......
AROPT=cq
SHARED_LIB='-fpic -DPIC'
CFLAGS='-O2 -pipe'
DLSUFFIX=.so
AROPT=cq
SHARED_LIB='-fpic -DPIC'
CFLAGS='-O2 -pipe'
DLSUFFIX=.so
AROPT=crs
# NOFIXADE disallows unaligned access.
# on Ultrix and OSF/1 it invokes an explicit syscall.
# on HP-UX it turns off certain compiler options.
# This is defined here because a bunch of clients include tmp/c.h,
# which is where the work is done on HP-UX. It only affects the
# backend on Ultrix and OSF/1.
if test "$GCC" = yes ; then
CFLAGS='-D__alpha__ -DNOFIXADE'
CFLAGS=
CCC=g++
else
CFLAGS='-D__alpha__ -DNOFIXADE -std -O4 -Olimit 2000'
LDFLAGS='-rpath $(libdir)'
CC="$CC -std"
CFLAGS='-O4 -Olimit 2000'
CCC=cxx
CXXFLAGS='-D__alpha__ -DNOFIXADE -O4 -Olimit 2000'
CXXFLAGS='-O4 -Olimit 2000'
fi
DLSUFFIX=.so
SHARED_LIB=
AROPT=cr
CFLAGS=
LIBS=-lunix
SHARED_LIB=
DLSUFFIX=.so
CXXFLAGS=-I/usr/local/lib/gcc-lib/i386-pc-qnx4/egcs-2.91.60/include/g++
AROPT=cq
CFLAGS=
SHARED_LIB='-K PIC'
DLSUFFIX=.so
CC="$CC -b elf"
AROPT=crs
DLSUFFIX=.so
if test "$GCC" = yes ; then
CFLAGS=
SHARED_LIB=-fPIC
else
CC="$CC -Xa" # relaxed ISO C mode
CFLAGS=-v # -v is like gcc -Wall
SHARED_LIB=-KPIC
fi
AROPT=cr
DLSUFFIX=.so
if test "$GCC" = yes ; then
CFLAGS=
SHARED_LIB=-fPIC
else
CFLAGS=
SHARED_LIB=-PIC
fi
CFLAGS=
AROPT=crs
CFLAGS=
SHARED_LIB=
DLSUFFIX=.so
AROPT=crs
CFLAGS=-DNOFIXADE
SHARED_LIB='-G 0'
DLSUFFIX=.so
CFLAGS=
AROPT=crs
CFLAGS='-v -O -K i486,host,inline,loop_unroll -Dsvr4'
SHARED_LIB='-K PIC'
DLSUFFIX=.so
LIBS=-lc89
AROPT=crs
CFLAGS='-O -K host,inline,loop_unroll,alloca -Dsvr4'
SHARED_LIB='-K PIC'
SRCH_INC='/opt/include'
SRCH_LIB='/opt/lib'
DLSUFFIX=.so
AROPT=crs
CFLAGS=-O2
SRCH_INC=/usr/local/include
SRCH_LIB=/usr/local/lib
DLSUFFIX=.dll
LIBS=-lcygipc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment