Thread: Compiling postgres-7.4.1

Compiling postgres-7.4.1

From
"Sathiamoorthy Balasubramaniyan (ext_TCS)"
Date:
hello,
Iam trying to install postgres-7.4.1 on my tru64 (O.S version 5.1A) box
without the shared library support.

 Here's my list of commands:
./configure --with-includes=/opt/gcc-33/include --prefix=/tools/postgres-741
--disable-shared
gmake
gmake install

The "gmake" successfully compiles the software but "gmake install"  throws
the following error:
/bin/sh ../../../../../../config/install-sh -c -m 755
/tools/postgres-741/lib/ascii_and_mic.so
install:  /tools/postgres-741/lib/ascii_and_mic.so does not exist
gmake[3]: *** [install] Error 1
gmake[3]: Leaving directory
`/tools/SW/postgresql-7.4.1/src/backend/utils/mb/conversion_procs/ascii_and_
mic'
gmake[2]: *** [install] Error 2
gmake[2]: Leaving directory
`/tools/SW/postgresql-7.4.1/src/backend/utils/mb/conversion_procs'
gmake[1]: *** [install] Error 2
gmake[1]: Leaving directory `/tools/SW/postgresql-7.4.1/src'
gmake: *** [install] Error 2

Iam not sure why the install program searches for the shared objects.
I have read the INSTALL file but there's nothing mentioned on
"--disable-shared" option in the configure command.
Surprisingly, google also failed to answer my question.

So how will i be able to compile postgres without the shared library support
?

Thanks in advance,
Bala S


Re: Compiling postgres-7.4.1

From
Tom Lane
Date:
"Sathiamoorthy Balasubramaniyan (ext_TCS)" <Balasubramaniyan.Sathiamoorthy.ext_TCS@ts.siemens.de> writes:
> Iam trying to install postgres-7.4.1 on my tru64 (O.S version 5.1A) box
> without the shared library support.

There seems to be some bit-rot in the support for --disable-shared.
I've applied the attached patch to fix it.

Note that without shared libraries, you are not going to have any PL
languages nor any character encoding conversion support.  That's rather
a big restriction, so you might want to look into how to get shared
libraries to work, instead ...

            regards, tom lane

Index: src/backend/utils/mb/conversion_procs/proc.mk
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/utils/mb/conversion_procs/proc.mk,v
retrieving revision 1.6
diff -c -r1.6 proc.mk
*** src/backend/utils/mb/conversion_procs/proc.mk    23 Aug 2003 04:22:34 -0000    1.6
--- src/backend/utils/mb/conversion_procs/proc.mk    21 Jan 2004 19:24:05 -0000
***************
*** 12,18 ****
--- 12,20 ----
  include $(top_srcdir)/src/Makefile.shlib

  install: all
+ ifeq ($(enable_shared), yes)
      $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)
+ endif

  uninstall:
      rm -f $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)
Index: src/backend/utils/mb/conversion_procs/Makefile
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/utils/mb/conversion_procs/Makefile,v
retrieving revision 1.9
diff -c -r1.9 Makefile
*** src/backend/utils/mb/conversion_procs/Makefile    23 Aug 2003 04:22:34 -0000    1.9
--- src/backend/utils/mb/conversion_procs/Makefile    21 Jan 2004 19:24:05 -0000
***************
*** 147,152 ****
--- 147,153 ----
      @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done

  $(SQLSCRIPT): Makefile
+ ifeq ($(enable_shared), yes)
      @set $(CONVERSIONS) ; \
      while [ "$$#" -gt 0 ] ; \
      do \
***************
*** 160,165 ****
--- 161,169 ----
          echo "DROP CONVERSION pg_catalog.$$name;"; \
          echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
      done > $@
+ else
+     echo "-- No conversion support, for lack of shared library support" > $@
+ endif

  $(REGRESSION_SCRIPT): Makefile
      @cp regress_prolog $@; \
Index: src/pl/plperl/GNUmakefile
===================================================================
RCS file: /cvsroot/pgsql-server/src/pl/plperl/GNUmakefile,v
retrieving revision 1.10
diff -c -r1.10 GNUmakefile
*** src/pl/plperl/GNUmakefile    28 May 2002 16:57:53 -0000    1.10
--- src/pl/plperl/GNUmakefile    21 Jan 2004 19:24:05 -0000
***************
*** 37,43 ****
--- 37,49 ----
      $(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@

  install: all installdirs
+ ifeq ($(enable_shared), yes)
      $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)
+ else
+     @echo "*****"; \
+      echo "* PL/Perl was not installed due to lack of shared library support."; \
+      echo "*****"
+ endif

  installdirs:
      $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
Index: src/pl/plpython/Makefile
===================================================================
RCS file: /cvsroot/pgsql-server/src/pl/plpython/Makefile,v
retrieving revision 1.11
diff -c -r1.11 Makefile
*** src/pl/plpython/Makefile    5 Sep 2002 18:28:46 -0000    1.11
--- src/pl/plpython/Makefile    21 Jan 2004 19:24:05 -0000
***************
*** 32,38 ****
--- 32,44 ----
  all: all-lib

  install: all installdirs
+ ifeq ($(enable_shared), yes)
      $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)
+ else
+     @echo "*****"; \
+      echo "* PL/Python was not installed due to lack of shared library support."; \
+      echo "*****"
+ endif

  installdirs:
      $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
Index: src/pl/tcl/Makefile
===================================================================
RCS file: /cvsroot/pgsql-server/src/pl/tcl/Makefile,v
retrieving revision 1.40
diff -c -r1.40 Makefile
*** src/pl/tcl/Makefile    27 Sep 2003 19:35:32 -0000    1.40
--- src/pl/tcl/Makefile    21 Jan 2004 19:24:05 -0000
***************
*** 44,50 ****
--- 44,56 ----
      $(MAKE) -C modules $@

  install: all installdirs
+ ifeq ($(enable_shared), yes)
      $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)
+ else
+     @echo "*****"; \
+      echo "* PL/Tcl was not installed due to lack of shared library support."; \
+      echo "*****"
+ endif
      $(MAKE) -C modules $@

  installdirs:
***************
*** 60,66 ****
  # Provide dummy targets for the case where we can't build the shared library.
  all:
      @echo "*****"; \
!      echo "* Cannot build pltcl because Tcl is not a shared library; skipping it."; \
       echo "*****"

  endif # TCL_SHARED_BUILD = 0
--- 66,72 ----
  # Provide dummy targets for the case where we can't build the shared library.
  all:
      @echo "*****"; \
!      echo "* Cannot build PL/Tcl because Tcl is not a shared library; skipping it."; \
       echo "*****"

  endif # TCL_SHARED_BUILD = 0