Generify source code

Previously we would fail in some parts of the code if we did not have a
premade configuration, now we use any code that was marked as Linux, BSD and
Solaris as our basis in order to support building unknown Unix systems.
This commit is contained in:
Chase
2022-08-03 23:15:45 -05:00
committed by Jon Trulson
parent 06863e826e
commit 45cee195bd
70 changed files with 46 additions and 1250 deletions

View File

@@ -242,15 +242,7 @@ DocParser::process(istream &input, ostringstream &output,
break;
case AttributeSection:
{
#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
!defined(CSRG_BASED) && !defined(sun)
volatile
#endif
AttributeList *attrs = 0;
#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
!defined(CSRG_BASED) && !defined(sun)
volatile
#endif
AttributeList *olias_attrs = 0;
mtry

View File

@@ -141,20 +141,8 @@ BinaryOperatorNode::evaluate() const
{
// calculate children trees and then have feature value do the operation
#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
!defined(CSRG_BASED) && !defined(sun)
volatile
#endif
FeatureValue *left = 0;
#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
!defined(CSRG_BASED) && !defined(sun)
volatile
#endif
FeatureValue *right = 0;
#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
!defined(CSRG_BASED) && !defined(sun)
volatile
#endif
FeatureValue *result = 0;
mtry

View File

@@ -85,14 +85,6 @@ typedef unsigned int size_t;
typedef unsigned int sigset_t;
#endif
/*
* If your system's vsnprintf returns a char *, not an int,
* change the 0 to a 1.
*/
#if !defined(_AIX) && !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#define VSPRINTF_CHARSTAR
#endif
/*
* If you don't have POSIX 1003.1 signals, the signal code surrounding the
* temporary file creation is intended to block all of the possible signals

View File

@@ -102,12 +102,6 @@ Destructable::~Destructable()
inline void
Destructable::destruct()
{
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
delete this;
#else
// Have to call this here since some compilers don't allow
// qualified calls through object pointer.
Destructable::~Destructable();
#endif
}
#endif

View File

@@ -26,10 +26,6 @@
#include <sys/types.h>
#include <unistd.h>
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <sysent.h>
#endif
#include <fcntl.h>
#include <string.h>

View File

@@ -52,14 +52,7 @@
#ifndef _funcs_h
#define _funcs_h 1
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <libc.h>
#endif
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <unistd.h>
#else
#include <sysent.h>
#endif
#include <time.h>
#include <errno.h>
#include <string.h>

View File

@@ -22,12 +22,7 @@
*/
/* $XConsortium: streambuf.C /main/8 1996/08/21 15:55:14 drk $ */
#include "utility/c_streambuf.h"
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <stdlib.h>
#else
#include <libc.h>
#endif
#define DEF_BUF_SIZ 4096

View File

@@ -7,16 +7,10 @@ libraima_la_CFLAGS = -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" \
-DCDE_CONFIGURATION_TOP=\"$(CDE_CONFIGURATION_TOP)\" \
-DNO_TRANS -DUNIX -D_POSIX_SOURCE -DMULTIBYTE
if LINUX
libraima_la_CFLAGS += -D_XOPEN_SOURCE=700
endif
if BSD
libraima_la_CFLAGS += -D_XOPEN_SOURCE=700
endif
if SOLARIS
libraima_la_CFLAGS += -D_XOPEN_SOURCE=500 -DNO_REGCOMP
libraima_la_CFLAGS += -D_XOPEN_SOURCE=500
else
libraima_la_CFLAGS += -D_XOPEN_SOURCE=700
endif

View File

@@ -36,15 +36,7 @@
#ifndef __DYNARRAY_H_
#define __DYNARRAY_H_
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <generic.h>
#endif
#if defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#define _DELETE_ARRAY(sz) delete[]
#else
#define _DELETE_ARRAY(sz) delete[(sz)]
#endif
// this is used to create an ARRAY of a TYPE
#define declare_array(ARRAY, TYPE, BUMP) \

View File

@@ -41,14 +41,6 @@ typedef void (*privbuf_func)(void *v);
#include <stddef.h>
#include <stdlib.h>
#if defined(sun) || defined(__linux__) || defined(CSRG_BASED)
// Rejects valid inline declarations, claiming they have both internal and
// external linkage.
#else
inline static void *operator new(size_t size) { return malloc((unsigned)size); }
inline static void operator delete(void *p) { if (p) free((char*)p); }
#endif
#include <codelibs/dynarray.h>
declare_array(privbuf_charbuf, char, 128)
declare_array(privbuf_strvec, char*, 128)

View File

@@ -66,28 +66,11 @@ extern "C"
#ifdef __cplusplus
char *strtokx(char *&ptr, const char *sep);
# if !defined(__linux__) && !defined(sun) && !defined(CSRG_BASED)
char **strsep(const char *str, const char *sep,
boolean whsp = TRUE, int *num = NULL);
const char *strcmbn(const char **vec, const char *sep = " ");
# endif
#else /* __STDC__ */
char *strtokx(char **ptr, const char *sep);
# if !defined(__linux__) && !defined(sun) && !defined(CSRG_BASED)
char **strsep(const char *str, const char *sep,
boolean whsp, int *num);
#endif
const char *strcmbn(const char **vec, const char *sep);
#endif /* __STDC__ */
#ifdef __OBSOLETE
size_t nl_strlen(const char *str); /* __OBSOLETE */
int strcharsize(const char *str); /* __OBSOLETE */
#endif /* __OBSOLETE */
#else /* C */
extern void strfree();
@@ -102,12 +85,6 @@ extern unsigned strhashi();
extern char *strupper(), *strlower();
#ifdef __OBSOLETE
extern int strcharsize(); /* __OBSOLETE */
extern size_t nl_strlen(); /* __OBSOLETE */
#endif /* __OBSOLETE */
#endif /* C */
#if defined(__cplusplus)
}
@@ -145,12 +122,6 @@ inline char *strdup(const char *s)
/* macros for funcs that work on top of privbuf versions */
/* for backward compatibility only - __OBSOLETE */
#ifdef __OBSOLETE
#define strpos strstrx /* __OBSOLETE */
#define strrpos strrstrx /* __OBSOLETE */
#endif /* __OBSOLETE */
#endif /* C || __STDC__ */
#endif /* __STRINGX_H_ */

View File

@@ -33,11 +33,7 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include <stdarg.h>
#include "TermHeader.h"
#include "TermPrimDebug.h"
#include <signal.h>

View File

@@ -37,7 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "util/copyright.h"
#if defined(__linux__) || defined(sgi) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
#include <getopt.h>
#endif
#include "dbck.h"

View File

@@ -58,9 +58,6 @@ typedef int Bool;
extern char *ProgramName;
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
extern char *malloc(), *realloc();
#endif
int process_command(), auth_initialize(), auth_finalize();
extern int print_help();
extern int verbose;

View File

@@ -214,11 +214,7 @@ main(int argc, char** argv, char **envp)
void install_signal_handler();
SVCXPRT *transp;
struct sockaddr_in saddr;
# if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
socklen_t asize = sizeof(saddr);
# else
size_t asize = sizeof(saddr);
# endif
int is_aix = 0;
int do_garbage_collect = 0;

View File

@@ -37,13 +37,7 @@
#include <stdlib.h>
#include <sys/param.h>
#include <sys/stat.h>
#if defined(__linux__) || defined(sun) || defined(CSRG_BASED)
#include <unistd.h>
#else
#if !defined(sun)
#include <osfcn.h>
#endif
#endif
#include <netdb.h>
#include <locale.h>
#include <errno.h>

View File

@@ -33,11 +33,7 @@
*/
#include <errno.h>
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <unistd.h>
#else
#include <osfcn.h>
#endif
#include <sys/param.h>
#include "api/c/api_api.h"
#include "Tt/tt_c.h"

View File

@@ -32,11 +32,7 @@
*
*/
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <unistd.h>
#else
#include <osfcn.h>
#endif
#include "Tt/tt_c.h"
#include "util/tt_iostream.h"
#include "tttar_utils.h"

View File

@@ -4,11 +4,6 @@ SUBDIRS = api db mp util tttk
lib_LTLIBRARIES = libtt.la
# if you are on a system that does not support realpath(), you may need to
# include realpath.c in the _SOURCES
#
#libtt_la_SOURCES = realpath.c
libtt_la_SOURCES =
# fake things so libtool creates this as a C++ library

View File

@@ -1,160 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
/*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
/*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
/*%% (c) Copyright 1993, 1994 Novell, Inc. */
/*%% $XConsortium: realpath.c /main/3 1995/10/23 09:49:50 rswiston $ */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <strings.h>
#include <errno.h>
/* This is used when the operating system does not provide us with
* a realpath implementation. It's named differently so there is
* no name clash between it and the system version of realpath.
*/
char *
_tt_internal_realpath(pathname, finalpath)
char *pathname;
char *finalpath;
{
struct stat sbuf;
char curpath[MAXPATHLEN],
workpath[MAXPATHLEN],
linkpath[MAXPATHLEN],
namebuf[MAXPATHLEN],
*where,
*ptr,
*last;
int len;
int nlink = 0; /* To keep track of loops in the path. */
strcpy(curpath, pathname);
if (*pathname != '/') {
#if defined(__STDC__)
if (!getcwd(workpath)) {
#else
if (!getwd(workpath)) {
#endif
strcpy(finalpath, ".");
return(NULL);
}
} else *workpath = NULL;
/* curpath is the path we're still resolving */
/* linkpath is the path a symbolic link points to */
/* workpath is the path we've resolved */
loop:
where = curpath;
while (*where != NULL) {
if (!strcmp(where, ".")) {
where++;
continue;
}
/* deal with "./" */
if (!strncmp(where, "./", 2)) {
where += 2;
continue;
}
/* deal with "../" */
if (!strncmp(where, "../", 3)) {
where += 3;
ptr = last = workpath;
while (*ptr) {
if (*ptr == '/') last = ptr;
ptr++;
}
*last = NULL;
continue;
}
ptr = strchr(where, '/');
if (!ptr)
ptr = where + strlen(where) - 1;
else
*ptr = NULL;
strcpy(namebuf, workpath);
for (last = namebuf; *last; last++) continue;
/* tack on a trailing, or leading, `/` */
if (last == namebuf || *--last != '/') {
strcat(namebuf, "/");
}
strcat(namebuf, where);
where = ++ptr;
if (lstat(namebuf, &sbuf) == -1) {
strcpy(finalpath, namebuf);
return(NULL);
}
if ((sbuf.st_mode & S_IFLNK) == S_IFLNK) {
/* Look for loop in path such as link to self. */
nlink++;
if (nlink > MAXSYMLINKS) {
errno = ELOOP;
return (NULL);
}
len = readlink(namebuf, linkpath, MAXPATHLEN);
if (len == 0) {
strcpy(finalpath, namebuf);
return(NULL);
}
*(linkpath + len) = NULL; /* readlink doesn't null-terminate result */
if (*linkpath == '/') *workpath = NULL;
if (*where) {
strcat(linkpath, "/");
strcat(linkpath, where);
}
strcpy(curpath, linkpath);
goto loop;
}
if ((sbuf.st_mode & S_IFDIR) == S_IFDIR) {
strcpy(workpath, namebuf);
continue;
}
if (*where) {
strcpy(finalpath, namebuf);
return(NULL); /* path/notadir/morepath */
} else
strcpy(workpath, namebuf);
}
strcpy(finalpath, workpath);
return(finalpath);
}

View File

@@ -1,146 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
/*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
/*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
/*%% (c) Copyright 1993, 1994 Novell, Inc. */
/*%% $XConsortium: realpath.hp.c /main/3 1995/10/23 09:49:57 rswiston $ */
/* @(#)realpath.hp.c 1.3 93/07/30
* Version of realpath for HP/UX systems */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <strings.h>
char *
realpath(pathname, finalpath)
char *pathname;
char *finalpath;
{
struct stat sbuf;
char curpath[MAXPATHLEN],
workpath[MAXPATHLEN],
linkpath[MAXPATHLEN],
namebuf[MAXPATHLEN],
*where,
*ptr,
*last;
int len;
strcpy(curpath, pathname);
if (*pathname != '/') {
#if defined(__STDC__)
if (!getcwd(workpath)) {
#else
if (!getwd(workpath)) {
#endif
strcpy(finalpath, ".");
return(NULL);
}
} else *workpath = NULL;
/* curpath is the path we're still resolving */
/* linkpath is the path a symbolic link points to */
/* workpath is the path we've resolved */
loop:
where = curpath;
while (*where != NULL) {
if (!strcmp(where, ".")) {
where++;
continue;
}
/* deal with "./" */
if (!strncmp(where, "./", 2)) {
where += 2;
continue;
}
/* deal with "../" */
if (!strncmp(where, "../", 3)) {
where += 3;
ptr = last = workpath;
while (*ptr) {
if (*ptr == '/') last = ptr;
ptr++;
}
*last = NULL;
continue;
}
ptr = strchr(where, '/');
if (!ptr)
ptr = where + strlen(where) - 1;
else
*ptr = NULL;
strcpy(namebuf, workpath);
for (last = namebuf; *last; last++) continue;
/* tack on a trailing, or leading, `/` */
if (last == namebuf || *--last != '/') {
strcat(namebuf, "/");
}
strcat(namebuf, where);
where = ++ptr;
if (lstat(namebuf, &sbuf) == -1) {
strcpy(finalpath, namebuf);
return(NULL);
}
if ((sbuf.st_mode & S_IFLNK) == S_IFLNK) {
len = readlink(namebuf, linkpath, MAXPATHLEN);
if (len == 0) {
strcpy(finalpath, namebuf);
return(NULL);
}
*(linkpath + len) = NULL; /* readlink doesn't null-terminate result */
if (*linkpath == '/') *workpath = NULL;
if (*where) {
strcat(linkpath, "/");
strcat(linkpath, where);
}
strcpy(curpath, linkpath);
goto loop;
}
if ((sbuf.st_mode & S_IFDIR) == S_IFDIR) {
strcpy(workpath, namebuf);
continue;
}
if (*where) {
strcpy(finalpath, namebuf);
return(NULL); /* path/notadir/morepath */
} else
strcpy(workpath, namebuf);
}
strcpy(finalpath, workpath);
return(finalpath);
}

View File

@@ -65,9 +65,6 @@
*
* OPT_PATCH -- if defined, build patch info into objects
*
* OPT_BUG_SUNOS_4 -- used to flag special hacks only needed because
* of bugs or quirks in SunOS 4.x.
*
* OPT_BUG_SUNOS_5 -- used to flag special hacks only needed because
* of bugs or quirks in SunOS 5.x.
*
@@ -77,9 +74,9 @@
* OPT_XDR_LONG_TYPE -- used for (64-bit) architectures where
* <rcp/xdr.h> defines x_putlong and x_getlong to not take "long*".
*
* OPT_POSIX_SIGNAL -- set to assume posix-style sigaction() call.
* OPT_POSIX_SIGNAL -- set to assume posix-style sigaction() call (default).
* OPT_BSD_SIGNAL -- set to assume bsd-style signal() call.
* If *neither* OPT_POSIX_SIGNAL or OPT_BSD_SIGNAL is defined, use
* If OPT_POSIX_SIGNAL is undefined and OPT_BSD_SIGNAL is not set, use
* the old SVR2-style sigset().
*
* OPT_BSD_WAIT -- set to assume bsd-style wait() calls, which expect
@@ -117,9 +114,6 @@
* the tttarfile file will appear after extracts, a small flaw but not a
* fatal one.
*
* OPT_HAS_REALPATH -- set if the system provides a realpath() library
* function; otherwise we'll use our local copy.
*
* OPT_PING_TRIES - The number of times to rpc-ping ttsession to
* see if ttsession is alive.
*
@@ -191,136 +185,50 @@
# define GNU_STRCAST
#endif
/*
* To avoid ugly cpp command-line options, we instead centralize
* in the following code all knowledge about deducing the OS version
* from the definitions cpp gives us.
*/
#if defined(sun)
# if !defined(OS_VERSION)
# if defined(OSMajorVersion)
# define OS_VERSION OSMajorVersion
# define OS_MINOR_VERSION OSMinorVersion
# else
# if !defined(_STDIO_H) && !defined(__stdio_h)
# include <stdio.h>
# endif
# if defined(_SIZE_T)
# define OS_VERSION 5
# else
# define OS_VERSION 4
# endif
# endif
# endif
#undef OPT_CPP_PATH
#define OPT_CPP_PATH CPP_PROGRAM
#ifdef sun
#define OPT_CPP_OPTIONS "-B"
#else
#define OPT_BUG_RPCINTR
#define OPT_CPP_OPTIONS ""
#define OPT_AUTOMOUNT_PATH_FIX
#define OPT_DEFINE_SIG_PF
#endif
#ifdef __linux__
#define OPT_LOCAL_MOUNT_TYPE "ext2fs"
#else
#define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
#endif
#define OPT_POSIX_SIGNAL
#define OPT_CATGETS
#define OPT_TAR_HAS_EXCLUDE_OPTION
#if defined(_AIX)
# undef OPT_UNIX_SOCKET_RPC
# undef OPT_TLI
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# undef OPT_BUG_RPCINTR
# undef OPT_LOCAL_MOUNT_TYPE
# undef OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_BUG_AIX
# undef OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_BSD_SIGNAL
# define OPT_POSIX_SIGNAL
# undef OPT_BSD_WAIT
# undef OPT_DGETTEXT
# define OPT_CATGETS
# define OPT_GETDTABLESIZE
# undef OPT_SYSINFO
# define OPT_CPP_PATH "/usr/ccs/lib/cpp"
# define OPT_CPP_OPTIONS ""
# undef OPT_SVR4_GETMNTENT
# undef OPT_LOCKF_MNTENT
# define OPT_DEFINE_SIG_PF
# undef OPT_TAR_HAS_EXCLUDE_OPTION
# undef OPT_HAS_REALPATH
# define OPT_AUTOMOUNT_PATH_FIX
/* # define OPT_XTHREADS 1 */ /* Defaulted by -DXTHREADS */
#elif defined(sun) && (OS_VERSION <= 4)
# define OPT_UNIX_SOCKET_RPC
# undef OPT_TLI
/* for 4.1.1 systems turning on any dlopen features on the */
/* client side would break clients with ld errors unless they */
/* linked with -ldl. OPT_DLOPEN_CE is ok since clients don't */
/* ever execute ce_* functions. */
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# define OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_PATCH
# define OPT_BSD_SIGNAL
# define OPT_BSD_WAIT
# define OPT_DGETTEXT
# undef OPT_CATGETS
# undef OPT_GETDTABLESIZE
# undef OPT_SYSINFO
# define OPT_CPP_PATH "/usr/lib/cpp"
# define OPT_CPP_OPTIONS "-B"
# undef OPT_SVR4_GETMNTENT
# undef OPT_LOCKF_MNTENT
# define OPT_LOCAL_MOUNT_TYPE MNTTYPE_42
# undef OPT_OLD_RPC
# undef OPT_DEFINE_SIG_PF
# define OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_BUG_SUNOS_4
# define OPT_HAS_REALPATH
# undef OPT_AUTOMOUNT_PATH_FIX
#elif defined(sun) && (OS_VERSION >= 5)
# undef OPT_UNIX_SOCKET_RPC
# define OPT_TLI
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# define OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_BSD_SIGNAL
# define OPT_POSIX_SIGNAL
# undef OPT_BSD_WAIT
# undef OPT_DGETTEXT
# define OPT_CATGETS
# undef OPT_GETDTABLESIZE
# define OPT_SYSINFO
# define OPT_CPP_PATH "/usr/ccs/lib/cpp"
# define OPT_CPP_OPTIONS "-B"
# define OPT_SVR4_GETMNTENT
# define OPT_LOCKF_MNTENT
# define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
# undef OPT_DEFINE_SIG_PF
# define OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_HAS_REALPATH
# undef OPT_AUTOMOUNT_PATH_FIX
/* Does not work on X86 */
# if defined(i386) && OS_MINOR_VERSION <= 4
# undef OPT_GARBAGE_THREADS
# undef OPT_SOLARIS_THREADED_TRIES
# else
# define OPT_SOLARIS_THREADS 1
# define OPT_SOLARIS_THREADS 1
/* # define OPT_XTHREADS 1 */ /* Defaulted by -DXTHREADS */
# define OPT_GARBAGE_THREADS 1
# define OPT_SOLARIS_THREADED_TRIES 10
# endif
# define OPT_GARBAGE_THREADS 1
# define OPT_SOLARIS_THREADED_TRIES 10
/* Solaris 2.5 and above, supports clnt_create_timed(3N) */
# if (OS_MINOR_VERSION >= 5)
# define OPT_HAS_CLNT_CREATE_TIMED 1
# define OPT_CLNT_CREATE_TIMEOUT 30
# endif
/* TURN THESE OFF FOR NOW */
# undef OPT_GARBAGE_IN_PARALLEL
# undef OPT_GARBAGE_THREADS
# define OPT_HAS_CLNT_CREATE_TIMED 1
# define OPT_CLNT_CREATE_TIMEOUT 30
/* Turn ON/OFF parallel threads for garbage collection */
# if defined(OPT_DO_AUTO_GARBAGE_COLLECT) && defined(OPT_SOLARIS_THREADS)
@@ -328,140 +236,23 @@
# define OPT_GARBAGE_THREADS 1
# else
# define OPT_GARBAGE_IN_PARALLEL 0 /* used as a const */
# undef OPT_GARBAGE_THREADS
# endif
#elif defined(__linux__)
# undef OPT_UNIX_SOCKET_RPC
# undef OPT_TLI
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# undef OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_PATCH
# define OPT_POSIX_SIGNAL
# undef OPT_BSD_WAIT
# undef OPT_DGETTEXT
# define OPT_CATGETS
# undef OPT_GETDTABLESIZE
# undef OPT_SYSINFO
# define OPT_CPP_PATH "/usr/bin/cpp"
# define OPT_CPP_OPTIONS ""
# undef OPT_SVR4_GETMNTENT
# undef OPT_LOCKF_MNTENT
# define OPT_LOCAL_MOUNT_TYPE "ext2fs"
# undef OPT_OLD_RPC
# define OPT_DEFINE_SIG_PF
# define OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_HAS_REALPATH
# define OPT_AUTOMOUNT_PATH_FIX
# define OPT_BUG_RPCINTR
# undef OPT_XTHREADS
# define OPT_CONST_CORRECT
#elif defined(__OpenBSD__)
# undef OPT_UNIX_SOCKET_RPC
# undef OPT_TLI
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# undef OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_PATCH
# define OPT_POSIX_SIGNAL
# undef OPT_BSD_WAIT
# undef OPT_DGETTEXT
# define OPT_CATGETS
# undef OPT_GETDTABLESIZE
# undef OPT_SYSINFO
# define OPT_CPP_PATH "/usr/libexec/cpp"
# define OPT_CPP_OPTIONS ""
# undef OPT_SVR4_GETMNTENT
# undef OPT_LOCKF_MNTENT
# define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
# undef OPT_OLD_RPC
# define OPT_DEFINE_SIG_PF
# define OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_HAS_REALPATH
# define OPT_AUTOMOUNT_PATH_FIX
# define OPT_BUG_RPCINTR
# undef OPT_XTHREADS
#elif defined(__FreeBSD__)
# undef OPT_UNIX_SOCKET_RPC
# undef OPT_TLI
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# undef OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_PATCH
# define OPT_POSIX_SIGNAL
# undef OPT_BSD_WAIT
# undef OPT_DGETTEXT
# define OPT_CATGETS
# undef OPT_GETDTABLESIZE
# undef OPT_SYSINFO
# if defined(OSMAJORVERSION) && (OSMAJORVERSION >= 5)
# define OPT_CPP_PATH "/usr/bin/cpp"
# else
# define OPT_CPP_PATH "/usr/libexec/cpp"
# endif
# define OPT_CPP_OPTIONS ""
# undef OPT_SVR4_GETMNTENT
# undef OPT_LOCKF_MNTENT
# define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
# undef OPT_OLD_RPC
# define OPT_DEFINE_SIG_PF
# define OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_HAS_REALPATH
# define OPT_AUTOMOUNT_PATH_FIX
# define OPT_BUG_RPCINTR
# undef OPT_XTHREADS
# define OPT_CONST_CORRECT
#elif defined(__NetBSD__)
# undef OPT_UNIX_SOCKET_RPC
# undef OPT_TLI
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# undef OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_PATCH
# define OPT_POSIX_SIGNAL
# undef OPT_BSD_WAIT
# undef OPT_DGETTEXT
# define OPT_CATGETS
# undef OPT_GETDTABLESIZE
# undef OPT_SYSINFO
# define OPT_CPP_PATH "/usr/bin/cpp"
# define OPT_CPP_OPTIONS ""
# undef OPT_SVR4_GETMNTENT
# undef OPT_LOCKF_MNTENT
# define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
# undef OPT_OLD_RPC
# define OPT_DEFINE_SIG_PF
# define OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_HAS_REALPATH
# define OPT_AUTOMOUNT_PATH_FIX
# define OPT_BUG_RPCINTR
# undef OPT_XTHREADS
# define OPT_CONST_CORRECT
# define HAS_STATVFS
#else
/* Unknown configuration, complain */
}}}} You must edit lib/tt_options.h and add a section defining the options for your configuration.
#endif
#ifdef CPP_PROGRAM
# undef OPT_CPP_PATH
# define OPT_CPP_PATH CPP_PROGRAM
#warning "Your system is unknown to us, things might not build properly without editing tt_options.h"
#endif
#endif /* _TT_OPTIONS_H */

