commit 922c2ee4f8f0ce0e53aac1f74ccc025a0b368a89
parent 13280533ede11fd6bd137cfbc610d2334976b02e
Author: Kyle Milz <kyle@0x30.net>
Date: Tue, 19 Sep 2017 01:22:32 -0600
remove configure script + merge with Jam
Diffstat:
M | Jamfile | | | 21 | +++++++++++++++++++++ |
A | Jamrules | | | 88 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
D | Jamrules.extra | | | 24 | ------------------------ |
D | configure | | | 102 | ------------------------------------------------------------------------------- |
4 files changed, 109 insertions(+), 126 deletions(-)
diff --git a/Jamfile b/Jamfile
@@ -5,6 +5,27 @@ SubInclude TOP lib ;
SubInclude TOP man ;
SubInclude TOP share citrun ;
+actions PkgConfig
+{
+ set -e
+ type pkg-config
+ echo
+
+ gl_pkgs="osmesa glfw3 glew freetype2"
+ for pkg in $gl_pkgs; do
+ echo -n "$pkg = "
+ pkg-config --modversion $pkg || echo "NOT FOUND"
+ done
+}
+
+actions C++11
+{
+ $(C++) -x c++ -std=c++11 -E - < /dev/null > /dev/null
+}
+
+C++11 check_dependencies ;
+PkgConfig check_dependencies ;
+
#
# Run clang static analysis on the build.
#
diff --git a/Jamrules b/Jamrules
@@ -0,0 +1,88 @@
+echo ░█▀▀░░░▀█▀░▀█▀░░░█▀▄░█░█░█▀█ ;
+echo ░█░░░░░░█░░░█░░░░█▀▄░█░█░█░█ ;
+echo ░▀▀▀░░░▀▀▀░░▀░░░░▀░▀░▀▀▀░▀░▀ ;
+echo ;
+
+PREFIX ?= `pwd` ;
+CC = clang ;
+C++ = clang++ ;
+
+echo PREFIX \= $(PREFIX) ;
+echo CC \= $(CC) ;
+echo C++ \= $(C++) ;
+echo CFLAGS \= $(CFLAGS) ;
+echo ;
+
+if $(OS) = "OPENBSD" {
+ echo "Good to go soldier." ;
+}
+else if $(OS) = "Darwin" {
+ GL_EXTRALIB = "-framework OpenGL" ;
+}
+else if $(OS) = "Linux" {
+ INST_EXTRALIB = "-lbsd" ;
+ GL_EXTRALIB = "-lbsd" ;
+}
+else {
+ echo "WARNING: Platform '$(OS)' untested, compilation may fail." ;
+ echo "WARNING: Run `jam check_dependencies` first." ;
+ echo ;
+}
+
+CCFLAGS += $(CFLAGS) -Wall -W -Wcast-qual
+ -Wwrite-strings ;
+
+C++FLAGS += $(CFLAGS) -Wall -W -Wcast-qual
+ -std=c++11
+ -fno-exceptions
+ -fno-rtti
+ -Wno-unused-parameter
+ -Werror=date-time
+ -fvisibility-inlines-hidden
+ -Wdelete-non-virtual-dtor ;
+
+LINKFLAGS += $(LDFLAGS) ;
+
+GL_CFLAGS = `pkg-config --cflags glfw3 glew freetype2` ;
+GL_LIBS = $(GL_EXTRALIB) `pkg-config --libs glfw3 glew freetype2` ;
+GLTEST_LIBS = `pkg-config --libs osmesa` ;
+
+INST_CFLAGS = `llvm-config --cxxflags` ;
+INST_LDFLAGS = -nopie ;
+
+INST_LIBS =
+ `llvm-config --ldflags`
+ $(INST_EXTRALIB)
+ -lclangTooling
+ -lclangFrontendTool
+ -lclangFrontend
+ -lclangDriver
+ -lclangSerialization
+ -lclangCodeGen
+ -lclangParse
+ -lclangSema
+ -lclangAnalysis
+ -lclangRewrite
+ -lclangRewriteFrontend
+ -lclangEdit
+ -lclangAST
+ -lclangLex
+ -lclangBasic
+ `llvm-config --system-libs --libs bitreader mcparser transformutils option`
+ ;
+
+# Quote an entire file and add a variable declaration prefixing the string.
+rule Stringize
+{
+ MakeLocate $(1) : $(LOCATE_SOURCE) ;
+ SEARCH on $(2) = $(SEARCH_SOURCE) ;
+ Depends $(1) : $(2) ;
+ Clean clean : $(1) ;
+}
+
+actions Stringize
+{
+ > $(<) echo "static const char *$(1:B) = R\"("
+ >> $(<) cat $(>)
+ >> $(<) echo ")\";"
+}
diff --git a/Jamrules.extra b/Jamrules.extra
@@ -1,24 +0,0 @@
-# Quote an entire file and add a variable declaration prefixing the string.
-rule Stringize
-{
- MakeLocate $(1) : $(LOCATE_SOURCE) ;
- SEARCH on $(2) = $(SEARCH_SOURCE) ;
- Depends $(1) : $(2) ;
- Clean clean : $(1) ;
-}
-
-if $(NT) {
- actions Stringize
- {
- > $(<) echo static const char *$(1:B) = R"(
- >> $(<) type $(>)
- >> $(<) echo )";
- }
-} else {
- actions Stringize
- {
- > $(<) echo "static const char *$(1:B) = R\"("
- >> $(<) cat $(>)
- >> $(<) echo ")\";"
- }
-}
diff --git a/configure b/configure
@@ -1,102 +0,0 @@
-#!/bin/sh -eu
-#
-# Checks that a bunch of crap is installed, creates Jamrules file.
-#
-echo ░█▀▀░░░▀█▀░▀█▀░░░█▀▄░█░█░█▀█
-echo ░█░░░░░░█░░░█░░░░█▀▄░█░█░█░█
-echo ░▀▀▀░░░▀▀▀░░▀░░░░▀░▀░▀▀▀░▀░▀
-echo Configuring...
-echo
-
-# These binaries are assumed throughout so make sure they are available.
-type pkg-config jam
-echo
-
-# Operating system specific variables.
-uname=`uname`
-if [ $uname = OpenBSD ]; then
- CXX=${CXX-eg++}
- LLVM_INCLUDES='-I/usr/local/include'
- #LLVM_INCLUDES='-I/usr/src/gnu/llvm/tools/clang/include
- #-I/usr/src/gnu/llvm/include
- #-I/usr/src/gnu/usr.bin/clang/include
- #-I/usr/obj/gnu/usr.bin/clang/include'
-elif [ $uname = Darwin ]; then
- GL_EXTRALIB="-framework OpenGL"
-elif [ $uname = Linux ]; then
- GL_EXTRALIB="-lbsd"
- INST_EXTRALIB="-lbsd"
-else
- echo WARNING: Platform $uname not tested. Compilation may fail.
- echo
-fi
-
-# C++11 required.
-${CXX-c++} -x c++ -std=c++11 -E - < /dev/null > /dev/null
-
-# citrun_gltest needs osmesa and both it and citrun_gl need the rest.
-gl_pkgs="osmesa glfw3 glew freetype2"
-for pkg in $gl_pkgs; do
- printf "%10s = " $pkg
- pkg-config --modversion $pkg || (echo "not found" && exit 1)
-done
-echo
-
-# Write Jamrules. Any errors inside backticks get ignored.
-cat <<EOF > Jamrules
-PREFIX ?= `pwd` ;
-CC = ${CC-cc} ;
-C++ = ${CXX-c++} ;
-
-CCFLAGS += ${CFLAGS-} -Wall -W -Wcast-qual
- -Wwrite-strings ;
-C++FLAGS += ${CFLAGS-} -Wall -W -Wcast-qual
- -std=c++11
- -fno-exceptions
- -fno-rtti
- -Wno-unused-parameter
- -Werror=date-time
- -fvisibility-inlines-hidden
- -Wdelete-non-virtual-dtor ;
-LINKFLAGS += ${LDFLAGS-} ;
-
-GL_CFLAGS = `pkg-config --cflags glfw3 glew freetype2` ;
-GL_LIBS = ${GL_EXTRALIB-} `pkg-config --libs glfw3 glew freetype2` ;
-GLTEST_LIBS = `pkg-config --libs osmesa` ;
-
-INST_CFLAGS = ${LLVM_INCLUDES-}
- -Wno-comment
- -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS ;
-INST_LDFLAGS = -nopie ;
-INST_LIBS = ${INST_EXTRALIB-}
- -lcurses
- -lpthread
- -lz
- -lm
- -lclangFrontendTool
- -lclangFrontend
- -lclangSerialization
- -lclangDriver
- -lclangTooling
- -lclangParse
- -lclangSema
- -lclangAnalysis
- -lclangRewriteFrontend
- -lclangRewrite
- -lclangEdit
- -lclangAST
- -lclangLex
- -lclangBasic
- -lLLVMOption
- -lLLVMTransformUtils
- -lLLVMAnalysis
- -lLLVMProfileData
- -lLLVMMCParser
- -lLLVMMC
- -lLLVMBitReader
- -lLLVMCore
- -lLLVMSupport
- ;
-EOF
-
-cat Jamrules.extra >> Jamrules