Compare commits
1 Commits
release
...
tags/DIREC
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87427db5b6 |
851
mozilla/cmd/winfe/mkfiles32/makedep.cpp
Executable file
851
mozilla/cmd/winfe/mkfiles32/makedep.cpp
Executable file
@@ -0,0 +1,851 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
// Dependency building hack
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <ctype.h>
|
||||
#include <afxcoll.h>
|
||||
#include <afxtempl.h>
|
||||
|
||||
int mainReturn = 0;
|
||||
BOOL b16 = FALSE;
|
||||
BOOL bSimple = FALSE;
|
||||
|
||||
// freopen won't work on stdout in win16
|
||||
FILE *pAltFile = stdout;
|
||||
|
||||
CStringArray includeDirectories;
|
||||
|
||||
// turn a file, relative path or other into an absolute path
|
||||
// This function copied from MFC 1.52
|
||||
BOOL PASCAL _AfxFullPath(LPSTR lpszPathOut, LPCSTR lpszFileIn)
|
||||
// lpszPathOut = buffer of _MAX_PATH
|
||||
// lpszFileIn = file, relative path or absolute path
|
||||
// (both in ANSI character set)
|
||||
{
|
||||
OFSTRUCT of;
|
||||
if (OpenFile(lpszFileIn, &of, OF_PARSE) != HFILE_ERROR)
|
||||
{
|
||||
// of.szPathName is in the OEM character set
|
||||
OemToAnsi(of.szPathName, lpszPathOut);
|
||||
AnsiUpper(lpszPathOut); // paths in upper case just to be sure
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE1("Warning: could not parse the path %Fs\n", lpszFileIn);
|
||||
lstrcpy(lpszPathOut, lpszFileIn); // take it literally
|
||||
AnsiUpper(lpszPathOut); // paths in upper case just to be sure
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void AddIncludeDirectory( char *pString ){
|
||||
CString s = pString;
|
||||
int len = s.GetLength();
|
||||
if(len > 0 && s[len - 1] != '\\' ){
|
||||
s += "\\";
|
||||
}
|
||||
includeDirectories.Add(s);
|
||||
}
|
||||
|
||||
BOOL FileExists( const char *pString ){
|
||||
struct _stat buf;
|
||||
int result;
|
||||
|
||||
result = _stat( pString, &buf );
|
||||
return (result == 0);
|
||||
}
|
||||
|
||||
void FixPathName(CString& str) {
|
||||
str.MakeUpper(); // all upper case
|
||||
|
||||
// now switch all forward slashes to back slashes
|
||||
int index;
|
||||
while ((index = str.Find('/')) != -1) {
|
||||
str.SetAt(index, '\\');
|
||||
}
|
||||
}
|
||||
|
||||
void FATName(CString& csLONGName)
|
||||
{
|
||||
// Only relevant for 16 bits.
|
||||
if(b16) {
|
||||
// Convert filename to FAT (8.3) equivalent.
|
||||
char aBuffer[2048];
|
||||
|
||||
if(GetShortPathName(csLONGName, aBuffer, 2048)) {
|
||||
csLONGName = aBuffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class CFileRecord {
|
||||
public:
|
||||
CString m_shortName;
|
||||
CString m_pathName;
|
||||
CPtrArray m_includes;
|
||||
BOOL m_bVisited;
|
||||
BOOL m_bSystem;
|
||||
BOOL m_bSource;
|
||||
static CMapStringToPtr fileMap;
|
||||
static CStringArray orderedFileNames;
|
||||
static CMapStringToPtr includeMap;
|
||||
static CMapStringToPtr noDependMap;
|
||||
|
||||
CFileRecord( const char *shortName, const char* pFullName, BOOL bSystem, BOOL bSource):
|
||||
m_shortName( shortName ),
|
||||
m_pathName(),
|
||||
m_includes(),
|
||||
m_bVisited(FALSE),
|
||||
m_bSource( bSource ),
|
||||
m_bSystem(bSystem){
|
||||
|
||||
m_pathName = pFullName;
|
||||
FixPathName(m_pathName); // all upper case for consistency
|
||||
ASSERT(FindFileRecord(m_pathName) == NULL); // make sure it's not already in the map
|
||||
fileMap[m_pathName] = this; // add this to the filemap, using the appropriate name as the key
|
||||
if (bSource) {
|
||||
orderedFileNames.Add(m_pathName); // remember the order we saw source files in
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// open the file and grab all the includes.
|
||||
//
|
||||
void ProcessFile(){
|
||||
FILE *f;
|
||||
CString fullName;
|
||||
BOOL bSystem;
|
||||
DWORD lineCntr = 0;
|
||||
char *a = new char[2048];
|
||||
memset(a, 0, 2048);
|
||||
char srcPath[_MAX_PATH];
|
||||
|
||||
// construct the full path
|
||||
if (!_AfxFullPath(srcPath, m_pathName)) {
|
||||
strcpy(srcPath, m_pathName);
|
||||
}
|
||||
|
||||
// strip off the source filename to end up with just the path
|
||||
LPSTR pTemp = strrchr(srcPath, '\\');
|
||||
if (pTemp) {
|
||||
*(pTemp + 1) = 0;
|
||||
}
|
||||
|
||||
f = fopen(m_pathName, "r");
|
||||
if(f != NULL && f != (FILE *)-1) {
|
||||
setvbuf(f, NULL, _IOFBF, 32768); // use a large file buffer
|
||||
while(fgets(a, 2047, f)) {
|
||||
// if the string "//{{NO_DEPENDENCIES}}" is at the start of one of the
|
||||
// first 10 lines of a file, don't build dependencies on it or any
|
||||
// of the files it includes
|
||||
if (lineCntr < 10) {
|
||||
static char* pDependStr = "//{{NO_DEPENDENCIES}}";
|
||||
if (strncmp(a, pDependStr, strlen(pDependStr)) == 0) {
|
||||
noDependMap[m_pathName] = 0; // add it to the noDependMap
|
||||
break; // no need for further processing of this file
|
||||
}
|
||||
}
|
||||
++lineCntr;
|
||||
// have to handle a variety of legal syntaxes that we find in our source files:
|
||||
// #include
|
||||
// # include
|
||||
// #include
|
||||
// if the first non-whitespace char is a '#', consider this line
|
||||
pTemp = a;
|
||||
pTemp += strspn(pTemp, " \t"); // skip whitespace
|
||||
if (*pTemp == '#') {
|
||||
++pTemp; // skip the '#'
|
||||
pTemp += strspn(pTemp, " \t"); // skip more whitespace
|
||||
if( !strncmp(pTemp, "include", 7) ){
|
||||
pTemp += 7; // skip the "include"
|
||||
pTemp += strspn(pTemp, " \t"); // skip more whitespace
|
||||
bSystem = (*pTemp == '<'); // mark if it's a system include or not
|
||||
if (bSystem || (*pTemp == '"')) {
|
||||
LPSTR pStart = pTemp + 1; // mark the start of the string
|
||||
pTemp = pStart + strcspn(pStart, ">\" "); // find the end of the string
|
||||
*pTemp = 0; // terminate the string
|
||||
|
||||
// construct the full pathname from the path part of the
|
||||
// source file and the name listed here
|
||||
fullName = srcPath;
|
||||
fullName += pStart;
|
||||
CFileRecord *pAddMe = AddFile( pStart, fullName, bSystem );
|
||||
if (pAddMe) {
|
||||
m_includes.Add(pAddMe);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
delete [] a;
|
||||
}
|
||||
|
||||
void PrintIncludes(){
|
||||
int i = 0;
|
||||
while( i < m_includes.GetSize() ){
|
||||
CFileRecord *pRec = (CFileRecord*) m_includes[i];
|
||||
|
||||
// Don't write out files that don't exist or are not in the namespace
|
||||
// of the programs using it (netscape_AppletMozillaContext.h doesn't
|
||||
// mix well with 16 bits).
|
||||
// Also don't write out files that are in the noDependMap
|
||||
void* lookupJunk;
|
||||
if( !pRec->m_bVisited && pRec->m_pathName.GetLength() != 0 && !noDependMap.Lookup(pRec->m_pathName, lookupJunk)) {
|
||||
|
||||
// not supposed to have a file in the list that doesn't exist
|
||||
ASSERT(FileExists(pRec->m_pathName));
|
||||
|
||||
CString csOutput;
|
||||
csOutput = pRec->m_pathName;
|
||||
FATName(csOutput);
|
||||
|
||||
fprintf(pAltFile, "\\\n %s ", (const char *) csOutput );
|
||||
|
||||
// mark this one as done so we don't do it more than once
|
||||
pRec->m_bVisited = TRUE;
|
||||
|
||||
pRec->PrintIncludes();
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
void PrintDepend(){
|
||||
CFileRecord *pRec;
|
||||
BOOL bFound;
|
||||
POSITION next;
|
||||
CString name;
|
||||
|
||||
// clear all the m_bVisisted flags so we can use it to keep track
|
||||
// of whether we've already output this file as a dependency
|
||||
next = fileMap.GetStartPosition();
|
||||
while( next ){
|
||||
fileMap.GetNextAssoc( next, name, *(void**)&pRec );
|
||||
pRec->m_bVisited = FALSE;
|
||||
}
|
||||
|
||||
char fname[_MAX_FNAME];
|
||||
|
||||
if (pRec->m_pathName.GetLength() != 0) {
|
||||
if( bSimple ){
|
||||
fprintf(pAltFile, "\n\n\n%s:\t", m_pathName );
|
||||
}
|
||||
else {
|
||||
CString csOutput;
|
||||
csOutput = m_pathName;
|
||||
FATName(csOutput);
|
||||
|
||||
_splitpath( csOutput, NULL, NULL, fname, NULL );
|
||||
|
||||
fprintf(pAltFile, "\n\n\n$(OUTDIR)\\%s.obj: %s ", fname, (const char*) csOutput );
|
||||
}
|
||||
m_bVisited = TRUE; // mark it as done so we won't do it again
|
||||
PrintIncludes();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static CString NormalizeFileName( const char* pName ){
|
||||
return CString(pName);
|
||||
}
|
||||
|
||||
static CFileRecord* FindFileRecord( const char *pName ){
|
||||
CFileRecord* pRec = NULL;
|
||||
CString name(pName);
|
||||
FixPathName(name);
|
||||
fileMap.Lookup(name, (void*&)pRec);
|
||||
return(pRec);
|
||||
}
|
||||
public:
|
||||
static CFileRecord* AddFile( const char* pShortName, const char* pFullName, BOOL bSystem = FALSE,
|
||||
BOOL bSource = FALSE ){
|
||||
|
||||
char fullName[_MAX_PATH];
|
||||
BOOL bFound = FALSE;
|
||||
BOOL bFoundInInclude = FALSE;
|
||||
CString foundName;
|
||||
CString fixedShortName;
|
||||
CString s;
|
||||
|
||||
|
||||
// if it is source, we might be getting an obj file. If we do,
|
||||
// convert it to a c or c++ file.
|
||||
if( bSource && (strcmp(GetExt(pShortName),".obj") == 0) ){
|
||||
char path_buffer[_MAX_PATH];
|
||||
char fname[_MAX_FNAME] = "";
|
||||
CString s;
|
||||
|
||||
_splitpath( pShortName, NULL, NULL, fname, NULL );
|
||||
if( FileExists( s = CString(fname) + ".cpp") ){
|
||||
pShortName = s;
|
||||
pFullName = s;
|
||||
}
|
||||
else if( FileExists( s = CString(fname) + ".c" ) ){
|
||||
pShortName = s;
|
||||
pFullName = s;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// if pFullName was not constructed, construct it here based on the current directory
|
||||
if (!pFullName) {
|
||||
_AfxFullPath(fullName, pShortName);
|
||||
pFullName = fullName;
|
||||
}
|
||||
|
||||
// first check to see if we already have this exact file
|
||||
CFileRecord *pRec = FindFileRecord(pFullName);
|
||||
|
||||
if (pRec) {
|
||||
bFound = TRUE;
|
||||
}
|
||||
|
||||
// check the fullname first
|
||||
if (!bFound && FileExists(pFullName)) {
|
||||
foundName = pFullName;
|
||||
bFound = TRUE;
|
||||
}
|
||||
|
||||
// if still not found, search the include paths
|
||||
if (!bFound) {
|
||||
// all files we've found in include directories are in the includeMap
|
||||
// we can see if we've already found it in the include path before and
|
||||
// save time by getting it from there
|
||||
fixedShortName = pShortName;
|
||||
FixPathName(fixedShortName); // normalize the name
|
||||
includeMap.Lookup(fixedShortName, (void*&)pRec);
|
||||
pShortName = fixedShortName; // set this to point to the normalized name for when we add it to the include map
|
||||
if (!pRec) {
|
||||
int i = 0;
|
||||
while( i < includeDirectories.GetSize() ){
|
||||
if( FileExists( includeDirectories[i] + pShortName ) ){
|
||||
foundName = includeDirectories[i] + pShortName;
|
||||
bFound = TRUE;
|
||||
bFoundInInclude = TRUE;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if we found it and don't already have a fileRecord for it
|
||||
// see if this name is already in there
|
||||
if (bFound && !pRec) {
|
||||
pRec = FindFileRecord(foundName);
|
||||
}
|
||||
|
||||
// source files are not allowed to be missing
|
||||
if (!pRec && !bFound && bSource) {
|
||||
fprintf(stderr, "Source file: %s doesn't exist\n", pFullName);
|
||||
mainReturn = -1; // exit with an error, don't write out the results
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (!pRec && !bFound && !bSystem) {
|
||||
fprintf(stderr, "Header not found: %s (%s)\n", pShortName, pFullName);
|
||||
}
|
||||
#endif
|
||||
|
||||
// if none of the above logic found it already in the list, must be a new file, add it to the list
|
||||
if (bFound && (pRec == NULL)) {
|
||||
pRec = new CFileRecord( pShortName, foundName, bSystem, bSource);
|
||||
|
||||
// if we found this one in the include path, add it to the includeMap
|
||||
// for performance reasons (so we can find it there next time rather
|
||||
// than having to search the file system again)
|
||||
if (bFoundInInclude) {
|
||||
includeMap[pShortName] = pRec;
|
||||
}
|
||||
}
|
||||
return pRec;
|
||||
}
|
||||
|
||||
|
||||
static void PrintDependancies(){
|
||||
CFileRecord *pRec;
|
||||
BOOL bFound;
|
||||
POSITION next;
|
||||
CString name;
|
||||
|
||||
// use orderedFileNames to preserve order
|
||||
for (int pos = 0; pos < orderedFileNames.GetSize(); pos++) {
|
||||
pRec = FindFileRecord(orderedFileNames[pos]);
|
||||
if(pRec && pRec->m_bSource ){
|
||||
pRec->PrintDepend();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PrintDepend2(){
|
||||
CFileRecord *pRec;
|
||||
int i;
|
||||
|
||||
if( m_includes.GetSize() != 0 ){
|
||||
fprintf(pAltFile, "\n\n\n%s: \\\n",m_pathName );
|
||||
i = 0;
|
||||
while( i < m_includes.GetSize() ){
|
||||
pRec = (CFileRecord*) m_includes[i];
|
||||
fprintf(pAltFile, "\t\t\t%s\t\\\n",pRec->m_pathName );
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void PrintDependancies2(){
|
||||
CFileRecord *pRec;
|
||||
BOOL bFound;
|
||||
POSITION next;
|
||||
CString name;
|
||||
|
||||
next = fileMap.GetStartPosition();
|
||||
while( next ){
|
||||
fileMap.GetNextAssoc( next, name, *(void**)&pRec );
|
||||
pRec->PrintDepend2();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void PrintTargets(const char *pMacroName, const char *pDelimeter){
|
||||
CFileRecord *pRec;
|
||||
BOOL bFound;
|
||||
POSITION next;
|
||||
CString name;
|
||||
|
||||
BOOL bNeedDelimeter = FALSE;
|
||||
fprintf(pAltFile, "%s = ", pMacroName);
|
||||
|
||||
// use orderedFileNames to preserve target order
|
||||
for (int pos = 0; pos < orderedFileNames.GetSize(); pos++) {
|
||||
pRec = FindFileRecord(orderedFileNames[pos]);
|
||||
ASSERT(pRec);
|
||||
|
||||
if( pRec && pRec->m_bSource && pRec->m_pathName.GetLength() != 0){
|
||||
char fname[_MAX_FNAME];
|
||||
|
||||
CString csOutput;
|
||||
csOutput = pRec->m_pathName;
|
||||
FATName(csOutput);
|
||||
|
||||
_splitpath( csOutput, NULL, NULL, fname, NULL );
|
||||
|
||||
if(bNeedDelimeter) {
|
||||
fprintf(pAltFile, "%s\n", pDelimeter);
|
||||
bNeedDelimeter = FALSE;
|
||||
}
|
||||
|
||||
fprintf(pAltFile, " $(OUTDIR)\\%s.obj ", fname );
|
||||
bNeedDelimeter = TRUE;
|
||||
}
|
||||
}
|
||||
fprintf(pAltFile, "\n\n\n");
|
||||
}
|
||||
|
||||
static CString DirDefine( const char *pPath ){
|
||||
char path_buffer[_MAX_PATH];
|
||||
char dir[_MAX_DIR] = "";
|
||||
char dir2[_MAX_DIR] = "";
|
||||
char fname[_MAX_FNAME] = "";
|
||||
char ext[_MAX_EXT] = "";
|
||||
CString s;
|
||||
|
||||
_splitpath( pPath, 0, dir, 0, ext );
|
||||
|
||||
BOOL bDone = FALSE;
|
||||
|
||||
while( dir && !bDone){
|
||||
// remove the trailing slash
|
||||
dir[ strlen(dir)-1] = 0;
|
||||
_splitpath( dir, 0, dir2, fname, 0 );
|
||||
if( strcmp( fname, "SRC" ) == 0 ){
|
||||
strcpy( dir, dir2 );
|
||||
}
|
||||
else {
|
||||
bDone = TRUE;
|
||||
}
|
||||
}
|
||||
s = CString(fname) + "_" + (ext+1);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
static void PrintSources(){
|
||||
int i;
|
||||
CString dirName, newDirName;
|
||||
|
||||
for( i=0; i< orderedFileNames.GetSize(); i++ ){
|
||||
newDirName= DirDefine( orderedFileNames[i] );
|
||||
if( newDirName != dirName ){
|
||||
fprintf( pAltFile, "\n\n\nFILES_%s= $(FILES_%s) \\",
|
||||
(const char*)newDirName, (const char*)newDirName );
|
||||
dirName = newDirName;
|
||||
}
|
||||
fprintf( pAltFile, "\n\t%s^", (const char*)orderedFileNames[i] );
|
||||
}
|
||||
}
|
||||
|
||||
static CString SourceDirName( const char *pPath, BOOL bFileName){
|
||||
char path_buffer[_MAX_PATH];
|
||||
char drive[_MAX_DRIVE] = "";
|
||||
char dir[_MAX_DIR] = "";
|
||||
char fname[_MAX_FNAME] = "";
|
||||
char ext[_MAX_EXT] = "";
|
||||
CString s;
|
||||
|
||||
_splitpath( pPath, drive, dir, fname, ext );
|
||||
|
||||
s = CString(drive) + dir;
|
||||
if( bFileName ){
|
||||
s += CString("FNAME") + ext;
|
||||
}
|
||||
else {
|
||||
// remove the trailing slash
|
||||
s = s.Left( s.GetLength() - 1 );
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
static CString GetExt( const char *pPath){
|
||||
char ext[_MAX_EXT] = "";
|
||||
|
||||
_splitpath( pPath, 0,0,0, ext );
|
||||
|
||||
CString s = CString(ext);
|
||||
s.MakeLower();
|
||||
return s;
|
||||
}
|
||||
|
||||
static void PrintBuildRules(){
|
||||
int i;
|
||||
CString dirName;
|
||||
|
||||
CMapStringToPtr dirList;
|
||||
|
||||
for( i=0; i< orderedFileNames.GetSize(); i++ ){
|
||||
dirList[ SourceDirName(orderedFileNames[i], TRUE) ]= 0;
|
||||
}
|
||||
|
||||
POSITION next;
|
||||
CString name;
|
||||
void *pVal;
|
||||
|
||||
next = dirList.GetStartPosition();
|
||||
while( next ){
|
||||
dirList.GetNextAssoc( next, name, pVal);
|
||||
CString dirDefine = DirDefine( name );
|
||||
CString ext = GetExt( name );
|
||||
name = SourceDirName( name, FALSE );
|
||||
CString response = dirDefine.Left(8);
|
||||
|
||||
fprintf( pAltFile,
|
||||
"\n\n\n{%s}%s{$(OUTDIR)}.obj:\n"
|
||||
"\t@rem <<$(OUTDIR)\\%s.cl\n"
|
||||
"\t$(CFILEFLAGS)\n"
|
||||
"\t$(CFLAGS_%s)\n"
|
||||
"<<KEEP\n"
|
||||
"\t$(CPP) @$(OUTDIR)\\%s.cl %%s\n",
|
||||
(const char*)name,
|
||||
(const char*)ext,
|
||||
(const char*)response,
|
||||
(const char*)dirDefine,
|
||||
(const char*)response
|
||||
);
|
||||
|
||||
fprintf( pAltFile,
|
||||
"\n\n\nBATCH_%s:\n"
|
||||
"\t@rem <<$(OUTDIR)\\%s.cl\n"
|
||||
"\t$(CFILEFLAGS)\n"
|
||||
"\t$(CFLAGS_%s)\n"
|
||||
"\t$(FILES_%s)\n"
|
||||
"<<KEEP\n"
|
||||
"\t$(TIMESTART)\n"
|
||||
"\t$(CPP) @$(OUTDIR)\\%s.cl\n"
|
||||
"\t$(TIMESTOP)\n",
|
||||
(const char*)dirDefine,
|
||||
(const char*)response,
|
||||
(const char*)dirDefine,
|
||||
(const char*)dirDefine,
|
||||
(const char*)response
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Loop through one more time and build the final batch build
|
||||
// rule
|
||||
//
|
||||
fprintf( pAltFile,
|
||||
"\n\n\nBATCH_BUILD_OBJECTS:\t\t\\\n");
|
||||
|
||||
next = dirList.GetStartPosition();
|
||||
while( next ){
|
||||
dirList.GetNextAssoc( next, name, pVal);
|
||||
CString dirDefine = DirDefine( name );
|
||||
|
||||
fprintf( pAltFile,
|
||||
"\tBATCH_%s\t\t\\\n", dirDefine );
|
||||
}
|
||||
|
||||
fprintf( pAltFile,
|
||||
"\n\n");
|
||||
}
|
||||
|
||||
|
||||
static void ProcessFiles(){
|
||||
CFileRecord *pRec;
|
||||
BOOL bFound;
|
||||
POSITION next;
|
||||
CString name;
|
||||
|
||||
// search all the files for headers, adding each one to the list when found
|
||||
// rather than do it recursively, it simple marks each one it's done
|
||||
// and starts over, stopping only when all are marked as done
|
||||
|
||||
next = fileMap.GetStartPosition();
|
||||
while( next ){
|
||||
fileMap.GetNextAssoc( next, name, *(void**)&pRec );
|
||||
if( pRec->m_bVisited == FALSE && pRec->m_bSystem == FALSE ){
|
||||
// mark this file as already done so we don't read it again
|
||||
// to find its headers
|
||||
pRec->m_bVisited = TRUE;
|
||||
pRec->ProcessFile();
|
||||
// Start searching from the beginning again
|
||||
// because ProcessFile may have added new files
|
||||
// and changed the GetNextAssoc order
|
||||
next = fileMap.GetStartPosition();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
CMapStringToPtr CFileRecord::fileMap;
|
||||
CStringArray CFileRecord::orderedFileNames;
|
||||
CMapStringToPtr CFileRecord::includeMap;
|
||||
CMapStringToPtr CFileRecord::noDependMap;
|
||||
|
||||
int main( int argc, char** argv ){
|
||||
int i = 1;
|
||||
char *pStr;
|
||||
static int iRecursion = 0; // Track levels of recursion.
|
||||
static CString outputFileName;
|
||||
|
||||
// Entering.
|
||||
iRecursion++;
|
||||
|
||||
while( i < argc ){
|
||||
if( argv[i][0] == '-' || argv[i][0] == '/' ){
|
||||
switch( argv[i][1] ){
|
||||
|
||||
case 'i':
|
||||
case 'I':
|
||||
if( argv[i][2] != 0 ){
|
||||
pStr = &(argv[i][2]);
|
||||
}
|
||||
else {
|
||||
i++;
|
||||
pStr = argv[i];
|
||||
}
|
||||
if( pStr == 0 || *pStr == '-' || *pStr == '/' ){
|
||||
goto usage;
|
||||
}
|
||||
else {
|
||||
AddIncludeDirectory( pStr );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
case 'F':
|
||||
if( argv[i][2] != 0 ){
|
||||
pStr = &(argv[i][2]);
|
||||
}
|
||||
else {
|
||||
i++;
|
||||
pStr = argv[i];
|
||||
}
|
||||
if( pStr == 0 || *pStr == '-' || *pStr == '/'){
|
||||
goto usage;
|
||||
}
|
||||
else {
|
||||
CStdioFile f;
|
||||
CString s;
|
||||
if( f.Open( pStr, CFile::modeRead ) ){
|
||||
while(f.ReadString(s)){
|
||||
s.TrimLeft();
|
||||
s.TrimRight();
|
||||
if( s.GetLength() ){
|
||||
CFileRecord::AddFile( s, NULL, FALSE, TRUE );
|
||||
}
|
||||
}
|
||||
f.Close();
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"makedep: file not found: %s", pStr );
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
case 'O':
|
||||
if( argv[i][2] != 0 ){
|
||||
pStr = &(argv[i][2]);
|
||||
}
|
||||
else {
|
||||
i++;
|
||||
pStr = argv[i];
|
||||
}
|
||||
if( pStr == 0 || *pStr == '-' || *pStr == '/'){
|
||||
goto usage;
|
||||
}
|
||||
else {
|
||||
CStdioFile f;
|
||||
CString s;
|
||||
outputFileName = pStr;
|
||||
if(!(pAltFile = fopen(pStr, "w+"))) {
|
||||
fprintf(stderr, "makedep: file not found: %s", pStr );
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case '1':
|
||||
if( argv[i][2] == '6') {
|
||||
b16 = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 's':
|
||||
case 'S':
|
||||
bSimple = TRUE;
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 'h':
|
||||
case 'H':
|
||||
case '?':
|
||||
usage:
|
||||
fprintf(stderr, "usage: makedep -I <dirname> -F <filelist> <filename>\n"
|
||||
" -I <dirname> Directory name, can be repeated\n"
|
||||
" -F <filelist> List of files to scan, one per line\n"
|
||||
" -O <outputFile> File to write output, default stdout\n");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
else if( argv[i][0] == '@' ){
|
||||
// file contains our commands.
|
||||
CStdioFile f;
|
||||
CString s;
|
||||
int iNewArgc = 0;
|
||||
char **apNewArgv = new char*[5000];
|
||||
memset(apNewArgv, 0, sizeof(apNewArgv));
|
||||
|
||||
// First one is always the name of the exe.
|
||||
apNewArgv[0] = argv[0];
|
||||
iNewArgc++;
|
||||
|
||||
const char *pTraverse;
|
||||
const char *pBeginArg;
|
||||
if( f.Open( &argv[i][1], CFile::modeRead ) ){
|
||||
while( iNewArgc < 5000 && f.ReadString(s) ) {
|
||||
// Scan the string for args, and do the right thing.
|
||||
pTraverse = (const char *)s;
|
||||
while(iNewArgc < 5000 && *pTraverse) {
|
||||
if(isspace(*pTraverse)) {
|
||||
pTraverse++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Extract to next space.
|
||||
pBeginArg = pTraverse;
|
||||
do {
|
||||
pTraverse++;
|
||||
}
|
||||
while(*pTraverse && !isspace(*pTraverse));
|
||||
apNewArgv[iNewArgc] = new char[pTraverse - pBeginArg + 1];
|
||||
memset(apNewArgv[iNewArgc], 0, pTraverse - pBeginArg + 1);
|
||||
strncpy(apNewArgv[iNewArgc], pBeginArg, pTraverse - pBeginArg);
|
||||
iNewArgc++;
|
||||
}
|
||||
}
|
||||
f.Close();
|
||||
}
|
||||
|
||||
// Recurse if needed.
|
||||
if(iNewArgc > 1) {
|
||||
main(iNewArgc, apNewArgv);
|
||||
}
|
||||
|
||||
// Free off the argvs (but not the very first one which we didn't allocate).
|
||||
while(iNewArgc > 1) {
|
||||
iNewArgc--;
|
||||
delete [] apNewArgv[iNewArgc];
|
||||
}
|
||||
delete [] apNewArgv;
|
||||
}
|
||||
else {
|
||||
CFileRecord::AddFile( argv[i], NULL, FALSE, TRUE );
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
// Only of the very bottom level of recursion do we do this.
|
||||
if(iRecursion == 1) {
|
||||
|
||||
// only write the results out if no errors encountered
|
||||
if (mainReturn == 0) {
|
||||
CFileRecord::ProcessFiles();
|
||||
if( !bSimple ){
|
||||
CFileRecord::PrintTargets("OBJ_FILES", "\\");
|
||||
if(b16) {
|
||||
CFileRecord::PrintTargets("LINK_OBJS", "+\\");
|
||||
}
|
||||
else {
|
||||
CFileRecord::PrintTargets("LINK_OBJS", "^");
|
||||
}
|
||||
CFileRecord::PrintSources();
|
||||
CFileRecord::PrintBuildRules();
|
||||
}
|
||||
CFileRecord::PrintDependancies();
|
||||
}
|
||||
|
||||
if(pAltFile != stdout) {
|
||||
fclose(pAltFile);
|
||||
if (mainReturn != 0) {
|
||||
remove(outputFileName); // kill output file if returning an error
|
||||
}
|
||||
}
|
||||
}
|
||||
iRecursion--;
|
||||
return mainReturn;
|
||||
}
|
||||
BIN
mozilla/cmd/winfe/mkfiles32/makedep.exe
Executable file
BIN
mozilla/cmd/winfe/mkfiles32/makedep.exe
Executable file
Binary file not shown.
2709
mozilla/cmd/winfe/mkfiles32/mozilla.mak
Normal file
2709
mozilla/cmd/winfe/mkfiles32/mozilla.mak
Normal file
File diff suppressed because it is too large
Load Diff
BIN
mozilla/cmd/winfe/mkfiles32/txt2rc.exe
Executable file
BIN
mozilla/cmd/winfe/mkfiles32/txt2rc.exe
Executable file
Binary file not shown.
103
mozilla/cmd/winfe/mkfiles32/waitfor.cpp
Normal file
103
mozilla/cmd/winfe/mkfiles32/waitfor.cpp
Normal file
@@ -0,0 +1,103 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
void usage( char *pMsg ){
|
||||
if( pMsg ){
|
||||
fprintf( stderr, "waitfor: %s\n\n", pMsg );
|
||||
}
|
||||
fprintf( stderr,
|
||||
"waitfor - wait for a file to exist\n"
|
||||
"\n"
|
||||
"usage: waitfor [-a] <file> [<file>..] \n"
|
||||
"\n"
|
||||
" Waits for file <file> to exist and returns 0, if more than one file is\n"
|
||||
" specified, waitfor waits for the first one found.\n"
|
||||
"\n"
|
||||
"Parameters:"
|
||||
"\n"
|
||||
" -a Waits for all files to be created \n"
|
||||
);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
#define FILEMAX 300
|
||||
|
||||
void waitfor( int iFileCount, char**ppFiles, int bAll ){
|
||||
int bDone = 0;
|
||||
|
||||
while( !bDone ){
|
||||
struct stat statbuf;
|
||||
|
||||
int i = 0;
|
||||
while( i < iFileCount ){
|
||||
if( stat( ppFiles[i], &statbuf ) == 0 ){
|
||||
if( !bAll ){
|
||||
bDone = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
goto SLEEP;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
bDone = 1;
|
||||
|
||||
SLEEP:
|
||||
if( !bDone ){
|
||||
_sleep( 100 * 1 );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char** argv ){
|
||||
if( argc == 0 ){
|
||||
usage(0);
|
||||
}
|
||||
int bAll = 0;
|
||||
|
||||
int i = 1;
|
||||
char* ppFiles[FILEMAX];
|
||||
int iFileCount = 0;
|
||||
|
||||
while( i < argc ){
|
||||
if( argv[i][0] == '-' ){
|
||||
switch( argv[i][1] ){
|
||||
case 'a':
|
||||
bAll = 1;
|
||||
defaut:
|
||||
usage("Unknown option");
|
||||
}
|
||||
}
|
||||
else {
|
||||
ppFiles[iFileCount] = argv[i];
|
||||
iFileCount++;
|
||||
}
|
||||
if( iFileCount >= FILEMAX || iFileCount == 0 ){
|
||||
usage("Too many files");
|
||||
}
|
||||
i++;
|
||||
}
|
||||
waitfor( iFileCount, ppFiles, bAll );
|
||||
return 0;
|
||||
}
|
||||
BIN
mozilla/cmd/winfe/mkfiles32/waitfor.exe
Executable file
BIN
mozilla/cmd/winfe/mkfiles32/waitfor.exe
Executable file
Binary file not shown.
130
mozilla/config/AIX.mk
Normal file
130
mozilla/config/AIX.mk
Normal file
@@ -0,0 +1,130 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for IBM AIX for RS/6000 and PPC
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := aix
|
||||
CPU_ARCH := rs6000 # How can I determine this?
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES =
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR = /usr/lib/X11
|
||||
MOTIF =
|
||||
MOTIFLIB = -lXm
|
||||
OS_LIBS = -lm -lbsd
|
||||
|
||||
PLATFORM_FLAGS = -qarch=com -qmaxmem=65536 -DAIX -Daix
|
||||
MOVEMAIL_FLAGS =
|
||||
PORT_FLAGS = -DSYSV -DNEED_CDEFS_H -DNEED_SELECT_H -DNEED_IOCTL_H -DSYS_MACHINE_H -DUSE_NODL_TABS -DHAVE_SIGNED_CHAR -DHAVE_SYS_SELECT_H -DNEED_SYS_WAIT_H -DHAVE_INT32_T -DNEED_H_ERRNO
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/aix.lm
|
||||
EN_LOCALE = en_US.ISO8859-1
|
||||
DE_LOCALE = de_DE.ISO8859-1
|
||||
FR_LOCALE = fr_FR.ISO8859-1
|
||||
JP_LOCALE = ja_JP.IBM-eucJP
|
||||
SJIS_LOCALE = Ja_JP.IBM-932
|
||||
KR_LOCALE = ko_KR.IBM-eucKR
|
||||
CN_LOCALE = zh_CN
|
||||
TW_LOCALE = zh_TW.IBM-eucTW
|
||||
I2_LOCALE = iso88592
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
ifeq ($(OS_RELEASE),3.2)
|
||||
PLATFORM_FLAGS += -qtune=601 -DAIXV3 -DAIX3_2_5
|
||||
PORT_FLAGS += -DSW_THREADS
|
||||
else
|
||||
PLATFORM_FLAGS += -qtune=604 -qnosom -DAIXV4
|
||||
endif
|
||||
ifeq ($(OS_RELEASE),4.1)
|
||||
PLATFORM_FLAGS += -DAIX4_1
|
||||
PORT_FLAGS += -DSW_THREADS
|
||||
OS_LIBS += -lsvld
|
||||
DSO_LDOPTS = -bM:SRE -bh:4 -bnoentry
|
||||
AIX_NSPR = $(DIST)/bin/libnspr_shr.a
|
||||
LIBNSPR = $(AIX_NSPR)
|
||||
AIX_NSPR_LINK = -L$(DIST)/bin -lnspr_shr -blibpath:/usr/local/lib/netscape:/usr/lib:/lib:.
|
||||
#
|
||||
# Used to link java, javah. Include 3 relative paths since we're guessing
|
||||
# at runtime where the hell the library is. LIBPATH can be set, but
|
||||
# setting this will be hell for release people, _AND_ I couldn't get it to
|
||||
# work. Sigh. -mcafee
|
||||
#
|
||||
AIX_NSPR_DIST_LINK = -L$(DIST)/bin -lnspr_shr -blibpath:.:../dist/$(OBJDIR)/bin:../../dist/$(OBJDIR)/bin:../../../dist/$(OBJDIR)/bin:/usr/lib:/lib
|
||||
endif
|
||||
ifneq (,$(filter 4.2 4.3,$(OS_RELEASE)))
|
||||
PORT_FLAGS += -DHW_THREADS -DUSE_PTHREADS -DPOSIX7
|
||||
OS_LIBS += -ldl
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
DSO_LDOPTS = -brtl -bM:SRE -bnoentry -bexpall
|
||||
ifeq ($(OS_RELEASE),4.2)
|
||||
PLATFORM_FLAGS += -DAIX4_2
|
||||
endif
|
||||
ifeq ($(OS_RELEASE),4.3)
|
||||
PLATFORM_FLAGS += -DAIX4_3
|
||||
endif
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
CC = cc
|
||||
CCC = xlC -+
|
||||
BSDECHO = $(DIST)/bin/bsdecho
|
||||
RANLIB = /usr/ccs/bin/ranlib
|
||||
WHOAMI = /bin/whoami
|
||||
|
||||
ifneq ($(OS_RELEASE),3.2)
|
||||
UNZIP_PROG = $(CONTRIB_BIN)unzip
|
||||
ZIP_PROG = $(CONTRIB_BIN)zip
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
ifdef SERVER_BUILD
|
||||
CC = xlC_r
|
||||
# In order to automatically generate export lists, we need to use -g with -O
|
||||
OPTIMIZER = -g -O
|
||||
PORT_FLAGS += -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -DFD_SETSIZE=4096
|
||||
endif
|
||||
|
||||
#ifeq ($(PTHREADS_USER),1)
|
||||
#USE_PTHREADS =
|
||||
#else
|
||||
#USE_PTHREADS = 1
|
||||
#endif
|
||||
|
||||
MUST_BOOTLEG_ALLOCA = 1
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
|
||||
DSO_LDFLAGS = -lXm -lXt -lX11
|
||||
EXTRA_DSO_LDOPTS = -lc
|
||||
84
mozilla/config/BSD_OS.mk
Normal file
84
mozilla/config/BSD_OS.mk
Normal file
@@ -0,0 +1,84 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for BSDI BSD/386 and BSD/OS for x86
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := bsdi
|
||||
CPU_ARCH := x86
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES = -I/usr/X11/include
|
||||
G++INCLUDES = -I/usr/include/g++
|
||||
LOC_LIB_DIR = /usr/X11/lib
|
||||
MOTIF = $(NS_LIB)/Xm
|
||||
MOTIFLIB = -lXm
|
||||
OS_LIBS = -lcompat
|
||||
|
||||
PLATFORM_FLAGS = -Wall -Wno-format -DBSDI -D__386BSD__ -DBSD -Di386
|
||||
MOVEMAIL_FLAGS = -DHAVE_STRERROR
|
||||
PORT_FLAGS = -DSW_THREADS -DNEED_BSDREGEX -DNTOHL_ENDIAN_H -DUSE_NODL_TABS -DNEED_SYS_WAIT_H -DNO_TZNAME -DHAVE_NETINET_IN_H -DNO_INT64_T -DNEED_UINT_T -DHAVE_SYS_SELECT_H
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/bsd386.lm
|
||||
EN_LOCALE = C
|
||||
DE_LOCALE = de_DE.ISO8859-1
|
||||
FR_LOCALE = fr_FR.ISO8859-1
|
||||
JP_LOCALE = ja
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko_KR.EUC
|
||||
CN_LOCALE = zh
|
||||
TW_LOCALE = zh
|
||||
I2_LOCALE = i2
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
ifeq ($(OS_RELEASE),1.1)
|
||||
PLATFORM_FLAGS += -DBSDI_1
|
||||
PORT_FLAGS += -DNEED_UINT -DNEED_IOCTL_H -DNEED_REALPATH
|
||||
endif
|
||||
ifeq ($(OS_RELEASE),2.1)
|
||||
PLATFORM_FLAGS += -DBSDI_2
|
||||
PORT_FLAGS += -DHAVE_FILIO_H
|
||||
UNZIP_PROG = $(CONTRIB_BIN)unzip
|
||||
endif
|
||||
ifeq ($(OS_RELEASE),3.0)
|
||||
PLATFORM_FLAGS += -DBSDI_2 -DBSDI_3
|
||||
PORT_FLAGS += -DHAVE_FILIO_H
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
EMACS = /usr/bin/true
|
||||
PERL = /usr/bin/perl
|
||||
RANLIB = /usr/bin/ranlib
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
89
mozilla/config/FreeBSD.mk
Normal file
89
mozilla/config/FreeBSD.mk
Normal file
@@ -0,0 +1,89 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for FreeBSD
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := freebsd
|
||||
CPU_ARCH := x86
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES = -I/usr/X11R6/include
|
||||
G++INCLUDES = -I/usr/include/g++
|
||||
LOC_LIB_DIR =
|
||||
MOTIF =
|
||||
MOTIFLIB =
|
||||
OS_LIBS =
|
||||
|
||||
# Don't define BSD, because it's already defined in /usr/include/sys/param.h.
|
||||
PLATFORM_FLAGS = -DFREEBSD -DBSDI -DBSDI_2 -D__386BSD__ -Di386 $(DSO_CFLAGS)
|
||||
MOVEMAIL_FLAGS = -DHAVE_STRERROR
|
||||
PORT_FLAGS = -DSW_THREADS -DNEED_UINT -DHAVE_LCHOWN -DNTOHL_ENDIAN_H -DHAVE_FILIO_H -DNEED_SYS_TIME_H -DNEED_UINT_T -DHAVE_BSD_FLOCK
|
||||
PDJAVA_FLAGS = -mx128m
|
||||
OS_GPROF_FLAGS = -pg
|
||||
LD_FLAGS = -L/usr/X11R6/lib -lXm
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/bsd386.lm
|
||||
EN_LOCALE = C
|
||||
DE_LOCALE = de_DE.ISO8859-1
|
||||
FR_LOCALE = fr_FR.ISO8859-1
|
||||
JP_LOCALE = ja
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko_KR.EUC
|
||||
CN_LOCALE = zh
|
||||
TW_LOCALE = zh
|
||||
I2_LOCALE = i2
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
DLL_SUFFIX = so.1.0
|
||||
EMACS = /usr/bin/true
|
||||
JAVA_PROG = $(JAVA_BIN)java
|
||||
RANLIB = /usr/bin/ranlib
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
ifeq ($(USE_PTHREADS),1)
|
||||
OS_LIBS = -lc_r
|
||||
PORT_FLAGS += -D_PR_NEED_FAKE_POLL
|
||||
else
|
||||
OS_LIBS = -lc
|
||||
PORT_FLAGS += -D_PR_LOCAL_THREADS_ONLY
|
||||
endif
|
||||
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
|
||||
DSO_CFLAGS = -fpic
|
||||
DSO_LDFLAGS =
|
||||
DSO_LDOPTS = -Bshareable
|
||||
119
mozilla/config/HP-UX.mk
Normal file
119
mozilla/config/HP-UX.mk
Normal file
@@ -0,0 +1,119 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for HP-UX
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := hpux
|
||||
CPU_ARCH := hppa
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES =
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR = /usr/lib/X11
|
||||
MOTIF =
|
||||
MOTIFLIB =
|
||||
OS_LIBS = -ldld
|
||||
|
||||
PLATFORM_FLAGS = $(DSO_CFLAGS) -DHPUX -Dhpux -D$(CPU_ARCH) $(ADDITIONAL_CFLAGS)
|
||||
MOVEMAIL_FLAGS = -DHAVE_STRERROR
|
||||
PORT_FLAGS = -D_HPUX_SOURCE -DSW_THREADS -DNO_SIGNED -DNO_FNDELAY -DHAVE_ODD_SELECT -DNO_CDEFS_H -DNO_LONG_LONG -DNEED_IOCTL_H -DNEED_MATH_H -DUSE_NODL_TABS -DMITSHM -DNEED_SYS_WAIT_H -DHAVE_INT32_T -DNEED_UINT_T -DNEED_H_ERRNO
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/hpux.lm
|
||||
EN_LOCALE = american.iso88591
|
||||
DE_LOCALE = german.iso88591
|
||||
FR_LOCALE = french.iso88591
|
||||
JP_LOCALE = japanese.euc
|
||||
SJIS_LOCALE = japanese
|
||||
KR_LOCALE = korean
|
||||
CN_LOCALE = chinese-s
|
||||
TW_LOCALE = chinese-t.big5
|
||||
I2_LOCALE = i2
|
||||
IT_LOCALE = it
|
||||
SV_LOCALE = sv
|
||||
ES_LOCALE = es
|
||||
NL_LOCALE = nl
|
||||
PT_LOCALE = pt
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
ifeq ($(OS_RELEASE),A.09)
|
||||
PLATFORM_FLAGS += -DHPUX9 -Dhpux9
|
||||
OS_LIBS += -L/lib/pa1.1 -lm
|
||||
NO_INLINE = +d
|
||||
else
|
||||
OS_LIBS += -lm
|
||||
endif
|
||||
|
||||
ifeq ($(OS_RELEASE),B.10)
|
||||
PLATFORM_FLAGS += -DHPUX10 -Dhpux10
|
||||
PORT_FLAGS += -DRW_NO_OVERLOAD_SCHAR -DHAVE_MODEL_H
|
||||
JAVA_PROG = $(CONTRIB_BIN)java
|
||||
ifeq ($(OS_VERSION),.10)
|
||||
PLATFORM_FLAGS += -DHPUX10_10
|
||||
endif
|
||||
ifeq ($(OS_VERSION),.20)
|
||||
PLATFORM_FLAGS += -DHPUX10_20
|
||||
endif
|
||||
ifeq ($(OS_VERSION),.30)
|
||||
PLATFORM_FLAGS += -DHPUX10_30
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OS_RELEASE),B.11)
|
||||
PLATFORM_FLAGS += -DHPUX10 -DHPUX11
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
BSDECHO = $(DIST)/bin/bsdecho
|
||||
CC = cc -Ae
|
||||
CCC = CC -Aa +a1 $(NO_INLINE)
|
||||
DLL_SUFFIX = sl
|
||||
PERL = $(LOCAL_BIN)perl
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
ifdef SERVER_BUILD
|
||||
PLATFORM_FLAGS += +DA1.0 -Wl,-E
|
||||
endif
|
||||
|
||||
ELIBS_CFLAGS = -g -DHAVE_STRERROR
|
||||
|
||||
HAVE_PURIFY = 1
|
||||
MUST_BOOTLEG_ALLOCA = 1
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
|
||||
DSO_LDOPTS = -b
|
||||
DSO_LDFLAGS =
|
||||
DSO_CFLAGS = +Z
|
||||
183
mozilla/config/IRIX.mk
Normal file
183
mozilla/config/IRIX.mk
Normal file
@@ -0,0 +1,183 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for IRIX
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := irix
|
||||
CPU_ARCH := mips
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES =
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR = /usr/lib/X11
|
||||
MOTIF =
|
||||
MOTIFLIB =
|
||||
OS_LIBS =
|
||||
|
||||
PLATFORM_FLAGS = -DIRIX
|
||||
MOVEMAIL_FLAGS =
|
||||
PORT_FLAGS = -DSVR4 -DHAVE_LCHOWN -DHAVE_SIGNED_CHAR -DHAVE_FILIO_H -DHAS_PGNO_T -DMITSHM -DHAVE_WAITID -DNEED_VBASE -DNEED_SYS_TIME_H -DHAVE_SYSTEMINFO_H -DNO_JNI_STUBS -D_MIPS_SIM_ABI32
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/irix.lm
|
||||
EN_LOCALE = en_US
|
||||
DE_LOCALE = de
|
||||
FR_LOCALE = fr
|
||||
JP_LOCALE = ja_JP.EUC
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko_KR.euc
|
||||
CN_LOCALE = zh_CN.ugb
|
||||
TW_LOCALE = zh_TW.ucns
|
||||
I2_LOCALE = i2
|
||||
IT_LOCALE = it
|
||||
SV_LOCALE = sv
|
||||
ES_LOCALE = es
|
||||
NL_LOCALE = nl
|
||||
PT_LOCALE = pt
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
ifeq ($(OS_RELEASE),6)
|
||||
#
|
||||
# The "-woff 131" silences the really noisy 6.x ld's warnings about
|
||||
# having multiply defined weak symbols.
|
||||
#
|
||||
# The "-woff 3247" silences complaints about the "#pragma segment"
|
||||
# stuff strewn all over libneo (apparently for Macintoshes).
|
||||
#
|
||||
NO_NOISE = -woff 131
|
||||
PLATFORM_FLAGS += -multigot -Wl,-nltgot,170
|
||||
PORT_FLAGS += -DNO_UINT32_T -DNO_INT64_T -DNEED_BSD_TYPES
|
||||
SHLIB_LD_OPTS = -no_unresolved
|
||||
ifeq ($(AWT_11),1)
|
||||
JAVAC_ZIP = $(NS_LIB)/rt.jar:$(NS_LIB)/dev.jar:$(NS_LIB)/i18n.jar:$(NS_LIB)/tiny.jar
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef NS_USE_GCC
|
||||
CC = cc
|
||||
CCC = CC -woff 3247
|
||||
endif
|
||||
|
||||
ifeq ($(OS_VERSION),.3)
|
||||
PERL = $(LOCAL_BIN)perl5
|
||||
ifndef NS_USE_GCC
|
||||
XGOT_FLAG = -xgot
|
||||
#
|
||||
# Use gtscc to unbloat the C++ global count.
|
||||
#
|
||||
ifdef USE_GTSCC
|
||||
ifndef NO_GTSCC
|
||||
XGOT_FLAG =
|
||||
CCC = $(DIST)/bin/gtscc $(GTSCC_CC_OPTIONS) -gtsfile $(DEPTH)/config/$(OBJDIR)/db.gts -gtsrootdir $(DEPTH)
|
||||
ifeq ($(findstring modules/,$(SRCDIR)),modules/)
|
||||
CC = $(DIST)/bin/gtscc $(GTSCC_CC_OPTIONS) -gtsfile $(DEPTH)/config/$(OBJDIR)/db.gts -gtsrootdir $(DEPTH)
|
||||
endif
|
||||
ifeq ($(findstring sun-java/,$(SRCDIR)),sun-java/)
|
||||
CC = $(DIST)/bin/gtscc $(GTSCC_CC_OPTIONS) -gtsfile $(DEPTH)/config/$(OBJDIR)/db.gts -gtsrootdir $(DEPTH)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
PLATFORM_FLAGS += $(XGOT_FLAG) -DIRIX5_3
|
||||
endif
|
||||
|
||||
ifeq ($(OS_VERSION),.2)
|
||||
PLATFORM_FLAGS += -DIRIX6_2
|
||||
endif
|
||||
ifeq ($(OS_VERSION),.3)
|
||||
PLATFORM_FLAGS += -DIRIX6_3
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
WHOAMI = /bin/whoami
|
||||
UNZIP_PROG = $(NS_BIN)unzip
|
||||
ZIP_PROG = $(NS_BIN)zip
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
ifdef NS_USE_GCC
|
||||
PLATFORM_FLAGS += -Wall -Wno-format
|
||||
ASFLAGS += -x assembler-with-cpp
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER = -O6
|
||||
endif
|
||||
else
|
||||
PLATFORM_FLAGS += -32 -fullwarn -xansi -DIRIX_STARTUP_SPEEDUPS
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER = -O -Olimit 4000
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef NO_MDUPDATE
|
||||
MDUPDATE_FLAGS = -MDupdate $(DEPENDENCIES)
|
||||
endif
|
||||
|
||||
ifeq ($(USE_KERNEL_THREADS),1)
|
||||
PORT_FLAGS += -DHW_THREADS -D_SGI_MP_SOURCE
|
||||
else
|
||||
PORT_FLAGS += -DSW_THREADS
|
||||
endif
|
||||
|
||||
#
|
||||
# The "o32" calling convention is the default for 5.3 and 6.2.
|
||||
# According to the SGI dudes, they will migrate to "n32" for 6.5.
|
||||
# What will we do then?
|
||||
# If we want to do the same, simply uncomment the line below ..
|
||||
#
|
||||
#PORT_FLAGS += -D_MIPS_SIM_NABI32
|
||||
|
||||
#
|
||||
# To get around SGI's problems with the Asian input method.
|
||||
#
|
||||
MAIL_IM_HACK = *Mail*preeditType:none
|
||||
NEWS_IM_HACK = *News*preeditType:none
|
||||
|
||||
#
|
||||
# An nm command which generates an output like:
|
||||
# archive.a:object.o: 0000003 T symbol
|
||||
#
|
||||
NM_PO = nm -Bpo
|
||||
|
||||
HAVE_PURIFY = 1
|
||||
MUST_BOOTLEG_ALLOCA = 1
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
|
||||
MKSHLIB = $(LD) $(NO_NOISE) $(SHLIB_LD_OPTS) -shared -soname $(@:$(OBJDIR)/%.so=%.so)
|
||||
|
||||
DSO_LDOPTS = -elf -shared -all
|
||||
DSO_LDFLAGS = -nostdlib -L/lib -L/usr/lib -L/usr/lib -lXm -lXt -lX11 -lgen
|
||||
|
||||
ifdef DSO_BACKEND
|
||||
DSO_LDOPTS += -soname $(DSO_NAME)
|
||||
endif
|
||||
|
||||
142
mozilla/config/Linux.mk
Normal file
142
mozilla/config/Linux.mk
Normal file
@@ -0,0 +1,142 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for Linux (all architectures)
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := linux
|
||||
ifeq (86,$(findstring 86,$(OS_TEST)))
|
||||
CPU_ARCH := x86
|
||||
else
|
||||
CPU_ARCH := $(OS_TEST)
|
||||
endif
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES =
|
||||
G++INCLUDES = -I/usr/include/g++
|
||||
LOC_LIB_DIR = /usr/lib/X11
|
||||
MOTIF =
|
||||
MOTIFLIB =
|
||||
OS_LIBS =
|
||||
|
||||
PLATFORM_FLAGS = -ansi -Wall -pipe -DLINUX -Dlinux -DLINUX1_2
|
||||
MOVEMAIL_FLAGS = -DHAVE_STRERROR
|
||||
PORT_FLAGS = -D_POSIX_SOURCE -D_BSD_SOURCE -DSW_THREADS -DNEED_ENDIAN_H -DNEED_GETOPT_H -DNEED_IOCTL_H -DUSE_NODL_TABS -DHAVE_SIGNED_CHAR -DNEED_SYS_TIME_H -DHAVE_SYS_BITYPES_H -DNEED_UINT_T
|
||||
PDJAVA_FLAGS = -mx128m
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/linux.lm
|
||||
EN_LOCALE = C
|
||||
DE_LOCALE = de_DE.ISO8859-1
|
||||
FR_LOCALE = fr_FR.ISO8859-1
|
||||
JP_LOCALE = ja
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko_KR.EUC
|
||||
CN_LOCALE = zh
|
||||
TW_LOCALE = zh
|
||||
I2_LOCALE = i2
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
ifeq ($(CPU_ARCH),alpha)
|
||||
PLATFORM_FLAGS += -D__$(CPU_ARCH) -D_ALPHA_
|
||||
PORT_FLAGS += -DNEED_TIME_R -DMITSHM -D_XOPEN_SOURCE
|
||||
OS_INCLUDES += -I/usr/X11R6/include
|
||||
OS_LIBS += -L/lib -ldl -lc
|
||||
endif
|
||||
ifeq ($(CPU_ARCH),m68k)
|
||||
PLATFORM_FLAGS += -m68020-40 -D$(CPU_ARCH)
|
||||
PORT_FLAGS += -DNEED_TIME_R -DMITSHM -D_XOPEN_SOURCE
|
||||
OS_INCLUDES += -I/usr/X11R6/include
|
||||
OS_LIBS += -L/lib -ldl -lc
|
||||
endif
|
||||
ifeq ($(CPU_ARCH),ppc)
|
||||
PLATFORM_FLAGS += -DMKLINUX -D$(CPU_ARCH)
|
||||
OS_INCLUDES += -I/usr/local/include -I/usr/X11R6/include
|
||||
endif
|
||||
ifeq ($(CPU_ARCH),sparc)
|
||||
PLATFORM_FLAGS += -D$(CPU_ARCH)
|
||||
OS_INCLUDES += -I/usr/X11R6/include
|
||||
endif
|
||||
ifeq ($(CPU_ARCH),x86)
|
||||
PLATFORM_FLAGS += -mno-486 -Di386
|
||||
PORT_FLAGS += -DNEED_TIME_R -DMITSHM -D_XOPEN_SOURCE
|
||||
OS_INCLUDES += -I/usr/X11R6/include
|
||||
OS_LIBS += -L/lib -ldl -lc
|
||||
endif
|
||||
|
||||
# These are CPU_ARCH independent
|
||||
ifeq ($(OS_RELEASE),1.2)
|
||||
PORT_FLAGS += -DNEED_SYS_WAIT_H
|
||||
endif
|
||||
ifneq (,$(filter 2.0 2.1,$(OS_RELEASE)))
|
||||
PORT_FLAGS += -DNO_INT64_T
|
||||
PLATFORM_FLAGS += -DLINUX2_0
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER = -O2
|
||||
endif
|
||||
endif
|
||||
# I think just -DLINUX1 for 1.x, -DLINUX2 for 2.x, ... would be a better strategy (?) --briano.
|
||||
ifeq ($(OS_RELEASE),2.1)
|
||||
PLATFORM_FLAGS += -DLINUX2_1
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
EMACS = /bin/true
|
||||
JAVA_PROG = $(JAVA_BIN)java
|
||||
PERL = /usr/bin/perl
|
||||
PROCESSOR_ARCHITECTURE = _$(CPU_ARCH)
|
||||
RANLIB = /usr/bin/ranlib
|
||||
|
||||
ifneq ($(CPU_ARCH),ppc)
|
||||
UNZIP_PROG = /usr/bin/unzip
|
||||
ZIP_PROG = /usr/bin/zip
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
ifeq ($(USE_PTHREADS),1)
|
||||
PORT_FLAGS += -D_REENTRANT -D_PR_NEED_FAKE_POLL
|
||||
else
|
||||
PORT_FLAGS += -D_PR_LOCAL_THREADS_ONLY
|
||||
endif
|
||||
|
||||
NEED_XMOS = 1
|
||||
|
||||
DSO_CFLAGS = -fpic
|
||||
DSO_LDOPTS = -shared
|
||||
DSO_LDFLAGS =
|
||||
|
||||
ifeq ($(USE_JDK11),1)
|
||||
JAVA_HOME = /usr/local/java
|
||||
JAVAC_ZIP = $(JAVA_HOME)/lib/classes.zip
|
||||
endif
|
||||
131
mozilla/config/Makefile
Normal file
131
mozilla/config/Makefile
Normal file
@@ -0,0 +1,131 @@
|
||||
# -*- Mode: Makefile -*-
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
DEPTH = ..
|
||||
|
||||
HSRCS = pathsub.h
|
||||
CSRCS = nsinstall.c pathsub.c
|
||||
|
||||
ifeq ($(subst /,_,$(shell uname -s)),OS2)
|
||||
DIRS = os2
|
||||
LOCAL_INCLUDES += -Ios2
|
||||
HSRCS += dirent.h getopt.h
|
||||
endif
|
||||
|
||||
PLSRCS = nfspwd.pl revdepth.pl
|
||||
|
||||
TARGETS = $(PROGRAM) $(PLSRCS:.pl=)
|
||||
|
||||
ifneq ($(subst /,_,$(shell uname -s)),WINNT)
|
||||
PROGRAM = nsinstall$(BIN_SUFFIX)
|
||||
TARGETS += $(OBJDIR)/bsdecho$(BIN_SUFFIX)
|
||||
endif
|
||||
|
||||
# IMPORTANT: Disable NSBUILDROOT for this directory only, otherwise we have
|
||||
# a recursive rule for finding nsinstall and the perl scripts
|
||||
ifdef NSBUILDROOT
|
||||
override NSBUILDROOT :=
|
||||
endif
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
||||
ifeq ($(OS_ARCH)$(OS_RELEASE),SunOS4.1)
|
||||
INCLUDES += -I../nsprpub/pr/include/md
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH)$(OS_RELEASE),IRIX5)
|
||||
TARGETS += $(OBJDIR)/gtscc$(BIN_SUFFIX)
|
||||
endif
|
||||
|
||||
# On linux we need to generake a motif.mk file which has special flags
|
||||
# for different motif versions and/or broken libraries.
|
||||
#
|
||||
# Currently there is only 2 flags:
|
||||
#
|
||||
# MOZILLA_XM_2_1_PRINT_SHELL_FLAGS: X Print Shell Extension available
|
||||
# starting with X11R6.3 and needed by motif 2.1.
|
||||
#
|
||||
# MOZILLA_XM_2_1_BROKEN_LOCALE_FLAGS: Needed because of currently
|
||||
# broken locale support in motif 2.1 when linked with gnu libc2.
|
||||
#
|
||||
# Please direct questions about motif and linux to ramiro@netscape.com.
|
||||
#
|
||||
ifeq ($(OS_ARCH),Linux)
|
||||
|
||||
export:: motif.mk
|
||||
|
||||
motif.mk:
|
||||
@rm -f $@
|
||||
|
||||
# Check for motif 2.1 which needs the X Print Shell extension (-lXp)
|
||||
#
|
||||
# Also check for /lib/libc.so.6 (GNU libc2). If we are using GLIBC2 with
|
||||
# Motif 2.1, we need to check for /usr/lib/libBrokenLocale.so. At this
|
||||
# time locale support on motif 2.1 seems to break with GLIBC2.
|
||||
ifeq ($(shell $(DEPTH)/config/xmversion.sh),2.1)
|
||||
|
||||
@echo "MOZILLA_XM_2_1_PRINT_SHELL_FLAGS = -lXp" > $@
|
||||
|
||||
@if test -f /lib/libc.so.6 -a -f /usr/lib/libBrokenLocale.so; then \
|
||||
echo "MOZILLA_XM_2_1_BROKEN_LOCALE_FLAGS = -lBrokenLocale" >> $@; \
|
||||
fi
|
||||
else
|
||||
@echo "" > $@
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
# Redefine MAKE_OBJDIR for just this directory
|
||||
define MAKE_OBJDIR
|
||||
if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); fi
|
||||
endef
|
||||
|
||||
export:: $(TARGETS)
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
# could not get bsdecho rules to work implicitly, so here is explicit ones
|
||||
$(OBJDIR)/bsdecho.o: bsdecho.c
|
||||
@$(MAKE_OBJDIR)
|
||||
$(CC) -Fo$@ $(CFLAGS) -c $<
|
||||
|
||||
$(OBJDIR)/bsdecho$(BIN_SUFFIX): $(OBJDIR)/bsdecho.o
|
||||
@$(MAKE_OBJDIR)
|
||||
$(LINK_EXE) -OUT:$@ $< $(LDFLAGS)
|
||||
$(INSTALL) -m 444 $@ $(DIST)/bin
|
||||
else
|
||||
$(OBJDIR)/bsdecho$(BIN_SUFFIX): $(OBJDIR)/bsdecho.o
|
||||
@$(MAKE_OBJDIR)
|
||||
$(CCF) $(LDFLAGS) -o $@ $<
|
||||
$(INSTALL) -m 444 $@ $(DIST)/bin
|
||||
endif
|
||||
|
||||
$(OBJDIR)/gtscc$(BIN_SUFFIX): $(OBJDIR)/gtscc.o
|
||||
@$(MAKE_OBJDIR)
|
||||
$(CCF) $(LDFLAGS) -o $@ $< -lelf
|
||||
$(INSTALL) -m 444 $@ $(DIST)/bin
|
||||
|
||||
ifdef MKDEPEND_DIR
|
||||
clean clobber realclean clobber_all::
|
||||
cd $(MKDEPEND_DIR); $(MAKE) $@
|
||||
endif
|
||||
|
||||
# For the continuous build scripts.
|
||||
show_objname:
|
||||
@echo $(OBJDIR)
|
||||
|
||||
.PHONY: show_objname
|
||||
86
mozilla/config/NCR.mk
Normal file
86
mozilla/config/NCR.mk
Normal file
@@ -0,0 +1,86 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for NCR SVR4 MP-RAS
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := ncr
|
||||
CPU_ARCH := x86
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES = -I/usr/X/include
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR = /usr/X/lib
|
||||
MOTIF =
|
||||
MOTIFLIB = -lXm
|
||||
OS_LIBS =
|
||||
|
||||
PLATFORM_FLAGS = -DNCR -D_ATT4 -Di386
|
||||
MOVEMAIL_FLAGS = -DUSG -DHAVE_STRERROR
|
||||
PORT_FLAGS = -DSVR4 -DSYSV -DSW_THREADS -DHAVE_FILIO_H -DHAVE_LCHOWN -DNEED_S_ISLNK -DNEED_S_ISSOCK -DSYS_ENDIAN_H -DSYS_BYTEORDER_H -DUSE_NODL_TABS -DMITSHM -DHAVE_WAITID -DHAVE_NETINET_IN_H -DHAVE_REMAINDER -DHAVE_SYS_BITYPES_H -DPRFSTREAMS_BROKEN
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP =
|
||||
EN_LOCALE = C
|
||||
DE_LOCALE = de_DE.ISO8859-1
|
||||
FR_LOCALE = fr_FR.ISO8859-1
|
||||
JP_LOCALE = ja
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko_KR.EUC
|
||||
CN_LOCALE = zh
|
||||
TW_LOCALE = zh
|
||||
I2_LOCALE = i2
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
EMACS = /bin/true
|
||||
PERL = $(LOCAL_BIN)perl
|
||||
WHOAMI = /usr/ucb/whoami
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
ifdef NS_USE_NATIVE
|
||||
CC = cc
|
||||
CCC = ncc
|
||||
PLATFORM_FLAGS += -Hnocopyr
|
||||
OS_LIBS += -L/opt/ncc/lib
|
||||
else
|
||||
PLATFORM_FLAGS += -Wall
|
||||
OS_LIBS += -lsocket -lnsl -lresolv -ldl
|
||||
endif
|
||||
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
|
||||
DSO_LDOPTS = -G
|
||||
DSO_LDFLAGS = -lXm -lXt -lX11 -lsocket -lnsl -lgen
|
||||
81
mozilla/config/NEC.mk
Normal file
81
mozilla/config/NEC.mk
Normal file
@@ -0,0 +1,81 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for NEC EWS-UX/V
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := nec
|
||||
CPU_ARCH := mips
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES =
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR = /usr/lib/X11
|
||||
MOTIF =
|
||||
MOTIFLIB = -L/usr/lib -lXm
|
||||
OS_LIBS = -lsocket -lnsl -ldl -L/usr/ucblib -lc -lucb
|
||||
|
||||
PLATFORM_FLAGS = -DNEC -Dnec_ews -DNECSVR4 -D__SVR4
|
||||
MOVEMAIL_FLAGS = -DUSG -DHAVE_STRERROR
|
||||
PORT_FLAGS = -DSVR4 -DSW_THREADS -DHAVE_FILIO_H -DHAVE_LCHOWN -DNEED_S_ISLNK -DNEED_CDEFS_H -DNO_LONG_LONG -DSYS_BYTEORDER_H -DMITSHM -DHAVE_NETINET_IN_H -DHAVE_ARPA_NAMESER_H
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/nec.lm
|
||||
EN_LOCALE = C
|
||||
DE_LOCALE = de_DE.ISO8859-1
|
||||
FR_LOCALE = fr_FR.ISO8859-1
|
||||
JP_LOCALE = ja_JP.EUC
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko_KR.EUC
|
||||
CN_LOCALE = zh_CN.ugb
|
||||
TW_LOCALE = zh_TW.ucns
|
||||
I2_LOCALE = i2
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
ifndef NS_USE_GCC
|
||||
CC = $(DEPTH)/build/hcc -Xa -KGnum=0 -KOlimit=4000
|
||||
endif
|
||||
|
||||
BSDECHO = /usr/ucb/echo
|
||||
EMACS = /bin/true
|
||||
PERL = $(LOCAL_BIN)perl
|
||||
WHOAMI = /usr/ucb/whoami
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
|
||||
DSO_LDOPTS = -G
|
||||
DSO_LDFLAGS =
|
||||
78
mozilla/config/NEWS-OS.mk
Normal file
78
mozilla/config/NEWS-OS.mk
Normal file
@@ -0,0 +1,78 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for Sony NEWS-OS
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := sony
|
||||
CPU_ARCH := mips
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES = -I/usr/include
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR = /usr/lib/X11
|
||||
MOTIF =
|
||||
MOTIFLIB = -L/usr/lib -lXm
|
||||
OS_LIBS = -lsocket -lnsl -lgen -lresolv
|
||||
|
||||
PLATFORM_FLAGS = -Xa -fullwarn -DSONY
|
||||
MOVEMAIL_FLAGS = -DHAVE_STRERROR
|
||||
PORT_FLAGS = -DSYSV -DSVR4 -D__svr4 -D__svr4__ -DSW_THREADS -DHAVE_INT32_T -DHAVE_STDDEF_H -DHAVE_STDLIB_H -DHAVE_FILIO_H -DSYS_BYTEORDER_H -DNO_CDEFS_H -DHAVE_LCHOWN -DHAS_PGNO_T -DNO_MULTICAST
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP =
|
||||
EN_LOCALE = C
|
||||
DE_LOCALE = de_DE.ISO8859-1
|
||||
FR_LOCALE = fr_FR.ISO8859-1
|
||||
JP_LOCALE = ja.JP.EUC
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko_KR.EUC
|
||||
CN_LOCALE = zh_CN.ugb
|
||||
TW_LOCALE = zh_TW.ucns
|
||||
I2_LOCALE = i2
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
BSDECHO = /usr/ucb/echo
|
||||
CC = cc
|
||||
CCC = CC
|
||||
EMACS = /bin/true
|
||||
PERL = /bin/true
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
|
||||
DSO_LDOPTS = -G
|
||||
DSO_LDFLAGS =
|
||||
71
mozilla/config/NEXTSTEP.mk
Normal file
71
mozilla/config/NEXTSTEP.mk
Normal file
@@ -0,0 +1,71 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for NEXTSTEP
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := nextstep
|
||||
CPU_ARCH := m68k
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES =
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR =
|
||||
MOTIF =
|
||||
MOTIFLIB =
|
||||
OS_LIBS =
|
||||
|
||||
PLATFORM_FLAGS = -Wall -Wno-format -DNEXTSTEP -DRHAPSODY -D_NEXT_SOURCE
|
||||
MOVEMAIL_FLAGS = -DHAVE_STRERROR
|
||||
PORT_FLAGS = -DSW_THREADS -DNO_CDEFS_H -DNO_REGEX -DNEED_BSDREGEX -DNO_REGCOMP -DHAS_PGNO_T -DNO_MULTICAST -DNO_TZNAME -D_POSIX_SOURCE -DNEED_S_ISLNK -DNEEDS_GETCWD -DNO_X11
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
ifeq ($(OS_RELEASE),3.3)
|
||||
PLATFORM_FLAGS += -DNEXTSTEP3 -DNEXTSTEP33
|
||||
else
|
||||
ifeq ($(OS_RELEASE),4.2)
|
||||
PLATFORM_FLAGS += -DNEXTSTEP4 -DNEXTSTEP42
|
||||
endif
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
CC = cc
|
||||
CCC = c++
|
||||
EMACS = /bin/true
|
||||
PERL = /usr/bin/perl
|
||||
AR = /bin/libtool -static -o $@
|
||||
RANLIB = /bin/true
|
||||
WHOAMI = /usr/ucb/whoami
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
114
mozilla/config/OSF1.mk
Normal file
114
mozilla/config/OSF1.mk
Normal file
@@ -0,0 +1,114 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for DEC OSF/1 (Digital UNIX)
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := dec
|
||||
CPU_ARCH := alpha
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES =
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR = /usr/lib/X11
|
||||
MOTIF =
|
||||
MOTIFLIB =
|
||||
OS_LIBS =
|
||||
|
||||
PLATFORM_FLAGS = -taso -D_ALPHA_ -DIS_64 -DOSF1
|
||||
MOVEMAIL_FLAGS =
|
||||
PORT_FLAGS = -D_REENTRANT -DHAVE_LCHOWN -DNEED_CDEFS_H -DNTOHL_ENDIAN_H -DNEED_IOCTL_H -DMACHINE_ENDIAN_H -DHAVE_VA_LIST_STRUCT -DNEED_BYTE_ALIGNMENT -DMITSHM -DNEED_REALPATH -DHAVE_WAITID -DNEED_H_ERRNO -DNEED_SYS_TIME_H -DHAVE_SYSTEMINFO_H -DNEED_SYS_PARAM_H -DHAVE_INT32_T -DODD_VA_START -DHAVE_REMAINDER
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/osf1.lm
|
||||
EN_LOCALE = en_US.ISO8859-1
|
||||
DE_LOCALE = de_DE.ISO8859-1
|
||||
FR_LOCALE = fr_FR.ISO8859-1
|
||||
JP_LOCALE = ja_JP.eucJP
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko_KR.eucKR
|
||||
CN_LOCALE = zh_CN
|
||||
TW_LOCALE = zh_TW.eucTW
|
||||
I2_LOCALE = i2
|
||||
IT_LOCALE = it
|
||||
SV_LOCALE = sv
|
||||
ES_LOCALE = es
|
||||
NL_LOCALE = nl
|
||||
PT_LOCALE = pt
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
ifeq ($(OS_RELEASE),V2)
|
||||
PORT_FLAGS += -DNEED_TIME_R
|
||||
else
|
||||
OS_LIBS += -lrt -lc_r
|
||||
endif
|
||||
|
||||
ifeq ($(OS_RELEASE),V3)
|
||||
PLATFORM_FLAGS += -DOSF1V3
|
||||
endif
|
||||
ifeq ($(OS_RELEASE),V4)
|
||||
PLATFORM_FLAGS += -DOSF1V4
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
AR = ar rcl $@
|
||||
CC = cc -ieee_with_inexact -std
|
||||
CCC = cxx -ieee_with_inexact -x cxx -cfront
|
||||
SHELL = /usr/bin/ksh
|
||||
WHOAMI = /bin/whoami
|
||||
UNZIP_PROG = $(NS_BIN)unzip
|
||||
ZIP_PROG = $(NS_BIN)zip
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER += -Olimit 4000
|
||||
endif
|
||||
|
||||
ifeq ($(USE_KERNEL_THREADS),1)
|
||||
ifdef NSPR20
|
||||
PLATFORM_FLAGS += -pthread
|
||||
OS_LIBS += -lpthread
|
||||
else
|
||||
PLATFORM_FLAGS += -threads
|
||||
PORT_FLAGS += -DHW_THREADS
|
||||
endif
|
||||
else
|
||||
PORT_FLAGS += -DSW_THREADS
|
||||
endif
|
||||
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
|
||||
DSO_LDOPTS = -shared -all -expect_unresolved "*"
|
||||
DSO_LDFLAGS = -lXm -lXt -lX11 -lc
|
||||
83
mozilla/config/Rhapsody.mk
Normal file
83
mozilla/config/Rhapsody.mk
Normal file
@@ -0,0 +1,83 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for Rhapsody
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := rhapsody
|
||||
CPU_ARCH := ppc
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES =
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR =
|
||||
MOTIF =
|
||||
MOTIFLIB =
|
||||
OS_LIBS =
|
||||
|
||||
PLATFORM_FLAGS = -DRHAPSODY -Wall -pipe
|
||||
MOVEMAIL_FLAGS = -DHAVE_STRERROR
|
||||
PORT_FLAGS = -DSW_THREADS -DHAVE_STDDEF_H -DHAVE_STDLIB_H -DHAVE_FILIO_H -DNTOHL_ENDIAN_H -DMACHINE_ENDIAN_H -DNO_REGEX -DNO_REGCOMP -DHAS_PGNO_T -DNO_TZNAME -DNO_X11 -DNEEDS_GETCWD
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
# "Commons" are tentative definitions in a global scope, like this:
|
||||
# int x;
|
||||
# The meaning of a common is ambiguous. It may be a true definition:
|
||||
# int x = 0;
|
||||
# or it may be a declaration of a symbol defined in another file:
|
||||
# extern int x;
|
||||
# Use the -fno-common option to force all commons to become true
|
||||
# definitions so that the linker can catch multiply-defined symbols.
|
||||
# Also, common symbols are not allowed with Rhapsody dynamic libraries.
|
||||
DSO_FLAGS = -fno-common
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(DSO_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
ifeq ($(OS_RELEASE),5.0)
|
||||
CCC = cc++
|
||||
else
|
||||
CCC = c++
|
||||
endif
|
||||
|
||||
CC = cc
|
||||
AR = libtool -static -o $@
|
||||
|
||||
EMACS = /usr/bin/true
|
||||
PERL = /usr/bin/true
|
||||
RANLIB = /usr/bin/true
|
||||
|
||||
# Comment out MKSHLIB to build only static libraries.
|
||||
MKSHLIB = $(CC) -arch ppc -dynamiclib -compatibility_version 1 -current_version 1 -all_load
|
||||
DLL_SUFFIX = dylib
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
94
mozilla/config/SCOOS.mk
Normal file
94
mozilla/config/SCOOS.mk
Normal file
@@ -0,0 +1,94 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for SCO OpenServer
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := sco_os
|
||||
CPU_ARCH := x86
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES = -I/usr/include/X11
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR = /usr/lib/X11
|
||||
MOTIF =
|
||||
MOTIFLIB = -lXm
|
||||
OS_LIBS = -lpmapi -lsocket
|
||||
|
||||
PLATFORM_FLAGS = -DSCO -Dsco -DSCO_SV -Di386
|
||||
MOVEMAIL_FLAGS = -DUSG -DHAVE_STRERROR
|
||||
PORT_FLAGS = -DSYSV -DSW_THREADS -DNO_SIGNED -DNEED_SOCKET_H -DNEED_S_ISLNK -DNO_LONG_LONG -DNEED_S_ISSOCK -DNEED_MATH_H -DSYS_BYTEORDER_H -DHAVE_BITYPES_H -DUSE_NODL_TABS -DMOTIF_WARNINGS_UPSET_JAVA -DMITSHM -DNO_ID_T -DHAVE_WAITID -DHAVE_SYS_NETINET_IN_H -DHAVE_REMAINDER -DNEED_SYS_SELECT_H -DHAVE_SYS_BITYPES_H -DNEED_H_ERRNO
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/sco.lm
|
||||
EN_LOCALE = C
|
||||
DE_LOCALE = de_DE.ISO8859-1
|
||||
FR_LOCALE = fr_FR.ISO8859-1
|
||||
JP_LOCALE = ja
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko_KR.EUC
|
||||
CN_LOCALE = zh
|
||||
TW_LOCALE = zh
|
||||
I2_LOCALE = i2
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
BSDECHO = /bin/echo
|
||||
CC = cc -b elf -K pic
|
||||
CCC = $(DEPTH)/build/hcpp +.cpp +d
|
||||
EMACS = /bin/true
|
||||
WHOAMI = $(LOCAL_BIN)whoami
|
||||
UNZIP_PROG = $(CONTRIB_BIN)unzip
|
||||
ZIP_PROG = $(CONTRIB_BIN)zip
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
#
|
||||
# -DSCO_PM - Policy Manager AKA: SCO Licensing
|
||||
# Only (supposedly) needed for the RTM builds.
|
||||
#
|
||||
ifdef NEED_SCO_PM
|
||||
PLATFORM_FLAGS += -DSCO_PM
|
||||
endif
|
||||
|
||||
ifeq ($(USE_PTHREADS),1)
|
||||
#PORT_FLAGS += -D_PR_NEED_FAKE_POLL
|
||||
else
|
||||
PORT_FLAGS += -D_PR_LOCAL_THREADS_ONLY
|
||||
endif
|
||||
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
|
||||
DSO_LDOPTS = -G -b elf -d y
|
||||
DSO_LDFLAGS =
|
||||
104
mozilla/config/SINIX.mk
Normal file
104
mozilla/config/SINIX.mk
Normal file
@@ -0,0 +1,104 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for SNI SINIX-N (aka ReliantUNIX)
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := sinix
|
||||
CPU_ARCH := mips
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES = -I/usr/local/include
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR = /usr/lib/locale
|
||||
MOTIF =
|
||||
MOTIFLIB = -lXm
|
||||
OS_LIBS = -lsocket -lnsl -lgen -lm -ldl -lresolv -lc -L/usr/ucblib -lucb
|
||||
|
||||
PLATFORM_FLAGS = -DSNI -Dsinix
|
||||
MOVEMAIL_FLAGS = -DUSG
|
||||
PORT_FLAGS = -DSVR4 -DHAVE_FILIO_H -DNEED_S_ISSOCK -DNEED_TIMEVAL -DNEED_SELECT_H -DHAVE_LCHOWN -DNEED_S_ISLNK -DNEED_FCHMOD_PROTO -DNO_CDEFS_H -DSYS_BYTEORDER_H -DUSE_NODL_TABS -DMITSHM -DNO_MULTICAST -DHAVE_NETINET_IN_H -DHAVE_INT32_T
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/sinix.lm
|
||||
EN_LOCALE = en_US.88591
|
||||
DE_LOCALE = de_DE.88591
|
||||
FR_LOCALE = fr_FR.88591
|
||||
JP_LOCALE = ja_JP.EUC
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko_KR.euc
|
||||
CN_LOCALE = zh_CN.ugb
|
||||
TW_LOCALE = zh_TW.ucns
|
||||
I2_LOCALE = i2
|
||||
IT_LOCALE = it_IT.88591
|
||||
SV_LOCALE = sv_SV.88591
|
||||
ES_LOCALE = es_ES.88591
|
||||
NL_LOCALE = nl_NL.88591
|
||||
PT_LOCALE = pt_PT.88591
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
BSDECHO = /usr/ucb/echo
|
||||
EMACS = /bin/true
|
||||
WHOAMI = /usr/ucb/whoami
|
||||
PERL = $(LOCAL_BIN)perl
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
ifdef NS_USE_NATIVE
|
||||
CC = cc
|
||||
CCC = CC
|
||||
PLATFORM_FLAGS += -fullwarn -xansi
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER = -Olimit 4000
|
||||
endif
|
||||
else
|
||||
PLATFORM_FLAGS += -pipe -Wall -Wno-format
|
||||
ASFLAGS += -x assembler-with-cpp
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER = -O
|
||||
else
|
||||
OPTIMIZER = -gdwarf
|
||||
JAVA_OPTIMIZER = -gdwarf
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_KERNEL_THREADS),1)
|
||||
PORT_FLAGS += -DSW_THREADS
|
||||
endif
|
||||
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
|
||||
DSO_LDOPTS = -G
|
||||
DSO_LDFLAGS = $(MOTIFLIB) -lXt -lX11 $(OS_LIBS)
|
||||
25
mozilla/config/SunOS.mk
Normal file
25
mozilla/config/SunOS.mk
Normal file
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# Config stuff for SunOS. 4 and 5 are vastly different, so we use 2 different files.
|
||||
#
|
||||
ifeq ($(OS_RELEASE),4.1)
|
||||
include $(DEPTH)/config/SunOS4.mk
|
||||
else
|
||||
include $(DEPTH)/config/SunOS5.mk
|
||||
endif
|
||||
91
mozilla/config/SunOS4.mk
Normal file
91
mozilla/config/SunOS4.mk
Normal file
@@ -0,0 +1,91 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for SunOS4.1.x
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := sunos
|
||||
CPU_ARCH := sparc
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES = -I/usr/X11R5/include -I$(MOTIF)/include
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR = /usr/openwin/lib/locale
|
||||
MOTIF = /home/motif/usr
|
||||
MOTIFLIB = -L$(MOTIF)/lib -lXm
|
||||
OS_LIBS = -ldl -lm
|
||||
|
||||
PLATFORM_FLAGS = -Wall -Wno-format -DSUNOS4
|
||||
MOVEMAIL_FLAGS =
|
||||
PORT_FLAGS = -DSW_THREADS -DNEED_SYSCALL -DSTRINGS_ALIGNED -DNO_REGEX -DNO_ISDIR -DUSE_RE_COMP -DNO_REGCOMP -DUSE_GETWD -DNO_MEMMOVE -DNO_ALLOCA -DBOGUS_MB_MAX -DNO_CONST -DHAVE_ODD_SEND -DHAVE_ODD_IOCTL -DHAVE_FILIO_H -DMITSHM -DNEED_SYS_WAIT_H -DNO_TZNAME -DNEED_SYS_TIME_H -DNO_MULTICAST -DHAVE_INT32_T -DNEED_UINT_T -DUSE_ODD_SSCANF -DUSE_ODD_SPRINTF -DNO_IOSTREAM_H
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/sunos.lm
|
||||
EN_LOCALE = en_US
|
||||
DE_LOCALE = de
|
||||
FR_LOCALE = fr
|
||||
JP_LOCALE = ja
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko
|
||||
CN_LOCALE = zh
|
||||
TW_LOCALE = zh_TW
|
||||
I2_LOCALE = i2
|
||||
IT_LOCALE = it
|
||||
SV_LOCALE = sv
|
||||
ES_LOCALE = es
|
||||
NL_LOCALE = nl
|
||||
PT_LOCALE = pt
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
DLL_SUFFIX = so.1.0
|
||||
PERL = $(LOCAL_SUN4)perl
|
||||
RANLIB = /bin/ranlib
|
||||
TAR = /usr/bin/tar
|
||||
WHOAMI = /usr/ucb/whoami
|
||||
UNZIP_PROG = $(NS_BIN)unzip
|
||||
ZIP_PROG = $(NS_BIN)zip
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
ifndef NO_MDUPDATE
|
||||
MDUPDATE_FLAGS = -MDupdate $(DEPENDENCIES)
|
||||
endif
|
||||
|
||||
HAVE_PURIFY = 1
|
||||
MUST_BOOTLEG_ALLOCA = 1
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
|
||||
MKSHLIB = $(LD) -L$(MOTIF)/lib
|
||||
|
||||
DSO_LDOPTS =
|
||||
DSO_LDFLAGS =
|
||||
177
mozilla/config/SunOS5.mk
Normal file
177
mozilla/config/SunOS5.mk
Normal file
@@ -0,0 +1,177 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for SunOS 5.x for SPARC and x86
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := solaris
|
||||
ifeq ($(OS_TEST),i86pc)
|
||||
CPU_ARCH := x86
|
||||
else
|
||||
CPU_ARCH := sparc
|
||||
endif
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES = -I$(MOTIF)/include -I/usr/openwin/include
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR = /usr/openwin/lib/locale
|
||||
MOTIF = /usr/dt
|
||||
MOTIFLIB = -lXm
|
||||
OS_LIBS =
|
||||
|
||||
PLATFORM_FLAGS = $(DSO_CFLAGS) -DSOLARIS -D__svr4 -D__svr4__
|
||||
MOVEMAIL_FLAGS = -DUSG
|
||||
PORT_FLAGS = -DSVR4 -DSYSV -DHAVE_WEAK_IO_SYMBOLS -DHAVE_FILIO_H -DHAVE_LCHOWN -DNEED_CDEFS_H -DMITSHM -DHAVE_WAITID -DHAVE_FORK1 -DHAVE_REMAINDER -DHAVE_SYSTEMINFO_H -DHAVE_INT32_T -DNO_JNI_STUBS
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/sunos.lm
|
||||
EN_LOCALE = en_US
|
||||
DE_LOCALE = de
|
||||
FR_LOCALE = fr
|
||||
JP_LOCALE = ja
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko
|
||||
CN_LOCALE = zh
|
||||
TW_LOCALE = zh_TW
|
||||
I2_LOCALE = i2
|
||||
IT_LOCALE = it
|
||||
SV_LOCALE = sv
|
||||
ES_LOCALE = es
|
||||
NL_LOCALE = nl
|
||||
PT_LOCALE = pt
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
ifeq ($(CPU_ARCH),x86)
|
||||
EMACS = /bin/true
|
||||
PLATFORM_FLAGS += -Di386
|
||||
PORT_FLAGS += -DNEED_INET_TCP_H
|
||||
else
|
||||
PLATFORM_FLAGS += -D$(CPU_ARCH)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_VERSION),.3)
|
||||
MOTIF = /usr/local/Motif/opt/ICS/Motif/usr
|
||||
MOTIFLIB = $(MOTIF)/lib/libXm.a
|
||||
EMACS = /bin/true
|
||||
endif
|
||||
ifeq ($(OS_VERSION),.4)
|
||||
PLATFORM_FLAGS += -DSOLARIS_24
|
||||
endif
|
||||
ifeq ($(OS_VERSION),.5)
|
||||
PLATFORM_FLAGS += -DSOLARIS2_5 -DSOLARIS_55_OR_GREATER
|
||||
PORT_FLAGS += -D_SVID_GETTOD
|
||||
endif
|
||||
ifeq ($(OS_RELEASE)$(OS_VERSION),5.5.1)
|
||||
PLATFORM_FLAGS += -DSOLARIS2_5 -DSOLARIS_55_OR_GREATER
|
||||
PORT_FLAGS += -D_SVID_GETTOD
|
||||
endif
|
||||
ifeq ($(OS_VERSION),.6)
|
||||
PLATFORM_FLAGS += -DSOLARIS2_6 -DSOLARIS_55_OR_GREATER -DSOLARIS_56_OR_GREATER
|
||||
PORT_FLAGS += -D_SVID_GETTOD
|
||||
else
|
||||
PORT_FLAGS += -DNEED_INET_TCP_H
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
BSDECHO = /usr/ucb/echo
|
||||
WHOAMI = /usr/ucb/whoami
|
||||
PROCESSOR_ARCHITECTURE = _$(CPU_ARCH)
|
||||
UNZIP_PROG = $(NS_BIN)unzip
|
||||
ZIP_PROG = $(NS_BIN)zip
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
ifdef NS_USE_NATIVE
|
||||
CC = cc
|
||||
CCC = CC
|
||||
NO_MDUPDATE = 1
|
||||
PORT_FLAGS += -DNS_USE_NATIVE
|
||||
ASFLAGS += -Wa,-P
|
||||
ifdef SERVER_BUILD
|
||||
ifndef BUILD_OPT
|
||||
PLATFORM_FLAGS += -xs
|
||||
endif
|
||||
endif
|
||||
# -z gets around _sbrk multiple define.
|
||||
OS_GPROF_FLAGS = -xpg -z muldefs
|
||||
DSO_CFLAGS = -KPIC
|
||||
else
|
||||
PLATFORM_FLAGS += -Wall -Wno-format
|
||||
ifneq ($(CPU_ARCH),x86)
|
||||
ASFLAGS += -x assembler-with-cpp
|
||||
endif
|
||||
OS_GPROF_FLAGS = -pg
|
||||
DSO_CFLAGS = -fPIC
|
||||
endif
|
||||
|
||||
ifndef NO_MDUPDATE
|
||||
MDUPDATE_FLAGS = -MDupdate $(DEPENDENCIES)
|
||||
endif
|
||||
|
||||
ifeq ($(FORCE_SW_THREADS),1)
|
||||
USE_KERNEL_THREADS = 0
|
||||
endif
|
||||
|
||||
ifeq ($(USE_KERNEL_THREADS),1)
|
||||
ifdef NSPR20
|
||||
PORT_FLAGS += -D_PR_NTHREAD -D_REENTRANT
|
||||
else
|
||||
PORT_FLAGS += -DHW_THREADS -D_REENTRANT
|
||||
endif
|
||||
OS_LIBS = -lthread -lposix4
|
||||
else
|
||||
ifdef NSPR20
|
||||
OS_LIBS = -lposix4
|
||||
else
|
||||
PORT_FLAGS += -DSW_THREADS
|
||||
endif
|
||||
endif
|
||||
OS_LIBS += -lsocket -lnsl -ldl
|
||||
|
||||
ifndef NS_USE_NATIVE
|
||||
OS_LIBS += -L$(NS_LIB)
|
||||
endif
|
||||
|
||||
#
|
||||
# An nm command which generates an output like:
|
||||
# archive.a:object.o: 0000003 T symbol
|
||||
#
|
||||
NM_PO = nm -Ap
|
||||
|
||||
HAVE_PURIFY = 1
|
||||
MUST_BOOTLEG_ALLOCA = 1
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
|
||||
DSO_LDOPTS = -G -L$(MOTIF)/lib -L/usr/openwin/lib
|
||||
DSO_LDFLAGS =
|
||||
83
mozilla/config/UNIXWARE.mk
Normal file
83
mozilla/config/UNIXWARE.mk
Normal file
@@ -0,0 +1,83 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Config stuff for SCO UnixWare
|
||||
######################################################################
|
||||
#
|
||||
######################################################################
|
||||
# Version-independent
|
||||
######################################################################
|
||||
|
||||
ARCH := sco_uw
|
||||
CPU_ARCH := x86
|
||||
GFX_ARCH := x
|
||||
|
||||
OS_INCLUDES = -I/usr/X/include
|
||||
G++INCLUDES =
|
||||
LOC_LIB_DIR = /usr/lib/X11
|
||||
MOTIF =
|
||||
MOTIFLIB = -lXm
|
||||
OS_LIBS = -lsocket -lc /usr/ucblib/libucb.a
|
||||
|
||||
PLATFORM_FLAGS = -DUNIXWARE -Di386
|
||||
MOVEMAIL_FLAGS = -DUSG -DHAVE_STRERROR
|
||||
PORT_FLAGS = -DSVR4 -DSYSV -DSW_THREADS -DHAVE_FILIO_H -DHAVE_ODD_ACCEPT -DNEED_S_ISLNK -DLAME_READDIR -DNO_CDEFS_H -DNO_LONG_LONG -DNEED_S_ISSOCK -DSYS_BYTEORDER_H -DUSE_NODL_TABS -DMOTIF_WARNINGS_UPSET_JAVA -DMITSHM -DNEED_SYS_TIME_H -DNO_MULTICAST -DHAVE_NETINET_IN_H -DHAVE_REMAINDER -DHAVE_INT32_T
|
||||
PDJAVA_FLAGS =
|
||||
|
||||
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
|
||||
|
||||
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/unixware.lm
|
||||
EN_LOCALE = C
|
||||
DE_LOCALE = de_DE.ISO8859-1
|
||||
FR_LOCALE = fr_FR.ISO8859-1
|
||||
JP_LOCALE = ja
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko_KR.EUC
|
||||
CN_LOCALE = zh
|
||||
TW_LOCALE = zh
|
||||
I2_LOCALE = i2
|
||||
|
||||
######################################################################
|
||||
# Version-specific stuff
|
||||
######################################################################
|
||||
|
||||
ifeq ($(OS_RELEASE),5)
|
||||
PLATFORM_FLAGS += -DUnixWare -DUNIXWARE5
|
||||
PORT_FLAGS += -DSVR5 -D_SIMPLE_R
|
||||
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
DSO_LDOPTS = -G
|
||||
DSO_LDFLAGS = -nostdlib -L/lib -L/usr/lib -L/usr/X/lib -lXm -lXt -lX11 -lgen
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
# Overrides for defaults in config.mk (or wherever)
|
||||
######################################################################
|
||||
|
||||
CC = $(DEPTH)/build/hcc
|
||||
CCC = $(DEPTH)/build/hcpp
|
||||
EMACS = /bin/true
|
||||
WHOAMI = /usr/ucb/whoami
|
||||
PERL = $(LOCAL_BIN)perl
|
||||
|
||||
######################################################################
|
||||
# Other
|
||||
######################################################################
|
||||
|
||||
BIN
mozilla/config/W95MAKE.EXE
Executable file
BIN
mozilla/config/W95MAKE.EXE
Executable file
Binary file not shown.
BIN
mozilla/config/W95MKDIR.EXE
Executable file
BIN
mozilla/config/W95MKDIR.EXE
Executable file
Binary file not shown.
79
mozilla/config/W95make.c
Normal file
79
mozilla/config/W95make.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <process.h>
|
||||
|
||||
/*
|
||||
* A feeble attempt at recursive make on win95 - spider 1/98
|
||||
*
|
||||
* argv[1] == target
|
||||
* argv[2] == end directory (full)
|
||||
* argv[3...n] == list of source directories
|
||||
*
|
||||
*/
|
||||
|
||||
void main(int argc, char **argv)
|
||||
{
|
||||
char *args[6];
|
||||
int n = 0 ;
|
||||
int rc = 0 ;
|
||||
|
||||
/* Set up parameters to be sent: Sorry for the hardcode!*/
|
||||
args[0] = "-nologo";
|
||||
args[1] = "-nologo";
|
||||
args[2] = "-S";
|
||||
args[3] = "-f";
|
||||
args[4] = "makefile.win";
|
||||
args[5] = argv[1] ;
|
||||
args[6] = NULL ;
|
||||
|
||||
if (argc < 3) {
|
||||
fprintf(stderr, "w95make: Not enough arguments, you figure it out\n");
|
||||
exit (666) ;
|
||||
}
|
||||
|
||||
|
||||
while(argv[n+3] != NULL) {
|
||||
|
||||
if (_chdir(argv[n+3]) != 0) {
|
||||
fprintf(stderr, "w95make: Could not change to directory %s ... skipping\n", argv[n+3]);
|
||||
} else {
|
||||
|
||||
fprintf(stdout, "w95make: Entering Directory %s\\%s with target %s\n", argv[2], argv[n+3], argv[1]);
|
||||
if ((rc = _spawnvp(_P_WAIT,"nmake", args)) != 0) {
|
||||
fprintf(stderr, "w95make: nmake failed in directory %s with error code %d\n", argv[n+3], rc);
|
||||
exit(rc);
|
||||
}
|
||||
|
||||
if (_chdir(argv[2]) != 0) {
|
||||
fprintf(stderr, "w95make: Could not change back to directory %s\n", argv[2]);
|
||||
exit (666) ;
|
||||
}
|
||||
|
||||
fprintf(stdout, "w95make: Leaving Directory %s\\%s with target %s\n", argv[2], argv[n+3], argv[1]);
|
||||
|
||||
}
|
||||
|
||||
n++;
|
||||
}
|
||||
|
||||
|
||||
exit(0);
|
||||
}
|
||||
38
mozilla/config/W95mkdir.c
Normal file
38
mozilla/config/W95mkdir.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <process.h>
|
||||
|
||||
/*
|
||||
* win95 mkdir that responds nicely if the directory already exists - spider 1/98
|
||||
*
|
||||
*/
|
||||
|
||||
void main(int argc, char **argv)
|
||||
{
|
||||
if (argc < 1) {
|
||||
fprintf(stderr, "w95mkdir: Not enough arguments, you figure it out\n");
|
||||
exit (666) ;
|
||||
}
|
||||
|
||||
|
||||
_mkdir(argv[1]);
|
||||
|
||||
}
|
||||
113
mozilla/config/WIN16
Normal file
113
mozilla/config/WIN16
Normal file
@@ -0,0 +1,113 @@
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Win16 Configuration file
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define the OS dependent commands used by MAKE
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
CC=cl
|
||||
LD=$(MOZ_TOOLS)\bin\optlinks.exe
|
||||
AR=$(DEPTH)\CONFIG\TLIB.EXE /P64 /C
|
||||
#AR=lib /NOLOGO /BATCH /NOIGNORECASE
|
||||
RC=rc
|
||||
#RM=del /F /Q
|
||||
#RM_R=del /F /S /Q
|
||||
RM=rm -f
|
||||
RM_R=rm -fr
|
||||
CP=cp
|
||||
AWK=$(MOZ_TOOLS)\bin\gawk.exe
|
||||
RANLIB=$(DEPTH)\config\true.bat
|
||||
!ifndef MOZ_DEBUG
|
||||
JAVAH_PROG=$(DEPTH)\dist\$(DIST_PREFIX)32_o.obj\bin\javah.exe
|
||||
!else
|
||||
JAVAH_PROG=$(DEPTH)\dist\$(DIST_PREFIX)32_d.obj\bin\javah.exe
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define Debug and optimization flags
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!ifndef MOZ_DEBUG
|
||||
!ifndef OPTIMIZER
|
||||
OPTIMIZER=-Ox -Os -DDEVELOPER_DEBUG
|
||||
!endif
|
||||
OS_LFLAGS=
|
||||
!else
|
||||
!if defined(MOZ_FULL_DEBUG_INFO) || ("$(MAKE_OBJ_TYPE)" == "DLL")
|
||||
OPTIMIZER=-Z7
|
||||
!else if defined(MOZ_DEBUG_FLAG)
|
||||
OPTIMIZER=$(MOZ_DEBUG_FLAG)
|
||||
!else
|
||||
OPTIMIZER=-Zd
|
||||
!endif
|
||||
OPTIMIZER=$(OPTIMIZER) -Od -DDEBUG -UNDEBUG
|
||||
OS_LFLAGS=/CO
|
||||
!endif
|
||||
!if defined (MOZ_LITE)
|
||||
OPTIMIZER=$(OPTIMIZER) -DMOZ_LITE
|
||||
!endif
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the OS dependent compiler flags, linker flags and libraries
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!ifdef 286_INSTRUCTIONS
|
||||
INSTRUCTIONS=-G2
|
||||
!else
|
||||
INSTRUCTIONS=-G3
|
||||
!endif
|
||||
OS_CFLAGS=$(INSTRUCTIONS) -AL -Gx- -Gf -Gd -Gs -W3 -nologo \
|
||||
!ifdef MOZ_JAVA
|
||||
-DSEG_ARRAY \
|
||||
!endif
|
||||
-D_X86_ -D_WINDOWS -DXP_PC -DSW_THREADS
|
||||
|
||||
|
||||
OS_LFLAGS=$(OS_LFLAGS) /NOE /NOD /NOI /XNOI \
|
||||
/ALIGN:16 /BYORDINAL /FARCALL \
|
||||
/PACKC:61440 /PACKD /REORDERSEGMENTS \
|
||||
/DETAILEDMAP /XREF /ONERROR:NOEXE /NOLOGO /WARNDUPS
|
||||
|
||||
OS_LIBS=LIBW.LIB TOOLHELP.LIB
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the special flags for creating EXEs
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
EXE_CFLAGS=/GA /Gt3
|
||||
EXE_LFLAGS=/STACK:20000
|
||||
EXE_LIBS=OLDNAMES.LIB LLIBCEW.LIB
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the special flags for creating DLLs
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!ifndef DLL_CFLAGS
|
||||
DLL_CFLAGS=/GD /D "_WINDLL"
|
||||
!endif
|
||||
DLL_LFLAGS=
|
||||
DLL_LIBS=OLDNAMES.LIB LDLLCEW.LIB
|
||||
|
||||
141
mozilla/config/WIN32
Normal file
141
mozilla/config/WIN32
Normal file
@@ -0,0 +1,141 @@
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Win32 Configuration file
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define the OS dependent commands used by MAKE
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
CC=cl
|
||||
LD=link
|
||||
AR=lib
|
||||
RC=rc
|
||||
#RM=del /F /Q
|
||||
#RM_R=del /F /S /Q
|
||||
RM=rm -f
|
||||
RM_R=rm -fr
|
||||
CP=cp
|
||||
AWK=$(MOZ_TOOLS)\bin\gawk.exe
|
||||
RANLIB=$(DEPTH)\config\true.bat
|
||||
JAVAH=$(DIST)\bin\javah.exe
|
||||
JAVA=$(MOZ_TOOLS)\bin\java.exe
|
||||
|
||||
!ifndef JAVAH_IN_JAVA
|
||||
JAVAH_PROG = $(DIST)\bin\javah.exe
|
||||
!else
|
||||
JAVAH_PROG = $(JAVA) netscape.tools.jric.Main
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define Debug and optimization flags
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!ifdef MOZ_PROF
|
||||
|
||||
#
|
||||
# compile with debug symbols, but without DEBUG code and ASSERTs
|
||||
#
|
||||
OPTIMIZER=-Z7 -UDEBUG -DNDEBUG -U_DEBUG
|
||||
OS_LFLAGS=/DEBUG /DEBUGTYPE:CV /PDB:NONE
|
||||
|
||||
!else
|
||||
!ifdef MOZ_DEBUG
|
||||
#
|
||||
# Uncomment for MSVC debug malloc logging...
|
||||
#
|
||||
#OPTIMIZER=-Z7 -DDEBUG -UNDEBUG -D_DEBUG -D_CRTDBG_MAP_ALLOC
|
||||
OPTIMIZER=-Z7 -DDEBUG -UNDEBUG -D_DEBUG
|
||||
OS_LFLAGS=/DEBUG /DEBUGTYPE:CV /PDB:NONE
|
||||
|
||||
!else
|
||||
#
|
||||
# optimize it
|
||||
#
|
||||
OPTIMIZER=-O1 -UDEBUG -DNDEBUG
|
||||
OS_LFLAGS=
|
||||
|
||||
!endif
|
||||
!endif
|
||||
|
||||
!ifndef MODULAR_NETLIB
|
||||
OPTIMIZER=$(OPTIMIZER) -DCookieManagement -DSingleSignon
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Select the correct RTL to link...
|
||||
#//
|
||||
#// Currently, unless USE_STATIC_LIBS is defined, the multithreaded
|
||||
#// DLL version of the RTL is used...
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!ifdef USE_STATIC_LIBS
|
||||
RTL_FLAGS=-MT # Statically linked multithreaded RTL
|
||||
!ifdef MOZ_DEBUG
|
||||
RTL_FLAGS=-MTd # Statically linked multithreaded MSVC4.0 debug RTL
|
||||
!endif
|
||||
|
||||
!else
|
||||
RTL_FLAGS=-MD # Dynamically linked, multithreaded RTL
|
||||
|
||||
!ifdef MOZ_DEBUG
|
||||
RTL_FLAGS=-MDd # Dynamically linked, multithreaded MSVC4.0 debug RTL
|
||||
!endif
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the OS dependent compiler flags, linker flags and libraries
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
OS_CFLAGS=$(OPTIMIZER) $(RTL_FLAGS) -W3 -nologo -D_X86_ -D_WINDOWS -DWIN32 \
|
||||
-DXP_PC -DHW_THREADS
|
||||
|
||||
OS_CFLAGS=$(OS_CFLAGS) -DMSVC4
|
||||
|
||||
## Removed MOZ_LITE/MOZ_MEDIUM stuff from OS_CFLAGS
|
||||
|
||||
OS_LFLAGS=$(OS_LFLAGS)
|
||||
OS_LIBS=kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the special flags for creating EXEs
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!ifdef SWAPTUNER
|
||||
EXE_CFLAGS=/Gh
|
||||
!else
|
||||
EXE_CFLAGS=/Gy
|
||||
!endif
|
||||
EXE_LFLAGS=
|
||||
EXE_LIBS=
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the special flags for creating DLLs
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DLL_CFLAGS=
|
||||
DLL_LFLAGS=/SUBSYSTEM:WINDOWS
|
||||
DLL_LIBS=
|
||||
114
mozilla/config/bin2rc.c
Normal file
114
mozilla/config/bin2rc.c
Normal file
@@ -0,0 +1,114 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <sys\stat.h>
|
||||
|
||||
int main(int iArgc, char **ppArgv) {
|
||||
int iRetval = 1;
|
||||
|
||||
/* First argument, the filename to convert.
|
||||
* Output to stdout, redirect to save.
|
||||
*/
|
||||
char *pFileName = ppArgv[1];
|
||||
if(pFileName) {
|
||||
FILE *pFile = fopen(pFileName, "rb");
|
||||
if(pFile) {
|
||||
struct stat sInfo;
|
||||
|
||||
/* Stat the file for size.
|
||||
*/
|
||||
if(!fstat(fileno(pFile), &sInfo)) {
|
||||
int iChar;
|
||||
int iX = 0;
|
||||
int iFirsttime = 1;
|
||||
|
||||
/* Begin RCDATA
|
||||
*/
|
||||
printf("BEGIN\n");
|
||||
|
||||
/* First string identifies created via bin2rc.
|
||||
* Users of the RCDATA must check for this to
|
||||
* assume the format of the remainder of
|
||||
* the data.
|
||||
*/
|
||||
printf("\t\"bin2rc generated resource\\0\",\t// bin2rc identity string\n");
|
||||
|
||||
/* Next string is optional parameter on command
|
||||
* line. If not present, an empty string.
|
||||
* Users of the RCDATA must understand this is
|
||||
* the optional string that can be used for
|
||||
* about any purpose they desire.
|
||||
*/
|
||||
printf("\t\"%s\\0\",\t// optional command line string\n", ppArgv[2] ? ppArgv[2] : "");
|
||||
|
||||
/* Next string is the size of the original file.
|
||||
* Users of the RCDATA must understand that this
|
||||
* is the size of the file's actual contents.
|
||||
*/
|
||||
printf("\t\"%ld\\0\"\t// data size header\n", sInfo.st_size);
|
||||
|
||||
while(EOF != (iChar = fgetc(pFile))) {
|
||||
/* Comma?
|
||||
*/
|
||||
if(0 == iFirsttime) {
|
||||
iX += printf(",");
|
||||
}
|
||||
else {
|
||||
iFirsttime = 0;
|
||||
}
|
||||
|
||||
/* Newline?
|
||||
*/
|
||||
if(iX >= 72) {
|
||||
printf("\n");
|
||||
iX = 0;
|
||||
}
|
||||
|
||||
/* Tab?
|
||||
*/
|
||||
if(0 == iX) {
|
||||
printf("\t");
|
||||
iX += 8;
|
||||
}
|
||||
|
||||
/* Octal byte.
|
||||
*/
|
||||
iX += printf("\"\\%.3o\"", iChar);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* End RCDATA
|
||||
*/
|
||||
if(0 != iX) {
|
||||
printf("\n");
|
||||
}
|
||||
printf("END\n");
|
||||
|
||||
/* All is well.
|
||||
*/
|
||||
iRetval = 0;
|
||||
}
|
||||
fclose(pFile);
|
||||
pFile = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return(iRetval);
|
||||
}
|
||||
|
||||
BIN
mozilla/config/bin2rc.exe
Executable file
BIN
mozilla/config/bin2rc.exe
Executable file
Binary file not shown.
77
mozilla/config/bsdecho.c
Normal file
77
mozilla/config/bsdecho.c
Normal file
@@ -0,0 +1,77 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
** This is a feeble attempt at creating a BSD-style echo command
|
||||
** for use on platforms that have only a Sys-V echo. This version
|
||||
** supports the '-n' flag, and will not interpret '\c', etc. As
|
||||
** of this writing this is only needed on HP-UX and AIX 4.1.
|
||||
** --briano.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#if !defined(XP_OS2)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef SUNOS4
|
||||
#include "sunos4.h"
|
||||
#endif
|
||||
|
||||
void main(int argc, char **argv)
|
||||
{
|
||||
short numargs = argc;
|
||||
short newline = 1;
|
||||
|
||||
if (numargs == 1)
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (strcmp(*++argv, "-n") == 0)
|
||||
{
|
||||
if (numargs == 2)
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
newline = 0;
|
||||
numargs--;
|
||||
argv++;
|
||||
}
|
||||
}
|
||||
|
||||
while (numargs > 1)
|
||||
{
|
||||
fprintf(stdout, "%s", *argv++);
|
||||
numargs--;
|
||||
if (numargs > 1)
|
||||
{
|
||||
fprintf(stdout, " ");
|
||||
}
|
||||
}
|
||||
|
||||
if (newline == 1)
|
||||
{
|
||||
fprintf(stdout, "\n");
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
41
mozilla/config/buildpkg.bat
Normal file
41
mozilla/config/buildpkg.bat
Normal file
@@ -0,0 +1,41 @@
|
||||
@echo off
|
||||
rem The contents of this file are subject to the Netscape Public License
|
||||
rem Version 1.0 (the "NPL"); you may not use this file except in
|
||||
rem compliance with the NPL. You may obtain a copy of the NPL at
|
||||
rem http://www.mozilla.org/NPL/
|
||||
rem
|
||||
rem Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
rem WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
rem for the specific language governing rights and limitations under the
|
||||
rem NPL.
|
||||
rem
|
||||
rem The Initial Developer of this code under the NPL is Netscape
|
||||
rem Communications Corporation. Portions created by Netscape are
|
||||
rem Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
rem Reserved.
|
||||
@echo on
|
||||
|
||||
@echo off
|
||||
if not exist %2 echo Warning: %2 does not exist! (you may need to check it out)
|
||||
if not exist %2 exit 1
|
||||
|
||||
pushd %2
|
||||
|
||||
goto NO_CAFE
|
||||
|
||||
if "%MOZ_CAFE%"=="" goto NO_CAFE
|
||||
|
||||
mkdir %MOZ_SRC%\ns\dist\classes\%2
|
||||
%MOZ_TOOLS%\bin\sj.exe -classpath %MOZ_SRC%\ns\dist\classes;%MOZ_SRC%\ns\sun-java\classsrc -d %MOZ_SRC%\ns\dist\classes *.java
|
||||
goto END
|
||||
|
||||
:NO_CAFE
|
||||
|
||||
|
||||
%MOZ_TOOLS%\perl5\perl.exe %MOZ_SRC%\ns\config\outofdate.pl -d %MOZ_SRC%\ns\dist\classes\%2 *.java >> %1
|
||||
%MOZ_TOOLS%\bin\java.exe -argfile %1
|
||||
|
||||
|
||||
:END
|
||||
|
||||
popd
|
||||
121
mozilla/config/clobber_miss.pl
Executable file
121
mozilla/config/clobber_miss.pl
Executable file
@@ -0,0 +1,121 @@
|
||||
#!perl5
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# Searches the tree for unclobbered files
|
||||
# should be relatively cross platform
|
||||
#
|
||||
|
||||
$start_dir = $ENV{"MOZ_SRC"};
|
||||
@ignore_list = ("make.dep","manifest.mnw");
|
||||
|
||||
$missed = 0;
|
||||
|
||||
print "\n\nChecking for unclobbered files\n" .
|
||||
"------------------------------\n";
|
||||
|
||||
GoDir("ns");
|
||||
|
||||
if( $missed ){
|
||||
die "\nError: $missed files or directories unclobbered\n";
|
||||
}
|
||||
else {
|
||||
print "No unclobbered files found\n";
|
||||
}
|
||||
|
||||
sub GoDir {
|
||||
local($dir) = @_;
|
||||
local(%filelist,$iscvsdir);
|
||||
local($k,$v,$d,$fn,$rev, $mod_time);
|
||||
local($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
|
||||
$atime,$mtime,$ctime,$blksize,$blocks);
|
||||
|
||||
if(! chdir "$start_dir/$dir" ){
|
||||
return;
|
||||
}
|
||||
|
||||
while(<*.*> ){
|
||||
if( $_ ne '.' && $_ ne '..' && $_ ne 'CVS'
|
||||
&& $_ ne 'nuke' ){
|
||||
$filelist{$_} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if( -r "CVS/Entries" ){
|
||||
$iscvsdir=1;
|
||||
open(ENT, "CVS/Entries" ) ||
|
||||
die "Cannot open CVS/Entries for reading\n";
|
||||
while(<ENT>){
|
||||
chop;
|
||||
($d,$fn,$rev,$mod_time) = split(/\//);
|
||||
|
||||
if( $fn ne "" ){
|
||||
if( $d eq "D" ){
|
||||
$filelist{$fn} = 3;
|
||||
}
|
||||
else {
|
||||
$filelist{$fn} = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
close(ENT);
|
||||
}
|
||||
|
||||
while( ($k,$v) = each %filelist ){
|
||||
if( $v == 1 && $iscvsdir && !IgnoreFile( $k ) ){
|
||||
if( ! -d $k ){
|
||||
print " file: $dir/$k\n";
|
||||
$missed++;
|
||||
}
|
||||
else {
|
||||
if( ! -r "$k/CVS/Entries" ){
|
||||
print "directory: $dir/$k\n";
|
||||
$missed++;
|
||||
}
|
||||
else {
|
||||
$filelist{$k} = 3;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while( ($k,$v) = each %filelist ){
|
||||
if( $v == 3 ){
|
||||
GoDir("$dir/$k");
|
||||
}
|
||||
}
|
||||
|
||||
# while( ($k,$v) = each %filelist ){
|
||||
# print "$k: $v\n";
|
||||
# }
|
||||
|
||||
}
|
||||
|
||||
sub IgnoreFile {
|
||||
local($fn) = @_;
|
||||
local($i);
|
||||
|
||||
for $i (@ignore_list){
|
||||
if( $fn eq $i ){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
138
mozilla/config/common.mk
Normal file
138
mozilla/config/common.mk
Normal file
@@ -0,0 +1,138 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Cross-platform defines used on all platforms (in theory)
|
||||
######################################################################
|
||||
|
||||
#
|
||||
# The VERSION_NUMBER is suffixed onto the end of the DLLs we ship.
|
||||
# Since the longest of these is 5 characters without the suffix,
|
||||
# be sure to not set VERSION_NUMBER to anything longer than 3
|
||||
# characters for Win16's sake.
|
||||
#
|
||||
# Also... If you change this value, there are several other places
|
||||
# you'll need to change (because they're not reached by this
|
||||
# variable):
|
||||
# sun-java/nsjava/nsjava32.def
|
||||
# sun-java/nsjava/nsjava16.def
|
||||
# sun-java/classsrc/sun/audio/AudioDevice.java
|
||||
# sun-java/classsrc/sun/awt/windows/WToolkit.java
|
||||
#
|
||||
VERSION_NUMBER = 40
|
||||
|
||||
ZIP_NAME = java_$(VERSION_NUMBER)
|
||||
JAR_NAME = java$(VERSION_NUMBER).jar
|
||||
|
||||
# XXX obsolete
|
||||
WIN_ZIP_NAME = $(ZIP_NAME).win
|
||||
MAC_ZIP_NAME = $(ZIP_NAME).mac
|
||||
UNIX_ZIP_NAME = $(ZIP_NAME).x
|
||||
STAND_ALONE_ZIP_NAME = java_sa.zip
|
||||
|
||||
######################################################################
|
||||
# Cross-Platform Java Stuff
|
||||
######################################################################
|
||||
# java interpreter
|
||||
|
||||
# get class files from the directory they are compiled to
|
||||
JAVA_CLASSPATH = $(JAVAC_ZIP)$(PATH_SEPARATOR)$(JAVA_DESTPATH)
|
||||
|
||||
JAVA_FLAGS = -classpath $(JAVA_CLASSPATH) -ms8m
|
||||
JAVA = $(JAVA_PROG) $(JAVA_FLAGS)
|
||||
|
||||
#
|
||||
# NOTE: If a new DLL is being added to this define you will have to update
|
||||
# ns/sun-java/include/javadefs.h in order not to break win16.
|
||||
#
|
||||
JAVA_DEFINES = -DJAR_NAME=\"$(JAR_NAME)\" -DJRTDLL=\"$(JRTDLL)\" -DMMDLL=\"$(MMDLL)\" \
|
||||
-DAWTDLL=\"$(AWTDLL)\" -DJITDLL=\"$(JITDLL)\" -DJPWDLL=\"$(JPWDLL)\"
|
||||
|
||||
######################################################################
|
||||
# javac
|
||||
|
||||
#
|
||||
# java wants '-ms8m' and kaffe wants '-ms 8m', so this needs to be
|
||||
# overridable.
|
||||
#
|
||||
JINT_FLAGS = -ms8m
|
||||
|
||||
# to run the compiler in the interpreter
|
||||
JAVAC_PROG = $(JINT_FLAGS) $(PDJAVA_FLAGS) -classpath $(JAVAC_ZIP) sun.tools.javac.Main
|
||||
JAVAC = $(JAVA_PROG) $(JAVAC_PROG) $(JAVAC_FLAGS)
|
||||
|
||||
# std set of options passed to the compiler
|
||||
JAVAC_FLAGS = -classpath $(JAVAC_CLASSPATH) $(JAVAC_OPTIMIZER) -d $(JAVA_DESTPATH)
|
||||
|
||||
#
|
||||
# The canonical Java classpath is:
|
||||
# JAVA_DESTPATH, JAVA_SOURCEPATH, JAVA_LIBS
|
||||
#
|
||||
# appropriately delimited, in that order
|
||||
#
|
||||
JAVAC_CLASSPATH = $(JAVA_DESTPATH)$(PATH_SEPARATOR)$(JAVA_SOURCEPATH)
|
||||
|
||||
######################################################################
|
||||
# javadoc
|
||||
|
||||
# Rules to build java .html files from java source files
|
||||
|
||||
JAVADOC_PROG = $(JAVA) sun.tools.javadoc.Main
|
||||
JAVADOC_FLAGS = -classpath $(JAVAC_CLASSPATH)
|
||||
JAVADOC = $(JAVADOC_PROG) $(JAVADOC_FLAGS)
|
||||
|
||||
######################################################################
|
||||
# javah
|
||||
|
||||
JAVAH_FLAGS = -classpath $(JAVA_DESTPATH)
|
||||
JAVAH = $(JAVAH_PROG) $(JAVAH_FLAGS)
|
||||
|
||||
######################################################################
|
||||
# jmc
|
||||
|
||||
JMCSRCDIR = $(XPDIST)/_jmc
|
||||
JMC_PROG = $(JAVA) netscape.tools.jmc.Main
|
||||
JMC_CLASSPATH = $(JMCSRCDIR)$(PATH_SEPARATOR)$(JAVAC_CLASSPATH)
|
||||
JMC_FLAGS = -classpath $(JMC_CLASSPATH) -verbose
|
||||
JMC = $(JMC_PROG) $(JMC_FLAGS)
|
||||
|
||||
######################################################################
|
||||
# zip
|
||||
|
||||
ZIP = $(ZIP_PROG) $(ZIP_FLAGS)
|
||||
|
||||
######################################################################
|
||||
# idl2java
|
||||
|
||||
ORBTOOLS = $(DEPTH)/modules/iiop/tools/orbtools.zip
|
||||
ORB_CLASSPATH = $(ORBTOOLS)$(PATH_SEPARATOR)$(JAVA_CLASSPATH)
|
||||
|
||||
IDL2JAVA_PROG = $(JAVA_PROG)
|
||||
IDL2JAVA_FLAGS = -classpath $(ORB_CLASSPATH) pomoco.tools.idl2java
|
||||
IDL2JAVA = $(IDL2JAVA_PROG) $(IDL2JAVA_FLAGS)
|
||||
|
||||
######################################################################
|
||||
# lex and yacc
|
||||
|
||||
JAVALEX_PROG = $(JAVA_PROG) -classpath $(ORB_CLASSPATH) sbktech.tools.jax.driver
|
||||
JAVALEX_FLAGS =
|
||||
JAVALEX = $(JAVALEX_PROG) $(JAVALEX_FLAGS)
|
||||
|
||||
JAVACUP_PROG = $(JAVA_PROG) -classpath $(ORB_CLASSPATH) java_cup.Main
|
||||
JAVACUP_FLAGS =
|
||||
JAVACUP = $(JAVACUP_PROG) $(JAVACUP_FLAGS)
|
||||
|
||||
370
mozilla/config/config.guess
vendored
Executable file
370
mozilla/config/config.guess
vendored
Executable file
@@ -0,0 +1,370 @@
|
||||
#!/bin/sh
|
||||
# This script attempts to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
#
|
||||
# The plan is that this can be called by configure scripts if you
|
||||
# don't specify an explicit system type (host/target name).
|
||||
#
|
||||
# Only a few systems have been added to this list; please add others
|
||||
# (but try to keep the structure clean).
|
||||
#
|
||||
|
||||
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
|
||||
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
alpha:OSF1:1.*:*)
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
echo alpha-dec-osf${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
# lemacs change from Dirk Grunwald <grunwald@foobar.cs.colorado.edu>
|
||||
alpha:OSF1:V[123].*:*)
|
||||
# 1.3 uses "V1.3" for uname -r.
|
||||
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
|
||||
exit 0 ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit 0;;
|
||||
sun4*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
# According to config.sub, this is the proper way to canonicalize
|
||||
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
|
||||
# it's likely to be more like Solaris than SunOS4.
|
||||
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
i86pc*:SunOS:5.*:*)
|
||||
echo x86-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:*:*)
|
||||
echo sparc-sun-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:SunOS:*:*)
|
||||
echo m68k-sun-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RISC*:ULTRIX:*:*)
|
||||
echo mips-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
VAX*:ULTRIX*:*:*)
|
||||
echo vax-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mips:*:5*:RISCos)
|
||||
echo mips-mips-riscos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
m88k:*:4*:R4*)
|
||||
echo m88k-motorola-sysv4
|
||||
exit 0 ;;
|
||||
m88k:*:3*:R3*)
|
||||
echo m88k-motorola-sysv3
|
||||
exit 0 ;;
|
||||
AViiON:dgux:*:*)
|
||||
echo m88k-dg-dgux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
M88*:*:R3*:*)
|
||||
# Delta 88k system running SVR3
|
||||
echo m88k-motorola-sysv3
|
||||
exit 0 ;;
|
||||
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
|
||||
echo m88k-tektronix-sysv3
|
||||
exit 0 ;;
|
||||
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
|
||||
echo m68k-tektronix-bsd
|
||||
exit 0 ;;
|
||||
*:IRIX*:*:*)
|
||||
echo mips-sgi-irix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i[3456]86:AIX:*:*)
|
||||
echo i386-ibm-aix
|
||||
exit 0 ;;
|
||||
*:AIX:2:3)
|
||||
test -x /usr/bin/oslevel && test `/usr/bin/oslevel` = '=3240' \
|
||||
&& echo rs6000-ibm-aix3.2.4 && exit 0
|
||||
test -x /usr/bin/oslevel && test `/usr/bin/oslevel` = '=3250' \
|
||||
&& echo rs6000-ibm-aix3.2.5 && exit 0
|
||||
test -x /usr/bin/oslevel && test `/usr/bin/oslevel` = '<>3250' \
|
||||
&& echo rs6000-ibm-aix3.2.5 && exit 0
|
||||
echo rs6000-ibm-aix3.2
|
||||
exit 0 ;;
|
||||
*:AIX:*:4)
|
||||
echo rs6000-ibm-aix4
|
||||
exit 0 ;;
|
||||
*:AIX:*:*)
|
||||
echo rs6000-ibm-aix
|
||||
exit 0 ;;
|
||||
*:BOSX:*:*)
|
||||
echo rs6000-bull-bosx
|
||||
exit 0 ;;
|
||||
DPX/2?00:B.O.S.:*:*)
|
||||
echo m68k-bull-sysv3
|
||||
exit 0 ;;
|
||||
9000/31?:HP-UX:*:*)
|
||||
echo m68000-hp-hpux
|
||||
exit 0 ;;
|
||||
9000/[34]??:HP-UX:*:*)
|
||||
echo m68k-hp-hpux
|
||||
exit 0 ;;
|
||||
9000/[34]??:4.3bsd:1.*:*)
|
||||
echo m68k-hp-bsd
|
||||
exit 0 ;;
|
||||
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
|
||||
echo m68k-hp-bsd4.4
|
||||
exit 0 ;;
|
||||
9000/7??:HP-UX:*:* | 9000/8?7:HP-UX:*:* )
|
||||
echo hppa1.1-hp-hpux
|
||||
exit 0 ;;
|
||||
9000/8??:HP-UX:*:*)
|
||||
echo hppa1.0-hp-hpux
|
||||
exit 0 ;;
|
||||
3050*:HI-UX:*:*)
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
#include <unistd.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
if (CPU_IS_HP_MC68K (cpu))
|
||||
puts ("m68k-hitachi-hiuxwe2");
|
||||
else if (CPU_IS_PA_RISC (cpu))
|
||||
{
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
|
||||
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
|
||||
default: puts ("hppa-hitachi-hiuxwe2"); break;
|
||||
}
|
||||
}
|
||||
else puts ("unknown-hitachi-hiuxwe2");
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
echo unknown-hitachi-hiuxwe2
|
||||
exit 0 ;;
|
||||
9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* )
|
||||
echo hppa1.1-hp-bsd
|
||||
exit 0 ;;
|
||||
9000/8??:4.3bsd:*:*)
|
||||
echo hppa1.0-hp-bsd
|
||||
exit 0 ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1:*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
C2*:ConvexOS:*:* | convex:ConvexOS:C2:*)
|
||||
echo c2-convex-bsd
|
||||
exit 0 ;;
|
||||
CRAY*X-MP:UNICOS:*:*)
|
||||
echo xmp-cray-unicos
|
||||
exit 0 ;;
|
||||
CRAY*Y-MP:UNICOS:*:*)
|
||||
echo ymp-cray-unicos
|
||||
exit 0 ;;
|
||||
CRAY-2:UNICOS:*:*)
|
||||
echo cray2-cray-unicos
|
||||
exit 0 ;;
|
||||
hp3[0-9][05]:NetBSD:*:*)
|
||||
echo m68k-hp-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i[3456]86:FreeBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd
|
||||
exit 0 ;;
|
||||
i[3456]86:NetBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux
|
||||
exit 0 ;;
|
||||
i[3456]86:UnixWare:*:*)
|
||||
echo ${UNAME_MACHINE}-sco-unixware${UNAME_VERSION}
|
||||
exit 0 ;;
|
||||
i[3456]86:UNIX_SV:4.*:* | i[3456]86:SYSTEM_V:4.*:*)
|
||||
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
|
||||
UNAME_REL=`(/bin/uname -v)`
|
||||
echo ${UNAME_MACHINE}-sco-unixware${UNAME_REL}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i[3456]86:*:3.2:*)
|
||||
if /bin/uname -X 2>/dev/null >/dev/null ; then
|
||||
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= .*v//')`
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
echo ${UNAME_MACHINE}-sco-opensv${UNAME_REL}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-sysv32
|
||||
fi
|
||||
exit 0 ;;
|
||||
mini*:CTIX:SYS*5:*)
|
||||
# "miniframe"
|
||||
echo m68010-convergent-sysv
|
||||
exit 0 ;;
|
||||
M680[234]0:*:R3V[567]*:*)
|
||||
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
||||
3[3456]??*:*:4.0:*)
|
||||
uname -p 2>/dev/null | egrep 'Pentium|86' >/dev/null && echo x86-ncr-sysv4 && exit 0 ;;
|
||||
m680[234]0:LynxOS:2.2*:*)
|
||||
echo m68k-lynx-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i[3456]86:LynxOS:2.2*:*)
|
||||
echo x86-lynx-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
TSUNAMI:LynxOS:2.2*:*)
|
||||
echo sparc-lynx-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RM*:SINIX*:5.4[23]:* | RM*:Reliant*:5.4[23]:*)
|
||||
echo mips-sni-reliantunix
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
|
||||
|
||||
cat >dummy.c <<EOF
|
||||
main()
|
||||
{
|
||||
#if defined (sony)
|
||||
#if defined (MIPSEB)
|
||||
#if defined (__svr4)
|
||||
printf ("mips-sony-sysv\n"); exit (0);
|
||||
#else
|
||||
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
|
||||
I don't know.... */
|
||||
printf ("mips-sony-bsd\n"); exit (0);
|
||||
#endif
|
||||
#else
|
||||
printf("m68k-sony-newsos\n"); exit(0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (_nec_ews)
|
||||
printf("mips-nec-uxv4.2\n"); exit(0);
|
||||
#endif
|
||||
|
||||
#if defined (__arm) && defined (__acorn) && defined (__unix)
|
||||
printf("arm-acorn-riscix"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined(hp300) && !defined(hpux)
|
||||
printf("m68k-hp-bsd\n"); exit(0);
|
||||
#endif
|
||||
|
||||
#if defined(NeXT)
|
||||
#if !defined(__ARCHITECTURE__)
|
||||
#define __ARCHITECTURE__ "m68k"
|
||||
#endif
|
||||
int version;
|
||||
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
|
||||
if (version==2)
|
||||
{
|
||||
printf("%s-next-ns2\n", __ARCHITECTURE__);
|
||||
exit(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%s-next-ns3\n", __ARCHITECTURE__);
|
||||
exit(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (MACH)
|
||||
#if defined (vax)
|
||||
printf("vax-dec-mach\n"); exit(0);
|
||||
#else
|
||||
#if defined (sun3)
|
||||
printf("mc68000-sun-mach\n"); exit(0);
|
||||
#else
|
||||
#if defined (sparc)
|
||||
printf("sparc-sun-mach\n"); exit(0);
|
||||
#else
|
||||
#if defined (mips)
|
||||
printf("mips-dec-mach\n"); exit(0);
|
||||
#else
|
||||
#if defined (ibmrt)
|
||||
printf("romp-ibm-mach\n"); exit(0);
|
||||
#else
|
||||
#if defined (i386)
|
||||
printf("i386-unknown-mach\n"); exit(0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (MULTIMAX) || defined (n16)
|
||||
#if defined (UMAXV)
|
||||
printf("ns32k-encore-sysv\n"); exit(0);
|
||||
#else
|
||||
#if defined (CMU)
|
||||
printf("ns32k-encore-mach\n"); exit(0);
|
||||
#else
|
||||
printf("ns32k-encore-bsd\n"); exit(0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__386BSD__) || (defined(__bsdi__) && defined(__i386__))
|
||||
printf("i386-bsdi-bsd\n"); exit(0);
|
||||
#endif
|
||||
|
||||
#if defined(sequent)
|
||||
#if defined(i386)
|
||||
printf("i386-sequent-dynix\n"); exit(0);
|
||||
#endif
|
||||
#if defined (ns32000)
|
||||
printf("ns32k-sequent-dynix\n"); exit(0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_SEQUENT_)
|
||||
printf("i386-sequent-ptx\n"); exit(0);
|
||||
#endif
|
||||
|
||||
#if defined(vax)
|
||||
#if !defined(ultrix)
|
||||
printf("vax-dec-bsd\n"); exit(0);
|
||||
#else
|
||||
printf("vax-dec-ultrix\n"); exit(0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
exit (1);
|
||||
}
|
||||
EOF
|
||||
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
|
||||
|
||||
#echo '(Unable to guess system type)' 1>&2
|
||||
|
||||
exit 1
|
||||
365
mozilla/config/config.mak
Normal file
365
mozilla/config/config.mak
Normal file
@@ -0,0 +1,365 @@
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
!if !defined(CONFIG_CONFIG_MAK)
|
||||
CONFIG_CONFIG_MAK=1
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define public make variables:
|
||||
#//
|
||||
#// OBJDIR - Specifies the location of intermediate files (ie. objs...)
|
||||
#// Currently, the names are WINxx_O.OBJ or WINxx_D.OBJ for
|
||||
#// optimized and debug builds respectively.
|
||||
#//
|
||||
#// DIST - Specifies the location of the distribution directory where
|
||||
#// all targets are delivered.
|
||||
#//
|
||||
#// CFGFILE - Specifies the name of the temporary configuration file
|
||||
#// containing the arguments to the current command.
|
||||
#//
|
||||
#// INCS - Default include paths.
|
||||
#//
|
||||
#// CFLAGS - Default compiler options.
|
||||
#//
|
||||
#// LFLAGS - Default linker options.
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!if [$(MOZ_TOOLS)\bin\uname > osuname.inc]
|
||||
!endif
|
||||
WINOS=\
|
||||
!include "osuname.inc"
|
||||
WINOS=$(WINOS: =)^
|
||||
|
||||
!if [del osuname.inc]
|
||||
!endif
|
||||
|
||||
## Include support for MOZ_LITE/MOZ_MEDIUM
|
||||
include <$(DEPTH)/config/liteness.mak>
|
||||
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
|
||||
!if "$(MAKE_OBJ_TYPE)" == "DLL"
|
||||
OBJTYPE=D
|
||||
!else
|
||||
OBJTYPE=E
|
||||
!endif
|
||||
|
||||
!else
|
||||
OBJTYPE=
|
||||
!endif
|
||||
|
||||
XPDIST=$(DEPTH)\dist
|
||||
PUBLIC=$(XPDIST)\public
|
||||
|
||||
#//-----------------------------------------------------------------------
|
||||
#// OBJDIR is NOT the same as DIST for Win16. The Win16 dist stuff can
|
||||
#// be built with EXE or DLL compiler flags, but the DIST directory
|
||||
#// has the same name no matter what
|
||||
#//-----------------------------------------------------------------------
|
||||
|
||||
!ifdef MOZ_NAV_BUILD_PREFIX
|
||||
DIST_PREFIX=NAV
|
||||
!else
|
||||
DIST_PREFIX=WIN
|
||||
!endif
|
||||
|
||||
!ifndef MOZ_DEBUG
|
||||
OBJDIR=$(DIST_PREFIX)$(MOZ_BITS)$(OBJTYPE)_O.OBJ
|
||||
JAVA_OPTIMIZER = -O
|
||||
!ifdef NO_CAFE
|
||||
JAVAC_OPTIMIZER =
|
||||
!else
|
||||
#JAVAC_OPTIMIZER= -O -noinline
|
||||
JAVAC_OPTIMIZER =
|
||||
!endif
|
||||
!else
|
||||
OBJDIR=$(DIST_PREFIX)$(MOZ_BITS)$(OBJTYPE)_D.OBJ
|
||||
JAVA_OPTIMIZER = -g
|
||||
JAVAC_OPTIMIZER = -g
|
||||
!endif
|
||||
|
||||
#//
|
||||
#// DIST DEFINES SHOULD NEVER BE COMPONENT SPECIFIC.
|
||||
#//
|
||||
!ifndef MOZ_DEBUG
|
||||
DIST=$(XPDIST)\$(DIST_PREFIX)$(MOZ_BITS)_O.OBJ
|
||||
!else
|
||||
DIST=$(XPDIST)\$(DIST_PREFIX)$(MOZ_BITS)_D.OBJ
|
||||
!endif
|
||||
|
||||
CFGFILE=$(OBJDIR)\cmd.cfg
|
||||
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
INCS=-I$(XPDIST)\public\win16 $(INCS) -I$(DEPTH)\include -I$(DIST)\include -I..\include
|
||||
!else
|
||||
INCS=$(INCS) -I$(DEPTH)\include -I$(DIST)\include \
|
||||
-I$(XPDIST)\public\img -I$(XPDIST)\public\util \
|
||||
-I$(XPDIST)\public\coreincl
|
||||
!endif # 16
|
||||
|
||||
!ifndef NO_LAYERS
|
||||
INCS=$(INCS) -I$(DEPTH)\lib\liblayer\include
|
||||
!endif
|
||||
|
||||
!if "$(STAND_ALONE_JAVA)" == "1"
|
||||
LCFLAGS=$(LCFLAGS) -DSTAND_ALONE_JAVA
|
||||
!endif
|
||||
|
||||
|
||||
!if defined(MOZ_JAVA)
|
||||
MOZ_JAVA_FLAG=-DJAVA
|
||||
!endif
|
||||
|
||||
# Perhaps we should add MOZ_LITENESS_FLAGS to 16 bit build
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
CFLAGS=$(MOZ_JAVA_FLAG) -DMOCHA -DLAYERS -DEDITOR $(OS_CFLAGS) $(MOZ_CFLAGS)
|
||||
!else
|
||||
CFLAGS=$(MOZ_JAVA_FLAG) -DMOCHA -DLAYERS $(OS_CFLAGS) $(MOZ_CFLAGS) $(MOZ_LITENESS_FLAGS)
|
||||
!endif
|
||||
LFLAGS=$(OS_LFLAGS) $(LLFLAGS) $(MOZ_LFLAGS)
|
||||
|
||||
!ifdef NO_SECURITY
|
||||
CFLAGS = $(CFLAGS) -DNO_SECURITY
|
||||
!endif
|
||||
|
||||
# This compiles in heap dumping utilities and other good stuff
|
||||
# for developers -- maybe we only want it in for a special SDK
|
||||
# nspr/java runtime(?):
|
||||
!if "$(MOZ_BITS)"=="32" || defined(MOZ_DEBUG)
|
||||
CFLAGS = $(CFLAGS) -DDEVELOPER_DEBUG
|
||||
!endif
|
||||
|
||||
!ifdef STANDALONE_IMAGE_LIB
|
||||
CFLAGS=$(CFLAGS) -DSTANDALONE_IMAGE_LIB
|
||||
!endif
|
||||
|
||||
!ifdef MODULAR_NETLIB
|
||||
CFLAGS=$(CFLAGS) -DMODULAR_NETLIB
|
||||
!endif
|
||||
|
||||
# always need these:
|
||||
CFLAGS = $(CFLAGS) -DNETSCAPE
|
||||
|
||||
# Specify that we are building a client.
|
||||
# This will instruct the cross platform libraries to
|
||||
# include all the client specific cruft.
|
||||
!if defined(SERVER_BUILD)
|
||||
CFLAGS = $(CFLAGS) -DSERVER_BUILD
|
||||
!elseif defined(LIVEWIRE)
|
||||
CFLAGS = $(CFLAGS) -DLIVEWIRE
|
||||
!else
|
||||
CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT
|
||||
!endif
|
||||
|
||||
PERL= $(MOZ_TOOLS)\perl5\perl.exe
|
||||
MASM = $(MOZ_TOOLS)\bin\ml.exe
|
||||
|
||||
!if "$(WINOS)" == "WIN95"
|
||||
MKDIR = $(DEPTH)\config\w95mkdir
|
||||
QUIET =
|
||||
!else
|
||||
MKDIR = mkdir
|
||||
QUIET=@
|
||||
!endif
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the OS dependent configuration information
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)/config/WIN$(MOZ_BITS)>
|
||||
|
||||
!ifdef MOZ_DEBUG
|
||||
!ifdef USERNAME
|
||||
CFLAGS = $(CFLAGS) -DDEBUG_$(USERNAME)
|
||||
!endif
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define the global make commands.
|
||||
#//
|
||||
#// MAKE_INSTALL - Copy a target to the distribution directory.
|
||||
#//
|
||||
#// MAKE_OBJDIRS - Create an object directory (if necessary).
|
||||
#//
|
||||
#// MAKE_MANGLE - Convert all long filenames into 8.3 names
|
||||
#//
|
||||
#// MAKE_UNMANGLE - Restore all long filenames
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!if !defined(MOZ_SRC)
|
||||
#enable builds on any drive if defined.
|
||||
MOZ_SRC=y:
|
||||
!endif
|
||||
MAKE_INSTALL=$(QUIET)$(DEPTH)\config\makecopy.exe
|
||||
MAKE_MANGLE=$(DEPTH)\config\mangle.exe
|
||||
MAKE_UNMANGLE=if exist unmangle.bat call unmangle.bat
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Common Libraries
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!ifdef NSPR20
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
LIBNSPR=$(DIST)\lib\nspr21.lib
|
||||
LIBNSPR=$(LIBNSPR) $(DIST)\lib\plds21.lib
|
||||
LIBNSPR=$(LIBNSPR) $(DIST)\lib\msgc21.lib
|
||||
!else
|
||||
LIBNSPR=$(DIST)\lib\libnspr21.lib
|
||||
LIBNSPR=$(LIBNSPR) $(DIST)\lib\libplds21.lib
|
||||
LIBNSPR=$(LIBNSPR) $(DIST)\lib\libmsgc21.lib
|
||||
!endif
|
||||
!else
|
||||
LIBNSPR=$(DIST)\lib\pr$(MOZ_BITS)$(VERSION_NUMBER).lib
|
||||
!endif
|
||||
|
||||
!ifdef NSPR20
|
||||
NSPRDIR = nsprpub
|
||||
CFLAGS = $(CFLAGS) -DNSPR20
|
||||
!else
|
||||
NSPRDIR = nspr
|
||||
!endif
|
||||
|
||||
LIBJPEG=$(DIST)\lib\jpeg$(MOZ_BITS)$(VERSION_NUMBER).lib
|
||||
|
||||
######################################################################
|
||||
### Windows-Specific Java Stuff
|
||||
|
||||
PATH_SEPARATOR = ;
|
||||
|
||||
# where the bytecode will go
|
||||
!if "$(AWT_11)" == "1"
|
||||
JAVA_DESTPATH = $(DEPTH)\dist\classes11
|
||||
!else
|
||||
JAVA_DESTPATH = $(DEPTH)\dist\classes
|
||||
!endif
|
||||
|
||||
# where the source are
|
||||
DEFAULT_JAVA_SOURCEPATH = $(DEPTH)\sun-java\classsrc
|
||||
!ifndef JAVA_SOURCEPATH
|
||||
!if "$(AWT_11)" == "1"
|
||||
JAVA_SOURCEPATH = $(DEPTH)\sun-java\classsrc11;$(DEFAULT_JAVA_SOURCEPATH)
|
||||
!else
|
||||
JAVA_SOURCEPATH = $(DEFAULT_JAVA_SOURCEPATH)
|
||||
!endif
|
||||
!endif
|
||||
|
||||
JAVA_PROG=$(MOZ_TOOLS)\bin\java.exe
|
||||
#JAVA_PROG=$(DIST)\bin\java
|
||||
|
||||
JAVAC_ZIP=$(MOZ_TOOLS)/lib/javac.zip
|
||||
|
||||
ZIP_PROG = $(MOZ_TOOLS)\bin\zip
|
||||
UNZIP_PROG = $(MOZ_TOOLS)\bin\unzip
|
||||
ZIP_FLAGS = -0 -r -q
|
||||
|
||||
CFLAGS = $(CFLAGS) -DOS_HAS_DLL
|
||||
|
||||
DLL_SUFFIX = dll
|
||||
LIB_SUFFIX = lib
|
||||
|
||||
!if "$(STAND_ALONE_JAVA)" == "1"
|
||||
STAND_ALONE_JAVA_DLL_SUFFIX=s
|
||||
!else
|
||||
STAND_ALONE_JAVA_DLL_SUFFIX=
|
||||
!endif
|
||||
|
||||
MOD_JRT=jrt$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
MOD_MM =mm$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
MOD_AWT=awt$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
MOD_AWTS=awt$(MOZ_BITS)$(VERSION_NUMBER)$(STAND_ALONE_JAVA_DLL_SUFFIX)
|
||||
MOD_JIT=jit$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
MOD_JSJ=jsj$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
MOD_NET=net$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
MOD_JBN=jbn$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
MOD_NSC=nsc$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
MOD_JPW=jpw$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
MOD_JDB=jdb$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
MOD_ZIP=zip$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
MOD_ZPW=zpw$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
MOD_CON=con$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
|
||||
JRTDLL=$(MOD_JRT).$(DLL_SUFFIX)
|
||||
MMDLL =$(MOD_MM).$(DLL_SUFFIX)
|
||||
AWTDLL=$(MOD_AWT).$(DLL_SUFFIX)
|
||||
AWTSDLL=$(MOD_AWT)$(STAND_ALONE_JAVA_DLL_SUFFIX).$(DLL_SUFFIX)
|
||||
JITDLL=$(MOD_JIT).$(DLL_SUFFIX)
|
||||
JSJDLL=$(MOD_JSJ).$(DLL_SUFFIX)
|
||||
NETDLL=$(MOD_NET).$(DLL_SUFFIX)
|
||||
JBNDLL=$(MOD_JBN).$(DLL_SUFFIX)
|
||||
NSCDLL=$(MOD_NSC).$(DLL_SUFFIX)
|
||||
JPWDLL=$(MOD_JPW).$(DLL_SUFFIX)
|
||||
JDBDLL=$(MOD_JDB).$(DLL_SUFFIX)
|
||||
ZIPDLL=$(MOD_ZIP).$(DLL_SUFFIX)
|
||||
ZPWDLL=$(MOD_ZPW).$(DLL_SUFFIX)
|
||||
CONDLL=$(MOD_CON).$(DLL_SUFFIX)
|
||||
|
||||
ZIPLIB=$(DIST)\lib\$(MOD_ZIP).$(LIB_SUFFIX)
|
||||
AWTLIB=$(DIST)\lib\$(MOD_AWT).$(LIB_SUFFIX)
|
||||
|
||||
######################################################################
|
||||
|
||||
include <$(DEPTH)/config/common.mk>
|
||||
|
||||
JAVA_DEFINES = \
|
||||
-DJAR_NAME=\"$(JAR_NAME)\" \
|
||||
-DJRTDLL=\"$(JRTDLL)\" \
|
||||
-DMMDLL=\"$(MMDLL)\" \
|
||||
-DAWTDLL=\"$(AWTDLL)\" \
|
||||
-DAWTSDLL=\"$(AWTSDLL)\" \
|
||||
-DJSJDLL=\"$(JSJDLL)\" \
|
||||
-DJITDLL=\"$(JITDLL)\" \
|
||||
-DNETDLL=\"$(NETDLL)\" \
|
||||
-DJBNDLL=\"$(JBNDLL)\" \
|
||||
-DNSCDLL=\"$(NSCDLL)\" \
|
||||
-DJDBDLL=\"$(JDBDLL)\" \
|
||||
-DJPWDLL=\"$(JPWDLL)\" \
|
||||
-DZPWDLL=\"$(ZPWDLL)\" \
|
||||
-DCONDLL=\"$(CONDLL)\"
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
|
||||
# Override JAVA_DEFINES to make command line short for win16.
|
||||
# Put any new defines into javadefs.h in ns/sun-java/include.
|
||||
# This is to shorten the command line in order not to break Win16.
|
||||
|
||||
JAVA_DEFINES = -DJAR_NAME=\"$(JAR_NAME)\" -DMOZ_BITS=\"$(MOZ_BITS)\" -DVERSION_NUMBER=\"$(VERSION_NUMBER)\" -DDLL_SUFFIX=\".$(DLL_SUFFIX)\"
|
||||
|
||||
!endif
|
||||
|
||||
|
||||
#JAVA_CLASSPATH = $(JAVA_CLASSPATH:/=\)
|
||||
JMCSRCDIR = $(JMCSRCDIR:/=\)
|
||||
JAVA_BOOT_CLASSPATH = $(JAVA_BOOT_CLASSPATH:/=\)
|
||||
|
||||
NMAKE=nmake -nologo -$(MAKEFLAGS)
|
||||
|
||||
########
|
||||
# Get the cwd to prepend to all compiled source
|
||||
# files. Will allow debugger to automatically find sources
|
||||
# instead of asking for the path info.
|
||||
# Win16 will break if enabled, guess we continue to live in pain
|
||||
# therein.
|
||||
########
|
||||
!if "$(MOZ_BITS)" == "32"
|
||||
CURDIR=$(MAKEDIR)^\
|
||||
!endif
|
||||
|
||||
!endif # CONFIG_CONFIG_MAK
|
||||
|
||||
569
mozilla/config/config.mk
Normal file
569
mozilla/config/config.mk
Normal file
@@ -0,0 +1,569 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# config.mk
|
||||
#
|
||||
# Determines the platform and builds the macros needed to load the
|
||||
# appropriate platform-specific .mk file, then defines all (most?)
|
||||
# of the generic macros.
|
||||
#
|
||||
|
||||
# This wastes time.
|
||||
include $(DEPTH)/config/common.mk
|
||||
|
||||
#
|
||||
# Important internal static macros
|
||||
#
|
||||
OS_ARCH := $(subst /,_,$(shell uname -s))
|
||||
OS_RELEASE := $(shell uname -r)
|
||||
OS_TEST := $(shell uname -m)
|
||||
|
||||
#
|
||||
# Tweak the default OS_ARCH and OS_RELEASE macros as needed.
|
||||
#
|
||||
ifeq ($(OS_ARCH),AIX)
|
||||
OS_RELEASE := $(shell uname -v).$(shell uname -r)
|
||||
endif
|
||||
ifeq ($(OS_ARCH),BSD_386)
|
||||
OS_ARCH := BSD_OS
|
||||
endif
|
||||
ifeq ($(OS_ARCH),IRIX64)
|
||||
OS_ARCH := IRIX
|
||||
endif
|
||||
ifeq ($(OS_ARCH),UNIX_SV)
|
||||
ifneq ($(findstring NCR,$(shell grep NCR /etc/bcheckrc | head -1 )),)
|
||||
OS_ARCH := NCR
|
||||
else
|
||||
OS_ARCH := UNIXWARE
|
||||
OS_RELEASE := $(shell uname -v)
|
||||
endif
|
||||
endif
|
||||
ifeq ($(OS_ARCH),ncr)
|
||||
OS_ARCH := NCR
|
||||
endif
|
||||
# This is the only way to correctly determine the actual OS version on NCR boxes.
|
||||
ifeq ($(OS_ARCH),NCR)
|
||||
OS_RELEASE := $(shell awk '{print $$3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$$/\2.\3/')
|
||||
endif
|
||||
ifeq ($(OS_ARCH),UNIX_System_V)
|
||||
OS_ARCH := NEC
|
||||
endif
|
||||
ifeq ($(OS_ARCH),SCO_SV)
|
||||
OS_ARCH := SCOOS
|
||||
OS_RELEASE := 5.0
|
||||
endif
|
||||
ifneq (,$(filter SINIX-N SINIX-Y ReliantUNIX-M,$(OS_ARCH)))
|
||||
OS_ARCH := SINIX
|
||||
endif
|
||||
ifeq ($(OS_ARCH),UnixWare)
|
||||
OS_ARCH := UNIXWARE
|
||||
endif
|
||||
|
||||
#
|
||||
# Strip off the excessively long version numbers on these platforms,
|
||||
# but save the version to allow multiple versions of the same base
|
||||
# platform to be built in the same tree.
|
||||
#
|
||||
ifneq (,$(filter FreeBSD HP-UX IRIX Linux OSF1 SunOS,$(OS_ARCH)))
|
||||
OS_VERS := $(suffix $(OS_RELEASE))
|
||||
OS_RELEASE := $(basename $(OS_RELEASE))
|
||||
OS_VERSION := $(shell echo $(OS_VERS) | sed 's/-.*//')
|
||||
endif
|
||||
|
||||
OS_CONFIG := $(OS_ARCH)$(OS_RELEASE)
|
||||
|
||||
#
|
||||
# Personal makefile customizations go in these optional make include files.
|
||||
#
|
||||
MY_CONFIG := $(DEPTH)/config/myconfig.mk
|
||||
MY_RULES := $(DEPTH)/config/myrules.mk
|
||||
|
||||
#
|
||||
# Relative pathname from top-of-tree to current source directory
|
||||
#
|
||||
ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
|
||||
REVDEPTH := $(DEPTH)/config/revdepth
|
||||
SRCDIR = $(shell $(PERL) $(REVDEPTH).pl $(DEPTH))
|
||||
endif
|
||||
|
||||
#
|
||||
# Define an include-at-most-once flag
|
||||
#
|
||||
NS_CONFIG_MK = 1
|
||||
|
||||
#
|
||||
# Provide the means to easily override our tool directory locations.
|
||||
#
|
||||
ifdef NETSCAPE_HIERARCHY
|
||||
CONTRIB_BIN := /tools/contrib/bin/
|
||||
JAVA_BIN := /usr/local/java/bin/
|
||||
LOCAL_BIN := /usr/local/bin/
|
||||
LOCAL_SUN4 := /usr/local/sun4/bin/
|
||||
NS_BIN := /tools/ns/bin/
|
||||
NS_LIB := /tools/ns/lib
|
||||
JAVA_LIB := /usr/local/netscape/java/lib
|
||||
XFEPRIVDIR := $(DEPTH)/../ns/cmd/xfe/
|
||||
else
|
||||
NS_LIB := .
|
||||
JAVA_LIB := .
|
||||
endif
|
||||
|
||||
#
|
||||
# Default command macros; can be overridden in <arch>.mk.
|
||||
#
|
||||
AS = $(CC)
|
||||
ASFLAGS = $(CFLAGS)
|
||||
BSDECHO = echo
|
||||
CC = gcc
|
||||
CCC = g++
|
||||
CCF = $(CC) $(CFLAGS)
|
||||
LINK_EXE = $(LINK) $(OS_LFLAGS) $(LFLAGS)
|
||||
LINK_DLL = $(LINK) $(OS_DLLFLAGS) $(DLLFLAGS)
|
||||
NFSPWD = $(DEPTH)/config/nfspwd
|
||||
PURIFY = purify $(PURIFYOPTIONS)
|
||||
QUANTIFY = quantify $(QUANTIFYOPTIONS)
|
||||
RANLIB = /bin/true
|
||||
SDKINSTALL = $(NSINSTALL) -t
|
||||
UNZIP_PROG = $(LOCAL_BIN)/unzip
|
||||
ZIP_PROG = $(LOCAL_BIN)/zip
|
||||
ZIP_FLAGS = -0rq
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
EMPTY :=
|
||||
SLASH := /$(EMPTY)
|
||||
BSLASH := \$(EMPTY)
|
||||
SEMICOLON := ;$(EMPTY)
|
||||
SPACE := $(EMPTY) $(EMPTY)
|
||||
PATH_SEPARATOR := \;
|
||||
RC = flipper rc$(BIN_SUFFIX)
|
||||
XP_DEFINE = -DXP_PC
|
||||
LIB_SUFFIX = lib
|
||||
DLL_SUFFIX = dll
|
||||
MAP_SUFFIX = map
|
||||
BIN_SUFFIX = .exe
|
||||
AR = flipper ILibo //noignorecase //nologo $@
|
||||
IMPLIB = flipper ILibo //noignorecase //nologo $@
|
||||
DLLFLAGS = -DLL -OUT:$@ $(XLFLAGS) -MAP:$(@:.dll=.map)
|
||||
LFLAGS = $(OBJS) -OUT:$@ $(XLFLAGS) $(DEPLIBS) $(EXTRA_LIBS) -MAP:$(@:.dll=.map) $(DEF_FILE)
|
||||
NSINSTALL = nsinstall
|
||||
INSTALL = $(NSINSTALL)
|
||||
JAVA_PROG = flipper java -norestart
|
||||
JAVAC_ZIP = $(subst $(BSLASH),$(SLASH),$(JAVA_HOME))/lib/classes.zip
|
||||
else
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
PATH_SEPARATOR := :
|
||||
RC = rc$(BIN_SUFFIX)
|
||||
XP_DEFINE = -DXP_PC
|
||||
LIB_SUFFIX = lib
|
||||
DLL_SUFFIX = dll
|
||||
BIN_SUFFIX = .exe
|
||||
AR = lib -NOLOGO -OUT:"$@"
|
||||
DLLFLAGS = $(XLFLAGS) -OUT:"$@"
|
||||
LFLAGS = $(OBJS) $(DEPLIBS) $(EXTRA_LIBS) -OUT:"$@"
|
||||
NSINSTALL = nsinstall
|
||||
INSTALL = $(NSINSTALL)
|
||||
JAVA_PROG = java
|
||||
else
|
||||
PATH_SEPARATOR := :
|
||||
XP_DEFINE = -DXP_UNIX
|
||||
AR = ar cr $@
|
||||
DLL_SUFFIX = so
|
||||
LIB_SUFFIX = a
|
||||
ifeq ($(AWT_11),1)
|
||||
JAVA_PROG = $(NS_BIN)java
|
||||
JAVAC_ZIP = $(NS_LIB)/classes.zip
|
||||
else
|
||||
JAVA_PROG = $(LOCAL_BIN)java
|
||||
JAVAC_ZIP = $(JAVA_LIB)/javac.zip
|
||||
endif
|
||||
PERL = $(NS_BIN)perl
|
||||
TAR = tar
|
||||
EMACS = xemacs
|
||||
WHOAMI = /usr/bin/whoami
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Debug by default.
|
||||
#
|
||||
OBJDIR_TAG = _DBG
|
||||
OPTIMIZER = -g
|
||||
JAVA_OPTIMIZER = -g
|
||||
XBCFLAGS = -FR$*
|
||||
XCFLAGS = $(LCFLAGS)
|
||||
XLFLAGS = $(LLFLAGS)
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
OPTIMIZER = -Ti+
|
||||
XLFLAGS += -DEBUG
|
||||
ifdef BUILD_PROFILE
|
||||
OPTIMIZER += -Gh+
|
||||
OBJDIR_TAG = _PRF
|
||||
else
|
||||
OPTIMIZER += -DDEBUG
|
||||
ifdef BUILD_MEMDBG
|
||||
OPTIMIZER += -Tm+ -DXP_OS2_MEMDEBUG=1
|
||||
OBJDIR_TAG = _MEM
|
||||
endif
|
||||
endif
|
||||
else
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
OPTIMIZER = -Od -Z7
|
||||
JAVA_OPTIMIZER = $(OPTIMIZER)
|
||||
XLFLAGS += -DEBUG
|
||||
else
|
||||
DEFINES = -DDEBUG -UNDEBUG -DDEBUG_$(shell $(WHOAMI)) -DTRACING
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef BUILD_OPT
|
||||
OBJDIR_TAG = _OPT
|
||||
XBCFLAGS =
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
OPTIMIZER = -O+ -Oi -DNDEBUG
|
||||
else
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
OPTIMIZER = -O2
|
||||
else
|
||||
OPTIMIZER = -O
|
||||
DEFINES = -UDEBUG -DNDEBUG -DTRIMMED
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# XXX For now, we're including $(DEPTH)/include directly instead of
|
||||
# getting this stuff from dist. This stuff is old and will eventually
|
||||
# be put in the library directories where it belongs so that it can
|
||||
# get exported to dist properly.
|
||||
#
|
||||
INCLUDES = $(LOCAL_PREINCLUDES) $(MODULE_PREINCLUDES) -I$(DEPTH)/include $(LOCAL_INCLUDES) $(OS_INCLUDES)
|
||||
|
||||
LIBNT = $(DIST)/lib/libnt.$(LIB_SUFFIX)
|
||||
LIBAWT = $(DIST)/lib/libawt.$(LIB_SUFFIX)
|
||||
LIBMMEDIA = $(DIST)/lib/libmmedia.$(LIB_SUFFIX)
|
||||
|
||||
#
|
||||
# NSPR 2.0 is now the default, "setenv NSPR10 1" to go back to 1.0
|
||||
#
|
||||
ifndef NSPR10
|
||||
NSPR20 = 1
|
||||
NSPRDIR = nsprpub
|
||||
DEFINES += -DNSPR20
|
||||
INCLUDES += -I$(DIST)/include
|
||||
LIBNSPR = $(DIST)/lib/libplds21.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libmsgc21.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libnspr21.$(LIB_SUFFIX)
|
||||
PURELIBNSPR = $(DIST)/lib/purelibplds21.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/purelibmsgc21.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/purelibnspr21.$(LIB_SUFFIX)
|
||||
else
|
||||
NSPRDIR = nspr
|
||||
LIBNSPR = $(DIST)/lib/libnspr.$(LIB_SUFFIX)
|
||||
PURELIBNSPR = $(DIST)/lib/libpurenspr.$(LIB_SUFFIX)
|
||||
endif
|
||||
|
||||
ifdef DBMALLOC
|
||||
LIBNSPR += $(DIST)/lib/libdbmalloc.$(LIB_SUFFIX)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
LIBNSJAVA = $(DIST)/lib/jrt$(MOZ_BITS)$(VERSION_NUMBER).$(LIB_SUFFIX)
|
||||
LIBMD = $(DIST)/lib/libjmd.$(LIB_SUFFIX)
|
||||
LIBJAVA = $(DIST)/lib/libjrt.$(LIB_SUFFIX)
|
||||
LIBNSPR = $(DIST)/lib/pr$(MOZ_BITS)$(VERSION_NUMBER).$(LIB_SUFFIX)
|
||||
LIBXP = $(DIST)/lib/libxp.$(LIB_SUFFIX)
|
||||
else
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
LIBNSJAVA = $(DIST)/lib/jrt3221.$(LIB_SUFFIX)
|
||||
else
|
||||
LIBNSJAVA = $(DIST)/lib/nsjava32.$(LIB_SUFFIX)
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS = $(XP_DEFINE) $(OPTIMIZER) $(OS_CFLAGS) $(MDUPDATE_FLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS) $(PROF_FLAGS)
|
||||
NOMD_CFLAGS = $(XP_DEFINE) $(OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS)
|
||||
|
||||
#
|
||||
# Include the binary distrib stuff, if necessary.
|
||||
#
|
||||
ifdef NS_BUILD_CORE
|
||||
include $(DEPTH)/config/coreconf.mk
|
||||
endif
|
||||
|
||||
#
|
||||
# Now include the platform-specific stuff.
|
||||
#
|
||||
include $(DEPTH)/config/$(OS_ARCH).mk
|
||||
|
||||
#
|
||||
# Some platforms (Solaris) might require builds using either
|
||||
# (or both) compiler(s).
|
||||
#
|
||||
ifdef SHOW_CC_TYPE
|
||||
COMPILER = _$(notdir $(CC))
|
||||
endif
|
||||
|
||||
#
|
||||
# Name of the binary code directories
|
||||
#
|
||||
ifeq ($(OS_ARCH)_$(PROCESSOR_ARCHITECTURE),WINNT_x86)
|
||||
OBJDIR_NAME = $(OS_CONFIG)$(OS_VERSION)$(OBJDIR_TAG).OBJ
|
||||
else
|
||||
OBJDIR_NAME = $(OS_CONFIG)$(OS_VERSION)$(PROCESSOR_ARCHITECTURE)$(COMPILER)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
|
||||
endif
|
||||
|
||||
# Figure out where the binary code lives. It either lives in the src
|
||||
# tree (NSBUILDROOT is undefined) or somewhere else.
|
||||
ifdef NSBUILDROOT
|
||||
BUILD = $(NSBUILDROOT)/$(OBJDIR_NAME)/build
|
||||
OBJDIR = $(BUILD)/$(SRCDIR)
|
||||
XPDIST = $(NSBUILDROOT)
|
||||
DIST = $(NSBUILDROOT)/$(OBJDIR_NAME)/dist
|
||||
else
|
||||
BUILD = $(OBJDIR_NAME)
|
||||
OBJDIR = $(OBJDIR_NAME)
|
||||
XPDIST = $(DEPTH)/dist
|
||||
DIST = $(DEPTH)/dist/$(OBJDIR_NAME)
|
||||
endif
|
||||
|
||||
# all public include files go in subdirectories of PUBLIC:
|
||||
PUBLIC = $(XPDIST)/public
|
||||
|
||||
VPATH = $(OBJDIR)
|
||||
DEPENDENCIES = $(OBJDIR)/.md
|
||||
|
||||
ifneq ($(OS_ARCH),WINNT)
|
||||
MKDEPEND_DIR = $(DEPTH)/config/mkdepend
|
||||
MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend
|
||||
MKDEPENDENCIES = $(OBJDIR)/depend.mk
|
||||
endif
|
||||
|
||||
#
|
||||
# Include any personal overrides the user might think are needed.
|
||||
#
|
||||
-include $(MY_CONFIG)
|
||||
|
||||
######################################################################
|
||||
# Now test variables that might have been set or overridden by $(MY_CONFIG).
|
||||
|
||||
DEFINES += -DNETSCAPE -DOSTYPE=\"$(OS_CONFIG)\"
|
||||
|
||||
# Specify that we are building a client.
|
||||
# This will instruct the cross platform libraries to
|
||||
# include all the client specific cruft.
|
||||
ifdef SERVER_BUILD
|
||||
DEFINES += -DSERVER_BUILD
|
||||
ifdef LIVEWIRE
|
||||
DEFINES += -DLIVEWIRE
|
||||
endif
|
||||
STATIC_JAVA = yes
|
||||
else
|
||||
MOZILLA_CLIENT = 1
|
||||
DEFINES += -DMOZILLA_CLIENT
|
||||
endif
|
||||
|
||||
ifdef MOZ_LITE
|
||||
NO_EDITOR = 1
|
||||
NO_UNIX_LDAP = 1
|
||||
MOZ_JSD = 1
|
||||
MOZ_NAV_BUILD_PREFIX = 1
|
||||
endif
|
||||
ifdef MOZ_MEDIUM
|
||||
DEFINES += -DEDITOR -DMOZ_COMMUNICATOR_IIDS
|
||||
EDITOR = 1
|
||||
MOZ_JSD = 1
|
||||
MOZ_COMMUNICATOR_IIDS = 1
|
||||
MOZ_COMMUNICATOR_CONFIG_JS = 1
|
||||
MOZ_COPY_ALL_JARS = 1
|
||||
NO_SECURITY = 1
|
||||
endif
|
||||
ifdef MOZ_GOLD
|
||||
DEFINES += -DGOLD
|
||||
BUILD_GOLD = 1
|
||||
endif
|
||||
|
||||
ifdef NO_SECURITY
|
||||
DEFINES += -DNO_SECURITY
|
||||
endif
|
||||
|
||||
ifdef EDITOR
|
||||
DEFINES += -DEDITOR -DEDITOR_UI
|
||||
BUILD_EDITOR = 1
|
||||
BUILD_EDITOR_UI = 1
|
||||
BUILD_EDT = 1
|
||||
endif
|
||||
|
||||
# Build layers by default
|
||||
ifndef NO_LAYERS
|
||||
DEFINES += -DLAYERS
|
||||
endif
|
||||
|
||||
ifdef BUILD_DEBUG_GC
|
||||
DEFINES += -DDEBUG_GC
|
||||
endif
|
||||
|
||||
ifdef BUILD_UNIX_PLUGINS
|
||||
# UNIX_EMBED Should not be needed. For now these two defines go
|
||||
# together until I talk with jg. --dp
|
||||
DEFINES += -DUNIX_EMBED -DX_PLUGINS
|
||||
endif
|
||||
|
||||
ifndef NO_UNIX_LDAP
|
||||
DEFINES += -DUNIX_LDAP
|
||||
endif
|
||||
|
||||
#
|
||||
# Platform dependent switching off of NSPR, JAVA and MOCHA
|
||||
#
|
||||
ifndef NO_NSPR
|
||||
DEFINES += -DNSPR
|
||||
endif
|
||||
|
||||
ifdef MOZ_JAVA
|
||||
DEFINES += -DJAVA
|
||||
endif
|
||||
|
||||
ifndef NO_MOCHA
|
||||
DEFINES += -DMOCHA
|
||||
endif
|
||||
|
||||
ifdef FORTEZZA
|
||||
DEFINES += -DFORTEZZA
|
||||
endif
|
||||
|
||||
ifdef UNIX_SKIP_ASSERTS
|
||||
DEFINES += -DUNIX_SKIP_ASSERTS
|
||||
endif
|
||||
|
||||
ifdef SHACK
|
||||
DEFINES += -DSHACK
|
||||
endif
|
||||
|
||||
ifndef NO_UNIX_ASYNC_DNS
|
||||
DEFINES += -DUNIX_ASYNC_DNS
|
||||
endif
|
||||
|
||||
# For profiling
|
||||
ifdef MOZILLA_GPROF
|
||||
# Don't want profiling on build tools..
|
||||
ifneq ($(SRCDIR),config)
|
||||
PROF_FLAGS = $(OS_GPROF_FLAGS) -DMOZILLA_GPROF
|
||||
endif
|
||||
endif
|
||||
|
||||
# This compiles in heap dumping utilities and other good stuff
|
||||
# for developers -- maybe we only want it in for a special SDK
|
||||
# nspr/java runtime(?):
|
||||
DEFINES += -DDEVELOPER_DEBUG
|
||||
|
||||
#
|
||||
# For the standalone image lib
|
||||
#
|
||||
|
||||
ifdef STANDALONE_IMAGE_LIB
|
||||
DEFINES += -DSTANDALONE_IMAGE_LIB
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
|
||||
GARBAGE = $(DEPENDENCIES) core $(wildcard core.[0-9]*)
|
||||
|
||||
ifndef SDK
|
||||
SDK = $(DEPTH)/dist/sdk
|
||||
endif
|
||||
|
||||
ifneq ($(OS_ARCH),WINNT)
|
||||
NSINSTALL = $(DEPTH)/config/$(OBJDIR_NAME)/nsinstall
|
||||
|
||||
ifeq ($(NSDISTMODE),copy)
|
||||
# copy files, but preserve source mtime
|
||||
INSTALL = $(NSINSTALL) -t
|
||||
else
|
||||
ifeq ($(NSDISTMODE),absolute_symlink)
|
||||
# install using absolute symbolic links
|
||||
INSTALL = $(NSINSTALL) -L `$(NFSPWD)`
|
||||
else
|
||||
# install using relative symbolic links
|
||||
INSTALL = $(NSINSTALL) -R
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
### Java Stuff - see common.mk
|
||||
######################################################################
|
||||
|
||||
# where the bytecode will go
|
||||
JAVA_DESTPATH = $(XPDIST)/classes
|
||||
|
||||
# where the sources for the module you are compiling are
|
||||
# default is sun-java/classsrc, override for other modules
|
||||
ifndef JAVA_SOURCEPATH
|
||||
JAVA_SOURCEPATH = $(DEPTH)/sun-java/classsrc
|
||||
endif
|
||||
|
||||
ifndef JAVAH_IN_JAVA
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
JAVAH_PROG = flipper $(DIST)/bin/javah
|
||||
else
|
||||
JAVAH_PROG = $(DIST)/bin/javah
|
||||
endif
|
||||
else
|
||||
JAVAH_PROG = $(JAVA) netscape.tools.jric.Main
|
||||
endif
|
||||
|
||||
ifeq ($(STAND_ALONE_JAVA),1)
|
||||
STAND_ALONE_JAVA_DLL_SUFFIX = s
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
AWTDLL = awt$(MOZ_BITS)$(VERSION_NUMBER).$(DLL_SUFFIX)
|
||||
AWTSDLL = awt$(MOZ_BITS)$(VERSION_NUMBER)$(STAND_ALONE_JAVA_DLL_SUFFIX).$(DLL_SUFFIX)
|
||||
CONDLL = con.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
|
||||
JBNDLL = jbn.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
|
||||
JDBCDLL = jdb.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
|
||||
JITDLL = jit.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
|
||||
JPWDLL = jpw.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
|
||||
JRTDLL = jrt$(MOZ_BITS)$(VERSION_NUMBER).$(DLL_SUFFIX)
|
||||
JSJDLL = jsj.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
|
||||
MMDLL = mm$(MOZ_BITS)$(VERSION_NUMBER).$(DLL_SUFFIX)
|
||||
NETDLL = net.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
|
||||
NSCDLL = nsc.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
|
||||
ZIPDLL = zip.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
|
||||
ZPWDLL = zpw.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
|
||||
else
|
||||
AWTDLL = libawt.$(DLL_SUFFIX)
|
||||
AWTSDLL = libawt$(STAND_ALONE_JAVA_DLL_SUFFIX).$(DLL_SUFFIX)
|
||||
CONDLL = libcon.$(DLL_SUFFIX)
|
||||
JBNDLL = libjbn.$(DLL_SUFFIX)
|
||||
JDBCDLL = libjdb.$(DLL_SUFFIX)
|
||||
JITDLL = libjit.$(DLL_SUFFIX)
|
||||
JPWDLL = libjpw.$(DLL_SUFFIX)
|
||||
JRTDLL = libjrt.$(DLL_SUFFIX)
|
||||
JSJDLL = libjsj.$(DLL_SUFFIX)
|
||||
MMDLL = libmm.$(DLL_SUFFIX)
|
||||
NETDLL = libnet.$(DLL_SUFFIX)
|
||||
NSCDLL = libnsc.$(DLL_SUFFIX)
|
||||
ZIPDLL = libzip.$(DLL_SUFFIX)
|
||||
ZPWDLL = libzpw.$(DLL_SUFFIX)
|
||||
endif
|
||||
|
||||
JAVA_DEFINES += -DAWTSDLL=\"$(AWTSDLL)\" -DCONDLL=\"$(CONDLL)\" -DJBNDLL=\"$(JBNDLL)\" -DJDBDLL=\"$(JDBDLL)\" \
|
||||
-DJSJDLL=\"$(JSJDLL)\" -DNETDLL=\"$(NETDLL)\" -DNSCDLL=\"$(NSCDLL)\" -DZPWDLL=\"$(ZPWDLL)\"
|
||||
|
||||
44
mozilla/config/coreconf.mk
Normal file
44
mozilla/config/coreconf.mk
Normal file
@@ -0,0 +1,44 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# coreconf.mk
|
||||
#
|
||||
# Defines the macro definitions for the modules that do binary
|
||||
# distributions into /m/dist.
|
||||
#
|
||||
|
||||
#
|
||||
# Are we building the client?
|
||||
#
|
||||
ifndef SERVER_BUILD
|
||||
ifeq ($(OS_ARCH),SunOS)
|
||||
IMPL_STRATEGY = _LOCAL
|
||||
else
|
||||
IMPL_STRATEGY = _CLASSIC
|
||||
else
|
||||
|
||||
ifeq ($(PTHREADS_USER),1)
|
||||
USE_PTHREADS =
|
||||
IMPL_STRATEGY = _PTH_USER
|
||||
endif
|
||||
|
||||
ifeq ($(USE_PTHREADS),1)
|
||||
IMPL_STRATEGY = _PTH
|
||||
endif
|
||||
|
||||
endif
|
||||
25
mozilla/config/cvsco.pl
Executable file
25
mozilla/config/cvsco.pl
Executable file
@@ -0,0 +1,25 @@
|
||||
#!perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
chdir($ENV{'MOZ_SRC'});
|
||||
|
||||
$cmd = "cvs -q co ".$ARGV[0]." ".$ARGV[1];
|
||||
|
||||
print "Excecuting ".$cmd."...\n";
|
||||
system($cmd);
|
||||
|
||||
90
mozilla/config/dll.inc
Normal file
90
mozilla/config/dll.inc
Normal file
@@ -0,0 +1,90 @@
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
!if !defined(VERBOSE)
|
||||
.SILENT:
|
||||
!endif
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// This makefile contains all of the rules necessary to build 16 and 32 bit
|
||||
#// DLLs.
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!if defined(DLL) && !defined(CONFIG_DLL_INC)
|
||||
CONFIG_DLL_INC=1
|
||||
|
||||
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule to build a 16-bit DLL using the DLL target
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
$(DLL): $(OBJDIR) $(OBJS) $(RESFILE) $(DEFFILE) $(MISCDEP)
|
||||
echo +++ make: Creating DLL: $@
|
||||
# //
|
||||
# // create response file for the command. The format is:
|
||||
# // Object files, Output file, Map file, Libraries, DEF file, RES file
|
||||
# //
|
||||
echo $(LFLAGS) > $(CFGFILE)
|
||||
echo /implib:$*.lib >> $(CFGFILE)
|
||||
for %%d in ($(OBJS)) do echo %%d + >> $(CFGFILE)
|
||||
echo. >> $(CFGFILE)
|
||||
echo $(OBJDIR)\$(*B).dll, >> $(CFGFILE)
|
||||
!ifdef MAPFILE
|
||||
echo $(MAPFILE), >> $(CFGFILE)
|
||||
!endif
|
||||
echo $(LLIBS) $(OS_LIBS) >> $(CFGFILE)
|
||||
!ifdef DEFFILE
|
||||
echo $(DEFFILE), >> $(CFGFILE)
|
||||
!else
|
||||
echo. >> $(CFGFILE)
|
||||
!endif
|
||||
!ifdef RESFILE
|
||||
echo $(RESFILE), >> $(CFGFILE)
|
||||
!else
|
||||
echo. >> $(CFGFILE)
|
||||
!endif
|
||||
# //
|
||||
# // execute the commands
|
||||
# //
|
||||
$(LD) @$(CFGFILE)
|
||||
|
||||
!else
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule to build a 32-bit DLL using the DLL target
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
$(DLL): $(OBJDIR) $(OBJS) $(RESFILE) $(DEFFILE) $(MISCDEP)
|
||||
echo +++ make: Creating DLL: $@
|
||||
$(LD) @<<$(CFGFILE)
|
||||
/NOLOGO /DLL /OUT:$@
|
||||
/PDB:$(PDBFILE)
|
||||
!ifdef DEFFILE
|
||||
/DEF:$(DEFFILE)
|
||||
!endif
|
||||
!ifdef MAPFILE
|
||||
/MAP:$(MAPFILE)
|
||||
!endif
|
||||
|
||||
$(LFLAGS)
|
||||
$(OBJS)
|
||||
$(RESFILE)
|
||||
$(LLIBS) $(OS_LIBS)
|
||||
<<KEEP
|
||||
!endif
|
||||
|
||||
!endif # DLL && ! CONFIG_DLL_INC
|
||||
87
mozilla/config/exe.inc
Normal file
87
mozilla/config/exe.inc
Normal file
@@ -0,0 +1,87 @@
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
!if !defined(VERBOSE)
|
||||
.SILENT:
|
||||
!endif
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// This makefile contains all of the rules necessary to build 16 and 32 bit
|
||||
#// executables.
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!if defined(PROGRAM) && !defined(CONFIG_EXE_INC)
|
||||
CONFIG_EXE_INC=1
|
||||
|
||||
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule to build a 16-bit executable using the PROGRAM target
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
$(PROGRAM):: $(OBJDIR) $(OBJS) $(RESFILE) $(DEFFILE) $(MISCDEP)
|
||||
echo +++ make: Creating EXE: $@
|
||||
# //
|
||||
# // create response file for the command. The format is:
|
||||
# // Object files, Output file, Map file, Libraries, DEF file, RES file
|
||||
# //
|
||||
echo $(LFLAGS) > $(CFGFILE)
|
||||
for %%d in ($(OBJS)) do echo %%d + >> $(CFGFILE)
|
||||
echo. >> $(CFGFILE)
|
||||
echo $(OBJDIR)\$(*B).exe, >> $(CFGFILE)
|
||||
echo $(MAPFILE), >> $(CFGFILE)
|
||||
echo $(LLIBS) $(OS_LIBS) >> $(CFGFILE)
|
||||
!ifdef DEFFILE
|
||||
echo $(DEFFILE), >> $(CFGFILE)
|
||||
!else
|
||||
echo. >> $(CFGFILE)
|
||||
!endif
|
||||
!ifdef RESFILE
|
||||
echo $(RESFILE), >> $(CFGFILE)
|
||||
!else
|
||||
echo. >> $(CFGFILE)
|
||||
!endif
|
||||
# //
|
||||
# // execute the command
|
||||
# //
|
||||
$(LD) /ST:8192 @$(CFGFILE)
|
||||
|
||||
!else
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule to build a 32-bit executable using the PROGRAM target
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
$(PROGRAM):: $(OBJDIR) $(OBJS) $(RESFILE) $(DEFFILE) $(MISCDEP)
|
||||
echo +++ make: Creating EXE: $@
|
||||
$(LD) @<<$(CFGFILE)
|
||||
/NOLOGO /OUT:$@
|
||||
/PDB:$(PDBFILE)
|
||||
!ifdef DEFFILE
|
||||
/DEF:$(DEFFILE)
|
||||
!endif
|
||||
!ifdef MAPFILE
|
||||
/MAP:$(MAPFILE)
|
||||
!endif
|
||||
|
||||
$(LFLAGS)
|
||||
$(OBJS)
|
||||
$(RESFILE)
|
||||
$(LLIBS) $(OS_LIBS)
|
||||
<<
|
||||
!endif
|
||||
|
||||
!endif # PROGRAM && ! CONFIG_EXE_INC
|
||||
53
mozilla/config/fastcwd.pl
Normal file
53
mozilla/config/fastcwd.pl
Normal file
@@ -0,0 +1,53 @@
|
||||
#!perl5
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
# By John Bazik
|
||||
#
|
||||
# Usage: $cwd = &fastcwd;
|
||||
#
|
||||
# This is a faster version of getcwd. It's also more dangerous because
|
||||
# you might chdir out of a directory that you can't chdir back into.
|
||||
#
|
||||
|
||||
sub fastcwd {
|
||||
local($odev, $oino, $cdev, $cino, $tdev, $tino);
|
||||
local(@path, $path);
|
||||
local(*DIR);
|
||||
|
||||
($cdev, $cino) = stat('.');
|
||||
for (;;) {
|
||||
($odev, $oino) = ($cdev, $cino);
|
||||
chdir('..');
|
||||
($cdev, $cino) = stat('.');
|
||||
last if $odev == $cdev && $oino == $cino;
|
||||
opendir(DIR, '.');
|
||||
for (;;) {
|
||||
$_ = readdir(DIR);
|
||||
next if $_ eq '.';
|
||||
next if $_ eq '..';
|
||||
|
||||
last unless $_;
|
||||
($tdev, $tino) = lstat($_);
|
||||
last unless $tdev != $odev || $tino != $oino;
|
||||
}
|
||||
closedir(DIR);
|
||||
unshift(@path, $_);
|
||||
}
|
||||
chdir($path = '/' . join('/', @path));
|
||||
$path;
|
||||
}
|
||||
1;
|
||||
2790
mozilla/config/gtscc.c
Normal file
2790
mozilla/config/gtscc.c
Normal file
File diff suppressed because it is too large
Load Diff
20
mozilla/config/install.bat
Normal file
20
mozilla/config/install.bat
Normal file
@@ -0,0 +1,20 @@
|
||||
@echo off
|
||||
rem The contents of this file are subject to the Netscape Public License
|
||||
rem Version 1.0 (the "NPL"); you may not use this file except in
|
||||
rem compliance with the NPL. You may obtain a copy of the NPL at
|
||||
rem http://www.mozilla.org/NPL/
|
||||
rem
|
||||
rem Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
rem WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
rem for the specific language governing rights and limitations under the
|
||||
rem NPL.
|
||||
rem
|
||||
rem The Initial Developer of this code under the NPL is Netscape
|
||||
rem Communications Corporation. Portions created by Netscape are
|
||||
rem Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
rem Reserved.
|
||||
@echo on
|
||||
|
||||
@if not exist %2\nul mkdir %2
|
||||
@rm -f %2\%1
|
||||
@cp %1 %2
|
||||
201
mozilla/config/java.inc
Normal file
201
mozilla/config/java.inc
Normal file
@@ -0,0 +1,201 @@
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
!if !defined(VERBOSE)
|
||||
.SILENT:
|
||||
!endif
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// This makefile contains all of the rules necessary to build Java Header
|
||||
#// and Stub files
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!if !defined(CONFIG_JAVA_INC)
|
||||
CONFIG_JAVA_INC=1
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Setup to generate Mac java headers (checkout ns/lib/mac/Java
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!ifdef MOZ_GENMAC
|
||||
MAC_JAVA_HEADERS_DIR = $(DEPTH)/lib/mac/Java
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Figure out how to do the pull.
|
||||
#//------------------------------------------------------------------------
|
||||
!if "$(MOZ_BRANCH)" != ""
|
||||
CVS_BRANCH=-r $(MOZ_BRANCH)
|
||||
HAVE_BRANCH=1
|
||||
!else
|
||||
HAVE_BRANCH=0
|
||||
!endif
|
||||
|
||||
!if "$(MOZ_TIP)" != ""
|
||||
CVS_BRANCH=-A
|
||||
!endif
|
||||
|
||||
|
||||
!if "$(MOZ_DATE)" != ""
|
||||
CVS_BRANCH=-D "$(MOZ_DATE)"
|
||||
HAVE_DATE=1
|
||||
!else
|
||||
HAVE_DATE=0
|
||||
!endif
|
||||
|
||||
!if $(HAVE_DATE) && $(HAVE_BRANCH)
|
||||
ERR_MESSAGE=$(ERR_MESSAGE)^
|
||||
Cannot specify both MOZ_BRANCH and MOZ_DATE
|
||||
!endif
|
||||
|
||||
$(MAC_JAVA_HEADERS_DIR):
|
||||
@echo +++ Checking out $(MAC_JAVA_HEADERS_DIR) +++
|
||||
$(PERL) $(DEPTH)/config/cvsco.pl $(CVS_BRANCH) ns/lib/mac/Java
|
||||
@echo +++ Done Checking out $(MAC_JAVA_HEADERS_DIR) +++
|
||||
!endif
|
||||
|
||||
!ifdef JDK_GEN
|
||||
!ifdef MOZ_JAVA
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule to generate Java header files using javah.
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
$(JDK_GEN):: display_java_header_msg
|
||||
!$(JAVAH) -d _gen $@
|
||||
|
||||
!ifdef NSBUILDROOT
|
||||
LINCS = $(LINCS) -I$(JDK_GEN_DIR) -I$(XPDIST)
|
||||
!else
|
||||
LINCS = $(LINCS) -I$(JDK_GEN_DIR)
|
||||
!endif
|
||||
|
||||
display_java_header_msg:
|
||||
echo +++ make: Generating java header files...
|
||||
|
||||
!ifdef MOZ_GENMAC
|
||||
$(JDK_GEN)::display_java_header_msg_mac $(MAC_JAVA_HEADERS_DIR)
|
||||
echo +++ make: creating JDK header for $@
|
||||
!$(JAVAH) -mac -d $(MAC_JAVA_HEADERS_DIR)/_gen $@
|
||||
|
||||
display_java_header_msg_mac:
|
||||
echo +++ make: Generating Macintosh JDK header files +++
|
||||
!endif
|
||||
!endif # MOZ_JAVA
|
||||
!endif
|
||||
|
||||
|
||||
!ifdef JDK_GEN
|
||||
!ifdef MOZ_JAVA
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rules to generate Java stub files using javah.
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
$(JDK_GEN)::display_java_stub_msg
|
||||
!$(JAVAH) -stubs -d _stubs $@
|
||||
|
||||
display_java_stub_msg:
|
||||
echo +++ make: Generating java stub files...
|
||||
|
||||
!ifdef MOZ_GENMAC
|
||||
$(JDK_GEN)::display_java_stub_msg_mac $(MAC_JAVA_HEADERS_DIR)
|
||||
echo +++ make: creating JDK stub for $@
|
||||
!$(JAVAH) -mac -stubs -d $(MAC_JAVA_HEADERS_DIR)/_stubs $@
|
||||
|
||||
display_java_stub_msg_mac:
|
||||
echo +++ make: Generating Macintosh JDK stub files +++
|
||||
!endif
|
||||
|
||||
export:: $(JDK_GEN)
|
||||
|
||||
!endif # MOZ_JAVA
|
||||
!endif
|
||||
|
||||
!ifdef JAVA_LIBSTUB_FILES
|
||||
!ifdef MOZ_JAVA
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rules to generate libstubs.c using javah.
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
libstubs.c::$(JAVA_LIBSTUB_FILES)
|
||||
echo +++ make: Generating libstubs.c...
|
||||
$(JAVAH) -o libstubs.c -stubs $**
|
||||
|
||||
stubs$(MOZ_BITS).c::$(JAVA_LIBSTUB_FILES)
|
||||
echo +++ make: Generating stubs$(MOZ_BITS).c...
|
||||
$(JAVAH) -o stubs$(MOZ_BITS).c -stubs $**
|
||||
|
||||
!endif # MOZ_JAVA
|
||||
!endif
|
||||
|
||||
!ifdef JRI_GEN
|
||||
!ifdef MOZ_JAVA
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule to generate JRI header files using javah.
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
$(JRI_GEN):: display_jri_header_msg
|
||||
!$(JAVAH) -jri -d _jri $@
|
||||
|
||||
!ifdef NSBUILDROOT
|
||||
LINCS = $(LINCS) -I$(JRI_GEN_DIR) -I$(XPDIST)
|
||||
!else
|
||||
LINCS = $(LINCS) -I$(JRI_GEN_DIR)
|
||||
!endif
|
||||
|
||||
display_jri_header_msg:
|
||||
echo +++ make: Generating JRI header files...
|
||||
|
||||
!ifdef MOZ_GENMAC
|
||||
$(JRI_GEN)::display_jri_header_msg_mac $(MAC_JAVA_HEADERS_DIR)
|
||||
echo +++ make: creating JRI header for $@
|
||||
!$(JAVAH) -mac -jri -d $(MAC_JAVA_HEADERS_DIR)/_jri $@
|
||||
|
||||
display_jri_header_msg_mac:
|
||||
echo +++ make: Generating Macintosh java JRI header files +++
|
||||
!endif
|
||||
!endif # MOZ_JAVA
|
||||
!endif
|
||||
|
||||
!ifdef JRI_GEN
|
||||
!ifdef MOZ_JAVA
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rules to generate JRI stub files using javah.
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
$(JRI_GEN)::display_jri_stub_msg
|
||||
!$(JAVAH) -stubs -jri -d _jri $@
|
||||
|
||||
display_jri_stub_msg:
|
||||
echo +++ make: Generating JRI stub files...
|
||||
|
||||
!ifdef MOZ_GENMAC
|
||||
$(JRI_GEN)::display_jri_stub_msg_mac $(MAC_JAVA_HEADERS_DIR)
|
||||
echo +++ make: creating JRI stub for $@
|
||||
!$(JAVAH) -mac -jri -stubs -d $(MAC_JAVA_HEADERS_DIR)/_jri $@
|
||||
|
||||
display_jri_stub_msg_mac:
|
||||
echo +++ make: Generating Macintosh java JRI stub files +++
|
||||
!endif
|
||||
|
||||
export:: $(JRI_GEN)
|
||||
|
||||
!endif # MOZ_JAVA
|
||||
!endif
|
||||
|
||||
!endif # CONFIG_JAVA_INC
|
||||
67
mozilla/config/lib.inc
Normal file
67
mozilla/config/lib.inc
Normal file
@@ -0,0 +1,67 @@
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
!if !defined(VERBOSE)
|
||||
.SILENT:
|
||||
!endif
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// This makefile contains all of the rules necessary to build 16 and 32 bit
|
||||
#// libraries.
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!if defined(LIBRARY) && !defined(CONFIG_LIB_INC)
|
||||
CONFIG_LIB_INC=1
|
||||
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule to build a 16-bit Library
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
$(LIBRARY):: $(OBJDIR) $(OBJS)
|
||||
# //
|
||||
# // create response file for the command. The format is:
|
||||
# // LIBNAME, -+foo.obj -+bar.obj , LISTFILE, NEWLIB
|
||||
# //
|
||||
rm -f $(CFGFILE)
|
||||
!if "$(OS)" == "Windows_NT"
|
||||
for %%d in ($(OBJS)) do echo -+%%d ^& >> $(CFGFILE)
|
||||
!else
|
||||
for %%d in ($(OBJS)) do echo -+%%d & >> $(CFGFILE)
|
||||
!endif
|
||||
echo * >> $(CFGFILE)
|
||||
# //
|
||||
# // execute the commands
|
||||
# //
|
||||
$(RM) $@
|
||||
$(AR) $@ @$(CFGFILE)
|
||||
$(RANLIB) $@
|
||||
!else
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule to build a 32-bit Library
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
$(LIBRARY):: $(OBJDIR) $(OBJS)
|
||||
$(RM) $@ 2> NUL
|
||||
$(AR) @<<$(CFGFILE)
|
||||
-NOLOGO -OUT:$@
|
||||
$(OBJS)
|
||||
<<
|
||||
$(RANLIB) $@
|
||||
!endif
|
||||
|
||||
!endif # LIBRARY && ! CONFIG_LIB_INC
|
||||
154
mozilla/config/liteness.mak
Normal file
154
mozilla/config/liteness.mak
Normal file
@@ -0,0 +1,154 @@
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
################################################################################
|
||||
#
|
||||
# MOZ_LITE and MOZ_MEDIUM stuff
|
||||
#
|
||||
# Does two things 1) Sets environment variables for use by other build scripts.
|
||||
# 2) Sets MOZ_LITENESS_FLAGS to be appended to the command lines
|
||||
# for calling the compilers/tools, CFLAGS, RCFLAGS, etc.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
|
||||
# Under the new system for MOZ_LITE, MOZ_MEDIUM. There should be no references to
|
||||
# MOZ_LITE or MOZ_MEDIUM in the code, either as an #ifdef, or as some other conditional
|
||||
# if in the build scripts. Instead, all #ifdefs, !if, etc. should be based on the
|
||||
# module-specific tag. E.g. #ifdef MOZ_MAIL_NEWS, #ifdef MOZ_LDAP, etc.
|
||||
# The reason for this is that we can decide what goes into the LITE and MEDIUM
|
||||
# builds by just tweaking this file (and the appropriate file for MAC and UNIX).
|
||||
#
|
||||
# Originally, I planned on defining MOZ_MEDIUM as being the same as MOZ_LITE + EDITOR,
|
||||
# but there were still many cases in the code and build scripts where I would have had
|
||||
# to do something ugly like "#if !defined(MOZ_LITE) || defined(MOZ_MEDIUM)". This
|
||||
# would be very error prone and difficult to maintain. I believe defining and
|
||||
# using a bunch of new symbols reduces the total amount of pain in both the short and
|
||||
# long term.
|
||||
#
|
||||
# IMPORTANT!! The method of running a build has not changed. You define
|
||||
# MOZ_LITE or MOZ_MEDIUM (not both) in your environment, and start the build.
|
||||
# You do not have to define the symbols for every module. E.g. you should never
|
||||
# have to define EDITOR, or MOZ_MAIL_NEWS in your environment. The build scripts
|
||||
# will do this for you, via the file you are looking at right now.
|
||||
|
||||
|
||||
|
||||
### Here is the list of all possible modules under control of MOZ_LITE/MOZ_MEDIUM,
|
||||
### Some only affect the build scripts, so are only set as environment variables, and
|
||||
### not added to MOZ_LITENESS_FLAGS
|
||||
#
|
||||
# MOZ_MAIL_NEWS
|
||||
# Enables mail and news.
|
||||
#
|
||||
# EDITOR
|
||||
# Enables the editor
|
||||
#
|
||||
# MOZ_OFFLINE
|
||||
# Enables go offline/go online
|
||||
#
|
||||
# MOZ_LOC_INDEP
|
||||
# Location independence
|
||||
#
|
||||
# MOZ_TASKBAR
|
||||
# The "taskbar" or "component bar"
|
||||
#
|
||||
# MOZ_LDAP
|
||||
# Enable LDAP, MOZ_NO_LDAP has been depreciated
|
||||
#
|
||||
# MOZ_ADMIN_LIB
|
||||
# Mission Control
|
||||
#
|
||||
# MOZ_COMMUNICATOR_NAME
|
||||
# Use "Communicator" as opposed to "Navigator" in strings,
|
||||
# Use the Communicator icon, splash screen, etc. instead of the Navigator one.
|
||||
# *** IMPORTANT *** This also controls whether the user agent string has " ;Nav"
|
||||
# appended to it. i.e. only append " ;Nav" if MOZ_COMMUNICATOR_NAME is not set.
|
||||
#
|
||||
# MOZ_JSD
|
||||
# Build JS debug code, needs to be turned off when we remove java from build.
|
||||
#
|
||||
# MOZ_IFC_TOOLS
|
||||
# Build ns/ifc/tools. Should this be the same as MOZ_JSD??
|
||||
#
|
||||
# MOZ_NETCAST
|
||||
# Build netcaster.
|
||||
#
|
||||
# MOZ_COMMUNICATOR_IIDS
|
||||
# For windows, use the COM IIDs for Communicator, as opposed to those for the
|
||||
# Navigator-only version. We must have a different set so that multiple versions can
|
||||
# be installed on the same machine. We need a more general solution to the problem of
|
||||
# multiple versions of the interface IDs.
|
||||
#
|
||||
# MOZ_COMMUNICATOR_ABOUT
|
||||
# Use the about: information from Communicator, as opposed to that for the Navigator-only
|
||||
# version. We will probably have to make another one for the source-only release.
|
||||
#
|
||||
# MOZ_NAV_BUILD_PREFIX
|
||||
# For building multiple versions with varying degree of LITEness in the same tree.
|
||||
# If true, use "Nav" as the prefix for the directory under ns/dist, else use "WIN".
|
||||
# Also, if true, build client in, say, NavDbg as oppposed to x86Dbg.
|
||||
#
|
||||
# MOZ_COMMUNICATOR_CONFIG_JS
|
||||
# Use "config.js" instead of the one specific to the Navigator-only version.
|
||||
#
|
||||
# MOZ_COPY_ALL_JARS
|
||||
# Copy all JAR files to the destination directory, else just copy the JARS appropriate for the
|
||||
# Navigator-only version.
|
||||
#
|
||||
# MOZ_SPELLCHK
|
||||
# Enable the spellchecker.
|
||||
|
||||
|
||||
### MOZ_LITE ###
|
||||
# NOTE: Doesn't need -DMOZ_LITE anymore.
|
||||
!if defined(MOZ_LITE)
|
||||
MOZ_LITENESS_FLAGS=
|
||||
MOZ_JSD=1
|
||||
MOZ_NAV_BUILD_PREFIX=1
|
||||
|
||||
|
||||
### MOZ_MEDIUM ###
|
||||
!elseif defined(MOZ_MEDIUM)
|
||||
MOZ_LITENESS_FLAGS=-DEDITOR -DMOZ_COMMUNICATOR_IIDS
|
||||
EDITOR=1
|
||||
MOZ_JSD=1
|
||||
MOZ_COMMUNICATOR_IIDS=1
|
||||
MOZ_COMMUNICATOR_CONFIG_JS=1
|
||||
MOZ_COPY_ALL_JARS=1
|
||||
|
||||
|
||||
### Full build ###
|
||||
!else
|
||||
MOZ_LITENESS_FLAGS=-DMOZ_MAIL_NEWS -DEDITOR -DMOZ_OFFLINE -DMOZ_LOC_INDEP \
|
||||
-DMOZ_TASKBAR -DMOZ_LDAP -DMOZ_ADMIN_LIB \
|
||||
-DMOZ_COMMUNICATOR_NAME -DMOZ_COMMUNICATOR_IIDS \
|
||||
-DMOZ_NETCAST -DMOZ_COMMUNICATOR_ABOUT -DMOZ_SPELLCHK
|
||||
MOZ_MAIL_NEWS=1
|
||||
EDITOR=1
|
||||
MOZ_OFFLINE=1
|
||||
MOZ_LOC_INDEP=1
|
||||
MOZ_TASKBAR=1
|
||||
MOZ_LDAP=1
|
||||
MOZ_ADMIN_LIB=1
|
||||
MOZ_COMMUNICATOR_NAME=1
|
||||
MOZ_JSD=1
|
||||
MOZ_IFC_TOOLS=1
|
||||
MOZ_NETCAST=1
|
||||
MOZ_COMMUNICATOR_IIDS=1
|
||||
MOZ_COMMUNICATOR_ABOUT=1
|
||||
MOZ_COMMUNICATOR_CONFIG_JS=1
|
||||
MOZ_COPY_ALL_JARS=1
|
||||
MOZ_SPELLCHK=1
|
||||
!endif
|
||||
50
mozilla/config/mac/ComponentConfig.h
Normal file
50
mozilla/config/mac/ComponentConfig.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
* Component_Config.h
|
||||
* ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
* This file is the Mac equivalent to ns/config/liteness.mak on Windows.
|
||||
* Set different #define's to control what components get built.
|
||||
*/
|
||||
|
||||
#if defined(MOZ_LITE) /* Nav-only */
|
||||
#define MOZ_JSD
|
||||
#define MOZ_NAV_BUILD_PREFIX
|
||||
#elif defined(MOZ_MEDIUM) /* Nav + Composer */
|
||||
#define EDITOR
|
||||
#define MOZ_JSD
|
||||
#define MOZ_COMMUNICATOR_CONFIG_JS
|
||||
#define MOZ_SPELLCHK
|
||||
#else /* The WHOLE enchilada */
|
||||
#define MOZ_MAIL_NEWS
|
||||
#define EDITOR
|
||||
#define MOZ_OFFLINE
|
||||
#define MOZ_LOC_INDEP
|
||||
#define MOZ_TASKBAR
|
||||
#define MOZ_LDAP
|
||||
#define MOZ_ADMIN_LIB
|
||||
#define MOZ_COMMUNICATOR_NAME
|
||||
#define MOZ_JSD
|
||||
#define MOZ_IFC_TOOLS
|
||||
#define MOZ_NETCAST
|
||||
#define MOZ_COMMUNICATOR_ABOUT
|
||||
#define MOZ_COMMUNICATOR_CONFIG_JS
|
||||
#define MOZ_SPELLCHK
|
||||
#endif
|
||||
59
mozilla/config/mac/DefinesMac.h
Normal file
59
mozilla/config/mac/DefinesMac.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
This is a common prefix file, included for both projects like
|
||||
NSStdLib and Mozilla.
|
||||
*/
|
||||
|
||||
/* Some build-wide Mac-related defines */
|
||||
#define macintosh /* macintosh is defined for GUSI */
|
||||
#define XP_MAC 1
|
||||
|
||||
/* We have to do this here because ConditionalMacros.h will be included from
|
||||
* within OpenTptInternet.h and will stupidly define these to 1 if they
|
||||
* have not been previously defined. The new PowerPlant (CWPro1) requires that
|
||||
* this be set to 0. (pinkerton)
|
||||
*/
|
||||
#define OLDROUTINENAMES 0
|
||||
#ifndef OLDROUTINELOCATIONS
|
||||
#define OLDROUTINELOCATIONS 0
|
||||
#endif
|
||||
|
||||
/* OpenTransport.h has changed to not include the error messages we need from
|
||||
* it unless this is defined. Why? dunnno...(pinkerton)
|
||||
*/
|
||||
#define OTUNIXERRORS 1
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DEVELOPER_DEBUG 1
|
||||
#else
|
||||
#define NDEBUG
|
||||
#endif
|
||||
|
||||
/* Some NSPR defines */
|
||||
#ifndef NSPR20
|
||||
#define NSPR20 1
|
||||
#endif
|
||||
#define _NSPR 1
|
||||
|
||||
/* Some other random defines */
|
||||
#define _NO_FAST_STRING_INLINES_ 1
|
||||
#define _PR_NO_PREEMPT 1
|
||||
///#define HAVE_BOOLEAN 1 // used by JPEG lib
|
||||
|
||||
65
mozilla/config/mac/DefinesMozilla.h
Normal file
65
mozilla/config/mac/DefinesMozilla.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
// ÑÑÑ Security
|
||||
//#define NADA_VERSION
|
||||
//#define EXPORT_VERSION
|
||||
#define US_VERSION
|
||||
|
||||
// ÑÑÑ Misc
|
||||
//#define NO_DBM // define this to kill DBM
|
||||
#define NEW_BOOKMARKS
|
||||
// Enables us to switch profiling from project preferences
|
||||
|
||||
// ÑÑÑ Version
|
||||
//#define ALPHA
|
||||
//#define BETA
|
||||
// Comment out both ALPHA and BETA for the final version
|
||||
|
||||
// ÑÑÑ Do we have an editor?
|
||||
// 98-03-10 pchen -- moved into Component_Config.h
|
||||
// #define EDITOR
|
||||
|
||||
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
// ¥ You typically will not need to change things below here
|
||||
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
|
||||
#define MOCHA
|
||||
#define MOZILLA_CLIENT
|
||||
#ifndef NETSCAPE
|
||||
#define NETSCAPE
|
||||
#endif
|
||||
|
||||
// #define JAVA 1
|
||||
|
||||
#ifdef JAVA
|
||||
#define UNICODE_FONTLIST 1
|
||||
#endif
|
||||
|
||||
#define LAYERS
|
||||
|
||||
#define CASTED_READ_OBJECT(stream, type, reference) (reference = NULL)
|
||||
|
||||
/* Defined in javaStubs prefix files
|
||||
#define VERSION_NUMBER "4_0b0"
|
||||
#define ZIP_NAME "java"##VERSION_NUMBER
|
||||
*/
|
||||
|
||||
// 97/05/05 jrm -- use phil's new search scope api
|
||||
#define B3_SEARCH_API
|
||||
|
||||
25
mozilla/config/mac/JavaDefines.h
Normal file
25
mozilla/config/mac/JavaDefines.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/* This file is included from the nav-java and sun-java projects */
|
||||
|
||||
#define MOCHAFILE 1
|
||||
#define COMPILER 0
|
||||
|
||||
#define VERSION_NUMBER "40"
|
||||
#define JAR_NAME "java"##VERSION_NUMBER##".jar"
|
||||
21
mozilla/config/mac/MacConfig.h
Normal file
21
mozilla/config/mac/MacConfig.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#define MOZ_MEDIUM
|
||||
|
||||
#define NO_SECURITY
|
||||
42
mozilla/config/mac/MacConfigInclude.h
Normal file
42
mozilla/config/mac/MacConfigInclude.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
This is included as a prefix file in all Mac projects. It ensures that
|
||||
the correct #defines are set up for this build.
|
||||
|
||||
Since this is included from C files, comments should be C-style.
|
||||
|
||||
Order below does matter.
|
||||
*/
|
||||
|
||||
/* Read compiler options */
|
||||
#include "IDE_Options.h"
|
||||
|
||||
/* Read file of defines global to the Mac build */
|
||||
#include "DefinesMac.h"
|
||||
|
||||
/* Read the configuration options (which build we are doing) */
|
||||
#include "MacConfig.h"
|
||||
|
||||
/* Read component defines */
|
||||
#include "ComponentConfig.h"
|
||||
|
||||
/* Read build-wide defines (e.g. MOZILLA_CLIENT) */
|
||||
#include "DefinesMozilla.h"
|
||||
|
||||
25
mozilla/config/mac/MacPrefix.h
Normal file
25
mozilla/config/mac/MacPrefix.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#undef DEBUG
|
||||
#undef Debug_Throw
|
||||
#undef Debug_Signal
|
||||
#undef txtnDebug
|
||||
|
||||
/* Read the common configuration file */
|
||||
#include "MacConfigInclude.h"
|
||||
25
mozilla/config/mac/MacPrefix_debug.h
Normal file
25
mozilla/config/mac/MacPrefix_debug.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#define DEBUG 1
|
||||
#define Debug_Throw
|
||||
#define Debug_Signal
|
||||
#define txtnDebug
|
||||
|
||||
/* Read the common configuration file */
|
||||
#include "MacConfigInclude.h"
|
||||
16
mozilla/config/mac/export.mac
Normal file
16
mozilla/config/mac/export.mac
Normal file
@@ -0,0 +1,16 @@
|
||||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist directory
|
||||
#
|
||||
|
||||
DefinesMac.h
|
||||
DefinesMozilla.h
|
||||
|
||||
JavaDefines.h
|
||||
|
||||
MacConfigInclude.h
|
||||
|
||||
MacPrefix.h
|
||||
MacPrefix_debug.h
|
||||
|
||||
MacConfig.h
|
||||
ComponentConfig.h
|
||||
167
mozilla/config/makecopy.c
Normal file
167
mozilla/config/makecopy.c
Normal file
@@ -0,0 +1,167 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <direct.h>
|
||||
#include <sys/stat.h>
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
static const char *prog;
|
||||
|
||||
void Usage(void)
|
||||
{
|
||||
fprintf(stderr, "makecopy: <file> <dir-path>\n");
|
||||
}
|
||||
|
||||
void FlipSlashes(char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
/*
|
||||
** Flip any "unix style slashes" into "dos style backslashes"
|
||||
*/
|
||||
for( i=0; name[i]; i++ ) {
|
||||
if( name[i] == '/' ) name[i] = '\\';
|
||||
}
|
||||
}
|
||||
|
||||
int MakeDir( char *path )
|
||||
{
|
||||
char *cp, *pstr;
|
||||
struct stat sb;
|
||||
|
||||
pstr = path;
|
||||
while( cp = strchr(pstr, '\\') ) {
|
||||
*cp = '\0';
|
||||
|
||||
if( stat(path, &sb) == 0 && (sb.st_mode & _S_IFDIR) ) {
|
||||
/* sub-directory already exists.... */
|
||||
} else {
|
||||
/* create the new sub-directory */
|
||||
printf("+++ makecopy: creating directory %s\n", path);
|
||||
if( mkdir(path) < 0 ) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
*cp = '\\';
|
||||
pstr = cp+1;
|
||||
}
|
||||
}
|
||||
|
||||
int CopyIfNecessary(char *oldFile, char *newFile)
|
||||
{
|
||||
BY_HANDLE_FILE_INFORMATION hNewInfo;
|
||||
BY_HANDLE_FILE_INFORMATION hOldInfo;
|
||||
|
||||
HANDLE hFile;
|
||||
|
||||
/* Try to open the destination file */
|
||||
if ( (hFile = CreateFile(newFile, GENERIC_READ, FILE_SHARE_WRITE, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
|
||||
NULL)) != INVALID_HANDLE_VALUE ) {
|
||||
if (GetFileInformationByHandle(hFile, &hNewInfo) == FALSE) {
|
||||
goto copy_file;
|
||||
}
|
||||
CloseHandle(hFile);
|
||||
|
||||
/* Try to open the source file */
|
||||
if ( (hFile = CreateFile(oldFile, GENERIC_READ, FILE_SHARE_WRITE, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
|
||||
NULL)) != INVALID_HANDLE_VALUE ) {
|
||||
if (GetFileInformationByHandle(hFile, &hOldInfo) == FALSE) {
|
||||
goto copy_file;
|
||||
}
|
||||
}
|
||||
CloseHandle(hFile);
|
||||
|
||||
/*
|
||||
** If both the source and destination were created at the same time
|
||||
** and have the same size then do not copy...
|
||||
*/
|
||||
if ((hOldInfo.ftLastWriteTime.dwLowDateTime == hNewInfo.ftLastWriteTime.dwLowDateTime) &&
|
||||
(hOldInfo.ftLastWriteTime.dwHighDateTime == hNewInfo.ftLastWriteTime.dwHighDateTime) &&
|
||||
(hOldInfo.nFileSizeLow == hNewInfo.nFileSizeLow) &&
|
||||
(hOldInfo.nFileSizeHigh == hNewInfo.nFileSizeHigh)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
copy_file:
|
||||
if( ! CopyFile(oldFile, newFile, FALSE) ) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
char old_path[4096];
|
||||
char new_path[4096];
|
||||
char *oldFileName; /* points to where file name starts in old_path */
|
||||
char *newFileName; /* points to where file name starts in new_path */
|
||||
WIN32_FIND_DATA findFileData;
|
||||
HANDLE hFindFile;
|
||||
int rv;
|
||||
|
||||
if( argc != 3 ) {
|
||||
Usage();
|
||||
return 2;
|
||||
}
|
||||
|
||||
strcpy(old_path, argv[1]);
|
||||
FlipSlashes(old_path);
|
||||
oldFileName = strrchr(old_path, '\\');
|
||||
if (oldFileName) {
|
||||
oldFileName++;
|
||||
} else {
|
||||
oldFileName = old_path;
|
||||
}
|
||||
|
||||
sprintf(new_path, "%s\\", argv[2]);
|
||||
FlipSlashes(new_path);
|
||||
newFileName = new_path + strlen(new_path);
|
||||
|
||||
if( MakeDir(new_path) < 0 ) {
|
||||
fprintf(stderr, "\n+++ makecopy: unable to create directory %s\n", new_path);
|
||||
return 1;
|
||||
}
|
||||
|
||||
hFindFile = FindFirstFile(old_path, &findFileData);
|
||||
if (hFindFile == INVALID_HANDLE_VALUE) {
|
||||
fprintf(stderr, "\n+++ makecopy: no such file: %s\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("+++ makecopy: Installing %s into directory %s\n", argv[1], argv[2]);
|
||||
|
||||
do {
|
||||
strcpy(oldFileName, findFileData.cFileName);
|
||||
strcpy(newFileName, findFileData.cFileName);
|
||||
rv = CopyIfNecessary(old_path, new_path);
|
||||
if (rv != 0) {
|
||||
break;
|
||||
}
|
||||
} while (FindNextFile(hFindFile, &findFileData) != 0);
|
||||
|
||||
FindClose(hFindFile);
|
||||
return rv;
|
||||
}
|
||||
BIN
mozilla/config/makecopy.exe
Executable file
BIN
mozilla/config/makecopy.exe
Executable file
Binary file not shown.
58
mozilla/config/makefile.win
Normal file
58
mozilla/config/makefile.win
Normal file
@@ -0,0 +1,58 @@
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Makefile fo NS/CONFIG - various commands used by other makefiles
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
!error This makefile must be build using 32-bit tools
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of NS
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH = ..
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
|
||||
#//
|
||||
#// Rule to build makedir.exe
|
||||
#//
|
||||
makecopy.exe:: makecopy.c
|
||||
$(CC) -O2 -MD makecopy.c
|
||||
|
||||
mangle.exe:: mangle.c
|
||||
$(CC) -O2 -MD mangle.c
|
||||
|
||||
mantomak.exe:: mantomak.c
|
||||
$(CC) -O2 -MD mantomak.c
|
||||
|
||||
bin2rc.exe:: bin2rc.c
|
||||
$(CC) -O2 -MD bin2rc.c
|
||||
|
||||
export:: makecopy.exe mangle.exe mantomak.exe bin2rc.exe
|
||||
|
||||
install:: export
|
||||
120
mozilla/config/mangle.c
Normal file
120
mozilla/config/mangle.c
Normal file
@@ -0,0 +1,120 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
HANDLE hMangleFile;
|
||||
|
||||
void Usage(void)
|
||||
{
|
||||
fprintf(stderr, "MANGLE: <file>\n");
|
||||
}
|
||||
|
||||
BOOL MangleFile( const char *real_name, const char *mangle_name )
|
||||
{
|
||||
int len;
|
||||
DWORD dwWritten;
|
||||
char buffer[2048];
|
||||
|
||||
if( mangle_name && *mangle_name && strcmpi(real_name, mangle_name) ) {
|
||||
printf("Mangle: renaming %s to %s\n", real_name, mangle_name);
|
||||
|
||||
if( ! MoveFile(real_name, "X_MANGLE.TMP") ) {
|
||||
fprintf(stderr, "MANGLE: cannot rename %s to X_MANGLE.TMP\n",
|
||||
real_name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( ! MoveFile("X_MANGLE.TMP", mangle_name) ) {
|
||||
MoveFile("X_MANGLE.TMP", real_name);
|
||||
fprintf(stderr, "MANGLE: cannot rename X_MANGLE.TMP to %s\n",
|
||||
mangle_name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
len = sprintf(buffer, "mv %s %s\r\n", mangle_name, real_name);
|
||||
|
||||
if( (WriteFile( hMangleFile, buffer, len, &dwWritten, NULL ) == FALSE) ||
|
||||
(dwWritten != len) ) {
|
||||
fprintf(stderr, "MANGLE: error writing to UNMANGLE.BAT\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
WIN32_FIND_DATA find_data;
|
||||
HANDLE hFoundFile;
|
||||
|
||||
if( argc != 1 ) {
|
||||
Usage();
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
hMangleFile = CreateFile("unmangle.bat", /* name */
|
||||
GENERIC_READ|GENERIC_WRITE, /* access mode */
|
||||
0, /* share mode */
|
||||
NULL, /* security descriptor */
|
||||
CREATE_NEW, /* how to create */
|
||||
FILE_ATTRIBUTE_NORMAL, /* file attributes */
|
||||
NULL ); /* template file */
|
||||
|
||||
if( hMangleFile == INVALID_HANDLE_VALUE ) {
|
||||
if( GetLastError() == ERROR_FILE_EXISTS ) {
|
||||
fprintf(stderr, "MANGLE: UNMANGLE.BAT already exists\n");
|
||||
} else {
|
||||
fprintf(stderr, "MANGLE: cannot open UNMANGLE.BAT\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if( (hFoundFile = FindFirstFile("*.*", &find_data)) == INVALID_HANDLE_VALUE ) {
|
||||
fprintf(stderr, "MANGLE: cannot read directory\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
do {
|
||||
if( !MangleFile(find_data.cFileName, find_data.cAlternateFileName) ) {
|
||||
fprintf(stderr, "MANGLE: cannot rename %s to %s\n",
|
||||
find_data.cFileName, find_data.cAlternateFileName );
|
||||
|
||||
FindClose( hFoundFile );
|
||||
CloseHandle( hMangleFile );
|
||||
return 1;
|
||||
}
|
||||
} while( FindNextFile(hFoundFile, &find_data) );
|
||||
FindClose( hFoundFile );
|
||||
|
||||
{
|
||||
int len;
|
||||
DWORD dwWritten;
|
||||
char buffer[255];
|
||||
|
||||
len = sprintf(buffer, "del unmangle.bat\r\n");
|
||||
WriteFile ( hMangleFile, buffer, len, &dwWritten, NULL );
|
||||
}
|
||||
CloseHandle( hMangleFile );
|
||||
|
||||
return 0;
|
||||
}
|
||||
BIN
mozilla/config/mangle.exe
Executable file
BIN
mozilla/config/mangle.exe
Executable file
Binary file not shown.
990
mozilla/config/mantomak.c
Normal file
990
mozilla/config/mantomak.c
Normal file
@@ -0,0 +1,990 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#define DEFAULT_MANIFEST_EXT ".mn"
|
||||
#define DEFAULT_MAKEFILE_EXT ".win"
|
||||
|
||||
typedef struct char_list_struct {
|
||||
char *m_pString;
|
||||
struct char_list_struct *m_pNext;
|
||||
} char_list;
|
||||
|
||||
typedef struct macro_list_struct {
|
||||
char *m_pMacro;
|
||||
char_list *m_pValue;
|
||||
struct macro_list_struct *m_pNext;
|
||||
} macro_list;
|
||||
|
||||
void help(void);
|
||||
char *input_filename(const char *);
|
||||
char *output_filename(const char *, const char *);
|
||||
int input_to_output(FILE *, FILE *);
|
||||
int output_rules(FILE *);
|
||||
int output_end(FILE *);
|
||||
int buffer_to_output(char *, FILE *);
|
||||
macro_list *extract_macros(char *);
|
||||
char *find_macro(char *, char **);
|
||||
void add_macro(char *, macro_list **);
|
||||
int macro_length(char *);
|
||||
int value_length(char *);
|
||||
void add_values(char *, char_list **);
|
||||
char *skip_white(char *);
|
||||
int write_macros(macro_list *, FILE *);
|
||||
int write_values(char_list *, FILE *, int);
|
||||
void free_macro_list(macro_list *);
|
||||
void free_char_list(char_list *);
|
||||
void morph_macro(macro_list **, char *, char *, char *);
|
||||
void slash_convert(macro_list *, char *);
|
||||
int explicit_rules(macro_list *, char *, FILE *);
|
||||
void create_classroot(macro_list **ppList );
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int iOS = 0;
|
||||
char *pInputFile = NULL;
|
||||
char *pOutputFile = NULL;
|
||||
|
||||
/* Figure out arguments.
|
||||
* [REQUIRED] First argument is input file.
|
||||
* [OPTIONAL] Second argument is output file.
|
||||
*/
|
||||
if(argc > 1) {
|
||||
FILE *pInputStream = NULL;
|
||||
FILE *pOutputStream = NULL;
|
||||
|
||||
/* Form respective filenames.
|
||||
*/
|
||||
pInputFile = input_filename(argv[1]);
|
||||
pOutputFile = output_filename(pInputFile, argc > 2 ? argv[2] : NULL);
|
||||
|
||||
if(pInputFile == NULL) {
|
||||
fprintf(stderr, "MANTOMAK: Unable to form input filename\n");
|
||||
iOS = 1;
|
||||
}
|
||||
else {
|
||||
pInputStream = fopen(pInputFile, "rb");
|
||||
if(pInputStream == NULL) {
|
||||
fprintf(stderr, "MANTOMAK: Unable to open input file %s\n", pInputFile);
|
||||
iOS = 1;
|
||||
}
|
||||
}
|
||||
if(pOutputFile == NULL) {
|
||||
fprintf(stderr, "MANTOMAK: Unable to form output filename\n");
|
||||
iOS = 1;
|
||||
}
|
||||
else if(pInputStream != NULL) {
|
||||
pOutputStream = fopen(pOutputFile, "wt");
|
||||
if(pOutputStream == NULL) {
|
||||
fprintf(stderr, "MANTOMAK: Unable to open output file %s\n", pOutputFile);
|
||||
iOS = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Only do the real processing if our error code is not
|
||||
* already set.
|
||||
*/
|
||||
if(iOS == 0) {
|
||||
iOS = input_to_output(pInputStream, pOutputStream);
|
||||
}
|
||||
|
||||
if(pInputStream != NULL) {
|
||||
fclose(pInputStream);
|
||||
pInputStream = NULL;
|
||||
}
|
||||
if(pOutputStream != NULL) {
|
||||
fclose(pOutputStream);
|
||||
pOutputStream = NULL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
help();
|
||||
iOS = 1;
|
||||
}
|
||||
|
||||
if(pInputFile) {
|
||||
free(pInputFile);
|
||||
pInputFile = NULL;
|
||||
}
|
||||
if(pOutputFile) {
|
||||
free(pOutputFile);
|
||||
pOutputFile = NULL;
|
||||
}
|
||||
|
||||
return(iOS);
|
||||
}
|
||||
|
||||
void help(void)
|
||||
{
|
||||
fprintf(stderr, "USAGE:\tmantomak.exe InputFile [OutputFile]\n\n");
|
||||
fprintf(stderr, "InputFile:\tManifest file. If without extension, \"%s\" assumed.\n", DEFAULT_MANIFEST_EXT);
|
||||
fprintf(stderr, "OutputFile:\tNMake file. If not present, \"InputFile%s\" assumed.\n", DEFAULT_MAKEFILE_EXT);
|
||||
}
|
||||
|
||||
char *input_filename(const char *pInputFile)
|
||||
{
|
||||
char aResult[_MAX_PATH];
|
||||
char aDrive[_MAX_DRIVE];
|
||||
char aDir[_MAX_DIR];
|
||||
char aName[_MAX_FNAME];
|
||||
char aExt[_MAX_EXT];
|
||||
|
||||
if(pInputFile == NULL) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
_splitpath(pInputFile, aDrive, aDir, aName, aExt);
|
||||
|
||||
if(aExt[0] == '\0') {
|
||||
/* No extension provided.
|
||||
* Use the default.
|
||||
*/
|
||||
strcpy(aExt, DEFAULT_MANIFEST_EXT);
|
||||
}
|
||||
|
||||
aResult[0] = '\0';
|
||||
_makepath(aResult, aDrive, aDir, aName, aExt);
|
||||
|
||||
if(aResult[0] == '\0') {
|
||||
return(NULL);
|
||||
}
|
||||
else {
|
||||
return(strdup(aResult));
|
||||
}
|
||||
}
|
||||
|
||||
char *output_filename(const char *pInputFile, const char *pOutputFile)
|
||||
{
|
||||
char aResult[_MAX_PATH];
|
||||
char aDrive[_MAX_DRIVE];
|
||||
char aDir[_MAX_DIR];
|
||||
char aName[_MAX_FNAME];
|
||||
char aExt[_MAX_EXT];
|
||||
|
||||
if(pOutputFile != NULL) {
|
||||
return(strdup(pOutputFile));
|
||||
}
|
||||
|
||||
/* From here on out, we have to create our own filename,
|
||||
* implied from the input file name.
|
||||
*/
|
||||
|
||||
if(pInputFile == NULL) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
_splitpath(pInputFile, aDrive, aDir, aName, aExt);
|
||||
strcpy(aExt, DEFAULT_MAKEFILE_EXT);
|
||||
|
||||
aResult[0] = '\0';
|
||||
_makepath(aResult, aDrive, aDir, aName, aExt);
|
||||
|
||||
if(aResult[0] == '\0') {
|
||||
return(NULL);
|
||||
}
|
||||
else {
|
||||
return(strdup(aResult));
|
||||
}
|
||||
}
|
||||
|
||||
int input_to_output(FILE *pInput, FILE *pOutput)
|
||||
{
|
||||
char *pHog = NULL;
|
||||
long lSize = 0;
|
||||
int iRetval = 0;
|
||||
|
||||
/* Read the entire file into memory.
|
||||
*/
|
||||
fseek(pInput, 0, SEEK_END);
|
||||
lSize = ftell(pInput);
|
||||
fseek(pInput, 0, SEEK_SET);
|
||||
|
||||
pHog = (char *)malloc(lSize + 1);
|
||||
if(pHog) {
|
||||
*(pHog + lSize) = '\0';
|
||||
fread(pHog, lSize, 1, pInput);
|
||||
|
||||
iRetval = buffer_to_output(pHog, pOutput);
|
||||
|
||||
free(pHog);
|
||||
pHog = NULL;
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "MANTOMAK: Out of Memory....\n");
|
||||
iRetval = 1;
|
||||
}
|
||||
|
||||
return(iRetval);
|
||||
}
|
||||
|
||||
int output_rules(FILE *pOutput)
|
||||
{
|
||||
int iRetval = 0;
|
||||
|
||||
if(EOF ==
|
||||
fputs("\n"
|
||||
"!if \"$(MANIFEST_LEVEL)\"==\"RULES\""
|
||||
"\n",
|
||||
pOutput))
|
||||
{
|
||||
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
|
||||
iRetval = 1;
|
||||
}
|
||||
return(iRetval);
|
||||
}
|
||||
|
||||
int output_end(FILE *pOutput)
|
||||
{
|
||||
int iRetval = 0;
|
||||
|
||||
if(EOF ==
|
||||
fputs("\n"
|
||||
"!endif"
|
||||
"\n",
|
||||
pOutput))
|
||||
{
|
||||
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
|
||||
iRetval = 1;
|
||||
}
|
||||
return(iRetval);
|
||||
}
|
||||
|
||||
|
||||
int buffer_to_output(char *pBuffer, FILE *pOutput)
|
||||
{
|
||||
int iRetval = 0;
|
||||
macro_list *pMacros = NULL;
|
||||
|
||||
/* Tokenize the macros and their corresponding values.
|
||||
*/
|
||||
pMacros = extract_macros(pBuffer);
|
||||
if(pMacros != NULL) {
|
||||
/* Perform forward to backslash conversion on those macros known to be
|
||||
* path information only.
|
||||
*/
|
||||
slash_convert(pMacros, "JBOOTDIRS");
|
||||
slash_convert(pMacros, "JDIRS");
|
||||
slash_convert(pMacros, "DEPTH");
|
||||
slash_convert(pMacros, "NS_DEPTH");
|
||||
slash_convert(pMacros, "PACKAGE");
|
||||
slash_convert(pMacros, "JMC_GEN_DIR");
|
||||
slash_convert(pMacros, "DIST_PUBLIC");
|
||||
|
||||
/* Process some of the macros, and convert them
|
||||
* into different macros with different data.
|
||||
*/
|
||||
morph_macro(&pMacros, "JMC_GEN", "JMC_HEADERS", "$(JMC_GEN_DIR)\\%s.h");
|
||||
morph_macro(&pMacros, "JMC_GEN", "JMC_STUBS", "$(JMC_GEN_DIR)\\%s.c");
|
||||
morph_macro(&pMacros, "JMC_GEN", "JMC_OBJS", ".\\$(OBJDIR)\\%s.obj");
|
||||
morph_macro(&pMacros, "CSRCS", "C_OBJS", ".\\$(OBJDIR)\\%s.obj");
|
||||
morph_macro(&pMacros, "CPPSRCS", "CPP_OBJS", ".\\$(OBJDIR)\\%s.obj");
|
||||
morph_macro(&pMacros, "REQUIRES", "LINCS", "-I$(XPDIST)\\public\\%s");
|
||||
|
||||
create_classroot( &pMacros );
|
||||
|
||||
/* Output the Macros and the corresponding values.
|
||||
*/
|
||||
iRetval = write_macros(pMacros, pOutput);
|
||||
|
||||
/* Output rule file inclusion
|
||||
*/
|
||||
if(iRetval == 0) {
|
||||
iRetval = output_rules(pOutput);
|
||||
}
|
||||
|
||||
/* Output explicit build rules/dependencies for JMC_GEN.
|
||||
*/
|
||||
if(iRetval == 0) {
|
||||
iRetval = explicit_rules(pMacros, "JMC_GEN", pOutput);
|
||||
}
|
||||
|
||||
if(iRetval == 0) {
|
||||
iRetval = output_end(pOutput);
|
||||
}
|
||||
/* Free off the macro list.
|
||||
*/
|
||||
free_macro_list(pMacros);
|
||||
pMacros = NULL;
|
||||
}
|
||||
|
||||
return(iRetval);
|
||||
}
|
||||
|
||||
int explicit_rules(macro_list *pList, char *pMacro, FILE *pOutput)
|
||||
{
|
||||
int iRetval = 0;
|
||||
macro_list *pEntry = NULL;
|
||||
|
||||
if(pList == NULL || pMacro == NULL || pOutput == NULL) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Find macro of said name.
|
||||
* Case insensitive.
|
||||
*/
|
||||
pEntry = pList;
|
||||
while(pEntry) {
|
||||
if(stricmp(pEntry->m_pMacro, pMacro) == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
pEntry = pEntry->m_pNext;
|
||||
}
|
||||
|
||||
if(pEntry) {
|
||||
/* Decide style of rule depending on macro name.
|
||||
*/
|
||||
if(stricmp(pEntry->m_pMacro, "JMC_GEN") == 0) {
|
||||
char_list *pNames = NULL;
|
||||
char *pModuleName = NULL;
|
||||
char *pClassName = NULL;
|
||||
|
||||
pNames = pEntry->m_pValue;
|
||||
while(pNames) {
|
||||
pModuleName = pNames->m_pString;
|
||||
pClassName = pModuleName + 1;
|
||||
|
||||
fprintf(pOutput, "$(JMC_GEN_DIR)\\%s.h", pModuleName);
|
||||
fprintf(pOutput, ": ");
|
||||
fprintf(pOutput, "$(JMCSRCDIR)\\%s.class", pClassName);
|
||||
fprintf(pOutput, "\n ");
|
||||
fprintf(pOutput, "$(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=)");
|
||||
fprintf(pOutput, "\n");
|
||||
|
||||
fprintf(pOutput, "$(JMC_GEN_DIR)\\%s.c", pModuleName);
|
||||
fprintf(pOutput, ": ");
|
||||
fprintf(pOutput, "$(JMCSRCDIR)\\%s.class", pClassName);
|
||||
fprintf(pOutput, "\n ");
|
||||
fprintf(pOutput, "$(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=)");
|
||||
fprintf(pOutput, "\n");
|
||||
|
||||
pNames = pNames->m_pNext;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Don't know how to format macro.
|
||||
*/
|
||||
iRetval = 69;
|
||||
}
|
||||
}
|
||||
|
||||
return(iRetval);
|
||||
}
|
||||
|
||||
void slash_convert(macro_list *pList, char *pMacro)
|
||||
{
|
||||
macro_list *pEntry = NULL;
|
||||
|
||||
if(pList == NULL || pMacro == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Find macro of said name.
|
||||
* Case insensitive.
|
||||
*/
|
||||
pEntry = pList;
|
||||
while(pEntry) {
|
||||
if(stricmp(pEntry->m_pMacro, pMacro) == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
pEntry = pEntry->m_pNext;
|
||||
}
|
||||
|
||||
if(pEntry) {
|
||||
char *pConvert = NULL;
|
||||
char_list *pValue = pEntry->m_pValue;
|
||||
|
||||
while(pValue) {
|
||||
pConvert = pValue->m_pString;
|
||||
while(pConvert && *pConvert) {
|
||||
if(*pConvert == '/') {
|
||||
*pConvert = '\\';
|
||||
}
|
||||
pConvert++;
|
||||
}
|
||||
pValue = pValue->m_pNext;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void morph_macro(macro_list **ppList, char *pMacro, char *pMorph, char *pPrintf)
|
||||
{
|
||||
macro_list *pEntry = NULL;
|
||||
|
||||
if(ppList == NULL || pMacro == NULL || pMorph == NULL || pPrintf == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Find macro of said name.
|
||||
* Case insensitive.
|
||||
*/
|
||||
pEntry = *ppList;
|
||||
while(pEntry) {
|
||||
if(stricmp(pEntry->m_pMacro, pMacro) == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
pEntry = pEntry->m_pNext;
|
||||
}
|
||||
|
||||
if(pEntry) {
|
||||
char_list *pFilename = NULL;
|
||||
char aPath[_MAX_PATH];
|
||||
char aDrive[_MAX_DRIVE];
|
||||
char aDir[_MAX_DIR];
|
||||
char aFName[_MAX_FNAME];
|
||||
char aExt[_MAX_EXT];
|
||||
char *pBuffer = NULL;
|
||||
|
||||
/* Start with buffer size needed.
|
||||
* We expand this as we go along if needed.
|
||||
*/
|
||||
pBuffer = (char *)malloc(strlen(pMorph) + 2);
|
||||
strcpy(pBuffer, pMorph);
|
||||
strcat(pBuffer, "=");
|
||||
|
||||
/* Go through each value, converting over to new macro.
|
||||
*/
|
||||
pFilename = pEntry->m_pValue;
|
||||
while(pFilename) {
|
||||
_splitpath(pFilename->m_pString, aDrive, aDir, aFName, aExt);
|
||||
|
||||
/* Expand buffer by required amount.
|
||||
*/
|
||||
sprintf(aPath, pPrintf, aFName);
|
||||
strcat(aPath, " ");
|
||||
pBuffer = (char *)realloc(pBuffer, _msize(pBuffer) + strlen(aPath));
|
||||
strcat(pBuffer, aPath);
|
||||
|
||||
pFilename = pFilename->m_pNext;
|
||||
}
|
||||
|
||||
/* Add the macro.
|
||||
*/
|
||||
add_macro(pBuffer, ppList);
|
||||
|
||||
free(pBuffer);
|
||||
pBuffer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void create_classroot(macro_list **ppList )
|
||||
{
|
||||
char cwd[512];
|
||||
int i, i2;
|
||||
macro_list *pEntry = NULL;
|
||||
macro_list *pE;
|
||||
|
||||
/* Find macro of said name.
|
||||
* Case insensitive.
|
||||
*/
|
||||
pEntry = *ppList;
|
||||
while(pEntry) {
|
||||
if(stricmp(pEntry->m_pMacro, "PACKAGE") == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
pEntry = pEntry->m_pNext;
|
||||
}
|
||||
|
||||
if(pEntry == 0 || pEntry->m_pValue == 0 || pEntry->m_pValue->m_pString == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
_getcwd( cwd, 512 );
|
||||
|
||||
i = strlen( pEntry->m_pValue->m_pString );
|
||||
i2 = strlen( cwd );
|
||||
|
||||
cwd[i2-i-1] = 0;
|
||||
|
||||
pE = NULL;
|
||||
pE = (macro_list *)calloc(sizeof(macro_list),1);
|
||||
pE->m_pMacro = strdup("CLASSROOT");
|
||||
pE->m_pValue = (char_list *)calloc(sizeof(char_list),1);
|
||||
pE->m_pValue->m_pString = strdup(cwd);
|
||||
|
||||
while(*ppList) {
|
||||
ppList = &((*ppList)->m_pNext);
|
||||
}
|
||||
*ppList = pE;
|
||||
}
|
||||
|
||||
|
||||
int write_macros(macro_list *pList, FILE *pOutput)
|
||||
{
|
||||
int iRetval = 0;
|
||||
int iLineLength = 0;
|
||||
|
||||
if(pList == NULL || pOutput == NULL) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
if(EOF ==
|
||||
fputs("\n"
|
||||
"!if \"$(MANIFEST_LEVEL)\"==\"MACROS\""
|
||||
"\n",
|
||||
pOutput))
|
||||
{
|
||||
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
|
||||
return(1);
|
||||
}
|
||||
|
||||
while(pList) {
|
||||
int bIgnoreForWin16 = 0;
|
||||
|
||||
/* The following macros should not be emitted for Win16 */
|
||||
if (0 == strcmp(pList->m_pMacro, "LINCS")) {
|
||||
bIgnoreForWin16 = 1;
|
||||
}
|
||||
|
||||
|
||||
if (bIgnoreForWin16) {
|
||||
if(0 > fprintf(pOutput, "!if \"$(MOZ_BITS)\" != \"16\"\n")) {
|
||||
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
|
||||
iRetval = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(0 > fprintf(pOutput, "%s=", pList->m_pMacro)) {
|
||||
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
|
||||
iRetval = 1;
|
||||
break;
|
||||
}
|
||||
iLineLength += strlen(pList->m_pMacro) + 1;
|
||||
|
||||
iRetval = write_values(pList->m_pValue, pOutput, iLineLength);
|
||||
if(iRetval) {
|
||||
break;
|
||||
}
|
||||
|
||||
if(EOF == fputc('\n', pOutput)) {
|
||||
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
|
||||
iRetval = 1;
|
||||
break;
|
||||
}
|
||||
iLineLength = 0;
|
||||
|
||||
pList = pList->m_pNext;
|
||||
|
||||
if (bIgnoreForWin16) {
|
||||
if(0 > fprintf(pOutput, "!endif\n")) {
|
||||
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
|
||||
iRetval = 1;
|
||||
break;
|
||||
}
|
||||
bIgnoreForWin16 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(EOF ==
|
||||
fputs("\n"
|
||||
"!endif"
|
||||
"\n",
|
||||
pOutput))
|
||||
{
|
||||
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
|
||||
return(1);
|
||||
}
|
||||
return(iRetval);
|
||||
}
|
||||
|
||||
int write_values(char_list *pList, FILE *pOutput, int iLineLength)
|
||||
{
|
||||
int iRetval = 0;
|
||||
|
||||
if(pList == NULL || pOutput == NULL) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
while(pList) {
|
||||
if(iLineLength == 0) {
|
||||
if(EOF == fputs(" ", pOutput)) {
|
||||
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
|
||||
iRetval = 1;
|
||||
break;
|
||||
}
|
||||
iLineLength += 4;
|
||||
|
||||
if(0 > fprintf(pOutput, "%s ", pList->m_pString)) {
|
||||
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
|
||||
iRetval = 1;
|
||||
break;
|
||||
}
|
||||
iLineLength += strlen(pList->m_pString) + 1;
|
||||
}
|
||||
else if(iLineLength + strlen(pList->m_pString) > 72) {
|
||||
if(EOF == fputs("\\\n", pOutput)) {
|
||||
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
|
||||
iRetval = 1;
|
||||
break;
|
||||
}
|
||||
iLineLength = 0;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if(0 > fprintf(pOutput, "%s ", pList->m_pString)) {
|
||||
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
|
||||
iRetval = 1;
|
||||
break;
|
||||
}
|
||||
iLineLength += strlen(pList->m_pString) + 1;
|
||||
}
|
||||
|
||||
pList = pList->m_pNext;
|
||||
}
|
||||
|
||||
return(iRetval);
|
||||
}
|
||||
|
||||
macro_list *extract_macros(char *pBuffer)
|
||||
{
|
||||
macro_list *pRetval = NULL;
|
||||
char *pTraverse = NULL;
|
||||
char *pMacro = NULL;
|
||||
|
||||
pTraverse = pBuffer;
|
||||
while(pTraverse) {
|
||||
pMacro = NULL;
|
||||
pTraverse = find_macro(pTraverse, &pMacro);
|
||||
if(pMacro) {
|
||||
add_macro(pMacro, &pRetval);
|
||||
}
|
||||
}
|
||||
|
||||
return(pRetval);
|
||||
}
|
||||
|
||||
void add_macro(char *pString, macro_list **ppList)
|
||||
{
|
||||
macro_list *pEntry = NULL;
|
||||
int iLength = 0;
|
||||
|
||||
if(pString == NULL || *pString == '\0' || ppList == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Allocate a new list entry for the macro.
|
||||
*/
|
||||
pEntry = (macro_list *)malloc(sizeof(macro_list));
|
||||
memset(pEntry, 0, sizeof(macro_list));
|
||||
|
||||
/* Very first part of the string is the macro name.
|
||||
* How long is it?
|
||||
*/
|
||||
iLength = macro_length(pString);
|
||||
pEntry->m_pMacro = (char *)malloc(iLength + 1);
|
||||
memset(pEntry->m_pMacro, 0, iLength + 1);
|
||||
strncpy(pEntry->m_pMacro, pString, iLength);
|
||||
|
||||
/* Skip to the values.
|
||||
* These are always on the right side of an '='
|
||||
*/
|
||||
pString = strchr(pString, '=');
|
||||
if(pString) {
|
||||
pString++;
|
||||
}
|
||||
add_values(pString, &(pEntry->m_pValue));
|
||||
|
||||
/* Add the macro to the end of the macro list.
|
||||
*/
|
||||
while(*ppList) {
|
||||
ppList = &((*ppList)->m_pNext);
|
||||
}
|
||||
*ppList = pEntry;
|
||||
}
|
||||
|
||||
void add_values(char *pString, char_list **ppList)
|
||||
{
|
||||
char_list **ppTraverse = NULL;
|
||||
char_list *pEntry = NULL;
|
||||
int iLength = 0;
|
||||
int iBackslash = 0;
|
||||
|
||||
if(pString == NULL || *pString == '\0' || ppList == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
while(pString) {
|
||||
/* Find start of value.
|
||||
*/
|
||||
iBackslash = 0;
|
||||
while(*pString) {
|
||||
if(*pString == '\\') {
|
||||
iBackslash++;
|
||||
}
|
||||
else if(*pString == '\n') {
|
||||
if(iBackslash == 0) {
|
||||
/* End of values.
|
||||
* Setting to NULL gets out of all loops.
|
||||
*/
|
||||
pString = NULL;
|
||||
break;
|
||||
}
|
||||
iBackslash = 0;
|
||||
}
|
||||
else if(!isspace(*pString)) {
|
||||
/* Backslashes part of string.
|
||||
* This screws up if a backslash is in the middle of the string.
|
||||
*/
|
||||
pString -= iBackslash;
|
||||
break;
|
||||
}
|
||||
|
||||
pString++;
|
||||
}
|
||||
if(pString == NULL || *pString == '\0') {
|
||||
break;
|
||||
}
|
||||
|
||||
/* Do not honor anything beginning with a #
|
||||
*/
|
||||
if(*pString == '#') {
|
||||
/* End of line.
|
||||
*/
|
||||
while(*pString && *pString != '\n') {
|
||||
pString++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Very first part of the string is value name.
|
||||
* How long is it?
|
||||
*/
|
||||
iLength = value_length(pString);
|
||||
|
||||
/* Do not honor $(NULL)
|
||||
*/
|
||||
if(_strnicmp(pString, "$(NULL)", 7) == 0) {
|
||||
pString += iLength;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Allocate a new list entry for the next value.
|
||||
*/
|
||||
pEntry = (char_list *)malloc(sizeof(char_list));
|
||||
memset(pEntry, 0, sizeof(char_list));
|
||||
|
||||
pEntry->m_pString = (char *)malloc(iLength + 1);
|
||||
memset(pEntry->m_pString, 0, iLength + 1);
|
||||
strncpy(pEntry->m_pString, pString, iLength);
|
||||
|
||||
/* Add new value entry to the end of the list.
|
||||
*/
|
||||
ppTraverse = ppList;
|
||||
while(*ppTraverse) {
|
||||
ppTraverse = &((*ppTraverse)->m_pNext);
|
||||
}
|
||||
*ppTraverse = pEntry;
|
||||
|
||||
/* Go on to next value.
|
||||
*/
|
||||
pString += iLength;
|
||||
}
|
||||
}
|
||||
|
||||
char *find_macro(char *pBuffer, char **ppMacro)
|
||||
{
|
||||
char *pRetval = NULL;
|
||||
int iBackslash = 0;
|
||||
|
||||
if(pBuffer == NULL || ppMacro == NULL) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* Skip any whitespace in the buffer.
|
||||
* If comments need to be skipped also, this is the place.
|
||||
*/
|
||||
while(1) {
|
||||
while(*pBuffer && isspace(*pBuffer)) {
|
||||
pBuffer++;
|
||||
}
|
||||
if(*pBuffer == '#') {
|
||||
/* Go to the end of the line, it's a comment.
|
||||
*/
|
||||
while(*pBuffer && *pBuffer != '\n') {
|
||||
pBuffer++;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(*pBuffer) {
|
||||
/* Should be at the start of a macro.
|
||||
*/
|
||||
*ppMacro = pBuffer;
|
||||
}
|
||||
|
||||
/* Find the end of the macro for the return value.
|
||||
* This is the end of a line which does not contain a backslash at the end.
|
||||
*/
|
||||
while(*pBuffer) {
|
||||
if(*pBuffer == '\\') {
|
||||
iBackslash++;
|
||||
}
|
||||
else if(*pBuffer == '\n') {
|
||||
if(iBackslash == 0) {
|
||||
pRetval = pBuffer + 1;
|
||||
break;
|
||||
}
|
||||
iBackslash = 0;
|
||||
}
|
||||
else if(!isspace(*pBuffer)) {
|
||||
iBackslash = 0;
|
||||
}
|
||||
|
||||
pBuffer++;
|
||||
}
|
||||
|
||||
return(pRetval);
|
||||
}
|
||||
|
||||
int macro_length(char *pMacro)
|
||||
{
|
||||
int iRetval = 0;
|
||||
|
||||
if(pMacro == NULL) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Length is no big deal.
|
||||
* Problem is finding the end:
|
||||
* whitespace
|
||||
* '='
|
||||
*/
|
||||
while(*pMacro) {
|
||||
if(*pMacro == '=') {
|
||||
break;
|
||||
}
|
||||
else if(isspace(*pMacro)) {
|
||||
break;
|
||||
}
|
||||
|
||||
pMacro++;
|
||||
iRetval++;
|
||||
}
|
||||
|
||||
return(iRetval);
|
||||
}
|
||||
|
||||
int value_length(char *pValue)
|
||||
{
|
||||
int iRetval = 0;
|
||||
|
||||
if(pValue == NULL) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Length is no big deal.
|
||||
* Problem is finding the end:
|
||||
* whitespace
|
||||
* '\\'whitespace
|
||||
*/
|
||||
while(*pValue) {
|
||||
if(*pValue == '\\') {
|
||||
char *pFindNewline = pValue + 1;
|
||||
/* If whitespace to end of line, break here.
|
||||
*/
|
||||
while(isspace(*pFindNewline)) {
|
||||
if(*pFindNewline == '\n') {
|
||||
break;
|
||||
}
|
||||
pFindNewline++;
|
||||
}
|
||||
if(*pFindNewline == '\n') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(isspace(*pValue)) {
|
||||
break;
|
||||
}
|
||||
|
||||
pValue++;
|
||||
iRetval++;
|
||||
}
|
||||
|
||||
return(iRetval);
|
||||
}
|
||||
|
||||
char *skip_white(char *pString)
|
||||
{
|
||||
if(pString == NULL) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
while(*pString && isspace(*pString)) {
|
||||
pString++;
|
||||
}
|
||||
|
||||
return(pString);
|
||||
}
|
||||
|
||||
void free_macro_list(macro_list *pList)
|
||||
{
|
||||
macro_list *pFree = NULL;
|
||||
|
||||
if(pList == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
while(pList) {
|
||||
pFree = pList;
|
||||
pList = pList->m_pNext;
|
||||
|
||||
pFree->m_pNext = NULL;
|
||||
|
||||
free_char_list(pFree->m_pValue);
|
||||
pFree->m_pValue = NULL;
|
||||
|
||||
free(pFree->m_pMacro);
|
||||
pFree->m_pMacro = NULL;
|
||||
|
||||
free(pFree);
|
||||
pFree = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void free_char_list(char_list *pList)
|
||||
{
|
||||
char_list *pFree = NULL;
|
||||
|
||||
if(pList == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
while(pList) {
|
||||
pFree = pList;
|
||||
pList = pList->m_pNext;
|
||||
|
||||
pFree->m_pNext = NULL;
|
||||
|
||||
free(pFree->m_pString);
|
||||
pFree->m_pString = NULL;
|
||||
|
||||
free(pFree);
|
||||
pFree = NULL;
|
||||
}
|
||||
}
|
||||
BIN
mozilla/config/mantomak.exe
Executable file
BIN
mozilla/config/mantomak.exe
Executable file
Binary file not shown.
32
mozilla/config/mkdepend/Makefile
Normal file
32
mozilla/config/mkdepend/Makefile
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
DEPTH = ../..
|
||||
|
||||
MODULE = mkdepend
|
||||
PROGRAM = mkdepend
|
||||
|
||||
CSRCS = cppsetup.c \
|
||||
ifparser.c \
|
||||
include.c \
|
||||
main.c \
|
||||
parse.c \
|
||||
pr.c
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
||||
DEFINES += -DINCLUDEDIR=\"/usr/include\" -DOBJSUFFIX=\".o\"
|
||||
244
mozilla/config/mkdepend/cppsetup.c
Normal file
244
mozilla/config/mkdepend/cppsetup.c
Normal file
@@ -0,0 +1,244 @@
|
||||
/* $XConsortium: cppsetup.c,v 1.13 94/04/17 20:10:32 gildea Exp $ */
|
||||
/*
|
||||
|
||||
Copyright (c) 1993, 1994 X Consortium
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of the X Consortium shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from the X Consortium.
|
||||
|
||||
*/
|
||||
|
||||
#include "def.h"
|
||||
|
||||
#ifdef CPP
|
||||
/*
|
||||
* This file is strictly for the sake of cpy.y and yylex.c (if
|
||||
* you indeed have the source for cpp).
|
||||
*/
|
||||
#define IB 1
|
||||
#define SB 2
|
||||
#define NB 4
|
||||
#define CB 8
|
||||
#define QB 16
|
||||
#define WB 32
|
||||
#define SALT '#'
|
||||
#if pdp11 | vax | ns16000 | mc68000 | ibm032
|
||||
#define COFF 128
|
||||
#else
|
||||
#define COFF 0
|
||||
#endif
|
||||
/*
|
||||
* These variables used by cpy.y and yylex.c
|
||||
*/
|
||||
extern char *outp, *inp, *newp, *pend;
|
||||
extern char *ptrtab;
|
||||
extern char fastab[];
|
||||
extern char slotab[];
|
||||
|
||||
/*
|
||||
* cppsetup
|
||||
*/
|
||||
struct filepointer *currentfile;
|
||||
struct inclist *currentinc;
|
||||
|
||||
cppsetup(line, filep, inc)
|
||||
register char *line;
|
||||
register struct filepointer *filep;
|
||||
register struct inclist *inc;
|
||||
{
|
||||
register char *p, savec;
|
||||
static boolean setupdone = FALSE;
|
||||
boolean value;
|
||||
|
||||
if (!setupdone) {
|
||||
cpp_varsetup();
|
||||
setupdone = TRUE;
|
||||
}
|
||||
|
||||
currentfile = filep;
|
||||
currentinc = inc;
|
||||
inp = newp = line;
|
||||
for (p=newp; *p; p++)
|
||||
;
|
||||
|
||||
/*
|
||||
* put a newline back on the end, and set up pend, etc.
|
||||
*/
|
||||
*p++ = '\n';
|
||||
savec = *p;
|
||||
*p = '\0';
|
||||
pend = p;
|
||||
|
||||
ptrtab = slotab+COFF;
|
||||
*--inp = SALT;
|
||||
outp=inp;
|
||||
value = yyparse();
|
||||
*p = savec;
|
||||
return(value);
|
||||
}
|
||||
|
||||
struct symtab *lookup(symbol)
|
||||
char *symbol;
|
||||
{
|
||||
static struct symtab undefined;
|
||||
struct symtab *sp;
|
||||
|
||||
sp = isdefined(symbol, currentinc, NULL);
|
||||
if (sp == NULL) {
|
||||
sp = &undefined;
|
||||
sp->s_value = NULL;
|
||||
}
|
||||
return (sp);
|
||||
}
|
||||
|
||||
pperror(tag, x0,x1,x2,x3,x4)
|
||||
int tag,x0,x1,x2,x3,x4;
|
||||
{
|
||||
warning("\"%s\", line %d: ", currentinc->i_file, currentfile->f_line);
|
||||
warning(x0,x1,x2,x3,x4);
|
||||
}
|
||||
|
||||
|
||||
yyerror(s)
|
||||
register char *s;
|
||||
{
|
||||
fatalerr("Fatal error: %s\n", s);
|
||||
}
|
||||
#else /* not CPP */
|
||||
|
||||
#include "ifparser.h"
|
||||
struct _parse_data {
|
||||
struct filepointer *filep;
|
||||
struct inclist *inc;
|
||||
const char *line;
|
||||
};
|
||||
|
||||
static const char *
|
||||
_my_if_errors (ip, cp, expecting)
|
||||
IfParser *ip;
|
||||
const char *cp;
|
||||
const char *expecting;
|
||||
{
|
||||
#ifdef DEBUG_MKDEPEND
|
||||
struct _parse_data *pd = (struct _parse_data *) ip->data;
|
||||
int lineno = pd->filep->f_line;
|
||||
char *filename = pd->inc->i_file;
|
||||
char prefix[300];
|
||||
int prefixlen;
|
||||
int i;
|
||||
|
||||
sprintf (prefix, "\"%s\":%d", filename, lineno);
|
||||
prefixlen = strlen(prefix);
|
||||
fprintf (stderr, "%s: %s", prefix, pd->line);
|
||||
i = cp - pd->line;
|
||||
if (i > 0 && pd->line[i-1] != '\n') {
|
||||
putc ('\n', stderr);
|
||||
}
|
||||
for (i += prefixlen + 3; i > 0; i--) {
|
||||
putc (' ', stderr);
|
||||
}
|
||||
fprintf (stderr, "^--- expecting %s\n", expecting);
|
||||
#endif /* DEBUG_MKDEPEND */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#define MAXNAMELEN 256
|
||||
|
||||
static struct symtab *
|
||||
_lookup_variable (ip, var, len)
|
||||
IfParser *ip;
|
||||
const char *var;
|
||||
int len;
|
||||
{
|
||||
char tmpbuf[MAXNAMELEN + 1];
|
||||
struct _parse_data *pd = (struct _parse_data *) ip->data;
|
||||
|
||||
if (len > MAXNAMELEN)
|
||||
return 0;
|
||||
|
||||
strncpy (tmpbuf, var, len);
|
||||
tmpbuf[len] = '\0';
|
||||
return isdefined (tmpbuf, pd->inc, NULL);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
_my_eval_defined (ip, var, len)
|
||||
IfParser *ip;
|
||||
const char *var;
|
||||
int len;
|
||||
{
|
||||
if (_lookup_variable (ip, var, len))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_')
|
||||
|
||||
static int
|
||||
_my_eval_variable (ip, var, len)
|
||||
IfParser *ip;
|
||||
const char *var;
|
||||
int len;
|
||||
{
|
||||
struct symtab *s;
|
||||
|
||||
s = _lookup_variable (ip, var, len);
|
||||
if (!s)
|
||||
return 0;
|
||||
do {
|
||||
var = s->s_value;
|
||||
if (!isvarfirstletter(*var))
|
||||
break;
|
||||
s = _lookup_variable (ip, var, strlen(var));
|
||||
} while (s);
|
||||
|
||||
return atoi(var);
|
||||
}
|
||||
|
||||
|
||||
cppsetup(line, filep, inc)
|
||||
register char *line;
|
||||
register struct filepointer *filep;
|
||||
register struct inclist *inc;
|
||||
{
|
||||
IfParser ip;
|
||||
struct _parse_data pd;
|
||||
int val = 0;
|
||||
|
||||
pd.filep = filep;
|
||||
pd.inc = inc;
|
||||
pd.line = line;
|
||||
ip.funcs.handle_error = _my_if_errors;
|
||||
ip.funcs.eval_defined = _my_eval_defined;
|
||||
ip.funcs.eval_variable = _my_eval_variable;
|
||||
ip.data = (char *) &pd;
|
||||
|
||||
(void) ParseIfExpression (&ip, line, &val);
|
||||
if (val)
|
||||
return IF;
|
||||
else
|
||||
return IFFALSE;
|
||||
}
|
||||
#endif /* CPP */
|
||||
|
||||
148
mozilla/config/mkdepend/def.h
Normal file
148
mozilla/config/mkdepend/def.h
Normal file
@@ -0,0 +1,148 @@
|
||||
/* $XConsortium: def.h,v 1.25 94/04/17 20:10:33 gildea Exp $ */
|
||||
/*
|
||||
|
||||
Copyright (c) 1993, 1994 X Consortium
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of the X Consortium shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from the X Consortium.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef NO_X11
|
||||
#include <X11/Xosdefs.h>
|
||||
#ifdef WIN32
|
||||
#include <X11/Xw32defs.h>
|
||||
#endif
|
||||
#include <X11/Xfuncproto.h>
|
||||
#endif /* NO_X11 */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#ifndef X_NOT_POSIX
|
||||
#ifndef _POSIX_SOURCE
|
||||
#define _POSIX_SOURCE
|
||||
#endif
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define MAXDEFINES 512
|
||||
#define MAXFILES 1024 /* Increased from 512. -mcafee */
|
||||
#define MAXDIRS 64
|
||||
#define SYMTABINC 10 /* must be > 1 for define() to work right */
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
/* the following must match the directives table in main.c */
|
||||
#define IF 0
|
||||
#define IFDEF 1
|
||||
#define IFNDEF 2
|
||||
#define ELSE 3
|
||||
#define ENDIF 4
|
||||
#define DEFINE 5
|
||||
#define UNDEF 6
|
||||
#define INCLUDE 7
|
||||
#define LINE 8
|
||||
#define PRAGMA 9
|
||||
#define ERROR 10
|
||||
#define IDENT 11
|
||||
#define SCCS 12
|
||||
#define ELIF 13
|
||||
#define EJECT 14
|
||||
#define IFFALSE 15 /* pseudo value --- never matched */
|
||||
#define ELIFFALSE 16 /* pseudo value --- never matched */
|
||||
#define INCLUDEDOT 17 /* pseudo value --- never matched */
|
||||
#define IFGUESSFALSE 18 /* pseudo value --- never matched */
|
||||
#define ELIFGUESSFALSE 19 /* pseudo value --- never matched */
|
||||
|
||||
#ifdef DEBUG
|
||||
extern int _debugmask;
|
||||
/*
|
||||
* debug levels are:
|
||||
*
|
||||
* 0 show ifn*(def)*,endif
|
||||
* 1 trace defined/!defined
|
||||
* 2 show #include
|
||||
* 3 show #include SYMBOL
|
||||
* 4-6 unused
|
||||
*/
|
||||
#define debug(level,arg) { if (_debugmask & (1 << level)) warning arg; }
|
||||
#else
|
||||
#define debug(level,arg) /**/
|
||||
#endif /* DEBUG */
|
||||
|
||||
typedef unsigned char boolean;
|
||||
|
||||
struct symtab {
|
||||
char *s_name;
|
||||
char *s_value;
|
||||
};
|
||||
|
||||
struct inclist {
|
||||
char *i_incstring; /* string from #include line */
|
||||
char *i_file; /* path name of the include file */
|
||||
struct inclist **i_list; /* list of files it itself includes */
|
||||
int i_listlen; /* length of i_list */
|
||||
struct symtab *i_defs; /* symbol table for this file */
|
||||
int i_ndefs; /* current # defines */
|
||||
int i_deflen; /* amount of space in table */
|
||||
boolean i_defchecked; /* whether defines have been checked */
|
||||
boolean i_notified; /* whether we have revealed includes */
|
||||
boolean i_marked; /* whether it's in the makefile */
|
||||
boolean i_searched; /* whether we have read this */
|
||||
boolean i_included_sym; /* whether #include SYMBOL was found */
|
||||
/* Can't use i_list if TRUE */
|
||||
};
|
||||
|
||||
struct filepointer {
|
||||
char *f_p;
|
||||
char *f_base;
|
||||
char *f_end;
|
||||
long f_len;
|
||||
long f_line;
|
||||
};
|
||||
|
||||
#ifndef X_NOT_STDC_ENV
|
||||
#include <stdlib.h>
|
||||
#if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */
|
||||
char *malloc(), *realloc();
|
||||
#endif /* macII */
|
||||
#else
|
||||
char *malloc();
|
||||
char *realloc();
|
||||
#endif
|
||||
|
||||
char *copy();
|
||||
char *base_name();
|
||||
char *getline();
|
||||
struct symtab *slookup();
|
||||
struct symtab *isdefined();
|
||||
struct symtab *fdefined();
|
||||
struct filepointer *getfile();
|
||||
struct inclist *newinclude();
|
||||
struct inclist *inc_path();
|
||||
|
||||
#if NeedVarargsPrototypes
|
||||
extern fatalerr(char *, ...);
|
||||
extern warning(char *, ...);
|
||||
extern warning1(char *, ...);
|
||||
#endif
|
||||
458
mozilla/config/mkdepend/ifparser.c
Normal file
458
mozilla/config/mkdepend/ifparser.c
Normal file
@@ -0,0 +1,458 @@
|
||||
/*
|
||||
* $XConsortium: ifparser.c,v 1.8 95/06/03 00:01:41 gildea Exp $
|
||||
*
|
||||
* Copyright 1992 Network Computing Devices, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation for any purpose and without fee is hereby granted, provided
|
||||
* that the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Network Computing Devices may not be
|
||||
* used in advertising or publicity pertaining to distribution of the software
|
||||
* without specific, written prior permission. Network Computing Devices makes
|
||||
* no representations about the suitability of this software for any purpose.
|
||||
* It is provided ``as is'' without express or implied warranty.
|
||||
*
|
||||
* NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
||||
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
|
||||
* IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL,
|
||||
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Author: Jim Fulton
|
||||
* Network Computing Devices, Inc.
|
||||
*
|
||||
* Simple if statement processor
|
||||
*
|
||||
* This module can be used to evaluate string representations of C language
|
||||
* if constructs. It accepts the following grammar:
|
||||
*
|
||||
* EXPRESSION := VALUE
|
||||
* | VALUE BINOP EXPRESSION
|
||||
*
|
||||
* VALUE := '(' EXPRESSION ')'
|
||||
* | '!' VALUE
|
||||
* | '-' VALUE
|
||||
* | 'defined' '(' variable ')'
|
||||
* | 'defined' variable
|
||||
* | # variable '(' variable-list ')'
|
||||
* | variable
|
||||
* | number
|
||||
*
|
||||
* BINOP := '*' | '/' | '%'
|
||||
* | '+' | '-'
|
||||
* | '<<' | '>>'
|
||||
* | '<' | '>' | '<=' | '>='
|
||||
* | '==' | '!='
|
||||
* | '&' | '|'
|
||||
* | '&&' | '||'
|
||||
*
|
||||
* The normal C order of precidence is supported.
|
||||
*
|
||||
*
|
||||
* External Entry Points:
|
||||
*
|
||||
* ParseIfExpression parse a string for #if
|
||||
*/
|
||||
|
||||
#include "ifparser.h"
|
||||
#include <ctype.h>
|
||||
|
||||
/****************************************************************************
|
||||
Internal Macros and Utilities for Parser
|
||||
****************************************************************************/
|
||||
|
||||
#define DO(val) if (!(val)) return NULL
|
||||
#define CALLFUNC(ggg,fff) (*((ggg)->funcs.fff))
|
||||
#define SKIPSPACE(ccc) while (isspace(*ccc)) ccc++
|
||||
#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_')
|
||||
|
||||
|
||||
static const char *
|
||||
parse_variable (g, cp, varp)
|
||||
IfParser *g;
|
||||
const char *cp;
|
||||
const char **varp;
|
||||
{
|
||||
SKIPSPACE (cp);
|
||||
|
||||
if (!isvarfirstletter (*cp))
|
||||
return CALLFUNC(g, handle_error) (g, cp, "variable name");
|
||||
|
||||
*varp = cp;
|
||||
/* EMPTY */
|
||||
for (cp++; isalnum(*cp) || *cp == '_'; cp++) ;
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
parse_number (g, cp, valp)
|
||||
IfParser *g;
|
||||
const char *cp;
|
||||
int *valp;
|
||||
{
|
||||
SKIPSPACE (cp);
|
||||
|
||||
if (!isdigit(*cp))
|
||||
return CALLFUNC(g, handle_error) (g, cp, "number");
|
||||
|
||||
#ifdef WIN32
|
||||
*valp = strtol(cp, &cp, 0);
|
||||
#else
|
||||
*valp = atoi (cp);
|
||||
/* EMPTY */
|
||||
for (cp++; isdigit(*cp); cp++) ;
|
||||
#endif
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
parse_value (g, cp, valp)
|
||||
IfParser *g;
|
||||
const char *cp;
|
||||
int *valp;
|
||||
{
|
||||
const char *var;
|
||||
|
||||
*valp = 0;
|
||||
|
||||
SKIPSPACE (cp);
|
||||
if (!*cp)
|
||||
return cp;
|
||||
|
||||
switch (*cp) {
|
||||
case '(':
|
||||
DO (cp = ParseIfExpression (g, cp + 1, valp));
|
||||
SKIPSPACE (cp);
|
||||
if (*cp != ')')
|
||||
return CALLFUNC(g, handle_error) (g, cp, ")");
|
||||
|
||||
return cp + 1; /* skip the right paren */
|
||||
|
||||
case '!':
|
||||
DO (cp = parse_value (g, cp + 1, valp));
|
||||
*valp = !(*valp);
|
||||
return cp;
|
||||
|
||||
case '-':
|
||||
DO (cp = parse_value (g, cp + 1, valp));
|
||||
*valp = -(*valp);
|
||||
return cp;
|
||||
|
||||
case '#':
|
||||
DO (cp = parse_variable (g, cp + 1, &var));
|
||||
SKIPSPACE (cp);
|
||||
if (*cp != '(')
|
||||
return CALLFUNC(g, handle_error) (g, cp, "(");
|
||||
do {
|
||||
DO (cp = parse_variable (g, cp + 1, &var));
|
||||
SKIPSPACE (cp);
|
||||
} while (*cp && *cp != ')');
|
||||
if (*cp != ')')
|
||||
return CALLFUNC(g, handle_error) (g, cp, ")");
|
||||
*valp = 1; /* XXX */
|
||||
return cp + 1;
|
||||
|
||||
case 'd':
|
||||
if (strncmp (cp, "defined", 7) == 0 && !isalnum(cp[7])) {
|
||||
int paren = 0;
|
||||
int len;
|
||||
|
||||
cp += 7;
|
||||
SKIPSPACE (cp);
|
||||
if (*cp == '(') {
|
||||
paren = 1;
|
||||
cp++;
|
||||
}
|
||||
DO (cp = parse_variable (g, cp, &var));
|
||||
len = cp - var;
|
||||
SKIPSPACE (cp);
|
||||
if (paren && *cp != ')')
|
||||
return CALLFUNC(g, handle_error) (g, cp, ")");
|
||||
*valp = (*(g->funcs.eval_defined)) (g, var, len);
|
||||
return cp + paren; /* skip the right paren */
|
||||
}
|
||||
/* fall out */
|
||||
}
|
||||
|
||||
if (isdigit(*cp)) {
|
||||
DO (cp = parse_number (g, cp, valp));
|
||||
} else if (!isvarfirstletter(*cp))
|
||||
return CALLFUNC(g, handle_error) (g, cp, "variable or number");
|
||||
else {
|
||||
DO (cp = parse_variable (g, cp, &var));
|
||||
*valp = (*(g->funcs.eval_variable)) (g, var, cp - var);
|
||||
}
|
||||
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static const char *
|
||||
parse_product (g, cp, valp)
|
||||
IfParser *g;
|
||||
const char *cp;
|
||||
int *valp;
|
||||
{
|
||||
int rightval;
|
||||
|
||||
DO (cp = parse_value (g, cp, valp));
|
||||
SKIPSPACE (cp);
|
||||
|
||||
switch (*cp) {
|
||||
case '*':
|
||||
DO (cp = parse_product (g, cp + 1, &rightval));
|
||||
*valp = (*valp * rightval);
|
||||
break;
|
||||
|
||||
case '/':
|
||||
DO (cp = parse_product (g, cp + 1, &rightval));
|
||||
|
||||
/* Do nothing in the divide-by-zero case. */
|
||||
if (rightval) {
|
||||
*valp = (*valp / rightval);
|
||||
}
|
||||
break;
|
||||
|
||||
case '%':
|
||||
DO (cp = parse_product (g, cp + 1, &rightval));
|
||||
*valp = (*valp % rightval);
|
||||
break;
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
parse_sum (g, cp, valp)
|
||||
IfParser *g;
|
||||
const char *cp;
|
||||
int *valp;
|
||||
{
|
||||
int rightval;
|
||||
|
||||
DO (cp = parse_product (g, cp, valp));
|
||||
SKIPSPACE (cp);
|
||||
|
||||
switch (*cp) {
|
||||
case '+':
|
||||
DO (cp = parse_sum (g, cp + 1, &rightval));
|
||||
*valp = (*valp + rightval);
|
||||
break;
|
||||
|
||||
case '-':
|
||||
DO (cp = parse_sum (g, cp + 1, &rightval));
|
||||
*valp = (*valp - rightval);
|
||||
break;
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
parse_shift (g, cp, valp)
|
||||
IfParser *g;
|
||||
const char *cp;
|
||||
int *valp;
|
||||
{
|
||||
int rightval;
|
||||
|
||||
DO (cp = parse_sum (g, cp, valp));
|
||||
SKIPSPACE (cp);
|
||||
|
||||
switch (*cp) {
|
||||
case '<':
|
||||
if (cp[1] == '<') {
|
||||
DO (cp = parse_shift (g, cp + 2, &rightval));
|
||||
*valp = (*valp << rightval);
|
||||
}
|
||||
break;
|
||||
|
||||
case '>':
|
||||
if (cp[1] == '>') {
|
||||
DO (cp = parse_shift (g, cp + 2, &rightval));
|
||||
*valp = (*valp >> rightval);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
parse_inequality (g, cp, valp)
|
||||
IfParser *g;
|
||||
const char *cp;
|
||||
int *valp;
|
||||
{
|
||||
int rightval;
|
||||
|
||||
DO (cp = parse_shift (g, cp, valp));
|
||||
SKIPSPACE (cp);
|
||||
|
||||
switch (*cp) {
|
||||
case '<':
|
||||
if (cp[1] == '=') {
|
||||
DO (cp = parse_inequality (g, cp + 2, &rightval));
|
||||
*valp = (*valp <= rightval);
|
||||
} else {
|
||||
DO (cp = parse_inequality (g, cp + 1, &rightval));
|
||||
*valp = (*valp < rightval);
|
||||
}
|
||||
break;
|
||||
|
||||
case '>':
|
||||
if (cp[1] == '=') {
|
||||
DO (cp = parse_inequality (g, cp + 2, &rightval));
|
||||
*valp = (*valp >= rightval);
|
||||
} else {
|
||||
DO (cp = parse_inequality (g, cp + 1, &rightval));
|
||||
*valp = (*valp > rightval);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
parse_equality (g, cp, valp)
|
||||
IfParser *g;
|
||||
const char *cp;
|
||||
int *valp;
|
||||
{
|
||||
int rightval;
|
||||
|
||||
DO (cp = parse_inequality (g, cp, valp));
|
||||
SKIPSPACE (cp);
|
||||
|
||||
switch (*cp) {
|
||||
case '=':
|
||||
if (cp[1] == '=')
|
||||
cp++;
|
||||
DO (cp = parse_equality (g, cp + 1, &rightval));
|
||||
*valp = (*valp == rightval);
|
||||
break;
|
||||
|
||||
case '!':
|
||||
if (cp[1] != '=')
|
||||
break;
|
||||
DO (cp = parse_equality (g, cp + 2, &rightval));
|
||||
*valp = (*valp != rightval);
|
||||
break;
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
parse_band (g, cp, valp)
|
||||
IfParser *g;
|
||||
const char *cp;
|
||||
int *valp;
|
||||
{
|
||||
int rightval;
|
||||
|
||||
DO (cp = parse_equality (g, cp, valp));
|
||||
SKIPSPACE (cp);
|
||||
|
||||
switch (*cp) {
|
||||
case '&':
|
||||
if (cp[1] != '&') {
|
||||
DO (cp = parse_band (g, cp + 1, &rightval));
|
||||
*valp = (*valp & rightval);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
parse_bor (g, cp, valp)
|
||||
IfParser *g;
|
||||
const char *cp;
|
||||
int *valp;
|
||||
{
|
||||
int rightval;
|
||||
|
||||
DO (cp = parse_band (g, cp, valp));
|
||||
SKIPSPACE (cp);
|
||||
|
||||
switch (*cp) {
|
||||
case '|':
|
||||
if (cp[1] != '|') {
|
||||
DO (cp = parse_bor (g, cp + 1, &rightval));
|
||||
*valp = (*valp | rightval);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
parse_land (g, cp, valp)
|
||||
IfParser *g;
|
||||
const char *cp;
|
||||
int *valp;
|
||||
{
|
||||
int rightval;
|
||||
|
||||
DO (cp = parse_bor (g, cp, valp));
|
||||
SKIPSPACE (cp);
|
||||
|
||||
switch (*cp) {
|
||||
case '&':
|
||||
if (cp[1] != '&')
|
||||
return CALLFUNC(g, handle_error) (g, cp, "&&");
|
||||
DO (cp = parse_land (g, cp + 2, &rightval));
|
||||
*valp = (*valp && rightval);
|
||||
break;
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
parse_lor (g, cp, valp)
|
||||
IfParser *g;
|
||||
const char *cp;
|
||||
int *valp;
|
||||
{
|
||||
int rightval;
|
||||
|
||||
DO (cp = parse_land (g, cp, valp));
|
||||
SKIPSPACE (cp);
|
||||
|
||||
switch (*cp) {
|
||||
case '|':
|
||||
if (cp[1] != '|')
|
||||
return CALLFUNC(g, handle_error) (g, cp, "||");
|
||||
DO (cp = parse_lor (g, cp + 2, &rightval));
|
||||
*valp = (*valp || rightval);
|
||||
break;
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
External Entry Points
|
||||
****************************************************************************/
|
||||
|
||||
const char *
|
||||
ParseIfExpression (g, cp, valp)
|
||||
IfParser *g;
|
||||
const char *cp;
|
||||
int *valp;
|
||||
{
|
||||
return parse_lor (g, cp, valp);
|
||||
}
|
||||
|
||||
|
||||
76
mozilla/config/mkdepend/ifparser.h
Normal file
76
mozilla/config/mkdepend/ifparser.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* $XConsortium: ifparser.h,v 1.1 92/08/22 13:05:39 rws Exp $
|
||||
*
|
||||
* Copyright 1992 Network Computing Devices, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation for any purpose and without fee is hereby granted, provided
|
||||
* that the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Network Computing Devices may not be
|
||||
* used in advertising or publicity pertaining to distribution of the software
|
||||
* without specific, written prior permission. Network Computing Devices makes
|
||||
* no representations about the suitability of this software for any purpose.
|
||||
* It is provided ``as is'' without express or implied warranty.
|
||||
*
|
||||
* NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
||||
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
|
||||
* IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL,
|
||||
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Author: Jim Fulton
|
||||
* Network Computing Devices, Inc.
|
||||
*
|
||||
* Simple if statement processor
|
||||
*
|
||||
* This module can be used to evaluate string representations of C language
|
||||
* if constructs. It accepts the following grammar:
|
||||
*
|
||||
* EXPRESSION := VALUE
|
||||
* | VALUE BINOP EXPRESSION
|
||||
*
|
||||
* VALUE := '(' EXPRESSION ')'
|
||||
* | '!' VALUE
|
||||
* | '-' VALUE
|
||||
* | 'defined' '(' variable ')'
|
||||
* | variable
|
||||
* | number
|
||||
*
|
||||
* BINOP := '*' | '/' | '%'
|
||||
* | '+' | '-'
|
||||
* | '<<' | '>>'
|
||||
* | '<' | '>' | '<=' | '>='
|
||||
* | '==' | '!='
|
||||
* | '&' | '|'
|
||||
* | '&&' | '||'
|
||||
*
|
||||
* The normal C order of precidence is supported.
|
||||
*
|
||||
*
|
||||
* External Entry Points:
|
||||
*
|
||||
* ParseIfExpression parse a string for #if
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define const /**/
|
||||
typedef int Bool;
|
||||
#define False 0
|
||||
#define True 1
|
||||
|
||||
typedef struct _if_parser {
|
||||
struct { /* functions */
|
||||
char *(*handle_error) (/* struct _if_parser *, const char *,
|
||||
const char * */);
|
||||
int (*eval_variable) (/* struct _if_parser *, const char *, int */);
|
||||
int (*eval_defined) (/* struct _if_parser *, const char *, int */);
|
||||
} funcs;
|
||||
char *data;
|
||||
} IfParser;
|
||||
|
||||
char *ParseIfExpression (/* IfParser *, const char *, int * */);
|
||||
|
||||
727
mozilla/config/mkdepend/imakemdep.h
Normal file
727
mozilla/config/mkdepend/imakemdep.h
Normal file
@@ -0,0 +1,727 @@
|
||||
|
||||
/* $XConsortium: imakemdep.h,v 1.83 95/04/07 19:47:46 kaleb Exp $ */
|
||||
/* $XFree86: xc/config/imake/imakemdep.h,v 3.12 1995/07/08 10:22:17 dawes Exp $ */
|
||||
/*
|
||||
|
||||
Copyright (c) 1993, 1994 X Consortium
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of the X Consortium shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from the X Consortium.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* This file contains machine-dependent constants for the imake utility.
|
||||
* When porting imake, read each of the steps below and add in any necessary
|
||||
* definitions. In general you should *not* edit ccimake.c or imake.c!
|
||||
*/
|
||||
|
||||
#ifdef CCIMAKE
|
||||
/*
|
||||
* Step 1: imake_ccflags
|
||||
* Define any special flags that will be needed to get imake.c to compile.
|
||||
* These will be passed to the compile along with the contents of the
|
||||
* make variable BOOTSTRAPCFLAGS.
|
||||
*/
|
||||
#ifdef hpux
|
||||
#ifdef hp9000s800
|
||||
#define imake_ccflags "-DSYSV"
|
||||
#else
|
||||
#define imake_ccflags "-Wc,-Nd4000,-Ns3000 -DSYSV"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(macII) || defined(_AUX_SOURCE)
|
||||
#define imake_ccflags "-DmacII -DSYSV"
|
||||
#endif
|
||||
|
||||
#ifdef stellar
|
||||
#define imake_ccflags "-DSYSV"
|
||||
#endif
|
||||
|
||||
#if defined(USL) || defined(Oki) || defined(NCR)
|
||||
#define imake_ccflags "-Xc -DSVR4"
|
||||
#endif
|
||||
|
||||
#ifdef sony
|
||||
#if defined(SYSTYPE_SYSV) || defined(_SYSTYPE_SYSV)
|
||||
#define imake_ccflags "-DSVR4"
|
||||
#else
|
||||
#include <sys/param.h>
|
||||
#if NEWSOS < 41
|
||||
#define imake_ccflags "-Dbsd43 -DNOSTDHDRS"
|
||||
#else
|
||||
#if NEWSOS < 42
|
||||
#define imake_ccflags "-Dbsd43"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _CRAY
|
||||
#define imake_ccflags "-DSYSV -DUSG"
|
||||
#endif
|
||||
|
||||
#if defined(_IBMR2) || defined(aix)
|
||||
#define imake_ccflags "-Daix -DSYSV"
|
||||
#endif
|
||||
|
||||
#ifdef Mips
|
||||
# if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43)
|
||||
# define imake_ccflags "-DBSD43"
|
||||
# else
|
||||
# define imake_ccflags "-DSYSV"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef is68k
|
||||
#define imake_ccflags "-Dluna -Duniosb"
|
||||
#endif
|
||||
|
||||
#ifdef SYSV386
|
||||
# ifdef SVR4
|
||||
# define imake_ccflags "-Xc -DSVR4"
|
||||
# else
|
||||
# define imake_ccflags "-DSYSV"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef SVR4
|
||||
# ifdef i386
|
||||
# define imake_ccflags "-Xc -DSVR4"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef SYSV
|
||||
# ifdef i386
|
||||
# define imake_ccflags "-DSYSV"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __convex__
|
||||
#define imake_ccflags "-fn -tm c1"
|
||||
#endif
|
||||
|
||||
#ifdef apollo
|
||||
#define imake_ccflags "-DX_NOT_POSIX"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define imake_ccflags "-nologo -batch -D__STDC__"
|
||||
#endif
|
||||
|
||||
#ifdef __uxp__
|
||||
#define imake_ccflags "-DSVR4 -DANSICPP"
|
||||
#endif
|
||||
|
||||
#ifdef __sxg__
|
||||
#define imake_ccflags "-DSYSV -DUSG -DNOSTDHDRS"
|
||||
#endif
|
||||
|
||||
#ifdef sequent
|
||||
#define imake_ccflags "-DX_NOT_STDC_ENV -DX_NOT_POSIX"
|
||||
#endif
|
||||
|
||||
#ifdef _SEQUENT_
|
||||
#define imake_ccflags "-DSYSV -DUSG"
|
||||
#endif
|
||||
|
||||
#if defined(SX) || defined(PC_UX)
|
||||
#define imake_ccflags "-DSYSV"
|
||||
#endif
|
||||
|
||||
#ifdef nec_ews_svr2
|
||||
#define imake_ccflags "-DUSG"
|
||||
#endif
|
||||
|
||||
#if defined(nec_ews_svr4) || defined(_nec_ews_svr4) || defined(_nec_up) || defined(_nec_ft)
|
||||
#define imake_ccflags "-DSVR4"
|
||||
#endif
|
||||
|
||||
#ifdef MACH
|
||||
#define imake_ccflags "-DNOSTDHDRS"
|
||||
#endif
|
||||
|
||||
/* this is for OS/2 under EMX. This won't work with DOS */
|
||||
#if defined(__EMX__)
|
||||
#define imake_ccflags "-DBSD43"
|
||||
#endif
|
||||
|
||||
#else /* not CCIMAKE */
|
||||
#ifndef MAKEDEPEND
|
||||
/*
|
||||
* Step 2: dup2
|
||||
* If your OS doesn't have a dup2() system call to duplicate one file
|
||||
* descriptor onto another, define such a mechanism here (if you don't
|
||||
* already fall under the existing category(ies).
|
||||
*/
|
||||
#if defined(SYSV) && !defined(_CRAY) && !defined(Mips) && !defined(_SEQUENT_)
|
||||
#define dup2(fd1,fd2) ((fd1 == fd2) ? fd1 : (close(fd2), \
|
||||
fcntl(fd1, F_DUPFD, fd2)))
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Step 3: FIXUP_CPP_WHITESPACE
|
||||
* If your cpp collapses tabs macro expansions into a single space and
|
||||
* replaces escaped newlines with a space, define this symbol. This will
|
||||
* cause imake to attempt to patch up the generated Makefile by looking
|
||||
* for lines that have colons in them (this is why the rules file escapes
|
||||
* all colons). One way to tell if you need this is to see whether or not
|
||||
* your Makefiles have no tabs in them and lots of @@ strings.
|
||||
*/
|
||||
#if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || (defined(AMOEBA) && defined(CROSS_COMPILE))
|
||||
#define FIXUP_CPP_WHITESPACE
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
#define REMOVE_CPP_LEADSPACE
|
||||
#define INLINE_SYNTAX
|
||||
#define MAGIC_MAKE_VARS
|
||||
#endif
|
||||
#ifdef __minix_vmd
|
||||
#define FIXUP_CPP_WHITESPACE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Step 4: USE_CC_E, DEFAULT_CC, DEFAULT_CPP
|
||||
* If you want to use cc -E instead of cpp, define USE_CC_E.
|
||||
* If use cc -E but want a different compiler, define DEFAULT_CC.
|
||||
* If the cpp you need is not in /lib/cpp, define DEFAULT_CPP.
|
||||
*/
|
||||
#ifdef hpux
|
||||
#define USE_CC_E
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
#define USE_CC_E
|
||||
#define DEFAULT_CC "cl"
|
||||
#endif
|
||||
#ifdef apollo
|
||||
#define DEFAULT_CPP "/usr/lib/cpp"
|
||||
#endif
|
||||
#if defined(_IBMR2) && !defined(DEFAULT_CPP)
|
||||
#define DEFAULT_CPP "/usr/lpp/X11/Xamples/util/cpp/cpp"
|
||||
#endif
|
||||
#if defined(sun) && defined(SVR4)
|
||||
#define DEFAULT_CPP "/usr/ccs/lib/cpp"
|
||||
#endif
|
||||
#ifdef __bsdi__
|
||||
#define DEFAULT_CPP "/usr/bin/cpp"
|
||||
#endif
|
||||
#ifdef __uxp__
|
||||
#define DEFAULT_CPP "/usr/ccs/lib/cpp"
|
||||
#endif
|
||||
#ifdef __sxg__
|
||||
#define DEFAULT_CPP "/usr/lib/cpp"
|
||||
#endif
|
||||
#ifdef _CRAY
|
||||
#define DEFAULT_CPP "/lib/pcpp"
|
||||
#endif
|
||||
#if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
|
||||
#define DEFAULT_CPP "/usr/libexec/cpp"
|
||||
#endif
|
||||
#ifdef MACH
|
||||
#define USE_CC_E
|
||||
#endif
|
||||
#ifdef __minix_vmd
|
||||
#define DEFAULT_CPP "/usr/lib/cpp"
|
||||
#endif
|
||||
#if defined(__EMX__)
|
||||
/* expects cpp in PATH */
|
||||
#define DEFAULT_CPP "cpp"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Step 5: cpp_argv
|
||||
* The following table contains the flags that should be passed
|
||||
* whenever a Makefile is being generated. If your preprocessor
|
||||
* doesn't predefine any unique symbols, choose one and add it to the
|
||||
* end of this table. Then, do the following:
|
||||
*
|
||||
* a. Use this symbol in Imake.tmpl when setting MacroFile.
|
||||
* b. Put this symbol in the definition of BootstrapCFlags in your
|
||||
* <platform>.cf file.
|
||||
* c. When doing a make World, always add "BOOTSTRAPCFLAGS=-Dsymbol"
|
||||
* to the end of the command line.
|
||||
*
|
||||
* Note that you may define more than one symbol (useful for platforms
|
||||
* that support multiple operating systems).
|
||||
*/
|
||||
|
||||
#define ARGUMENTS 50 /* number of arguments in various arrays */
|
||||
char *cpp_argv[ARGUMENTS] = {
|
||||
"cc", /* replaced by the actual program to exec */
|
||||
"-I.", /* add current directory to include path */
|
||||
#ifdef unix
|
||||
"-Uunix", /* remove unix symbol so that filename unix.c okay */
|
||||
#endif
|
||||
#if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(MACH)
|
||||
# ifdef __i386__
|
||||
"-D__i386__",
|
||||
# endif
|
||||
# ifdef __GNUC__
|
||||
"-traditional",
|
||||
# endif
|
||||
#endif
|
||||
#ifdef M4330
|
||||
"-DM4330", /* Tektronix */
|
||||
#endif
|
||||
#ifdef M4310
|
||||
"-DM4310", /* Tektronix */
|
||||
#endif
|
||||
#if defined(macII) || defined(_AUX_SOURCE)
|
||||
"-DmacII", /* Apple A/UX */
|
||||
#endif
|
||||
#ifdef USL
|
||||
"-DUSL", /* USL */
|
||||
#endif
|
||||
#ifdef sony
|
||||
"-Dsony", /* Sony */
|
||||
#if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV) && NEWSOS < 42
|
||||
"-Dbsd43",
|
||||
#endif
|
||||
#endif
|
||||
#ifdef _IBMR2
|
||||
"-D_IBMR2", /* IBM RS-6000 (we ensured that aix is defined above */
|
||||
#ifndef aix
|
||||
#define aix /* allow BOOTSTRAPCFLAGS="-D_IBMR2" */
|
||||
#endif
|
||||
#endif /* _IBMR2 */
|
||||
#ifdef aix
|
||||
"-Daix", /* AIX instead of AOS */
|
||||
#ifndef ibm
|
||||
#define ibm /* allow BOOTSTRAPCFLAGS="-Daix" */
|
||||
#endif
|
||||
#endif /* aix */
|
||||
#ifdef ibm
|
||||
"-Dibm", /* IBM PS/2 and RT under both AOS and AIX */
|
||||
#endif
|
||||
#ifdef luna
|
||||
"-Dluna", /* OMRON luna 68K and 88K */
|
||||
#ifdef luna1
|
||||
"-Dluna1",
|
||||
#endif
|
||||
#ifdef luna88k /* need not on UniOS-Mach Vers. 1.13 */
|
||||
"-traditional", /* for some older version */
|
||||
#endif /* instead of "-DXCOMM=\\#" */
|
||||
#ifdef uniosb
|
||||
"-Duniosb",
|
||||
#endif
|
||||
#ifdef uniosu
|
||||
"-Duniosu",
|
||||
#endif
|
||||
#endif /* luna */
|
||||
#ifdef _CRAY /* Cray */
|
||||
"-Ucray",
|
||||
#endif
|
||||
#ifdef Mips
|
||||
"-DMips", /* Define and use Mips for Mips Co. OS/mach. */
|
||||
# if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43)
|
||||
"-DBSD43", /* Mips RISCOS supports two environments */
|
||||
# else
|
||||
"-DSYSV", /* System V environment is the default */
|
||||
# endif
|
||||
#endif /* Mips */
|
||||
#ifdef MOTOROLA
|
||||
"-DMOTOROLA", /* Motorola Delta Systems */
|
||||
# ifdef SYSV
|
||||
"-DSYSV",
|
||||
# endif
|
||||
# ifdef SVR4
|
||||
"-DSVR4",
|
||||
# endif
|
||||
#endif /* MOTOROLA */
|
||||
#ifdef i386
|
||||
"-Di386",
|
||||
# ifdef SVR4
|
||||
"-DSVR4",
|
||||
# endif
|
||||
# ifdef SYSV
|
||||
"-DSYSV",
|
||||
# ifdef ISC
|
||||
"-DISC",
|
||||
# ifdef ISC40
|
||||
"-DISC40", /* ISC 4.0 */
|
||||
# else
|
||||
# ifdef ISC202
|
||||
"-DISC202", /* ISC 2.0.2 */
|
||||
# else
|
||||
# ifdef ISC30
|
||||
"-DISC30", /* ISC 3.0 */
|
||||
# else
|
||||
"-DISC22", /* ISC 2.2.1 */
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# ifdef SCO
|
||||
"-DSCO",
|
||||
# ifdef SCO324
|
||||
"-DSCO324",
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# ifdef ESIX
|
||||
"-DESIX",
|
||||
# endif
|
||||
# ifdef ATT
|
||||
"-DATT",
|
||||
# endif
|
||||
# ifdef DELL
|
||||
"-DDELL",
|
||||
# endif
|
||||
#endif
|
||||
#ifdef SYSV386 /* System V/386 folks, obsolete */
|
||||
"-Di386",
|
||||
# ifdef SVR4
|
||||
"-DSVR4",
|
||||
# endif
|
||||
# ifdef ISC
|
||||
"-DISC",
|
||||
# ifdef ISC40
|
||||
"-DISC40", /* ISC 4.0 */
|
||||
# else
|
||||
# ifdef ISC202
|
||||
"-DISC202", /* ISC 2.0.2 */
|
||||
# else
|
||||
# ifdef ISC30
|
||||
"-DISC30", /* ISC 3.0 */
|
||||
# else
|
||||
"-DISC22", /* ISC 2.2.1 */
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# ifdef SCO
|
||||
"-DSCO",
|
||||
# ifdef SCO324
|
||||
"-DSCO324",
|
||||
# endif
|
||||
# endif
|
||||
# ifdef ESIX
|
||||
"-DESIX",
|
||||
# endif
|
||||
# ifdef ATT
|
||||
"-DATT",
|
||||
# endif
|
||||
# ifdef DELL
|
||||
"-DDELL",
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __osf__
|
||||
"-D__osf__",
|
||||
# ifdef __mips__
|
||||
"-D__mips__",
|
||||
# endif
|
||||
# ifdef __alpha
|
||||
"-D__alpha",
|
||||
# endif
|
||||
# ifdef __i386__
|
||||
"-D__i386__",
|
||||
# endif
|
||||
# ifdef __GNUC__
|
||||
"-traditional",
|
||||
# endif
|
||||
#endif
|
||||
#ifdef Oki
|
||||
"-DOki",
|
||||
#endif
|
||||
#ifdef sun
|
||||
#ifdef SVR4
|
||||
"-DSVR4",
|
||||
#endif
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
"-DWIN32",
|
||||
"-nologo",
|
||||
"-batch",
|
||||
"-D__STDC__",
|
||||
#endif
|
||||
#ifdef NCR
|
||||
"-DNCR", /* NCR */
|
||||
#endif
|
||||
#ifdef linux
|
||||
"-traditional",
|
||||
"-Dlinux",
|
||||
#endif
|
||||
#ifdef __uxp__
|
||||
"-D__uxp__",
|
||||
#endif
|
||||
#ifdef __sxg__
|
||||
"-D__sxg__",
|
||||
#endif
|
||||
#ifdef nec_ews_svr2
|
||||
"-Dnec_ews_svr2",
|
||||
#endif
|
||||
#ifdef AMOEBA
|
||||
"-DAMOEBA",
|
||||
# ifdef CROSS_COMPILE
|
||||
"-DCROSS_COMPILE",
|
||||
# ifdef CROSS_i80386
|
||||
"-Di80386",
|
||||
# endif
|
||||
# ifdef CROSS_sparc
|
||||
"-Dsparc",
|
||||
# endif
|
||||
# ifdef CROSS_mc68000
|
||||
"-Dmc68000",
|
||||
# endif
|
||||
# else
|
||||
# ifdef i80386
|
||||
"-Di80386",
|
||||
# endif
|
||||
# ifdef sparc
|
||||
"-Dsparc",
|
||||
# endif
|
||||
# ifdef mc68000
|
||||
"-Dmc68000",
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __minix_vmd
|
||||
"-Dminix",
|
||||
#endif
|
||||
|
||||
#if defined(__EMX__)
|
||||
"-traditional",
|
||||
"-Demxos2",
|
||||
#endif
|
||||
|
||||
};
|
||||
#else /* else MAKEDEPEND */
|
||||
/*
|
||||
* Step 6: predefs
|
||||
* If your compiler and/or preprocessor define any specific symbols, add
|
||||
* them to the the following table. The definition of struct symtab is
|
||||
* in util/makedepend/def.h.
|
||||
*/
|
||||
struct symtab predefs[] = {
|
||||
#ifdef apollo
|
||||
{"apollo", "1"},
|
||||
#endif
|
||||
#ifdef ibm032
|
||||
{"ibm032", "1"},
|
||||
#endif
|
||||
#ifdef ibm
|
||||
{"ibm", "1"},
|
||||
#endif
|
||||
#ifdef aix
|
||||
{"aix", "1"},
|
||||
#endif
|
||||
#ifdef sun
|
||||
{"sun", "1"},
|
||||
#endif
|
||||
#ifdef sun2
|
||||
{"sun2", "1"},
|
||||
#endif
|
||||
#ifdef sun3
|
||||
{"sun3", "1"},
|
||||
#endif
|
||||
#ifdef sun4
|
||||
{"sun4", "1"},
|
||||
#endif
|
||||
#ifdef sparc
|
||||
{"sparc", "1"},
|
||||
#endif
|
||||
#ifdef __sparc__
|
||||
{"__sparc__", "1"},
|
||||
#endif
|
||||
#ifdef hpux
|
||||
{"hpux", "1"},
|
||||
#endif
|
||||
#ifdef __hpux
|
||||
{"__hpux", "1"},
|
||||
#endif
|
||||
#ifdef __hp9000s800
|
||||
{"__hp9000s800", "1"},
|
||||
#endif
|
||||
#ifdef __hp9000s700
|
||||
{"__hp9000s700", "1"},
|
||||
#endif
|
||||
#ifdef vax
|
||||
{"vax", "1"},
|
||||
#endif
|
||||
#ifdef VMS
|
||||
{"VMS", "1"},
|
||||
#endif
|
||||
#ifdef cray
|
||||
{"cray", "1"},
|
||||
#endif
|
||||
#ifdef CRAY
|
||||
{"CRAY", "1"},
|
||||
#endif
|
||||
#ifdef _CRAY
|
||||
{"_CRAY", "1"},
|
||||
#endif
|
||||
#ifdef att
|
||||
{"att", "1"},
|
||||
#endif
|
||||
#ifdef mips
|
||||
{"mips", "1"},
|
||||
#endif
|
||||
#ifdef __mips__
|
||||
{"__mips__", "1"},
|
||||
#endif
|
||||
#ifdef ultrix
|
||||
{"ultrix", "1"},
|
||||
#endif
|
||||
#ifdef stellar
|
||||
{"stellar", "1"},
|
||||
#endif
|
||||
#ifdef mc68000
|
||||
{"mc68000", "1"},
|
||||
#endif
|
||||
#ifdef mc68020
|
||||
{"mc68020", "1"},
|
||||
#endif
|
||||
#ifdef __GNUC__
|
||||
{"__GNUC__", "1"},
|
||||
#endif
|
||||
#if __STDC__
|
||||
{"__STDC__", "1"},
|
||||
#endif
|
||||
#ifdef __HIGHC__
|
||||
{"__HIGHC__", "1"},
|
||||
#endif
|
||||
#ifdef CMU
|
||||
{"CMU", "1"},
|
||||
#endif
|
||||
#ifdef luna
|
||||
{"luna", "1"},
|
||||
#ifdef luna1
|
||||
{"luna1", "1"},
|
||||
#endif
|
||||
#ifdef luna2
|
||||
{"luna2", "1"},
|
||||
#endif
|
||||
#ifdef luna88k
|
||||
{"luna88k", "1"},
|
||||
#endif
|
||||
#ifdef uniosb
|
||||
{"uniosb", "1"},
|
||||
#endif
|
||||
#ifdef uniosu
|
||||
{"uniosu", "1"},
|
||||
#endif
|
||||
#endif
|
||||
#ifdef ieeep754
|
||||
{"ieeep754", "1"},
|
||||
#endif
|
||||
#ifdef is68k
|
||||
{"is68k", "1"},
|
||||
#endif
|
||||
#ifdef m68k
|
||||
{"m68k", "1"},
|
||||
#endif
|
||||
#ifdef m88k
|
||||
{"m88k", "1"},
|
||||
#endif
|
||||
#ifdef __m88k__
|
||||
{"__m88k__", "1"},
|
||||
#endif
|
||||
#ifdef bsd43
|
||||
{"bsd43", "1"},
|
||||
#endif
|
||||
#ifdef hcx
|
||||
{"hcx", "1"},
|
||||
#endif
|
||||
#ifdef sony
|
||||
{"sony", "1"},
|
||||
#ifdef SYSTYPE_SYSV
|
||||
{"SYSTYPE_SYSV", "1"},
|
||||
#endif
|
||||
#ifdef _SYSTYPE_SYSV
|
||||
{"_SYSTYPE_SYSV", "1"},
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __OSF__
|
||||
{"__OSF__", "1"},
|
||||
#endif
|
||||
#ifdef __osf__
|
||||
{"__osf__", "1"},
|
||||
#endif
|
||||
#ifdef __alpha
|
||||
{"__alpha", "1"},
|
||||
#endif
|
||||
#ifdef __DECC
|
||||
{"__DECC", "1"},
|
||||
#endif
|
||||
#ifdef __decc
|
||||
{"__decc", "1"},
|
||||
#endif
|
||||
#ifdef __uxp__
|
||||
{"__uxp__", "1"},
|
||||
#endif
|
||||
#ifdef __sxg__
|
||||
{"__sxg__", "1"},
|
||||
#endif
|
||||
#ifdef _SEQUENT_
|
||||
{"_SEQUENT_", "1"},
|
||||
{"__STDC__", "1"},
|
||||
#endif
|
||||
#ifdef __bsdi__
|
||||
{"__bsdi__", "1"},
|
||||
#endif
|
||||
#ifdef nec_ews_svr2
|
||||
{"nec_ews_svr2", "1"},
|
||||
#endif
|
||||
#ifdef nec_ews_svr4
|
||||
{"nec_ews_svr4", "1"},
|
||||
#endif
|
||||
#ifdef _nec_ews_svr4
|
||||
{"_nec_ews_svr4", "1"},
|
||||
#endif
|
||||
#ifdef _nec_up
|
||||
{"_nec_up", "1"},
|
||||
#endif
|
||||
#ifdef SX
|
||||
{"SX", "1"},
|
||||
#endif
|
||||
#ifdef nec
|
||||
{"nec", "1"},
|
||||
#endif
|
||||
#ifdef _nec_ft
|
||||
{"_nec_ft", "1"},
|
||||
#endif
|
||||
#ifdef PC_UX
|
||||
{"PC_UX", "1"},
|
||||
#endif
|
||||
#ifdef sgi
|
||||
{"sgi", "1"},
|
||||
#endif
|
||||
#ifdef __sgi
|
||||
{"__sgi", "1"},
|
||||
#endif
|
||||
#ifdef __FreeBSD__
|
||||
{"__FreeBSD__", "1"},
|
||||
#endif
|
||||
#ifdef __NetBSD__
|
||||
{"__NetBSD__", "1"},
|
||||
#endif
|
||||
#ifdef __EMX__
|
||||
{"__EMX__", "1"},
|
||||
#endif
|
||||
/* add any additional symbols before this line */
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
#endif /* MAKEDEPEND */
|
||||
#endif /* CCIMAKE */
|
||||
308
mozilla/config/mkdepend/include.c
Normal file
308
mozilla/config/mkdepend/include.c
Normal file
@@ -0,0 +1,308 @@
|
||||
/* $XConsortium: include.c,v 1.17 94/12/05 19:33:08 gildea Exp $ */
|
||||
/*
|
||||
|
||||
Copyright (c) 1993, 1994 X Consortium
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of the X Consortium shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from the X Consortium.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "def.h"
|
||||
|
||||
extern struct inclist inclist[ MAXFILES ],
|
||||
*inclistp;
|
||||
extern char *includedirs[ ];
|
||||
extern char *notdotdot[ ];
|
||||
extern boolean show_where_not;
|
||||
extern boolean warn_multiple;
|
||||
|
||||
struct inclist *inc_path(file, include, dot)
|
||||
register char *file,
|
||||
*include;
|
||||
boolean dot;
|
||||
{
|
||||
static char path[ BUFSIZ ];
|
||||
register char **pp, *p;
|
||||
register struct inclist *ip;
|
||||
struct stat st;
|
||||
boolean found = FALSE;
|
||||
|
||||
/*
|
||||
* Check all previously found include files for a path that
|
||||
* has already been expanded.
|
||||
*/
|
||||
for (ip = inclist; ip->i_file; ip++)
|
||||
if ((strcmp(ip->i_incstring, include) == 0) && !ip->i_included_sym)
|
||||
{
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the path was surrounded by "" or is an absolute path,
|
||||
* then check the exact path provided.
|
||||
*/
|
||||
if (!found && (dot || *include == '/')) {
|
||||
if (stat(include, &st) == 0) {
|
||||
ip = newinclude(include, include);
|
||||
found = TRUE;
|
||||
}
|
||||
else if (show_where_not)
|
||||
warning1("\tnot in %s\n", include);
|
||||
}
|
||||
|
||||
/*
|
||||
* See if this include file is in the directory of the
|
||||
* file being compiled.
|
||||
*/
|
||||
if (!found) {
|
||||
for (p=file+strlen(file); p>file; p--)
|
||||
if (*p == '/')
|
||||
break;
|
||||
if (p == file)
|
||||
strcpy(path, include);
|
||||
else {
|
||||
strncpy(path, file, (p-file) + 1);
|
||||
path[ (p-file) + 1 ] = '\0';
|
||||
strcpy(path + (p-file) + 1, include);
|
||||
}
|
||||
remove_dotdot(path);
|
||||
if (stat(path, &st) == 0) {
|
||||
ip = newinclude(path, include);
|
||||
found = TRUE;
|
||||
}
|
||||
else if (show_where_not)
|
||||
warning1("\tnot in %s\n", path);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check the include directories specified. (standard include dir
|
||||
* should be at the end.)
|
||||
*/
|
||||
if (!found)
|
||||
for (pp = includedirs; *pp; pp++) {
|
||||
sprintf(path, "%s/%s", *pp, include);
|
||||
remove_dotdot(path);
|
||||
if (stat(path, &st) == 0) {
|
||||
ip = newinclude(path, include);
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
else if (show_where_not)
|
||||
warning1("\tnot in %s\n", path);
|
||||
}
|
||||
|
||||
if (!found)
|
||||
ip = NULL;
|
||||
return(ip);
|
||||
}
|
||||
|
||||
/*
|
||||
* Occasionally, pathnames are created that look like .../x/../y
|
||||
* Any of the 'x/..' sequences within the name can be eliminated.
|
||||
* (but only if 'x' is not a symbolic link!!)
|
||||
*/
|
||||
remove_dotdot(path)
|
||||
char *path;
|
||||
{
|
||||
register char *end, *from, *to, **cp;
|
||||
char *components[ MAXFILES ],
|
||||
newpath[ BUFSIZ ];
|
||||
boolean component_copied;
|
||||
|
||||
/*
|
||||
* slice path up into components.
|
||||
*/
|
||||
to = newpath;
|
||||
if (*path == '/')
|
||||
*to++ = '/';
|
||||
*to = '\0';
|
||||
cp = components;
|
||||
for (from=end=path; *end; end++)
|
||||
if (*end == '/') {
|
||||
while (*end == '/')
|
||||
*end++ = '\0';
|
||||
if (*from)
|
||||
*cp++ = from;
|
||||
from = end;
|
||||
}
|
||||
*cp++ = from;
|
||||
*cp = NULL;
|
||||
|
||||
/*
|
||||
* Recursively remove all 'x/..' component pairs.
|
||||
*/
|
||||
cp = components;
|
||||
while(*cp) {
|
||||
if (!isdot(*cp) && !isdotdot(*cp) && isdotdot(*(cp+1))
|
||||
&& !issymbolic(newpath, *cp))
|
||||
{
|
||||
char **fp = cp + 2;
|
||||
char **tp = cp;
|
||||
|
||||
do
|
||||
*tp++ = *fp; /* move all the pointers down */
|
||||
while (*fp++);
|
||||
if (cp != components)
|
||||
cp--; /* go back and check for nested ".." */
|
||||
} else {
|
||||
cp++;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Concatenate the remaining path elements.
|
||||
*/
|
||||
cp = components;
|
||||
component_copied = FALSE;
|
||||
while(*cp) {
|
||||
if (component_copied)
|
||||
*to++ = '/';
|
||||
component_copied = TRUE;
|
||||
for (from = *cp; *from; )
|
||||
*to++ = *from++;
|
||||
*to = '\0';
|
||||
cp++;
|
||||
}
|
||||
*to++ = '\0';
|
||||
|
||||
/*
|
||||
* copy the reconstituted path back to our pointer.
|
||||
*/
|
||||
strcpy(path, newpath);
|
||||
}
|
||||
|
||||
isdot(p)
|
||||
register char *p;
|
||||
{
|
||||
if(p && *p++ == '.' && *p++ == '\0')
|
||||
return(TRUE);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
isdotdot(p)
|
||||
register char *p;
|
||||
{
|
||||
if(p && *p++ == '.' && *p++ == '.' && *p++ == '\0')
|
||||
return(TRUE);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
issymbolic(dir, component)
|
||||
register char *dir, *component;
|
||||
{
|
||||
#ifdef S_IFLNK
|
||||
struct stat st;
|
||||
char buf[ BUFSIZ ], **pp;
|
||||
|
||||
sprintf(buf, "%s%s%s", dir, *dir ? "/" : "", component);
|
||||
for (pp=notdotdot; *pp; pp++)
|
||||
if (strcmp(*pp, buf) == 0)
|
||||
return (TRUE);
|
||||
if (lstat(buf, &st) == 0
|
||||
&& (st.st_mode & S_IFMT) == S_IFLNK) {
|
||||
*pp++ = copy(buf);
|
||||
if (pp >= ¬dotdot[ MAXDIRS ])
|
||||
fatalerr("out of .. dirs, increase MAXDIRS\n");
|
||||
return(TRUE);
|
||||
}
|
||||
#endif
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add an include file to the list of those included by 'file'.
|
||||
*/
|
||||
struct inclist *newinclude(newfile, incstring)
|
||||
register char *newfile, *incstring;
|
||||
{
|
||||
register struct inclist *ip;
|
||||
|
||||
/*
|
||||
* First, put this file on the global list of include files.
|
||||
*/
|
||||
ip = inclistp++;
|
||||
if (inclistp == inclist + MAXFILES - 1)
|
||||
fatalerr("out of space: increase MAXFILES\n");
|
||||
ip->i_file = copy(newfile);
|
||||
ip->i_included_sym = FALSE;
|
||||
if (incstring == NULL)
|
||||
ip->i_incstring = ip->i_file;
|
||||
else
|
||||
ip->i_incstring = copy(incstring);
|
||||
|
||||
return(ip);
|
||||
}
|
||||
|
||||
included_by(ip, newfile)
|
||||
register struct inclist *ip, *newfile;
|
||||
{
|
||||
register i;
|
||||
|
||||
if (ip == NULL)
|
||||
return;
|
||||
/*
|
||||
* Put this include file (newfile) on the list of files included
|
||||
* by 'file'. If 'file' is NULL, then it is not an include
|
||||
* file itself (i.e. was probably mentioned on the command line).
|
||||
* If it is already on the list, don't stick it on again.
|
||||
*/
|
||||
if (ip->i_list == NULL)
|
||||
ip->i_list = (struct inclist **)
|
||||
malloc(sizeof(struct inclist *) * ++ip->i_listlen);
|
||||
else {
|
||||
for (i=0; i<ip->i_listlen; i++)
|
||||
if (ip->i_list[ i ] == newfile) {
|
||||
i = strlen(newfile->i_file);
|
||||
if (!ip->i_included_sym &&
|
||||
!(i > 2 &&
|
||||
newfile->i_file[i-1] == 'c' &&
|
||||
newfile->i_file[i-2] == '.'))
|
||||
{
|
||||
/* only complain if ip has */
|
||||
/* no #include SYMBOL lines */
|
||||
/* and is not a .c file */
|
||||
if (warn_multiple)
|
||||
{
|
||||
warning("%s includes %s more than once!\n",
|
||||
ip->i_file, newfile->i_file);
|
||||
warning1("Already have\n");
|
||||
for (i=0; i<ip->i_listlen; i++)
|
||||
warning1("\t%s\n", ip->i_list[i]->i_file);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
ip->i_list = (struct inclist **) realloc(ip->i_list,
|
||||
sizeof(struct inclist *) * ++ip->i_listlen);
|
||||
}
|
||||
ip->i_list[ ip->i_listlen-1 ] = newfile;
|
||||
}
|
||||
|
||||
inc_clean ()
|
||||
{
|
||||
register struct inclist *ip;
|
||||
|
||||
for (ip = inclist; ip < inclistp; ip++) {
|
||||
ip->i_marked = FALSE;
|
||||
}
|
||||
}
|
||||
710
mozilla/config/mkdepend/main.c
Normal file
710
mozilla/config/mkdepend/main.c
Normal file
@@ -0,0 +1,710 @@
|
||||
/* $XConsortium: main.c,v 1.84 94/11/30 16:10:44 kaleb Exp $ */
|
||||
/* $XFree86: xc/config/makedepend/main.c,v 3.4 1995/07/15 14:53:49 dawes Exp $ */
|
||||
/*
|
||||
|
||||
Copyright (c) 1993, 1994 X Consortium
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of the X Consortium shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from the X Consortium.
|
||||
|
||||
*/
|
||||
|
||||
#include "def.h"
|
||||
#ifdef hpux
|
||||
#define sigvec sigvector
|
||||
#endif /* hpux */
|
||||
|
||||
#ifdef X_POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE X_POSIX_C_SOURCE
|
||||
#include <signal.h>
|
||||
#undef _POSIX_C_SOURCE
|
||||
#else
|
||||
#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE)
|
||||
#include <signal.h>
|
||||
#else
|
||||
#define _POSIX_SOURCE
|
||||
#include <signal.h>
|
||||
#undef _POSIX_SOURCE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if NeedVarargsPrototypes
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#ifdef MINIX
|
||||
#define USE_CHMOD 1
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
int _debugmask;
|
||||
#endif
|
||||
|
||||
char *ProgramName;
|
||||
|
||||
char *directives[] = {
|
||||
"if",
|
||||
"ifdef",
|
||||
"ifndef",
|
||||
"else",
|
||||
"endif",
|
||||
"define",
|
||||
"undef",
|
||||
"include",
|
||||
"line",
|
||||
"pragma",
|
||||
"error",
|
||||
"ident",
|
||||
"sccs",
|
||||
"elif",
|
||||
"eject",
|
||||
NULL
|
||||
};
|
||||
|
||||
#define MAKEDEPEND
|
||||
#include "imakemdep.h" /* from config sources */
|
||||
#undef MAKEDEPEND
|
||||
|
||||
struct inclist inclist[ MAXFILES ],
|
||||
*inclistp = inclist,
|
||||
maininclist;
|
||||
|
||||
char *filelist[ MAXFILES ];
|
||||
char *includedirs[ MAXDIRS + 1 ];
|
||||
char *notdotdot[ MAXDIRS ];
|
||||
char *objprefix = "";
|
||||
char *objsuffix = OBJSUFFIX;
|
||||
char *startat = "# DO NOT DELETE";
|
||||
int width = 78;
|
||||
boolean append = FALSE;
|
||||
boolean printed = FALSE;
|
||||
boolean verbose = FALSE;
|
||||
boolean show_where_not = FALSE;
|
||||
boolean warn_multiple = FALSE; /* Warn on multiple includes of same file */
|
||||
|
||||
static
|
||||
#ifdef SIGNALRETURNSINT
|
||||
int
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
catch (sig)
|
||||
int sig;
|
||||
{
|
||||
fflush (stdout);
|
||||
fatalerr ("got signal %d\n", sig);
|
||||
}
|
||||
|
||||
#if defined(USG) || (defined(i386) && defined(SYSV)) || defined(WIN32) || defined(__EMX__) || defined(Lynx_22)
|
||||
#define USGISH
|
||||
#endif
|
||||
|
||||
#ifndef USGISH
|
||||
#ifndef _POSIX_SOURCE
|
||||
#define sigaction sigvec
|
||||
#define sa_handler sv_handler
|
||||
#define sa_mask sv_mask
|
||||
#define sa_flags sv_flags
|
||||
#endif
|
||||
struct sigaction sig_act;
|
||||
#endif /* USGISH */
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
register char **fp = filelist;
|
||||
register char **incp = includedirs;
|
||||
register char *p;
|
||||
register struct inclist *ip;
|
||||
char *makefile = NULL;
|
||||
struct filepointer *filecontent;
|
||||
struct symtab *psymp = predefs;
|
||||
char *endmarker = NULL;
|
||||
char *defincdir = NULL;
|
||||
|
||||
ProgramName = argv[0];
|
||||
|
||||
while (psymp->s_name)
|
||||
{
|
||||
define2(psymp->s_name, psymp->s_value, &maininclist);
|
||||
psymp++;
|
||||
}
|
||||
if (argc == 2 && argv[1][0] == '@') {
|
||||
struct stat ast;
|
||||
int afd;
|
||||
char *args;
|
||||
char **nargv;
|
||||
int nargc;
|
||||
char quotechar = '\0';
|
||||
|
||||
nargc = 1;
|
||||
if ((afd = open(argv[1]+1, O_RDONLY)) < 0)
|
||||
fatalerr("cannot open \"%s\"\n", argv[1]+1);
|
||||
fstat(afd, &ast);
|
||||
args = (char *)malloc(ast.st_size + 1);
|
||||
if ((ast.st_size = read(afd, args, ast.st_size)) < 0)
|
||||
fatalerr("failed to read %s\n", argv[1]+1);
|
||||
args[ast.st_size] = '\0';
|
||||
close(afd);
|
||||
for (p = args; *p; p++) {
|
||||
if (quotechar) {
|
||||
if (quotechar == '\\' ||
|
||||
(*p == quotechar && p[-1] != '\\'))
|
||||
quotechar = '\0';
|
||||
continue;
|
||||
}
|
||||
switch (*p) {
|
||||
case '\\':
|
||||
case '"':
|
||||
case '\'':
|
||||
quotechar = *p;
|
||||
break;
|
||||
case ' ':
|
||||
case '\n':
|
||||
*p = '\0';
|
||||
if (p > args && p[-1])
|
||||
nargc++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (p[-1])
|
||||
nargc++;
|
||||
nargv = (char **)malloc(nargc * sizeof(char *));
|
||||
nargv[0] = argv[0];
|
||||
argc = 1;
|
||||
for (p = args; argc < nargc; p += strlen(p) + 1)
|
||||
if (*p) nargv[argc++] = p;
|
||||
argv = nargv;
|
||||
}
|
||||
for(argc--, argv++; argc; argc--, argv++) {
|
||||
/* if looking for endmarker then check before parsing */
|
||||
if (endmarker && strcmp (endmarker, *argv) == 0) {
|
||||
endmarker = NULL;
|
||||
continue;
|
||||
}
|
||||
if (**argv != '-') {
|
||||
/* treat +thing as an option for C++ */
|
||||
if (endmarker && **argv == '+')
|
||||
continue;
|
||||
*fp++ = argv[0];
|
||||
continue;
|
||||
}
|
||||
switch(argv[0][1]) {
|
||||
case '-':
|
||||
endmarker = &argv[0][2];
|
||||
if (endmarker[0] == '\0') endmarker = "--";
|
||||
break;
|
||||
case 'D':
|
||||
if (argv[0][2] == '\0') {
|
||||
argv++;
|
||||
argc--;
|
||||
}
|
||||
for (p=argv[0] + 2; *p ; p++)
|
||||
if (*p == '=') {
|
||||
*p = ' ';
|
||||
break;
|
||||
}
|
||||
define(argv[0] + 2, &maininclist);
|
||||
break;
|
||||
case 'I':
|
||||
if (incp >= includedirs + MAXDIRS)
|
||||
fatalerr("Too many -I flags.\n");
|
||||
*incp++ = argv[0]+2;
|
||||
if (**(incp-1) == '\0') {
|
||||
*(incp-1) = *(++argv);
|
||||
argc--;
|
||||
}
|
||||
break;
|
||||
case 'Y':
|
||||
defincdir = argv[0]+2;
|
||||
break;
|
||||
/* do not use if endmarker processing */
|
||||
case 'a':
|
||||
if (endmarker) break;
|
||||
append = TRUE;
|
||||
break;
|
||||
case 'w':
|
||||
if (endmarker) break;
|
||||
if (argv[0][2] == '\0') {
|
||||
argv++;
|
||||
argc--;
|
||||
width = atoi(argv[0]);
|
||||
} else
|
||||
width = atoi(argv[0]+2);
|
||||
break;
|
||||
case 'o':
|
||||
if (endmarker) break;
|
||||
if (argv[0][2] == '\0') {
|
||||
argv++;
|
||||
argc--;
|
||||
objsuffix = argv[0];
|
||||
} else
|
||||
objsuffix = argv[0]+2;
|
||||
break;
|
||||
case 'p':
|
||||
if (endmarker) break;
|
||||
if (argv[0][2] == '\0') {
|
||||
argv++;
|
||||
argc--;
|
||||
objprefix = argv[0];
|
||||
} else
|
||||
objprefix = argv[0]+2;
|
||||
break;
|
||||
case 'v':
|
||||
if (endmarker) break;
|
||||
verbose = TRUE;
|
||||
#ifdef DEBUG
|
||||
if (argv[0][2])
|
||||
_debugmask = atoi(argv[0]+2);
|
||||
#endif
|
||||
break;
|
||||
case 's':
|
||||
if (endmarker) break;
|
||||
startat = argv[0]+2;
|
||||
if (*startat == '\0') {
|
||||
startat = *(++argv);
|
||||
argc--;
|
||||
}
|
||||
if (*startat != '#')
|
||||
fatalerr("-s flag's value should start %s\n",
|
||||
"with '#'.");
|
||||
break;
|
||||
case 'f':
|
||||
if (endmarker) break;
|
||||
makefile = argv[0]+2;
|
||||
if (*makefile == '\0') {
|
||||
makefile = *(++argv);
|
||||
argc--;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
warn_multiple = TRUE;
|
||||
break;
|
||||
|
||||
/* Ignore -O, -g so we can just pass ${CFLAGS} to
|
||||
makedepend
|
||||
*/
|
||||
case 'O':
|
||||
case 'g':
|
||||
break;
|
||||
default:
|
||||
if (endmarker) break;
|
||||
/* fatalerr("unknown opt = %s\n", argv[0]); */
|
||||
warning("ignoring option %s\n", argv[0]);
|
||||
}
|
||||
}
|
||||
if (!defincdir) {
|
||||
#ifdef PREINCDIR
|
||||
if (incp >= includedirs + MAXDIRS)
|
||||
fatalerr("Too many -I flags.\n");
|
||||
*incp++ = PREINCDIR;
|
||||
#endif
|
||||
if (incp >= includedirs + MAXDIRS)
|
||||
fatalerr("Too many -I flags.\n");
|
||||
*incp++ = INCLUDEDIR;
|
||||
#ifdef POSTINCDIR
|
||||
if (incp >= includedirs + MAXDIRS)
|
||||
fatalerr("Too many -I flags.\n");
|
||||
*incp++ = POSTINCDIR;
|
||||
#endif
|
||||
} else if (*defincdir) {
|
||||
if (incp >= includedirs + MAXDIRS)
|
||||
fatalerr("Too many -I flags.\n");
|
||||
*incp++ = defincdir;
|
||||
}
|
||||
|
||||
redirect(startat, makefile);
|
||||
|
||||
/*
|
||||
* catch signals.
|
||||
*/
|
||||
#ifdef USGISH
|
||||
/* should really reset SIGINT to SIG_IGN if it was. */
|
||||
#ifdef SIGHUP
|
||||
signal (SIGHUP, catch);
|
||||
#endif
|
||||
signal (SIGINT, catch);
|
||||
#ifdef SIGQUIT
|
||||
signal (SIGQUIT, catch);
|
||||
#endif
|
||||
signal (SIGILL, catch);
|
||||
#ifdef SIGBUS
|
||||
signal (SIGBUS, catch);
|
||||
#endif
|
||||
signal (SIGSEGV, catch);
|
||||
#ifdef SIGSYS
|
||||
signal (SIGSYS, catch);
|
||||
#endif
|
||||
signal (SIGFPE, catch);
|
||||
#else
|
||||
sig_act.sa_handler = catch;
|
||||
#ifdef _POSIX_SOURCE
|
||||
sigemptyset(&sig_act.sa_mask);
|
||||
sigaddset(&sig_act.sa_mask, SIGINT);
|
||||
sigaddset(&sig_act.sa_mask, SIGQUIT);
|
||||
#ifdef SIGBUS
|
||||
sigaddset(&sig_act.sa_mask, SIGBUS);
|
||||
#endif
|
||||
sigaddset(&sig_act.sa_mask, SIGILL);
|
||||
sigaddset(&sig_act.sa_mask, SIGSEGV);
|
||||
sigaddset(&sig_act.sa_mask, SIGHUP);
|
||||
sigaddset(&sig_act.sa_mask, SIGPIPE);
|
||||
#ifdef SIGSYS
|
||||
sigaddset(&sig_act.sa_mask, SIGSYS);
|
||||
#endif
|
||||
#else
|
||||
sig_act.sa_mask = ((1<<(SIGINT -1))
|
||||
|(1<<(SIGQUIT-1))
|
||||
#ifdef SIGBUS
|
||||
|(1<<(SIGBUS-1))
|
||||
#endif
|
||||
|(1<<(SIGILL-1))
|
||||
|(1<<(SIGSEGV-1))
|
||||
|(1<<(SIGHUP-1))
|
||||
|(1<<(SIGPIPE-1))
|
||||
#ifdef SIGSYS
|
||||
|(1<<(SIGSYS-1))
|
||||
#endif
|
||||
);
|
||||
#endif /* _POSIX_SOURCE */
|
||||
sig_act.sa_flags = 0;
|
||||
sigaction(SIGHUP, &sig_act, (struct sigaction *)0);
|
||||
sigaction(SIGINT, &sig_act, (struct sigaction *)0);
|
||||
sigaction(SIGQUIT, &sig_act, (struct sigaction *)0);
|
||||
sigaction(SIGILL, &sig_act, (struct sigaction *)0);
|
||||
#ifdef SIGBUS
|
||||
sigaction(SIGBUS, &sig_act, (struct sigaction *)0);
|
||||
#endif
|
||||
sigaction(SIGSEGV, &sig_act, (struct sigaction *)0);
|
||||
#ifdef SIGSYS
|
||||
sigaction(SIGSYS, &sig_act, (struct sigaction *)0);
|
||||
#endif
|
||||
#endif /* USGISH */
|
||||
|
||||
/*
|
||||
* now peruse through the list of files.
|
||||
*/
|
||||
for(fp=filelist; *fp; fp++) {
|
||||
filecontent = getfile(*fp);
|
||||
ip = newinclude(*fp, (char *)NULL);
|
||||
|
||||
find_includes(filecontent, ip, ip, 0, FALSE);
|
||||
freefile(filecontent);
|
||||
recursive_pr_include(ip, ip->i_file, base_name(*fp));
|
||||
inc_clean();
|
||||
}
|
||||
if (printed)
|
||||
printf("\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
struct filepointer *getfile(file)
|
||||
char *file;
|
||||
{
|
||||
register int fd;
|
||||
struct filepointer *content;
|
||||
struct stat st;
|
||||
|
||||
content = (struct filepointer *)malloc(sizeof(struct filepointer));
|
||||
if ((fd = open(file, O_RDONLY)) < 0) {
|
||||
warning("cannot open \"%s\"\n", file);
|
||||
content->f_p = content->f_base = content->f_end = (char *)malloc(1);
|
||||
*content->f_p = '\0';
|
||||
return(content);
|
||||
}
|
||||
fstat(fd, &st);
|
||||
content->f_base = (char *)malloc(st.st_size+1);
|
||||
if (content->f_base == NULL)
|
||||
fatalerr("cannot allocate mem\n");
|
||||
if ((st.st_size = read(fd, content->f_base, st.st_size)) < 0)
|
||||
fatalerr("failed to read %s\n", file);
|
||||
close(fd);
|
||||
content->f_len = st.st_size+1;
|
||||
content->f_p = content->f_base;
|
||||
content->f_end = content->f_base + st.st_size;
|
||||
*content->f_end = '\0';
|
||||
content->f_line = 0;
|
||||
return(content);
|
||||
}
|
||||
|
||||
freefile(fp)
|
||||
struct filepointer *fp;
|
||||
{
|
||||
free(fp->f_base);
|
||||
free(fp);
|
||||
}
|
||||
|
||||
char *copy(str)
|
||||
register char *str;
|
||||
{
|
||||
register char *p = (char *)malloc(strlen(str) + 1);
|
||||
|
||||
strcpy(p, str);
|
||||
return(p);
|
||||
}
|
||||
|
||||
match(str, list)
|
||||
register char *str, **list;
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i=0; *list; i++, list++)
|
||||
if (strcmp(str, *list) == 0)
|
||||
return(i);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the next line. We only return lines beginning with '#' since that
|
||||
* is all this program is ever interested in.
|
||||
*/
|
||||
char *getline(filep)
|
||||
register struct filepointer *filep;
|
||||
{
|
||||
register char *p, /* walking pointer */
|
||||
*eof, /* end of file pointer */
|
||||
*bol; /* beginning of line pointer */
|
||||
register lineno; /* line number */
|
||||
|
||||
p = filep->f_p;
|
||||
eof = filep->f_end;
|
||||
if (p >= eof)
|
||||
return((char *)NULL);
|
||||
lineno = filep->f_line;
|
||||
|
||||
for(bol = p--; ++p < eof; ) {
|
||||
if (*p == '/' && *(p+1) == '*') { /* consume comments */
|
||||
*p++ = ' ', *p++ = ' ';
|
||||
while (*p) {
|
||||
if (*p == '*' && *(p+1) == '/') {
|
||||
*p++ = ' ', *p = ' ';
|
||||
break;
|
||||
}
|
||||
else if (*p == '\n')
|
||||
lineno++;
|
||||
*p++ = ' ';
|
||||
}
|
||||
continue;
|
||||
}
|
||||
#ifdef WIN32
|
||||
else if (*p == '/' && *(p+1) == '/') { /* consume comments */
|
||||
*p++ = ' ', *p++ = ' ';
|
||||
while (*p && *p != '\n')
|
||||
*p++ = ' ';
|
||||
lineno++;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
else if (*p == '\\') {
|
||||
if (*(p+1) == '\n') {
|
||||
*p = ' ';
|
||||
*(p+1) = ' ';
|
||||
lineno++;
|
||||
}
|
||||
}
|
||||
else if (*p == '\n') {
|
||||
lineno++;
|
||||
if (*bol == '#') {
|
||||
register char *cp;
|
||||
|
||||
*p++ = '\0';
|
||||
/* punt lines with just # (yacc generated) */
|
||||
for (cp = bol+1;
|
||||
*cp && (*cp == ' ' || *cp == '\t'); cp++);
|
||||
if (*cp) goto done;
|
||||
}
|
||||
bol = p+1;
|
||||
}
|
||||
}
|
||||
if (*bol != '#')
|
||||
bol = NULL;
|
||||
done:
|
||||
filep->f_p = p;
|
||||
filep->f_line = lineno;
|
||||
return(bol);
|
||||
}
|
||||
|
||||
/*
|
||||
* Strip the file name down to what we want to see in the Makefile.
|
||||
* It will have objprefix and objsuffix around it.
|
||||
*/
|
||||
char *base_name(file)
|
||||
register char *file;
|
||||
{
|
||||
register char *p;
|
||||
|
||||
file = copy(file);
|
||||
for(p=file+strlen(file); p>file && *p != '.'; p--) ;
|
||||
|
||||
if (*p == '.')
|
||||
*p = '\0';
|
||||
return(file);
|
||||
}
|
||||
|
||||
#if defined(USG) && !defined(CRAY) && !defined(SVR4) && !defined(__EMX__)
|
||||
int rename (from, to)
|
||||
char *from, *to;
|
||||
{
|
||||
(void) unlink (to);
|
||||
if (link (from, to) == 0) {
|
||||
unlink (from);
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif /* USGISH */
|
||||
|
||||
redirect(line, makefile)
|
||||
char *line,
|
||||
*makefile;
|
||||
{
|
||||
struct stat st;
|
||||
FILE *fdin, *fdout;
|
||||
char backup[ BUFSIZ ],
|
||||
buf[ BUFSIZ ];
|
||||
boolean found = FALSE;
|
||||
int len;
|
||||
|
||||
/*
|
||||
* if makefile is "-" then let it pour onto stdout.
|
||||
*/
|
||||
if (makefile && *makefile == '-' && *(makefile+1) == '\0')
|
||||
return;
|
||||
|
||||
/*
|
||||
* use a default makefile is not specified.
|
||||
*/
|
||||
if (!makefile) {
|
||||
if (stat("Makefile", &st) == 0)
|
||||
makefile = "Makefile";
|
||||
else if (stat("makefile", &st) == 0)
|
||||
makefile = "makefile";
|
||||
else
|
||||
fatalerr("[mM]akefile is not present\n");
|
||||
}
|
||||
else
|
||||
stat(makefile, &st);
|
||||
if ((fdin = fopen(makefile, "r")) == NULL)
|
||||
fatalerr("cannot open \"%s\"\n", makefile);
|
||||
sprintf(backup, "%s.bak", makefile);
|
||||
unlink(backup);
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
fclose(fdin);
|
||||
#endif
|
||||
if (rename(makefile, backup) < 0)
|
||||
fatalerr("cannot rename %s to %s\n", makefile, backup);
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
if ((fdin = fopen(backup, "r")) == NULL)
|
||||
fatalerr("cannot open \"%s\"\n", backup);
|
||||
#endif
|
||||
if ((fdout = freopen(makefile, "w", stdout)) == NULL)
|
||||
fatalerr("cannot open \"%s\"\n", backup);
|
||||
len = strlen(line);
|
||||
while (!found && fgets(buf, BUFSIZ, fdin)) {
|
||||
if (*buf == '#' && strncmp(line, buf, len) == 0)
|
||||
found = TRUE;
|
||||
fputs(buf, fdout);
|
||||
}
|
||||
if (!found) {
|
||||
if (verbose)
|
||||
warning("Adding new delimiting line \"%s\" and dependencies...\n",
|
||||
line);
|
||||
puts(line); /* same as fputs(fdout); but with newline */
|
||||
} else if (append) {
|
||||
while (fgets(buf, BUFSIZ, fdin)) {
|
||||
fputs(buf, fdout);
|
||||
}
|
||||
}
|
||||
fflush(fdout);
|
||||
#if defined(USGISH) || defined(_SEQUENT_) || defined(USE_CHMOD)
|
||||
chmod(makefile, st.st_mode);
|
||||
#else
|
||||
fchmod(fileno(fdout), st.st_mode);
|
||||
#endif /* USGISH */
|
||||
}
|
||||
|
||||
#if NeedVarargsPrototypes
|
||||
fatalerr(char *msg, ...)
|
||||
#else
|
||||
/*VARARGS*/
|
||||
fatalerr(msg,x1,x2,x3,x4,x5,x6,x7,x8,x9)
|
||||
char *msg;
|
||||
#endif
|
||||
{
|
||||
#if NeedVarargsPrototypes
|
||||
va_list args;
|
||||
#endif
|
||||
fprintf(stderr, "%s: error: ", ProgramName);
|
||||
#if NeedVarargsPrototypes
|
||||
va_start(args, msg);
|
||||
vfprintf(stderr, msg, args);
|
||||
va_end(args);
|
||||
#else
|
||||
fprintf(stderr, msg,x1,x2,x3,x4,x5,x6,x7,x8,x9);
|
||||
#endif
|
||||
exit (1);
|
||||
}
|
||||
|
||||
#if NeedVarargsPrototypes
|
||||
warning(char *msg, ...)
|
||||
#else
|
||||
/*VARARGS0*/
|
||||
warning(msg,x1,x2,x3,x4,x5,x6,x7,x8,x9)
|
||||
char *msg;
|
||||
#endif
|
||||
{
|
||||
#ifdef DEBUG_MKDEPEND
|
||||
#if NeedVarargsPrototypes
|
||||
va_list args;
|
||||
#endif
|
||||
fprintf(stderr, "%s: warning: ", ProgramName);
|
||||
#if NeedVarargsPrototypes
|
||||
va_start(args, msg);
|
||||
vfprintf(stderr, msg, args);
|
||||
va_end(args);
|
||||
#else
|
||||
fprintf(stderr, msg,x1,x2,x3,x4,x5,x6,x7,x8,x9);
|
||||
#endif
|
||||
#endif /* DEBUG_MKDEPEND */
|
||||
}
|
||||
|
||||
#if NeedVarargsPrototypes
|
||||
warning1(char *msg, ...)
|
||||
#else
|
||||
/*VARARGS0*/
|
||||
warning1(msg,x1,x2,x3,x4,x5,x6,x7,x8,x9)
|
||||
char *msg;
|
||||
#endif
|
||||
{
|
||||
#ifdef DEBUG_MKDEPEND
|
||||
#if NeedVarargsPrototypes
|
||||
va_list args;
|
||||
va_start(args, msg);
|
||||
vfprintf(stderr, msg, args);
|
||||
va_end(args);
|
||||
#else
|
||||
fprintf(stderr, msg,x1,x2,x3,x4,x5,x6,x7,x8,x9);
|
||||
#endif
|
||||
#endif /* DEBUG_MKDEPEND */
|
||||
}
|
||||
368
mozilla/config/mkdepend/mkdepend.man
Normal file
368
mozilla/config/mkdepend/mkdepend.man
Normal file
@@ -0,0 +1,368 @@
|
||||
.\" $XConsortium: mkdepend.man,v 1.15 94/04/17 20:10:37 gildea Exp $
|
||||
.\" Copyright (c) 1993, 1994 X Consortium
|
||||
.\"
|
||||
.\" Permission is hereby granted, free of charge, to any person obtaining a
|
||||
.\" copy of this software and associated documentation files (the "Software"),
|
||||
.\" to deal in the Software without restriction, including without limitation
|
||||
.\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
.\" and/or sell copies of the Software, and to permit persons to whom the
|
||||
.\" Software furnished to do so, subject to the following conditions:
|
||||
.\"
|
||||
.\" The above copyright notice and this permission notice shall be included in
|
||||
.\" all copies or substantial portions of the Software.
|
||||
.\"
|
||||
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
.\" THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
.\" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
.\" OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
.\" SOFTWARE.
|
||||
.\"
|
||||
.\" Except as contained in this notice, the name of the X Consortium shall not
|
||||
.\" be used in advertising or otherwise to promote the sale, use or other
|
||||
.\" dealing in this Software without prior written authorization from the
|
||||
.\" X Consortium.
|
||||
.TH MAKEDEPEND 1 "Release 6" "X Version 11"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
makedepend \- create dependencies in makefiles
|
||||
.SH SYNOPSIS
|
||||
.B makedepend
|
||||
[
|
||||
.B \-Dname=def
|
||||
] [
|
||||
.B \-Dname
|
||||
] [
|
||||
.B \-Iincludedir
|
||||
] [
|
||||
.B \-Yincludedir
|
||||
] [
|
||||
.B \-a
|
||||
] [
|
||||
.B \-fmakefile
|
||||
] [
|
||||
.B \-oobjsuffix
|
||||
] [
|
||||
.B \-pobjprefix
|
||||
] [
|
||||
.B \-sstring
|
||||
] [
|
||||
.B \-wwidth
|
||||
] [
|
||||
.B \-v
|
||||
] [
|
||||
.B \-m
|
||||
] [
|
||||
\-\^\-
|
||||
.B otheroptions
|
||||
\-\^\-
|
||||
]
|
||||
sourcefile .\|.\|.
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
.B Makedepend
|
||||
reads each
|
||||
.I sourcefile
|
||||
in sequence and parses it like a C-preprocessor,
|
||||
processing all
|
||||
.I #include,
|
||||
.I #define,
|
||||
.I #undef,
|
||||
.I #ifdef,
|
||||
.I #ifndef,
|
||||
.I #endif,
|
||||
.I #if
|
||||
and
|
||||
.I #else
|
||||
directives so that it can correctly tell which
|
||||
.I #include,
|
||||
directives would be used in a compilation.
|
||||
Any
|
||||
.I #include,
|
||||
directives can reference files having other
|
||||
.I #include
|
||||
directives, and parsing will occur in these files as well.
|
||||
.PP
|
||||
Every file that a
|
||||
.I sourcefile
|
||||
includes,
|
||||
directly or indirectly,
|
||||
is what
|
||||
.B makedepend
|
||||
calls a "dependency".
|
||||
These dependencies are then written to a
|
||||
.I makefile
|
||||
in such a way that
|
||||
.B make(1)
|
||||
will know which object files must be recompiled when a dependency has changed.
|
||||
.PP
|
||||
By default,
|
||||
.B makedepend
|
||||
places its output in the file named
|
||||
.I makefile
|
||||
if it exists, otherwise
|
||||
.I Makefile.
|
||||
An alternate makefile may be specified with the
|
||||
.B \-f
|
||||
option.
|
||||
It first searches the makefile for
|
||||
the line
|
||||
.sp
|
||||
# DO NOT DELETE THIS LINE \-\^\- make depend depends on it.
|
||||
.sp
|
||||
or one provided with the
|
||||
.B \-s
|
||||
option,
|
||||
as a delimiter for the dependency output.
|
||||
If it finds it, it will delete everything
|
||||
following this to the end of the makefile
|
||||
and put the output after this line.
|
||||
If it doesn't find it, the program
|
||||
will append the string to the end of the makefile
|
||||
and place the output following that.
|
||||
For each
|
||||
.I sourcefile
|
||||
appearing on the command line,
|
||||
.B makedepend
|
||||
puts lines in the makefile of the form
|
||||
.sp
|
||||
sourcefile.o:\0dfile .\|.\|.
|
||||
.sp
|
||||
Where "sourcefile.o" is the name from the command
|
||||
line with its suffix replaced with ".o",
|
||||
and "dfile" is a dependency discovered in a
|
||||
.I #include
|
||||
directive while parsing
|
||||
.I sourcefile
|
||||
or one of the files it included.
|
||||
.SH EXAMPLE
|
||||
Normally,
|
||||
.B makedepend
|
||||
will be used in a makefile target so that typing "make depend" will
|
||||
bring the dependencies up to date for the makefile.
|
||||
For example,
|
||||
.nf
|
||||
SRCS\0=\0file1.c\0file2.c\0.\|.\|.
|
||||
CFLAGS\0=\0\-O\0\-DHACK\0\-I\^.\^.\^/foobar\0\-xyz
|
||||
depend:
|
||||
makedepend\0\-\^\-\0$(CFLAGS)\0\-\^\-\0$(SRCS)
|
||||
.fi
|
||||
.SH OPTIONS
|
||||
.B Makedepend
|
||||
will ignore any option that it does not understand so that you may use
|
||||
the same arguments that you would for
|
||||
.B cc(1).
|
||||
.TP 5
|
||||
.B \-Dname=def or \-Dname
|
||||
Define.
|
||||
This places a definition for
|
||||
.I name
|
||||
in
|
||||
.B makedepend's
|
||||
symbol table.
|
||||
Without
|
||||
.I =def
|
||||
the symbol becomes defined as "1".
|
||||
.TP 5
|
||||
.B \-Iincludedir
|
||||
Include directory.
|
||||
This option tells
|
||||
.B makedepend
|
||||
to prepend
|
||||
.I includedir
|
||||
to its list of directories to search when it encounters
|
||||
a
|
||||
.I #include
|
||||
directive.
|
||||
By default,
|
||||
.B makedepend
|
||||
only searches the standard include directories (usually /usr/include
|
||||
and possibly a compiler-dependent directory).
|
||||
.TP 5
|
||||
.B \-Yincludedir
|
||||
Replace all of the standard include directories with the single specified
|
||||
include directory; you can omit the
|
||||
.I includedir
|
||||
to simply prevent searching the standard include directories.
|
||||
.TP 5
|
||||
.B \-a
|
||||
Append the dependencies to the end of the file instead of replacing them.
|
||||
.TP 5
|
||||
.B \-fmakefile
|
||||
Filename.
|
||||
This allows you to specify an alternate makefile in which
|
||||
.B makedepend
|
||||
can place its output.
|
||||
.TP 5
|
||||
.B \-oobjsuffix
|
||||
Object file suffix.
|
||||
Some systems may have object files whose suffix is something other
|
||||
than ".o".
|
||||
This option allows you to specify another suffix, such as
|
||||
".b" with
|
||||
.I -o.b
|
||||
or ":obj"
|
||||
with
|
||||
.I -o:obj
|
||||
and so forth.
|
||||
.TP 5
|
||||
.B \-pobjprefix
|
||||
Object file prefix.
|
||||
The prefix is prepended to the name of the object file. This is
|
||||
usually used to designate a different directory for the object file.
|
||||
The default is the empty string.
|
||||
.TP 5
|
||||
.B \-sstring
|
||||
Starting string delimiter.
|
||||
This option permits you to specify
|
||||
a different string for
|
||||
.B makedepend
|
||||
to look for in the makefile.
|
||||
.TP 5
|
||||
.B \-wwidth
|
||||
Line width.
|
||||
Normally,
|
||||
.B makedepend
|
||||
will ensure that every output line that it writes will be no wider than
|
||||
78 characters for the sake of readability.
|
||||
This option enables you to change this width.
|
||||
.TP 5
|
||||
.B \-v
|
||||
Verbose operation.
|
||||
This option causes
|
||||
.B makedepend
|
||||
to emit the list of files included by each input file on standard output.
|
||||
.TP 5
|
||||
.B \-m
|
||||
Warn about multiple inclusion.
|
||||
This option causes
|
||||
.B makedepend
|
||||
to produce a warning if any input file includes another file more than
|
||||
once. In previous versions of
|
||||
.B makedepend
|
||||
this was the default behavior; the default has been changed to better
|
||||
match the behavior of the C compiler, which does not consider multiple
|
||||
inclusion to be an error. This option is provided for backward
|
||||
compatibility, and to aid in debugging problems related to multiple
|
||||
inclusion.
|
||||
.TP 5
|
||||
.B "\-\^\- options \-\^\-"
|
||||
If
|
||||
.B makedepend
|
||||
encounters a double hyphen (\-\^\-) in the argument list,
|
||||
then any unrecognized argument following it
|
||||
will be silently ignored; a second double hyphen terminates this
|
||||
special treatment.
|
||||
In this way,
|
||||
.B makedepend
|
||||
can be made to safely ignore esoteric compiler arguments that might
|
||||
normally be found in a CFLAGS
|
||||
.B make
|
||||
macro (see the
|
||||
.B EXAMPLE
|
||||
section above).
|
||||
All options that
|
||||
.B makedepend
|
||||
recognizes and appear between the pair of double hyphens
|
||||
are processed normally.
|
||||
.SH ALGORITHM
|
||||
The approach used in this program enables it to run an order of magnitude
|
||||
faster than any other "dependency generator" I have ever seen.
|
||||
Central to this performance are two assumptions:
|
||||
that all files compiled by a single
|
||||
makefile will be compiled with roughly the same
|
||||
.I -I
|
||||
and
|
||||
.I -D
|
||||
options;
|
||||
and that most files in a single directory will include largely the
|
||||
same files.
|
||||
.PP
|
||||
Given these assumptions,
|
||||
.B makedepend
|
||||
expects to be called once for each makefile, with
|
||||
all source files that are maintained by the
|
||||
makefile appearing on the command line.
|
||||
It parses each source and include
|
||||
file exactly once, maintaining an internal symbol table
|
||||
for each.
|
||||
Thus, the first file on the command line will take an amount of time
|
||||
proportional to the amount of time that a normal C preprocessor takes.
|
||||
But on subsequent files, if it encounter's an include file
|
||||
that it has already parsed, it does not parse it again.
|
||||
.PP
|
||||
For example,
|
||||
imagine you are compiling two files,
|
||||
.I file1.c
|
||||
and
|
||||
.I file2.c,
|
||||
they each include the header file
|
||||
.I header.h,
|
||||
and the file
|
||||
.I header.h
|
||||
in turn includes the files
|
||||
.I def1.h
|
||||
and
|
||||
.I def2.h.
|
||||
When you run the command
|
||||
.sp
|
||||
makedepend\0file1.c\0file2.c
|
||||
.sp
|
||||
.B makedepend
|
||||
will parse
|
||||
.I file1.c
|
||||
and consequently,
|
||||
.I header.h
|
||||
and then
|
||||
.I def1.h
|
||||
and
|
||||
.I def2.h.
|
||||
It then decides that the dependencies for this file are
|
||||
.sp
|
||||
file1.o:\0header.h\0def1.h\0def2.h
|
||||
.sp
|
||||
But when the program parses
|
||||
.I file2.c
|
||||
and discovers that it, too, includes
|
||||
.I header.h,
|
||||
it does not parse the file,
|
||||
but simply adds
|
||||
.I header.h,
|
||||
.I def1.h
|
||||
and
|
||||
.I def2.h
|
||||
to the list of dependencies for
|
||||
.I file2.o.
|
||||
.SH "SEE ALSO"
|
||||
cc(1), make(1)
|
||||
.SH BUGS
|
||||
.B makedepend
|
||||
parses, but does not currently evaluate, the SVR4
|
||||
#predicate(token-list) preprocessor expression;
|
||||
such expressions are simply assumed to be true.
|
||||
This may cause the wrong
|
||||
.I #include
|
||||
directives to be evaluated.
|
||||
.PP
|
||||
Imagine you are parsing two files,
|
||||
say
|
||||
.I file1.c
|
||||
and
|
||||
.I file2.c,
|
||||
each includes the file
|
||||
.I def.h.
|
||||
The list of files that
|
||||
.I def.h
|
||||
includes might truly be different when
|
||||
.I def.h
|
||||
is included by
|
||||
.I file1.c
|
||||
than when it is included by
|
||||
.I file2.c.
|
||||
But once
|
||||
.B makedepend
|
||||
arrives at a list of dependencies for a file,
|
||||
it is cast in concrete.
|
||||
.SH AUTHOR
|
||||
Todd Brunhoff, Tektronix, Inc. and MIT Project Athena
|
||||
567
mozilla/config/mkdepend/parse.c
Normal file
567
mozilla/config/mkdepend/parse.c
Normal file
@@ -0,0 +1,567 @@
|
||||
/* $XConsortium: parse.c,v 1.30 94/04/17 20:10:38 gildea Exp $ */
|
||||
/*
|
||||
|
||||
Copyright (c) 1993, 1994 X Consortium
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of the X Consortium shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from the X Consortium.
|
||||
|
||||
*/
|
||||
|
||||
#include "def.h"
|
||||
|
||||
extern char *directives[];
|
||||
extern struct inclist maininclist;
|
||||
|
||||
find_includes(filep, file, file_red, recursion, failOK)
|
||||
struct filepointer *filep;
|
||||
struct inclist *file, *file_red;
|
||||
int recursion;
|
||||
boolean failOK;
|
||||
{
|
||||
register char *line;
|
||||
register int type;
|
||||
boolean recfailOK;
|
||||
|
||||
while (line = getline(filep)) {
|
||||
switch(type = deftype(line, filep, file_red, file, TRUE)) {
|
||||
case IF:
|
||||
doif:
|
||||
type = find_includes(filep, file,
|
||||
file_red, recursion+1, failOK);
|
||||
while ((type == ELIF) || (type == ELIFFALSE) ||
|
||||
(type == ELIFGUESSFALSE))
|
||||
type = gobble(filep, file, file_red);
|
||||
if (type == ELSE)
|
||||
gobble(filep, file, file_red);
|
||||
break;
|
||||
case IFFALSE:
|
||||
case IFGUESSFALSE:
|
||||
doiffalse:
|
||||
if (type == IFGUESSFALSE || type == ELIFGUESSFALSE)
|
||||
recfailOK = TRUE;
|
||||
else
|
||||
recfailOK = failOK;
|
||||
type = gobble(filep, file, file_red);
|
||||
if (type == ELSE)
|
||||
find_includes(filep, file,
|
||||
file_red, recursion+1, recfailOK);
|
||||
else
|
||||
if (type == ELIF)
|
||||
goto doif;
|
||||
else
|
||||
if ((type == ELIFFALSE) || (type == ELIFGUESSFALSE))
|
||||
goto doiffalse;
|
||||
break;
|
||||
case IFDEF:
|
||||
case IFNDEF:
|
||||
if ((type == IFDEF && isdefined(line, file_red, NULL))
|
||||
|| (type == IFNDEF && !isdefined(line, file_red, NULL))) {
|
||||
debug(1,(type == IFNDEF ?
|
||||
"line %d: %s !def'd in %s via %s%s\n" : "",
|
||||
filep->f_line, line,
|
||||
file->i_file, file_red->i_file, ": doit"));
|
||||
type = find_includes(filep, file,
|
||||
file_red, recursion+1, failOK);
|
||||
while (type == ELIF || type == ELIFFALSE || type == ELIFGUESSFALSE)
|
||||
type = gobble(filep, file, file_red);
|
||||
if (type == ELSE)
|
||||
gobble(filep, file, file_red);
|
||||
}
|
||||
else {
|
||||
debug(1,(type == IFDEF ?
|
||||
"line %d: %s !def'd in %s via %s%s\n" : "",
|
||||
filep->f_line, line,
|
||||
file->i_file, file_red->i_file, ": gobble"));
|
||||
type = gobble(filep, file, file_red);
|
||||
if (type == ELSE)
|
||||
find_includes(filep, file,
|
||||
file_red, recursion+1, failOK);
|
||||
else if (type == ELIF)
|
||||
goto doif;
|
||||
else if (type == ELIFFALSE || type == ELIFGUESSFALSE)
|
||||
goto doiffalse;
|
||||
}
|
||||
break;
|
||||
case ELSE:
|
||||
case ELIFFALSE:
|
||||
case ELIFGUESSFALSE:
|
||||
case ELIF:
|
||||
if (!recursion)
|
||||
gobble(filep, file, file_red);
|
||||
case ENDIF:
|
||||
if (recursion)
|
||||
return(type);
|
||||
case DEFINE:
|
||||
define(line, file);
|
||||
break;
|
||||
case UNDEF:
|
||||
if (!*line) {
|
||||
warning("%s, line %d: incomplete undef == \"%s\"\n",
|
||||
file_red->i_file, filep->f_line, line);
|
||||
break;
|
||||
}
|
||||
undefine(line, file_red);
|
||||
break;
|
||||
case INCLUDE:
|
||||
add_include(filep, file, file_red, line, FALSE, failOK);
|
||||
break;
|
||||
case INCLUDEDOT:
|
||||
add_include(filep, file, file_red, line, TRUE, failOK);
|
||||
break;
|
||||
case ERROR:
|
||||
warning("%s: %d: %s\n", file_red->i_file,
|
||||
filep->f_line, line);
|
||||
break;
|
||||
|
||||
case PRAGMA:
|
||||
case IDENT:
|
||||
case SCCS:
|
||||
case EJECT:
|
||||
break;
|
||||
case -1:
|
||||
warning("%s", file_red->i_file);
|
||||
if (file_red != file)
|
||||
warning1(" (reading %s)", file->i_file);
|
||||
warning1(", line %d: unknown directive == \"%s\"\n",
|
||||
filep->f_line, line);
|
||||
break;
|
||||
case -2:
|
||||
warning("%s", file_red->i_file);
|
||||
if (file_red != file)
|
||||
warning1(" (reading %s)", file->i_file);
|
||||
warning1(", line %d: incomplete include == \"%s\"\n",
|
||||
filep->f_line, line);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return(-1);
|
||||
}
|
||||
|
||||
gobble(filep, file, file_red)
|
||||
register struct filepointer *filep;
|
||||
struct inclist *file, *file_red;
|
||||
{
|
||||
register char *line;
|
||||
register int type;
|
||||
|
||||
while (line = getline(filep)) {
|
||||
switch(type = deftype(line, filep, file_red, file, FALSE)) {
|
||||
case IF:
|
||||
case IFFALSE:
|
||||
case IFGUESSFALSE:
|
||||
case IFDEF:
|
||||
case IFNDEF:
|
||||
type = gobble(filep, file, file_red);
|
||||
while ((type == ELIF) || (type == ELIFFALSE) ||
|
||||
(type == ELIFGUESSFALSE))
|
||||
type = gobble(filep, file, file_red);
|
||||
if (type == ELSE)
|
||||
(void)gobble(filep, file, file_red);
|
||||
break;
|
||||
case ELSE:
|
||||
case ENDIF:
|
||||
debug(0,("%s, line %d: #%s\n",
|
||||
file->i_file, filep->f_line,
|
||||
directives[type]));
|
||||
return(type);
|
||||
case DEFINE:
|
||||
case UNDEF:
|
||||
case INCLUDE:
|
||||
case INCLUDEDOT:
|
||||
case PRAGMA:
|
||||
case ERROR:
|
||||
case IDENT:
|
||||
case SCCS:
|
||||
case EJECT:
|
||||
break;
|
||||
case ELIF:
|
||||
case ELIFFALSE:
|
||||
case ELIFGUESSFALSE:
|
||||
return(type);
|
||||
case -1:
|
||||
warning("%s, line %d: unknown directive == \"%s\"\n",
|
||||
file_red->i_file, filep->f_line, line);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Decide what type of # directive this line is.
|
||||
*/
|
||||
int deftype (line, filep, file_red, file, parse_it)
|
||||
register char *line;
|
||||
register struct filepointer *filep;
|
||||
register struct inclist *file_red, *file;
|
||||
int parse_it;
|
||||
{
|
||||
register char *p;
|
||||
char *directive, savechar;
|
||||
register int ret;
|
||||
|
||||
/*
|
||||
* Parse the directive...
|
||||
*/
|
||||
directive=line+1;
|
||||
while (*directive == ' ' || *directive == '\t')
|
||||
directive++;
|
||||
|
||||
p = directive;
|
||||
while (*p >= 'a' && *p <= 'z')
|
||||
p++;
|
||||
savechar = *p;
|
||||
*p = '\0';
|
||||
ret = match(directive, directives);
|
||||
*p = savechar;
|
||||
|
||||
/* If we don't recognize this compiler directive or we happen to just
|
||||
* be gobbling up text while waiting for an #endif or #elif or #else
|
||||
* in the case of an #elif we must check the zero_value and return an
|
||||
* ELIF or an ELIFFALSE.
|
||||
*/
|
||||
|
||||
if (ret == ELIF && !parse_it)
|
||||
{
|
||||
while (*p == ' ' || *p == '\t')
|
||||
p++;
|
||||
/*
|
||||
* parse an expression.
|
||||
*/
|
||||
debug(0,("%s, line %d: #elif %s ",
|
||||
file->i_file, filep->f_line, p));
|
||||
ret = zero_value(p, filep, file_red);
|
||||
if (ret != IF)
|
||||
{
|
||||
debug(0,("false...\n"));
|
||||
if (ret == IFFALSE)
|
||||
return(ELIFFALSE);
|
||||
else
|
||||
return(ELIFGUESSFALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
debug(0,("true...\n"));
|
||||
return(ELIF);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret < 0 || ! parse_it)
|
||||
return(ret);
|
||||
|
||||
/*
|
||||
* now decide how to parse the directive, and do it.
|
||||
*/
|
||||
while (*p == ' ' || *p == '\t')
|
||||
p++;
|
||||
switch (ret) {
|
||||
case IF:
|
||||
/*
|
||||
* parse an expression.
|
||||
*/
|
||||
ret = zero_value(p, filep, file_red);
|
||||
debug(0,("%s, line %d: %s #if %s\n",
|
||||
file->i_file, filep->f_line, ret?"false":"true", p));
|
||||
break;
|
||||
case IFDEF:
|
||||
case IFNDEF:
|
||||
debug(0,("%s, line %d: #%s %s\n",
|
||||
file->i_file, filep->f_line, directives[ret], p));
|
||||
case UNDEF:
|
||||
/*
|
||||
* separate the name of a single symbol.
|
||||
*/
|
||||
while (isalnum(*p) || *p == '_')
|
||||
*line++ = *p++;
|
||||
*line = '\0';
|
||||
break;
|
||||
case INCLUDE:
|
||||
debug(2,("%s, line %d: #include %s\n",
|
||||
file->i_file, filep->f_line, p));
|
||||
|
||||
/* Support ANSI macro substitution */
|
||||
{
|
||||
struct symtab *sym = isdefined(p, file_red, NULL);
|
||||
while (sym) {
|
||||
p = sym->s_value;
|
||||
debug(3,("%s : #includes SYMBOL %s = %s\n",
|
||||
file->i_incstring,
|
||||
sym -> s_name,
|
||||
sym -> s_value));
|
||||
/* mark file as having included a 'soft include' */
|
||||
file->i_included_sym = TRUE;
|
||||
sym = isdefined(p, file_red, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Separate the name of the include file.
|
||||
*/
|
||||
while (*p && *p != '"' && *p != '<')
|
||||
p++;
|
||||
if (! *p)
|
||||
return(-2);
|
||||
if (*p++ == '"') {
|
||||
ret = INCLUDEDOT;
|
||||
while (*p && *p != '"')
|
||||
*line++ = *p++;
|
||||
} else
|
||||
while (*p && *p != '>')
|
||||
*line++ = *p++;
|
||||
*line = '\0';
|
||||
break;
|
||||
case DEFINE:
|
||||
/*
|
||||
* copy the definition back to the beginning of the line.
|
||||
*/
|
||||
strcpy (line, p);
|
||||
break;
|
||||
case ELSE:
|
||||
case ENDIF:
|
||||
case ELIF:
|
||||
case PRAGMA:
|
||||
case ERROR:
|
||||
case IDENT:
|
||||
case SCCS:
|
||||
case EJECT:
|
||||
debug(0,("%s, line %d: #%s\n",
|
||||
file->i_file, filep->f_line, directives[ret]));
|
||||
/*
|
||||
* nothing to do.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
struct symtab *isdefined(symbol, file, srcfile)
|
||||
register char *symbol;
|
||||
struct inclist *file;
|
||||
struct inclist **srcfile;
|
||||
{
|
||||
register struct symtab *val;
|
||||
|
||||
if (val = slookup(symbol, &maininclist)) {
|
||||
debug(1,("%s defined on command line\n", symbol));
|
||||
if (srcfile != NULL) *srcfile = &maininclist;
|
||||
return(val);
|
||||
}
|
||||
if (val = fdefined(symbol, file, srcfile))
|
||||
return(val);
|
||||
debug(1,("%s not defined in %s\n", symbol, file->i_file));
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
struct symtab *fdefined(symbol, file, srcfile)
|
||||
register char *symbol;
|
||||
struct inclist *file;
|
||||
struct inclist **srcfile;
|
||||
{
|
||||
register struct inclist **ip;
|
||||
register struct symtab *val;
|
||||
register int i;
|
||||
static int recurse_lvl = 0;
|
||||
|
||||
if (file->i_defchecked)
|
||||
return(NULL);
|
||||
file->i_defchecked = TRUE;
|
||||
if (val = slookup(symbol, file))
|
||||
debug(1,("%s defined in %s as %s\n", symbol, file->i_file, val->s_value));
|
||||
if (val == NULL && file->i_list)
|
||||
{
|
||||
for (ip = file->i_list, i=0; i < file->i_listlen; i++, ip++)
|
||||
if (val = fdefined(symbol, *ip, srcfile)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (val != NULL && srcfile != NULL) *srcfile = file;
|
||||
recurse_lvl--;
|
||||
file->i_defchecked = FALSE;
|
||||
|
||||
return(val);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return type based on if the #if expression evaluates to 0
|
||||
*/
|
||||
zero_value(exp, filep, file_red)
|
||||
register char *exp;
|
||||
register struct filepointer *filep;
|
||||
register struct inclist *file_red;
|
||||
{
|
||||
if (cppsetup(exp, filep, file_red))
|
||||
return(IFFALSE);
|
||||
else
|
||||
return(IF);
|
||||
}
|
||||
|
||||
define(def, file)
|
||||
char *def;
|
||||
struct inclist *file;
|
||||
{
|
||||
char *val;
|
||||
|
||||
/* Separate symbol name and its value */
|
||||
val = def;
|
||||
while (isalnum(*val) || *val == '_')
|
||||
val++;
|
||||
if (*val)
|
||||
*val++ = '\0';
|
||||
while (*val == ' ' || *val == '\t')
|
||||
val++;
|
||||
|
||||
if (!*val)
|
||||
val = "1";
|
||||
define2(def, val, file);
|
||||
}
|
||||
|
||||
define2(name, val, file)
|
||||
char *name, *val;
|
||||
struct inclist *file;
|
||||
{
|
||||
int first, last, below;
|
||||
register struct symtab *sp = NULL, *dest;
|
||||
|
||||
/* Make space if it's needed */
|
||||
if (file->i_defs == NULL)
|
||||
{
|
||||
file->i_defs = (struct symtab *)
|
||||
malloc(sizeof (struct symtab) * SYMTABINC);
|
||||
file->i_deflen = SYMTABINC;
|
||||
file->i_ndefs = 0;
|
||||
}
|
||||
else if (file->i_ndefs == file->i_deflen)
|
||||
file->i_defs = (struct symtab *)
|
||||
realloc(file->i_defs,
|
||||
sizeof(struct symtab)*(file->i_deflen+=SYMTABINC));
|
||||
|
||||
if (file->i_defs == NULL)
|
||||
fatalerr("malloc()/realloc() failure in insert_defn()\n");
|
||||
|
||||
below = first = 0;
|
||||
last = file->i_ndefs - 1;
|
||||
while (last >= first)
|
||||
{
|
||||
/* Fast inline binary search */
|
||||
register char *s1;
|
||||
register char *s2;
|
||||
register int middle = (first + last) / 2;
|
||||
|
||||
/* Fast inline strchr() */
|
||||
s1 = name;
|
||||
s2 = file->i_defs[middle].s_name;
|
||||
while (*s1++ == *s2++)
|
||||
if (s2[-1] == '\0') break;
|
||||
|
||||
/* If exact match, set sp and break */
|
||||
if (*--s1 == *--s2)
|
||||
{
|
||||
sp = file->i_defs + middle;
|
||||
break;
|
||||
}
|
||||
|
||||
/* If name > i_defs[middle] ... */
|
||||
if (*s1 > *s2)
|
||||
{
|
||||
below = first;
|
||||
first = middle + 1;
|
||||
}
|
||||
/* else ... */
|
||||
else
|
||||
{
|
||||
below = last = middle - 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Search is done. If we found an exact match to the symbol name,
|
||||
just replace its s_value */
|
||||
if (sp != NULL)
|
||||
{
|
||||
free(sp->s_value);
|
||||
sp->s_value = copy(val);
|
||||
return;
|
||||
}
|
||||
|
||||
sp = file->i_defs + file->i_ndefs++;
|
||||
dest = file->i_defs + below + 1;
|
||||
while (sp > dest)
|
||||
{
|
||||
*sp = sp[-1];
|
||||
sp--;
|
||||
}
|
||||
sp->s_name = copy(name);
|
||||
sp->s_value = copy(val);
|
||||
}
|
||||
|
||||
struct symtab *slookup(symbol, file)
|
||||
register char *symbol;
|
||||
register struct inclist *file;
|
||||
{
|
||||
register int first = 0;
|
||||
register int last = file->i_ndefs - 1;
|
||||
|
||||
if (file) while (last >= first)
|
||||
{
|
||||
/* Fast inline binary search */
|
||||
register char *s1;
|
||||
register char *s2;
|
||||
register int middle = (first + last) / 2;
|
||||
|
||||
/* Fast inline strchr() */
|
||||
s1 = symbol;
|
||||
s2 = file->i_defs[middle].s_name;
|
||||
while (*s1++ == *s2++)
|
||||
if (s2[-1] == '\0') break;
|
||||
|
||||
/* If exact match, we're done */
|
||||
if (*--s1 == *--s2)
|
||||
{
|
||||
return file->i_defs + middle;
|
||||
}
|
||||
|
||||
/* If symbol > i_defs[middle] ... */
|
||||
if (*s1 > *s2)
|
||||
{
|
||||
first = middle + 1;
|
||||
}
|
||||
/* else ... */
|
||||
else
|
||||
{
|
||||
last = middle - 1;
|
||||
}
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
undefine(symbol, file)
|
||||
char *symbol;
|
||||
register struct inclist *file;
|
||||
{
|
||||
register struct symtab *ptr;
|
||||
struct inclist *srcfile;
|
||||
while ((ptr = isdefined(symbol, file, &srcfile)) != NULL)
|
||||
{
|
||||
srcfile->i_ndefs--;
|
||||
for (; ptr < srcfile->i_defs + srcfile->i_ndefs; ptr++)
|
||||
*ptr = ptr[1];
|
||||
}
|
||||
}
|
||||
132
mozilla/config/mkdepend/pr.c
Normal file
132
mozilla/config/mkdepend/pr.c
Normal file
@@ -0,0 +1,132 @@
|
||||
/* $XConsortium: pr.c,v 1.17 94/04/17 20:10:38 gildea Exp $ */
|
||||
/*
|
||||
|
||||
Copyright (c) 1993, 1994 X Consortium
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of the X Consortium shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from the X Consortium.
|
||||
|
||||
*/
|
||||
|
||||
#include "def.h"
|
||||
|
||||
extern struct inclist inclist[ MAXFILES ],
|
||||
*inclistp;
|
||||
extern char *objprefix;
|
||||
extern char *objsuffix;
|
||||
extern int width;
|
||||
extern boolean printed;
|
||||
extern boolean verbose;
|
||||
extern boolean show_where_not;
|
||||
|
||||
add_include(filep, file, file_red, include, dot, failOK)
|
||||
struct filepointer *filep;
|
||||
struct inclist *file, *file_red;
|
||||
char *include;
|
||||
boolean dot;
|
||||
{
|
||||
register struct inclist *newfile;
|
||||
register struct filepointer *content;
|
||||
|
||||
/*
|
||||
* First decide what the pathname of this include file really is.
|
||||
*/
|
||||
newfile = inc_path(file->i_file, include, dot);
|
||||
if (newfile == NULL) {
|
||||
if (failOK)
|
||||
return;
|
||||
if (file != file_red)
|
||||
warning("%s (reading %s, line %d): ",
|
||||
file_red->i_file, file->i_file, filep->f_line);
|
||||
else
|
||||
warning("%s, line %d: ", file->i_file, filep->f_line);
|
||||
warning1("cannot find include file \"%s\"\n", include);
|
||||
show_where_not = TRUE;
|
||||
newfile = inc_path(file->i_file, include, dot);
|
||||
show_where_not = FALSE;
|
||||
}
|
||||
|
||||
if (newfile) {
|
||||
|
||||
/* Only add new dependency files if they don't have "/usr/include" in them. */
|
||||
if (!(newfile && newfile->i_file && strstr(newfile->i_file, "/usr/"))) {
|
||||
included_by(file, newfile);
|
||||
}
|
||||
|
||||
if (!newfile->i_searched) {
|
||||
newfile->i_searched = TRUE;
|
||||
content = getfile(newfile->i_file);
|
||||
find_includes(content, newfile, file_red, 0, failOK);
|
||||
freefile(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
recursive_pr_include(head, file, base)
|
||||
register struct inclist *head;
|
||||
register char *file, *base;
|
||||
{
|
||||
register int i;
|
||||
|
||||
if (head->i_marked)
|
||||
return;
|
||||
head->i_marked = TRUE;
|
||||
if (head->i_file != file)
|
||||
pr(head, file, base);
|
||||
for (i=0; i<head->i_listlen; i++)
|
||||
recursive_pr_include(head->i_list[ i ], file, base);
|
||||
}
|
||||
|
||||
pr(ip, file, base)
|
||||
register struct inclist *ip;
|
||||
char *file, *base;
|
||||
{
|
||||
static char *lastfile;
|
||||
static int current_len;
|
||||
register int len, i;
|
||||
char buf[ BUFSIZ ];
|
||||
|
||||
printed = TRUE;
|
||||
len = strlen(ip->i_file)+1;
|
||||
if (current_len + len > width || file != lastfile) {
|
||||
lastfile = file;
|
||||
sprintf(buf, "\n%s%s%s: %s", objprefix, base, objsuffix,
|
||||
ip->i_file);
|
||||
len = current_len = strlen(buf);
|
||||
}
|
||||
else {
|
||||
buf[0] = ' ';
|
||||
strcpy(buf+1, ip->i_file);
|
||||
current_len += len;
|
||||
}
|
||||
fwrite(buf, len, 1, stdout);
|
||||
|
||||
/*
|
||||
* If verbose is set, then print out what this file includes.
|
||||
*/
|
||||
if (! verbose || ip->i_list == NULL || ip->i_notified)
|
||||
return;
|
||||
ip->i_notified = TRUE;
|
||||
lastfile = NULL;
|
||||
printf("\n# %s includes:", ip->i_file);
|
||||
for (i=0; i<ip->i_listlen; i++)
|
||||
printf("\n#\t%s", ip->i_list[ i ]->i_incstring);
|
||||
}
|
||||
30
mozilla/config/nfspwd.pl
Normal file
30
mozilla/config/nfspwd.pl
Normal file
@@ -0,0 +1,30 @@
|
||||
#! perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
require "fastcwd.pl";
|
||||
|
||||
$_ = &fastcwd;
|
||||
if (m@^/[uh]/@o || s@^/tmp_mnt/@/@o) {
|
||||
print("$_\n");
|
||||
} elsif ((($user, $rest) = m@^/usr/people/(\w+)/(.*)@o)
|
||||
&& readlink("/u/$user") eq "/usr/people/$user") {
|
||||
print("/u/$user/$rest\n");
|
||||
} else {
|
||||
chop($host = `hostname`);
|
||||
print("/h/$host$_\n");
|
||||
}
|
||||
42
mozilla/config/nodl.pl
Normal file
42
mozilla/config/nodl.pl
Normal file
@@ -0,0 +1,42 @@
|
||||
#! perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# Print out the nodltab.
|
||||
# Usage: nodl.pl table-name sym1 sym2 ... symN
|
||||
#
|
||||
|
||||
$table = $ARGV[0];
|
||||
shift(@ARGV);
|
||||
|
||||
print "/* Automatically generated file; do not edit */\n\n";
|
||||
|
||||
print "#include \"prtypes.h\"\n\n";
|
||||
print "#include \"prlink.h\"\n\n";
|
||||
|
||||
foreach $symbol (@ARGV) {
|
||||
print "extern void ",$symbol,"();\n";
|
||||
}
|
||||
print "\n";
|
||||
|
||||
print "PRStaticLinkTable ",$table,"[] = {\n";
|
||||
foreach $symbol (@ARGV) {
|
||||
print " { \"",$symbol,"\", ",$symbol," },\n";
|
||||
}
|
||||
print " { 0, 0, },\n";
|
||||
print "};\n";
|
||||
400
mozilla/config/nsinstall.c
Normal file
400
mozilla/config/nsinstall.c
Normal file
@@ -0,0 +1,400 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
** Netscape portable install command.
|
||||
**
|
||||
** Brendan Eich, 7/20/95
|
||||
*/
|
||||
#include <stdio.h> /* OSF/1 requires this before grp.h, so put it first */
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifndef XP_OS2
|
||||
#include <grp.h>
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef XP_OS2
|
||||
#include <unistd.h>
|
||||
#include <utime.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include "pathsub.h"
|
||||
|
||||
#ifdef NEED_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef XP_OS2
|
||||
#include <dirent.h>
|
||||
#include <direct.h>
|
||||
#include <io.h>
|
||||
#include <sys\utime.h>
|
||||
#include <sys\types.h>
|
||||
#include "getopt.h" /*yes... we had to build this...*/
|
||||
#endif
|
||||
|
||||
#ifdef SUNOS4
|
||||
#include "sunos4.h"
|
||||
#endif
|
||||
|
||||
#ifdef NEXTSTEP
|
||||
#include <bsd/libc.h>
|
||||
#endif
|
||||
|
||||
#ifdef NEED_S_ISLNK
|
||||
#if !defined(S_ISLNK) && defined(S_IFLNK)
|
||||
#define S_ISLNK(a) (((a) & S_IFMT) == S_IFLNK)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_FCHMOD_PROTO
|
||||
extern int fchmod(int fildes, mode_t mode);
|
||||
#endif
|
||||
|
||||
#ifdef XP_OS2
|
||||
/*Note: OS/2 has no concept of users or groups, or symbolic links...*/
|
||||
#define lstat stat
|
||||
/*looks reasonably safe based on OS/2's stat.h...*/
|
||||
#define S_ISLNK(mode) 0 /*no way in hell on a file system that doesn't support it*/
|
||||
typedef unsigned short mode_t;
|
||||
typedef unsigned short uid_t;
|
||||
typedef unsigned short gid_t;
|
||||
#define mkdir(path, mode) mkdir(path)
|
||||
#define W_OK 1
|
||||
#define touid(spam) 0
|
||||
#define togid(spam) 0
|
||||
#define access(spam, spam2) 0
|
||||
#define chown(spam1, spam2, spam3) 0
|
||||
#define lchown(spam1, spam2, spam3) 0
|
||||
#define fchown(spam1, spam2, spam3) 0
|
||||
#define readlink(spam1, spam2, spam3) -1
|
||||
#define symlink(spam1, spam2) -1
|
||||
unsigned long _System DosSetFileSize(int, int);
|
||||
#define ftruncate(spam1, spam2) DosSetFileSize(spam1, spam2)
|
||||
#endif
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"usage: %s [-C cwd] [-L linkprefix] [-m mode] [-o owner] [-g group]\n"
|
||||
" %*s [-DdltR] file [file ...] directory\n",
|
||||
program, (int) strlen(program), "");
|
||||
exit(2);
|
||||
}
|
||||
|
||||
static int
|
||||
mkdirs(char *path, mode_t mode)
|
||||
{
|
||||
char *cp;
|
||||
struct stat sb;
|
||||
|
||||
while (*path == '/' && path[1] == '/')
|
||||
path++;
|
||||
while ((cp = strrchr(path, '/')) && cp[1] == '\0')
|
||||
*cp = '\0';
|
||||
if (cp && cp != path) {
|
||||
*cp = '\0';
|
||||
if ((lstat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&
|
||||
mkdirs(path, mode) < 0) {
|
||||
return -1;
|
||||
}
|
||||
*cp = '/';
|
||||
}
|
||||
return mkdir(path, mode);
|
||||
}
|
||||
|
||||
#ifndef XP_OS2
|
||||
static uid_t
|
||||
touid(char *owner)
|
||||
{
|
||||
struct passwd *pw;
|
||||
uid_t uid;
|
||||
char *cp;
|
||||
|
||||
pw = getpwnam(owner);
|
||||
if (pw)
|
||||
return pw->pw_uid;
|
||||
uid = strtol(owner, &cp, 0);
|
||||
if (uid == 0 && cp == owner)
|
||||
fail("cannot find uid for %s", owner);
|
||||
return uid;
|
||||
}
|
||||
|
||||
static gid_t
|
||||
togid(char *group)
|
||||
{
|
||||
struct group *gr;
|
||||
gid_t gid;
|
||||
char *cp;
|
||||
|
||||
gr = getgrnam(group);
|
||||
if (gr)
|
||||
return gr->gr_gid;
|
||||
gid = strtol(group, &cp, 0);
|
||||
if (gid == 0 && cp == group)
|
||||
fail("cannot find gid for %s", group);
|
||||
return gid;
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int onlydir, dodir, dolink, dorelsymlink, dotimes, opt, len, lplen, tdlen, bnlen, exists, fromfd, tofd, cc, wc;
|
||||
mode_t mode = 0755;
|
||||
char *linkprefix, *owner, *group, *cp, *cwd, *todir, *toname, *name, *base, *linkname, *bp, buf[BUFSIZ];
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
struct stat sb, tosb, fromsb;
|
||||
struct utimbuf utb;
|
||||
|
||||
program = argv[0];
|
||||
cwd = linkname = linkprefix = owner = group = 0;
|
||||
onlydir = dodir = dolink = dorelsymlink = dotimes = lplen = 0;
|
||||
|
||||
while ((opt = getopt(argc, argv, "C:DdlL:Rm:o:g:t")) != EOF) {
|
||||
switch (opt) {
|
||||
case 'C':
|
||||
cwd = optarg;
|
||||
break;
|
||||
case 'D':
|
||||
onlydir = 1;
|
||||
break;
|
||||
case 'd':
|
||||
dodir = 1;
|
||||
break;
|
||||
case 'l':
|
||||
dolink = 1;
|
||||
break;
|
||||
case 'L':
|
||||
linkprefix = optarg;
|
||||
lplen = strlen(linkprefix);
|
||||
dolink = 1;
|
||||
break;
|
||||
case 'R':
|
||||
#ifdef XP_OS2
|
||||
/* treat like -t since no symbolic links on OS2 */
|
||||
dotimes = 1;
|
||||
#else
|
||||
dolink = dorelsymlink = 1;
|
||||
#endif
|
||||
break;
|
||||
case 'm':
|
||||
mode = strtoul(optarg, &cp, 8);
|
||||
if (mode == 0 && cp == optarg)
|
||||
usage();
|
||||
break;
|
||||
case 'o':
|
||||
owner = optarg;
|
||||
break;
|
||||
case 'g':
|
||||
group = optarg;
|
||||
break;
|
||||
case 't':
|
||||
dotimes = 1;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
if (argc < 2 - onlydir)
|
||||
usage();
|
||||
|
||||
todir = argv[argc-1];
|
||||
if ((stat(todir, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&
|
||||
mkdirs(todir, 0777) < 0) {
|
||||
fail("cannot make directory %s", todir);
|
||||
}
|
||||
if (onlydir)
|
||||
return 0;
|
||||
|
||||
if (!cwd) {
|
||||
#ifndef NEEDS_GETCWD
|
||||
cwd = getcwd(0, PATH_MAX);
|
||||
#else
|
||||
cwd = malloc(PATH_MAX + 1);
|
||||
cwd = getwd(cwd);
|
||||
#endif
|
||||
}
|
||||
|
||||
xchdir(todir);
|
||||
#ifndef NEEDS_GETCWD
|
||||
todir = getcwd(0, PATH_MAX);
|
||||
#else
|
||||
todir = malloc(PATH_MAX + 1);
|
||||
todir = getwd(todir);
|
||||
#endif
|
||||
tdlen = strlen(todir);
|
||||
xchdir(cwd);
|
||||
tdlen = strlen(todir);
|
||||
|
||||
uid = owner ? touid(owner) : -1;
|
||||
gid = group ? togid(group) : -1;
|
||||
|
||||
while (--argc > 0) {
|
||||
name = *argv++;
|
||||
len = strlen(name);
|
||||
base = xbasename(name);
|
||||
bnlen = strlen(base);
|
||||
toname = xmalloc(tdlen + 1 + bnlen + 1);
|
||||
sprintf(toname, "%s/%s", todir, base);
|
||||
exists = (lstat(toname, &tosb) == 0);
|
||||
|
||||
if (dodir) {
|
||||
/* -d means create a directory, always */
|
||||
if (exists && !S_ISDIR(tosb.st_mode)) {
|
||||
(void) unlink(toname);
|
||||
exists = 0;
|
||||
}
|
||||
if (!exists && mkdir(toname, mode) < 0)
|
||||
fail("cannot make directory %s", toname);
|
||||
if ((owner || group) && chown(toname, uid, gid) < 0)
|
||||
fail("cannot change owner of %s", toname);
|
||||
} else if (dolink) {
|
||||
if (*name == '/') {
|
||||
/* source is absolute pathname, link to it directly */
|
||||
linkname = 0;
|
||||
} else {
|
||||
if (linkprefix) {
|
||||
/* -L implies -l and prefixes names with a $cwd arg. */
|
||||
len += lplen + 1;
|
||||
linkname = xmalloc(len + 1);
|
||||
sprintf(linkname, "%s/%s", linkprefix, name);
|
||||
} else if (dorelsymlink) {
|
||||
/* Symlink the relative path from todir to source name. */
|
||||
linkname = xmalloc(PATH_MAX);
|
||||
|
||||
if (*todir == '/') {
|
||||
/* todir is absolute: skip over common prefix. */
|
||||
lplen = relatepaths(todir, cwd, linkname);
|
||||
strcpy(linkname + lplen, name);
|
||||
} else {
|
||||
/* todir is named by a relative path: reverse it. */
|
||||
reversepath(todir, name, len, linkname);
|
||||
xchdir(cwd);
|
||||
}
|
||||
|
||||
len = strlen(linkname);
|
||||
}
|
||||
name = linkname;
|
||||
}
|
||||
|
||||
/* Check for a pre-existing symlink with identical content. */
|
||||
if ((exists && (!S_ISLNK(tosb.st_mode) ||
|
||||
readlink(toname, buf, sizeof buf) != len ||
|
||||
strncmp(buf, name, len) != 0)) ||
|
||||
((stat(name, &fromsb) == 0) &&
|
||||
(fromsb.st_mtime > tosb.st_mtime))) {
|
||||
(void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname);
|
||||
exists = 0;
|
||||
}
|
||||
if (!exists && symlink(name, toname) < 0)
|
||||
fail("cannot make symbolic link %s", toname);
|
||||
#ifdef HAVE_LCHOWN
|
||||
if ((owner || group) && lchown(toname, uid, gid) < 0)
|
||||
fail("cannot change owner of %s", toname);
|
||||
#endif
|
||||
|
||||
if (linkname) {
|
||||
free(linkname);
|
||||
linkname = 0;
|
||||
}
|
||||
} else {
|
||||
/* Copy from name to toname, which might be the same file. */
|
||||
#ifdef XP_OS2_FIX
|
||||
fromfd = open(name, O_RDONLY | O_BINARY);
|
||||
#else
|
||||
fromfd = open(name, O_RDONLY);
|
||||
#endif
|
||||
if (fromfd < 0 || fstat(fromfd, &sb) < 0)
|
||||
fail("cannot access %s", name);
|
||||
if (exists && (!S_ISREG(tosb.st_mode) || access(toname, W_OK) < 0))
|
||||
(void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname);
|
||||
#ifdef XP_OS2
|
||||
chmod(toname, S_IREAD | S_IWRITE);
|
||||
#endif
|
||||
#ifdef XP_OS2_FIX
|
||||
tofd = open(toname, O_CREAT | O_WRONLY | O_BINARY, 0666);
|
||||
#else
|
||||
tofd = open(toname, O_CREAT | O_WRONLY, 0666);
|
||||
#endif
|
||||
if (tofd < 0)
|
||||
fail("cannot create %s", toname);
|
||||
|
||||
bp = buf;
|
||||
while ((cc = read(fromfd, bp, sizeof buf)) > 0) {
|
||||
while ((wc = write(tofd, bp, cc)) > 0) {
|
||||
if ((cc -= wc) == 0)
|
||||
break;
|
||||
bp += wc;
|
||||
}
|
||||
if (wc < 0)
|
||||
fail("cannot write to %s", toname);
|
||||
}
|
||||
if (cc < 0)
|
||||
fail("cannot read from %s", name);
|
||||
|
||||
if (ftruncate(tofd, sb.st_size) < 0)
|
||||
fail("cannot truncate %s", toname);
|
||||
#ifndef XP_OS2
|
||||
if (dotimes) {
|
||||
utb.actime = sb.st_atime;
|
||||
utb.modtime = sb.st_mtime;
|
||||
if (utime(toname, &utb) < 0)
|
||||
fail("cannot set times of %s", toname);
|
||||
}
|
||||
if (fchmod(tofd, mode) < 0)
|
||||
fail("cannot change mode of %s", toname);
|
||||
#endif
|
||||
if ((owner || group) && fchown(tofd, uid, gid) < 0)
|
||||
fail("cannot change owner of %s", toname);
|
||||
|
||||
/* Must check for delayed (NFS) write errors on close. */
|
||||
if (close(tofd) < 0)
|
||||
fail("cannot write to %s", toname);
|
||||
close(fromfd);
|
||||
#ifdef XP_OS2
|
||||
if (dotimes) {
|
||||
utb.actime = sb.st_atime;
|
||||
utb.modtime = sb.st_mtime;
|
||||
if (utime(toname, &utb) < 0)
|
||||
fail("cannot set times of %s", toname);
|
||||
}
|
||||
if (chmod(toname, (mode & (S_IREAD | S_IWRITE))) < 0)
|
||||
fail("cannot change mode of %s", toname);
|
||||
#endif
|
||||
}
|
||||
|
||||
free(toname);
|
||||
}
|
||||
|
||||
free(cwd);
|
||||
free(todir);
|
||||
return 0;
|
||||
}
|
||||
209
mozilla/config/obj.inc
Normal file
209
mozilla/config/obj.inc
Normal file
@@ -0,0 +1,209 @@
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
!if !defined(VERBOSE)
|
||||
.SILENT:
|
||||
!endif
|
||||
|
||||
## Include support for MOZ_LITE/MOZ_MEDIUM
|
||||
include <$(DEPTH)/config/liteness.mak>
|
||||
|
||||
RCFLAGS=$(RCFLAGS) $(MOZ_LITENESS_FLAGS)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// This makefile contains all of the rules necessary to build 16 and 32 bit
|
||||
#// object files.
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!if !defined(CONFIG_OBJ_INC)
|
||||
CONFIG_OBJ_INC=1
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rules for compiling 16/32 bit object files from either c or c++ source
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
.c.obj:
|
||||
@$(CC) @<<$(CFGFILE)
|
||||
-nologo -c $(OPTIMIZER)
|
||||
$(CFLAGS)
|
||||
$(LCFLAGS)
|
||||
$(LINCS)
|
||||
$(LINCS_1)
|
||||
$(INCS)
|
||||
-Fd$(PDBFILE)
|
||||
$(CURDIR)$(*B).c
|
||||
<<KEEP
|
||||
|
||||
.c{.\$(OBJDIR)\}.obj:
|
||||
@$(CC) @<<$(CFGFILE)
|
||||
-nologo -c $(OPTIMIZER)
|
||||
$(CFLAGS)
|
||||
$(LCFLAGS)
|
||||
$(LINCS)
|
||||
$(LINCS_1)
|
||||
$(INCS)
|
||||
-Fd$(PDBFILE)
|
||||
-Fo.\$(OBJDIR)\
|
||||
$(CURDIR)$(*B).c
|
||||
<<KEEP
|
||||
|
||||
{.\_jmc\}.c{.\$(OBJDIR)\}.obj:
|
||||
@$(CC) @<<$(CFGFILE)
|
||||
-nologo -c $(OPTIMIZER)
|
||||
$(CFLAGS)
|
||||
$(LCFLAGS)
|
||||
$(LINCS)
|
||||
$(LINCS_1)
|
||||
$(INCS)
|
||||
-Fd$(PDBFILE)
|
||||
-Fo.\$(OBJDIR)\
|
||||
$(CURDIR)_jmc\$(*B).c
|
||||
<<KEEP
|
||||
|
||||
.cpp.obj:
|
||||
@$(CC) @<<$(CFGFILE)
|
||||
-nologo -c $(OPTIMIZER)
|
||||
$(CFLAGS)
|
||||
$(LCFLAGS)
|
||||
$(LINCS)
|
||||
$(LINCS_1)
|
||||
$(INCS)
|
||||
-Fd$(PDBFILE)
|
||||
$(CURDIR)$(*B).cpp
|
||||
<<KEEP
|
||||
|
||||
.cpp{.\$(OBJDIR)\}.obj:
|
||||
@$(CC) @<<$(CFGFILE)
|
||||
-nologo -c $(OPTIMIZER)
|
||||
$(CFLAGS)
|
||||
$(LCFLAGS)
|
||||
$(LINCS)
|
||||
$(LINCS_1)
|
||||
$(INCS)
|
||||
-Fd$(PDBFILE)
|
||||
-Fo.\$(OBJDIR)\
|
||||
$(CURDIR)$(*B).cpp
|
||||
<<KEEP
|
||||
|
||||
{.\_jmc\}.cpp{.\$(OBJDIR)\}.obj:
|
||||
@$(CC) @<<$(CFGFILE)
|
||||
-nologo -c $(OPTIMIZER)
|
||||
$(CFLAGS)
|
||||
$(LCFLAGS)
|
||||
$(LINCS)
|
||||
$(LINCS_1)
|
||||
$(INCS)
|
||||
-Fd$(PDBFILE)
|
||||
-Fo.\$(OBJDIR)\
|
||||
$(CURDIR)_jmc\$(*B).cpp
|
||||
<<KEEP
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule for compiling resource files
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
.rc{.\$(OBJDIR)\}.res:
|
||||
# //
|
||||
# // execute the command
|
||||
# //
|
||||
echo Creating Resource file: $*.res
|
||||
$(RC) $(RCFLAGS) -r -Fo.\$(OBJDIR)\$(*B).res $(*B).rc
|
||||
|
||||
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule for building simple 16 bit executables
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
.c{.\$(OBJDIR)\}.exe:
|
||||
$(CC) @<<$(CFGFILE)
|
||||
-c
|
||||
$(OPTIMIZER)
|
||||
$(CFLAGS)
|
||||
$(LCFLAGS)
|
||||
$(LINCS)
|
||||
$(LINCS_1)
|
||||
$(INCS)
|
||||
-Fd$(PBDFILE)
|
||||
-Fo.\$(OBJDIR)\
|
||||
$(CURDIR)$(*B).c
|
||||
<<
|
||||
$(LD) @<<$(CFGFILE)
|
||||
$(LFLAGS)
|
||||
$(OBJDIR)\$(*B).obj,
|
||||
$(OBJDIR)\$(*B).exe,
|
||||
$(MAPFILE),
|
||||
$(LLIBS) $(OS_LIBS),
|
||||
$(DEFFILE),
|
||||
$(RESFILE),
|
||||
<<
|
||||
|
||||
!else
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule for building simple 32 bit executables
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
.c{.\$(OBJDIR)\}.exe:
|
||||
$(CC) @<<$(CFGFILE)
|
||||
$(CFLAGS)
|
||||
$(LCFLAGS)
|
||||
$(LINCS)
|
||||
$(LINCS_1)
|
||||
$(INCS)
|
||||
-Fd$(PBDFILE)
|
||||
-Fe.\$(OBJDIR)\
|
||||
$(CURDIR)$(*B).c
|
||||
<<
|
||||
!endif
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule for creating .i file containing c preprocessor output
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
.c.i:
|
||||
@$(CC) @<<$(CFGFILE)
|
||||
/P -c
|
||||
$(OPTIMIZER)
|
||||
$(CFLAGS)
|
||||
$(LCFLAGS)
|
||||
$(LINCS)
|
||||
$(LINCS_1)
|
||||
$(INCS)
|
||||
-Fd$(PDBFILE)
|
||||
$(CURDIR)$(*B).c
|
||||
<<KEEP
|
||||
|
||||
.c{.\$(OBJDIR)\}.i:
|
||||
@$(CC) @<<$(CFGFILE)
|
||||
/P -c
|
||||
$(OPTIMIZER)
|
||||
$(CFLAGS)
|
||||
$(LCFLAGS)
|
||||
$(LINCS)
|
||||
$(LINCS_1)
|
||||
$(INCS)
|
||||
-Fd$(PDBFILE)
|
||||
-Fo.\$(OBJDIR)\
|
||||
$(CURDIR)$(*B).c
|
||||
<<KEEP
|
||||
|
||||
|
||||
!endif # CONFIG_OBJ_INC
|
||||
63
mozilla/config/outofdate.pl
Normal file
63
mozilla/config/outofdate.pl
Normal file
@@ -0,0 +1,63 @@
|
||||
#!perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
#
|
||||
#Input: [-d dir] foo1.java foo2.java
|
||||
#Compares with: foo1.class foo2.class (if -d specified, checks in 'dir',
|
||||
# otherwise assumes .class files in same directory as .java files)
|
||||
#Returns: list of input arguments which are newer than corresponding class
|
||||
#files (non-existant class files are considered to be real old :-)
|
||||
#
|
||||
|
||||
$found = 1;
|
||||
|
||||
if ($ARGV[0] eq '-d') {
|
||||
$classdir = $ARGV[1];
|
||||
$classdir .= "/";
|
||||
shift;
|
||||
shift;
|
||||
} else {
|
||||
$classdir = "./";
|
||||
}
|
||||
|
||||
foreach $filename (@ARGV) {
|
||||
$classfilename = $classdir;
|
||||
$classfilename .= $filename;
|
||||
$classfilename =~ s/.java$/.class/;
|
||||
# workaround to only build sun/io/* classes when necessary
|
||||
# change the pathname of target file to be consistent
|
||||
# with sun/io subdirectories
|
||||
#
|
||||
# sun/io was always getting rebuilt because the java files
|
||||
# were split into subdirectories, but the package names
|
||||
# remained the same. This was confusing outofdate.pl
|
||||
#
|
||||
$classfilename =~ s/sun\/io\/extended.\//sun\/io\//;
|
||||
$classfilename =~ s/\.\.\/\.\.\/sun-java\/classsrc\///;
|
||||
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,
|
||||
$ctime,$blksize,$blocks) = stat($filename);
|
||||
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$classmtime,
|
||||
$ctime,$blksize,$blocks) = stat($classfilename);
|
||||
# print $filename, " ", $mtime, ", ", $classfilename, " ", $classmtime, "\n";
|
||||
if ($mtime > $classmtime) {
|
||||
print $filename, " ";
|
||||
$found = 0;
|
||||
}
|
||||
}
|
||||
|
||||
print "\n";
|
||||
232
mozilla/config/pathsub.c
Normal file
232
mozilla/config/pathsub.c
Normal file
@@ -0,0 +1,232 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
** Pathname subroutines.
|
||||
**
|
||||
** Brendan Eich, 8/29/95
|
||||
*/
|
||||
#include <assert.h>
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifndef XP_OS2
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#include "pathsub.h"
|
||||
|
||||
#ifdef USE_REENTRANT_LIBC
|
||||
#include <libc_r.h>
|
||||
#endif
|
||||
|
||||
#ifdef XP_OS2
|
||||
#include <direct.h>
|
||||
#include <io.h>
|
||||
#include <sys\utime.h>
|
||||
#include <sys\types.h>
|
||||
#endif
|
||||
|
||||
#ifdef SUNOS4
|
||||
#include "sunos4.h"
|
||||
#endif
|
||||
|
||||
char *program;
|
||||
|
||||
void
|
||||
fail(char *format, ...)
|
||||
{
|
||||
int error;
|
||||
va_list ap;
|
||||
|
||||
#ifdef USE_REENTRANT_LIBC
|
||||
R_STRERROR_INIT_R();
|
||||
#endif
|
||||
|
||||
error = errno;
|
||||
fprintf(stderr, "%s: ", program);
|
||||
va_start(ap, format);
|
||||
vfprintf(stderr, format, ap);
|
||||
va_end(ap);
|
||||
if (error)
|
||||
|
||||
#ifdef USE_REENTRANT_LIBC
|
||||
R_STRERROR_R(errno);
|
||||
fprintf(stderr, ": %s", r_strerror_r);
|
||||
#else
|
||||
fprintf(stderr, ": %s", strerror(errno));
|
||||
#endif
|
||||
|
||||
putc('\n', stderr);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
char *
|
||||
getcomponent(char *path, char *name)
|
||||
{
|
||||
if (*path == '\0')
|
||||
return 0;
|
||||
if (*path == '/') {
|
||||
*name++ = '/';
|
||||
} else {
|
||||
do {
|
||||
*name++ = *path++;
|
||||
} while (*path != '/' && *path != '\0');
|
||||
}
|
||||
*name = '\0';
|
||||
while (*path == '/')
|
||||
path++;
|
||||
return path;
|
||||
}
|
||||
|
||||
#ifdef LAME_READDIR
|
||||
#include <sys/param.h>
|
||||
/*
|
||||
** The static buffer in Unixware's readdir is too small.
|
||||
*/
|
||||
struct dirent *readdir(DIR *d)
|
||||
{
|
||||
static struct dirent *buf = NULL;
|
||||
|
||||
if(buf == NULL)
|
||||
buf = (struct dirent *) malloc(sizeof(struct dirent) + MAXPATHLEN);
|
||||
return(readdir_r(d, buf));
|
||||
}
|
||||
#endif
|
||||
|
||||
char *
|
||||
ino2name(ino_t ino, char *dir)
|
||||
{
|
||||
DIR *dp;
|
||||
struct dirent *ep;
|
||||
char *name;
|
||||
|
||||
dp = opendir("..");
|
||||
if (!dp)
|
||||
fail("cannot read parent directory");
|
||||
for (;;) {
|
||||
if (!(ep = readdir(dp)))
|
||||
fail("cannot find current directory");
|
||||
if (ep->d_ino == ino)
|
||||
break;
|
||||
}
|
||||
name = xstrdup(ep->d_name);
|
||||
closedir(dp);
|
||||
return name;
|
||||
}
|
||||
|
||||
void *
|
||||
xmalloc(size_t size)
|
||||
{
|
||||
void *p = malloc(size);
|
||||
if (!p)
|
||||
fail("cannot allocate %u bytes", size);
|
||||
return p;
|
||||
}
|
||||
|
||||
char *
|
||||
xstrdup(char *s)
|
||||
{
|
||||
return strcpy(xmalloc(strlen(s) + 1), s);
|
||||
}
|
||||
|
||||
char *
|
||||
xbasename(char *path)
|
||||
{
|
||||
char *cp;
|
||||
|
||||
while ((cp = strrchr(path, '/')) && cp[1] == '\0')
|
||||
*cp = '\0';
|
||||
if (!cp) return path;
|
||||
return cp + 1;
|
||||
}
|
||||
|
||||
void
|
||||
xchdir(char *dir)
|
||||
{
|
||||
if (chdir(dir) < 0)
|
||||
fail("cannot change directory to %s", dir);
|
||||
}
|
||||
|
||||
int
|
||||
relatepaths(char *from, char *to, char *outpath)
|
||||
{
|
||||
char *cp, *cp2;
|
||||
int len;
|
||||
char buf[NAME_MAX];
|
||||
|
||||
assert(*from == '/' && *to == '/');
|
||||
for (cp = to, cp2 = from; *cp == *cp2; cp++, cp2++)
|
||||
if (*cp == '\0')
|
||||
break;
|
||||
while (cp[-1] != '/')
|
||||
cp--, cp2--;
|
||||
if (cp - 1 == to) {
|
||||
/* closest common ancestor is /, so use full pathname */
|
||||
len = strlen(strcpy(outpath, to));
|
||||
if (outpath[len] != '/') {
|
||||
outpath[len++] = '/';
|
||||
outpath[len] = '\0';
|
||||
}
|
||||
} else {
|
||||
len = 0;
|
||||
while ((cp2 = getcomponent(cp2, buf)) != 0) {
|
||||
strcpy(outpath + len, "../");
|
||||
len += 3;
|
||||
}
|
||||
while ((cp = getcomponent(cp, buf)) != 0) {
|
||||
sprintf(outpath + len, "%s/", buf);
|
||||
len += strlen(outpath + len);
|
||||
}
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
void
|
||||
reversepath(char *inpath, char *name, int len, char *outpath)
|
||||
{
|
||||
char *cp, *cp2;
|
||||
char buf[NAME_MAX];
|
||||
struct stat sb;
|
||||
|
||||
cp = strcpy(outpath + PATH_MAX - (len + 1), name);
|
||||
cp2 = inpath;
|
||||
while ((cp2 = getcomponent(cp2, buf)) != 0) {
|
||||
if (strcmp(buf, ".") == 0)
|
||||
continue;
|
||||
if (strcmp(buf, "..") == 0) {
|
||||
if (stat(".", &sb) < 0)
|
||||
fail("cannot stat current directory");
|
||||
name = ino2name(sb.st_ino, "..");
|
||||
len = strlen(name);
|
||||
cp -= len + 1;
|
||||
strcpy(cp, name);
|
||||
cp[len] = '/';
|
||||
free(name);
|
||||
xchdir("..");
|
||||
} else {
|
||||
cp -= 3;
|
||||
strncpy(cp, "../", 3);
|
||||
xchdir(buf);
|
||||
}
|
||||
}
|
||||
strcpy(outpath, cp);
|
||||
}
|
||||
55
mozilla/config/pathsub.h
Normal file
55
mozilla/config/pathsub.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef pathsub_h___
|
||||
#define pathsub_h___
|
||||
/*
|
||||
** Pathname subroutines.
|
||||
**
|
||||
** Brendan Eich, 8/29/95
|
||||
*/
|
||||
#include <limits.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Just prevent stupidity
|
||||
*/
|
||||
#undef NAME_MAX
|
||||
#define NAME_MAX 256
|
||||
|
||||
extern char *program;
|
||||
|
||||
extern void fail(char *format, ...);
|
||||
extern char *getcomponent(char *path, char *name);
|
||||
extern char *ino2name(ino_t ino, char *dir);
|
||||
extern void *xmalloc(size_t size);
|
||||
extern char *xstrdup(char *s);
|
||||
extern char *xbasename(char *path);
|
||||
extern void xchdir(char *dir);
|
||||
|
||||
/* Relate absolute pathnames from and to returning the result in outpath. */
|
||||
extern int relatepaths(char *from, char *to, char *outpath);
|
||||
|
||||
/* XXX changes current working directory -- caveat emptor */
|
||||
extern void reversepath(char *inpath, char *name, int len, char *outpath);
|
||||
|
||||
#endif /* pathsub_h___ */
|
||||
27
mozilla/config/pkg2dpth.pl
Executable file
27
mozilla/config/pkg2dpth.pl
Executable file
@@ -0,0 +1,27 @@
|
||||
#!perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# Transform package paths to depths:
|
||||
# foo/bar ==> ../..
|
||||
#
|
||||
|
||||
# Why don't we need .. here?
|
||||
$ARGV[0] =~ s@[^/\\]+@..@g;
|
||||
|
||||
print $ARGV[0]
|
||||
34
mozilla/config/ports/Makefile
Normal file
34
mozilla/config/ports/Makefile
Normal file
@@ -0,0 +1,34 @@
|
||||
# -*- Mode: Makefile -*-
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# A pitifully inadequate tool for starting a port to a new platform.
|
||||
#
|
||||
OS_ARCH := $(subst /,_,$(shell uname -s))
|
||||
OS_RELEASE := $(shell uname -r)
|
||||
|
||||
MK_FILE = $(OS_ARCH)$(OS_RELEASE).mk
|
||||
|
||||
all: $(MK_FILE)
|
||||
|
||||
$(MK_FILE): configure.sh
|
||||
@rm -f $@
|
||||
@$< $(OS_ARCH) $(OS_RELEASE) $@
|
||||
|
||||
clean:
|
||||
rm -f $(MK_FILE) $(wildcard *.add)
|
||||
537
mozilla/config/ports/configure.sh
Executable file
537
mozilla/config/ports/configure.sh
Executable file
@@ -0,0 +1,537 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
ARCH="$1"
|
||||
RELEASE="$2"
|
||||
MKFILE="$3"
|
||||
BSDECHO=""
|
||||
LIB_DIRS=""
|
||||
MACROS=""
|
||||
PATH="/usr/ccs/bin:/tools/ns/bin:/tools/contrib/bin:/usr/local/bin:/usr/sbin:/usr/bsd:/sbin:/usr/bin:/bin:/usr/bin/X11:/usr/etc:/usr/ucb:/usr/lpp/xlC/bin"
|
||||
POSSIBLE_X_DIRS="/usr/X/lib /usr/X11R6/lib /usr/abiccs/lib/X11R5 /usr/X11/lib /usr/lib/X11 /usr/lib /lib"
|
||||
SPECIAL=""
|
||||
TMPFILE="foo.$$.c"
|
||||
X_DIR=""
|
||||
XFE_MKFILE="xfe_mfile.add"
|
||||
|
||||
export PATH
|
||||
|
||||
rm -f foo ${TMPFILE}
|
||||
|
||||
echo "Let's see what we've got to work with...."
|
||||
|
||||
if test "`echo -n blah`" != "-n blah"
|
||||
then
|
||||
BSDECHO="echo"
|
||||
ECHO_FLAG="-n"
|
||||
ENDER=""
|
||||
else
|
||||
ECHO_FLAG=""
|
||||
ENDER="\c"
|
||||
fi
|
||||
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
echo "void main() { }" >> ${TMPFILE}
|
||||
cc -o foo ${TMPFILE} >/dev/null 2>&1
|
||||
if test $? -eq 0
|
||||
then
|
||||
CC="cc"
|
||||
else
|
||||
CC="gcc"
|
||||
fi
|
||||
echo "Compiler seems to be ${CC}...."
|
||||
|
||||
echo "Looking for various header files...."
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have <stddef.h>....${ENDER}"
|
||||
if test -f /usr/include/stddef.h
|
||||
then
|
||||
MACROS="${MACROS} -DHAVE_STDDEF_H"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have <stdlib.h>....${ENDER}"
|
||||
if test -f /usr/include/stdlib.h
|
||||
then
|
||||
MACROS="${MACROS} -DHAVE_STDLIB_H"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have <model.h>....${ENDER}"
|
||||
if test -f /usr/include/model.h
|
||||
then
|
||||
MACROS="${MACROS} -DHAVE_MODEL_H"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have <bitypes.h>....${ENDER}"
|
||||
if test -f /usr/include/bitypes.h
|
||||
then
|
||||
MACROS="${MACROS} -DHAVE_BITYPES_H"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have <sys/bitypes.h>....${ENDER}"
|
||||
if test -f /usr/include/sys/bitypes.h
|
||||
then
|
||||
MACROS="${MACROS} -DHAVE_SYS_BITYPES_H"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have <sys/filio.h>....${ENDER}"
|
||||
if test -f /usr/include/sys/filio.h
|
||||
then
|
||||
MACROS="${MACROS} -DHAVE_FILIO_H"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have <sys/endian.h>....${ENDER}"
|
||||
if test -f /usr/include/sys/endian.h
|
||||
then
|
||||
MACROS="${MACROS} -DSYS_ENDIAN_H"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have <ntohl/endian.h> and/or <machine/endian.h>....${ENDER}"
|
||||
if test -f /usr/include/ntohl/endian.h -o -f /usr/include/machine/endian.h
|
||||
then
|
||||
MACROS="${MACROS} -DNTOHL_ENDIAN_H"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have <machine/endian.h>....${ENDER}"
|
||||
if test -f /usr/include/machine/endian.h
|
||||
then
|
||||
MACROS="${MACROS} -DMACHINE_ENDIAN_H"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have <sys/machine.h>....${ENDER}"
|
||||
if test -f /usr/include/sys/machine.h
|
||||
then
|
||||
MACROS="${MACROS} -DSYS_MACHINE_H"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have <sys/byteorder.h>....${ENDER}"
|
||||
if test -f /usr/include/sys/byteorder.h
|
||||
then
|
||||
MACROS="${MACROS} -DSYS_BYTEORDER_H"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have either <cdefs.h> or <sys/cdefs.h>....${ENDER}"
|
||||
if test ! -f /usr/include/cdefs.h -a ! -f /usr/include/sys/cdefs.h
|
||||
then
|
||||
MACROS="${MACROS} -DNO_CDEFS_H"
|
||||
echo " no"
|
||||
else
|
||||
echo " yes"
|
||||
fi
|
||||
|
||||
#
|
||||
# Obviously I have no idea what I _should_ be looking for here.... --briano.
|
||||
#
|
||||
echo "Trying to determine if this system is strict SYSV...."
|
||||
rm -f foo ${TMPFILE}
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
if test -f /usr/include/sys/param.h
|
||||
then
|
||||
echo "#include <sys/param.h>" >> ${TMPFILE}
|
||||
fi
|
||||
echo "int main() {" >> ${TMPFILE}
|
||||
echo "#if defined(SVR4) || defined(SYSV) || defined(__svr4) || defined(__svr4__) || defined(_SVR4) || defined(__SVR4) || defined(M_SYSV) || defined(_M_SYSV)" >> ${TMPFILE}
|
||||
echo " return(0);" >> ${TMPFILE}
|
||||
echo "#endif" >> ${TMPFILE}
|
||||
echo "#if defined(BSD) || defined(bsd) || defined(__bsd) || defined(__bsd__) || defined(_BSD) || defined(__BSD)" >> ${TMPFILE}
|
||||
echo " return(1);" >> ${TMPFILE}
|
||||
echo "#endif" >> ${TMPFILE}
|
||||
echo " return(2);" >> ${TMPFILE}
|
||||
echo "}" >> ${TMPFILE}
|
||||
${CC} -o foo ${TMPFILE} >/dev/null 2>&1
|
||||
./foo
|
||||
case $? in
|
||||
0) echo " -- Looks like SYSVR4...."
|
||||
MACROS="${MACROS} -DSYSV -DSVR4 -D__svr4 -D__svr4__"
|
||||
;;
|
||||
1) echo " -- Looks like BSD...."
|
||||
;;
|
||||
2) echo " -- Can't tell. Could be either SYSV or BSD, or both...."
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
echo "Looking for various platform-specific quirks...."
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have long long....${ENDER}"
|
||||
rm -f foo ${TMPFILE}
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
echo "void main() { long long x; }" >> ${TMPFILE}
|
||||
${CC} -o foo ${TMPFILE} >/dev/null 2>&1
|
||||
if test $? -ne 0
|
||||
then
|
||||
MACROS="${MACROS} -DNO_LONG_LONG"
|
||||
echo " no"
|
||||
else
|
||||
echo " yes"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have signed long....${ENDER}"
|
||||
rm -f foo ${TMPFILE}
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
echo "void main() { signed long x; }" >> ${TMPFILE}
|
||||
${CC} -o foo ${TMPFILE} >/dev/null 2>&1
|
||||
if test $? -ne 0
|
||||
then
|
||||
MACROS="${MACROS} -DNO_SIGNED"
|
||||
echo " no"
|
||||
else
|
||||
echo " yes"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have strerror()....${ENDER}"
|
||||
rm -f foo ${TMPFILE}
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
echo "void main() { (void *)strerror(666); }" >> ${TMPFILE}
|
||||
${CC} -o foo ${TMPFILE} >/dev/null 2>&1
|
||||
if test $? -eq 0
|
||||
then
|
||||
SPECIAL="-DHAVE_STRERROR"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have lchown()....${ENDER}"
|
||||
rm -f foo ${TMPFILE}
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
echo "void main() { (void)lchown(\"/foo\",666,666); }" >> ${TMPFILE}
|
||||
${CC} -o foo ${TMPFILE} >/dev/null 2>&1
|
||||
if test $? -eq 0
|
||||
then
|
||||
MACROS="${MACROS} -DHAVE_LCHOWN"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have memmove()....${ENDER}"
|
||||
rm -f foo ${TMPFILE}
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
echo "void main() { char s[32]; const char *s2 = \"diediedie\"; memmove(s,s2,32); }" >> ${TMPFILE}
|
||||
${CC} -o foo ${TMPFILE} >/dev/null 2>&1
|
||||
if test $? -ne 0
|
||||
then
|
||||
MACROS="${MACROS} -DNO_MEMMOVE"
|
||||
echo " no"
|
||||
else
|
||||
echo " yes"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have alloca()....${ENDER}"
|
||||
rm -f foo ${TMPFILE}
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
if test -f /usr/include/alloca.h
|
||||
then
|
||||
echo "#include <alloca.h>" > ${TMPFILE}
|
||||
fi
|
||||
echo "void main() { alloca(666); }" >> ${TMPFILE}
|
||||
${CC} -o foo ${TMPFILE} >/dev/null 2>&1
|
||||
if test $? -ne 0
|
||||
then
|
||||
MACROS="${MACROS} -DNO_ALLOCA"
|
||||
echo " no"
|
||||
else
|
||||
echo " yes"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have regex()....${ENDER}"
|
||||
rm -f foo ${TMPFILE}
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
echo "void main() { (void *)regex(\"foo\",(char *)0); }" >> ${TMPFILE}
|
||||
${CC} -o foo ${TMPFILE} -lgen >/dev/null 2>&1
|
||||
if test $? -ne 0
|
||||
then
|
||||
MACROS="${MACROS} -DNO_REGEX"
|
||||
echo " no"
|
||||
else
|
||||
echo " yes"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have regcmp()....${ENDER}"
|
||||
rm -f foo ${TMPFILE}
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
echo "void main() { (void *)regcmp(\"foo\",\"barfoofrab\"); }" >> ${TMPFILE}
|
||||
${CC} -o foo ${TMPFILE} -lgen >/dev/null 2>&1
|
||||
if test $? -ne 0
|
||||
then
|
||||
MACROS="${MACROS} -DNO_REGCOMP"
|
||||
echo " no"
|
||||
else
|
||||
echo " yes"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have pgno_t....${ENDER}"
|
||||
rm -f foo ${TMPFILE}
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
echo "void main() { pgno_t foo = 0; }" >> ${TMPFILE}
|
||||
${CC} -o foo ${TMPFILE} >/dev/null 2>&1
|
||||
if test $? -ne 0
|
||||
then
|
||||
MACROS="${MACROS} -DHAS_PGNO_T"
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have IN_MULTICAST....${ENDER}"
|
||||
rm -f foo ${TMPFILE}
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
if test -f /usr/include/types.h
|
||||
then
|
||||
echo "#include <types.h>" >> ${TMPFILE}
|
||||
fi
|
||||
if test -f /usr/include/sys/types.h
|
||||
then
|
||||
echo "#include <sys/types.h>" >> ${TMPFILE}
|
||||
fi
|
||||
if test -f /usr/include/netinet/in.h
|
||||
then
|
||||
echo "#include <netinet/in.h>" >> ${TMPFILE}
|
||||
fi
|
||||
if test -f /usr/include/linux/in.h
|
||||
then
|
||||
echo "#include <linux/in.h>" >> ${TMPFILE}
|
||||
fi
|
||||
if test -f /usr/include/sys/socket.h
|
||||
then
|
||||
echo "#include <sys/socket.h>" >> ${TMPFILE}
|
||||
fi
|
||||
echo "void main() {" >> ${TMPFILE}
|
||||
echo "#ifndef IN_MULTICAST" >> ${TMPFILE}
|
||||
echo "ERROR" >> ${TMPFILE}
|
||||
echo "#endif" >> ${TMPFILE}
|
||||
echo "}" >> ${TMPFILE}
|
||||
${CC} -o foo ${TMPFILE} >/dev/null 2>&1
|
||||
if test $? -ne 0
|
||||
then
|
||||
MACROS="${MACROS} -DNO_MULTICAST"
|
||||
echo " no"
|
||||
else
|
||||
echo " yes"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have tzname[]....${ENDER}"
|
||||
rm -f foo ${TMPFILE}
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
if test -f /usr/include/time.h
|
||||
then
|
||||
echo "#include <time.h>" >> ${TMPFILE}
|
||||
fi
|
||||
if test -f /usr/include/sys/time.h
|
||||
then
|
||||
echo "#include <sys/time.h>" >> ${TMPFILE}
|
||||
fi
|
||||
echo "void main() { int foo = tzname[0]; }" >> ${TMPFILE}
|
||||
${CC} -o foo ${TMPFILE} >/dev/null 2>&1
|
||||
if test $? -ne 0
|
||||
then
|
||||
MACROS="${MACROS} -DNO_TZNAME"
|
||||
echo " no"
|
||||
else
|
||||
echo " yes"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have realpath()....${ENDER}"
|
||||
rm -f foo ${TMPFILE}
|
||||
echo "#include <stdio.h>" > ${TMPFILE}
|
||||
echo "void main() { const char *s1 = \"/foo/bar\"; char *s2; (void *)realpath(s1,s2); }" >> ${TMPFILE}
|
||||
${CC} -o foo ${TMPFILE} >/dev/null 2>&1
|
||||
if test $? -ne 0
|
||||
then
|
||||
MACROS="${MACROS} -DNEED_REALPATH"
|
||||
echo " no"
|
||||
else
|
||||
echo " yes"
|
||||
fi
|
||||
|
||||
rm -f foo ${TMPFILE}
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have ranlib....${ENDER}"
|
||||
ranlib >/dev/null 2>&1
|
||||
if test $? -eq 0
|
||||
then
|
||||
RANLIB="ranlib"
|
||||
echo " yes"
|
||||
else
|
||||
RANLIB="true"
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo ${ECHO_FLAG} "Do we have xemacs....${ENDER}"
|
||||
xemacs --version >/dev/null 2>&1
|
||||
if test $? -eq 0
|
||||
then
|
||||
EMACS="xemacs"
|
||||
echo " yes"
|
||||
else
|
||||
EMACS="true"
|
||||
echo " no"
|
||||
fi
|
||||
|
||||
echo "Generating ${MKFILE} file...."
|
||||
|
||||
if test -x /bin/echo -a -z "${BSDECHO}"
|
||||
then
|
||||
if test "`/bin/echo -n blah`" != "-n blah"
|
||||
then
|
||||
BSDECHO="/bin/echo"
|
||||
fi
|
||||
fi
|
||||
if test -x /usr/ucb/echo -a -z "${BSDECHO}"
|
||||
then
|
||||
if test "`/usr/ucb/echo -n blah`" != "-n blah"
|
||||
then
|
||||
BSDECHO="/usr/ucb/echo"
|
||||
fi
|
||||
fi
|
||||
if test -z "${BSDECHO}"
|
||||
then
|
||||
BSDECHO="\$(DIST)/bin/bsdecho"
|
||||
fi
|
||||
|
||||
CPU_ARCH="`uname -m`"
|
||||
case ${CPU_ARCH} in
|
||||
000*)
|
||||
CPU_ARCH="rs6000"
|
||||
;;
|
||||
9000*)
|
||||
CPU_ARCH="hppa"
|
||||
;;
|
||||
IP* | RM[45]00 | R[45]000)
|
||||
CPU_ARCH="mips"
|
||||
;;
|
||||
34* | i[3456]86* | i86pc)
|
||||
CPU_ARCH="x86"
|
||||
;;
|
||||
sun4*)
|
||||
CPU_ARCH="sparc"
|
||||
;;
|
||||
esac
|
||||
|
||||
for i in ${POSSIBLE_X_DIRS}
|
||||
do
|
||||
if test -d ${i}
|
||||
then
|
||||
LIB_DIRS="${LIB_DIRS} ${i}"
|
||||
fi
|
||||
done
|
||||
if test ! -z "${LIB_DIRS}"
|
||||
then
|
||||
for i in ${LIB_DIRS}
|
||||
do
|
||||
if test -f ${i}/libX11.a -o -f ${i}/libX11.so
|
||||
then
|
||||
X_DIR="${i}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
rm -f ${MKFILE}
|
||||
echo "######################################################################" > ${MKFILE}
|
||||
echo "# Config stuff for ${ARCH}." >> ${MKFILE}
|
||||
echo "######################################################################" >> ${MKFILE}
|
||||
echo "" >> ${MKFILE}
|
||||
echo "######################################################################" >> ${MKFILE}
|
||||
echo "# Version-independent" >> ${MKFILE}
|
||||
echo "######################################################################" >> ${MKFILE}
|
||||
echo "" >> ${MKFILE}
|
||||
echo "ARCH := `echo ${ARCH} | tr '[A-Z]' '[a-z]'`" >> ${MKFILE}
|
||||
echo "CPU_ARCH := ${CPU_ARCH}" >> ${MKFILE}
|
||||
echo "GFX_ARCH := x" >> ${MKFILE}
|
||||
echo "" >> ${MKFILE}
|
||||
echo "CC = ${CC}" >> ${MKFILE}
|
||||
echo "CCC =" >> ${MKFILE}
|
||||
echo "BSDECHO = ${BSDECHO}" >> ${MKFILE}
|
||||
echo "EMACS = ${EMACS}" >> ${MKFILE}
|
||||
echo "RANLIB = ${RANLIB}" >> ${MKFILE}
|
||||
echo "" >> ${MKFILE}
|
||||
echo "OS_INCLUDES = -I/usr/X11/include" >> ${MKFILE}
|
||||
echo "G++INCLUDES =" >> ${MKFILE}
|
||||
echo "LOC_LIB_DIR = ${X_DIR}" >> ${MKFILE}
|
||||
echo "MOTIF =" >> ${MKFILE}
|
||||
echo "MOTIFLIB = -lXm" >> ${MKFILE}
|
||||
echo "OS_LIBS =" >> ${MKFILE}
|
||||
echo "" >> ${MKFILE}
|
||||
echo "PLATFORM_FLAGS = -D`echo ${ARCH} | tr '[a-z]' '[A-Z]'`" >> ${MKFILE}
|
||||
echo "MOVEMAIL_FLAGS = ${SPECIAL}" >> ${MKFILE}
|
||||
echo "PORT_FLAGS = -DSW_THREADS ${MACROS}" >> ${MKFILE}
|
||||
echo "PDJAVA_FLAGS =" >> ${MKFILE}
|
||||
echo "" >> ${MKFILE}
|
||||
echo "OS_CFLAGS = \$(PLATFORM_FLAGS) \$(PORT_FLAGS) \$(MOVEMAIL_FLAGS)" >> ${MKFILE}
|
||||
echo "" >> ${MKFILE}
|
||||
echo "######################################################################" >> ${MKFILE}
|
||||
echo "# Version-specific stuff" >> ${MKFILE}
|
||||
echo "######################################################################" >> ${MKFILE}
|
||||
echo "" >> ${MKFILE}
|
||||
echo "######################################################################" >> ${MKFILE}
|
||||
echo "# Overrides for defaults in config.mk (or wherever)" >> ${MKFILE}
|
||||
echo "######################################################################" >> ${MKFILE}
|
||||
echo "" >> ${MKFILE}
|
||||
echo "######################################################################" >> ${MKFILE}
|
||||
echo "# Other" >> ${MKFILE}
|
||||
echo "######################################################################" >> ${MKFILE}
|
||||
echo "" >> ${MKFILE}
|
||||
echo "ifdef SERVER_BUILD" >> ${MKFILE}
|
||||
echo "STATIC_JAVA = yes" >> ${MKFILE}
|
||||
echo "endif" >> ${MKFILE}
|
||||
|
||||
echo "Generating a default macro file (${XFE_MKFILE}) to be added to cmd/xfe/Makefile...."
|
||||
rm -f ${XFE_MKFILE}
|
||||
echo "" > ${XFE_MKFILE}
|
||||
echo "########################################" >> ${XFE_MKFILE}
|
||||
echo "# ${ARCH} ${RELEASE} ${CPU_ARCH}" >> ${XFE_MKFILE}
|
||||
echo "ifeq (\$(OS_ARCH)\$(OS_RELEASE),${ARCH}${RELEASE})" >> ${XFE_MKFILE}
|
||||
echo "OTHER_LIBS = -L${X_DIR} \$(MOTIFLIB) -lXt -lXmu -lXext -lX11 -lm \$(OS_LIBS)" >> ${XFE_MKFILE}
|
||||
echo "endif" >> ${XFE_MKFILE}
|
||||
echo "" >> ${XFE_MKFILE}
|
||||
|
||||
exit 0
|
||||
28
mozilla/config/revdepth-nt.pl
Normal file
28
mozilla/config/revdepth-nt.pl
Normal file
@@ -0,0 +1,28 @@
|
||||
#! perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
require "/ns/config/fastcwd.pl";
|
||||
|
||||
$cur = &fastcwd;
|
||||
chdir($ARGV[0]);
|
||||
$newcur = &fastcwd;
|
||||
$newcurlen = length($newcur);
|
||||
|
||||
# Skip common separating / unless $newcur is "/"
|
||||
$cur = substr($cur, $newcurlen + ($newcurlen > 1));
|
||||
print $cur;
|
||||
31
mozilla/config/revdepth.pl
Normal file
31
mozilla/config/revdepth.pl
Normal file
@@ -0,0 +1,31 @@
|
||||
#! perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
unshift(@INC, '/usr/lib/perl');
|
||||
unshift(@INC, '/usr/local/lib/perl');
|
||||
|
||||
require "fastcwd.pl";
|
||||
|
||||
$cur = &fastcwd;
|
||||
chdir($ARGV[0]);
|
||||
$newcur = &fastcwd;
|
||||
$newcurlen = length($newcur);
|
||||
|
||||
# Skip common separating / unless $newcur is "/"
|
||||
$cur = substr($cur, $newcurlen + ($newcurlen > 1));
|
||||
print $cur;
|
||||
608
mozilla/config/rules.mak
Normal file
608
mozilla/config/rules.mak
Normal file
@@ -0,0 +1,608 @@
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
!if !defined(VERBOSE)
|
||||
.SILENT:
|
||||
!endif
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// This makefile contains all of the common rules shared by all other
|
||||
#// makefiles.
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!if !defined(CONFIG_RULES_MAK)
|
||||
CONFIG_RULES_MAK=1
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Assumed variables by the manifest.
|
||||
#//------------------------------------------------------------------------
|
||||
!if !defined(PACKAGE)
|
||||
PACKAGE=.
|
||||
!endif # PACKAGE
|
||||
|
||||
!if !defined(JDK_GEN_DIR)
|
||||
JDK_GEN_DIR=_gen
|
||||
!endif
|
||||
|
||||
!if !defined(JDK_STUB_DIR)
|
||||
JDK_STUB_DIR=_stubs
|
||||
!endif
|
||||
|
||||
!if !defined(JMC_GEN_DIR)
|
||||
!ifdef MOZ_JAVA
|
||||
JMC_GEN_DIR=_jmc
|
||||
!else
|
||||
JMC_GEN_DIR=$(LOCAL_JMC_SUBDIR)
|
||||
!endif
|
||||
!endif
|
||||
|
||||
!if !defined(JRI_GEN_DIR)
|
||||
JRI_GEN_DIR=_jri
|
||||
!endif
|
||||
|
||||
|
||||
MANIFEST_LEVEL=MACROS
|
||||
!IF EXIST(manifest.mn) && !defined(IGNORE_MANIFEST)
|
||||
!IF "$(WINOS)" == "WIN95"
|
||||
!IF [$(DEPTH)\config\mantomak.exe manifest.mn manifest.mnw] == 0
|
||||
!INCLUDE <manifest.mnw>
|
||||
!ELSE
|
||||
!ERROR ERROR: Unable to generate manifest.mnw from manifest.mn
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!IF ["$(DEPTH)\config\mantomak.exe manifest.mn manifest.mnw"] == 0
|
||||
!INCLUDE <manifest.mnw>
|
||||
!ELSE
|
||||
!ERROR ERROR: Unable to generate manifest.mnw from manifest.mn
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Make sure that JDIRS is set after the manifest file is included
|
||||
#// and before the rules for JDIRS get generated. We cannot put this line
|
||||
#// in the makefile.win after including rules.mak as the rules would already
|
||||
#// be generated based on JDIRS set in manifest.mn. We cannot put in ifdefs in
|
||||
#// manifest.mn too I was told.
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!ifdef JDIRS
|
||||
JDIRS=$(JDIRS) $(JSCD)
|
||||
!if "$(STAND_ALONE_JAVA)" == "1"
|
||||
JDIRS=$(JDIRS) $(SAJDIRS)
|
||||
!endif
|
||||
!endif
|
||||
|
||||
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
#//------------------------------------------------------------------------
|
||||
#// All public win16 headers go to a single directory
|
||||
#// due to compiler limitations.
|
||||
#//------------------------------------------------------------------------
|
||||
MODULE=win16
|
||||
!endif # 16
|
||||
|
||||
|
||||
OBJS=$(OBJS) $(C_OBJS) $(CPP_OBJS)
|
||||
|
||||
include <$(DEPTH)/config/config.mak>
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify a default target if non was set...
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!ifndef TARGETS
|
||||
TARGETS=$(PROGRAM) $(LIBRARY) $(DLL)
|
||||
!endif
|
||||
|
||||
!ifndef MAKE_ARGS
|
||||
#MAKE_ARGS=all
|
||||
!endif
|
||||
|
||||
!if "$(WINOS)" == "WIN95"
|
||||
W95MAKE=$(DEPTH)\config\w95make.exe
|
||||
W32OBJS = $(OBJS:.obj=.obj, )
|
||||
W32LOBJS = $(OBJS: .= +-.)
|
||||
!endif
|
||||
|
||||
|
||||
all::
|
||||
$(NMAKE) -f makefile.win export
|
||||
$(NMAKE) -f makefile.win libs
|
||||
$(NMAKE) -f makefile.win install
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Setup tool flags for the appropriate type of objects being built
|
||||
#// (either DLL or EXE)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!if "$(MAKE_OBJ_TYPE)" == "DLL"
|
||||
CFLAGS=$(DLL_CFLAGS) $(CFLAGS)
|
||||
LFLAGS=$(DLL_LFLAGS) $(LFLAGS)
|
||||
OS_LIBS=$(DLL_LIBS) $(OS_LIBS)
|
||||
!else
|
||||
CFLAGS=$(EXE_CFLAGS) $(CFLAGS)
|
||||
LFLAGS=$(EXE_LFLAGS) $(LFLAGS)
|
||||
OS_LIBS=$(EXE_LIBS) $(OS_LIBS)
|
||||
!endif
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Prepend the "object directory" to any public make variables.
|
||||
#// PDBFILE - File containing debug info
|
||||
#// RESFILE - Compiled resource file
|
||||
#// MAPFILE - MAP file for an executable
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!ifdef PDBFILE
|
||||
PDBFILE=.\$(OBJDIR)\$(PDBFILE)
|
||||
!else
|
||||
PDBFILE=NONE
|
||||
!endif
|
||||
!ifdef RESFILE
|
||||
RESFILE=.\$(OBJDIR)\$(RESFILE)
|
||||
!endif
|
||||
!ifdef MAPFILE
|
||||
MAPFILE=.\$(OBJDIR)\$(MAPFILE)
|
||||
!endif
|
||||
|
||||
!ifdef DIRS
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule to recursively make all subdirectories specified by the DIRS target
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
$(DIRS)::
|
||||
!if "$(WINOS)" == "WIN95"
|
||||
@echo +++ make: cannot recursively make on win95 using command.com, use w95make.
|
||||
!else
|
||||
@echo +++ make: %MAKE_ARGS% in $(MAKEDIR)\$@
|
||||
@cd $@
|
||||
@$(NMAKE) -f makefile.win %%MAKE_ARGS%%
|
||||
@cd $(MAKEDIR)
|
||||
!endif
|
||||
|
||||
!endif # DIRS
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Created directories
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
|
||||
$(JAVA_DESTPATH):
|
||||
!if "$(AWT_11)" == "1"
|
||||
-mkdir $(XPDIST:/=\)\classes11
|
||||
!else
|
||||
-mkdir $(XPDIST:/=\)\classes
|
||||
!endif
|
||||
|
||||
$(JAVA_DESTPATH)\$(PACKAGE): $(JAVA_DESTPATH)
|
||||
!if "$(AWT_11)" == "1"
|
||||
-mkdir $(XPDIST:/=\)\classes11\$(PACKAGE:/=\)
|
||||
!else
|
||||
-mkdir $(XPDIST:/=\)\classes\$(PACKAGE:/=\)
|
||||
!endif
|
||||
$(JMCSRCDIR):
|
||||
-mkdir $(JMCSRCDIR)
|
||||
|
||||
$(XPDIST)\public\$(MODULE):
|
||||
-mkdir $(XPDIST:/=\)\public\$(MODULE:/=\)
|
||||
|
||||
!ifdef IDL_GEN
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// IDL Stuff
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
idl::
|
||||
@echo +++ make: Starting osagent
|
||||
@start $(DEPTH)\modules\iiop\tools\win32\osagent
|
||||
@echo +++ make: idl2java $(IDL_GEN)
|
||||
@type <<cmd.cfg
|
||||
$(IDL2JAVA_FLAGS) $(IDL_GEN)
|
||||
<<
|
||||
@$(IDL2JAVA_PROG) -argfile cmd.cfg
|
||||
@del cmd.cfg
|
||||
|
||||
!endif # IDL_GEN
|
||||
|
||||
TMPDIR=$(MOZ_SRC)\tmp
|
||||
$(TMPDIR):
|
||||
-mkdir $(TMPDIR)
|
||||
|
||||
!ifdef JDIRS
|
||||
!ifdef MOZ_JAVA
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule to recursively make all subdirectories specified by the JDIRS target
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
export:: $(JAVA_DESTPATH) $(JDIRS)
|
||||
|
||||
$(JDIRS):: $(JAVA_DESTPATH) $(TMPDIR)
|
||||
|
||||
!if "$(WINOS)" == "WIN95"
|
||||
JDIRS = $(JDIRS:/=\)
|
||||
!endif
|
||||
|
||||
!if defined(NO_CAFE)
|
||||
|
||||
$(JDIRS)::
|
||||
@echo +++ make: building package: $@
|
||||
@echo $(JAVAC_PROG) $(JAVAC_FLAGS) > $(TMPDIR)\javac.cfg
|
||||
-@$(DEPTH)\config\buildpkg $(TMPDIR)\javac.cfg $@
|
||||
@$(RM) $(TMPDIR)\javac.cfg
|
||||
# @$(DEPTH)\config\buildpkg $@ $(DEPTH)\dist\classes
|
||||
|
||||
!else
|
||||
|
||||
# compile using symantec cafe's super-speedy compiler!
|
||||
$(JDIRS)::
|
||||
@echo +++ make: building package $@
|
||||
!if "$(WINOS)" == "WIN95"
|
||||
-@$(MKDIR) $(DEPTH)\dist\classes\$(@:/=\)
|
||||
!else
|
||||
-@$(MKDIR) $(DEPTH)\dist\classes\$@ 2> NUL
|
||||
!endif
|
||||
$(MOZ_TOOLS)\bin\sj -classpath $(JAVA_DESTPATH);$(JAVA_SOURCEPATH) \
|
||||
-d $(JAVA_DESTPATH) $(JAVAC_OPTIMIZER) $@\*.java
|
||||
|
||||
|
||||
!endif # NO_CAFE
|
||||
|
||||
clobber::
|
||||
-for %g in ($(JDIRS)) do $(RM_R) $(XPDIST:/=\)/classes/%g
|
||||
|
||||
!endif # MOZ_JAVA
|
||||
!endif # JDIRS
|
||||
|
||||
!if defined(INSTALL_FILE_LIST) && defined(INSTALL_DIR)
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule to install the files specified by the INSTALL_FILE_LIST variable
|
||||
#// into the directory specified by the INSTALL_DIR variable
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
#//------------------------------------------------------------------------
|
||||
#// All public win16 headers go to a single directory
|
||||
#// due to compiler limitations.
|
||||
#//------------------------------------------------------------------------
|
||||
INSTALL_DIR=$(PUBLIC)\win16
|
||||
!endif # 16
|
||||
INSTALL_FILES: $(INSTALL_FILE_LIST)
|
||||
!$(MAKE_INSTALL) $** $(INSTALL_DIR)
|
||||
|
||||
!endif # INSTALL_FILES
|
||||
|
||||
!ifdef LIBRARY_NAME
|
||||
LIBRARY=$(OBJDIR)\$(LIBRARY_NAME)$(LIBRARY_SUFFIX).lib
|
||||
!endif
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Global rules...
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
#//
|
||||
#// Set the MAKE_ARGS variable to indicate the target being built... This is used
|
||||
#// when processing subdirectories via the $(DIRS) rule
|
||||
#//
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Nasty hack to get around the win95 shell's inability to set
|
||||
# environment variables whilst in a set of target commands
|
||||
#
|
||||
!if "$(WINOS)" == "WIN95"
|
||||
|
||||
clean::
|
||||
!ifdef DIRS
|
||||
@$(W95MAKE) clean $(MAKEDIR) $(DIRS)
|
||||
!endif
|
||||
-$(RM) $(OBJS) $(NOSUCHFILE) NUL 2> NUL
|
||||
|
||||
clobber::
|
||||
!ifdef DIRS
|
||||
@$(W95MAKE) clobber $(MAKEDIR) $(DIRS)
|
||||
!endif
|
||||
-$(RM_R) $(GARBAGE) $(OBJDIR) 2> NUL
|
||||
|
||||
clobber_all::
|
||||
!ifdef DIRS
|
||||
@$(W95MAKE) clobber_all $(MAKEDIR) $(DIRS)
|
||||
!endif
|
||||
-$(RM_R) *.OBJ $(TARGETS) $(GARBAGE) $(OBJDIR) 2> NUL
|
||||
|
||||
|
||||
export::
|
||||
!ifdef DIRS
|
||||
@$(W95MAKE) export $(MAKEDIR) $(DIRS)
|
||||
!endif # DIRS
|
||||
|
||||
libs:: w95libs $(LIBRARY)
|
||||
|
||||
w95libs::
|
||||
!ifdef DIRS
|
||||
@$(W95MAKE) libs $(MAKEDIR) $(DIRS)
|
||||
!endif # DIRS
|
||||
|
||||
install::
|
||||
!ifdef DIRS
|
||||
@$(W95MAKE) install $(MAKEDIR) $(DIRS)
|
||||
!endif # DIRS
|
||||
|
||||
depend::
|
||||
!ifdef DIRS
|
||||
@$(W95MAKE) depend $(MAKEDIR) $(DIRS)
|
||||
!endif # DIRS
|
||||
|
||||
mangle::
|
||||
!ifdef DIRS
|
||||
@$(W95MAKE) mangle $(MAKEDIR) $(DIRS)
|
||||
!endif # DIRS
|
||||
$(MAKE_MANGLE)
|
||||
|
||||
unmangle::
|
||||
!ifdef DIRS
|
||||
@$(W95MAKE) unmangle $(MAKEDIR) $(DIRS)
|
||||
!endif # DIRS
|
||||
-$(MAKE_UNMANGLE)
|
||||
|
||||
!else
|
||||
|
||||
|
||||
clean::
|
||||
@set MAKE_ARGS=$@
|
||||
|
||||
clobber::
|
||||
@set MAKE_ARGS=$@
|
||||
|
||||
clobber_all::
|
||||
@set MAKE_ARGS=$@
|
||||
|
||||
export::
|
||||
@set MAKE_ARGS=$@
|
||||
|
||||
libs::
|
||||
@set MAKE_ARGS=$@
|
||||
|
||||
install::
|
||||
@set MAKE_ARGS=$@
|
||||
|
||||
mangle::
|
||||
@set MAKE_ARGS=$@
|
||||
|
||||
unmangle::
|
||||
@set MAKE_ARGS=$@
|
||||
|
||||
depend::
|
||||
@set MAKE_ARGS=$@
|
||||
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// DEPEND
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
MAKEDEP=$(MOZ_TOOLS)\makedep.exe
|
||||
MAKEDEPFILE=.\$(OBJDIR:/=\)\make.dep
|
||||
|
||||
MAKEDEPDETECT=$(OBJS)
|
||||
MAKEDEPDETECT=$(MAKEDEPDETECT: =)
|
||||
MAKEDEPDETECT=$(MAKEDEPDETECT: =)
|
||||
|
||||
!if !defined(NODEPEND) && "$(MAKEDEPDETECT)" != ""
|
||||
|
||||
depend:: $(OBJDIR)
|
||||
@echo $(MAKEDEP) -s -o $(LINCS) $(OBJS)
|
||||
$(MAKEDEP) -s -o $(MAKEDEPFILE) @<<
|
||||
$(LINCS)
|
||||
$(OBJS)
|
||||
<<
|
||||
|
||||
!endif
|
||||
|
||||
!IF EXIST($(MAKEDEPFILE))
|
||||
!INCLUDE <$(MAKEDEPFILE)>
|
||||
!ENDIF
|
||||
|
||||
|
||||
|
||||
export:: $(DIRS)
|
||||
|
||||
libs:: $(DIRS) $(LIBRARY)
|
||||
|
||||
install:: $(DIRS)
|
||||
|
||||
depend:: $(DIRS)
|
||||
|
||||
mangle:: $(DIRS)
|
||||
$(MAKE_MANGLE)
|
||||
|
||||
unmangle:: $(DIRS)
|
||||
-$(MAKE_UNMANGLE)
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Rule to create the object directory (if necessary)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
$(OBJDIR):
|
||||
@echo +++ make: Creating directory: $(OBJDIR)
|
||||
echo.
|
||||
-mkdir $(OBJDIR)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the makefile for building the various targets...
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)/config/obj.inc>
|
||||
include <$(DEPTH)/config/exe.inc>
|
||||
include <$(DEPTH)/config/dll.inc>
|
||||
include <$(DEPTH)/config/lib.inc>
|
||||
include <$(DEPTH)/config/java.inc>
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// JMC
|
||||
#//
|
||||
#// JSRCS .java files to be compiled (.java extension included)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!if defined(MOZ_JAVA)
|
||||
!if defined(JSRCS)
|
||||
|
||||
JSRCS_DEPS = $(JAVA_DESTPATH) $(JAVA_DESTPATH)\$(PACKAGE) $(TMPDIR)
|
||||
|
||||
# Can't get moz cafe to compile a single file
|
||||
!if defined(NO_CAFE)
|
||||
|
||||
export:: $(JSRCS_DEPS)
|
||||
@echo +++ make: building package: $(PACKAGE)
|
||||
$(MOZ_TOOLS)\perl5\perl.exe $(DEPTH)\config\outofdate.pl \
|
||||
-d $(JAVA_DESTPATH)\$(PACKAGE) $(JSRCS) >> $(TMPDIR)\javac.cfg
|
||||
-$(JAVAC_PROG) -argfile $(TMPDIR)\javac.cfg
|
||||
@$(RM) $(TMPDIR)\javac.cfg
|
||||
!else
|
||||
|
||||
# compile using symantec cafe's super-speedy compiler!
|
||||
export:: $(JSRC_DEPS)
|
||||
@echo +++ make: building package: $(PACKAGE)
|
||||
@echo -d $(JAVA_DESTPATH) $(JAVAC_OPTIMIZER) \
|
||||
-classpath $(JAVA_DESTPATH);$(JAVA_SOURCEPATH) > $(TMPDIR)\javac.cfg
|
||||
@$(MOZ_TOOLS)\perl5\perl $(DEPTH)\config\sj.pl \
|
||||
$(JAVA_DESTPATH)\$(PACKAGE)\ $(TMPDIR)\javac.cfg <<
|
||||
$(JSRCS)
|
||||
<<
|
||||
|
||||
!endif #NO_CAFE
|
||||
|
||||
clobber::
|
||||
-for %g in ($(JSRCS:.java=.class)) do $(RM) $(XPDIST:/=\)/classes/$(PACKAGE:/=\)/%g
|
||||
|
||||
!endif # JSRCS
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// JMC
|
||||
#//
|
||||
#// JMC_EXPORT .class files to be copied from XPDIST/classes/PACKAGE to
|
||||
#// XPDIST/jmc (without the .class extension)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!if defined(JMC_EXPORT)
|
||||
export:: $(JMCSRCDIR)
|
||||
for %g in ($(JMC_EXPORT)) do $(MAKE_INSTALL:/=\) $(JAVA_DESTPATH)\$(PACKAGE:/=\)\%g.class $(JMCSRCDIR)
|
||||
|
||||
clobber::
|
||||
-for %f in ($(JMC_EXPORT)) do $(RM) $(JMCSRCDIR:/=\)\%f.class
|
||||
!endif # JMC_EXPORT
|
||||
!endif # MOZ_JAVA
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// JMC
|
||||
#//
|
||||
#// JMC_GEN Names of classes to be run through JMC
|
||||
#// Generated .h and .c files go to JMC_GEN_DIR
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!if defined(MOZ_JAVA)
|
||||
|
||||
!if defined(JMC_GEN)
|
||||
export:: $(JMC_HEADERS)
|
||||
|
||||
# Don't delete them if they don't compile (makes it hard to debug)
|
||||
.PRECIOUS: $(JMC_HEADERS) $(JMC_STUBS)
|
||||
|
||||
|
||||
# They may want to generate/compile the stubs
|
||||
!if defined(CCJMC)
|
||||
{$(JMC_GEN_DIR)\}.c{$(OBJDIR)\}.obj:
|
||||
@$(CC) @<<$(CFGFILE)
|
||||
-c $(CFLAGS)
|
||||
-I. -I$(JMC_GEN_DIR)
|
||||
-Fd$(PDBFILE)
|
||||
-Fo.\$(OBJDIR)\
|
||||
$(JMC_GEN_DIR)\$(*B).c
|
||||
<<KEEP
|
||||
|
||||
export:: $(JMC_STUBS) $(OBJDIR) $(JMC_OBJS)
|
||||
|
||||
!endif # CCJMC
|
||||
!endif # JMC_GEN
|
||||
!endif # MOZ_JAVA
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// JMC
|
||||
#//
|
||||
#// EXPORTS Names of headers to be copied to MODULE
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!if defined(EXPORTS)
|
||||
export:: $(XPDIST)\public\$(MODULE)
|
||||
for %f in ($(EXPORTS)) do $(MAKE_INSTALL:/=\) %f $(XPDIST:/=\)\public\$(MODULE:/=\)
|
||||
|
||||
clobber::
|
||||
-for %g in ($(EXPORTS)) do $(RM) $(XPDIST:/=\)\public\$(MODULE:/=\)\%g
|
||||
!endif # EXPORTS
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// These rules must follow all lines that define the macros they use
|
||||
#//------------------------------------------------------------------------
|
||||
!ifdef MOZ_JAVA
|
||||
GARBAGE = $(JMC_GEN_DIR) $(JMC_HEADERS) $(JMC_STUBS) \
|
||||
$(JDK_STUB_DIR) $(JRI_GEN_DIR) $(JDK_GEN_DIR)
|
||||
!endif
|
||||
|
||||
|
||||
clean:: $(DIRS)
|
||||
-$(RM) $(OBJS) $(NOSUCHFILE) NUL 2> NUL
|
||||
|
||||
clobber:: $(DIRS)
|
||||
-$(RM_R) $(GARBAGE) $(OBJDIR) 2> NUL
|
||||
|
||||
clobber_all:: $(DIRS)
|
||||
-$(RM_R) *.OBJ $(TARGETS) $(GARBAGE) $(OBJDIR) 2> NUL
|
||||
|
||||
MANIFEST_LEVEL=RULES
|
||||
!IF EXIST(manifest.mnw) && !defined(IGNORE_MANIFEST)
|
||||
!INCLUDE <manifest.mnw>
|
||||
!ENDIF
|
||||
|
||||
!if "$(MOZ_BITS)"=="32"
|
||||
CFLAGS = $(CFLAGS) -DNO_JNI_STUBS
|
||||
!endif
|
||||
|
||||
|
||||
!endif # CONFIG_RULES_MAK
|
||||
739
mozilla/config/rules.mk
Normal file
739
mozilla/config/rules.mk
Normal file
@@ -0,0 +1,739 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# We now use a 3-pass build system. This needs to be re-thought....
|
||||
#
|
||||
# Pass 1. export - Create generated headers and stubs. Publish public headers
|
||||
# to dist/<arch>/include.
|
||||
#
|
||||
# Pass 2. libs - Create libraries. Publish libraries to dist/<arch>/lib.
|
||||
#
|
||||
# Pass 3. install - Create programs. Publish them to dist/<arch>/bin.
|
||||
#
|
||||
# 'gmake' will build each of these properly, but 'gmake -jN' will break (need
|
||||
# to do each pass explicitly when using -j).
|
||||
#
|
||||
# Parameters to this makefile (set these before including):
|
||||
#
|
||||
# a)
|
||||
# TARGETS -- the target to create
|
||||
# (defaults to $LIBRARY $PROGRAM)
|
||||
# b)
|
||||
# DIRS -- subdirectories for make to recurse on
|
||||
# (the 'all' rule builds $TARGETS $DIRS)
|
||||
# c)
|
||||
# CSRCS, CPPSRCS -- .c and .cpp files to compile
|
||||
# (used to define $OBJS)
|
||||
# d)
|
||||
# PROGRAM -- the target program name to create from $OBJS
|
||||
# ($OBJDIR automatically prepended to it)
|
||||
# e)
|
||||
# LIBRARY_NAME -- the target library name to create from $OBJS
|
||||
# ($OBJDIR automatically prepended to it)
|
||||
# f)
|
||||
# JSRCS -- java source files to compile into class files
|
||||
# (if you don't specify this it will default to *.java)
|
||||
# g)
|
||||
# PACKAGE -- the package to put the .class files into
|
||||
# (e.g. netscape/applet)
|
||||
# h)
|
||||
# JMC_EXPORT -- java files to be exported for use by JMC_GEN
|
||||
# (this is a list of Class names)
|
||||
# i)
|
||||
# JRI_GEN -- files to run through javah to generate headers and stubs
|
||||
# (output goes into the _jri sub-dir)
|
||||
# j)
|
||||
# JMC_GEN -- files to run through jmc to generate headers and stubs
|
||||
# (output goes into the _jmc sub-dir)
|
||||
#
|
||||
################################################################################
|
||||
|
||||
#
|
||||
# Common rules used by lots of makefiles...
|
||||
#
|
||||
ifndef NS_CONFIG_MK
|
||||
include $(DEPTH)/config/config.mk
|
||||
endif
|
||||
|
||||
ifdef PROGRAM
|
||||
PROGRAM := $(addprefix $(OBJDIR)/, $(PROGRAM))
|
||||
endif
|
||||
|
||||
ifndef LIBRARY
|
||||
ifdef LIBRARY_NAME
|
||||
LIBRARY := lib$(LIBRARY_NAME).$(LIB_SUFFIX)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef LIBRARY
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
ifndef DEF_FILE
|
||||
DEF_FILE := $(LIBRARY:.lib=.def)
|
||||
endif
|
||||
endif
|
||||
LIBRARY := $(addprefix $(OBJDIR)/, $(LIBRARY))
|
||||
ifdef MKSHLIB
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
SHARED_LIBRARY := $(LIBRARY:.lib=.dll)
|
||||
MAPS := $(LIBRARY:.lib=.map)
|
||||
else
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
SHARED_LIBRARY := $(LIBRARY:.lib=.dll)
|
||||
else
|
||||
ifeq ($(OS_ARCH),HP-UX)
|
||||
SHARED_LIBRARY := $(LIBRARY:.a=.sl)
|
||||
else
|
||||
ifeq ($(OS_ARCH),FreeBSD)
|
||||
SHARED_LIBRARY := $(LIBRARY:.a=.so.1.0)
|
||||
else
|
||||
ifeq ($(OS_ARCH)$(OS_RELEASE),SunOS4.1)
|
||||
SHARED_LIBRARY := $(LIBRARY:.a=.so.1.0)
|
||||
else
|
||||
ifeq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
|
||||
SHARED_LIBRARY := $(LIBRARY:.a=)_shr.a
|
||||
else
|
||||
SHARED_LIBRARY := $(LIBRARY:.a=.so)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef TARGETS
|
||||
TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM)
|
||||
endif
|
||||
|
||||
ifndef OBJS
|
||||
OBJS = $(JRI_STUB_CFILES) $(addsuffix .o, $(JMC_GEN)) $(CSRCS:.c=.o) $(CPPSRCS:.cpp=.o) $(ASFILES:.s=.o)
|
||||
endif
|
||||
|
||||
OBJS := $(addprefix $(OBJDIR)/, $(OBJS))
|
||||
|
||||
ifdef REQUIRES
|
||||
MODULE_PREINCLUDES = $(addprefix -I$(XPDIST)/public/, $(REQUIRES))
|
||||
endif
|
||||
|
||||
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
|
||||
ifdef DLL
|
||||
DLL := $(addprefix $(OBJDIR)/, $(DLL))
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
LIB := $(addprefix $(OBJDIR)/, $(LIB))
|
||||
endif
|
||||
endif
|
||||
MAKE_OBJDIR = mkdir $(OBJDIR)
|
||||
else
|
||||
define MAKE_OBJDIR
|
||||
if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
|
||||
endef
|
||||
endif
|
||||
|
||||
ifndef OS2_IMPLIB
|
||||
LIBOBJS := $(addprefix \", $(OBJS))
|
||||
LIBOBJS := $(addsuffix \", $(LIBOBJS))
|
||||
endif
|
||||
|
||||
ifndef PACKAGE
|
||||
PACKAGE = .
|
||||
endif
|
||||
|
||||
ifdef MOZ_JAVA
|
||||
ALL_TRASH = $(TARGETS) $(OBJS) $(OBJDIR) LOGS TAGS $(GARBAGE) \
|
||||
$(NOSUCHFILE) $(JDK_HEADER_CFILES) $(JDK_STUB_CFILES) \
|
||||
$(JRI_HEADER_CFILES) $(JRI_STUB_CFILES) $(JMC_STUBS) \
|
||||
$(JMC_HEADERS) $(JMC_EXPORT_FILES) so_locations \
|
||||
_gen _jmc _jri _stubs $(wildcard gts_tmp_*) \
|
||||
$(wildcard $(JAVA_DESTPATH)/$(PACKAGE)/*.class)
|
||||
else
|
||||
ALL_TRASH = $(TARGETS) $(OBJS) $(OBJDIR) LOGS TAGS $(GARBAGE) \
|
||||
$(NOSUCHFILE) \
|
||||
$(JMC_STUBS) \
|
||||
so_locations \
|
||||
_gen _stubs $(wildcard gts_tmp_*)
|
||||
endif
|
||||
|
||||
ifdef MOZ_JAVA
|
||||
ifdef JDIRS
|
||||
ALL_TRASH += $(addprefix $(JAVA_DESTPATH)/,$(JDIRS))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef MOZ_JAVA
|
||||
JMC_SUBDIR = _jmc
|
||||
else
|
||||
JMC_SUBDIR = $(LOCAL_JMC_SUBDIR)
|
||||
endif
|
||||
|
||||
ifdef NSBUILDROOT
|
||||
JDK_GEN_DIR = $(XPDIST)/_gen
|
||||
JMC_GEN_DIR = $(XPDIST)/$(JMC_SUBDIR)
|
||||
JRI_GEN_DIR = $(XPDIST)/_jri
|
||||
JDK_STUB_DIR = $(XPDIST)/_stubs
|
||||
else
|
||||
JDK_GEN_DIR = _gen
|
||||
JMC_GEN_DIR = $(JMC_SUBDIR)
|
||||
JRI_GEN_DIR = _jri
|
||||
JDK_STUB_DIR = _stubs
|
||||
endif
|
||||
|
||||
#
|
||||
# If this is an "official" build, try to build everything.
|
||||
# I.e., don't exit on errors.
|
||||
#
|
||||
ifdef BUILD_OFFICIAL
|
||||
EXIT_ON_ERROR = +e
|
||||
CLICK_STOPWATCH = date
|
||||
else
|
||||
EXIT_ON_ERROR = -e
|
||||
CLICK_STOPWATCH = true
|
||||
endif
|
||||
|
||||
ifdef DIRS
|
||||
LOOP_OVER_DIRS = \
|
||||
@for d in $(DIRS); do \
|
||||
if test -d $$d; then \
|
||||
set $(EXIT_ON_ERROR); \
|
||||
echo "cd $$d; $(MAKE) $@"; \
|
||||
oldDir=`pwd`; \
|
||||
cd $$d; $(MAKE) $@; cd $$oldDir; \
|
||||
set +e; \
|
||||
else \
|
||||
echo "Skipping non-directory $$d..."; \
|
||||
fi; \
|
||||
$(CLICK_STOPWATCH); \
|
||||
done
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
all:: export libs install
|
||||
|
||||
#
|
||||
# Maybe this should be done in config/Makefile so it only happens once...?
|
||||
#
|
||||
TARGETS += tweak_nspr
|
||||
|
||||
#
|
||||
# Since the NSPR folks won't help, we'll fix things the sneaky way.
|
||||
#
|
||||
tweak_nspr:
|
||||
@(cd $(DEPTH)/nsprpub/config; \
|
||||
if test -f UNIX.mk.orig; then rm -f UNIX.mk; mv UNIX.mk.orig UNIX.mk; fi; \
|
||||
mv UNIX.mk UNIX.mk.orig; \
|
||||
awk '/^OBJDIR_NAME[ ]*=/ { \
|
||||
printf("OBJDIR_NAME\t= %s%s%s%s%s%s.OBJ\n","$(OS_CONFIG)","$(OS_VERSION)","$(PROCESSOR_ARCHITECTURE)","$(COMPILER)","$(IMPL_STRATEGY)","$(OBJDIR_TAG)"); next} {print}' UNIX.mk.orig > UNIX.mk)
|
||||
|
||||
ifdef ALL_PLATFORMS
|
||||
all_platforms:: $(NFSPWD)
|
||||
@d=`$(NFSPWD)`; \
|
||||
if test ! -d LOGS; then rm -rf LOGS; mkdir LOGS; fi; \
|
||||
for h in $(PLATFORM_HOSTS); do \
|
||||
echo "On $$h: $(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log";\
|
||||
rsh $$h -n "(chdir $$d; \
|
||||
$(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log; \
|
||||
echo DONE) &" 2>&1 > LOGS/$$h.pid & \
|
||||
sleep 1; \
|
||||
done
|
||||
|
||||
$(NFSPWD):
|
||||
cd $(@D); $(MAKE) $(@F)
|
||||
endif
|
||||
|
||||
export::
|
||||
+$(LOOP_OVER_DIRS)
|
||||
|
||||
libs install:: $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(MAPS)
|
||||
ifdef LIBRARY
|
||||
$(INSTALL) -m 444 $(LIBRARY) $(DIST)/lib
|
||||
endif
|
||||
ifdef MAPS
|
||||
$(INSTALL) -m 444 $(MAPS) $(DIST)/bin
|
||||
endif
|
||||
ifdef SHARED_LIBRARY
|
||||
$(INSTALL) -m 555 $(SHARED_LIBRARY) $(DIST)/bin
|
||||
endif
|
||||
ifdef PROGRAM
|
||||
$(INSTALL) -m 444 $(PROGRAM) $(DIST)/bin
|
||||
endif
|
||||
+$(LOOP_OVER_DIRS)
|
||||
|
||||
clean clobber::
|
||||
rm -rf $(ALL_TRASH)
|
||||
+$(LOOP_OVER_DIRS)
|
||||
|
||||
realclean clobber_all::
|
||||
rm -rf $(wildcard *.OBJ) dist $(ALL_TRASH)
|
||||
+$(LOOP_OVER_DIRS)
|
||||
|
||||
alltags:
|
||||
rm -f TAGS
|
||||
find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs etags -a
|
||||
|
||||
$(PROGRAM): $(OBJS)
|
||||
@$(MAKE_OBJDIR)
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
$(LINK) -FREE -OUT:$@ $(LDFLAGS) $(OS_LFLAGS) $(OBJS) $(EXTRA_LIBS) -MAP:$(@:.exe=.map) $(OS_LIBS) $(DEF_FILE)
|
||||
else
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
$(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
|
||||
else
|
||||
$(CCF) -o $@ $(OBJS) $(LDFLAGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(OS_ARCH),OS2)
|
||||
$(LIBRARY): $(OBJS) $(LOBJS)
|
||||
@$(MAKE_OBJDIR)
|
||||
rm -f $@
|
||||
$(AR) $(OBJS) $(LOBJS)
|
||||
$(RANLIB) $@
|
||||
else
|
||||
ifdef OS2_IMPLIB
|
||||
$(LIBRARY): $(OBJS) $(DEF_FILE)
|
||||
@$(MAKE_OBJDIR)
|
||||
rm -f $@
|
||||
$(IMPLIB) $@ $(DEF_FILE)
|
||||
$(RANLIB) $@
|
||||
else
|
||||
$(LIBRARY): $(OBJS)
|
||||
@$(MAKE_OBJDIR)
|
||||
rm -f $@
|
||||
$(AR) $(LIBOBJS),,
|
||||
$(RANLIB) $@
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(OS_ARCH),OS2)
|
||||
$(SHARED_LIBRARY): $(OBJS) $(LOBJS)
|
||||
@$(MAKE_OBJDIR)
|
||||
rm -f $@
|
||||
$(MKSHLIB) -o $@ $(OBJS) $(LOBJS) $(EXTRA_DSO_LDOPTS)
|
||||
chmod +x $@
|
||||
else
|
||||
$(SHARED_LIBRARY): $(OBJS) $(DEF_FILE)
|
||||
@$(MAKE_OBJDIR)
|
||||
rm -f $@
|
||||
$(LINK_DLL) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE)
|
||||
chmod +x $@
|
||||
endif
|
||||
|
||||
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
|
||||
$(DLL): $(OBJS) $(EXTRA_LIBS)
|
||||
@$(MAKE_OBJDIR)
|
||||
rm -f $@
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
$(LINK_DLL) $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
|
||||
else
|
||||
$(LINK_DLL) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
$(OBJDIR)/%: %.c
|
||||
@$(MAKE_OBJDIR)
|
||||
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
|
||||
$(CC) -Fo$@ -c $(CFLAGS) $*.c
|
||||
else
|
||||
$(CCF) $(LDFLAGS) -o $@ $*.c
|
||||
endif
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@$(MAKE_OBJDIR)
|
||||
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
|
||||
$(CC) -Fo$@ -c $(CFLAGS) $*.c
|
||||
else
|
||||
$(CC) -o $@ -c $(CFLAGS) $*.c
|
||||
endif
|
||||
|
||||
$(OBJDIR)/%.o: %.s
|
||||
@$(MAKE_OBJDIR)
|
||||
$(AS) -o $@ $(ASFLAGS) -c $*.s
|
||||
|
||||
$(OBJDIR)/%.o: %.S
|
||||
@$(MAKE_OBJDIR)
|
||||
$(AS) -o $@ $(ASFLAGS) -c $*.S
|
||||
|
||||
$(OBJDIR)/%: %.cpp
|
||||
@$(MAKE_OBJDIR)
|
||||
$(CCC) -o $@ $(CFLAGS) $*.c $(LDFLAGS)
|
||||
|
||||
#
|
||||
# Please keep the next two rules in sync.
|
||||
#
|
||||
$(OBJDIR)/%.o: %.cc
|
||||
@$(MAKE_OBJDIR)
|
||||
$(CCC) -o $@ -c $(CFLAGS) $*.cc
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
@$(MAKE_OBJDIR)
|
||||
ifdef STRICT_CPLUSPLUS_SUFFIX
|
||||
echo "#line 1 \"$*.cpp\"" | cat - $*.cpp > $(OBJDIR)/t_$*.cc
|
||||
$(CCC) -o $@ -c $(CFLAGS) $(OBJDIR)/t_$*.cc
|
||||
rm -f $(OBJDIR)/t_$*.cc
|
||||
else
|
||||
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
|
||||
$(CCC) -Fo$@ -c $(CFLAGS) $*.cpp
|
||||
else
|
||||
$(CCC) -o $@ -c $(CFLAGS) $*.cpp
|
||||
endif
|
||||
endif #STRICT_CPLUSPLUS_SUFFIX
|
||||
|
||||
%.i: %.cpp
|
||||
$(CCC) -C -E $(CFLAGS) $< > $*.i
|
||||
|
||||
%.i: %.c
|
||||
$(CC) -C -E $(CFLAGS) $< > $*.i
|
||||
|
||||
%: %.pl
|
||||
rm -f $@; cp $*.pl $@; chmod +x $@
|
||||
|
||||
%: %.sh
|
||||
rm -f $@; cp $*.sh $@; chmod +x $@
|
||||
|
||||
ifdef DIRS
|
||||
$(DIRS)::
|
||||
@if test -d $@; then \
|
||||
set $(EXIT_ON_ERROR); \
|
||||
echo "cd $@; $(MAKE)"; \
|
||||
cd $@; $(MAKE); \
|
||||
set +e; \
|
||||
else \
|
||||
echo "Skipping non-directory $@..."; \
|
||||
fi; \
|
||||
$(CLICK_STOPWATCH)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Bunch of things that extend the 'export' rule (in order):
|
||||
################################################################################
|
||||
|
||||
$(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) $(JMCSRCDIR)::
|
||||
@if test ! -d $@; then \
|
||||
echo Creating $@; \
|
||||
rm -rf $@; \
|
||||
$(NSINSTALL) -D $@; \
|
||||
fi
|
||||
|
||||
################################################################################
|
||||
### JSRCS -- for compiling java files
|
||||
|
||||
ifneq ($(JSRCS),)
|
||||
ifdef MOZ_JAVA
|
||||
export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE)
|
||||
list=`$(PERL) $(DEPTH)/config/outofdate.pl $(PERLARG) \
|
||||
-d $(JAVA_DESTPATH)/$(PACKAGE) $(JSRCS)`; \
|
||||
if test "$$list"x != "x"; then \
|
||||
echo $(JAVAC) $$list; \
|
||||
$(JAVAC) $$list; \
|
||||
fi
|
||||
|
||||
all:: export
|
||||
|
||||
clobber::
|
||||
rm -f $(XPDIST)/classes/$(PACKAGE)/*.class
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# JDIRS -- like JSRCS, except you can give a list of directories and it will
|
||||
# compile all the out-of-date java files in those directories.
|
||||
#
|
||||
# NOTE: recursing through these can speed things up, but they also cause
|
||||
# some builds to run out of memory
|
||||
#
|
||||
ifdef JDIRS
|
||||
ifdef MOZ_JAVA
|
||||
export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE)
|
||||
@for d in $(JDIRS); do \
|
||||
if test -d $$d; then \
|
||||
set $(EXIT_ON_ERROR); \
|
||||
files=`echo $$d/*.java`; \
|
||||
list=`$(PERL) $(DEPTH)/config/outofdate.pl $(PERLARG) \
|
||||
-d $(JAVA_DESTPATH)/$(PACKAGE) $$files`; \
|
||||
if test "$${list}x" != "x"; then \
|
||||
echo Building all java files in $$d; \
|
||||
echo $(JAVAC) $$list; \
|
||||
$(JAVAC) $$list; \
|
||||
fi; \
|
||||
set +e; \
|
||||
else \
|
||||
echo "Skipping non-directory $$d..."; \
|
||||
fi; \
|
||||
$(CLICK_STOPWATCH); \
|
||||
done
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# JDK_GEN -- for generating "old style" native methods
|
||||
#
|
||||
# Generate JDK Headers and Stubs into the '_gen' and '_stubs' directory
|
||||
#
|
||||
ifneq ($(JDK_GEN),)
|
||||
ifdef MOZ_JAVA
|
||||
ifdef NSBUILDROOT
|
||||
INCLUDES += -I$(JDK_GEN_DIR) -I$(XPDIST)
|
||||
else
|
||||
INCLUDES += -I$(JDK_GEN_DIR)
|
||||
endif
|
||||
JDK_PACKAGE_CLASSES = $(JDK_GEN)
|
||||
JDK_PATH_CLASSES = $(subst .,/,$(JDK_PACKAGE_CLASSES))
|
||||
JDK_HEADER_CLASSFILES = $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JDK_PATH_CLASSES))
|
||||
JDK_STUB_CLASSFILES = $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JDK_PATH_CLASSES))
|
||||
JDK_HEADER_CFILES = $(patsubst %,$(JDK_GEN_DIR)/%.h,$(JDK_GEN))
|
||||
JDK_STUB_CFILES = $(patsubst %,$(JDK_STUB_DIR)/%.c,$(JDK_GEN))
|
||||
|
||||
$(JDK_HEADER_CFILES): $(JDK_HEADER_CLASSFILES)
|
||||
$(JDK_STUB_CFILES): $(JDK_STUB_CLASSFILES)
|
||||
|
||||
export::
|
||||
@echo Generating/Updating JDK headers
|
||||
$(JAVAH) -d $(JDK_GEN_DIR) $(JDK_PACKAGE_CLASSES)
|
||||
@echo Generating/Updating JDK stubs
|
||||
$(JAVAH) -stubs -d $(JDK_STUB_DIR) $(JDK_PACKAGE_CLASSES)
|
||||
ifdef MOZ_GENMAC
|
||||
@if test ! -d $(DEPTH)/lib/mac/Java/; then \
|
||||
echo "!!! You need to have a ns/lib/mac/Java directory checked out."; \
|
||||
echo "!!! This allows us to automatically update generated files for the mac."; \
|
||||
echo "!!! If you see any modified files there, please check them in."; \
|
||||
fi
|
||||
@echo Generating/Updating JDK headers for the Mac
|
||||
$(JAVAH) -mac -d $(DEPTH)/lib/mac/Java/_gen $(JDK_PACKAGE_CLASSES)
|
||||
@echo Generating/Updating JDK stubs for the Mac
|
||||
$(JAVAH) -mac -stubs -d $(DEPTH)/lib/mac/Java/_stubs $(JDK_PACKAGE_CLASSES)
|
||||
endif
|
||||
endif # MOZ_JAVA
|
||||
endif
|
||||
|
||||
#
|
||||
# JRI_GEN -- for generating JRI native methods
|
||||
#
|
||||
# Generate JRI Headers and Stubs into the 'jri' directory
|
||||
#
|
||||
ifneq ($(JRI_GEN),)
|
||||
ifdef MOZ_JAVA
|
||||
ifdef NSBUILDROOT
|
||||
INCLUDES += -I$(JRI_GEN_DIR) -I$(XPDIST)
|
||||
else
|
||||
INCLUDES += -I$(JRI_GEN_DIR)
|
||||
endif
|
||||
JRI_PACKAGE_CLASSES = $(JRI_GEN)
|
||||
JRI_PATH_CLASSES = $(subst .,/,$(JRI_PACKAGE_CLASSES))
|
||||
JRI_HEADER_CLASSFILES = $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JRI_PATH_CLASSES))
|
||||
JRI_STUB_CLASSFILES = $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JRI_PATH_CLASSES))
|
||||
JRI_HEADER_CFILES = $(patsubst %,$(JRI_GEN_DIR)/%.h,$(JRI_GEN))
|
||||
JRI_STUB_CFILES = $(patsubst %,$(JRI_GEN_DIR)/%.c,$(JRI_GEN))
|
||||
|
||||
$(JRI_HEADER_CFILES): $(JRI_HEADER_CLASSFILES)
|
||||
$(JRI_STUB_CFILES): $(JRI_STUB_CLASSFILES)
|
||||
|
||||
export::
|
||||
@echo Generating/Updating JRI headers
|
||||
$(JAVAH) -jri -d $(JRI_GEN_DIR) $(JRI_PACKAGE_CLASSES)
|
||||
@echo Generating/Updating JRI stubs
|
||||
$(JAVAH) -jri -stubs -d $(JRI_GEN_DIR) $(JRI_PACKAGE_CLASSES)
|
||||
ifdef MOZ_GENMAC
|
||||
@if test ! -d $(DEPTH)/lib/mac/Java/; then \
|
||||
echo "!!! You need to have a ns/lib/mac/Java directory checked out."; \
|
||||
echo "!!! This allows us to automatically update generated files for the mac."; \
|
||||
echo "!!! If you see any modified files there, please check them in."; \
|
||||
fi
|
||||
@echo Generating/Updating JRI headers for the Mac
|
||||
$(JAVAH) -jri -mac -d $(DEPTH)/lib/mac/Java/_jri $(JRI_PACKAGE_CLASSES)
|
||||
@echo Generating/Updating JRI stubs for the Mac
|
||||
$(JAVAH) -jri -mac -stubs -d $(DEPTH)/lib/mac/Java/_jri $(JRI_PACKAGE_CLASSES)
|
||||
endif
|
||||
endif # MOZ_JAVA
|
||||
endif
|
||||
|
||||
#
|
||||
# JMC_EXPORT -- for declaring which java classes are to be exported for jmc
|
||||
#
|
||||
ifneq ($(JMC_EXPORT),)
|
||||
ifdef MOZ_JAVA
|
||||
JMC_EXPORT_PATHS = $(subst .,/,$(JMC_EXPORT))
|
||||
JMC_EXPORT_FILES = $(patsubst %,$(JAVA_DESTPATH)/$(PACKAGE)/%.class,$(JMC_EXPORT_PATHS))
|
||||
|
||||
#
|
||||
# We're doing NSINSTALL -t here (copy mode) because calling INSTALL will pick up
|
||||
# your NSDISTMODE and make links relative to the current directory. This is a
|
||||
# problem because the source isn't in the current directory:
|
||||
#
|
||||
export:: $(JMC_EXPORT_FILES) $(JMCSRCDIR)
|
||||
$(NSINSTALL) -t -m 444 $(JMC_EXPORT_FILES) $(JMCSRCDIR)
|
||||
endif # MOZ_JAVA
|
||||
endif
|
||||
|
||||
#
|
||||
# JMC_GEN -- for generating java modules
|
||||
#
|
||||
# Provide default export & install rules when using JMC_GEN
|
||||
#
|
||||
ifneq ($(JMC_GEN),)
|
||||
INCLUDES += -I$(JMC_GEN_DIR) -I.
|
||||
ifdef MOZ_JAVA
|
||||
JMC_HEADERS = $(patsubst %,$(JMC_GEN_DIR)/%.h,$(JMC_GEN))
|
||||
JMC_STUBS = $(patsubst %,$(JMC_GEN_DIR)/%.c,$(JMC_GEN))
|
||||
JMC_OBJS = $(patsubst %,$(OBJDIR)/%.o,$(JMC_GEN))
|
||||
|
||||
$(JMC_GEN_DIR)/M%.h: $(JMCSRCDIR)/%.class
|
||||
$(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=)
|
||||
|
||||
$(JMC_GEN_DIR)/M%.c: $(JMCSRCDIR)/%.class
|
||||
$(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=)
|
||||
|
||||
$(OBJDIR)/M%.o: $(JMC_GEN_DIR)/M%.h $(JMC_GEN_DIR)/M%.c
|
||||
@$(MAKE_OBJDIR)
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
$(CC) -Fo$@ -c $(CFLAGS) $(JMC_GEN_DIR)/M$*.c
|
||||
else
|
||||
$(CC) -o $@ -c $(CFLAGS) $(JMC_GEN_DIR)/M$*.c
|
||||
endif
|
||||
|
||||
export:: $(JMC_HEADERS) $(JMC_STUBS)
|
||||
endif # MOZ_JAVA
|
||||
endif
|
||||
|
||||
#
|
||||
# Copy each element of EXPORTS to $(XPDIST)/public/$(MODULE)/
|
||||
#
|
||||
ifneq ($(EXPORTS),)
|
||||
$(XPDIST)/public/$(MODULE)::
|
||||
@if test ! -d $@; then \
|
||||
echo Creating $@; \
|
||||
rm -rf $@; \
|
||||
$(NSINSTALL) -D $@; \
|
||||
fi
|
||||
|
||||
export:: $(EXPORTS) $(XPDIST)/public/$(MODULE)
|
||||
$(INSTALL) -m 444 $(EXPORTS) $(XPDIST)/public/$(MODULE)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
-include $(DEPENDENCIES)
|
||||
|
||||
ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
|
||||
# Can't use sed because of its 4000-char line length limit, so resort to perl
|
||||
.DEFAULT:
|
||||
@$(PERL) -e ' \
|
||||
open(MD, "< $(DEPENDENCIES)"); \
|
||||
while (<MD>) { \
|
||||
if (m@ \.*/*$< @) { \
|
||||
$$found = 1; \
|
||||
last; \
|
||||
} \
|
||||
} \
|
||||
if ($$found) { \
|
||||
print "Removing stale dependency $< from $(DEPENDENCIES)\n"; \
|
||||
seek(MD, 0, 0); \
|
||||
$$tmpname = "$(OBJDIR)/fix.md" . $$$$; \
|
||||
open(TMD, "> " . $$tmpname); \
|
||||
while (<MD>) { \
|
||||
s@ \.*/*$< @ @; \
|
||||
if (!print TMD "$$_") { \
|
||||
unlink(($$tmpname)); \
|
||||
exit(1); \
|
||||
} \
|
||||
} \
|
||||
close(TMD); \
|
||||
if (!rename($$tmpname, "$(DEPENDENCIES)")) { \
|
||||
unlink(($$tmpname)); \
|
||||
} \
|
||||
} elsif ("$<" ne "$(DEPENDENCIES)") { \
|
||||
print "$(MAKE): *** No rule to make target $<. Stop.\n"; \
|
||||
exit(1); \
|
||||
}'
|
||||
endif
|
||||
|
||||
#############################################################################
|
||||
# X dependency system
|
||||
#############################################################################
|
||||
|
||||
ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
|
||||
|
||||
$(MKDEPENDENCIES)::
|
||||
@$(MAKE_OBJDIR)
|
||||
touch $(MKDEPENDENCIES)
|
||||
$(MKDEPEND) -p$(OBJDIR_NAME)/ -o'.o' -f$(MKDEPENDENCIES) $(INCLUDES) $(CSRCS) $(CPPSRCS)
|
||||
|
||||
$(MKDEPEND)::
|
||||
cd $(MKDEPEND_DIR); $(MAKE)
|
||||
|
||||
ifdef OBJS
|
||||
depend:: $(MKDEPEND) $(MKDEPENDENCIES)
|
||||
else
|
||||
depend::
|
||||
endif
|
||||
+$(LOOP_OVER_DIRS)
|
||||
|
||||
dependclean::
|
||||
rm -f $(MKDEPENDENCIES)
|
||||
+$(LOOP_OVER_DIRS)
|
||||
|
||||
-include $(OBJDIR)/depend.mk
|
||||
|
||||
endif
|
||||
|
||||
#############################################################################
|
||||
|
||||
-include $(MY_RULES)
|
||||
|
||||
#
|
||||
# This speeds up gmake's processing if these files don't exist.
|
||||
#
|
||||
$(MY_CONFIG) $(MY_RULES):
|
||||
@touch $@
|
||||
|
||||
#
|
||||
# Generate Emacs tags in a file named TAGS if ETAGS was set in $(MY_CONFIG)
|
||||
# or in $(MY_RULES)
|
||||
#
|
||||
ifdef ETAGS
|
||||
ifneq ($(CSRCS)$(CPPSRCS)$(HEADERS),)
|
||||
all:: TAGS
|
||||
TAGS:: $(CSRCS) $(CPPSRCS) $(HEADERS)
|
||||
$(ETAGS) $(CSRCS) $(CPPSRCS) $(HEADERS)
|
||||
endif
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Special gmake rules.
|
||||
################################################################################
|
||||
|
||||
#
|
||||
# Re-define the list of default suffixes, so gmake won't have to churn through
|
||||
# hundreds of built-in suffix rules for stuff we don't need.
|
||||
#
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .out .a .ln .o .c .cc .C .cpp .y .l .s .S .h .sh .i .pl .class .java .html
|
||||
|
||||
#
|
||||
# Don't delete these files if we get killed.
|
||||
#
|
||||
.PRECIOUS: .java $(JDK_HEADERS) $(JDK_STUBS) $(JRI_HEADERS) $(JRI_STUBS) $(JMC_HEADERS) $(JMC_STUBS)
|
||||
|
||||
#
|
||||
# Fake targets. Always run these rules, even if a file/directory with that
|
||||
# name already exists.
|
||||
#
|
||||
.PHONY: all all_platforms alltags boot clean clobber clobber_all export install libs realclean $(OBJDIR) $(DIRS)
|
||||
|
||||
89
mozilla/config/sj.pl
Executable file
89
mozilla/config/sj.pl
Executable file
@@ -0,0 +1,89 @@
|
||||
#!perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# Input: output_class_dir argfile javafilelist
|
||||
#
|
||||
|
||||
$classdir = $ARGV[0];
|
||||
$argfile = $ARGV[1];
|
||||
$filelist = $ARGV[2];
|
||||
shift;
|
||||
|
||||
$sjcmd = $ENV{'MOZ_TOOLS'} . '\bin\sj.exe';
|
||||
|
||||
open(FL, "<$filelist" ) || die "can't open $filelist for reading";
|
||||
|
||||
while( <FL> ){
|
||||
# print;
|
||||
@java_files = (@java_files, split(/[ \t\n]/));
|
||||
}
|
||||
close (FL);
|
||||
|
||||
open(FL, "<$argfile" ) || die "can't open $argfile for reading";
|
||||
|
||||
while( <FL> ){
|
||||
chop;
|
||||
$args .= $_;
|
||||
}
|
||||
close (FL);
|
||||
|
||||
|
||||
print "Java Files: @java_files\n";
|
||||
|
||||
|
||||
# compile as many java files as we can in one invocation
|
||||
# given the limitations of the command line
|
||||
foreach $filename (@java_files) {
|
||||
$classfilename = $classdir;
|
||||
$classfilename .= $filename;
|
||||
$classfilename =~ s/.java$/.class/;
|
||||
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,
|
||||
$ctime,$blksize,$blocks) = stat($filename);
|
||||
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$classmtime,
|
||||
$ctime,$blksize,$blocks) = stat($classfilename);
|
||||
# print $filename, " ", $mtime, ", ", $classfilename, " ", $classmtime, "\n";
|
||||
if ($mtime > $classmtime) {
|
||||
# are we too big?
|
||||
$len += length($filename);
|
||||
if( $len >= 512 ) {
|
||||
print "$sjcmd $args $outofdate\n";
|
||||
$status = system "$sjcmd $args $outofdate";
|
||||
if( $status != 0 ) {
|
||||
exit( $status / 256 );
|
||||
}
|
||||
$outofdate = "";
|
||||
$len = length($filename);
|
||||
}
|
||||
$outofdate .= $filename;
|
||||
$outofdate .= " ";
|
||||
}
|
||||
}
|
||||
|
||||
if( length($outofdate) > 0 ) {
|
||||
print "$sjcmd $args $outofdate\n";
|
||||
$status = system "$sjcmd $args $outofdate";
|
||||
if( $status != 0 ) {
|
||||
exit( $status / 256 );
|
||||
}
|
||||
} else {
|
||||
print "Files are up to date.\n";
|
||||
}
|
||||
|
||||
|
||||
print "\n";
|
||||
18
mozilla/config/true.bat
Normal file
18
mozilla/config/true.bat
Normal file
@@ -0,0 +1,18 @@
|
||||
@echo off
|
||||
rem The contents of this file are subject to the Netscape Public License
|
||||
rem Version 1.0 (the "NPL"); you may not use this file except in
|
||||
rem compliance with the NPL. You may obtain a copy of the NPL at
|
||||
rem http://www.mozilla.org/NPL/
|
||||
rem
|
||||
rem Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
rem WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
rem for the specific language governing rights and limitations under the
|
||||
rem NPL.
|
||||
rem
|
||||
rem The Initial Developer of this code under the NPL is Netscape
|
||||
rem Communications Corporation. Portions created by Netscape are
|
||||
rem Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
rem Reserved.
|
||||
@echo on
|
||||
|
||||
@echo off
|
||||
106
mozilla/config/xmversion.sh
Executable file
106
mozilla/config/xmversion.sh
Executable file
@@ -0,0 +1,106 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Name: xmversion.sh - a fast way to get a motif lib's version
|
||||
##
|
||||
## Description: Print the major and minor version numbers for motif libs on
|
||||
## the system that executes the script. Could be tweaked
|
||||
## to output more info.
|
||||
##
|
||||
## More checks need to be added for more platforms.
|
||||
## Currently this script is only useful in Linux Universe
|
||||
## where there are a many versions of motif.
|
||||
##
|
||||
## Author: Ramiro Estrugo <ramiro@netscape.com>
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# The string build into the motif libs
|
||||
MOTIF_VERSION_STRING="Motif Version"
|
||||
|
||||
# Make motif 1.x the default
|
||||
MOTIF_DEFAULT_VERSION=1
|
||||
|
||||
# Reasonable defaults for motif lib locations
|
||||
MOTIF_LIB_DIR=/usr/lib
|
||||
MOTIF_STATIC_LIB=libXm.a
|
||||
MOTIF_SHARED_LIB=libXm.so
|
||||
|
||||
os=`uname`
|
||||
|
||||
case `uname`
|
||||
in
|
||||
Linux)
|
||||
case `uname -m`
|
||||
in
|
||||
ppc)
|
||||
MOTIF_LIB_DIR=/usr/local/motif-1.2.4/lib
|
||||
;;
|
||||
|
||||
i386|i486|i586|i686)
|
||||
MOTIF_LIB_DIR=/usr/X11R6/lib
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
SunOS)
|
||||
case `uname -r`
|
||||
in
|
||||
5.3|5.4|5.5.1|5.6)
|
||||
MOTIF_LIB_DIR=/usr/dt/lib
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
HP-UX)
|
||||
MOTIF_LIB_DIR=/usr/lib/Motif1.2
|
||||
MOTIF_SHARED_LIB=libXm.sl
|
||||
;;
|
||||
|
||||
AIX)
|
||||
MOTIF_LIB_DIR=/usr/lib
|
||||
MOTIF_SHARED_LIB=libXm.a
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Look for the shared one first
|
||||
MOTIF_LIB=
|
||||
|
||||
if [ -f $MOTIF_LIB_DIR/$MOTIF_SHARED_LIB ]
|
||||
then
|
||||
MOTIF_LIB=$MOTIF_LIB_DIR/$MOTIF_SHARED_LIB
|
||||
else
|
||||
if [ -f $MOTIF_LIB_DIR/$MOTIF_STATIC_LIB ]
|
||||
then
|
||||
MOTIF_LIB=$MOTIF_LIB_DIR/$MOTIF_STATIC_LIB
|
||||
else
|
||||
echo $MOTIF_DEFAULT_VERSION
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
VERSION=`strings $MOTIF_LIB | grep "Motif Version" | awk '{ print $3;}'`
|
||||
|
||||
MAJOR=`echo $VERSION | awk -F"." '{ print $1; }'`
|
||||
MINOR=`echo $VERSION | awk -F"." '{ print $2; }'`
|
||||
|
||||
echo $MAJOR.$MINOR
|
||||
|
||||
67
mozilla/directory/Makefile
Normal file
67
mozilla/directory/Makefile
Normal file
@@ -0,0 +1,67 @@
|
||||
#! gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
# You need to have checked out the LDAP tree at the same level as ns
|
||||
# in order to build LDAP.
|
||||
#
|
||||
|
||||
|
||||
LDAP_DEPTH = ..
|
||||
DEPTH = ..
|
||||
|
||||
include $(LDAP_DEPTH)/config/rules.mk
|
||||
|
||||
all export:: FORCE
|
||||
@if [ -d $(LDAP_DEPTH)/directory/c-sdk/ldap ]; then \
|
||||
cd $(LDAP_DEPTH)/directory/c-sdk/ldap; \
|
||||
$(MAKE) -f Makefile.client $(MFLAGS) export; \
|
||||
else \
|
||||
echo "No LDAP directory -- skipping"; \
|
||||
exit 0; \
|
||||
fi
|
||||
|
||||
libs install:: FORCE
|
||||
@if [ -d $(LDAP_DEPTH)/directory/c-sdk/ldap ]; then \
|
||||
cd $(LDAP_DEPTH)/directory/c-sdk/ldap; \
|
||||
$(MAKE) -f Makefile.client $(MFLAGS) install; \
|
||||
else \
|
||||
echo "No LDAP directory -- skipping"; \
|
||||
exit 0; \
|
||||
fi
|
||||
|
||||
clean clobber:: FORCE
|
||||
@if [ -d $(LDAP_DEPTH)/directory/c-sdk/ldap ]; then \
|
||||
cd $(LDAP_DEPTH)/directory/c-sdk/ldap; \
|
||||
$(MAKE) -f Makefile.client $(MFLAGS) clean; \
|
||||
else \
|
||||
echo "No LDAP directory -- skipping"; \
|
||||
exit 0; \
|
||||
fi
|
||||
|
||||
realclean clobber_all:: FORCE
|
||||
@if [ -d $(LDAP_DEPTH)/directory/c-sdk/ldap ]; then \
|
||||
cd $(LDAP_DEPTH)/directory/c-sdk/ldap; \
|
||||
$(MAKE) -f Makefile.client $(MFLAGS) realclean; \
|
||||
else \
|
||||
echo "No LDAP directory -- skipping"; \
|
||||
exit 0; \
|
||||
fi
|
||||
|
||||
FORCE:
|
||||
32
mozilla/directory/c-sdk/ldap/Makefile.client
Normal file
32
mozilla/directory/c-sdk/ldap/Makefile.client
Normal file
@@ -0,0 +1,32 @@
|
||||
DEPTH = ../../..
|
||||
|
||||
SRCDIRS = build include libraries
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
||||
all export:: FORCE
|
||||
@for i in $(SRCDIRS); do \
|
||||
echo " cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) export"; \
|
||||
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) export ); \
|
||||
done
|
||||
|
||||
libs install:: FORCE
|
||||
@for i in $(SRCDIRS); do \
|
||||
echo "cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) install"; \
|
||||
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) install ); \
|
||||
done
|
||||
|
||||
clean clobber:: FORCE
|
||||
@for i in $(SRCDIRS); do \
|
||||
echo "cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) clean"; \
|
||||
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) clean ); \
|
||||
done
|
||||
|
||||
realclean clobber_all:: FORCE
|
||||
@for i in $(SRCDIRS); do \
|
||||
echo "cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) realclean"; \
|
||||
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) realclean ); \
|
||||
done
|
||||
|
||||
FORCE:
|
||||
|
||||
23
mozilla/directory/c-sdk/ldap/build/Makefile.client
Normal file
23
mozilla/directory/c-sdk/ldap/build/Makefile.client
Normal file
@@ -0,0 +1,23 @@
|
||||
DEPTH = ../../../..
|
||||
|
||||
CSRCS = dirver.c
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
||||
TARGETS = $(OBJDIR)/dirver$(BIN_SUFFIX)
|
||||
|
||||
GARBAGE += $(TARGETS)
|
||||
|
||||
ifeq ($(OS_ARCH), OS2)
|
||||
$(OBJS) = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.o))
|
||||
|
||||
$(TARGETS): $(OBJS)
|
||||
@$(MAKE_OBJDIR)
|
||||
$(LINK_EXE) -OUT:$@ $(OBJS)
|
||||
endif
|
||||
|
||||
export:: $(TARGETS)
|
||||
$(INSTALL) -m 555 $(TARGETS) $(DIST)/bin
|
||||
|
||||
install:: export
|
||||
|
||||
193
mozilla/directory/c-sdk/ldap/build/dirver.c
Normal file
193
mozilla/directory/c-sdk/ldap/build/dirver.c
Normal file
@@ -0,0 +1,193 @@
|
||||
/*--------------------------------------------------------------------------
|
||||
/ Copyright (C) 1996, 1997 Netscape Communications Corporation
|
||||
/ --------------------------------------------------------------------------
|
||||
/
|
||||
/ Name: Netscape File Version Generator
|
||||
/ Platforms: WIN32
|
||||
/ ......................................................................
|
||||
/ This program generates an ascii format of the 64-bit FILEVERSION
|
||||
/ resource identifier used by Windows executable binaries.
|
||||
/
|
||||
/ Usage Syntax:
|
||||
/ fversion <major.minor.patch> [mm/dd/yyyy] [outfile]
|
||||
/ If date is not specified, the current GMT date is used. yyyy must be
|
||||
/ greater than 1980
|
||||
/
|
||||
/ Usage Example:
|
||||
/ fversion 3.0.0
|
||||
/ fversion 6.5.4 1/30/2001
|
||||
/ fversion 6.5.4 1/30/2001 fileversion.h
|
||||
/
|
||||
/ see http://ntsbuild/sd/30ver.htm for specification
|
||||
/ ......................................................................
|
||||
/ Revision History:
|
||||
/ 01-30-97 Initial Version, Andy Hakim (ahakim@netscape.com)
|
||||
/ --------------------------------------------------------------------------*/
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
unsigned _CalcVersion(unsigned nMajor, unsigned nMinor, unsigned nPatch)
|
||||
{
|
||||
unsigned nVersion;
|
||||
nVersion = nMajor;
|
||||
nVersion <<= 5;
|
||||
nVersion += nMinor;
|
||||
nVersion <<= 7;
|
||||
nVersion += nPatch;
|
||||
nVersion &= 0xFFFF;
|
||||
return(nVersion);
|
||||
}
|
||||
|
||||
|
||||
static void _GetVersions(char *szVer, unsigned *nMajor, unsigned *nMinor,
|
||||
unsigned *nPatch)
|
||||
{
|
||||
char szVersion[128];
|
||||
unsigned nReturn = 0;
|
||||
char *szToken;
|
||||
*nMajor = 0;
|
||||
*nMinor = 0;
|
||||
*nPatch = 0;
|
||||
|
||||
strcpy(szVersion, szVer);
|
||||
if(szToken = strtok(szVersion, ".\n"))
|
||||
{
|
||||
*nMajor = atoi(szToken);
|
||||
if(szToken = strtok(NULL, ".\n"))
|
||||
{
|
||||
*nMinor = atoi(szToken);
|
||||
if(szToken = strtok(NULL, ".\n"))
|
||||
{
|
||||
*nPatch = atoi(szToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned _CalcBuildDate(unsigned nYear, unsigned nMonth, unsigned nDay)
|
||||
{
|
||||
unsigned nBuildDate = 0;
|
||||
|
||||
if(nYear < 100) /* they really mean 19xx */
|
||||
nYear += 1900;
|
||||
|
||||
nYear -= 1980;
|
||||
nBuildDate = nYear;
|
||||
nBuildDate <<= 5;
|
||||
nBuildDate += nMonth;
|
||||
nBuildDate <<= 4;
|
||||
nBuildDate += nDay;
|
||||
nBuildDate &= 0xFFFF;
|
||||
return(nBuildDate);
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned _GenBuildDate(char *szBuildDate)
|
||||
{
|
||||
unsigned nReturn = 0;
|
||||
char *szToken;
|
||||
unsigned nYear = 0;
|
||||
unsigned nMonth = 0;
|
||||
unsigned nDay = 0;
|
||||
|
||||
if((szBuildDate) && (strchr(szBuildDate, '\\') || strchr(szBuildDate, '/')) && (szToken = strtok(szBuildDate, "\\/")))
|
||||
{
|
||||
nMonth = atoi(szToken);
|
||||
if(szToken = strtok(NULL, "\\/"))
|
||||
{
|
||||
nDay = atoi(szToken);
|
||||
if(szToken = strtok(NULL, "\\/"))
|
||||
{
|
||||
nYear = atoi(szToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
struct tm *newtime;
|
||||
time_t ltime;
|
||||
|
||||
time( <ime );
|
||||
|
||||
/* Obtain coordinated universal time: */
|
||||
newtime = gmtime( <ime );
|
||||
nYear = newtime->tm_year;
|
||||
nMonth = newtime->tm_mon;
|
||||
nDay = newtime->tm_mday;
|
||||
}
|
||||
|
||||
nReturn = _CalcBuildDate(nYear, nMonth, nDay);
|
||||
return(nReturn);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void ShowHelp(char *szFilename)
|
||||
{
|
||||
char szTemp[128];
|
||||
fprintf(stdout, "%s: Generates ascii format #define for FILEVERSION\n", szFilename);
|
||||
fprintf(stdout, " resource identifier used by Windows executable binaries.\n");
|
||||
fprintf(stdout, "\n");
|
||||
fprintf(stdout, "Usage: %s <major.minor.patch> [mm/dd/yy] [outfile]\n", szFilename);
|
||||
fprintf(stdout, "\n");
|
||||
fprintf(stdout, "Examples:\n");
|
||||
fprintf(stdout, "%s 3.0.0\n", szFilename);
|
||||
fprintf(stdout, "%s 6.5.2 1/30/2001\n", szFilename);
|
||||
fprintf(stdout, "%s 6.5.2 1/30/2001 fileversion.h\n", szFilename);
|
||||
}
|
||||
|
||||
|
||||
|
||||
main(int nArgc, char **lpArgv)
|
||||
{
|
||||
int nReturn = 0;
|
||||
unsigned nVersion = 0;
|
||||
unsigned nBuildDate = 0;
|
||||
|
||||
if(nArgc < 2)
|
||||
{
|
||||
ShowHelp(lpArgv[0]);
|
||||
nReturn = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *szVersion = NULL;
|
||||
char *szDate = NULL;
|
||||
char *szOutput = NULL;
|
||||
FILE *f = stdout;
|
||||
unsigned nMajor = 0;
|
||||
unsigned nMinor = 0;
|
||||
unsigned nPatch = 0;
|
||||
|
||||
szVersion = (char *)lpArgv[1];
|
||||
szDate = (char *)lpArgv[2];
|
||||
szOutput = (char *)lpArgv[3];
|
||||
_GetVersions( szVersion, &nMajor, &nMinor, &nPatch );
|
||||
nVersion = _CalcVersion(nMajor, nMinor, nPatch);
|
||||
nBuildDate = _GenBuildDate(szDate);
|
||||
|
||||
if(nArgc >= 4)
|
||||
f = fopen(szOutput, "w");
|
||||
|
||||
fprintf(f, "#define VI_PRODUCTVERSION %u.%u\n", nMajor, nMinor);
|
||||
fprintf(f, "#define PRODUCTTEXT \"%u.%u\"\n", nMajor, nMinor);
|
||||
fprintf(f, "#define VI_FILEVERSION %u, 0, 0,%u\n",
|
||||
nVersion, nBuildDate);
|
||||
fprintf(f, "#define VI_FileVersion \"%s Build %u\\0\"\n",
|
||||
szVersion, nBuildDate);
|
||||
|
||||
if(nArgc >= 4)
|
||||
fclose(f);
|
||||
nReturn = (nVersion && !nBuildDate);
|
||||
}
|
||||
return(nReturn);
|
||||
}
|
||||
|
||||
48
mozilla/directory/c-sdk/ldap/include/Makefile.client
Normal file
48
mozilla/directory/c-sdk/ldap/include/Makefile.client
Normal file
@@ -0,0 +1,48 @@
|
||||
DEPTH = ../../../..
|
||||
|
||||
|
||||
CHMOD = chmod
|
||||
RM = rm -f
|
||||
SED = sed
|
||||
|
||||
HEADERS = \
|
||||
disptmpl.h \
|
||||
lber.h \
|
||||
ldap.h \
|
||||
srchpref.h \
|
||||
$(NULL)
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
||||
GARBAGE += sdkver.h dirver.h
|
||||
|
||||
ETCDIR = $(DIST)/etc
|
||||
INCLUDEDIR = $(XPDIST)/public/ldap
|
||||
|
||||
DIR_VERSION := 2.0
|
||||
DIRSDK_VERSION := 1.0
|
||||
|
||||
ifeq ($(OS_ARCH), WINNT)
|
||||
# Is this correct?
|
||||
DIRVER_PATH = $(DEPTH)/netsite/ldap/build
|
||||
else
|
||||
DIRVER_PATH = $(DIST)/bin
|
||||
endif
|
||||
|
||||
DIRVER_PROG = $(DIRVER_PATH)/dirver$(BIN_SUFFIX)
|
||||
|
||||
###########################################################################
|
||||
|
||||
all export:: sdkver.h dirver.h FORCE
|
||||
$(INSTALL) $(INSTALLFLAGS) -m 644 $(HEADERS) $(INCLUDEDIR)
|
||||
$(INSTALL) $(INSTALLFLAGS) -m 644 $(HEADERS) $(DIST)/include
|
||||
|
||||
sdkver.h: $(DIRVER_PROG)
|
||||
@$< $(DIRSDK_VERSION) UseSystemDate $@
|
||||
|
||||
dirver.h: $(DIRVER_PROG)
|
||||
@$< $(DIR_VERSION) UseSystemDate $@
|
||||
|
||||
install:: export
|
||||
|
||||
FORCE:
|
||||
343
mozilla/directory/c-sdk/ldap/include/disptmpl.h
Normal file
343
mozilla/directory/c-sdk/ldap/include/disptmpl.h
Normal file
@@ -0,0 +1,343 @@
|
||||
/*
|
||||
* Copyright (c) 1993, 1994 Regents of the University of Michigan.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that this notice is preserved and that due credit is given
|
||||
* to the University of Michigan at Ann Arbor. The name of the University
|
||||
* may not be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission. This software
|
||||
* is provided ``as is'' without express or implied warranty.
|
||||
*
|
||||
* disptmpl.h: display template library defines
|
||||
* 7 March 1994 by Mark C Smith
|
||||
*/
|
||||
|
||||
#ifndef _DISPTMPL_H
|
||||
#define _DISPTMPL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* calling conventions used by library */
|
||||
#ifndef LDAP_CALL
|
||||
#if defined( _WINDOWS ) || defined( _WIN32 )
|
||||
#define LDAP_C __cdecl
|
||||
#ifndef _WIN32
|
||||
#define __stdcall _far _pascal
|
||||
#define LDAP_CALLBACK _loadds
|
||||
#else
|
||||
#define LDAP_CALLBACK
|
||||
#endif /* _WIN32 */
|
||||
#define LDAP_PASCAL __stdcall
|
||||
#define LDAP_CALL LDAP_PASCAL
|
||||
#else /* _WINDOWS */
|
||||
#define LDAP_C
|
||||
#define LDAP_CALLBACK
|
||||
#define LDAP_PASCAL
|
||||
#define LDAP_CALL
|
||||
#endif /* _WINDOWS */
|
||||
#endif /* LDAP_CALL */
|
||||
|
||||
#define LDAP_TEMPLATE_VERSION 1
|
||||
|
||||
/*
|
||||
* general types of items (confined to most significant byte)
|
||||
*/
|
||||
#define LDAP_SYN_TYPE_TEXT 0x01000000L
|
||||
#define LDAP_SYN_TYPE_IMAGE 0x02000000L
|
||||
#define LDAP_SYN_TYPE_BOOLEAN 0x04000000L
|
||||
#define LDAP_SYN_TYPE_BUTTON 0x08000000L
|
||||
#define LDAP_SYN_TYPE_ACTION 0x10000000L
|
||||
|
||||
|
||||
/*
|
||||
* syntax options (confined to second most significant byte)
|
||||
*/
|
||||
#define LDAP_SYN_OPT_DEFER 0x00010000L
|
||||
|
||||
|
||||
/*
|
||||
* display template item syntax ids (defined by common agreement)
|
||||
* these are the valid values for the ti_syntaxid of the tmplitem
|
||||
* struct (defined below). A general type is encoded in the
|
||||
* most-significant 8 bits, and some options are encoded in the next
|
||||
* 8 bits. The lower 16 bits are reserved for the distinct types.
|
||||
*/
|
||||
#define LDAP_SYN_CASEIGNORESTR ( 1 | LDAP_SYN_TYPE_TEXT )
|
||||
#define LDAP_SYN_MULTILINESTR ( 2 | LDAP_SYN_TYPE_TEXT )
|
||||
#define LDAP_SYN_DN ( 3 | LDAP_SYN_TYPE_TEXT )
|
||||
#define LDAP_SYN_BOOLEAN ( 4 | LDAP_SYN_TYPE_BOOLEAN )
|
||||
#define LDAP_SYN_JPEGIMAGE ( 5 | LDAP_SYN_TYPE_IMAGE )
|
||||
#define LDAP_SYN_JPEGBUTTON ( 6 | LDAP_SYN_TYPE_BUTTON | LDAP_SYN_OPT_DEFER )
|
||||
#define LDAP_SYN_FAXIMAGE ( 7 | LDAP_SYN_TYPE_IMAGE )
|
||||
#define LDAP_SYN_FAXBUTTON ( 8 | LDAP_SYN_TYPE_BUTTON | LDAP_SYN_OPT_DEFER )
|
||||
#define LDAP_SYN_AUDIOBUTTON ( 9 | LDAP_SYN_TYPE_BUTTON | LDAP_SYN_OPT_DEFER )
|
||||
#define LDAP_SYN_TIME ( 10 | LDAP_SYN_TYPE_TEXT )
|
||||
#define LDAP_SYN_DATE ( 11 | LDAP_SYN_TYPE_TEXT )
|
||||
#define LDAP_SYN_LABELEDURL ( 12 | LDAP_SYN_TYPE_TEXT )
|
||||
#define LDAP_SYN_SEARCHACTION ( 13 | LDAP_SYN_TYPE_ACTION )
|
||||
#define LDAP_SYN_LINKACTION ( 14 | LDAP_SYN_TYPE_ACTION )
|
||||
#define LDAP_SYN_ADDDNACTION ( 15 | LDAP_SYN_TYPE_ACTION )
|
||||
#define LDAP_SYN_VERIFYDNACTION ( 16 | LDAP_SYN_TYPE_ACTION )
|
||||
#define LDAP_SYN_RFC822ADDR ( 17 | LDAP_SYN_TYPE_TEXT )
|
||||
|
||||
|
||||
/*
|
||||
* handy macros
|
||||
*/
|
||||
#define LDAP_GET_SYN_TYPE( syid ) ((syid) & 0xFF000000L )
|
||||
#define LDAP_GET_SYN_OPTIONS( syid ) ((syid) & 0x00FF0000L )
|
||||
|
||||
|
||||
/*
|
||||
* display options for output routines (used by entry2text and friends)
|
||||
*/
|
||||
/*
|
||||
* use calculated label width (based on length of longest label in
|
||||
* template) instead of contant width
|
||||
*/
|
||||
#define LDAP_DISP_OPT_AUTOLABELWIDTH 0x00000001L
|
||||
#define LDAP_DISP_OPT_HTMLBODYONLY 0x00000002L
|
||||
|
||||
/*
|
||||
* perform search actions (applies to ldap_entry2text_search only)
|
||||
*/
|
||||
#define LDAP_DISP_OPT_DOSEARCHACTIONS 0x00000002L
|
||||
|
||||
/*
|
||||
* include additional info. relevant to "non leaf" entries only
|
||||
* used by ldap_entry2html and ldap_entry2html_search to include "Browse"
|
||||
* and "Move Up" HREFs
|
||||
*/
|
||||
#define LDAP_DISP_OPT_NONLEAF 0x00000004L
|
||||
|
||||
|
||||
/*
|
||||
* display template item options (may not apply to all types)
|
||||
* if this bit is set in ti_options, it applies.
|
||||
*/
|
||||
#define LDAP_DITEM_OPT_READONLY 0x00000001L
|
||||
#define LDAP_DITEM_OPT_SORTVALUES 0x00000002L
|
||||
#define LDAP_DITEM_OPT_SINGLEVALUED 0x00000004L
|
||||
#define LDAP_DITEM_OPT_HIDEIFEMPTY 0x00000008L
|
||||
#define LDAP_DITEM_OPT_VALUEREQUIRED 0x00000010L
|
||||
#define LDAP_DITEM_OPT_HIDEIFFALSE 0x00000020L /* booleans only */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* display template item structure
|
||||
*/
|
||||
struct ldap_tmplitem {
|
||||
unsigned long ti_syntaxid;
|
||||
unsigned long ti_options;
|
||||
char *ti_attrname;
|
||||
char *ti_label;
|
||||
char **ti_args;
|
||||
struct ldap_tmplitem *ti_next_in_row;
|
||||
struct ldap_tmplitem *ti_next_in_col;
|
||||
void *ti_appdata;
|
||||
};
|
||||
|
||||
|
||||
#define NULLTMPLITEM ((struct ldap_tmplitem *)0)
|
||||
|
||||
#define LDAP_SET_TMPLITEM_APPDATA( ti, datap ) \
|
||||
(ti)->ti_appdata = (void *)(datap)
|
||||
|
||||
#define LDAP_GET_TMPLITEM_APPDATA( ti, type ) \
|
||||
(type)((ti)->ti_appdata)
|
||||
|
||||
#define LDAP_IS_TMPLITEM_OPTION_SET( ti, option ) \
|
||||
(((ti)->ti_options & option ) != 0 )
|
||||
|
||||
|
||||
/*
|
||||
* object class array structure
|
||||
*/
|
||||
struct ldap_oclist {
|
||||
char **oc_objclasses;
|
||||
struct ldap_oclist *oc_next;
|
||||
};
|
||||
|
||||
#define NULLOCLIST ((struct ldap_oclist *)0)
|
||||
|
||||
|
||||
/*
|
||||
* add defaults list
|
||||
*/
|
||||
struct ldap_adddeflist {
|
||||
int ad_source;
|
||||
#define LDAP_ADSRC_CONSTANTVALUE 1
|
||||
#define LDAP_ADSRC_ADDERSDN 2
|
||||
char *ad_attrname;
|
||||
char *ad_value;
|
||||
struct ldap_adddeflist *ad_next;
|
||||
};
|
||||
|
||||
#define NULLADLIST ((struct ldap_adddeflist *)0)
|
||||
|
||||
|
||||
/*
|
||||
* display template global options
|
||||
* if this bit is set in dt_options, it applies.
|
||||
*/
|
||||
/*
|
||||
* users should be allowed to try to add objects of these entries
|
||||
*/
|
||||
#define LDAP_DTMPL_OPT_ADDABLE 0x00000001L
|
||||
|
||||
/*
|
||||
* users should be allowed to do "modify RDN" operation of these entries
|
||||
*/
|
||||
#define LDAP_DTMPL_OPT_ALLOWMODRDN 0x00000002L
|
||||
|
||||
/*
|
||||
* this template is an alternate view, not a primary view
|
||||
*/
|
||||
#define LDAP_DTMPL_OPT_ALTVIEW 0x00000004L
|
||||
|
||||
|
||||
/*
|
||||
* display template structure
|
||||
*/
|
||||
struct ldap_disptmpl {
|
||||
char *dt_name;
|
||||
char *dt_pluralname;
|
||||
char *dt_iconname;
|
||||
unsigned long dt_options;
|
||||
char *dt_authattrname;
|
||||
char *dt_defrdnattrname;
|
||||
char *dt_defaddlocation;
|
||||
struct ldap_oclist *dt_oclist;
|
||||
struct ldap_adddeflist *dt_adddeflist;
|
||||
struct ldap_tmplitem *dt_items;
|
||||
void *dt_appdata;
|
||||
struct ldap_disptmpl *dt_next;
|
||||
};
|
||||
|
||||
#define NULLDISPTMPL ((struct ldap_disptmpl *)0)
|
||||
|
||||
#define LDAP_SET_DISPTMPL_APPDATA( dt, datap ) \
|
||||
(dt)->dt_appdata = (void *)(datap)
|
||||
|
||||
#define LDAP_GET_DISPTMPL_APPDATA( dt, type ) \
|
||||
(type)((dt)->dt_appdata)
|
||||
|
||||
#define LDAP_IS_DISPTMPL_OPTION_SET( dt, option ) \
|
||||
(((dt)->dt_options & option ) != 0 )
|
||||
|
||||
#define LDAP_TMPL_ERR_VERSION 1
|
||||
#define LDAP_TMPL_ERR_MEM 2
|
||||
#define LDAP_TMPL_ERR_SYNTAX 3
|
||||
#define LDAP_TMPL_ERR_FILE 4
|
||||
|
||||
/*
|
||||
* buffer size needed for entry2text and vals2text
|
||||
*/
|
||||
#define LDAP_DTMPL_BUFSIZ 8192
|
||||
|
||||
typedef int (*writeptype)( void *writeparm, char *p, int len );
|
||||
|
||||
LDAP_API(int)
|
||||
LDAP_CALL
|
||||
ldap_init_templates( char *file, struct ldap_disptmpl **tmpllistp );
|
||||
|
||||
LDAP_API(int)
|
||||
LDAP_CALL
|
||||
ldap_init_templates_buf( char *buf, long buflen,
|
||||
struct ldap_disptmpl **tmpllistp );
|
||||
|
||||
LDAP_API(void)
|
||||
LDAP_CALL
|
||||
ldap_free_templates( struct ldap_disptmpl *tmpllist );
|
||||
|
||||
LDAP_API(struct ldap_disptmpl *)
|
||||
LDAP_CALL
|
||||
ldap_first_disptmpl( struct ldap_disptmpl *tmpllist );
|
||||
|
||||
LDAP_API(struct ldap_disptmpl *)
|
||||
LDAP_CALL
|
||||
ldap_next_disptmpl( struct ldap_disptmpl *tmpllist,
|
||||
struct ldap_disptmpl *tmpl );
|
||||
|
||||
LDAP_API(struct ldap_disptmpl *)
|
||||
LDAP_CALL
|
||||
ldap_name2template( char *name, struct ldap_disptmpl *tmpllist );
|
||||
|
||||
LDAP_API(struct ldap_disptmpl *)
|
||||
LDAP_CALL
|
||||
ldap_oc2template( char **oclist, struct ldap_disptmpl *tmpllist );
|
||||
|
||||
LDAP_API(char **)
|
||||
LDAP_CALL
|
||||
ldap_tmplattrs( struct ldap_disptmpl *tmpl, char **includeattrs, int exclude,
|
||||
unsigned long syntaxmask );
|
||||
|
||||
LDAP_API(struct ldap_tmplitem *)
|
||||
LDAP_CALL
|
||||
ldap_first_tmplrow( struct ldap_disptmpl *tmpl );
|
||||
|
||||
LDAP_API(struct ldap_tmplitem *)
|
||||
LDAP_CALL
|
||||
ldap_next_tmplrow( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row );
|
||||
|
||||
LDAP_API(struct ldap_tmplitem *)
|
||||
LDAP_CALL
|
||||
ldap_first_tmplcol( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row );
|
||||
|
||||
LDAP_API(struct ldap_tmplitem *)
|
||||
LDAP_CALL
|
||||
ldap_next_tmplcol( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row,
|
||||
struct ldap_tmplitem *col );
|
||||
|
||||
LDAP_API(int)
|
||||
LDAP_CALL
|
||||
ldap_entry2text( LDAP *ld, char *buf, LDAPMessage *entry,
|
||||
struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals,
|
||||
writeptype writeproc, void *writeparm, char *eol, int rdncount,
|
||||
unsigned long opts );
|
||||
|
||||
LDAP_API(int)
|
||||
LDAP_CALL
|
||||
ldap_vals2text( LDAP *ld, char *buf, char **vals, char *label, int labelwidth,
|
||||
unsigned long syntaxid, writeptype writeproc, void *writeparm,
|
||||
char *eol, int rdncount );
|
||||
|
||||
LDAP_API(int)
|
||||
LDAP_CALL
|
||||
ldap_entry2text_search( LDAP *ld, char *dn, char *base, LDAPMessage *entry,
|
||||
struct ldap_disptmpl *tmpllist, char **defattrs, char ***defvals,
|
||||
writeptype writeproc, void *writeparm, char *eol, int rdncount,
|
||||
unsigned long opts );
|
||||
|
||||
LDAP_API(int)
|
||||
LDAP_CALL
|
||||
ldap_entry2html( LDAP *ld, char *buf, LDAPMessage *entry,
|
||||
struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals,
|
||||
writeptype writeproc, void *writeparm, char *eol, int rdncount,
|
||||
unsigned long opts, char *urlprefix, char *base );
|
||||
|
||||
LDAP_API(int)
|
||||
LDAP_CALL
|
||||
ldap_vals2html( LDAP *ld, char *buf, char **vals, char *label, int labelwidth,
|
||||
unsigned long syntaxid, writeptype writeproc, void *writeparm,
|
||||
char *eol, int rdncount, char *urlprefix );
|
||||
|
||||
LDAP_API(int)
|
||||
LDAP_CALL
|
||||
ldap_entry2html_search( LDAP *ld, char *dn, char *base, LDAPMessage *entry,
|
||||
struct ldap_disptmpl *tmpllist, char **defattrs, char ***defvals,
|
||||
writeptype writeproc, void *writeparm, char *eol, int rdncount,
|
||||
unsigned long opts, char *urlprefix );
|
||||
|
||||
LDAP_API(char *)
|
||||
LDAP_CALL
|
||||
ldap_tmplerr2string( int err );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _DISPTMPL_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user