Re: Changes needed to build on NetBSD

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
Cc: <pgsql-patches(at)PostgreSQL(dot)org>
Subject: Re: Changes needed to build on NetBSD
Date: 2001-05-12 20:25:52
Message-ID: Pine.LNX.4.30.0105122220400.757-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

D'Arcy J.M. Cain writes:

> ## --disable-readline disables readline support
> ## --with-python-compile byte-compile Python modules
> ##
> ## The former is useful if you wish to only compile the libraries, but don't
> ## want the libpq shared libraries to be linked against readline.

libpq is not linked against readline either way.

> The latter
> ## optionally allows byte-compiling the Python modules as an optimization.

We can do that.

> --- src/Makefile.shlib.orig Sun Apr 1 15:17:30 2001
> +++ src/Makefile.shlib
> @@ -275,10 +275,12 @@
> # Normal case
> $(shlib): $(OBJS)
> $(LINK.shared) $(OBJS) $(SHLIB_LINK) -o $@
> +ifdef ELF_SYSTEM
> # If we're using major and minor versions, then make a symlink to major-version-only.
> ifneq ($(shlib), lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION))
> rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
> $(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
> +endif
> endif
> # Make sure we have a link to a name without any version numbers
> ifneq ($(shlib), lib$(NAME)$(DLSUFFIX))

This is not portable to other non-ELF systems.

> ###########################################################################
> ##
> ## Add -lc, needed if a shared object is linked with -Bsymbolic on ELF
> ## to resolve the C library functions.
> ##
> --- src/makefiles/Makefile.netbsd.orig Sat Jan 6 21:03:41 2001
> +++ src/makefiles/Makefile.netbsd
> @@ -3,7 +3,9 @@
> ifdef ELF_SYSTEM
> export_dynamic = -Wl,-E
> rpath = -Wl,-R$(libdir)
> -shlib_symbolic = -Wl,-Bsymbolic
> +shlib_symbolic = -Wl,-Bsymbolic -lc
> +else
> +rpath = -R$(libdir)
> endif

The compiler driver (gcc) should provide -lc if necessary. Manually
specifying -lc can cause problems at other places. I just tried building
the ODBC driver on FreeBSD and didn't see a problem, so maybe it's
something with NetBSD's GCC installation?

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Ed Loehr 2001-05-13 05:47:55 Re: microsecond log timestamps
Previous Message Tom Lane 2001-05-12 18:05:44 Re: microsecond log timestamps