From 8980b9be264841eef34c6da007b64a3469c2e900 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Thu, 18 Jan 2018 22:09:21 +0000 Subject: [PATCH] Build: rename EXTRA_LIBS to the more conventional LDFLAGS. --- BUILD | 3 ++- mconfig | 6 +++--- src/Makefile | 6 +++--- src/tests/Makefile | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/BUILD b/BUILD index 7e040eb..718dec1 100644 --- a/BUILD +++ b/BUILD @@ -8,7 +8,8 @@ within. In particular: CXX : should be set to the name of the C++ compiler (and linker) CXXOPTS : are options passed to the compiler during compilation (see note for GCC below) - EXTRA_LIBS : are any extra libraries required for linking; should not normally be needed. + LDFLAGS : are any extra flags required for linking; should not normally be needed + (FreeBSD requires -lrt). Defaults for Linux and OpenBSD are provided. Note that the "eg++" or "clang++" package must be installed on OpenBSD as the default "g++" compiler is too old. Clang is part of the base diff --git a/mconfig b/mconfig index 33fe44e..4e81314 100644 --- a/mconfig +++ b/mconfig @@ -10,14 +10,14 @@ MANDIR=/usr/share/man # the new ABI. See BUILD file for more information. CXX=g++ CXXOPTS=-D_GLIBCXX_USE_CXX11_ABI=1 -std=gnu++11 -Os -Wall -fno-rtti -EXTRA_LIBS= +LDFLAGS= BUILD_SHUTDOWN=yes SANITIZEOPTS=-fsanitize=address,undefined # OpenBSD, tested with GCC 4.9.3 / Clang++ 4/5 and gmake: #CXX=clang++ #CXXOPTS=-std=gnu++11 -Os -Wall -fno-rtti -#EXTRA_LIBS= +#LDFLAGS= #BUILD_SHUTDOWN=no #SANITIZEOPTS= # (shutdown command not available for OpenBSD yet). @@ -25,7 +25,7 @@ SANITIZEOPTS=-fsanitize=address,undefined # FreeBSD: use clang++ by default, supports sanitizers, requires linking with -lrt #CXX=clang++ #CXXOPTS=-std=gnu++11 -Os -Wall -fno-rtti -#EXTRA_LIBS=-lrt +#LDFLAGS=-lrt #BUILD_SHUTDOWN=no #SANITIZEOPTS=-fsanitize=address,undefined diff --git a/src/Makefile b/src/Makefile index 203f019..412bb2e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -12,13 +12,13 @@ objects = $(dinit_objects) dinitctl.o shutdown.o all: dinit dinitctl $(SHUTDOWN) dinit: $(dinit_objects) - $(CXX) -o dinit $(dinit_objects) $(EXTRA_LIBS) + $(CXX) -o dinit $(dinit_objects) $(LDFLAGS) dinitctl: dinitctl.o - $(CXX) -o dinitctl dinitctl.o $(EXTRA_LIBS) + $(CXX) -o dinitctl dinitctl.o $(LDFLAGS) shutdown: shutdown.o - $(CXX) -o shutdown shutdown.o $(EXTRA_LIBS) + $(CXX) -o shutdown shutdown.o $(LDFLAGS) $(objects): %.o: %.cc $(CXX) $(CXXOPTS) -MMD -MP -Iincludes -Idasynq -c $< -o $@ diff --git a/src/tests/Makefile b/src/tests/Makefile index ae01b79..d2baa75 100644 --- a/src/tests/Makefile +++ b/src/tests/Makefile @@ -17,10 +17,10 @@ prepare-incdir: cd includes; ln -sf ../test-includes/*.h . tests: prepare-incdir $(parent_objs) tests.o test-dinit.o test-bpsys.o test-run-child-proc.o - $(CXX) $(SANITIZEOPTS) -o tests $(parent_objs) tests.o test-dinit.o test-bpsys.o test-run-child-proc.o $(EXTRA_LIBS) + $(CXX) $(SANITIZEOPTS) -o tests $(parent_objs) tests.o test-dinit.o test-bpsys.o test-run-child-proc.o $(LDFLAGS) proctests: prepare-incdir $(parent_objs) proctests.o test-dinit.o test-bpsys.o test-run-child-proc.o - $(CXX) $(SANITIZEOPTS) -o proctests $(parent_objs) proctests.o test-dinit.o test-bpsys.o test-run-child-proc.o $(EXTRA_LIBS) + $(CXX) $(SANITIZEOPTS) -o proctests $(parent_objs) proctests.o test-dinit.o test-bpsys.o test-run-child-proc.o $(LDFLAGS) $(objects): %.o: %.cc $(CXX) $(CXXOPTS) $(SANITIZEOPTS) -MMD -MP -Iincludes -I../dasynq -c $< -o $@ -- 2.25.1