Dear patchers,

Please find attached my first submission for installing all necessary
build files (makefile, scripts...) by default.

 - for the old behavior, do a "make light-install"

 - "make install" installs headers and other necessary files
   such as scripts and makefiles, for postgresql extensions
   to be build.

 - these files are installed in "pg_config --insbuilddir"
   the actual directory can be modified during configure with
   "--with-insbuilddir=DIR" option. Default is LIBDIR/build

 - the installation documentation is updated.

 - I also added a "install-client-only" target so as to simplify the doc.


What is yet to be done:

 - check that all necessary files are really there...
   esp. wrt win32/cygwin

 - provide an example makefile (script?) to build extensions, and install it!
   I'm planning to do that later.

 - check that the documentation is clear enough.

It validates (make check does perform a "make install").
I'm obviously ready to update the patch if necessary (missing files,
other default directories...).

Have a nice day,

-- 
Fabien Coelho - [EMAIL PROTECTED]
*** ./GNUmakefile.in.orig       Tue Apr 20 09:35:41 2004
--- ./GNUmakefile.in    Tue May 18 11:52:08 2004
***************
*** 13,30 ****
        $(MAKE) -C src all
        @echo "All of PostgreSQL successfully made. Ready to install."
  
! install:
        $(MAKE) -C doc install
        $(MAKE) -C src install
-       @echo "PostgreSQL installation complete."
  
  installdirs uninstall distprep:
        $(MAKE) -C doc $@
        $(MAKE) -C src $@
  
  install-all-headers:
        $(MAKE) -C src $@
  
  # clean, distclean, etc should apply to contrib too, even though
  # it's not built by default
  clean:
--- 13,51 ----
        $(MAKE) -C src all
        @echo "All of PostgreSQL successfully made. Ready to install."
  
! install: light-install install-all-headers install-config-files
!       @echo "PostgreSQL installation complete."
! 
! light-install:
        $(MAKE) -C doc install
        $(MAKE) -C src install
  
  installdirs uninstall distprep:
        $(MAKE) -C doc $@
        $(MAKE) -C src $@
  
