Commit Graph

35 Commits

Author SHA1 Message Date
Mark Vitale
46a7ca3059 Standardize static library archive (lib*.a) options
Convert all hardcoded $(AR) options to use configuration variable
ARFLAGS.

No functional change should be incurred by this commit.

Change-Id: I3a0840e58d8996d60c119c6d5df1ab8d985ba0d8
Reviewed-on: https://gerrit.openafs.org/14896
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2024-06-28 08:17:31 -04:00
Simon Wilkinson
2b1481dae5 Build system: MT_LIBS includes XLIBS
The MT_LIBS library list already includes XLIBS, so there's no need
to specify both on a link line.

Change-Id: I8594b1b6e1a16af741b40822cbce49e846b26f49
Reviewed-on: http://gerrit.openafs.org/8904
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-01-21 17:34:06 -05:00
Michael Meffie
c01236beb5 build: separate source and header compile_et rules
Generate source and header files separately to support parallel make
without contortions.

Add a complete list of dependencies for each generated header file
to avoid build errors during parallel make.

Change-Id: I804ff553e08d411a1cfe20a4ef4e57da9d321837
Reviewed-on: http://gerrit.openafs.org/10370
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>
2014-05-28 10:25:22 -04:00
Michael Meffie
dbf68229c6 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>
2013-09-30 06:31:02 -07:00
Ben Kaduk
7af86ecffb db_dump.o depends on budb_errs.h
Add INCLS and budb_errs.h accordingly.

budb had this already, in 6fda61ba2e.

Change-Id: I5ef372e8f8b9ad270b83e158d0ce14109e0f9ef1
Reviewed-on: http://gerrit.openafs.org/9996
Reviewed-by: Jeffrey Hutzelman <jhutz@cmu.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-06-20 05:15:29 -07:00
Ben Kaduk
c981ef1761 Fix build for separate objdirs
In particular, setting UNTHREADED=${srcdir}/dir and then referring
to ${srcdir}/${UNTHREADED} is a recipe for sadness.

Fix the libtool invocation to correctly find .la.sym files in ${srcdir}.

Also add some missing header dependencies that are hidden when building
in the src tree.

Change-Id: I1b663141c549cc4b90e46327c3fb31dc80294eaa
Reviewed-on: http://gerrit.openafs.org/8891
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-07 20:28:58 -08:00
Simon Wilkinson
3c3d209a4f libafsauthent: Build with libtool
Construct the libafsauthent library with libtool. All libraries
contributing to libafsauthent provide a libauthent_<library>.la
convenience library, which we use libtool to combine into shared
and static versions of libafsauthent.

Change-Id: I76fa61eb027862eab730c4c86ab74a7b7e03c13b
Reviewed-on: http://gerrit.openafs.org/8097
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>
2012-09-12 06:48:00 -07:00
Simon Wilkinson
035a2ea4a1 ubik: Use libtool
Use libtool to build LWP and pthreaded versions of the ubik library.
Both versions are built in the src/ubik directory. src/tubik is modified
to only build pthreaded versions of the ubik test commands.

Replace use of libubik_pthread.a with the libtool generated library.

Change-Id: Id441fe00dbe801e38a108600bfbe06c292383872
Reviewed-on: http://gerrit.openafs.org/8090
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-09-11 14:41:37 -07:00
Simon Wilkinson
95f2b8f928 Stop using libafsrpc
Instead of using libafsrpc.a in the pthreaded server directories,
use the libtool library variants instead.

Change-Id: I4cdbaf5a060b3e5aa82fb0d79535cb4fdc850bcf
Reviewed-on: http://gerrit.openafs.org/8074
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-09-11 09:27:37 -07:00
Simon Wilkinson
9220bd4adc Don't explicitly build and link rx_pthread.o
A number of pthreaded directories explicitly build, and link, with
rx_pthread.o, in order to be able to send RX 'dpf' debugging messages
to the server log, rather than to stderr.

However, this direct linking causes build failures on some platforms,
because we end up linking in a version of rx_pthread.o, twice and both
versions contain identical linker symbols.

As this functionality is only used for debugging, just get rid of the
additional object.

Change-Id: I6126891db2dcbc289f6a9f7b99c01d6af7a19089
Reviewed-on: http://gerrit.openafs.org/8071
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-09-09 12:45:18 -07:00
Simon Wilkinson
012b878576 util: Convert to using libtool
Create a pthreaded version of libafsutil, named liboafs_util.la,
and use this library in all of the pthreaded binaries that we build,
replacing both inclusion of libafsutil.a, and direct compliation of
pthreaded versions of the util source files.

libafsutil.a is provided for legacy LWP applications, and the
convenience library libafsutil_pic.a remains until we address the way
in which the user space cache manager is built and linked.

Change-Id: Ibdc3d6e2fe56ca6f5b882cf03991d1a2e32c62b2
Reviewed-on: http://gerrit.openafs.org/8056
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-09-08 20:27:51 -07:00
Simon Wilkinson
d36be5b8be cmd: Convert to using libtool
Convert the libcmd and libcmd_pic libaries to being built using
libtool. Historically, these have been built as LWP code, but they
have no LWP dependencies, and no LWP-specific code within them. So,
make cmd a pthread-only library.

In addition to the libtool library liboafs_cmd.la, we build the
legacy libcmd.a and libcmd_pic.a as convenience libraries. libcmd64.a
(a 64bit variant, used solely by kdump), remains built through
"normal" means.

Update pthreaded users of libcmd to use the new liboafs_cmd.la. For
now, non-pthreaded users are left alone.

Change-Id: Id8445949754d1942f6e8752ae182b4e6f86fe94f
Reviewed-on: http://gerrit.openafs.org/8055
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-09-07 11:29:14 -07:00
Simon Wilkinson
8b84d9538c opr: Convert to using libtool
Convert opr so that it uses libtool. For backwards compatibility we
still build libopr.a, but we do so as a static convenience library.

As libopr.a may, in the future, be converted to an LWP library, change
all of the pthreaded binaries so that they link against the libtool
library liboafs_opr.la

Change-Id: Icee04ff4745334f06ffba16df5bb07fc9dcc0b54
Reviewed-on: http://gerrit.openafs.org/8034
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2012-09-04 13:23:14 -07:00
Simon Wilkinson
1e76c59ea5 auth: Relocate NetRestrict support functions
Pull the NetRestrict and NetInfo support functions out of libutil,
and into libauth. This starts to concentrate all of our configuration
file parsing functions into the same place.

It also gets rid of a circular dependency. NetRestrict parsing relies
on functions from rx, so with this in libutil, we had the dependency
chain util->rx->util

Change-Id: I250d4d8264da8db61f603a06d1b7fdab44384cd3
Reviewed-on: http://gerrit.openafs.org/8027
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-31 10:39:59 -07:00
Simon Wilkinson
cac7424272 Clean up assertion
The AFS code has multiple different assertion implementations in
userspace. This patchset is the start of bringing some sanity to them.

In rx, we have osi_Assert, a user/kernel assertion macro. This is only
available to libraries which have RX dependencies

In util, we redefine the standard 'assert()' macro to provide a
cross-platform assertion solution.

Because util has an RX dependency, neither of these provide an
assertion solution for libraries which should be independent of rx.
So, pull the assertion code out of util, and put it into opr, as a new
opr_Assert() macro. Implement the userspace osi_Assert in terms of this
macro, leaving the kernel variant untouched.

Update callers to the new macro and header file names.

Change-Id: I780b30ec1ea1207daa17127df4d5fbf9a94481b6
Reviewed-on: http://gerrit.openafs.org/5394
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-09-25 21:10:11 -07:00
Simon Wilkinson
9d3d4b30af Fix broken make dest rules
Commit ffb6864f0f is missing some
semi-colons in assorted dest rules, which breaks the make dest target.

Change-Id: Ie6f88878604f1043256f1683e1d228e16d568f50
Reviewed-on: http://gerrit.openafs.org/5037
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-16 22:02:13 -07:00
Simon Wilkinson
ffb6864f0f Make --enable-pthreaded-ubik do what it claims
The configure help text for --enable-pthreded-ubik says
    "enable installation of pthreaded ubik applications"

This patch set makes the behaviour in the code match that. Instead
of controlling whether the pthreaded ubik code is compiled at all,
the configure option now just controls whether it is installed. This
means that we'll always build the pthread code, and so should reduce
the number of times it is inadvertently broken.

Change-Id: I8b2ffb46e01157f2043cf7daf68e69580ea285c5
Reviewed-on: http://gerrit.openafs.org/5028
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-15 12:28:26 -07:00
Simon Wilkinson
f56f273155 Fix pthreaded ubik dest and install rules
Fix the dest and install rules for pthreaded ubik, and its servers, so
that they match the current Makefile style.

Change-Id: Ifd3bd181772e278518f2a90167b6524d6045645c
Reviewed-on: http://gerrit.openafs.org/5027
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-15 12:27:27 -07:00
Simon Wilkinson
4c9134a995 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>
2011-06-05 06:50:52 -07:00
Simon Wilkinson
8c1f725931 afs_snprintf is dead, long live rk_snprintf
We were shipping our own implementation of snprintf and friends, as
afs_snprintf. Now that we're using roken everywhere, we can make use
of roken's rk_snprintf, and no longer need to ship our own.

