Commit 4f4edb83 authored by Marc G. Fournier's avatar Marc G. Fournier

Thanks to Vince Vielhaber <vev@michvhf.com>

Here is an os2 psql client, with libpq.a library
parent 58544215
#-------------------------------------------------------------------------
#
# Makefile
# Makefile for libpq library
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/contrib/os2client/Attic/Makefile,v 1.1 1998/10/31 04:10:52 scrappy Exp $
#
#-------------------------------------------------------------------------
SO_MAJOR_VERSION=1
SO_MINOR_VERSION=1
SRCDIR= ../../src
INTERFACES= $(SRCDIR)/interfaces/libpq
PORTNAME=OS2
CC=gcc
CFLAGS=-I. -I$(SRCDIR)/include
CFLAGS+=-DFRONTEND -DTCPIPV4 -DHAVE_CRYPT_H
CP= copy
AR=ar
AROPT=rc
RANLIB= ar s
LDFLAGS= -L.
OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-lobj.o fe-print.o \
dllist.o pqsignal.o pqcomprim.o
EXEOBJS= psql.o stringutils.o
all: libpq.a c.h psql
fe-auth.o: $(INTERFACES)/fe-auth.c
$(CC) $(CFLAGS) -c $(INTERFACES)/fe-auth.c
fe-connect.o: $(INTERFACES)/fe-connect.c
$(CC) $(CFLAGS) -c $(INTERFACES)/fe-connect.c
fe-exec.o: $(INTERFACES)/fe-exec.c
$(CC) $(CFLAGS) -c $(INTERFACES)/fe-exec.c
fe-lobj.o: $(INTERFACES)/fe-lobj.c
$(CC) $(CFLAGS) -c $(INTERFACES)/fe-lobj.c
fe-misc.o: $(INTERFACES)/fe-misc.c
$(CC) $(CFLAGS) -c $(INTERFACES)/fe-misc.c
fe-print.o: $(INTERFACES)/fe-print.c
$(CC) $(CFLAGS) -c $(INTERFACES)/fe-print.c
pqsignal.o: $(INTERFACES)/pqsignal.c
$(CC) $(CFLAGS) -c $(INTERFACES)/pqsignal.c
dllist.o: $(SRCDIR)/backend/lib/dllist.c
$(CC) $(CFLAGS) -c $(SRCDIR)/backend/lib/dllist.c
pqcomprim.o: $(SRCDIR)/backend/libpq/pqcomprim.c
$(CC) $(CFLAGS) -c $(SRCDIR)/backend/libpq/pqcomprim.c
libpq.a: $(OBJS)
$(AR) $(AROPT) libpq.a $(OBJS)
$(RANLIB) libpq.a
psql: $(EXEOBJS)
$(CC) -o psql.exe $(EXEOBJS) $(LDFLAGS) -llibpq -lsocket -lufc
psql.o: $(SRCDIR)/bin/psql/psql.c
$(CC) $(CFLAGS) -I$(INTERFACES) -c $(SRCDIR)/bin/psql/psql.c
stringutils.o: $(SRCDIR)/bin/psql/stringutils.c
$(CC) $(CFLAGS) -I$(INTERFACES) -c $(SRCDIR)/bin/psql/stringutils.c
c.h: $(SRCDIR)/include/c.h
rm -f c.h
$(CP) portname c.h
cat $(SRCDIR)/include/c.h >> c.h
clean:
rm -f libpq.a $(OBJS) $(EXEOBJS) psql.exe c.h dllist.c pqcomprim.c
19981029 libpq.a and psql.exe Version 6.4 for OS/2
---------------------------------------------------
Requirements:
emx 0.9c or newer under OS/2
GNU crypt library for emx+gcc version 2.0.6 (available from
ftp://ftp.leo.org/pub/comp/os/os2/leo/crypt/gnuufc.zip)
Also a patch is needed for sys/socket.h around line 291. The lines
with the pluses need to be added, the other lines are already there
and are only for reference:
#define MT_IFADDR 13
+#ifndef MAXSOCKETS
+#define MAXSOCKETS 2048
+#endif
struct mbstat {
u_short m_mbufs;
u_short m_clusters;
Possible problems:
You will also need to #define TCPIPV4
Make sure both socket.a and ufc.a are linked in to the executable
AFTER libpq.a.
The following include files will be needed in order to use the library.
You only need to include one (libpq-fe.h) but these need to be present:
postgres_ext.h
libpq/pqcomm.h
lib/dllist.h"
c.h
Good luck and enjoy!!
Vince Vielhaber <vev@michvhf.com>
This diff is collapsed.
#ifndef TCPIPV4
# define TCPIPV4
#endif
#ifndef MAXSOCKETS
#define MAXSOCKETS 2048
#endif
/*
* DEF_PGPORT is the TCP port number on which the Postmaster listens by
* default. This can be overriden by command options, environment variables,
* and the postconfig hook. (set by build script)
*/
#define DEF_PGPORT "5432"
#define HAVE_TERMIOS_H
#define HAVE_ENDIAN_H
#define SOCKET_SIZE_TYPE size_t
#define strcasecmp(s1, s2) stricmp(s1, s2)
#undef PORTNAME
#define PORTNAME OS2
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