+ uninstall:
+       $(RM) $(DESTDIR)$(insbuilddir)/* $(DESTDIR)$(insbuilddir)/config/*
+ 
  install-all-headers:
        $(MAKE) -C src $@
  
+ install-config-files: installdirs
+       $(MAKE) -C src $@
+       $(INSTALL_DATA) config.status $(DESTDIR)$(insbuilddir)
+       $(INSTALL_DATA) config/install-sh $(DESTDIR)$(insbuilddir)/config
+       $(INSTALL_DATA) config/mkinstalldirs $(DESTDIR)$(insbuilddir)/config
+ 
+ installdirs:
+       $(mkinstalldirs) $(DESTDIR)$(insbuilddir)
+       $(mkinstalldirs) $(DESTDIR)$(insbuilddir)/config
+ 
+ install-client-only:
+       $(MAKE) -C src/bin install
+       $(MAKE) -C src/include install
+       $(MAKE) -C src/interfaces install
+       $(MAKE) -C doc install
+ 
  # clean, distclean, etc should apply to contrib too, even though
  # it's not built by default
  clean:
*** ./configure.in.orig Mon May 17 14:00:03 2004
--- ./configure.in      Tue May 18 12:02:38 2004
***************
*** 128,133 ****
--- 128,144 ----
  
  
  #
+ # Installation directory for build utilities
+ #
+ PGAC_ARG(with, insbuilddir, 
+         [  --with-insbuilddir=DIR  install build utilities in DIR [[LIBDIR/build]]], 
+       [AC_MSG_ERROR([option --with-insbuilddir requires an argument])],
+       [AC_MSG_ERROR([option --without-insbuilddir does not apply])], 
+       [insbuilddir=$withval],
+       [insbuilddir='${libdir}/build'])
+ AC_SUBST(insbuilddir)
+ 
+ #
  # Add non-standard directories to the library search path
  #
  PGAC_ARG_REQ(with, libraries, [  --with-libraries=DIRS   look for additional 
libraries in DIRS],
*** ./doc/src/sgml/installation.sgml.orig       Mon May 17 18:54:02 2004
--- ./doc/src/sgml/installation.sgml    Tue May 18 11:42:02 2004
***************
*** 589,594 ****
--- 589,606 ----
        </varlistentry>
  
        <varlistentry>
+       
<term><option>--with-insbuilddir=<replaceable>DIRECTORY</replaceable></option></term>
+        <listitem>
+         <para>
+        Useful files for building <productname>PostgreSQL</productname>
+        extensions, such as makefiles or scripts, will be installed in this
+        directory.
+        The default is <filename><replaceable>LIBDIR</replaceable>/build</filename>
+       </para>
+        </listitem>
+       </varlistentry>
+ 
+       <varlistentry>
         <term><option>--with-docdir=<replaceable>DIRECTORY</></option></term>
         <term><option>--without-docdir</option></term>
         <listitem>
***************
*** 1035,1064 ****
     </para>
  
     <para>
!     The standard installation provides only the header files needed for client
!     application development.  If you plan to do any server-side program
!     development (such as custom functions or data types written in C),
!     then you may want to install the entire <productname>PostgreSQL</>
!     include tree into your target include directory.  To do that, enter
  <screen>
! <userinput>gmake install-all-headers</userinput>
  </screen>
!     This adds a megabyte or two to the installation footprint, and is only
!     useful if you don't plan to keep the whole source tree around for
!     reference.  (If you do, you can just use the source's include
!     directory when building server-side software.)
     </para>
  
     <formalpara>
      <title>Client-only installation:</title>
      <para>
       If you want to install only the client applications and
!      interface libraries, then you can use these commands:
  <screen>
! <userinput>gmake -C src/bin install</>
! <userinput>gmake -C src/include install</>
! <userinput>gmake -C src/interfaces install</>
! <userinput>gmake -C doc install</>
  </screen>
      </para>
     </formalpara>
--- 1047,1073 ----
     </para>
  
     <para>
!     The standard installation provides all the header files needed for client
!     application development, as well as headers for server-side program
!     development such as custom functions or data types written in C.
!     If you do not want to install the entire <productname>PostgreSQL</>
!     include tree into your target include directory.  Enter
  <screen>
! <userinput>gmake light-install</userinput>
  </screen>
!     rather than the <literal>install</literal> target.
!     This reduce by two megabytes the installation footprint, at the price
!     of having to recover the whole source tree if you need
!     to add extensions such as new data types or custom functions.
     </para>
  
     <formalpara>
      <title>Client-only installation:</title>
      <para>
       If you want to install only the client applications and
!      interface libraries, then you can use these command:
  <screen>
! <userinput>gmake install-client-only</>
  </screen>
      </para>
     </formalpara>
*** ./src/Makefile.global.in.orig       Mon May 17 14:00:06 2004
--- ./src/Makefile.global.in    Tue May 18 11:42:44 2004
***************
*** 113,118 ****
--- 113,119 ----
  
  localedir := @localedir@
  
+ insbuilddir := @insbuilddir@
  
  ##########################################################################
  #
*** ./src/Makefile.orig Fri Apr 30 17:18:16 2004
--- ./src/Makefile      Tue May 18 12:14:18 2004
***************
*** 26,31 ****
--- 26,46 ----
  install-all-headers:
        $(MAKE) -C include $@
  
+ install-config-files: installdirs
+       $(MAKE) -C utils $@
+       $(INSTALL_DATA) Makefile.global $(DESTDIR)$(insbuilddir)/src
+       $(INSTALL_DATA) Makefile.port $(DESTDIR)$(insbuilddir)/src
+       $(INSTALL_DATA) Makefile.shlib $(DESTDIR)$(insbuilddir)/src
+       $(INSTALL_DATA) nls-global.mk $(DESTDIR)$(insbuilddir)/src
+ 
+ uninstall:
+       $(MAKE) -C utils $@
+       $(RM) $(DESTDIR)$(insbuilddir)/* $(DESTDIR)$(insbuilddir)/src/*
+ 
+ installdirs:
+       $(mkinstalldirs) $(DESTDIR)$(insbuilddir)
+       $(mkinstalldirs) $(DESTDIR)$(insbuilddir)/src
+ 
  clean:
        $(MAKE) -C port $@
        $(MAKE) -C timezone $@
*** ./src/bin/pg_config/Makefile.orig   Sat Nov 29 20:52:04 2003
--- ./src/bin/pg_config/Makefile        Tue May 18 12:07:50 2004
***************
*** 14,19 ****
--- 14,20 ----
            -e 's,@pkglibdir@,$(pkglibdir),g' \
            -e "s|@configure@|$(configure_args)|g" \
            -e 's,@version@,$(VERSION),g' \
+           -e 's,@insbuilddir@,$(insbuilddir),g' \
          $< >$@
        chmod a+x $@
  
*** ./src/bin/pg_config/pg_config.sh.orig       Sat Nov 29 20:52:04 2003
--- ./src/bin/pg_config/pg_config.sh    Tue May 18 12:32:06 2004
***************
*** 19,24 ****
--- 19,25 ----
  val_pkglibdir='@pkglibdir@'
  val_configure="@configure@"
  val_version='@version@'
+ val_insbuilddir='@insbuilddir@'
  
  help="\
  $me provides information about the installed version of PostgreSQL.
***************
*** 35,40 ****
--- 36,42 ----
    --pkglibdir           show location of dynamically loadable modules
    --configure           show options given to 'configure' script when
                          PostgreSQL was built
+   --insbuilddir         show location of files for building extensions
    --version             show the PostgreSQL version, then exit
    --help                show this help, then exit
  
***************
*** 61,66 ****
--- 63,69 ----
          --libdir)       show="$show \$val_libdir";;
          --pkglibdir)    show="$show \$val_pkglibdir";;
          --configure)    show="$show \$val_configure";;
+       --insbuilddir)  show="$show \$val_insbuilddir";;
  
        --version)      echo "PostgreSQL $val_version"
                          exit 0;;
*** ./src/utils/Makefile.orig   Sat Nov 29 20:52:15 2003
--- ./src/utils/Makefile        Tue May 18 12:16:48 2004
***************
*** 16,18 ****
--- 16,24 ----
  
  clean distclean maintainer-clean:
        rm -f dllinit.o
+ 
+ uninstall:
+       $(RM) $(DESTDIR)$(insbuilddir)/dllinit.o
+ 
+ install-config-files:
+       -[ -f dllinit.o ] && $(INSTALL_DATA) dllinit.o $(DESTDIR)$(insbuilddir)
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to