зеркало из https://github.com/mozilla/pjs.git
Ports to many Unix variants. Added the OMIT_LIB_BUILD_TIME workaround
for platforms that don't have 'long long'. In pr/src/Makefile and lib/libc/src/Makefile, use single quotes so that we can avoid using backslashes in double quotes (that doesn't work under MKS shell).
This commit is contained in:
Родитель
c3de3fa938
Коммит
bf719a79e4
|
@ -31,6 +31,13 @@ else
|
|||
PROG_SUFFIX =
|
||||
endif
|
||||
|
||||
# Temporary workaround to disable the generation of
|
||||
# library build time because now.c uses the 'long long'
|
||||
# data type that's not available on some platforms.
|
||||
ifeq (,$(filter-out NEC SCOOS UNIXWARE,$(OS_ARCH)))
|
||||
DEFINES += -DOMIT_LIB_BUILD_TIME
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH), IRIX)
|
||||
ifeq ($(basename $(OS_RELEASE)),6)
|
||||
ifeq ($(USE_N32),1)
|
||||
|
|
|
@ -27,14 +27,25 @@
|
|||
|
||||
include $(MOD_DEPTH)/config/UNIX.mk
|
||||
|
||||
ifeq ($(OS_RELEASE),7)
|
||||
CC = cc
|
||||
CCC = CC
|
||||
else
|
||||
CC = $(NSDEPTH)/build/hcc
|
||||
CCC = $(NSDEPTH)/build/hcpp
|
||||
endif
|
||||
|
||||
RANLIB = true
|
||||
|
||||
DEFINES += -D_PR_LOCAL_THREADS_ONLY
|
||||
OS_CFLAGS = -DSVR4 -DSYSV -DUNIXWARE
|
||||
|
||||
ifeq ($(OS_RELEASE),7)
|
||||
OS_CFLAGS += -D_LARGEFILE64_SOURCE -D_PR_HAVE_OFF64_T -D_PR_HAVE_SOCKADDR_LEN
|
||||
else
|
||||
OS_CFLAGS += -D_PR_NO_LARGE_FILES
|
||||
endif
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
DSO_LDOPTS = -G
|
||||
|
||||
|
|
|
@ -30,15 +30,30 @@
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#if defined(XP_UNIX)
|
||||
long long now;
|
||||
struct timeval tv;
|
||||
#if defined(OMIT_LIB_BUILD_TIME)
|
||||
/*
|
||||
* Some platforms don't have any 64-bit integer type
|
||||
* such as 'long long'. Because we can't use NSPR's
|
||||
* PR_snprintf in this program, it is difficult to
|
||||
* print a static initializer for PRInt64 (a struct).
|
||||
* So we print nothing. The makefiles that build the
|
||||
* shared libraries will detect the empty output string
|
||||
* of this program and omit the library build time
|
||||
* in PRVersionDescription.
|
||||
*/
|
||||
#elif defined(XP_UNIX)
|
||||
long long now;
|
||||
struct timeval tv;
|
||||
#ifdef HAVE_SVID_GETTOD
|
||||
gettimeofday(&tv);
|
||||
#else
|
||||
gettimeofday(&tv, NULL);
|
||||
#endif
|
||||
now = ((1000000LL) * tv.tv_sec) + (long long)tv.tv_usec;
|
||||
#if defined(OSF1)
|
||||
return fprintf(stdout, "%ld", now);
|
||||
fprintf(stdout, "%ld", now);
|
||||
#else
|
||||
return fprintf(stdout, "%lld", now);
|
||||
fprintf(stdout, "%lld", now);
|
||||
#endif
|
||||
|
||||
#elif defined(WIN32)
|
||||
|
@ -48,10 +63,12 @@ int main(int argc, char **argv)
|
|||
now = b.time;
|
||||
now *= 1000000;
|
||||
now += (1000 * b.millitm);
|
||||
return fprintf(stdout, "%I64d", now);
|
||||
fprintf(stdout, "%I64d", now);
|
||||
#else
|
||||
#error "Architecture not supported"
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
} /* main */
|
||||
|
||||
/* now.c */
|
||||
|
|
|
@ -99,9 +99,7 @@ include $(MOD_DEPTH)/config/rules.mk
|
|||
#
|
||||
# Version information generation (begin)
|
||||
#
|
||||
RM = rm
|
||||
ECHO = echo
|
||||
INCLUDES = -I$(DIST)/include
|
||||
TINC = $(OBJDIR)/_pl_bld.h
|
||||
PROD = libplc$(MOD_VERSION).$(DLL_SUFFIX)
|
||||
NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
|
||||
|
@ -110,17 +108,17 @@ SH_NOW = $(shell $(NOW))
|
|||
|
||||
ifeq ($(OS_ARCH), WINNT)
|
||||
SUF = i64
|
||||
SH_QUOTE =
|
||||
else
|
||||
SUF = LL
|
||||
SH_QUOTE = "
|
||||
endif
|
||||
|
||||
$(TINC):
|
||||
@$(MAKE_OBJDIR)
|
||||
@$(ECHO) $(SH_QUOTE)#define _BUILD_STRING \"$(SH_DATE)\"$(SH_QUOTE) > $(TINC)
|
||||
@$(ECHO) $(SH_QUOTE)#define _BUILD_TIME $(SH_NOW)$(SUF)$(SH_QUOTE) >> $(TINC)
|
||||
@$(ECHO) $(SH_QUOTE)#define _PRODUCTION \"$(PROD)\"$(SH_QUOTE) >> $(TINC)
|
||||
@$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
|
||||
@if test ! -z "$(SH_NOW)"; then \
|
||||
$(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
|
||||
fi
|
||||
@$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
|
||||
|
||||
|
||||
$(OBJDIR)/plvrsion.$(OBJ_SUFFIX): $(TINC)
|
||||
|
|
|
@ -24,7 +24,11 @@
|
|||
/************************************************************************/
|
||||
#include "_pl_bld.h"
|
||||
#if !defined(_BUILD_TIME)
|
||||
#ifdef HAVE_LONG_LONG
|
||||
#define _BUILD_TIME 0
|
||||
#else
|
||||
#define _BUILD_TIME {0, 0}
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(_BUILD_STRING)
|
||||
#define _BUILD_STRING ""
|
||||
|
|
|
@ -25,13 +25,10 @@
|
|||
#endif
|
||||
|
||||
/*
|
||||
* To pick up fd_set. In AIX 4.2, fd_set is defined in <sys/time.h>,
|
||||
* which is included by _unixos.h.
|
||||
* To pick up fd_set and the poll events.
|
||||
*/
|
||||
#ifdef AIX4_1
|
||||
#include <sys/select.h>
|
||||
#include <sys/poll.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Internal configuration macros
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
|
||||
#define _PR_POLL_AVAILABLE
|
||||
#define _PR_USE_POLL
|
||||
#define _PR_NO_LARGE_FILES
|
||||
#define _PR_STAT_HAS_ST_ATIM_UNION
|
||||
|
||||
#undef HAVE_STACK_GROWING_UP
|
||||
#define HAVE_NETCONFIG
|
||||
|
|
|
@ -37,6 +37,10 @@
|
|||
#define USE_DLFCN
|
||||
#define NEED_TIME_R
|
||||
#define NEED_STRFTIME_LOCK
|
||||
#define _PR_POLL_AVAILABLE
|
||||
#define _PR_USE_POLL
|
||||
#define _PR_NO_LARGE_FILES
|
||||
#define _PR_STAT_HAS_ST_ATIM_UNION
|
||||
|
||||
#include <ucontext.h>
|
||||
#include <sys/regset.h>
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
|
||||
#define _PR_POLL_AVAILABLE
|
||||
#define _PR_USE_POLL
|
||||
#define _PR_NO_LARGE_FILES
|
||||
#define _PR_STAT_HAS_ONLY_ST_ATIME
|
||||
|
||||
#define NEED_STRFTIME_LOCK
|
||||
#define NEED_TIME_R
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#endif
|
||||
#define _PR_POLL_AVAILABLE
|
||||
#define _PR_USE_POLL
|
||||
#define _PR_STAT_HAS_ST_ATIM_UNION
|
||||
|
||||
#undef HAVE_STACK_GROWING_UP
|
||||
#define HAVE_NETCONFIG
|
||||
|
|
|
@ -310,7 +310,6 @@ endif
|
|||
#
|
||||
# Version information generation (begin)
|
||||
#
|
||||
RM = rm
|
||||
ECHO = echo
|
||||
INCLUDES = -I$(DIST)/include
|
||||
TINC = $(OBJDIR)/_pr_bld.h
|
||||
|
@ -321,17 +320,17 @@ SH_NOW = $(shell $(NOW))
|
|||
|
||||
ifeq ($(OS_ARCH), WINNT)
|
||||
SUF = i64
|
||||
SH_QUOTE =
|
||||
else
|
||||
SUF = LL
|
||||
SH_QUOTE = "
|
||||
endif
|
||||
|
||||
$(TINC):
|
||||
@$(MAKE_OBJDIR)
|
||||
@$(ECHO) $(SH_QUOTE)#define _BUILD_STRING \"$(SH_DATE)\"$(SH_QUOTE) > $(TINC)
|
||||
@$(ECHO) $(SH_QUOTE)#define _BUILD_TIME $(SH_NOW)$(SUF)$(SH_QUOTE) >> $(TINC)
|
||||
@$(ECHO) $(SH_QUOTE)#define _PRODUCTION \"$(PROD)\"$(SH_QUOTE) >> $(TINC)
|
||||
@$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
|
||||
@if test ! -z "$(SH_NOW)"; then \
|
||||
$(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
|
||||
fi
|
||||
@$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
|
||||
|
||||
|
||||
$(OBJDIR)/prvrsion.$(OBJ_SUFFIX): $(TINC)
|
||||
|
|
|
@ -2260,6 +2260,44 @@ static void _MD_set_fileinfo64_times(
|
|||
info->creationTime = ((PRTime)sb->st_ctim.tv_sec * PR_USEC_PER_SEC);
|
||||
info->creationTime += (sb->st_ctim.tv_nsec / 1000);
|
||||
}
|
||||
#elif defined(_PR_STAT_HAS_ST_ATIM_UNION)
|
||||
/*
|
||||
** The st_atim, st_mtim, and st_ctim fields in struct stat are
|
||||
** unions with a st__tim union member of type timestruc_t.
|
||||
*/
|
||||
static void _MD_set_fileinfo_times(
|
||||
const struct stat *sb,
|
||||
PRFileInfo *info)
|
||||
{
|
||||
PRInt64 us, s2us;
|
||||
|
||||
LL_I2L(s2us, PR_USEC_PER_SEC);
|
||||
LL_I2L(info->modifyTime, sb->st_mtim.st__tim.tv_sec);
|
||||
LL_MUL(info->modifyTime, info->modifyTime, s2us);
|
||||
LL_I2L(us, sb->st_mtim.st__tim.tv_nsec / 1000);
|
||||
LL_ADD(info->modifyTime, info->modifyTime, us);
|
||||
LL_I2L(info->creationTime, sb->st_ctim.st__tim.tv_sec);
|
||||
LL_MUL(info->creationTime, info->creationTime, s2us);
|
||||
LL_I2L(us, sb->st_ctim.st__tim.tv_nsec / 1000);
|
||||
LL_ADD(info->creationTime, info->creationTime, us);
|
||||
}
|
||||
|
||||
static void _MD_set_fileinfo64_times(
|
||||
const _MDStat64 *sb,
|
||||
PRFileInfo64 *info)
|
||||
{
|
||||
PRInt64 us, s2us;
|
||||
|
||||
LL_I2L(s2us, PR_USEC_PER_SEC);
|
||||
LL_I2L(info->modifyTime, sb->st_mtim.st__tim.tv_sec);
|
||||
LL_MUL(info->modifyTime, info->modifyTime, s2us);
|
||||
LL_I2L(us, sb->st_mtim.st__tim.tv_nsec / 1000);
|
||||
LL_ADD(info->modifyTime, info->modifyTime, us);
|
||||
LL_I2L(info->creationTime, sb->st_ctim.st__tim.tv_sec);
|
||||
LL_MUL(info->creationTime, info->creationTime, s2us);
|
||||
LL_I2L(us, sb->st_ctim.st__tim.tv_nsec / 1000);
|
||||
LL_ADD(info->creationTime, info->creationTime, us);
|
||||
}
|
||||
#elif defined(_PR_STAT_HAS_ST_ATIMESPEC)
|
||||
/*
|
||||
** struct stat has st_atimespec, st_mtimespec, and st_ctimespec
|
||||
|
@ -2572,7 +2610,7 @@ static void* _MD_Unix_mmap64(
|
|||
} /* _MD_Unix_mmap64 */
|
||||
#endif /* defined(_PR_NO_LARGE_FILES) || defined(SOLARIS2_5) */
|
||||
|
||||
#if defined(IRIX)
|
||||
#if defined(IRIX) || defined(UNIXWARE)
|
||||
|
||||
/*
|
||||
** This function emulates a lock64 for IRIX using fcntl calls. It is a true
|
||||
|
@ -2642,7 +2680,7 @@ static void _PR_InitIOV(void)
|
|||
** $$$ IRIX does not have a lockf64. One must fabricate it from fcntl
|
||||
** calls with 64 bit arguments.
|
||||
*/
|
||||
#if defined(IRIX)
|
||||
#if defined(IRIX) || defined(UNIXWARE)
|
||||
_md_iovector._lockf64 = _MD_irix_lockf64;
|
||||
#else
|
||||
_md_iovector._lockf64 = lockf64;
|
||||
|
|
|
@ -24,7 +24,11 @@
|
|||
/************************************************************************/
|
||||
#include "_pr_bld.h"
|
||||
#if !defined(_BUILD_TIME)
|
||||
#ifdef HAVE_LONG_LONG
|
||||
#define _BUILD_TIME 0
|
||||
#else
|
||||
#define _BUILD_TIME {0, 0}
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(_BUILD_STRING)
|
||||
#define _BUILD_STRING ""
|
||||
|
|
Загрузка…
Ссылка в новой задаче