summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makeconf56
-rw-r--r--config.make.in1
-rw-r--r--configure.in19
3 files changed, 50 insertions, 26 deletions
diff --git a/Makeconf b/Makeconf
index aaafbb20..d29698e5 100644
--- a/Makeconf
+++ b/Makeconf
@@ -97,7 +97,7 @@ ifeq ($(makemode),server)
doinst := one
installationdir := $(hurddir)
clean := yes
- cleantarg := $(target)
+ linktarg := $(target)
endif
ifeq ($(makemode),utility)
@@ -106,14 +106,14 @@ ifeq ($(makemode),utility)
installationdir := $(bindir)
endif
clean := yes
- cleantarg := $(target)
+ linktarg := $(target)
endif
ifeq ($(makemode),servers)
doinst := many
installationdir := $(hurddir)
clean := yes
- cleantarg := $(targets)
+ linktarg := $(targets)
endif
ifeq ($(makemode),utilities)
@@ -122,7 +122,7 @@ ifeq ($(makemode),utilities)
installationdir := $(bindir)
endif
clean := yes
- cleantarg := $(targets)
+ linktarg := $(targets)
endif
ifeq ($(makemode),library)
@@ -145,12 +145,15 @@ ifeq ($(makemode),library)
targets := $(libname).a $(libname).so $(libname)_pic.a $(libname)_p.a
endif
endif
+else
+ linktarg := $(linktarg) $(linktarg:=.static)
endif
-ifeq ($(linktarg),)
- linktarg:=$(cleantarg)
+ifeq ($(cleantarg),)
+ cleantarg := $(linktarg)
endif
+
# This is a hack to give all hurd utilities a default bug-reporting
# address (defined in libhurdbugaddr/bugaddr.c).
BUGADDR = $(..)libhurdbugaddr/libhurdbugaddr.a
@@ -172,19 +175,15 @@ endif
endif
# Installation
-ifeq ($(doinst),one)
-all: $(target)
-install: $(installationdir) $(installationdir)/$(target)
-$(installationdir)/$(target): $(target)
- $(INSTALL_PROGRAM) $(INSTALL-$<-ops) $< $@
-endif
-
-ifeq ($(doinst),many)
-all: $(targets)
-install: $(installationdir) $(addprefix $(installationdir)/,$(targets))
-$(addprefix $(installationdir)/,$(targets)): $(installationdir)/%: %
+ifndef targets
+targets = $(target)
+endif
+installable := $(sort $(linktarg) $(targets))
+install-targets := $(targets) $(filter $(build-static:=.static),$(linktarg))
+all: $(install-targets)
+install: $(installationdir) $(addprefix $(installationdir)/,$(install-targets))
+$(addprefix $(installationdir)/,$(installable)): $(installationdir)/%: %
$(INSTALL_PROGRAM) $(INSTALL-$<-ops) $< $@
-endif
ifeq ($(makemode),library)
all: libs
@@ -240,7 +239,7 @@ ifeq ($(doinst),many)
endif
ifeq ($(doinst),one)
-$(target): $(OBJS) $(OTHERLIBS) $(library_deps)
+$(target) $(target).static: $(OBJS) $(OTHERLIBS) $(library_deps)
endif
# Determine which sort of library we should link against from whether -static
@@ -262,11 +261,22 @@ rpath := -Wl,-rpath-link=.:$(subst $. ,:,$(dir $(wildcard ../lib*/lib*.so)))
# (prof-depend is a special kind of run not normally used; see the rules
# below for %.prof_d which uses it.)
ifeq ($(prof-depend),)
+
+define link-executable
+$(CC) $(rpath) $(CFLAGS) $($*-CFLAGS) $(LDFLAGS) $($*-LDFLAGS) \
+ $(BUGADDR_REF) \
+ -o $@
+endef
$(target): %$(target-suffix): $(BUGADDR)
- $(CC) $(rpath) $(CFLAGS) $($*-CFLAGS) $(LDFLAGS) $($*-LDFLAGS) $(BUGADDR_REF) \
- -o $@ \
- '-Wl,-(' $(filter %.o,$^) \
- $(foreach lib,$(filter-out %.o,$+),${_libsubst}) $($*-LDLIBS) $(LDLIBS) \
+ $(link-executable) \
+ $(filter %.o,$^) \
+ '-Wl,-(' $(foreach lib,$(filter-out %.o,$^),${_libsubst}) \
+ $($*-LDLIBS) $(LDLIBS) \
+ '-Wl,-)'
+
+$(addsuffix .static,$(target)): %$(target-suffix).static: $(BUGADDR)
+ $(link-executable) -static \
+ '-Wl,-(' $(patsubst %.so,%.a,$^) $($*-LDLIBS) $(LDLIBS) \
'-Wl,-)'
endif
diff --git a/config.make.in b/config.make.in
index 6ac85f9e..c9371150 100644
--- a/config.make.in
+++ b/config.make.in
@@ -6,6 +6,7 @@ asm_syntax = @asm_syntax@
# Build options.
build-profiled = @enable_profile@
+build-static = @enable_static_progs@
# Prefix prepended to names of machine-independent installed files.
prefix = @prefix@
diff --git a/configure.in b/configure.in
index f291b665..91420edc 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_REVISION([$Id: configure.in,v 1.15 1999/01/27 20:48:21 roland Exp $])
+AC_REVISION([$Id: configure.in,v 1.16 1999/09/13 04:34:38 roland Exp $])
AC_PREREQ(2.12) dnl Minimum Autoconf version required.
AC_INIT(hurd/hurd_types.h) dnl A distinctive file to look for in srcdir.
@@ -26,10 +26,23 @@ esac
AC_SUBST(asm_syntax)
AC_ARG_ENABLE(profile,
-[ --disable-profile do not build profiled libraries and programs],,
- enable_profile=yes)
+[ --disable-profile do not build profiled libraries and programs])
AC_SUBST(enable_profile)
+define([default_static],['ext2fs,ufs'])dnl
+AC_ARG_ENABLE(static-progs,
+[ --enable-static-progs=PROGRAMS...
+ build statically-linked PROGRAM.static versions
+ of (only) the listed programs ]dnl
+changequote(',')[default_static]changequote([,]))
+case "$enable_static_progs" in
+'no') enable_static_progs= ;; # we got --disable-static
+'') enable_static_progs=default_static ;;
+*) enable_static_progs=`echo "$enable_static_progs" |
+ sed 's/[[, ]][[, ]]*/ /g'` ;;
+esac
+AC_SUBST(enable_static_progs)
+
AC_PROG_INSTALL
AC_PROG_AWK