diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2002-07-27 20:10:05 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2002-07-27 20:10:05 +0000 |
commit | b0c3c48eb3779d9637a03c455f3934d9d7c08030 (patch) | |
tree | 4fbf5c8d94ae2534735e1b7935edb40d6205cc44 /src | |
parent | c3fdf8925ed7fbb3017be052e0700c51ceb12e0b (diff) | |
download | postgresql-b0c3c48eb3779d9637a03c455f3934d9d7c08030.tar.gz postgresql-b0c3c48eb3779d9637a03c455f3934d9d7c08030.zip |
Assemble portability modules into libpgport library.
Some makefile simplifications.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 5 | ||||
-rw-r--r-- | src/Makefile.global.in | 32 | ||||
-rw-r--r-- | src/Makefile.shlib | 4 | ||||
-rw-r--r-- | src/backend/Makefile | 16 | ||||
-rw-r--r-- | src/backend/port/Makefile | 10 | ||||
-rw-r--r-- | src/backend/port/inet_aton.c | 152 | ||||
-rw-r--r-- | src/bin/pg_dump/Makefile | 18 | ||||
-rw-r--r-- | src/bin/pg_encoding/Makefile | 23 | ||||
-rw-r--r-- | src/bin/psql/Makefile | 21 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/Makefile | 15 | ||||
-rw-r--r-- | src/interfaces/libpgtcl/Makefile | 8 | ||||
-rw-r--r-- | src/interfaces/libpq++/examples/Makefile | 4 | ||||
-rw-r--r-- | src/interfaces/libpq/Makefile | 18 | ||||
-rw-r--r-- | src/makefiles/Makefile.win | 3 | ||||
-rw-r--r-- | src/port/Makefile | 15 | ||||
-rw-r--r-- | src/port/inet_aton.h | 3 | ||||
-rw-r--r-- | src/utils/Makefile | 18 | ||||
-rw-r--r-- | src/utils/dllinit.c (renamed from src/backend/port/dllinit.c) | 0 |
18 files changed, 77 insertions, 288 deletions
diff --git a/src/Makefile b/src/Makefile index f7d67350dcf..91a97df4928 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/Makefile,v 1.25 2002/07/18 22:15:10 tgl Exp $ +# $Header: /cvsroot/pgsql/src/Makefile,v 1.26 2002/07/27 20:10:04 petere Exp $ # #------------------------------------------------------------------------- @@ -14,6 +14,7 @@ include Makefile.global all install installdirs uninstall dep depend distprep: + $(MAKE) -C port $@ $(MAKE) -C backend $@ $(MAKE) -C include $@ $(MAKE) -C interfaces $@ @@ -24,6 +25,7 @@ install-all-headers: $(MAKE) -C include $@ clean: + $(MAKE) -C port $@ $(MAKE) -C backend $@ $(MAKE) -C include $@ $(MAKE) -C interfaces $@ @@ -32,6 +34,7 @@ clean: $(MAKE) -C test $@ distclean maintainer-clean: + -$(MAKE) -C port $@ -$(MAKE) -C backend $@ -$(MAKE) -C include $@ -$(MAKE) -C interfaces $@ diff --git a/src/Makefile.global.in b/src/Makefile.global.in index f3d04c19273..a7370bcc848 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -1,5 +1,5 @@ # -*-makefile-*- -# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.151 2002/07/19 17:35:10 momjian Exp $ +# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.152 2002/07/27 20:10:04 petere Exp $ #------------------------------------------------------------------------------ # All PostgreSQL makefiles include this file and use the variables it sets, @@ -294,6 +294,7 @@ ifeq ($(enable_rpath), yes) LDFLAGS += $(rpath) endif + ########################################################################## # # Some variables needed to find some client interfaces @@ -302,6 +303,14 @@ libpq_srcdir = $(top_srcdir)/src/interfaces/libpq libpq_builddir = $(top_builddir)/src/interfaces/libpq libpq = -L$(libpq_builddir) -lpq +submake-libpq: + $(MAKE) -C $(libpq_builddir) all + +submake-libpgport: + $(MAKE) -C $(top_builddir)/src/port all + +.PHONY: submake-libpq submake-libpgport + ########################################################################## # @@ -346,23 +355,14 @@ endif # # substitute implementations of the C library -GETHOSTNAME = @GETHOSTNAME@ -GETRUSAGE = @GETRUSAGE@ -INET_ATON = @INET_ATON@ -ISINF = @ISINF@ -MEMCMP = @MEMCMP@ -MISSING_RANDOM = @MISSING_RANDOM@ -QSORT = @QSORT@ -SNPRINTF = @SNPRINTF@ -SRANDOM = @SRANDOM@ -STRCASECMP = @STRCASECMP@ -STRDUP = @STRDUP@ -STRERROR = @STRERROR@ -STRTOL = @STRTOL@ -STRTOUL = @STRTOUL@ +LIBOBJS = @LIBOBJS@ + +ifneq (,$(LIBOBJS)) +LIBS += -lpgport +LDFLAGS := -L$(top_builddir)/src/port $(LDFLAGS) +endif # Not really standard libc functions, used by the backend. -DLLINIT = @DLLINIT@ TAS = @TAS@ diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 8b4145b12a5..dc6933a1886 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib @@ -6,7 +6,7 @@ # Copyright (c) 1998, Regents of the University of California # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.59 2002/07/16 05:46:35 momjian Exp $ +# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.60 2002/07/27 20:10:04 petere Exp $ # #------------------------------------------------------------------------- @@ -332,7 +332,7 @@ $(shlib) lib$(NAME).a: $(OBJS) $(DLLINIT) $(DLLWRAP) -o $(shlib) --dllname $(shlib) --def $(NAME).def $(OBJS) $(DLLINIT) $(DLLLIBS) $(SHLIB_LINK) $(DLLTOOL) --dllname $(shlib) --def $(NAME).def --output-lib lib$(NAME).a -$(DLLINIT): +$(DLLINIT): $(DLLINIT:%.o=%.c) $(MAKE) -C $(@D) $(@F) endif # PORTNAME == win diff --git a/src/backend/Makefile b/src/backend/Makefile index 925340c3b19..dcfa3cad39b 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.81 2002/07/18 02:02:29 ishii Exp $ +# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.82 2002/07/27 20:10:04 petere Exp $ # #------------------------------------------------------------------------- @@ -29,7 +29,7 @@ endif ########################################################################## -all: postgres $(POSTGRES_IMP) +all: submake-libpgport postgres $(POSTGRES_IMP) ifeq ($(enable_nls), yes) $(MAKE) -C po all endif @@ -41,13 +41,11 @@ postgres: $(OBJS) else # win -# No points for style here. How about encapsulating some of these -# commands into variables? postgres: $(OBJS) $(DLLINIT) postgres.def libpostgres.a - dlltool --dllname $@$(X) --output-exp $@.exp --def postgres.def - gcc $(LDFLAGS) -g -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS) $(DLLLIBS) - dlltool --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def - gcc $(LDFLAGS) -g -o $@$(X) $@.exp $(OBJS) $(DLLLIBS) + $(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def + $(CC) $(LDFLAGS) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS) $(DLLLIBS) + $(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def + $(CC) $(LDFLAGS) -o $@$(X) $@.exp $(OBJS) $(DLLLIBS) rm $@.exp $@.base endif # win @@ -73,7 +71,7 @@ libpostgres.a: $(OBJS) $(DLLINIT) postgres.def endif # MAKE_DLL -$(DLLINIT): +$(DLLINIT): $(DLLINIT:%.o=%.c) $(MAKE) -C $(@D) $(@F) # The postgres.o target is needed by the rule in Makefile.global that diff --git a/src/backend/port/Makefile b/src/backend/port/Makefile index 2960526c5af..3a9a38af892 100644 --- a/src/backend/port/Makefile +++ b/src/backend/port/Makefile @@ -13,7 +13,7 @@ # be converted to Method 2. # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/port/Makefile,v 1.17 2002/07/19 17:35:11 momjian Exp $ +# $Header: /cvsroot/pgsql/src/backend/port/Makefile,v 1.18 2002/07/27 20:10:05 petere Exp $ # #------------------------------------------------------------------------- @@ -21,14 +21,8 @@ subdir = src/backend/port top_builddir = ../../.. include $(top_builddir)/src/Makefile.global -OBJS=$(GETHOSTNAME) $(GETRUSAGE) $(INET_ATON) $(ISINF) $(MEMCMP) \ - $(MISSING_RANDOM) $(QSORT) $(SNPRINTF) $(SRANDOM) $(STRCASECMP) \ - $(STRDUP) $(STRERROR) $(STRTOL) $(STRTOUL) - OBJS+=dynloader.o pg_sema.o pg_shmem.o -OBJS+=$(DLLINIT) - OBJS+=$(TAS) ifeq ($(PORTNAME), qnx4) @@ -65,7 +59,7 @@ tas.o: tas.s $(CC) $(CFLAGS) -c $< # IPC test program -ipc_test: ipc_test.o pg_sema.o pg_shmem.o $(MEMCMP) $(SNPRINTF) $(STRERROR) +ipc_test: ipc_test.o pg_sema.o pg_shmem.o $(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(LIBS) -o $@ distclean clean: diff --git a/src/backend/port/inet_aton.c b/src/backend/port/inet_aton.c deleted file mode 100644 index 8f7c4e255a9..00000000000 --- a/src/backend/port/inet_aton.c +++ /dev/null @@ -1,152 +0,0 @@ -/* $Id: inet_aton.c,v 1.20 2001/10/25 05:49:40 momjian Exp $ - * - * This inet_aton() function was taken from the GNU C library and - * incorporated into Postgres for those systems which do not have this - * routine in their standard C libraries. - * - * The function was been extracted whole from the file inet_aton.c in - * Release 5.3.12 of the Linux C library, which is derived from the - * GNU C library, by Bryan Henderson in October 1996. The copyright - * notice from that file is below. - */ - -/* - * Copyright (c) 1983, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. */ - -#include "c.h" - -#include <sys/types.h> -#include <netinet/in.h> -#include <ctype.h> - -/* - * Check whether "cp" is a valid ascii representation - * of an Internet address and convert to a binary address. - * Returns 1 if the address is valid, 0 if not. - * This replaces inet_addr, the return value from which - * cannot distinguish between failure and a local broadcast address. - */ -int -inet_aton(const char *cp, struct in_addr * addr) -{ - unsigned int val; - int base, - n; - char c; - u_int parts[4]; - u_int *pp = parts; - - for (;;) - { - /* - * Collect number up to ``.''. Values are specified as for C: - * 0x=hex, 0=octal, other=decimal. - */ - val = 0; - base = 10; - if (*cp == '0') - { - if (*++cp == 'x' || *cp == 'X') - base = 16, cp++; - else - base = 8; - } - while ((c = *cp) != '\0') - { - if (isdigit((unsigned char) c)) - { - val = (val * base) + (c - '0'); - cp++; - continue; - } - if (base == 16 && isxdigit((unsigned char) c)) - { - val = (val << 4) + - (c + 10 - (islower((unsigned char) c) ? 'a' : 'A')); - cp++; - continue; - } - break; - } - if (*cp == '.') - { - /* - * Internet format: a.b.c.d a.b.c (with c treated as - * 16-bits) a.b (with b treated as 24 bits) - */ - if (pp >= parts + 3 || val > 0xff) - return 0; - *pp++ = val, cp++; - } - else - break; - } - - /* - * Check for trailing junk. - */ - while (*cp) - if (!isspace((unsigned char) *cp++)) - return 0; - - /* - * Concoct the address according to the number of parts specified. - */ - n = pp - parts + 1; - switch (n) - { - - case 1: /* a -- 32 bits */ - break; - - case 2: /* a.b -- 8.24 bits */ - if (val > 0xffffff) - return 0; - val |= parts[0] << 24; - break; - - case 3: /* a.b.c -- 8.8.16 bits */ - if (val > 0xffff) - return 0; - val |= (parts[0] << 24) | (parts[1] << 16); - break; - - case 4: /* a.b.c.d -- 8.8.8.8 bits */ - if (val > 0xff) - return 0; - val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); - break; - } - if (addr) - addr->s_addr = htonl(val); - return 1; -} diff --git a/src/bin/pg_dump/Makefile b/src/bin/pg_dump/Makefile index 1a19c71fc26..eff79981866 100644 --- a/src/bin/pg_dump/Makefile +++ b/src/bin/pg_dump/Makefile @@ -5,7 +5,7 @@ # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group # Portions Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.35 2002/07/15 21:34:05 momjian Exp $ +# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.36 2002/07/27 20:10:05 petere Exp $ # #------------------------------------------------------------------------- @@ -14,12 +14,11 @@ top_builddir = ../../.. include $(top_builddir)/src/Makefile.global OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o \ - pg_backup_files.o pg_backup_null.o pg_backup_tar.o sprompt.o \ - $(STRDUP) $(STRTOUL) + pg_backup_files.o pg_backup_null.o pg_backup_tar.o sprompt.o override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) -all: submake pg_dump pg_restore pg_dumpall +all: submake-libpq submake-libpgport pg_dump pg_restore pg_dumpall pg_dump: pg_dump.o common.o $(OBJS) $(libpq_builddir)/libpq.a $(CC) $(CFLAGS) pg_dump.o common.o $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@ @@ -34,10 +33,6 @@ pg_dumpall: pg_dumpall.sh $< >$@ chmod a+x $@ -.PHONY: submake -submake: - $(MAKE) -C $(libpq_builddir) all - install: all installdirs $(INSTALL_PROGRAM) pg_dump$(X) $(DESTDIR)$(bindir)/pg_dump$(X) $(INSTALL_PROGRAM) pg_restore$(X) $(DESTDIR)$(bindir)/pg_restore$(X) @@ -49,12 +44,5 @@ installdirs: uninstall: rm -f $(addprefix $(DESTDIR)$(bindir)/, pg_dump$(X) pg_restore$(X) pg_dumpall) -depend dep: - $(CC) -MM $(CFLAGS) *.c >depend - clean distclean maintainer-clean: rm -f pg_dump$(X) pg_restore$(X) $(OBJS) pg_dump.o common.o pg_restore.o pg_dumpall - -ifeq (depend,$(wildcard depend)) -include depend -endif diff --git a/src/bin/pg_encoding/Makefile b/src/bin/pg_encoding/Makefile index 94d3e08c5ae..a4ca9bb3a29 100644 --- a/src/bin/pg_encoding/Makefile +++ b/src/bin/pg_encoding/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1998, PostgreSQL Global Development Group # -# $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.14 2001/03/23 05:46:05 ishii Exp $ +# $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.15 2002/07/27 20:10:05 petere Exp $ # #------------------------------------------------------------------------- @@ -14,23 +14,11 @@ include $(top_builddir)/src/Makefile.global OBJS= pg_encoding.o -all: submake pg_encoding - -ifdef STRTOUL -OBJS+=$(top_builddir)/src/backend/port/strtoul.o - -$(top_builddir)/src/backend/port/strtoul.o: - $(MAKE) -C $(top_builddir)/src/backend/port strtoul.o -endif +all: submake-libpq submake-libpgport pg_encoding pg_encoding: $(OBJS) $(CC) $(CFLAGS) $^ $(libpq) $(LDFLAGS) $(LIBS) -o $@ -.PHONY: submake - -submake: - $(MAKE) -C $(libpq_builddir) all - install: all installdirs $(INSTALL_PROGRAM) pg_encoding$(X) $(DESTDIR)$(bindir)/pg_encoding$(X) @@ -40,12 +28,5 @@ installdirs: uninstall: rm -f $(DESTDIR)$(bindir)/pg_encoding$(X) -depend dep: - $(CC) -MM $(CFLAGS) *.c >depend - clean distclean maintainer-clean: rm -f pg_encoding$(X) pg_encoding.o - -ifeq (depend,$(wildcard depend)) -include depend -endif diff --git a/src/bin/psql/Makefile b/src/bin/psql/Makefile index 5baa463bbc1..dbaa5836b48 100644 --- a/src/bin/psql/Makefile +++ b/src/bin/psql/Makefile @@ -5,7 +5,7 @@ # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group # Portions Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.34 2002/07/15 21:34:05 momjian Exp $ +# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.35 2002/07/27 20:10:05 petere Exp $ # #------------------------------------------------------------------------- @@ -19,12 +19,9 @@ override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) OBJS=command.o common.o help.o input.o stringutils.o mainloop.o copy.o \ startup.o prompt.o variables.o large_obj.o print.o describe.o \ - sprompt.o tab-complete.o mbprint.o $(SNPRINTF) $(STRDUP) \ - $(STRERROR) $(STRTOUL) + sprompt.o tab-complete.o mbprint.o -all: submake psql - -# End of hacks for picking up backend 'port' modules +all: submake-libpq submake-libpgport psql psql: $(OBJS) $(libpq_builddir)/libpq.a $(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@ @@ -39,11 +36,6 @@ $(srcdir)/sql_help.h: @echo "*** Perl is needed to build psql help." endif -.PHONY: submake - -submake: - $(MAKE) -C $(libpq_builddir) all - distprep: $(srcdir)/sql_help.h install: all installdirs @@ -55,15 +47,8 @@ installdirs: uninstall: rm -f $(DESTDIR)$(bindir)/psql$(X) -depend dep: - $(CC) -MM -MG $(CFLAGS) *.c >depend - clean distclean: rm -f psql$(X) $(OBJS) maintainer-clean: distclean rm -f $(srcdir)/sql_help.h - -ifeq (depend,$(wildcard depend)) -include depend -endif diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile index 212b3cc8a6a..0057c0010bf 100644 --- a/src/interfaces/ecpg/preproc/Makefile +++ b/src/interfaces/ecpg/preproc/Makefile @@ -1,4 +1,4 @@ -# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.84 2002/07/15 21:34:05 momjian Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.85 2002/07/27 20:10:05 petere Exp $ subdir = src/interfaces/ecpg/preproc top_builddir = ../../../.. @@ -18,10 +18,9 @@ override CFLAGS += -Wno-error endif OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\ - keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o \ - $(SNPRINTF) $(STRDUP) + keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o -all: ecpg +all: submake-libpgport ecpg ecpg: $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ @@ -70,11 +69,3 @@ clean distclean: # inadequate tools. maintainer-clean: distclean rm -f $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c - - -depend dep: preproc.c pgc.c - $(CC) -MM $(CFLAGS) *.c >depend - -ifeq (depend,$(wildcard depend)) -include depend -endif diff --git a/src/interfaces/libpgtcl/Makefile b/src/interfaces/libpgtcl/Makefile index 32b21685511..09fb7bca5ec 100644 --- a/src/interfaces/libpgtcl/Makefile +++ b/src/interfaces/libpgtcl/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.26 2001/05/11 01:46:33 momjian Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.27 2002/07/27 20:10:05 petere Exp $ # #------------------------------------------------------------------------- @@ -27,11 +27,7 @@ SHLIB_LINK = $(libpq) # braindead; users of libpq should not need to know what it depends on.) SHLIB_LINK+= $(filter -L%, $(LDFLAGS)) $(filter -lcrypt, $(LIBS)) -all: submake all-lib - -.PHONY: submake -submake: - $(MAKE) -C $(libpq_builddir) all +all: submake-libpq all-lib # Shared library stuff include $(top_srcdir)/src/Makefile.shlib diff --git a/src/interfaces/libpq++/examples/Makefile b/src/interfaces/libpq++/examples/Makefile index d2e9b16a03e..5f4fa65f8bd 100644 --- a/src/interfaces/libpq++/examples/Makefile +++ b/src/interfaces/libpq++/examples/Makefile @@ -5,7 +5,7 @@ # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group # Portions Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/interfaces/libpq++/examples/Attic/Makefile,v 1.14 2002/06/20 20:29:54 momjian Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/libpq++/examples/Attic/Makefile,v 1.15 2002/07/27 20:10:05 petere Exp $ # #------------------------------------------------------------------------- @@ -31,8 +31,6 @@ all: $(PROGS) $(PROGS): % : %.cc $(CXX) $(CXXFLAGS) -o $@ $@.cc $(LDFLAGS) -.PHONY: submake - clean: rm -f $(PROGS) diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile index 5700a95a773..804360f07b8 100644 --- a/src/interfaces/libpq/Makefile +++ b/src/interfaces/libpq/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.63 2002/07/18 03:59:49 momjian Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.64 2002/07/27 20:10:05 petere Exp $ # #------------------------------------------------------------------------- @@ -22,7 +22,7 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) -DFRONTEND -DSYSCONFDIR='"$(sysconf OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \ pqexpbuffer.o dllist.o md5.o pqsignal.o fe-secure.o \ - $(notdir $(INET_ATON)) $(notdir $(SNPRINTF)) $(notdir $(STRERROR)) + $(filter inet_aton.o snprintf.o strerror.o, $(LIBOBJS)) ifdef MULTIBYTE OBJS+= wchar.o encnames.o @@ -54,20 +54,8 @@ md5.c: $(backend_src)/libpq/md5.c # symlink the source files in here and build our own object file. # this only gets done if configure finds system doesn't have inet_aton() -ifdef INET_ATON -$(basename $(notdir $(INET_ATON))).c: $(basename $(INET_ATON)).c +inet_aton.c snprintf.c strerror.c: %.c : $(top_srcdir)/src/port/%.c rm -f $@ && $(LN_S) $< . -endif - -ifdef SNPRINTF -$(basename $(notdir $(SNPRINTF))).c: $(basename $(SNPRINTF)).c - rm -f $@ && $(LN_S) $< . -endif - -ifdef STRERROR -$(basename $(notdir $(STRERROR))).c: $(basename $(STRERROR)).c - rm -f $@ && $(LN_S) $< . -endif ifdef MULTIBYTE wchar.c : % : $(backend_src)/utils/mb/% diff --git a/src/makefiles/Makefile.win b/src/makefiles/Makefile.win index b9b0a7381d6..bcf1165f014 100644 --- a/src/makefiles/Makefile.win +++ b/src/makefiles/Makefile.win @@ -1,9 +1,10 @@ -# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.16 2002/07/16 05:46:35 momjian Exp $ +# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.17 2002/07/27 20:10:05 petere Exp $ LDFLAGS+= -g DLLTOOL= dlltool DLLWRAP= dllwrap DLLLIBS= -lcygipc -lcrypt BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres +DLLINIT = $(top_builddir)/src/utils/dllinit.o MK_NO_LORDER=true MAKE_DLL=true #MAKE_DLL=false diff --git a/src/port/Makefile b/src/port/Makefile index b005143018a..04d9e049940 100644 --- a/src/port/Makefile +++ b/src/port/Makefile @@ -7,7 +7,7 @@ # with broken/missing library files. # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/port/Makefile,v 1.2 2002/07/19 17:35:11 momjian Exp $ +# $Header: /cvsroot/pgsql/src/port/Makefile,v 1.3 2002/07/27 20:10:05 petere Exp $ # #------------------------------------------------------------------------- @@ -15,9 +15,12 @@ subdir = src/port top_builddir = ../.. include $(top_builddir)/src/Makefile.global +ifdef LIBOBJS +all: libpgport.a +endif -# -# The backend/port directory removes these files. -# -#distclean clean: -# rm -f $(OBJS) +libpgport.a: $(LIBOBJS) + $(AR) crs $@ $^ + +clean distclean maintainer-clean: + rm -f libpgport.a $(LIBOBJS) diff --git a/src/port/inet_aton.h b/src/port/inet_aton.h deleted file mode 100644 index d965afc5c7c..00000000000 --- a/src/port/inet_aton.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $Id: inet_aton.h,v 1.1 2002/07/18 04:13:59 momjian Exp $ */ - -int inet_aton(const char *cp, struct in_addr * addr); diff --git a/src/utils/Makefile b/src/utils/Makefile new file mode 100644 index 00000000000..26273cd4bd5 --- /dev/null +++ b/src/utils/Makefile @@ -0,0 +1,18 @@ +#------------------------------------------------------------------------- +# +# Makefile for utils +# +# $Header: /cvsroot/pgsql/src/utils/Attic/Makefile,v 1.14 2002/07/27 20:10:05 petere Exp $ +# +# dllinit.o is only built on Win32 platform. +# +#------------------------------------------------------------------------- + +subdir = src/utils +top_builddir = ../.. +include $(top_builddir)/src/Makefile.global + +all: + +clean distclean maintainer-clean: + rm -f dllinit.o diff --git a/src/backend/port/dllinit.c b/src/utils/dllinit.c index e30a76a5f25..e30a76a5f25 100644 --- a/src/backend/port/dllinit.c +++ b/src/utils/dllinit.c |