@ -6,7 +6,7 @@
# Copyright (c) 1998, Regents of the University of California
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.76 2004/05/19 21:37:43 momjian Exp $
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.77 2004/07/13 00:06:46 tgl Exp $
#
#-------------------------------------------------------------------------
@ -71,8 +71,14 @@ LINK.static = $(AR) $(AROPT)
i f e q ( $( enable_shared ) , y e s )
# Default shlib naming convention used by the majority of platforms
shlib = lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
shlib_major = lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION)
shlib_bare = lib$( NAME) $( DLSUFFIX)
# For each platform we support shared libraries on, set shlib to the
# name of the library, LINK.shared to the command to link the library,
# name of the library (if default above is not right), set
# LINK.shared to the command to link the library,
# and adjust SHLIB_LINK if necessary.
# Try to keep the sections in some kind of order, folks...
@ -82,17 +88,28 @@ override CFLAGS += $(CFLAGS_SL)
soname = lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION)
i f e q ( $( PORTNAME ) , a i x )
shlib : = lib$( NAME) $( DLSUFFIX)
shlib = lib$( NAME) $( DLSUFFIX)
# SHLIB_LINK += -lc
e n d i f
i f e q ( $( PORTNAME ) , d a r w i n )
shlib := lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
LINK.shared = $( COMPILER) -bundle
ifneq ( $( SO_MAJOR_VERSION) , 0)
version_link := -compatibility_version $( SO_MAJOR_VERSION) -current_version $( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
endif
ifeq ( $( DLTYPE) , library)
# linkable library
DLSUFFIX := .dylib
LINK.shared = $( COMPILER) -dynamiclib -install_name $( libdir) /lib$( NAME) .$( SO_MAJOR_VERSION) $( DLSUFFIX) $( version_link) -multiply_defined suppress
else
# loadable module (default case)
DLSUFFIX := .so
LINK.shared = $( COMPILER) -bundle
endif
shlib = lib$( NAME) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION) $( DLSUFFIX)
shlib_major = lib$( NAME) .$( SO_MAJOR_VERSION) $( DLSUFFIX)
e n d i f
i f e q ( $( PORTNAME ) , o p e n b s d )
shlib := lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
ifdef ELF_SYSTEM
LINK.shared = $( COMPILER) -shared -Wl,-x,-soname,$( soname)
SHLIB_LINK += -lc
@ -102,7 +119,6 @@ ifeq ($(PORTNAME), openbsd)
e n d i f
i f e q ( $( PORTNAME ) , b s d i )
shlib := lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
ifeq ( $( DLSUFFIX) , .so)
LINK.shared = $( COMPILER) -shared -Wl,-x,-soname,$( soname)
SHLIB_LINK += -lc
@ -114,16 +130,15 @@ endif
i f e q ( $( PORTNAME ) , f r e e b s d )
ifdef ELF_SYSTEM
shlib : = lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION)
shlib = lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION)
LINK.shared = $( COMPILER) -shared -Wl,-x,-soname,$( soname)
else
shlib : = lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
shlib = lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
LINK.shared = $( LD) -x -Bshareable -Bforcearchive
endif
e n d i f
i f e q ( $( PORTNAME ) , n e t b s d )
shlib := lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
ifdef ELF_SYSTEM
LINK.shared = $( COMPILER) -shared -Wl,-x,-soname,$( soname)
else
@ -132,7 +147,7 @@ ifeq ($(PORTNAME), netbsd)
e n d i f
i f e q ( $( PORTNAME ) , h p u x )
shlib : = lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION)
shlib = lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION)
LINK.shared = $( LD) +h $( soname) -b +b $( libdir)
ifeq ( $( GCC) , yes)
SHLIB_LINK += ` $( CC) -print-libgcc-file-name`
@ -140,17 +155,15 @@ ifeq ($(PORTNAME), hpux)
e n d i f
i f e q ( $( PORTNAME ) , i r i x )
shlib : = lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION)
shlib = lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION)
LINK.shared = $( COMPILER) -shared -Wl,-set_version,sgi$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
e n d i f
i f e q ( $( PORTNAME ) , l i n u x )
shlib := lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
LINK.shared = $( COMPILER) -shared -Wl,-soname,$( soname)
e n d i f
i f e q ( $( PORTNAME ) , s o l a r i s )
shlib := lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
ifeq ( $( GCC) , yes)
LINK.shared = $( CC) -shared
else
@ -164,17 +177,14 @@ ifeq ($(PORTNAME), solaris)
e n d i f
i f e q ( $( PORTNAME ) , s u n o s 4 )
shlib := lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
LINK.shared = $( LD) -assert pure-text -Bdynamic
e n d i f
i f e q ( $( PORTNAME ) , o s f )
shlib := lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
LINK.shared = $( LD) -shared -expect_unresolved '*'
e n d i f
i f e q ( $( PORTNAME ) , s c o )
shlib := lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
ifeq ( $( GCC) , yes)
LINK.shared = $( CC) -shared
else
@ -184,17 +194,14 @@ ifeq ($(PORTNAME), sco)
e n d i f
i f e q ( $( PORTNAME ) , s v r 4 )
shlib := lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
LINK.shared = $( LD) -G
e n d i f
i f e q ( $( PORTNAME ) , u n i v e l )
shlib := lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
LINK.shared = $( LD) -G -z text
e n d i f
i f e q ( $( PORTNAME ) , u n i x w a r e )
shlib := lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION)
ifeq ( $( GCC) , yes)
LINK.shared = $( CC) -shared
else
@ -204,15 +211,15 @@ ifeq ($(PORTNAME), unixware)
e n d i f
i f e q ( $( PORTNAME ) , c y g w i n )
shlib : = $( NAME) $( DLSUFFIX)
shlib = $( NAME) $( DLSUFFIX)
e n d i f
i f e q ( $( PORTNAME ) , w i n 3 2 )
shlib : = lib$( NAME) $( DLSUFFIX)
shlib = lib$( NAME) $( DLSUFFIX)
e n d i f
i f e q ( $( PORTNAME ) , b e o s )
shlib : = lib$( NAME) $( DLSUFFIX)
shlib = lib$( NAME) $( DLSUFFIX)
LINK.shared = $( LD) -nostart
SHLIB_LINK += -ltermcap -lstdc++.r4 -lbind -lsocket -L/boot/develop/lib/x86
e n d i f
@ -258,23 +265,23 @@ endif # not cygwin
i f e q ( $( enable_shared ) , y e s )
i f n e q ( $( PORTNAME ) , b e o s )
i f n e q ( $( PORTNAME ) , c y g w i n )
i f n e q ( $( PORTNAME ) , w i n 3 2 )
i f n e q ( $( PORTNAME ) , c y g w i n )
i f n e q ( $( PORTNAME ) , b e o s )
i f n e q ( $( PORTNAME ) , a i x )
# Normal case
$(shlib) : $( OBJS )
$( LINK.shared) $( OBJS) $( SHLIB_LINK) -o $@
# If we're using major and minor versions, then make a symlink to major-version-only.
i f n e q ( $( shlib ) , l i b $( NAME ) $( DLSUFFIX ) . $( SO_MAJOR_VERSION ) )
rm -f lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION )
$( LN_S) $( shlib) lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION )
i f n e q ( $( shlib ) , $( shlib_major ) )
rm -f $( shlib_major)
$( LN_S) $( shlib) $( shlib_major)
e n d i f
# Make sure we have a link to a name without any version numbers
i f n e q ( $( shlib ) , l i b $( NAME ) $( DLSUFFIX ) )
rm -f lib$( NAME) $( DLSUFFIX )
$( LN_S) $( shlib) lib$( NAME) $( DLSUFFIX )
i f n e q ( $( shlib ) , $( shlib_bare ) )
rm -f $( shlib_bare)
$( LN_S) $( shlib) $( shlib_bare)
e n d i f
e l s e # PORTNAME == aix
@ -286,15 +293,14 @@ $(shlib): lib$(NAME).a
e n d i f # PORTNAME == aix
e l s e # PORTNAME == win32
e l s e # PORTNAME == beos
# win32 case
$(shlib) lib$(NAME).a : $( OBJS )
$( DLLTOOL) --export-all $( DLLTOOL_DEFFLAGS) --output-def $( NAME) .def $( OBJS)
$( DLLWRAP) -o $( shlib) --dllname $( shlib) $( DLLWRAP_FLAGS) --def $( NAME) .def $( OBJS) $( SHLIB_LINK)
$( DLLTOOL) --dllname $( shlib) $( DLLTOOL_LIBFLAGS) --def $( NAME) .def --output-lib lib$( NAME) .a
# BEOS case
$(shlib) : $( OBJS )
ln -fs $( top_srcdir) /src/backend/postgres _APP_
$( CC) -Xlinker -soname= $@ $( LDFLAGS_SL) -o $@ _APP_ $( OBJS) $( SHLIB_LINK)
e n d i f # PORTNAME == win32
e n d i f # PORTNAME == beos
e l s e # PORTNAME == cygwin
@ -309,14 +315,15 @@ $(DLLINIT): $(DLLINIT:%.o=%.c)
e n d i f # PORTNAME == cygwin
e l s e # PORTNAME == beos
e l s e # PORTNAME == win32
# BEOS case
$(shlib) : $( OBJS )
ln -fs $( top_srcdir) /src/backend/postgres _APP_
$( CC) -Xlinker -soname= $@ $( LDFLAGS_SL) -o $@ _APP_ $( OBJS) $( SHLIB_LINK)
# win32 case
$(shlib) lib$(NAME).a : $( OBJS )
$( DLLTOOL) --export-all $( DLLTOOL_DEFFLAGS) --output-def $( NAME) .def $( OBJS)
$( DLLWRAP) -o $( shlib) --dllname $( shlib) $( DLLWRAP_FLAGS) --def $( NAME) .def $( OBJS) $( SHLIB_LINK)
$( DLLTOOL) --dllname $( shlib) $( DLLTOOL_LIBFLAGS) --def $( NAME) .def --output-lib lib$( NAME) .a
e n d i f # PORTNAME == beos
e n d i f # PORTNAME == win32
e n d i f # enable_shared
@ -340,17 +347,16 @@ install-lib-shared: $(shlib)
$( INSTALL_SHLIB) $< $( DESTDIR) $( libdir) /$( shlib)
i f n e q ( $( PORTNAME ) , c y g w i n )
i f n e q ( $( PORTNAME ) , w i n 3 2 )
i f n e q ( $( shlib ) , l i b $( NAME ) $( DLSUFFIX ) . $( SO_MAJOR_VERSION ) )
i f n e q ( $( shlib ) , $( shlib_major ) )
cd $( DESTDIR) $( libdir) && \
rm -f lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION ) && \
$( LN_S) $( shlib) lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION )
rm -f $( shlib_major) && \
$( LN_S) $( shlib) $( shlib_major)
e n d i f
i f n e q ( $( shlib ) , l i b $( NAME ) $( DLSUFFIX ) )
i f n e q ( $( shlib ) , $( shlib_bare ) )
cd $( DESTDIR) $( libdir) && \
rm -f lib$( NAME) $( DLSUFFIX ) && \
$( LN_S) $( shlib) lib$( NAME) $( DLSUFFIX )
rm -f $( shlib_bare) && \
$( LN_S) $( shlib) $( shlib_bare)
e n d i f
e n d i f # not win32
e n d i f # not cygwin
e n d i f # enable_shared
@ -364,9 +370,9 @@ endif # enable_shared
uninstall-lib :
rm -f $( DESTDIR) $( libdir) /lib$( NAME) .a
i f e q ( $( enable_shared ) , y e s )
rm -f $( DESTDIR) $( libdir) /lib$( NAME) $( DLSUFFIX ) \
$( DESTDIR) $( libdir) /lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION ) \
$( DESTDIR) $( libdir) /lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION )
rm -f $( DESTDIR) $( libdir) /$( shlib_bare) \
$( DESTDIR) $( libdir) /$( shlib_major) \
$( DESTDIR) $( libdir) /$( shlib)
e n d i f # enable_shared
@ -378,7 +384,7 @@ endif # enable_shared
clean-lib :
rm -f lib$( NAME) .a
i f e q ( $( enable_shared ) , y e s )
rm -f lib$( NAME) $( DLSUFFIX) lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) lib$( NAME) $( DLSUFFIX) .$( SO_MAJOR_VERSION) .$( SO_MINOR_VERSION )
rm -f $( shlib_bare) $( shlib_major) $( shlib)
i f d e f E X P S U F F
rm -f lib$( NAME) $( EXPSUFF)
e n d i f