Added build option for idl tool. Thanks to Tague Griffith <tague@netscape.com> for the patch and the patience while I fumbled this patch. :)

This commit is contained in:
cls%seawood.org 1998-12-15 03:24:59 +00:00
Родитель c54575737f
Коммит 813dce53f5
10 изменённых файлов: 94 добавлений и 30 удалений

Просмотреть файл

@ -42,6 +42,7 @@ SMART_MAIL = @MOZ_SMART_MAIL@
DOM = @MOZ_DOM@
MOZ_MAIL_COMPOSE = @MOZ_MAIL_COMPOSE@
NO_UNIX_LDAP = @NO_UNIX_LDAP@
BUILD_IDL_TOOL = @MOZ_IDL_TOOL@
MOZ_NATIVE_ZLIB = @SYSTEM_ZLIB@
MOZ_NATIVE_JPEG = @SYSTEM_JPEG@

Просмотреть файл

@ -505,6 +505,12 @@ AC_ARG_ENABLE(ldap,
NO_UNIX_LDAP=
fi] )
AC_ARG_ENABLE(idltool,
[ --enable-idltool build idl tool (default=no) ],
[if test "$enableval" = "yes"; then
MOZ_IDL_TOOL=1
fi] )
AC_SUBST(OS_TARGET)
AC_SUBST(MOZ_TOOLKIT)
AC_SUBST(MOZ_SECURITY)
@ -526,6 +532,7 @@ AC_SUBST(MOZ_DOM)
AC_SUBST(MOZ_MAIL_COMPOSE)
AC_SUBST(FULL_STATIC_BUILD)
AC_SUBST(NO_UNIX_LDAP)
AC_SUBST(MOZ_IDL_TOOL)
dnl Checks for X libraries.
dnl Ordering is important.

Просмотреть файл

@ -23,6 +23,9 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src
ifdef BUILD_IDL_TOOL
DIRS += tools
endif
include $(topsrcdir)/config/config.mk

Просмотреть файл

@ -80,7 +80,11 @@ AbortParser::AbortParser(char *aFileName, long aLineNumber)
strcat(message, aFileName);
strcat(message, ". Line Number: ");
#ifdef XP_UNIX
sprintf(lineNumber,"%d",aLineNumber);
#else
itoa(aLineNumber, lineNumber, 10);
#endif
strcat(message, lineNumber);
SetMessage(message);

Просмотреть файл

@ -834,13 +834,25 @@ IdlParameter* IdlParser::ParseFunctionParameter(IdlSpecification &aSpecification
switch(token->id) {
// base type
case INPUT_PARAM_TOKEN:
#ifdef XP_UNIX
argObj->SetAttribute(IdlParameter::INPUT);
#else
argObj->SetAttribute(IdlParameter.INPUT);
#endif
break;
case OUTPUT_PARAM_TOKEN:
#ifdef XP_UNIX
argObj->SetAttribute(IdlParameter::OUTPUT);
#else
argObj->SetAttribute(IdlParameter.OUTPUT);
#endif
break;
case INOUT_PARAM_TOKEN:
#ifdef XP_UNIX
argObj->SetAttribute(IdlParameter::INOUT);
#else
argObj->SetAttribute(IdlParameter.INOUT);
#endif
break;
default:
delete argObj;
@ -924,3 +936,6 @@ void IdlParser::TrimComments()
mScanner->NextToken();
}
}

Просмотреть файл

