Skip to content

Commit e7c767b

Browse files
committed
Try to further reduce the PORT dependencies.
Essentially, config.h now includes an 'os.h', which is created via configure by linking a "port.h" file from the port directory to the include directory. Going to try to merge backend/port in similar ways
1 parent d557375 commit e7c767b

File tree

17 files changed

+306
-310
lines changed

17 files changed

+306
-310
lines changed

src/configure

Lines changed: 212 additions & 166 deletions
Large diffs are not rendered by default.

src/configure.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ case "$host_os" in
99
esac ;;
1010
linux*) PORTNAME='linux' ;;
1111
bsdi*) PORTNAME='bsdi' ;;
12-
freebsd*|netbsd*) PORTNAME='BSD44_derived' ;;
12+
freebsd*|netbsd*) PORTNAME='BSD44_derived';;
1313
dgux*) PORTNAME='dgux';;
1414
aix*) PORTNAME='aix';;
1515
nextstep*) PORTNAME='nextstep';;
@@ -25,6 +25,7 @@ nextstep*) PORTNAME='nextstep';;
2525
echo ""
2626
exit;;
2727
esac
28+
AC_LINK_FILES(port/${PORTNAME}.h, include/os.h)
2829
AC_SUBST(PORTNAME)
2930
AC_SUBST(LDFLAGS)
3031
AC_SUBST(CPPFLAGS)

src/include/config.h.in

Lines changed: 1 addition & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -93,149 +93,7 @@
9393
* Code below this point should not require changes
9494
*/
9595

96-
#if defined(aix)
97-
# define CLASS_CONFLICT
98-
# define DISABLE_XOPEN_NLS
99-
# define HAVE_ANSI_CPP
100-
# define HAS_TEST_AND_SET
101-
typedef unsigned int slock_t;
102-
#endif
103-
104-
#if defined(alpha)
105-
# define USE_POSIX_TIME
106-
# define USE_POSIX_SIGNALS
107-
# define DISABLE_XOPEN_NLS
108-
# define HAS_LONG_LONG
109-
# define HAS_TEST_AND_SET
110-
# include <sys/mman.h> /* for msemaphore */
111-
typedef msemaphore slock_t;
112-
#endif
113-
114-
#if defined(BSD44_derived)
115-
# define USE_POSIX_TIME
116-
# define NEED_I386_TAS_ASM
117-
# define HAS_TEST_AND_SET
118-
# if defined(__mips__)
119-
/* # undef HAS_TEST_AND_SET */
120-
# endif
121-
typedef unsigned char slock_t;
122-
#endif
123-
124-
#if defined(bsdi)
125-
# if defined(i386)
126-
# define NEED_I386_TAS_ASM
127-
# endif
128-
# if defined(sparc)
129-
# define NEED_SPARC_TAS_ASM
130-
# endif
131-
# define USE_POSIX_TIME
132-
# define HAS_TEST_AND_SET
133-
typedef unsigned char slock_t;
134-
#endif
135-
136-
137-
#if defined(dgux)
138-
# define LINUX_ELF
139-
# define USE_POSIX_SIGNALS
140-
#endif
141-
142-
#if defined(hpux)
143-
# define JMP_BUF
144-
# define USE_POSIX_TIME
145-
# define HAS_TEST_AND_SET
146-
typedef struct { int sem[4]; } slock_t;
147-
#endif
148-
149-
#if defined(i386_solaris)
150-
# define USE_POSIX_TIME
151-
# define USE_POSIX_SIGNALS
152-
# define NO_EMPTY_STMTS
153-
# define SYSV_DIRENT
154-
# define HAS_TEST_AND_SET
155-
typedef unsigned char slock_t;
156-
#endif
157-
158-
#if defined(irix5)
159-
# define USE_POSIX_TIME
160-
# define USE_POSIX_SIGNALS
161-
# define NO_EMPTY_STMTS
162-
# define SYSV_DIRENT
163-
# define HAS_TEST_AND_SET
164-
# include <abi_mutex.h>
165-
typedef abilock_t slock_t;
166-
#endif
167-
168-
#if defined(linux)
169-
/* __USE_POSIX, __USE_BSD, and __USE_BSD_SIGNAL used to be defined either
170-
here or with -D compile options, but __ macros should be set and used by C
171-
library macros, not Postgres code. __USE_POSIX is set by features.h,
172-
__USE_BSD is set by bsd/signal.h, and __USE_BSD_SIGNAL appears not to
173-
be used.
174-
*/
175-
# define JMP_BUF
176-
# define USE_POSIX_TIME
177-
# if !defined(PPC)
178-
# define NEED_I386_TAS_ASM
179-
# define HAS_TEST_AND_SET
180-
typedef unsigned char slock_t;
181-
# endif
182-
#endif
183-
184-
#if defined(nextstep)
185-
# include <sys/ioctl.h>
186-
# if defined(__STRICT_ANSI__)
187-
# define isascii(c) ((unsigned)(c)<=0177)
188-
# endif
189-
extern char* strdup (const char* string);
190-
# ifndef _POSIX_SOURCE
191-
typedef unsigned short mode_t;
192-
typedef int sigset_t;
193-
# define SIG_BLOCK 00
194-
# define SIG_UNBLOCK 01
195-
# define SIG_SETMASK 02
196-
# define NEED_SIG_JMP
197-
# endif
198-
199-
# define JMP_BUF
200-
# define NO_WAITPID
201-
typedef struct mutex slock_t;
202-
#endif
203-
204-
#if defined(sparc_solaris)
205-
# define USE_POSIX_TIME
206-
# define USE_POSIX_SIGNALS
207-
# define NO_EMPTY_STMTS
208-
# define SYSV_DIRENT
209-
# define HAS_TEST_AND_SET
210-
typedef unsigned char slock_t;
211-
#endif
212-
213-
#if defined(sunos4)
214-
# define USE_POSIX_TIME
215-
#endif
216-
217-
#if defined(svr4)
218-
# define USE_POSIX_TIME
219-
# define USE_POSIX_SIGNALS
220-
# define NO_EMPTY_STMTS
221-
# define SYSV_DIRENT
222-
#endif
223-
224-
#if defined(win32)
225-
# define JMP_BUF
226-
# define NEED_SIG_JMP
227-
# define NO_UNISTD_H
228-
# define USES_WINSOCK
229-
# define NOFILE 100
230-
# ifndef MAXPATHLEN
231-
# define MAXPATHLEN 250
232-
# endif
233-
#endif /* WIN32 */
234-
235-
#if defined(ultrix4)
236-
# define USE_POSIX_TIME
237-
# define NEED_STRDUP
238-
#endif
96+
#include "os.h"
23997

