aboutsummaryrefslogtreecommitdiff
path: root/src/mac/HeaderFiles.jam
diff options
context:
space:
mode:
Diffstat (limited to 'src/mac/HeaderFiles.jam')
-rw-r--r--src/mac/HeaderFiles.jam210
1 files changed, 210 insertions, 0 deletions
diff --git a/src/mac/HeaderFiles.jam b/src/mac/HeaderFiles.jam
new file mode 100644
index 0000000..70bd5c4
--- /dev/null
+++ b/src/mac/HeaderFiles.jam
@@ -0,0 +1,210 @@
+include "/Developer/Makefiles/pbx_jamfiles/Jambase" ;
+
+GSSKRB5_TEMP_DIR = "$(SYMROOT)/GSSKerberos5.intermediates" ;
+
+COM_ERR_DIR = "$(SRCROOT)/../util/et" ;
+PROFILE_DIR = "$(SRCROOT)/../util/profile" ;
+GSS_DIR = "$(SRCROOT)/../lib/gssapi" ;
+INCLUDE_DIR = "$(SRCROOT)/../include" ;
+ERROR_TABLES_DIR = "$(SRCROOT)/../lib/krb5/error_tables" ;
+
+ERROR_CODE_REGEXP = "/^\\s*#define\\s+\\w+\(\\s+\\(-?\\d+L\\)\)|\(initialize_\\w+_error_table\\(\\)\)\\s*$/" ;
+EXTRACT_ERROR_CODES = "perl -e 'while (<STDIN>) { if ($(ERROR_CODE_REGEXP)) { print; } }'" ;
+
+# install and installhdrs depends on the existence of the autogenerated headers
+DEPENDS install : all ;
+DEPENDS installhdrs : all ;
+
+# all depends on autogenerating the headers in the temporary directory
+DEPENDS all : "$(GSSKRB5_TEMP_DIR)"
+ "$(GSSKRB5_TEMP_DIR)/KerberosComErr.h"
+ "$(GSSKRB5_TEMP_DIR)/profile.h"
+ "$(GSSKRB5_TEMP_DIR)/KerberosProfile/profile.h"
+ "$(GSSKRB5_TEMP_DIR)/KerberosProfile.h"
+ "$(GSSKRB5_TEMP_DIR)/adm_err.h"
+ "$(GSSKRB5_TEMP_DIR)/asn1_err.h"
+ "$(GSSKRB5_TEMP_DIR)/kdb5_err.h"
+ "$(GSSKRB5_TEMP_DIR)/krb5_err.h"
+ "$(GSSKRB5_TEMP_DIR)/kv5m_err.h"
+ "$(GSSKRB5_TEMP_DIR)/krb5.h"
+ "$(GSSKRB5_TEMP_DIR)/Kerberos5/krb5.h"
+ "$(GSSKRB5_TEMP_DIR)/Kerberos5.h"
+ "$(GSSKRB5_TEMP_DIR)/gssapi.h"
+ "$(GSSKRB5_TEMP_DIR)/GSS/gssapi.h"
+ "$(GSSKRB5_TEMP_DIR)/GSS.h"
+ "$(GSSKRB5_TEMP_DIR)/autoconf.h" ;
+
+
+# Delete these files when we clean
+Clean.Remove clean : "$(GSSKRB5_TEMP_DIR)"
+ "$(GSSKRB5_TEMP_DIR)/KerberosComErr.h"
+ "$(GSSKRB5_TEMP_DIR)/profile.h"
+ "$(GSSKRB5_TEMP_DIR)/KerberosProfile.h"
+ "$(GSSKRB5_TEMP_DIR)/adm_err.h"
+ "$(GSSKRB5_TEMP_DIR)/asn1_err.h"
+ "$(GSSKRB5_TEMP_DIR)/kdb5_err.h"
+ "$(GSSKRB5_TEMP_DIR)/krb5_err.h"
+ "$(GSSKRB5_TEMP_DIR)/kv5m_err.h"
+ "$(GSSKRB5_TEMP_DIR)/krb5.h"
+ "$(GSSKRB5_TEMP_DIR)/Kerberos5.h"
+ "$(GSSKRB5_TEMP_DIR)/gssapi.h"
+ "$(GSSKRB5_TEMP_DIR)/GSS.h"
+ "$(GSSKRB5_TEMP_DIR)/autoconf.h" ;
+
+# JAM rules to autogenerate files
+
+rule KerberosComErr.h
+{
+ DEPENDS "$(1)" : "$(2)" ;
+}
+
+actions KerberosComErr.h
+{
+ echo "#ifndef __KERBEROSCOMERR__" > "$(1)" ;
+ echo "#define __KERBEROSCOMERR__" >> "$(1)" ;
+ echo "" >> "$(1)" ;
+ echo "#include <KerberosComErr/com_err.h>" >> "$(1)" ;
+ echo "" >> "$(1)" ;
+ echo "#endif /* __KERBEROSCOMERR__ */" >> "$(1)" ;
+}
+
+rule profile.h
+{
+ DEPENDS "$(1)" : "$(2)" ;
+}
+
+actions profile.h
+{
+ cat "$(2[1])" > "$(1)" ;
+ for header in "$(2[2-])" ; do
+ cat $header | $(EXTRACT_ERROR_CODES) >> "$(1)" ;
+ done
+}
+
+rule KerberosProfile.h
+{
+ DEPENDS "$(1)" : "$(2)" ;
+}
+
+actions KerberosProfile.h
+{
+ echo "#ifndef __KERBEROSPROFILE__" > "$(1)" ;
+ echo "#define __KERBEROSPROFILE__" >> "$(1)" ;
+ echo "" >> "$(1)" ;
+ echo "#include <KerberosProfile/profile.h>" >> "$(1)" ;
+ echo "" >> "$(1)" ;
+ echo "#endif /* __KERBEROSPROFILE__ */" >> "$(1)" ;
+}
+
+rule krb5.h
+{
+ DEPENDS "$(1)" : "$(2)" ;
+ DEPENDS "$(1)" : "$(PREFIX)" ;
+}
+
+actions krb5.h
+{
+ echo "/* This is the prologue to krb5.h */" > "$(1)" ;
+ echo "/* Unfortunately some of these defines are compiler dependent */" >> "$(1)" ;
+ grep SIZEOF "$(SRCROOT)/GSSKerberosPrefix.h" >> "$(1)" ;
+ grep HAVE_STDARG_H "$(SRCROOT)/GSSKerberosPrefix.h" >> "$(1)" ;
+ grep HAVE_SYS_TYPES_H "$(SRCROOT)/GSSKerberosPrefix.h" >> "$(1)" ;
+ cat "$(2[1])" >> "$(1)" ;
+ for header in "$(2[2-])" ; do
+ echo Processing $header
+ cat $header | $(EXTRACT_ERROR_CODES) >> "$(1)" ;
+ done
+}
+
+
+rule Kerberos5.h
+{
+ DEPENDS "$(1)" : "$(2)" ;
+}
+
+actions Kerberos5.h
+{
+ echo "#ifndef __KERBEROS5__" > "$(1)" ;
+ echo "#define __KERBEROS5__" >> "$(1)" ;
+ echo "" >> "$(1)" ;
+ echo "#include <Kerberos5/krb5.h>" >> "$(1)" ;
+ echo "" >> "$(1)" ;
+ echo "#endif /* __KERBEROS5__ */" >> "$(1)" ;
+}
+
+rule gssapi.h
+{
+ DEPENDS "$(1)" : "$(2)" ;
+ DEPENDS "$(1)" : "$(PREFIX)" ;
+}
+
+actions gssapi.h
+{
+ echo "/* This is the prologue to gssapi.h */" > "$(1)" ;
+ echo "/* It contains some choice pieces of autoconf.h */" >> "$(1)" ;
+ grep SIZEOF "$(SRCROOT)/GSSKerberosPrefix.h" >> "$(1)" ;
+ grep 'HAVE_.*_H' "$(SRCROOT)/GSSKerberosPrefix.h" >> "$(1)" ;
+ grep 'USE_.*_H' "$(SRCROOT)/GSSKerberosPrefix.h" >> "$(1)" ;
+ echo "/* End of gssapi.h prologue. */" >> "$(1)" ;
+ cat "$(2[1])" >> "$(1)" ;
+ for header in "$(2[2-])" ; do
+ cat $header | $(EXTRACT_ERROR_CODES) >> "$(1)" ;
+ done
+}
+
+
+rule GSS.h
+{
+ DEPENDS "$(1)" : "$(2)" ;
+}
+
+actions GSS.h
+{
+ echo "#ifndef __GSS__" > "$(1)" ;
+ echo "#define __GSS__" >> "$(1)" ;
+ echo "" >> "$(1)" ;
+ echo "#include <GSS/gssapi.h>" >> "$(1)" ;
+ echo "#include <GSS/gssapi_krb5.h>" >> "$(1)" ;
+ echo "" >> "$(1)" ;
+ echo "#endif /* __GSS__ */" >> "$(1)" ;
+}
+
+rule autoconf.h
+{
+}
+
+actions autoconf.h
+{
+ touch "$(1)" ;
+}
+
+# Dependencies to make the autogenerated headers in the temporary directory
+Mkdir "$(GSSKRB5_TEMP_DIR)" ;
+KerberosComErr.h "$(GSSKRB5_TEMP_DIR)/KerberosComErr.h" : "$(COM_ERR_DIR)/com_err.h" ;
+profile.h "$(GSSKRB5_TEMP_DIR)/profile.h" : "$(PROFILE_DIR)/profile.hin"
+ "$(GSSKRB5_TEMP_DIR)/prof_err.h" ;
+KerberosProfile.h "$(GSSKRB5_TEMP_DIR)/KerberosProfile.h" : "$(GSSKRB5_TEMP_DIR)/profile.h" ;
+krb5.h "$(GSSKRB5_TEMP_DIR)/krb5.h" : "$(INCLUDE_DIR)/krb5.hin"
+ "$(GSSKRB5_TEMP_DIR)/krb5_err.h"
+ "$(GSSKRB5_TEMP_DIR)/kdb5_err.h"
+ "$(GSSKRB5_TEMP_DIR)/kv5m_err.h"
+ "$(GSSKRB5_TEMP_DIR)/asn1_err.h" ;
+Kerberos5.h "$(GSSKRB5_TEMP_DIR)/Kerberos5.h" : "$(GSSKRB5_TEMP_DIR)/krb5.h" ;
+gssapi.h "$(GSSKRB5_TEMP_DIR)/gssapi.h" : "$(GSS_DIR)/generic/gssapi.hin" ;
+GSS.h "$(GSSKRB5_TEMP_DIR)/GSS.h" : "$(GSSKRB5_TEMP_DIR)/gssapi.h" ;
+autoconf.h "$(GSSKRB5_TEMP_DIR)/autoconf.h" ;
+
+# We need to also make copies in the appropriate subdirectories, so that <foo/bar.h> paths work
+# correctly inside the foo framework target. This is due to a Project Builder bug which causes
+# builds to fail if an autogenerated SYMROOT-relative file is added to a target
+Mkdir "$(GSSKRB5_TEMP_DIR)/GSS" ;
+DEPENDS "$(GSSKRB5_TEMP_DIR)/GSS/gssapi.h" : "$(GSSKRB5_TEMP_DIR)/GSS" ;
+Cp "$(GSSKRB5_TEMP_DIR)/GSS/gssapi.h" : "$(GSSKRB5_TEMP_DIR)/gssapi.h" ;
+
+Mkdir "$(GSSKRB5_TEMP_DIR)/Kerberos5" ;
+DEPENDS "$(GSSKRB5_TEMP_DIR)/Kerberos5/krb5.h" : "$(GSSKRB5_TEMP_DIR)/Kerberos5" ;
+Cp "$(GSSKRB5_TEMP_DIR)/Kerberos5/krb5.h" : "$(GSSKRB5_TEMP_DIR)/krb5.h" ;
+
+Mkdir "$(GSSKRB5_TEMP_DIR)/KerberosProfile" ;
+DEPENDS "$(GSSKRB5_TEMP_DIR)/KerberosProfile/profile.h" : "$(GSSKRB5_TEMP_DIR)/KerberosProfile" ;
+Cp "$(GSSKRB5_TEMP_DIR)/KerberosProfile/profile.h" : "$(GSSKRB5_TEMP_DIR)/profile.h" ;