mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +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:
@@ -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