24098
/* This patch changes the behavior of aclcheck for groups. Currently an user
24199
* can access a table only if he has the required permission for ALL the groups

src/port/aix.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# define CLASS_CONFLICT
2+
# define DISABLE_XOPEN_NLS
3+
# define HAVE_ANSI_CPP
4+
# define HAS_TEST_AND_SET
5+
typedef unsigned int slock_t;

src/port/alpha.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# define USE_POSIX_TIME
2+
# define USE_POSIX_SIGNALS
3+
# define DISABLE_XOPEN_NLS
4+
# define HAS_LONG_LONG
5+
# define HAS_TEST_AND_SET
6+
# include <sys/mman.h> /* for msemaphore */
7+
typedef msemaphore slock_t;

src/port/bsdi.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# if defined(i386)
2+
# define NEED_I386_TAS_ASM
3+
# endif
4+
# if defined(sparc)
5+
# define NEED_SPARC_TAS_ASM
6+
# endif
7+
# define USE_POSIX_TIME
8+
# define HAS_TEST_AND_SET
9+
typedef unsigned char slock_t;

src/port/dgux.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# define LINUX_ELF
2+
# define USE_POSIX_SIGNALS

src/port/hpux.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# define JMP_BUF
2+
# define USE_POSIX_TIME
3+
# define HAS_TEST_AND_SET
4+
typedef struct { int sem[4]; } slock_t;

src/port/i386_solaris.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# define USE_POSIX_TIME
2+
# define USE_POSIX_SIGNALS
3+
# define NO_EMPTY_STMTS
4+
# define SYSV_DIRENT
5+
# define HAS_TEST_AND_SET
6+
typedef unsigned char slock_t;

src/port/irix5.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# define USE_POSIX_TIME
2+
# define USE_POSIX_SIGNALS
3+
# define NO_EMPTY_STMTS
4+
# define SYSV_DIRENT
5+
# define HAS_TEST_AND_SET
6+
# include <abi_mutex.h>
7+
typedef abilock_t slock_t;

src/port/linux.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* __USE_POSIX, __USE_BSD, and __USE_BSD_SIGNAL used to be defined either
2+
here or with -D compile options, but __ macros should be set and used by C
3+
library macros, not Postgres code. __USE_POSIX is set by features.h,
4+
__USE_BSD is set by bsd/signal.h, and __USE_BSD_SIGNAL appears not to
5+
be used.
6+
*/
7+
# define JMP_BUF
8+
# define USE_POSIX_TIME
9+
# if !defined(PPC)
10+
# define NEED_I386_TAS_ASM
11+
# define HAS_TEST_AND_SET
12+
typedef unsigned char slock_t;
13+
# endif

src/port/nextstep.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# include <sys/ioctl.h>
2+
# if defined(__STRICT_ANSI__)
3+
# define isascii(c) ((unsigned)(c)<=0177)
4+
# endif
5+
extern char* strdup (const char* string);
6+
# ifndef _POSIX_SOURCE
7+
typedef unsigned short mode_t;
8+
typedef int sigset_t;
9+
# define SIG_BLOCK 00
10+
# define SIG_UNBLOCK 01
11+
# define SIG_SETMASK 02
12+
# define NEED_SIG_JMP
13+
# endif
14+
15+
# define JMP_BUF
16+
# define NO_WAITPID
17+
typedef struct mutex slock_t;

src/port/sparc_solaris.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# define USE_POSIX_TIME
2+
# define USE_POSIX_SIGNALS
3+
# define NO_EMPTY_STMTS
4+
# define SYSV_DIRENT
5+
# define HAS_TEST_AND_SET
6+
typedef unsigned char slock_t;

src/port/sunos4.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# define USE_POSIX_TIME

src/port/svr4.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# define USE_POSIX_TIME
2+
# define USE_POSIX_SIGNALS
3+
# define NO_EMPTY_STMTS
4+
# define SYSV_DIRENT

src/port/ultrix4.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# define USE_POSIX_TIME
2+
# define NEED_STRDUP

src/port/win32.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# define JMP_BUF
2+
# define NEED_SIG_JMP
3+
# define NO_UNISTD_H
4+
# define USES_WINSOCK
5+
# define NOFILE 100
6+
# ifndef MAXPATHLEN
7+
# define MAXPATHLEN 250
8+
# endif

0 commit comments

Comments
 (0)