Normalize names of libtool convenience libraries Part of why libtool was introduced into the tree was to reduce the number of times each source file is compiled. PIC code is needed for shared objects, and non-PIC code for static libraries, so in most cases a C file must be compiled twice, but not more than that. Libtool automatically manages which version of an object is passed to the linker when libtool is used to link .la files. At several places in the tree (libafsrpc, libafsauthent, libuafs_pic.so, and pam_afs.so) we use libtool to link a .la library and pass other .la libraries in as linker inputs. In normal situations, libtool would produce an output shared library that registered a shared library dependency on the (shared version of the) input library. However, in our usage, these input .la libraries are used only for our convenience, and are not intended to be installed, so libtool would produce an output library that was not usable. Libtool refers to our usage of libraries not intended to be installed as "convenience libraries"; for us, they are essentially just static archives that contain PIC objects (as opposed to normal static archives which contain non-PIC objects). Prior to this commit, we had named our convenience libraries things like libafsauthent_auth.la or libafsrpc_comerr.la, since they were mostly only used for either libafsrpc or libafsauthent. However, future commits will need to use some of these convenience libraries in other shared objects (such as pam_afs.so), so we normalize the library name to indicate merely that it is a PIC version of that module. There are three exceptions to this rule: libafsrpc_sys.la, which contains only a single file and not the whole of the sys module, libafsrpc_util.la, which contains a subset of the util objects, and libauthent_ubik.la, which contains a subset of the ubik objects. Since these convenience libraries are in fact tailored to the particular application, a target-specific name is appropriate. The convenience library provided by the ptserver module is named libprot_pic to match the existing public interface libprot.a. We cannot link the dependencies of the convenience libraries directly into them, because any given object may only be linked once into a given library, and our dependency graph between modules is decidedly not a tree, so attempting to link in the dependencies would result in duplicate symbol errors. Change-Id: I5f10af74b8582edd51e5f1b3f0026dbc7ef9f7ad Reviewed-on: http://gerrit.openafs.org/11459 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: D Brashear <shadow@your-file-system.com>
Split up libtool support into LWP and pthread Currently, the type of library you build is determined by whether the library is build in a pthread, or an lwp build directory. However, this prevents building an LWP library in a directory that builds pthreaded clients and servers. As we want to continue to provide LWP libraries for backwards compatibility, but move over to pthreaded binaries, this causes some issues. So, split up the libtool logic, so we have Makefile.libtool, which you include if you want to build a pthreaded libtool library, and Makefile.lwptool, for building a library which supports LWP and pthreaded use. These only affect how .lo files are built - so the .o files used for non-library objects are managed with the Makefile.pthread and Makefile.lwp includes as before. Change-Id: Ib1af48342253230abab9056eb15a3f79bd77a6de Reviewed-on: http://gerrit.openafs.org/8126 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
libafsrpc: Assemble with libtool Use libtool to assemble the libafsrpc shared and static libraries from objects built with libtool in each of the directories that contribute to the library (fsint, rx, rxkad, comerr, util, rxstat, sys and lwp). Each source directory controls which objects are built into the shared library by making a libafsrpc_<dir> libtool convenience directory. These convenience directories are then merged together to produce the libafsrpc library. Change-Id: I330aeb8df4c237b408a298826363eea7357339ce Reviewed-on: http://gerrit.openafs.org/8072 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Remove redundant header includes Remove includes of system headers where roken.h already takes care of including them. This simplifies the source tree, reduces the amount of work done by the compiler, and ensures that all of our headers are included with the correct guards The list of files to edit was generated with the following script: list=`grep include external/heimdal/roken/roken.h.in \ | sed -e's/#include//g' | sort | uniq`; \ for A in `find . -name *.c | xargs grep -l roken.h \ | grep -v external/ | grep -v WINNT/`; do \ found=0; \ for B in $list; do \ if grep "$B" $A > /dev/null; then \ echo "$A : $B"; \ found=1; \ fi; \ done; \ if [ $found == 1 ] ; then mvim -f $A; fi; \ done Change-Id: I2edbda550a129709b1dc6860b17d6a8a7509af58 Reviewed-on: http://gerrit.openafs.org/5815 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com> Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementix.org>
Windows: remove install9x rules Change-Id: I293f982d0f1466fd9bf213db055eedafc3c79977 Reviewed-on: http://gerrit.openafs.org/6712 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com> Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
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>
libroken: Build on windows A minimal change set to get libroken to build on Windows. Sadly, libroken contains definitions for a number of platform compatibility macros which were previously scattered throughout the windows code. These scattered macros have to be removed in order to build libroken. The impact of this removal is that a very large number of files throughout the tree require the addition of "roken.h" to pick up the new compatibility code. The bulk of this change is adding these includes. In addition, some of the added includes add roken dependencies to the Unix build. So, also add libroken to the build rules in affected Unix Makefiles. Change-Id: Ifba431bd37e67b1e273fbc6f69b805a232193456 Reviewed-on: http://gerrit.openafs.org/3205 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>
death to trailing whitespace if we're gonna clean up... Change-Id: I5ab03f29468577b62dacab41a67eadfd8c43f812 Reviewed-on: http://gerrit.openafs.org/2463 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>
Always include afsconfig.h Our coding standards say that OpenAFS source files should always have #include <afsconfig.h> #include <afs/param.h> at the start of the file. Including just param.h, or having these includes in a different order can produce unexpected effects, because param.h includes sysnames.h, which in turn includes stds.h, which may rely upon having the results of configure tests available. Fix the obvious places in the Unix build which get this wrong. Change-Id: I081f04dab30a6bbb49fe71d3ac2d7c11e231e2f5 Reviewed-on: http://gerrit.openafs.org/1912 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Tidy up UKERNEL includes UKERNEL is just another userspace build - there's no need to maintain completely separate header file lists in each object file for "userspace" and "ukernel". Tidy this up to improve the readability of these sections of code. Change-Id: I69f476a0b8aae1204cd4207c7c656ec7e07184df Reviewed-on: http://gerrit.openafs.org/1758 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Make rxgen emit prototype for ExecuteRequest Make rxgen provide a prototype in its header file for _ExecuteRequest, and remove all of the adhoc prototypes from the tree. Reviewed-on: http://gerrit.openafs.org/247 Tested-by: Jeffrey Altman <jaltman@openafs.org> Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Remove the RCSID macro The move to git means that we can no longer populate the RCSID macro in the way that it was used with CVS. This patch simply removes the macro from every file, except where it contains information from upstream (and it's in a comment). Reviewed-on: http://gerrit.openafs.org/14 Verified-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Derrick Brashear <shadow@dementia.org>