aboutsummaryrefslogtreecommitdiff
path: root/src/config
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2013-05-16 14:21:12 -0400
committerGreg Hudson <ghudson@mit.edu>2013-05-16 20:09:27 -0400
commit4b0985f8573840838bcfa8ec1df3dcd39a3dbf15 (patch)
treea9ac284b8ef9000f968cb610cc8ff79061e8293b /src/config
parent780b34cd19c0360458395e87f35550e9803a5194 (diff)
downloadkrb5-4b0985f8573840838bcfa8ec1df3dcd39a3dbf15.zip
krb5-4b0985f8573840838bcfa8ec1df3dcd39a3dbf15.tar.gz
krb5-4b0985f8573840838bcfa8ec1df3dcd39a3dbf15.tar.bz2
Reduce boilerplate in makefiles
Provide default values in pre.in for PROG_LIBPATH, PROG_RPATH, SHLIB_DIRS, SHLIB_RDIRS, and STOBJLISTS so that they don't have to be specified in the common case. Rename KRB5_RUN_ENV and KRB5_RUN_VARS to RUN_SETUP (already the most commonly used name) and RUN_VARS. Make sure to use DEFINES for local defines (not DEFS). Remove some other unnecessary makefile content.
Diffstat (limited to 'src/config')
-rw-r--r--src/config/lib.in14
-rw-r--r--src/config/libnover.in14
-rw-r--r--src/config/pre.in30
3 files changed, 26 insertions, 32 deletions
diff --git a/src/config/lib.in b/src/config/lib.in
index 26d1d5a..8dd5475 100644
--- a/src/config/lib.in
+++ b/src/config/lib.in
@@ -8,25 +8,17 @@
# LIBBASE library name without "lib" or extension
# LIBMAJOR library major version
# LIBMINOR library minor version
-# STOBJLISTS list of files, each of which is an OBJS.ST created by
-# libobj.in; *DO NOT* use ./OBJS.ST for the current
-# directory as that will cause some makes to lose.
# SHLIB_EXPDEPS list of libraries that this one has explicit
# dependencies on, pref. in the form libfoo$(SHLIBEXT)
# SHLIB_EXPLIBS list of libraries that this one has explicit
# dependencies on, in "-lfoo" form.
-# SHLIB_DIRS list of directories where $(SHLIB_EXPLIBS) can be
-# found, in the form -Ldir1 -Ldir2 ...
-# since there are very few systems where -L is the
-# wrong thing (notable exception of SunOS but we
-# deal with it...)
-# SHLIB_RDIRS rpath directories to search; given in the
-# form dir1:dir2 ...
# RELDIR path to this directory relative to $(TOPLIBD)
+#
+# Makefile.in can also override the defaults for SHLIB_DIRS,
+# SHLIB_RDIRS, and STOBJLISTS from pre.in.
LIBPREFIX=lib
-# STOBJLISTS=dir1/OBJS.ST dir2/OBJS.ST etc...
SHOBJLISTS=$(STOBJLISTS:.ST=.SH)
PFOBJLISTS=$(STOBJLISTS:.ST=.PF)
diff --git a/src/config/libnover.in b/src/config/libnover.in
index 4214aed..b55a427 100644
--- a/src/config/libnover.in
+++ b/src/config/libnover.in
@@ -7,25 +7,17 @@
# The following variables must be set in the Makefile.in:
#
# LIBBASE library name without "lib" or extension
-# STOBJLISTS list of files, each of which is an OBJS.ST created by
-# libobj.in; *DO NOT* use ./OBJS.ST for the current
-# directory as that will cause some makes to lose.
# SHLIB_EXPDEPS list of libraries that this one has explicit
# dependencies on, pref. in the form libfoo$(SHLIBEXT)
# SHLIB_EXPLIBS list of libraries that this one has explicit
# dependencies on, in "-lfoo" form.
-# SHLIB_DIRS list of directories where $(SHLIB_EXPLIBS) can be
-# found, in the form -Ldir1 -Ldir2 ...
-# since there are very few systems where -L is the
-# wrong thing (notable exception of SunOS but we
-# deal with it...)
-# SHLIB_RDIRS rpath directories to search; given in the
-# form dir1:dir2 ...
# RELDIR path to this directory relative to $(TOPLIBD)
+#
+# Makefile.in can also override the defaults for SHLIB_DIRS,
+# SHLIB_RDIRS, and STOBJLISTS from pre.in.
LIBPREFIX=
-# STOBJLISTS=dir1/OBJS.ST dir2/OBJS.ST etc...
SHOBJLISTS=$(STOBJLISTS:.ST=.SH)
PFOBJLISTS=$(STOBJLISTS:.ST=.PF)
diff --git a/src/config/pre.in b/src/config/pre.in
index bf6c93b..fbc5c11 100644
--- a/src/config/pre.in
+++ b/src/config/pre.in
@@ -275,21 +275,31 @@ EXEEXT =
# variables for libraries, for use in linking programs
# -- this may want to get broken out into a separate frag later
#
-#
-# Note: the following variables must be set in any Makefile.in that
-# uses KRB5_BUILD_PROGRAM
-#
-# PROG_LIBPATH list of dirs, in -Ldir form, to search for libraries at link
-# PROG_RPATH list of dirs, in dir1:dir2 form, for rpath purposes
-#
# invocation is like:
# prog: foo.o bar.o $(KRB5_BASE_DEPLIBS)
# $(CC_LINK) -o $@ foo.o bar.o $(KRB5_BASE_LIBS)
-
CC_LINK=@CC_LINK@
CXX_LINK=@CXX_LINK@
+# Makefile.in files which build programs can override the list of
+# directories to look for dependent libraries in (in the form -Ldir1
+# -Ldir2 ...) and also the list of rpath directories to search (in the
+# form dir1:dir2:...).
+PROG_LIBPATH=-L$(TOPLIBD)
+PROG_RPATH=$(KRB5_LIBDIR)
+
+# Library Makefile.in files can override this list of directories to
+# look for dependent libraries in (in the form -Ldir1 -Ldir2 ...) and
+# also the list of rpath directories to search (in the form
+# dir1:dir2:...)
+SHLIB_DIRS=-L$(TOPLIBD)
+SHLIB_RDIRS=$(KRB5_LIBDIR)
+
+# Multi-directory library Makefile.in files should override this list
+# of object files with the full list.
+STOBJLISTS=OBJS.ST
+
# prefix (with no spaces after) for rpath flag to cc
RPATH_FLAG=@RPATH_FLAG@
@@ -398,8 +408,8 @@ KADMCLNT_LIBS = -lkadm5clnt_mit $(KADM_COMM_LIBS)
APPUTILS_LIB = -lapputils
# So test programs can find their libraries without "make install", etc.
-KRB5_RUN_ENV=@KRB5_RUN_ENV@
-KRB5_RUN_VARS=@KRB5_RUN_VARS@
+RUN_SETUP=@KRB5_RUN_ENV@
+RUN_VARS=@KRB5_RUN_VARS@
#
# variables for --with-tcl=