@ -19,6 +19,10 @@
#ifndef _IdlVariable_h__
#define _IdlVariable_h__
#ifdef XP_UNIX
#include <stddef.h>
#endif
#include "IdlObject.h"
enum Type {
@ -56,7 +60,7 @@ public:
void SetType(Type aType);
Type GetType();
void SetTypeName(char *aTypeName);
char* GetTypeName();
char* GetTypeName(void);
void GetTypeAsString(char *aString, size_t aStringSize);
void SetValue(unsigned long aValue);

Просмотреть файл

@ -18,7 +18,9 @@
#include <sys/types.h>
#include <sys/stat.h>
#ifndef XP_UNIX
#include <direct.h>
#endif
#include <fstream.h>
#include <ctype.h>
#include "nsIPtr.h"

Просмотреть файл

@ -24,42 +24,58 @@ include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
PROGRAM = idlc
CPPSRCS = \
main.cpp \
IdlParser.cpp \
IdlScanner.cpp \
Exceptions.cpp \
Id.cppect.cpp \
IdlVariable.cpp \
IdlAttribute.cpp \
IdlEnum.cpp \
IdlFunction.cpp \
IdlInterface.cpp \
IdlParameter.cpp \
IdlSpecification.cpp \
FileGen.cpp \
XPCOMGen.cpp \
JSStubGen.cpp \
$(NULL)
CPPSRCS = \
main.cpp \
IdlParser.cpp \
IdlScanner.cpp \
Exceptions.cpp \
IdlObject.cpp \
IdlVariable.cpp \
IdlAttribute.cpp \
IdlEnum.cpp \
IdlFunction.cpp \
IdlInterface.cpp \
IdlParameter.cpp \
IdlSpecification.cpp \
FileGen.cpp \
XPCOMGen.cpp \
JSStubGen.cpp \
$(NULL)
OBJS = $(CPPSRCS:.cpp=.o)
EX_LIBS = \
$(NULL)
PROGS = $(OBJDIR)/idlc
TARGETS = $(PROGS)
INCLUDES += \
-I$(PUBLIC)/raptor \
-I$(PUBLIC)/xpcom \
$(NULL)
EX_LIBS = \
-L$(DIST)/bin \
-lraptorbase
NON_DIRS = $(PROGS)
TARGETS = $(NON_DIRS)
include $(topsrcdir)/config/rules.mk
$(OBJDIR)/%.o: %.cpp
$(PROGS): $(OBJS) # $(EX_LIBS)
@$(MAKE_OBJDIR)
$(CCC) -o $@ $(CFLAGS) -DUSE_NSREG -c $<
ifeq ($(OS_ARCH),Linux)
$(CCC) -rdynamic -o $@ $(OBJS) $(LDFLAGS) $(EX_LIBS) $(NSPR_LIBS) $(TOOLKIT_LIBS) $(OS_LIBS)
else
ifeq ($(OS_ARCH),IRIX)
$(CCC) -o $@ -woff 84,85 $(LDFLAGS) $(OBJS) $(EX_LIBS) $(NSPR_LIBS) $(TOOLKIT_LIBS) $(OS_LIBS)
else
$(CCC) -o $@ $(LDFLAGS) $(OBJS) $(EX_LIBS) $(NSPR_LIBS) $(TOOLKIT_LIBS) $(OS_LIBS)
endif
endif
export::
install:: $(PROGRAM)
$(INSTALL) $(PROGRAM) $(DIST)/bin
install:: $(TARGETS)
$(INSTALL) $(PROGS) $(DIST)/bin

Просмотреть файл

@ -18,10 +18,12 @@
#include <sys/types.h>
#include <sys/stat.h>
#ifndef XP_UNIX
#include <direct.h>
#endif
#include <fstream.h>
#include <ctype.h>
#include "XPComGen.h"
#include "XPCOMGen.h"
#include "Exceptions.h"
#include "plhash.h"
#include "IdlSpecification.h"

Просмотреть файл

@ -21,7 +21,9 @@
#include "string.h"
#include <sys/types.h>
#include <sys/stat.h>
#ifndef XP_UNIX
#include <direct.h>
#endif
#include "IdlParser.h"
#include "Exceptions.h"
#include "IdlSpecification.h"
@ -66,9 +68,17 @@ int main(int argc, char *argv[])
if (op_dir) {
struct stat sb;
if (stat(argv[op_dir_arg], &sb) == 0) {
#ifdef XP_UNIX
if (!(sb.st_mode & S_IFDIR)) {
#else
if (!(sb.st_mode & _S_IFDIR)) {
#endif
cout << "Creating directory " << argv[op_dir_arg] << " ...\n";
#ifdef XP_UNIX
if (mkdir(argv[op_dir_arg],S_IWGRP | S_IWOTH) < 0) {
#else
if (mkdir(argv[op_dir_arg]) < 0) {
#endif
cout << "WARNING: cannot create output directory [" << argv[op_dir_arg] << "]\n";
cout << "++++++++ using current directory\n";
}
@ -107,7 +117,7 @@ int main(int argc, char *argv[])
cout << "Generating XPCOM headers for " << argv[i] << ".\n";
try {
xpcomgen->Generate(argv[i], op_dir ? argv[op_dir_arg] : NULL,
xpcomgen->Generate(argv[i], op_dir ? argv[op_dir_arg] :(char*)NULL,
*specification, is_global);
}
catch(CantOpenFileException &exc) {
@ -124,7 +134,7 @@ int main(int argc, char *argv[])
cout << "Generating JavaScript stubs for " << argv[i] << ".\n";
try {
jsgen->Generate(argv[i], op_dir ? argv[op_dir_arg] : NULL,
jsgen->Generate(argv[i], op_dir ? argv[op_dir_arg] : (char*)NULL,
*specification, is_global);
}
catch(CantOpenFileException &exc) {