View File

@@ -45,9 +45,6 @@ extern "C" in_addr_t inet_addr(const char *);
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <osfcn.h>
#endif
#define X_INCLUDE_NETDB_H
#define XOS_USE_XT_LOCKING

View File

@@ -34,9 +34,6 @@
#include <stdio.h>
#include <stdlib.h>
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <osfcn.h>
#endif
#define X_INCLUDE_TIME_H
#define XOS_USE_XT_LOCKING

View File

@@ -59,23 +59,10 @@
#undef rindex
#endif
// Not everybody has realpath() in libc, sometimes we have to define
// it ourselves, see realpath*.c in tt/lib
#if !defined(OPT_HAS_REALPATH)
extern "C" { char *_tt_internal_realpath(char*, char*); }
#endif
// Use the system realpath on OS's that have it, otherwise
// use the ToolTalk implementation of it.
char *
_tt_get_realpath(char *pathname, char *finalpath)
{
#ifdef OPT_HAS_REALPATH
return realpath(pathname, finalpath);
#else
return _tt_internal_realpath(pathname, finalpath);
#endif
}
/*

View File

@@ -51,9 +51,7 @@
#include <memory.h>
#include <stdlib.h>
#include <ctype.h>
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <wctype.h>
#endif
#include "util/tt_string.h"
#include "util/tt_assert.h"
#include "util/tt_xdr_utils.h"

View File

@@ -36,11 +36,7 @@
* Generic control function
*/
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "isam_impl.h"
@@ -76,25 +72,13 @@
typedef int (* intfunc)();
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
int
iscntl(int isfd, int func, ...)
#else
int
iscntl(isfd, func, va_alist)
int isfd;
int func;
va_dcl
#endif
{
va_list pvar;
int ret;
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
va_start(pvar, func);
#else
va_start(pvar);
#endif
switch (func) {
case ISCNTL_MASKSIGNALS: