libadmin: add support for UAE error translation Routine util_AdminErrorCodeTranslate() provides the support for error translation that is used by the libadmin package and several Windows utilities, including the Windows implementation of translate_et (translate_et_nt.c). Enhance it so the Windows translate_et can translate UAE errors. No changes are required for translate_et_nt.c. Note: this may be unit-tested under Unix via a libadmin test: $ src/libadmin/test/afscp UtilErrorTranslate -error 49733388 49733388 -> Permission denied Change-Id: Iee85e09813e3488558c0f1c6682d0049b912abc7 Reviewed-on: https://gerrit.openafs.org/14648 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
objdir build: Normalize COMPILE_ET_* commands A few different places in the tree currently invoke compile_et in a few different ways. These three general styles all appear: ${COMPILE_ET_H} -p ${srcdir} foo ${COMPILE_ET_H} -p ${srcdir} foo.et ${COMPILE_ET_H} ${srcdir}/foo.et Of these, the first is the correct way to invoke compile_et in a Makefile. The other two can fail during at least some objdir builds. Take this example of the second style of invocation: afs_trace.h: afs_trace.et ${COMPILE_ET_H} -v 2 -p ${srcdir} afs_trace.et During an objdir build, the compile_et command will get expanded like so, due to VPATH expansion: $top_objdir/src/comerr/compile_et -emit h -v 2 \ -p $top_srcdir/src/afs \ $top_srcdir/src/afs/afs_trace.et The compile_et command concatenates the -p prefix with the actual filename provided, so the file it tries to open is: $top_srcdir/src/afs/$top_srcdir/src/afs/afs_trace.et For non-objdir builds this doesn't happen, since $srcdir is just '.', and afs_trace.et gets expanded to just afs_trace.et (or possibly ./afs_trace.et). This is also not a problem for objdir builds that are specified as a relative path and are 'adjacent' to the srcdir. For example, if we ran '../openafs-1.6.10pre1/configure --options', our $top_srcdir is just '../openafs-1.6.10pre1', with some magic to expand '..' to the correct number of levels. So in the above example, the compile_et invocation gets expanded to: /path/to/objdir/src/comerr/compile_et -emit h -v 2 \ -p ../../../openafs-1.6.10pre1/src/afs \ ../../../openafs-1.6.10pre1/src/afs/afs_trace.et And compile_et then tries to open the path ../../../openafs-1.6.10pre1/src/afs/../../../openafs-1.6.10pre1/src/afs/afs_trace.et which collapses to just ../../../openafs-1.6.10pre1/src/afs/afs_trace.et, which is the correct file. However, if the $srcdir is specified as an absolute path, or if the number of '..'s is wrong, this doesn't work. It is perhaps easiest to explain why by just using another example. For an absolute path, the invoked command is: /path/to/objdir/src/comerr/compile_et -emit h -v 2 \ -p /path/to/openafs-1.6.10pre1/src/afs \ /path/to/openafs-1.6.10pre1/src/afs/afs_trace.et And compile_et tries to open /path/to/openafs-1.6.10pre1/src/afs/path/to/openafs-1.6.10pre1/src/afs/afs_trace.et, which obviously does not exist. This results in a build failure like: /path/to/openafs-1.6.10pre1/src/afs/path/to/openafs-1.6.10pre1/src/afs/afs_trace.et: No such file or directory *** Error code 1 make: Fatal error: Command failed for target `afs_trace.msf' For a non-working relative objdir, we may invoke a command like this: /path/to/objdir/src/comerr/compile_et -emit h -v 2 \ -p ../../../../openafs-1.6.10pre1/src/afs \ ../../../../openafs-1.6.10pre1/src/afs/afs_trace.et And compile_et tries to open ../../../../openafs-1.6.10pre1/src/afs/../../../../openafs-1.6.10pre1/src/afs/afs_trace.et, which is ../../../../../openafs-1.6.10pre1/src/afs/afs_trace.et, which (probably) doesn't exist, since it goes one too many levels up. To avoid this, we can just prevent the filename argument to compile_et from undergoing VPATH expansion. compile_et never opens the given path directly if -p is given, so it's not really a file path and so should not be altered by VPATH. compile_et will add a trailing .et to the filename if it doesn't have one, so we can avoid the VPATH expansion by just leaving out the trailing .et. We could also avoid the VPATH expansion by specifying something like './afs_trace.et', but it is perhaps more clear to not say the explicit filename, since we're not really specifying a path to a file. Just leaving out the -p option, as in this style of compile_et invocation: dumpscan_errs.h: ${srcdir}/dumpscan_errs.et $(COMPILE_ET_H) ${srcdir}/dumpscan_errs.et also fails for objdir builds. This is because, without the -p option, compile_et defaults to '.' as the prefix. If the srcdir is /path/to/openafs-1.6.10pre1, then this will expand to: /path/to/objdir/src/comerr/compile_et -emit h \ .//path/to/openafs-1.6.10pre1/src/tools/dumpscan/dumpscan_errs.et which will fail, since that path to dumpscan_errs.et does not exist. So to fix this, make all compile_et invocations follow this style: ${COMPILE_ET_H} -p ${srcdir} foo Many other invocations of compile_et in the tree are already like this, so this commit just changes the others to match. Change-Id: Ied12e07a1cc6e115d4a10cd7a6c97aae9ce7f5f9 Reviewed-on: http://gerrit.openafs.org/11391 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Revert "libafs: remove stray "-v 2" argument to afs_compile_et" This reverts commit d7082793eedc46d3647d38ffdf5a2b52fadb3cc3 Change-Id: I8ad37f109fc244d198f85c4642dcf1e8eb33a184 Reviewed-on: http://gerrit.openafs.org/11360 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
libafs: remove stray "-v 2" argument to afs_compile_et Commit 4e6b7ab904d38d38da1b80a7342bd815668a8c09 separated the compile_et rules for creating the source and header files using the new -emit functionality. During review for inclusion in 1.6, Chas Williams spotted a stray "-v 2" carried over to the rule for creating the header file, where it doesn't apply. Remove it. Change-Id: I554354eae0fa018e56fe7b78df69a43e5b5a0b07 Reviewed-on: http://gerrit.openafs.org/11347 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: D Brashear <shadow@your-file-system.com>
libafs: separate source and header compile_et rules Use the new compile_et -emit flag to generate source and header files separately to support parallel make. Export afs_trace.h since it is required to build libafs. Before the compile_et -emit flag was available, The afs_trace.h file was generated as a side-effect of creating afszcm.cat. Change-Id: I4e93691dda34ddc8600d6a818503e0c9e75e618a Reviewed-on: http://gerrit.openafs.org/10729 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: D Brashear <shadow@your-file-system.com>
build: compile_et rules for parallel make Change all makefile rules which run compile_et in order support parallel make. The compile_et generates two outputs, so special care must be taken in rules which run compile_et. All the rules for compile_et have been changed to the form: foo.c foo.h: foo.et compile_et foo.et -h foo foo.h: foo.c The above rules are equivalent to: foo.c: foo.et compile_et foo.et -h foo foo.h: foo.et foo.c compile_et foo.et -h foo therefore a parallel make will serialize the builds of foo.c and foo.h, and should detect that the second is no longer needed once the first is over. This form works since foo.et is not a phony target, and does not depend on a phony target. Previously, the rules for compile_et were of the one of the two forms: a) foo.c foo.h: foo.et compile_et foo.et -h foo or b) foo.h: foo.c foo.c: foo.et compile_et foo.et -h foo Form a) is problematic for parallel makes, since it is equivalent to: foo.c: compile_et foo.et -h foo foo.h: compile_et foo.et -h foo In a parallel make, compile_et will be run concurrently, clobbering each other's output files. Form b) is better, but is problematic when foo.h is removed, since foo.h will not be updated. Thanks to Russ Allbery for pointing out the automake documentation which describes issues with commands that produce multiple outputs, and portable solutions. http://www.gnu.org/software/automake/manual/automake.html#Multiple-Outputs Change-Id: I14c056606084f80270e05592d3d09a600f804e24 Reviewed-on: http://gerrit.openafs.org/10237 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Build: check for gencat Check for the gencat program and give a missing warning if not present. Change-Id: I71cdaa0840215b53071be4481a5f23b2f8667bda Reviewed-on: http://gerrit.openafs.org/7203 Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementix.org> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Finish removing sunos 4.x references and build cruft Also, fix afsxbsa.h to always include <time.h> since this should get struct tm on any fairly modern operating system. Change-Id: Idfb39f12d28a2a0aa470c8549e4149d0b2ccde9e Change-Id: Ia1c563e5954c533f18bd56155f2ae1825813efe3 Reviewed-on: http://gerrit.openafs.org/6923 Reviewed-by: Derrick Brashear <shadow@dementix.org> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Install afszcm.cat for i386_fbsd make dest Because we missed it in gerrit/4815. Change-Id: I653c4259a0bbe926abac80c09e32ff3bc35f2de2 Reviewed-on: http://gerrit.openafs.org/5022 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Also install afszcm.cat for i386_fbsd The change gerrit/4760 enabled the use of gencat to actually build this file, but failed to also change installation logic, so it was sitting unused in the build tree. Fix this, and install the file. This allows us to remove a shell case statement which had formerly been needed to enforce this restriction. Change-Id: I7f9e94b09c504193084e1e04ae137df08b27b447 Reviewed-on: http://gerrit.openafs.org/4815 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Enable gencat for i386_fbsd_* The machines certainly have a /usr/bin/gencat, and I see nothing in history to indicate a reason for this prevention. Allow the 32-bit machines to build afszcm.cat and make packaging more uniform between architectures. Change-Id: If1017d28cc804d58cfb29019158ad5b3d70da9ac Reviewed-on: http://gerrit.openafs.org/4760 Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Build system: Move install definitions to include Move the definitions of the INSTALL_* variables out to Makefile.config rather than replicating them in each file. Change-Id: I5f74dcbf544a93716994418bee3be2c51a2a82d0 Reviewed-on: http://gerrit.openafs.org/4781 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Unix: Rework build system Rework the unix build system so that we support taking CFLAGS and LDFLAGS from the command line, and don't replace them with our own settings. Also, take the opportunity to bring some sanity and consistency into our Makefiles. The standard Makefile.config now defines rules for LWP, pthreaded and shared library builds. The CFLAGS settings for these are called LWP_CFLAGS, PTH_CFLAGS and SHD_CFLAGS, respectively. Similarly named variables are provided for LDFLAGS. A module may select to use a particular build type for its suffix rule by including either Makefile.lwp, Makefile.pthread or Makefile.shared from src/config. This creates an appropriate .c.o suffix rule, defines AFS_CFLAGS and AFS_LDFLAGS as appropriate, and creates two rules AFS_CCRULE and AFS_LDRULE, which can be used to build, and link objects. For example: foo.o: foo.c $(AFS_CCRULE) foo.c foo: foo.o $(AFS_LDRULE) foo.o If a you wish to override the CFLAGS or LDFLAGS for an object build using these rules (or through the .c.o suffix rule) you can do so, by defining CFLAGS_<object> or LDFLAGS_<object>. For example: CFLAGS_foo.o= -DDEBUG LDFLAGS_foo = -ldebugging A module may also alter the behaviour of the compile and link steps module wide by defining MODULE_CFLAGS or MODULE_LDFLAGS. This functionality is now used throughout the tree: *) Suffix rules are used wherever possible, removing a number of unecessary build rules. *) All link steps are replaced with AFS_LDRULE *) All standard compile steps are replaced with AFS_CCRULE *) Unusal compile steps are defined, as far as possible, int terms of the LWP_ PTH_ and SHD_ variables. *) The use of $? has been removed entirely, as it makes it impossible to provide build rules with dependency information Change-Id: If76207e45da402a0ed9d7c1bdbe83c58c911a4f2 Reviewed-on: http://gerrit.openafs.org/2896 Tested-by: BuildBot <buildbot@rampaginggeek.com> Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Fix objdir install/dest targets Many 'install' and 'dest' targets were referring to source files without a srcdir prefix. Fix them so we can 'make install' / 'make dest' with objdir. Change-Id: Id76c5e326309baf8ec3f1213ecb2e40b19aea7d4 Reviewed-on: http://gerrit.openafs.org/2522 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
generated file target in order to cross compile, allow a way to generate generated files on the host Change-Id: I9639f350b179dbeb3d45802e8685da88a3b06c83 Reviewed-on: http://gerrit.openafs.org/2147 Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Consolidate duplicate definitions Housekeeping change to consolidate some common definitions. Create a new common header called afs_consts.h. This allows us to remove the afscp.c dependency on afs.h (so src/tests will build again.) Rename the max filename definition in the update server package to MAXFNSIZE to avoid a name conflict with MAXSIZE. The global defines will be prefixed with AFS_ in a second patch. Change-Id: I2b8d555a244cc92d889618de4eec4a99550d7c7f Reviewed-on: http://gerrit.openafs.org/855 Reviewed-by: Mickey Lane <mlane@sinenomine.net> Tested-by: Mickey Lane <mlane@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Fixed out-of-tree builds. The problems were * wrong location of Makefile.version-CML * lots of omissions of "$?" in favor of actual file names in Makefiles * wrong dependencies in pam/Makefile.in The latter now point to TOP_INCDIR. Still, ktc.c could not be built from src/pam (buildtree), as include "..." would not work on generated headers. Therefore, it uses include <...> where appropriate now. Reviewed-on: http://gerrit.openafs.org/http://gerrit.openafs.org/155 Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simplify fstrace message catalog and support non-dest installation fstrace was searching for its message catalog first through the normal NLS message catalog search paths and then falling back on the client configuration directory. This, however, is neither a traditional message catalog for internationalization nor is it a configuration file. Instead, search for the message catalog only in a C directory under AFSDIR_CLIENT_DATA_DIRPATH, which is for architecture-independent data, and simplify the code. Now that we have a standard location for the message catalog, install it with make install as well as make dest. Reviewed-on: http://gerrit.openafs.org/92 Verified-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementia.org>
darwin-install-fstrace-catalog-20071015 fstrace needs the message catalog to be useful. install it.
death-to-longc-procs-20060804 longc_procs.h was only used on Ultrix, about which we no longer care. Delete it, its installation rules, and the places where we were including it.