summaryrefslogtreecommitdiff
path: root/libcult/build
diff options
context:
space:
mode:
authorJörg Frings-Fürst <jff@merkur>2014-05-18 16:08:14 +0200
committerJörg Frings-Fürst <jff@merkur>2014-05-18 16:08:14 +0200
commita15cf65c44d5c224169c32ef5495b68c758134b7 (patch)
tree3419f58fc8e1b315ba8171910ee044c5d467c162 /libcult/build
Imported Upstream version 3.3.0.2upstream/3.3.0.2
Diffstat (limited to 'libcult/build')
-rw-r--r--libcult/build/bootstrap.make46
-rw-r--r--libcult/build/configuration-dynamic.make3
-rw-r--r--libcult/build/configuration-rules.make18
-rw-r--r--libcult/build/configuration.make28
-rwxr-xr-xlibcult/build/configure47
-rw-r--r--libcult/build/cxx/configuration-dynamic.make14
-rw-r--r--libcult/build/cxx/gnu/configuration-dynamic.make8
-rw-r--r--libcult/build/export/libcult/stub.make10
l---------libcult/build/import/libcult/LICENSE1
-rw-r--r--libcult/build/import/libcult/configuration-rules.make15
-rwxr-xr-xlibcult/build/import/libcult/configure55
-rw-r--r--libcult/build/import/libcult/stub.make30
-rw-r--r--libcult/build/ld/configuration-lib-dynamic.make13
13 files changed, 288 insertions, 0 deletions
diff --git a/libcult/build/bootstrap.make b/libcult/build/bootstrap.make
new file mode 100644
index 0000000..fc9cd38
--- /dev/null
+++ b/libcult/build/bootstrap.make
@@ -0,0 +1,46 @@
+# file : build/bootstrap.make
+# author : Boris Kolpackov <boris@kolpackov.net>
+# copyright : Copyright (c) 2005-2010 Boris Kolpackov
+# license : GNU GPL v2; see accompanying LICENSE file
+
+project_name := libcult
+
+# First try to include the bundled bootstrap.make if it exist. If that
+# fails, let make search for the external bootstrap.make.
+#
+build := build-0.3
+
+-include $(dir $(lastword $(MAKEFILE_LIST)))../../$(build)/bootstrap.make
+
+ifeq ($(patsubst %build/bootstrap.make,,$(lastword $(MAKEFILE_LIST))),)
+include $(build)/bootstrap.make
+endif
+
+# Aliases
+#
+.PHONY: $(out_base)/ \
+ $(out_base)/.test \
+ $(out_base)/.clean
+
+ifdef %interactive%
+
+.PHONY: test clean
+
+test: $(out_base)/.test
+clean: $(out_base)/.clean
+
+ifneq ($(filter $(.DEFAULT_GOAL),test clean),)
+.DEFAULT_GOAL :=
+endif
+
+endif
+
+# Don't include dependency info for certain targets.
+#
+define include-dep
+$(call -include,$1)
+endef
+
+ifneq ($(filter $(MAKECMDGOALS),clean cleandoc disfigure),)
+include-dep =
+endif
diff --git a/libcult/build/configuration-dynamic.make b/libcult/build/configuration-dynamic.make
new file mode 100644
index 0000000..e027b0b
--- /dev/null
+++ b/libcult/build/configuration-dynamic.make
@@ -0,0 +1,3 @@
+cult_dr := n
+cult_threads := n
+cult_network := n
diff --git a/libcult/build/configuration-rules.make b/libcult/build/configuration-rules.make
new file mode 100644
index 0000000..e6df883
--- /dev/null
+++ b/libcult/build/configuration-rules.make
@@ -0,0 +1,18 @@
+# file : build/configuration-rules.make
+# author : Boris Kolpackov <boris@kolpackov.net>
+# copyright : Copyright (c) 2006-2010 Boris Kolpackov
+# license : GNU GPL v2; see accompanying LICENSE file
+
+$(dcf_root)/configuration-dynamic.make: | $(dcf_root)/.
+ $(call message,,$(scf_root)/configure $@)
+
+ifndef %foreign%
+
+disfigure::
+ $(call message,rm $$1,rm -f $$1,$(dcf_root)/configuration-dynamic.make)
+
+endif
+
+ifeq ($(.DEFAULT_GOAL),$(dcf_root)/configuration-dynamic.make)
+.DEFAULT_GOAL :=
+endif
diff --git a/libcult/build/configuration.make b/libcult/build/configuration.make
new file mode 100644
index 0000000..b8724c8
--- /dev/null
+++ b/libcult/build/configuration.make
@@ -0,0 +1,28 @@
+# file : build/configuration.make
+# author : Boris Kolpackov <boris@kolpackov.net>
+# copyright : Copyright (c) 2006-2010 Boris Kolpackov
+# license : GNU GPL v2; see accompanying LICENSE file
+
+$(call include-once,$(scf_root)/configuration-rules.make,$(dcf_root))
+
+
+# Dynamic configuration.
+#
+cult_dr :=
+cult_threads :=
+cult_network :=
+
+
+$(call -include,$(dcf_root)/configuration-dynamic.make)
+
+ifdef cult_dr
+
+$(out_root)/%: cult_threads := $(cult_threads)
+$(out_root)/%: cult_network := $(cult_network)
+$(out_root)/%: cult_dr := $(cult_dr)
+
+else
+
+.NOTPARALLEL:
+
+endif
diff --git a/libcult/build/configure b/libcult/build/configure
new file mode 100755
index 0000000..4473653
--- /dev/null
+++ b/libcult/build/configure
@@ -0,0 +1,47 @@
+#! /usr/bin/env bash
+
+# file : build/configure
+# author : Boris Kolpackov <boris@kolpackov.net>
+# copyright : Copyright (c) 2006-2010 Boris Kolpackov
+# license : GNU GPL v2; see accompanying LICENSE file
+
+# $1 out file
+#
+# bld_root - build root
+# project_name - project name
+#
+
+source $bld_root/dialog.bash
+
+
+$echo
+$echo
+$echo "configuring '$project_name'"
+$echo
+$echo
+
+
+$echo
+$echo "Would you like to build a multi-threaded version of '$project_name'?"
+$echo
+
+threads=`read_y_n y`
+
+
+$echo
+$echo "Would you like to build the network subsystem of '$project_name'?"
+$echo
+
+network=`read_y_n y`
+
+
+$echo
+$echo "Would you like to build the data representation subsystem of '$project_name'?"
+$echo
+
+dr=`read_y_n y`
+
+
+echo "cult_dr := $dr" >$1
+echo "cult_threads := $threads" >>$1
+echo "cult_network := $network" >>$1
diff --git a/libcult/build/cxx/configuration-dynamic.make b/libcult/build/cxx/configuration-dynamic.make
new file mode 100644
index 0000000..568ab40
--- /dev/null
+++ b/libcult/build/cxx/configuration-dynamic.make
@@ -0,0 +1,14 @@
+cxx_id := gnu
+cxx_optimize := n
+cxx_debug := n
+cxx_rpath := n
+cxx_pp_extra_options := $(CPPFLAGS)
+cxx_extra_options := $(CXXFLAGS)
+cxx_ld_extra_options := $(LDFLAGS)
+cxx_extra_libs := $(LIBS)
+
+r := $(shell echo $(LDFLAGS) | sed -e 's/-L *\([^ ]*\)/-L\1/g')
+r := $(patsubst -L%,%,$(filter -L%,$(r)))
+r := $(shell echo $(r) | sed -e 's/ /:/g')
+
+cxx_extra_lib_paths := $(r)
diff --git a/libcult/build/cxx/gnu/configuration-dynamic.make b/libcult/build/cxx/gnu/configuration-dynamic.make
new file mode 100644
index 0000000..f3fe64d
--- /dev/null
+++ b/libcult/build/cxx/gnu/configuration-dynamic.make
@@ -0,0 +1,8 @@
+ifneq ($(CXX),)
+cxx_gnu := $(CXX)
+else
+cxx_gnu := g++
+endif
+
+cxx_gnu_libraries :=
+cxx_gnu_optimization_options :=
diff --git a/libcult/build/export/libcult/stub.make b/libcult/build/export/libcult/stub.make
new file mode 100644
index 0000000..354b083
--- /dev/null
+++ b/libcult/build/export/libcult/stub.make
@@ -0,0 +1,10 @@
+# file : build/export/libcult/stub.make
+# author : Boris Kolpackov <boris@kolpackov.net>
+# copyright : Copyright (c) 2005-2010 Boris Kolpackov
+# license : GNU GPL v2; see accompanying LICENSE file
+
+$(call include-once,$(src_root)/cult/makefile,$(out_root))
+
+$(call export,\
+ l: $(out_root)/cult/cult.l,\
+ cpp-options: $(out_root)/cult/cult.l.cpp-options)
diff --git a/libcult/build/import/libcult/LICENSE b/libcult/build/import/libcult/LICENSE
new file mode 120000
index 0000000..5853aae
--- /dev/null
+++ b/libcult/build/import/libcult/LICENSE
@@ -0,0 +1 @@
+../../../LICENSE \ No newline at end of file
diff --git a/libcult/build/import/libcult/configuration-rules.make b/libcult/build/import/libcult/configuration-rules.make
new file mode 100644
index 0000000..5d8c939
--- /dev/null
+++ b/libcult/build/import/libcult/configuration-rules.make
@@ -0,0 +1,15 @@
+# file : build/import/libcult/configuration-rules.make
+# author : Boris Kolpackov <boris@kolpackov.net>
+# copyright : Copyright (c) 2005-2010 Boris Kolpackov
+# license : GNU GPL v2; see accompanying LICENSE file
+
+$(dcf_root)/import/libcult/configuration-dynamic.make: | $(dcf_root)/import/libcult/.
+ $(call message,,$(scf_root)/import/libcult/configure $@)
+
+ifndef %foreign%
+
+disfigure::
+ $(call message,rm $(dcf_root)/import/libcult/configuration-dynamic.make,\
+rm -f $(dcf_root)/import/libcult/configuration-dynamic.make)
+
+endif
diff --git a/libcult/build/import/libcult/configure b/libcult/build/import/libcult/configure
new file mode 100755
index 0000000..0eb142f
--- /dev/null
+++ b/libcult/build/import/libcult/configure
@@ -0,0 +1,55 @@
+#! /usr/bin/env bash
+
+# file : build/import/libcult/configure
+# author : Boris Kolpackov <boris@kolpackov.net>
+# copyright : Copyright (c) 2005-2010 Boris Kolpackov
+# license : GNU GPL v2; see accompanying LICENSE file
+
+
+# $1 - out file
+#
+# bld_root - build root
+# project_name - project name
+#
+
+source $bld_root/dialog.bash
+
+
+$echo
+$echo "Configuring external dependency on 'libcult' for '$project_name'."
+$echo
+
+$echo
+$echo "Would you like to configure dependency on the installed "
+$echo "version of 'libcult' as opposed to the development build?"
+$echo
+
+installed=`read_y_n y`
+
+path=
+
+if [ "$installed" = "n" ]; then
+
+$echo
+$echo "Please enter the src_root for 'libcult'."
+$echo
+
+src_root=`read_path --directory --exist`
+
+$echo
+$echo "Please enter the out_root for 'libcult'."
+$echo
+
+out_root=`read_path --directory $src_root`
+
+fi
+
+echo libcult_installed := $installed >$1
+
+if [ "$installed" = "n" ]; then
+
+echo src_root := $src_root >>$1
+echo scf_root := \$\(src_root\)/build >>$1
+echo out_root := $out_root >>$1
+
+fi
diff --git a/libcult/build/import/libcult/stub.make b/libcult/build/import/libcult/stub.make
new file mode 100644
index 0000000..7469300
--- /dev/null
+++ b/libcult/build/import/libcult/stub.make
@@ -0,0 +1,30 @@
+# file : build/import/libcult/stub.make
+# author : Boris Kolpackov <boris@kolpackov.net>
+# copyright : Copyright (c) 2005-2010 Boris Kolpackov
+# license : GNU GPL v2; see accompanying LICENSE file
+
+$(call include-once,$(scf_root)/import/libcult/configuration-rules.make,$(dcf_root))
+
+libcult_installed :=
+
+$(call -include,$(dcf_root)/import/libcult/configuration-dynamic.make)
+
+ifdef libcult_installed
+
+ifeq ($(libcult_installed),y)
+
+$(call export,l: -lcult,cpp-options: )
+
+else
+
+# Include export stub.
+#
+$(call include,$(scf_root)/export/libcult/stub.make)
+
+endif
+
+else
+
+.NOTPARALLEL:
+
+endif
diff --git a/libcult/build/ld/configuration-lib-dynamic.make b/libcult/build/ld/configuration-lib-dynamic.make
new file mode 100644
index 0000000..74c8885
--- /dev/null
+++ b/libcult/build/ld/configuration-lib-dynamic.make
@@ -0,0 +1,13 @@
+ld_lib_type := archive
+
+ifneq ($(AR),)
+ld_lib_ar := $(AR)
+else
+ld_lib_ar := ar
+endif
+
+ifneq ($(RANLIB),)
+ld_lib_ranlib := $(RANLIB)
+else
+ld_lib_ranlib := ranlib
+endif