mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Remove most compile-time options, add a few runtime options to make up for it.
In particular, no more compiled-in default for PGDATA or LIBDIR. Commands that need them need either invocation options or environment variables. PGPORT default is hardcoded as 5432, but overrideable with options or environment variables.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
# Makefile for libpq subsystem (backend half of libpq interface)
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/backend/libpq/Makefile,v 1.3 1996/11/06 08:48:21 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/backend/libpq/Makefile,v 1.4 1996/11/14 10:23:51 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -16,7 +16,6 @@ INCLUDE_OPT = -I.. \
|
||||
-I../../include
|
||||
|
||||
CFLAGS+=$(INCLUDE_OPT)
|
||||
CFLAGS+= -DPOSTPORT='"$(POSTPORT)"'
|
||||
|
||||
# kerberos flags
|
||||
ifdef KRBVERS
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.6 1996/11/08 05:56:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.7 1996/11/14 10:23:53 bryanh Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -140,7 +140,7 @@ pq_getport()
|
||||
|
||||
if (envport)
|
||||
return(atoi(envport));
|
||||
return(atoi(POSTPORT));
|
||||
return(atoi(DEF_PGPORT));
|
||||
}
|
||||
|
||||
/* --------------------------------
|
||||
|
||||
@@ -30,7 +30,6 @@ struct sembuf
|
||||
|
||||
#define MAXHOSTNAMELEN 12 /* where is the official definition of this? */
|
||||
#define MAXPATHLEN _MAX_PATH /* in winsock.h */
|
||||
#define POSTPORT "5432"
|
||||
|
||||
/* NT has stricmp not strcasecmp. Which is ANSI? */
|
||||
#define strcasecmp(a,b) _stricmp(a,b)
|
||||
@@ -46,5 +45,3 @@ struct sembuf
|
||||
#define GETNCNT 5
|
||||
#define GETVAL 6
|
||||
|
||||
#define POSTGRESDIR "d:\\pglite"
|
||||
#define PGDATADIR "d:\\pglite\\data"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.10 1996/11/10 03:03:28 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.11 1996/11/14 10:24:22 bryanh Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -234,7 +234,7 @@ DebugFileOpen(void)
|
||||
fd = fileno(stderr);
|
||||
if (fcntl(fd, F_GETFD, 0) < 0) {
|
||||
sprintf(OutputFileName, "%s/pg.errors.%d",
|
||||
GetPGData(), (int)getpid());
|
||||
DataDir, (int)getpid());
|
||||
fd = open(OutputFileName, O_CREAT|O_APPEND|O_WRONLY, 0666);
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Makefile for utils/init
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/backend/utils/init/Makefile,v 1.3 1996/11/12 06:46:40 bryanh Exp $
|
||||
# $Header: /cvsroot/pgsql/src/backend/utils/init/Makefile,v 1.4 1996/11/14 10:24:32 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -16,9 +16,6 @@ INCLUDE_OPT = -I../.. \
|
||||
-I../../../include
|
||||
|
||||
CFLAGS += $(INCLUDE_OPT)
|
||||
# The following defines really ought to go in config.h
|
||||
CFLAGS += -DPOSTGRESDIR='"$(POSTGRESDIR)"' -DPGDATADIR='"$(DATADIR)"' \
|
||||
-DPOSTPORT='"$(POSTPORT)"'
|
||||
|
||||
OBJS = enbl.o findbe.o globals.o miscinit.o postinit.o
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.2 1996/11/06 10:31:54 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.3 1996/11/14 10:24:38 bryanh Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Globals used all over the place should be declared here and not
|
||||
@@ -99,12 +99,3 @@ char *SharedSystemRelationNames[] = {
|
||||
VariableRelationName,
|
||||
0
|
||||
};
|
||||
|
||||
/* set up global variables, pointers, etc. */
|
||||
void InitGlobals()
|
||||
{
|
||||
MasterPid = getpid();
|
||||
DataDir = GetPGData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.2 1996/11/06 10:31:57 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.3 1996/11/14 10:24:41 bryanh Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -345,35 +345,3 @@ SetUserId()
|
||||
UserRelationName);
|
||||
UserId = (Oid) ((Form_pg_user) GETSTRUCT(userTup))->usesysid;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* GetPGHome
|
||||
*
|
||||
* Get POSTGRESHOME from environment, or return default.
|
||||
* ----------------
|
||||
*/
|
||||
char *
|
||||
GetPGHome()
|
||||
{
|
||||
#ifdef USE_ENVIRONMENT
|
||||
char *h;
|
||||
|
||||
if ((h = getenv("POSTGRESHOME")) != (char *) NULL)
|
||||
return (h);
|
||||
#endif /* USE_ENVIRONMENT */
|
||||
return (POSTGRESDIR);
|
||||
|
||||
}
|
||||
|
||||
char *
|
||||
GetPGData()
|
||||
{
|
||||
#ifdef USE_ENVIRONMENT
|
||||
char *p;
|
||||
|
||||
if ((p = getenv("PGDATA")) != (char *) NULL) {
|
||||
return (p);
|
||||
}
|
||||
#endif /* USE_ENVIRONMENT */
|
||||
return (PGDATADIR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user