summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/et/ChangeLog36
-rw-r--r--src/util/et/Makefile.in8
-rw-r--r--src/util/et/com_err.h13
-rw-r--r--src/util/et/error_message.c16
-rw-r--r--src/util/et/error_table.h2
-rw-r--r--src/util/et/et.pbexp10
-rw-r--r--src/util/et/et_c.awk6
-rw-r--r--src/util/et/et_c.pl (renamed from src/util/et/et_c.perl)15
-rw-r--r--src/util/et/et_h.awk6
-rw-r--r--src/util/et/et_h.pl (renamed from src/util/et/et_h.perl)13
10 files changed, 109 insertions, 16 deletions
diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog
index 7e27e5689..4b767f953 100644
--- a/src/util/et/ChangeLog
+++ b/src/util/et/ChangeLog
@@ -1,3 +1,39 @@
+2002-07-03 Tom Yu <tlyu@mit.edu>
+
+ * Makefile.in: Fix rebuild rules et_?.perl -> et_?.pl. Also,
+ strip the "#!" line.
+
+ * error_table.h: Fix mac conditional, due to _et_list declaration
+ moving from et_c.awk
+
+ * et_c.perl, et_h.perl: Remove.
+
+ * et_c.pl, et_h.pl: Generate.
+
+2002-07-03 Danilo Almeida <dalmeida@mit.edu>
+
+ * com_err.h: Windows should include <win-mac.h> as opposed
+ to <Kerberos5/win-mac.h>
+ [pullup from 1-2-2-branch]
+
+2002-07-03 Miro Jurisic <meeroh@mit.edu>
+
+ * et_c.perl, et_h.perl:
+ Renamed to et_c.pl and et_h.pl because the extension is used
+ as a newline separator heuristic in MacPerl parser
+
+ * et_c.perl, et_h.perl:
+ Removed #! from the first line to avoid confusing MacPerl
+
+ [pullups from 1-2-2-branch]
+
+2002-07-03 Alexandra Ellwood <lxs@mit.edu>
+
+ * com_err.h, error_message.c, et.pbexp, et_c.awk, et_h.awk:
+ conditionalized com_err so it doesn't need to export et_list
+ on Mac OS X
+ [pullup from 1-2-2-branch]
+
2001-10-05 Ken Raeburn <raeburn@mit.edu>
* com_err.h (KRB5_EXPORTVAR): Don't define.
diff --git a/src/util/et/Makefile.in b/src/util/et/Makefile.in
index c7e3651c9..9ddecfb31 100644
--- a/src/util/et/Makefile.in
+++ b/src/util/et/Makefile.in
@@ -164,11 +164,11 @@ compile_et: $(srcdir)/compile_et.sh $(srcdir)/config_script
rebuild: rebuild-c rebuild-h
rebuild-c:
- a2p < $(srcdir)/et_c.awk > $(srcdir)/et_c.tmp
- mv -f $(srcdir)/et_c.tmp $(srcdir)/et_c.perl
+ a2p < $(srcdir)/et_c.awk | awk 'NR != 1 || $$0 !~ /^\043!/{print;}' > $(srcdir)/et_c.tmp
+ mv -f $(srcdir)/et_c.tmp $(srcdir)/et_c.pl
rebuild-h:
- a2p < $(srcdir)/et_h.awk > $(srcdir)/et_h.tmp
- mv -f $(srcdir)/et_h.tmp $(srcdir)/et_h.perl
+ a2p < $(srcdir)/et_h.awk | awk 'NR != 1 || $$0 !~ /^\043!/{print;}' > $(srcdir)/et_h.tmp
+ mv -f $(srcdir)/et_h.tmp $(srcdir)/et_h.pl
clean-unix::
$(RM) compile_et
diff --git a/src/util/et/com_err.h b/src/util/et/com_err.h
index c56fad2b1..8738a5a7f 100644
--- a/src/util/et/com_err.h
+++ b/src/util/et/com_err.h
@@ -13,7 +13,14 @@
#ifndef __COM_ERR_H
#if defined(_WIN32) || defined(macintosh)
+#ifdef _WIN32
#include <win-mac.h>
+#else
+#include <Kerberos5/win-mac.h>
+#endif
+#if defined(macintosh) && defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__)
+#pragma import on
+#endif
#endif
#ifndef KRB5_CALLCONV
@@ -53,7 +60,7 @@ extern errcode_t KRB5_CALLCONV remove_error_table
(const struct error_table *)
/*@modifies internalState@*/;
-#if !defined(_WIN32) && !defined(macintosh)
+#if !defined(_WIN32) && !defined(macintosh) && !defined(__MACH__)
/*
* The display routine should be application specific. A global hook,
* may cause inappropriate display procedures to be called between
@@ -68,5 +75,9 @@ extern et_old_error_hook_func reset_com_err_hook (void);
}
#endif
+#if defined(macintosh) && defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__)
+#pragma import reset
+#endif
+
#define __COM_ERR_H
#endif /* ! defined(__COM_ERR_H) */
diff --git a/src/util/et/error_message.c b/src/util/et/error_message.c
index 827b52aa7..450148f06 100644
--- a/src/util/et/error_message.c
+++ b/src/util/et/error_message.c
@@ -27,8 +27,9 @@
#include "com_err.h"
#include "error_table.h"
-#ifdef macintosh
-#include <ErrorLib.h>
+#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
+ #include <KerberosSupport/KerberosSupport.h>
+ #include <KerberosSupport/ErrorLib.h>
#endif
#if defined(_WIN32)
@@ -48,7 +49,7 @@ extern const int sys_nerr;
static char buffer[ET_EBUFSIZ];
-#if (defined(_WIN32) || defined(macintosh))
+#if (defined(_WIN32) || defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)))
/*@null@*/ static struct et_list * _et_list = (struct et_list *) NULL;
#else
/* Old interface compatibility */
@@ -199,12 +200,19 @@ error_message(long code)
oops:
-#if defined(macintosh)
+#if TARGET_OS_MAC
{
/* This may be a Mac OS Toolbox error or an MIT Support Library Error. Ask ErrorLib */
if (GetErrorLongString(code, buffer, ET_EBUFSIZ - 1) == noErr) {
return buffer;
}
+
+#if TARGET_API_MAC_OSX
+ /* ComErr and ErrorLib don't know about this error, ask the system */
+ /* Of course there's no way to tell if it knew what error it got */
+ return (strerror (code));
+#endif
+
}
#endif
diff --git a/src/util/et/error_table.h b/src/util/et/error_table.h
index d30457d3f..505521dfe 100644
--- a/src/util/et/error_table.h
+++ b/src/util/et/error_table.h
@@ -19,7 +19,7 @@ struct et_list {
/*@dependent@*//*@null@*/ struct et_list *next;
/*@dependent@*//*@null@*/ const struct error_table *table;
};
-#if !defined(_WIN32) && !defined(macintosh)
+#if !defined(_WIN32) && !defined(macintosh) && !(defined(__MACH__) && defined(__APPLE__))
/*@null@*//*@dependent@*/ extern struct et_list * _et_list;
#endif
diff --git a/src/util/et/et.pbexp b/src/util/et/et.pbexp
new file mode 100644
index 000000000..31097615a
--- /dev/null
+++ b/src/util/et/et.pbexp
@@ -0,0 +1,10 @@
+#
+# comerr library Macintosh export file
+#
+# $Header$
+
+_com_err
+_com_err_va
+_error_message
+_add_error_table
+_remove_error_table
diff --git a/src/util/et/et_c.awk b/src/util/et/et_c.awk
index 023c831c3..10662b6e5 100644
--- a/src/util/et/et_c.awk
+++ b/src/util/et/et_c.awk
@@ -113,7 +113,9 @@ c2n["_"]=63
print "# include \"win-mac.h\"" > outfile
print "#endif" > outfile
print "" > outfile
+ print "#if !defined(_WIN32) && !defined(macintosh) && !(defined(__MACH__) && defined(__APPLE__))" > outfile
print "extern void initialize_" table_name "_error_table (void);" > outfile
+ print "#endif" > outfile
print "" > outfile
print "/* Lclint doesn't handle null annotations on arrays" > outfile
print " properly, so we need this typedef in each" > outfile
@@ -185,7 +187,9 @@ END {
print " 0" > outfile
print "};" > outfile
print "" > outfile
+ print "#if !defined(_WIN32) && !defined(macintosh) && !(defined(__MACH__) && defined(__APPLE__))" > outfile
print "#include <com_err.h>" > outfile
+ print "#endif" > outfile
print "" > outfile
if (tab_base_high == 0) {
print "const struct error_table et_" table_name "_error_table = { text, " \
@@ -197,7 +201,7 @@ END {
tab_base_low, table_item_count) > outfile
}
print "" > outfile
- print "#if !defined(_WIN32) && !defined(macintosh)" > outfile
+ print "#if !defined(_WIN32) && !defined(macintosh) && !(defined(__MACH__) && defined(__APPLE__))" > outfile
print "void initialize_" table_name "_error_table (void)" > outfile
print " /*@modifies internalState@*/" > outfile
print "{" > outfile
diff --git a/src/util/et/et_c.perl b/src/util/et/et_c.pl
index ad85ec759..fff4a56ff 100644
--- a/src/util/et/et_c.perl
+++ b/src/util/et/et_c.pl
@@ -1,4 +1,3 @@
-#!/usr/athena/bin/perl
eval 'exec /usr/athena/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
# this emulates #! processing on NIH machines.
@@ -145,10 +144,16 @@ line: while (<>) {
&Pick('>', $outfile) &&
(print $fh '');
&Pick('>', $outfile) &&
+ (print $fh
+
+ '#if !defined(_WIN32) && !defined(macintosh) && !(defined(__MACH__) && defined(__APPLE__))');
+ &Pick('>', $outfile) &&
(print $fh 'extern void initialize_' . $table_name .
'_error_table (void);');
&Pick('>', $outfile) &&
+ (print $fh '#endif');
+ &Pick('>', $outfile) &&
(print $fh '');
&Pick('>', $outfile) &&
(print $fh "/* Lclint doesn't handle null annotations on arrays");
@@ -234,8 +239,14 @@ line: while (<>) {
&Pick('>', $outfile) &&
(print $fh '');
&Pick('>', $outfile) &&
+ (print $fh
+
+ '#if !defined(_WIN32) && !defined(macintosh) && !(defined(__MACH__) && defined(__APPLE__))');
+&Pick('>', $outfile) &&
(print $fh '#include <com_err.h>');
&Pick('>', $outfile) &&
+ (print $fh '#endif');
+&Pick('>', $outfile) &&
(print $fh '');
if ($tab_base_high == 0) {
&Pick('>', $outfile) &&
@@ -258,7 +269,7 @@ else {
&Pick('>', $outfile) &&
(print $fh
- '#if !defined(_WIN32) && !defined(macintosh)');
+ '#if !defined(_WIN32) && !defined(macintosh) && !(defined(__MACH__) && defined(__APPLE__))');
&Pick('>', $outfile) &&
(print $fh 'void initialize_' . $table_name . '_error_table (void)');
&Pick('>', $outfile) &&
diff --git a/src/util/et/et_h.awk b/src/util/et/et_h.awk
index 2cea1532d..1bbe5e972 100644
--- a/src/util/et/et_h.awk
+++ b/src/util/et/et_h.awk
@@ -111,7 +111,11 @@ c2n["_"]=63
print " * This file is automatically generated; please do not edit it." > outfile
print " */" > outfile
print "" > outfile
+ print "#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))" > outfile
+ print "#include <KerberosComErr/KerberosComErr.h>" > outfile
+ print "#else" > outfile
print "#include <com_err.h>" > outfile
+ print "#endif" > outfile
print "" > outfile
}
@@ -148,7 +152,7 @@ END {
print "" > outfile
print "extern struct error_table et_" table_name "_error_table;" > outfile
print "" > outfile
- print "#if !defined(_WIN32) && !defined(macintosh)" > outfile
+ print "#if !defined(_WIN32) && !defined(macintosh) && !(defined(__MACH__) && defined(__APPLE__))" > outfile
print "/* for compatibility with older versions... */" > outfile
print "extern void initialize_" table_name "_error_table () /*@modifies internalState@*/;" > outfile
print "#define init_" table_name "_err_tbl initialize_" table_name "_error_table" > outfile
diff --git a/src/util/et/et_h.perl b/src/util/et/et_h.pl
index 5789617a4..5debb4869 100644
--- a/src/util/et/et_h.perl
+++ b/src/util/et/et_h.pl
@@ -1,4 +1,3 @@
-#!/usr/athena/bin/perl
eval 'exec /usr/athena/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
# this emulates #! processing on NIH machines.
@@ -138,8 +137,18 @@ line: while (<>) {
&Pick('>', $outfile) &&
(print $fh '');
&Pick('>', $outfile) &&
+ (print $fh
+
+ '#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))');
+ &Pick('>', $outfile) &&
+ (print $fh '#include <KerberosComErr/KerberosComErr.h>');
+ &Pick('>', $outfile) &&
+ (print $fh '#else');
+ &Pick('>', $outfile) &&
(print $fh '#include <com_err.h>');
&Pick('>', $outfile) &&
+ (print $fh '#endif');
+ &Pick('>', $outfile) &&
(print $fh '');
}
@@ -194,7 +203,7 @@ else {
&Pick('>', $outfile) &&
(print $fh
- '#if !defined(_WIN32) && !defined(macintosh)');
+ '#if !defined(_WIN32) && !defined(macintosh) && !(defined(__MACH__) && defined(__APPLE__))');
&Pick('>', $outfile) &&
(print $fh '/* for compatibility with older versions... */');
&Pick('>', $outfile) &&