Browse Source

Build: rename EXTRA_LIBS to the more conventional LDFLAGS.

Davin McCall 6 years ago
parent
commit
8980b9be26
4 changed files with 10 additions and 9 deletions
  1. 2 1
      BUILD
  2. 3 3
      mconfig
  3. 3 3
      src/Makefile
  4. 2 2
      src/tests/Makefile

+ 2 - 1
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

+ 3 - 3
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
 

+ 3 - 3
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 $@

+ 2 - 2
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 $@