As Window's snprintf isn't C99 compliant, roken always uses its own
on this platform. The effect of this is that we can no longer use
AFS_UINT64_FMT and AFS_INT64_FMT for snprintf calls (and the Log
functions that call them). Instead, we need to always use the
Unix format specifiers when calling these functions.

Make thse changes across the whole tree.

Change-Id: I3fffef97566f239ad639f15c4decd136d5bbd765
Reviewed-on: http://gerrit.openafs.org/4316
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-03-27 16:43:30 -07:00
Andrew Deason
61453d8f33 Fix budb build rules for tbudb and WINNT
Commit 0d0b5048a5 only fixed the budb
Makefile.in. Make the analagous changes to tbudb/Makefile.in and
NTMakefile.

Change-Id: I4fa00e630aafcfa9d4d41a1948f3eae750900526
Reviewed-on: http://gerrit.openafs.org/4029
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-02-21 13:36:35 -08:00
Simon Wilkinson
a9b8fd81bf Remove local crypto
This change removes all of the local crypto use in userspace, in
favour of using our shiny new afshcrypto library.

Change-Id: Iac21b42e49bac424cc28c449a31f2da44121b7e5
Reviewed-on: http://gerrit.openafs.org/2577
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-11-19 05:07:57 -08:00
Simon Wilkinson
f22ae5f7d8 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>
2010-10-11 08:00:29 -07:00
Andrew Deason
cdbf7827ef Eliminate $< outside of pattern rules
The $< variable in makefiles is not portable when used outside of
pattern rules. Replace each usage with the actual name of the file we
want.

Change-Id: Idc9309e7d7bd3b1bd93e8225507b8b53c9433d69
Reviewed-on: http://gerrit.openafs.org/2523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-05 21:15:06 -07:00
Andrew Deason
17a57cdafe tubik: Fix objdir builds
- Make netutils.c include afs/dirpath.h, so we don't have to find the
   correct include dir for "dirpath.h"

 - Fix dependencies in tvlserver, tbudb, and tptserver, and refer to
   sources in srcdir where appropriate

Change-Id: Id9c2b3eefaa9d02ccb197a61341776444b958cdc
Reviewed-on: http://gerrit.openafs.org/2521
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-05 21:14:21 -07:00
Andrew Deason
6b6535279a tbudb: Use INSTALL_PROGRAM, not INSTALL -f
"$INSTALL -f" is not portable. Use $INSTALL_PROGRAM instead.

Change-Id: I5013476cc036350b0b61b6e3c01a86d303aa70b6
Reviewed-on: http://gerrit.openafs.org/2507
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2010-08-04 05:23:08 -07:00
Simon Wilkinson
d5081f264d Remove CVS ignore files
Now we're in git we don't need any cvsignore files any more...

Reviewed-on: http://gerrit.openafs.org/1
Verified-by: Derrick Brashear <shadow@gmail.com>
Reviewed-by: Derrick Brashear <shadow@gmail.com>
2009-07-06 11:03:16 -06:00
Simon Wilkinson
c41a467741 gitignore-20090615
LICENSE IPL10

make gitignore files
2009-06-15 23:29:29 +00:00
Russ Allbery
db9f59e9be threaded-ubik-cvsignore-20080713
LICENSE BSD

Add .cvsignore patterns for threaded ubik builds.
2008-07-14 05:12:46 +00:00
Marc Dionne
bb617c649c cvsignore-updates-20080612
LICENSE IPL10
FIXES 102819

add missing things to cvsignore files
2008-06-12 21:00:12 +00:00
Derrick Brashear
ece59f688a tubik-head-makefile-compat-20080403
LICENSE IPL10

match new style install stuff
2008-04-03 17:58:11 +00:00
Derrick Brashear
bc1a7f1ee8 tubik-one-more-20080402
LICENSE IPL10

handle the rest of the issues
2008-04-03 04:54:34 +00:00
Derrick Brashear
3316136038 tubik-makefiles-fun-20080402
LICENSE IPL10

these fixes brought to you by delicious beer.
2008-04-03 02:20:25 +00:00
Derrick Brashear
ec02ff4342 tubik-makefile-fixes-20080402
LICENSE IPL10

don't use gmake macros. ick
2008-04-02 22:45:05 +00:00
Steven Jenkins
9fbbc3f50c pthreaded-ubik-20080402
LICENSE IPL10

add pthreaded ubik and various binaries
2008-04-02 20:47:27 +00:00