Commit 6da56f3f authored by Magnus Hagander's avatar Magnus Hagander

Remove support for bcc and msvc standalone libpq builds

This removes the support for building just libpq using Borland C++ or
Visual C++. This has not worked properly for years, and given the number
of complaints it's clearly not worth the maintenance burden.

Building libpq using the standard MSVC build system is of course still
supported, along with mingw.
parent 258cef12
...@@ -34,14 +34,6 @@ ...@@ -34,14 +34,6 @@
<productname>Windows</productname>. <productname>Windows</productname>.
</para> </para>
<para>
Finally, the client access library
(<application>libpq</application>) can be built using
<productname>Visual C++ 7.1</productname> or
<productname>Borland C++</productname> for compatibility with statically
linked applications built using these tools.
</para>
<para> <para>
Building using <productname>MinGW</productname> or Building using <productname>MinGW</productname> or
<productname>Cygwin</productname> uses the normal build system, see <productname>Cygwin</productname> uses the normal build system, see
...@@ -539,113 +531,4 @@ $ENV{DOCROOT}='c:\docbook'; ...@@ -539,113 +531,4 @@ $ENV{DOCROOT}='c:\docbook';
</sect2> </sect2>
</sect1> </sect1>
<sect1 id="install-windows-libpq">
<title>Building <application>libpq</application> with
<productname>Visual C++</productname> or
<productname>Borland C++</productname></title>
<para>
Using <productname>Visual C++ 7.1-9.0</productname> or
<productname>Borland C++</productname> to build libpq is only recommended
if you need a version with different debug/release flags, or if you need a
static library to link into an application. For normal use the
<productname>MinGW</productname> or
<productname>Visual Studio</productname> or
<productname>Windows SDK</productname> method is recommended.
</para>
<para>
To build the <application>libpq</application> client library using
<productname>Visual Studio 7.1 or later</productname>, change into the
<filename>src</filename> directory and type the command:
<screen>
<userinput>nmake /f win32.mak</userinput>
</screen>
</para>
<para>
To build a 64-bit version of the <application>libpq</application>
client library using <productname>Visual Studio 8.0 or
later</productname>, change into the <filename>src</filename>
directory and type in the command:
<screen>
<userinput>nmake /f win32.mak CPU=AMD64</userinput>
</screen>
See the <filename>win32.mak</filename> file for further details
about supported variables.
</para>
<para>
To build the <application>libpq</application> client library using
<productname>Borland C++</productname>, change into the
<filename>src</filename> directory and type the command:
<screen>
<userinput>make -N -DCFG=Release /f bcc32.mak</userinput>
</screen>
</para>
<sect2>
<title>Generated Files</title>
<para>
The following files will be built:
<variablelist>
<varlistentry>
<term><filename>interfaces\libpq\Release\libpq.dll</filename></term>
<listitem>
<para>
The dynamically linkable frontend library
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>interfaces\libpq\Release\libpqdll.lib</filename></term>
<listitem>
<para>
Import library to link your programs to <filename>libpq.dll</filename>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>interfaces\libpq\Release\libpq.lib</filename></term>
<listitem>
<para>
Static version of the frontend library
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
Normally you do not need to install any of the client files. You should
place the <filename>libpq.dll</filename> file in the same directory
as your applications executable file. Do not install
<filename>libpq.dll</filename> into your <filename>Windows</>,
<filename>System</> or <filename>System32</> directory unless
absolutely necessary.
If this file is installed using a setup program, then it should
be installed with version checking using the
<symbol>VERSIONINFO</symbol> resource included in the file, to
ensure that a newer version of the library is not overwritten.
</para>
<para>
If you are planning to do development using <application>libpq</application>
on this machine, you will have to add the
<filename>src\include</filename> and
<filename>src\interfaces\libpq</filename> subdirectories of the source
tree to the include path in your compiler's settings.
</para>
<para>
To use the library, you must add the
<filename>libpqdll.lib</filename> file to your project. (In Visual
C++, just right-click on the project and choose to add it.)
</para>
</sect2>
</sect1>
</chapter> </chapter>
...@@ -405,30 +405,22 @@ endif # PORTNAME == cygwin || PORTNAME == win32 ...@@ -405,30 +405,22 @@ endif # PORTNAME == cygwin || PORTNAME == win32
# tarballs. # tarballs.
ifneq (,$(SHLIB_EXPORTS)) ifneq (,$(SHLIB_EXPORTS))
distprep: lib$(NAME)dll.def lib$(NAME)ddll.def blib$(NAME)dll.def distprep: lib$(NAME)dll.def lib$(NAME)ddll.def
UC_NAME = $(shell echo $(NAME) | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') UC_NAME = $(shell echo $(NAME) | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')
lib$(NAME)dll.def: $(SHLIB_EXPORTS) lib$(NAME)dll.def: $(SHLIB_EXPORTS)
echo '; DEF file for win32.mak release build and for Makefile.shlib (MinGW)' >$@ echo '; DEF file for Makefile.shlib (MinGW)' >$@
echo 'LIBRARY LIB$(UC_NAME).dll' >>$@ echo 'LIBRARY LIB$(UC_NAME).dll' >>$@
echo 'EXPORTS' >>$@ echo 'EXPORTS' >>$@
sed -e '/^#/d' -e 's/^\(.*[ ]\)\([0-9][0-9]*\)/ \1@ \2/' $< >>$@ sed -e '/^#/d' -e 's/^\(.*[ ]\)\([0-9][0-9]*\)/ \1@ \2/' $< >>$@
lib$(NAME)ddll.def: $(SHLIB_EXPORTS) lib$(NAME)ddll.def: $(SHLIB_EXPORTS)
echo '; DEF file for win32.mak debug build' >$@ echo '; DEF file for Makefile.shlib (MinGW)' >$@
echo 'LIBRARY LIB$(UC_NAME)D.dll' >>$@ echo 'LIBRARY LIB$(UC_NAME)D.dll' >>$@
echo 'EXPORTS' >>$@ echo 'EXPORTS' >>$@
sed -e '/^#/d' -e 's/^\(.*[ ]\)\([0-9][0-9]*\)/ \1@ \2/' $< >>$@ sed -e '/^#/d' -e 's/^\(.*[ ]\)\([0-9][0-9]*\)/ \1@ \2/' $< >>$@
blib$(NAME)dll.def: $(SHLIB_EXPORTS)
echo '; DEF file for bcc32.mak (Borland C++ Builder)' >$@
echo 'LIBRARY BLIB$(UC_NAME)' >>$@
echo 'EXPORTS' >>$@
sed -e '/^#/d' -e 's/^\(.*[ ]\)\([0-9][0-9]*\)/ _\1@ \2/' $< >>$@
echo >>$@
echo '; Aliases for MS compatible names' >> $@
sed -e '/^#/d' -e 's/^\(.*[ ]\)\([0-9][0-9]*\)/ \1= _\1/' $< | sed 's/ *$$//' >>$@
endif # SHLIB_EXPORTS endif # SHLIB_EXPORTS
...@@ -517,5 +509,5 @@ clean-lib: ...@@ -517,5 +509,5 @@ clean-lib:
ifneq (,$(SHLIB_EXPORTS)) ifneq (,$(SHLIB_EXPORTS))
maintainer-clean-lib: maintainer-clean-lib:
rm -f lib$(NAME)dll.def lib$(NAME)ddll.def blib$(NAME)dll.def rm -f lib$(NAME)dll.def lib$(NAME)ddll.def
endif endif
# src/bcc32.mak
# Makefile for Borland C++ 5.5 (or compat)
# Top-file makefile for building Win32 libpq with Borland C++.
!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running MAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE make -DCFG=[Release | Debug] /f bcc32.mak
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Release" (Win32 Release)
!MESSAGE "Debug" (Win32 Debug)
!MESSAGE
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
ALL:
cd include
if not exist pg_config.h copy pg_config.h.win32 pg_config.h
if not exist pg_config_ext.h copy pg_config_ext.h.win32 pg_config_ext.h
if not exist pg_config_os.h copy port\win32.h pg_config_os.h
cd ..
cd interfaces\libpq
make -N -DCFG=$(CFG) /f bcc32.mak
cd ..\..
echo All Win32 parts have been built!
CLEAN:
cd interfaces\libpq
make -N -DCFG=Release /f bcc32.mak CLEAN
make -N -DCFG=Debug /f bcc32.mak CLEAN
cd ..\..
echo All Win32 parts have been cleaned!
DISTCLEAN: CLEAN
cd include
del pg_config.h pg_config_ext.h pg_config_os.h
cd ..
...@@ -8,10 +8,6 @@ ...@@ -8,10 +8,6 @@
#include "postgres_fe.h" #include "postgres_fe.h"
#include "command.h" #include "command.h"
#ifdef __BORLANDC__ /* needed for BCC */
#undef mkdir
#endif
#include <ctype.h> #include <ctype.h>
#include <time.h> #include <time.h>
#include <pwd.h> #include <pwd.h>
......
...@@ -44,10 +44,8 @@ ...@@ -44,10 +44,8 @@
#ifndef WSA_NOT_ENOUGH_MEMORY #ifndef WSA_NOT_ENOUGH_MEMORY
#define WSA_NOT_ENOUGH_MEMORY (WSAENOBUFS) #define WSA_NOT_ENOUGH_MEMORY (WSAENOBUFS)
#endif #endif
#ifndef __BORLANDC__
#define WSATYPE_NOT_FOUND (WSABASEERR+109) #define WSATYPE_NOT_FOUND (WSABASEERR+109)
#endif #endif
#endif
#define EAI_AGAIN WSATRY_AGAIN #define EAI_AGAIN WSATRY_AGAIN
#define EAI_BADFLAGS WSAEINVAL #define EAI_BADFLAGS WSAEINVAL
#define EAI_FAIL WSANO_RECOVERY #define EAI_FAIL WSANO_RECOVERY
......
...@@ -403,7 +403,7 @@ extern size_t strlcat(char *dst, const char *src, size_t siz); ...@@ -403,7 +403,7 @@ extern size_t strlcat(char *dst, const char *src, size_t siz);
extern size_t strlcpy(char *dst, const char *src, size_t siz); extern size_t strlcpy(char *dst, const char *src, size_t siz);
#endif #endif
#if !defined(HAVE_RANDOM) && !defined(__BORLANDC__) #if !defined(HAVE_RANDOM)
extern long random(void); extern long random(void);
#endif #endif
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#error "should be included via atomics.h" #error "should be included via atomics.h"
#endif #endif
/* Should work on both MSVC and Borland. */
#pragma intrinsic(_ReadWriteBarrier) #pragma intrinsic(_ReadWriteBarrier)
#define pg_compiler_barrier_impl() _ReadWriteBarrier() #define pg_compiler_barrier_impl() _ReadWriteBarrier()
......
/* src/include/port/win32.h */ /* src/include/port/win32.h */
#if defined(_MSC_VER) || defined(__BORLANDC__) #if defined(_MSC_VER)
#define WIN32_ONLY_COMPILER #define WIN32_ONLY_COMPILER
#endif #endif
...@@ -32,9 +32,7 @@ ...@@ -32,9 +32,7 @@
* Always build with SSPI support. Keep it as a #define in case * Always build with SSPI support. Keep it as a #define in case
* we want a switch to disable it sometime in the future. * we want a switch to disable it sometime in the future.
*/ */
#ifndef __BORLANDC__
#define ENABLE_SSPI 1 #define ENABLE_SSPI 1
#endif
/* undefine and redefine after #include */ /* undefine and redefine after #include */
#undef mkdir #undef mkdir
...@@ -56,9 +54,7 @@ ...@@ -56,9 +54,7 @@
#include <signal.h> #include <signal.h>
#include <errno.h> #include <errno.h>
#include <direct.h> #include <direct.h>
#ifndef __BORLANDC__
#include <sys/utime.h> /* for non-unicode version */ #include <sys/utime.h> /* for non-unicode version */
#endif
#undef near #undef near
/* Must be here to avoid conflicting with prototype in windows.h */ /* Must be here to avoid conflicting with prototype in windows.h */
...@@ -207,10 +203,8 @@ ...@@ -207,10 +203,8 @@
#define SIGTTIN 21 #define SIGTTIN 21
#define SIGTTOU 22 /* Same as SIGABRT -- no problem, I hope */ #define SIGTTOU 22 /* Same as SIGABRT -- no problem, I hope */
#define SIGWINCH 28 #define SIGWINCH 28
#ifndef __BORLANDC__
#define SIGUSR1 30 #define SIGUSR1 30
#define SIGUSR2 31 #define SIGUSR2 31
#endif
/* /*
* New versions of mingw have gettimeofday() and also declare * New versions of mingw have gettimeofday() and also declare
...@@ -421,7 +415,7 @@ extern int pgwin32_is_admin(void); ...@@ -421,7 +415,7 @@ extern int pgwin32_is_admin(void);
#define putenv(x) pgwin32_putenv(x) #define putenv(x) pgwin32_putenv(x)
#define unsetenv(x) pgwin32_unsetenv(x) #define unsetenv(x) pgwin32_unsetenv(x)
/* Things that exist in MingW headers, but need to be added to MSVC & BCC */ /* Things that exist in MingW headers, but need to be added to MSVC */
#ifdef WIN32_ONLY_COMPILER #ifdef WIN32_ONLY_COMPILER
#ifndef _WIN64 #ifndef _WIN64
...@@ -430,7 +424,6 @@ typedef long ssize_t; ...@@ -430,7 +424,6 @@ typedef long ssize_t;
typedef __int64 ssize_t; typedef __int64 ssize_t;
#endif #endif
#ifndef __BORLANDC__
typedef unsigned short mode_t; typedef unsigned short mode_t;
#define S_IRUSR _S_IREAD #define S_IRUSR _S_IREAD
...@@ -440,7 +433,6 @@ typedef unsigned short mode_t; ...@@ -440,7 +433,6 @@ typedef unsigned short mode_t;
/* see also S_IRGRP etc below */ /* see also S_IRGRP etc below */
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif /* __BORLANDC__ */
#define F_OK 0 #define F_OK 0
#define W_OK 2 #define W_OK 2
...@@ -454,26 +446,9 @@ typedef unsigned short mode_t; ...@@ -454,26 +446,9 @@ typedef unsigned short mode_t;
/* Pulled from Makefile.port in mingw */ /* Pulled from Makefile.port in mingw */
#define DLSUFFIX ".dll" #define DLSUFFIX ".dll"
#ifdef __BORLANDC__
/* for port/dirent.c */
#ifndef INVALID_FILE_ATTRIBUTES
#define INVALID_FILE_ATTRIBUTES ((DWORD) -1)
#endif
/* for port/open.c */
#ifndef O_RANDOM
#define O_RANDOM 0x0010 /* File access is primarily random */
#define O_SEQUENTIAL 0x0020 /* File access is primarily sequential */
#define O_TEMPORARY 0x0040 /* Temporary file bit */
#define O_SHORT_LIVED 0x1000 /* Temporary storage file, try not to flush */
#define _O_SHORT_LIVED O_SHORT_LIVED
#endif /* ifndef O_RANDOM */
#endif /* __BORLANDC__ */
#endif /* WIN32_ONLY_COMPILER */ #endif /* WIN32_ONLY_COMPILER */
/* These aren't provided by either MingW or MSVC */ /* These aren't provided by either MingW or MSVC */
#ifndef __BORLANDC__
#define S_IRGRP 0 #define S_IRGRP 0
#define S_IWGRP 0 #define S_IWGRP 0
#define S_IXGRP 0 #define S_IXGRP 0
...@@ -482,5 +457,3 @@ typedef unsigned short mode_t; ...@@ -482,5 +457,3 @@ typedef unsigned short mode_t;
#define S_IWOTH 0 #define S_IWOTH 0
#define S_IXOTH 0 #define S_IXOTH 0
#define S_IRWXO 0 #define S_IRWXO 0
#endif /* __BORLANDC__ */
# Makefile for Borland C++ 5.5
# Will build a Win32 static library libpq.lib
# and a Win32 dynamic library libpq.dll with import library libpqdll.lib
# Borland C++ base install directory goes here
# BCB=c:\Borland\Bcc55
!IF "$(BCB)" == ""
!MESSAGE You must edit bcc32.mak and define BCB at the top
!ERROR missing BCB
!ENDIF
!IF "$(__NMAKE__)" == ""
!MESSAGE You must use the -N compatibility flag, e.g. make -N -f bcc32.make
!ERROR missing -N
!ENDIF
!MESSAGE Building the Win32 DLL and Static Library...
!MESSAGE
!IF "$(CFG)" == ""
CFG=Release
!MESSAGE No configuration specified. Defaulting to Release.
!MESSAGE
!ELSE
!MESSAGE Configuration "$(CFG)"
!MESSAGE
!ENDIF
!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running MAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE make -N -DCFG=[Release | Debug] -f bcc32.mak
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Release" (Win32 Release DLL and Static Library)
!MESSAGE "Debug" (Win32 Debug DLL and Static Library)
!MESSAGE
!ERROR An invalid configuration was specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "Debug"
DEBUG=1
OUTDIR=.\Debug
INTDIR=.\Debug
!ELSE
OUTDIR=.\Release
INTDIR=.\Release
!ENDIF
OUTFILENAME=blibpq
USERDEFINES=FRONTEND;NDEBUG;WIN32;_WINDOWS
CPP=bcc32.exe
CPP_PROJ = -I..\..\include\port\win32_msvc;$(BCB)\include;..\..\include;..\..\include\port\win32;..\..\port -n"$(INTDIR)" -WD -c -D$(USERDEFINES) -tWM \
-a8 -X -w-use -w-par -w-pia -w-csu -w-aus -w-ccc
!IFDEF DEBUG
CPP_PROJ = $(CPP_PROJ) -Od -r- -k -v -y -vi- -D_DEBUG
!else
CPP_PROJ = $(CPP_PROJ) -O -Oi -OS -DNDEBUG
!endif
ALL : config "$(OUTDIR)" "$(OUTDIR)\blibpq.dll" "$(OUTDIR)\blibpq.lib"
CLEAN :
-@erase "$(INTDIR)\getaddrinfo.obj"
-@erase "$(INTDIR)\pgstrcasecmp.obj"
-@erase "$(INTDIR)\pqsignal.obj"
-@erase "$(INTDIR)\thread.obj"
-@erase "$(INTDIR)\inet_aton.obj"
-@erase "$(INTDIR)\crypt.obj"
-@erase "$(INTDIR)\noblock.obj"
-@erase "$(INTDIR)\chklocale.obj"
-@erase "$(INTDIR)\inet_net_ntop.obj"
-@erase "$(INTDIR)\md5.obj"
-@erase "$(INTDIR)\ip.obj"
-@erase "$(INTDIR)\fe-auth.obj"
-@erase "$(INTDIR)\fe-protocol2.obj"
-@erase "$(INTDIR)\fe-protocol3.obj"
-@erase "$(INTDIR)\fe-connect.obj"
-@erase "$(INTDIR)\fe-exec.obj"
-@erase "$(INTDIR)\fe-lobj.obj"
-@erase "$(INTDIR)\fe-misc.obj"
-@erase "$(INTDIR)\fe-print.obj"
-@erase "$(INTDIR)\fe-secure.obj"
-@erase "$(INTDIR)\libpq-events.obj"
-@erase "$(INTDIR)\pqexpbuffer.obj"
-@erase "$(INTDIR)\win32.obj"
-@erase "$(INTDIR)\wchar.obj"
-@erase "$(INTDIR)\encnames.obj"
-@erase "$(INTDIR)\pthread-win32.obj"
-@erase "$(INTDIR)\snprintf.obj"
-@erase "$(INTDIR)\strlcpy.obj"
-@erase "$(INTDIR)\dirent.obj"
-@erase "$(INTDIR)\dirmod.obj"
-@erase "$(INTDIR)\pgsleep.obj"
-@erase "$(INTDIR)\open.obj"
-@erase "$(INTDIR)\system.obj"
-@erase "$(INTDIR)\win32error.obj"
-@erase "$(OUTDIR)\$(OUTFILENAME).lib"
-@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib"
-@erase "$(OUTDIR)\libpq.res"
-@erase "$(OUTDIR)\$(OUTFILENAME).dll"
-@erase "$(OUTDIR)\$(OUTFILENAME).tds"
-@erase "$(INTDIR)\pg_config_paths.h"
LIB32=tlib.exe
LIB32_FLAGS=
LIB32_OBJS= \
"$(INTDIR)\win32.obj" \
"$(INTDIR)\getaddrinfo.obj" \
"$(INTDIR)\pgstrcasecmp.obj" \
"$(INTDIR)\pqsignal.obj" \
"$(INTDIR)\thread.obj" \
"$(INTDIR)\inet_aton.obj" \
"$(INTDIR)\crypt.obj" \
"$(INTDIR)\noblock.obj" \
"$(INTDIR)\chklocale.obj" \
"$(INTDIR)\inet_net_ntop.obj" \
"$(INTDIR)\md5.obj" \
"$(INTDIR)\ip.obj" \
"$(INTDIR)\fe-auth.obj" \
"$(INTDIR)\fe-protocol2.obj" \
"$(INTDIR)\fe-protocol3.obj" \
"$(INTDIR)\fe-connect.obj" \
"$(INTDIR)\fe-exec.obj" \
"$(INTDIR)\fe-lobj.obj" \
"$(INTDIR)\fe-misc.obj" \
"$(INTDIR)\fe-print.obj" \
"$(INTDIR)\fe-secure.obj" \
"$(INTDIR)\libpq-events.obj" \
"$(INTDIR)\pqexpbuffer.obj" \
"$(INTDIR)\wchar.obj" \
"$(INTDIR)\encnames.obj" \
"$(INTDIR)\snprintf.obj" \
"$(INTDIR)\strlcpy.obj" \
"$(INTDIR)\dirent.obj" \
"$(INTDIR)\dirmod.obj" \
"$(INTDIR)\pgsleep.obj" \
"$(INTDIR)\open.obj" \
"$(INTDIR)\system.obj" \
"$(INTDIR)\win32error.obj" \
"$(INTDIR)\pthread-win32.obj"
config: ..\..\include\pg_config.h ..\..\include\pg_config_ext.h ..\..\include\pg_config_os.h pg_config_paths.h
..\..\include\pg_config.h: ..\..\include\pg_config.h.win32
copy ..\..\include\pg_config.h.win32 ..\..\include\pg_config.h
..\..\include\pg_config_ext.h: ..\..\include\pg_config_ext.h.win32
copy ..\..\include\pg_config_ext.h.win32 ..\..\include\pg_config_ext.h
..\..\include\pg_config_os.h: ..\..\include\port\win32.h
copy ..\..\include\port\win32.h ..\..\include\pg_config_os.h
# Have to use \# so # isn't treated as a comment, but MSVC doesn't like this
pg_config_paths.h: bcc32.mak
echo \#define SYSCONFDIR "" > pg_config_paths.h
"$(OUTDIR)" :
@if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
RSC=brcc32.exe
RSC_PROJ=-l 0x409 -i$(BCB)\include -fo"$(INTDIR)\libpq.res"
LINK32=ilink32.exe
LINK32_FLAGS = -Gn -L$(BCB)\lib;$(INTDIR); -x -Tpd -v
# @<< is a Response file, http://www.opussoftware.com/tutorial/TutMakefile.htm
"$(OUTDIR)\blibpq.dll": "$(OUTDIR)\blibpq.lib" "$(INTDIR)\libpq.res" blibpqdll.def
$(LINK32) @<<
$(LINK32_FLAGS) +
c0d32.obj , +
$@,, +
"$(OUTDIR)\blibpq.lib" import32.lib cw32mt.lib, +
blibpqdll.def,"$(INTDIR)\libpq.res"
<<
implib -w "$(OUTDIR)\blibpqdll.lib" blibpqdll.def $@
"$(INTDIR)\libpq.res" : "$(INTDIR)" libpq-dist.rc
$(RSC) $(RSC_PROJ) libpq-dist.rc
"$(OUTDIR)\blibpq.lib": $(LIB32_OBJS)
$(LIB32) $@ @<<
+-"$(**: =" &^
+-")"
<<
"$(INTDIR)\getaddrinfo.obj" : ..\..\port\getaddrinfo.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\getaddrinfo.c
<<
"$(INTDIR)\pgstrcasecmp.obj" : ..\..\port\pgstrcasecmp.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\pgstrcasecmp.c
<<
"$(INTDIR)\pqsignal.obj" : ..\..\port\pqsignal.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\pqsignal.c
<<
"$(INTDIR)\thread.obj" : ..\..\port\thread.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\thread.c
<<
"$(INTDIR)\inet_aton.obj" : ..\..\port\inet_aton.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\inet_aton.c
<<
"$(INTDIR)\crypt.obj" : ..\..\port\crypt.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\crypt.c
<<
"$(INTDIR)\noblock.obj" : ..\..\port\noblock.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\noblock.c
<<
"$(INTDIR)\chklocale.obj" : ..\..\port\chklocale.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\chklocale.c
<<
"$(INTDIR)\inet_net_ntop.obj" : ..\..\port\inet_net_ntop.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\inet_net_ntop.c
<<
"$(INTDIR)\md5.obj" : ..\..\backend\libpq\md5.c
$(CPP) @<<
$(CPP_PROJ) ..\..\backend\libpq\md5.c
<<
"$(INTDIR)\ip.obj" : ..\..\backend\libpq\ip.c
$(CPP) @<<
$(CPP_PROJ) ..\..\backend\libpq\ip.c
<<
"$(INTDIR)\wchar.obj" : ..\..\backend\utils\mb\wchar.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\backend\utils\mb\wchar.c
<<
"$(INTDIR)\encnames.obj" : ..\..\backend\utils\mb\encnames.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\backend\utils\mb\encnames.c
<<
"$(INTDIR)\snprintf.obj" : ..\..\port\snprintf.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\snprintf.c
<<
"$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\strlcpy.c
<<
"$(INTDIR)\dirent.obj" : ..\..\port\dirent.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\dirent.c
<<
"$(INTDIR)\dirmod.obj" : ..\..\port\dirmod.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\dirmod.c
<<
"$(INTDIR)\pgsleep.obj" : ..\..\port\pgsleep.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\pgsleep.c
<<
"$(INTDIR)\open.obj" : ..\..\port\open.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\open.c
<<
"$(INTDIR)\system.obj" : ..\..\port\system.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\system.c
<<
"$(INTDIR)\win32error.obj" : ..\..\port\win32error.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\win32error.c
<<
.c.obj:
$(CPP) $(CPP_PROJ) $<
...@@ -7,17 +7,11 @@ ...@@ -7,17 +7,11 @@
/* /*
* Some compatibility functions * Some compatibility functions
*/ */
#ifdef __BORLANDC__
#define _timeb timeb
#define _ftime(a) ftime(a)
#define _errno errno
#define popen(a,b) _popen(a,b)
#else
/* open provided elsewhere */ /* open provided elsewhere */
#define close(a) _close(a) #define close(a) _close(a)
#define read(a,b,c) _read(a,b,c) #define read(a,b,c) _read(a,b,c)
#define write(a,b,c) _write(a,b,c) #define write(a,b,c) _write(a,b,c)
#endif
#undef EAGAIN /* doesn't apply on sockets */ #undef EAGAIN /* doesn't apply on sockets */
#undef EINTR #undef EINTR
......
# Makefile for Microsoft Visual C++ 7.1-8.0
# Will build a static library libpq(d).lib
# and a dynamic library libpq(d).dll with import library libpq(d)dll.lib
# USE_OPENSSL=1 will compile with OpenSSL
# USE_KFW=1 will compile with kfw(kerberos for Windows)
# DEBUG=1 compiles with debugging symbols
# ENABLE_THREAD_SAFETY=1 compiles with threading enabled
ENABLE_THREAD_SAFETY=1
# CPU="i386" or CPU environment of nmake.exe (AMD64 or IA64)
!IF ("$(CPU)" == "")||("$(CPU)" == "i386")
CPU=i386
!MESSAGE Building the Win32 static library...
!MESSAGE
!ELSEIF ("$(CPU)" == "IA64")||("$(CPU)" == "AMD64")
ADD_DEFINES=/Wp64 /GS
ADD_SECLIB=bufferoverflowU.lib
!MESSAGE Building the Win64 static library...
!MESSAGE
!ELSE
!MESSAGE Please check a CPU=$(CPU) ?
!MESSAGE CPU=i386 or AMD64 or IA64
!ERROR Make aborted.
!ENDIF
!IFDEF DEBUG
OPT=/Od /Zi /MDd
LOPT=/DEBUG
DEBUGDEF=/D _DEBUG
OUTFILENAME=libpqd
!ELSE
OPT=/O2 /MD
LOPT=
DEBUGDEF=/D NDEBUG
OUTFILENAME=libpq
!ENDIF
!IF "$(SSL_INC)" == ""
SSL_INC=C:\OpenSSL\include
!MESSAGE Using default OpenSSL Include directory: $(SSL_INC)
!ENDIF
!IF "$(SSL_LIB_PATH)" == ""
SSL_LIB_PATH=C:\OpenSSL\lib\VC
!MESSAGE Using default OpenSSL Library directory: $(SSL_LIB_PATH)
!ENDIF
!IF "$(KFW_INC)" == ""
KFW_INC=C:\kfw-2.6.5\inc
!MESSAGE Using default Kerberos Include directory: $(KFW_INC)
!ENDIF
!IF "$(KFW_LIB_PATH)" == ""
KFW_LIB_PATH=C:\kfw-2.6.5\lib\$(CPU)
!MESSAGE Using default Kerberos Library directory: $(KFW_LIB_PATH)
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
CPP=cl.exe
RSC=rc.exe
!IFDEF DEBUG
OUTDIR=.\Debug
INTDIR=.\Debug
CPP_OBJS=.\Debug/
!ELSE
OUTDIR=.\Release
INTDIR=.\Release
CPP_OBJS=.\Release/
!ENDIF
ALL : config "$(OUTDIR)\$(OUTFILENAME).lib" "$(OUTDIR)\$(OUTFILENAME).dll"
CLEAN :
-@erase "$(INTDIR)\getaddrinfo.obj"
-@erase "$(INTDIR)\pgstrcasecmp.obj"
-@erase "$(INTDIR)\pqsignal.obj"
-@erase "$(INTDIR)\thread.obj"
-@erase "$(INTDIR)\inet_aton.obj"
-@erase "$(INTDIR)\crypt.obj"
-@erase "$(INTDIR)\noblock.obj"
-@erase "$(INTDIR)\chklocale.obj"
-@erase "$(INTDIR)\inet_net_ntop.obj"
-@erase "$(INTDIR)\md5.obj"
-@erase "$(INTDIR)\ip.obj"
-@erase "$(INTDIR)\fe-auth.obj"
-@erase "$(INTDIR)\fe-protocol2.obj"
-@erase "$(INTDIR)\fe-protocol3.obj"
-@erase "$(INTDIR)\fe-connect.obj"
-@erase "$(INTDIR)\fe-exec.obj"
-@erase "$(INTDIR)\fe-lobj.obj"
-@erase "$(INTDIR)\fe-misc.obj"
-@erase "$(INTDIR)\fe-print.obj"
-@erase "$(INTDIR)\fe-secure.obj"
-@erase "$(INTDIR)\libpq-events.obj"
-@erase "$(INTDIR)\pqexpbuffer.obj"
-@erase "$(INTDIR)\win32.obj"
-@erase "$(INTDIR)\wchar.obj"
-@erase "$(INTDIR)\encnames.obj"
-@erase "$(INTDIR)\pthread-win32.obj"
-@erase "$(INTDIR)\snprintf.obj"
-@erase "$(INTDIR)\strlcpy.obj"
-@erase "$(INTDIR)\dirent.obj"
-@erase "$(INTDIR)\dirmod.obj"
-@erase "$(INTDIR)\pgsleep.obj"
-@erase "$(INTDIR)\open.obj"
-@erase "$(INTDIR)\system.obj"
-@erase "$(INTDIR)\win32error.obj"
-@erase "$(INTDIR)\win32setlocale.obj"
-@erase "$(OUTDIR)\$(OUTFILENAME).lib"
-@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib"
-@erase "$(OUTDIR)\libpq.res"
-@erase "$(OUTDIR)\$(OUTFILENAME).dll"
-@erase "$(OUTDIR)\$(OUTFILENAME)dll.exp"
-@erase "$(OUTDIR)\$(OUTFILENAME).dll.manifest"
-@erase "$(OUTDIR)\*.idb"
-@erase pg_config_paths.h"
!IFDEF USE_OPENSSL
-@erase "$(INTDIR)\fe-secure-openssl.obj"
!ENDIF
LIB32=link.exe -lib
LIB32_FLAGS=$(LOPT) /nologo /out:"$(OUTDIR)\$(OUTFILENAME).lib"
LIB32_OBJS= \
"$(INTDIR)\win32.obj" \
"$(INTDIR)\getaddrinfo.obj" \
"$(INTDIR)\pgstrcasecmp.obj" \
"$(INTDIR)\pqsignal.obj" \
"$(INTDIR)\thread.obj" \
"$(INTDIR)\inet_aton.obj" \
"$(INTDIR)\crypt.obj" \
"$(INTDIR)\noblock.obj" \
"$(INTDIR)\chklocale.obj" \
"$(INTDIR)\inet_net_ntop.obj" \
"$(INTDIR)\md5.obj" \
"$(INTDIR)\ip.obj" \
"$(INTDIR)\fe-auth.obj" \
"$(INTDIR)\fe-protocol2.obj" \
"$(INTDIR)\fe-protocol3.obj" \
"$(INTDIR)\fe-connect.obj" \
"$(INTDIR)\fe-exec.obj" \
"$(INTDIR)\fe-lobj.obj" \
"$(INTDIR)\fe-misc.obj" \
"$(INTDIR)\fe-print.obj" \
"$(INTDIR)\fe-secure.obj" \
"$(INTDIR)\libpq-events.obj" \
"$(INTDIR)\pqexpbuffer.obj" \
"$(INTDIR)\wchar.obj" \
"$(INTDIR)\encnames.obj" \
"$(INTDIR)\snprintf.obj" \
"$(INTDIR)\strlcpy.obj" \
"$(INTDIR)\dirent.obj" \
"$(INTDIR)\dirmod.obj" \
"$(INTDIR)\pgsleep.obj" \
"$(INTDIR)\open.obj" \
"$(INTDIR)\system.obj" \
"$(INTDIR)\win32error.obj" \
"$(INTDIR)\win32setlocale.obj" \
"$(INTDIR)\pthread-win32.obj"
!IFDEF USE_OPENSSL
LIB32_OBJS=$(LIB32_OBJS) "$(INTDIR)\fe-secure-openssl.obj"
!ENDIF
config: ..\..\include\pg_config.h ..\..\include\pg_config_ext.h pg_config_paths.h ..\..\include\pg_config_os.h
..\..\include\pg_config.h: ..\..\include\pg_config.h.win32
copy ..\..\include\pg_config.h.win32 ..\..\include\pg_config.h
..\..\include\pg_config_ext.h: ..\..\include\pg_config_ext.h.win32
copy ..\..\include\pg_config_ext.h.win32 ..\..\include\pg_config_ext.h
..\..\include\pg_config_os.h:
copy ..\..\include\port\win32.h ..\..\include\pg_config_os.h
pg_config_paths.h: win32.mak
echo #define SYSCONFDIR "" > pg_config_paths.h
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /W3 /EHsc $(OPT) /I "..\..\include" /I "..\..\include\port\win32" /I "..\..\include\port\win32_msvc" /I "..\..\port" /I. /I "$(SSL_INC)" \
/D "FRONTEND" $(DEBUGDEF) \
/D "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\libpq.pch" \
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c \
/D "_CRT_SECURE_NO_DEPRECATE" $(ADD_DEFINES)
!IFDEF USE_OPENSSL
CPP_PROJ=$(CPP_PROJ) /D USE_OPENSSL
SSL_LIBS=ssleay32.lib libeay32.lib gdi32.lib
!ENDIF
!IFDEF USE_KFW
CPP_PROJ=$(CPP_PROJ) /D KRB5
KFW_LIBS=krb5_32.lib comerr32.lib gssapi32.lib
!ENDIF
!IFDEF ENABLE_THREAD_SAFETY
CPP_PROJ=$(CPP_PROJ) /D ENABLE_THREAD_SAFETY
!ENDIF
CPP_SBRS=.
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\libpq.res"
LINK32=link.exe
LINK32_FLAGS=kernel32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib secur32.lib $(SSL_LIBS) $(KFW_LIB) $(ADD_SECLIB) \
/nologo /subsystem:windows /dll $(LOPT) /incremental:no \
/pdb:"$(OUTDIR)\libpqdll.pdb" /machine:$(CPU) \
/out:"$(OUTDIR)\$(OUTFILENAME).dll"\
/implib:"$(OUTDIR)\$(OUTFILENAME)dll.lib" \
/libpath:"$(SSL_LIB_PATH)" /libpath:"$(KFW_LIB_PATH)" \
/def:$(OUTFILENAME)dll.def
LINK32_OBJS= \
"$(OUTDIR)\$(OUTFILENAME).lib" \
"$(OUTDIR)\libpq.res"
# @<< is a Response file, http://www.opussoftware.com/tutorial/TutMakefile.htm
"$(OUTDIR)\$(OUTFILENAME).lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
$(LIB32) @<<
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
<<
"$(INTDIR)\libpq.res" : "$(INTDIR)" libpq-dist.rc
$(RSC) $(RSC_PROJ) libpq-dist.rc
"$(OUTDIR)\$(OUTFILENAME).dll" : "$(OUTDIR)" "$(INTDIR)\libpq.res"
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
# Inclusion of manifest
!IF "$(_NMAKE_VER)" != "6.00.8168.0" && "$(_NMAKE_VER)" != "7.00.9466"
!IF "$(_NMAKE_VER)" != "6.00.9782.0" && "$(_NMAKE_VER)" != "7.10.3077"
mt -manifest $(OUTDIR)\$(OUTFILENAME).dll.manifest -outputresource:$(OUTDIR)\$(OUTFILENAME).dll;2
!ENDIF
!ENDIF
"$(INTDIR)\getaddrinfo.obj" : ..\..\port\getaddrinfo.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\getaddrinfo.c
<<
"$(INTDIR)\pgstrcasecmp.obj" : ..\..\port\pgstrcasecmp.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\pgstrcasecmp.c
<<
"$(INTDIR)\pqsignal.obj" : ..\..\port\pqsignal.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\pqsignal.c
<<
"$(INTDIR)\thread.obj" : ..\..\port\thread.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\thread.c
<<
"$(INTDIR)\inet_aton.obj" : ..\..\port\inet_aton.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\inet_aton.c
<<
"$(INTDIR)\crypt.obj" : ..\..\port\crypt.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\crypt.c
<<
"$(INTDIR)\noblock.obj" : ..\..\port\noblock.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\noblock.c
<<
"$(INTDIR)\chklocale.obj" : ..\..\port\chklocale.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\chklocale.c
<<
"$(INTDIR)\inet_net_ntop.obj" : ..\..\port\inet_net_ntop.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\inet_net_ntop.c
<<
"$(INTDIR)\md5.obj" : ..\..\backend\libpq\md5.c
$(CPP) @<<
$(CPP_PROJ) ..\..\backend\libpq\md5.c
<<
"$(INTDIR)\ip.obj" : ..\..\backend\libpq\ip.c
$(CPP) @<<
$(CPP_PROJ) ..\..\backend\libpq\ip.c
<<
"$(INTDIR)\wchar.obj" : ..\..\backend\utils\mb\wchar.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\backend\utils\mb\wchar.c
<<
"$(INTDIR)\encnames.obj" : ..\..\backend\utils\mb\encnames.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\backend\utils\mb\encnames.c
<<
"$(INTDIR)\snprintf.obj" : ..\..\port\snprintf.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\snprintf.c
<<
"$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\strlcpy.c
<<
"$(INTDIR)\dirent.obj" : ..\..\port\dirent.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\dirent.c
<<
"$(INTDIR)\dirmod.obj" : ..\..\port\dirmod.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\dirmod.c
<<
"$(INTDIR)\pgsleep.obj" : ..\..\port\pgsleep.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\pgsleep.c
<<
"$(INTDIR)\open.obj" : ..\..\port\open.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\open.c
<<
"$(INTDIR)\system.obj" : ..\..\port\system.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\system.c
<<
"$(INTDIR)\win32error.obj" : ..\..\port\win32error.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\win32error.c
<<
"$(INTDIR)\win32setlocale.obj" : ..\..\port\win32setlocale.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\win32setlocale.c
<<
.c{$(CPP_OBJS)}.obj:
$(CPP) $(CPP_PROJ) $<
.c.obj:
$(CPP) $(CPP_PROJ) $<
# src/win32.mak
# Top-file makefile for building Win32 libpq with Visual C++ 7.1.
# (see src/tools/msvc for tools to build with Visual C++ 2005 and newer)
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
ALL:
cd include
if not exist pg_config.h copy pg_config.h.win32 pg_config.h
if not exist pg_config_ext.h copy pg_config_ext.h.win32 pg_config_ext.h
if not exist pg_config_os.h copy port\win32.h pg_config_os.h
cd ..
cd interfaces\libpq
nmake /f win32.mak $(MAKEMACRO)
cd ..\..
echo All Win32 parts have been built!
CLEAN:
cd interfaces\libpq
nmake /f win32.mak CLEAN
cd ..\..
echo All Win32 parts have been cleaned!
DISTCLEAN: CLEAN
cd include
del pg_config.h pg_config_ext.h pg_config_os.h
cd ..
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