diff options
32 files changed, 341 insertions, 0 deletions
@@ -0,0 +1,54 @@ +This archive contains pre-configured CodeSynthesis XSD/e source code +with all its dependencies (except Xerces-C++ and Boost) as well as a +build script that builds the XSD/e compiler in non-interactive mode +(that is, without asking any questions). + +The following GNU tools are required to build XSD/e. Any fairly recent +GNU/Linux distribution should have these already installed: + +GNU bash >= 2.00 (bash --version) http://www.gnu.org/software/bash/ +GNU m4 >= 1.4 (m4 --version) http://www.gnu.org/software/m4/ +GNU make >= 3.81 (make --version) http://www.gnu.org/software/make/ +GNU g++ >= 3.4.3 (g++ --version) http://gcc.gnu.org/ + +The build script expects you to have the Xerces-C++ (2.6.0 or later) +as well as Boost filesystem and regex (1.33.1 or later) libraries +built and installed in a location where the g++ compiler looks by +default (normally /usr/lib/ and /usr/local/lib/). Alternatively, you +can install them into the stage/ directory in this package or provide +include (-I) and library (-L) paths via the CPPFLAGS and LDFLAGS +variables, respectively. + +The script supports the following standard variables: + +CXX (defaults to g++ if not set) +CPPFLAGS +CXXFLAGS +LDFALGS +LIBS +MAKEFLAGS + +For example: + +$ CXX=g++-4.2 CXXFLAGS=-O3 MAKEFLAGS=-j4 ./build.sh + +If you would like to see the full compiler/linker/etc., command lines, +you can add verbose=1 to MAKEFLAGS, for example: + +MAKEFLAGS="verbose=1" ./build.sh + +After the build, the XSD/e compiler can be found in the xsde-x.y.z/xsde/ +directory. You can also create a distribution package with the XSD/e +compiler binary, source code and build system for the runtime library +and examples, as well as the documentation using the dist target, for +example: + +$ ./build.sh dist + +The distribution files are placed into the dist/xsde-x.y.z/ directory. The +build script also supports the clean target: + +$ ./build.sh clean + +Send bug reports or any other feedback to the xsde-users@codesynthesis.com +mailing list. diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..237e92e --- /dev/null +++ b/build.sh @@ -0,0 +1,108 @@ +#! /usr/bin/env bash + +trap 'exit 1' ERR + +build=build +libcult=libcult +libfe=libfrontend-elements +libbe=libbackend-elements +libxsd_fe=libxsd-frontend +xsde=xsde + +pwd=`pwd` + +MAKEFLAGS="-I$pwd/stage/include $MAKEFLAGS" + +target=$1 + +if [ "$target" = "dist" ]; then + # Since we only want to package XSD/e, we will handle + # this target at the end. + target= +fi + + +# build +# +if [ ! -d $pwd/stage/include/build-* ]; then + make -C $build install_prefix=$pwd/stage install +fi + + +# libcult +# +make $MAKEFLAGS -C $libcult/cult $target + +if [ "$target" = "clean" ]; then + rm -f $pwd/stage/include/cult + rm -f $pwd/stage/lib/libcult.a + rm -f $libcult/build/system/configuration-dynamic.make +else + if [ ! -d $pwd/stage/include/cult ]; then + ln -s ../../$libcult/cult stage/include/ + ln -s ../../$libcult/cult/libcult.a stage/lib/ + fi +fi + + +# libfrontend-elements +# +make $MAKEFLAGS -C $libfe/frontend-elements $target + +if [ "$target" = "clean" ]; then + rm -f $pwd/stage/include/frontend-elements + rm -f $pwd/stage/lib/libfrontend-elements.a +else + if [ ! -d $pwd/stage/include/frontend-elements ]; then + ln -s ../../$libfe/frontend-elements stage/include/ + ln -s ../../$libfe/frontend-elements/libfrontend-elements.a stage/lib/ + fi +fi + + +# libbackend-elements +# +make $MAKEFLAGS -C $libbe/backend-elements $target + +if [ "$target" = "clean" ]; then + rm -f $pwd/stage/include/backend-elements +else + if [ ! -d $pwd/stage/include/backend-elements ]; then + ln -s ../../$libbe/backend-elements stage/include/ + fi +fi + + +# libxsd-frontend +# +make $MAKEFLAGS -C $libxsd_fe/xsd-frontend $target + +if [ "$target" = "clean" ]; then + rm -f $pwd/stage/include/xsd-frontend + rm -f $pwd/stage/lib/libxsd-frontend.a +else + if [ ! -d $pwd/stage/include/xsd-frontend ]; then + ln -s ../../$libxsd_fe/xsd-frontend stage/include/ + ln -s ../../$libxsd_fe/xsd-frontend/libxsd-frontend.a stage/lib/ + fi +fi + + +# xsde +# +if [ "$target" = "clean" ]; then + make $MAKEFLAGS -C $xsde clean + rm -fr $pwd/dist +else + make $MAKEFLAGS -C $xsde/xsde $target +fi + +if [ "$1" = "dist" ]; then +make $MAKEFLAGS -C $xsde dist_prefix=$pwd/dist/$xsde dist +fi + +# build (clean) +# +if [ "$target" = "clean" ]; then + rm -rf $pwd/stage/include/build-* +fi diff --git a/libbackend-elements/build/cxx/configuration-dynamic.make b/libbackend-elements/build/cxx/configuration-dynamic.make new file mode 100644 index 0000000..7485fe9 --- /dev/null +++ b/libbackend-elements/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) -I$(out_root)/../stage/include +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 := $(out_root)/../stage/lib $(r) diff --git a/libbackend-elements/build/cxx/gnu/configuration-dynamic.make b/libbackend-elements/build/cxx/gnu/configuration-dynamic.make new file mode 100644 index 0000000..f3fe64d --- /dev/null +++ b/libbackend-elements/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/libbackend-elements/build/import/libboost/configuration-dynamic.make b/libbackend-elements/build/import/libboost/configuration-dynamic.make new file mode 100644 index 0000000..a33bf20 --- /dev/null +++ b/libbackend-elements/build/import/libboost/configuration-dynamic.make @@ -0,0 +1 @@ +libboost_installed := y diff --git a/libbackend-elements/build/import/libcult/configuration-dynamic.make b/libbackend-elements/build/import/libcult/configuration-dynamic.make new file mode 100644 index 0000000..78c41d3 --- /dev/null +++ b/libbackend-elements/build/import/libcult/configuration-dynamic.make @@ -0,0 +1 @@ +libcult_installed := y diff --git a/libbackend-elements/build/ld/configuration-lib-dynamic.make b/libbackend-elements/build/ld/configuration-lib-dynamic.make new file mode 100644 index 0000000..c2c560c --- /dev/null +++ b/libbackend-elements/build/ld/configuration-lib-dynamic.make @@ -0,0 +1,3 @@ +ld_lib_type := archive +ld_lib_ar := ar +ld_lib_ranlib := ranlib 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/cxx/configuration-dynamic.make b/libcult/build/cxx/configuration-dynamic.make new file mode 100644 index 0000000..7485fe9 --- /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) -I$(out_root)/../stage/include +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 := $(out_root)/../stage/lib $(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/ld/configuration-lib-dynamic.make b/libcult/build/ld/configuration-lib-dynamic.make new file mode 100644 index 0000000..c2c560c --- /dev/null +++ b/libcult/build/ld/configuration-lib-dynamic.make @@ -0,0 +1,3 @@ +ld_lib_type := archive +ld_lib_ar := ar +ld_lib_ranlib := ranlib diff --git a/libfrontend-elements/build/cxx/configuration-dynamic.make b/libfrontend-elements/build/cxx/configuration-dynamic.make new file mode 100644 index 0000000..7485fe9 --- /dev/null +++ b/libfrontend-elements/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) -I$(out_root)/../stage/include +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 := $(out_root)/../stage/lib $(r) diff --git a/libfrontend-elements/build/cxx/gnu/configuration-dynamic.make b/libfrontend-elements/build/cxx/gnu/configuration-dynamic.make new file mode 100644 index 0000000..f3fe64d --- /dev/null +++ b/libfrontend-elements/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/libfrontend-elements/build/import/libcult/configuration-dynamic.make b/libfrontend-elements/build/import/libcult/configuration-dynamic.make new file mode 100644 index 0000000..78c41d3 --- /dev/null +++ b/libfrontend-elements/build/import/libcult/configuration-dynamic.make @@ -0,0 +1 @@ +libcult_installed := y diff --git a/libfrontend-elements/build/ld/configuration-lib-dynamic.make b/libfrontend-elements/build/ld/configuration-lib-dynamic.make new file mode 100644 index 0000000..c2c560c --- /dev/null +++ b/libfrontend-elements/build/ld/configuration-lib-dynamic.make @@ -0,0 +1,3 @@ +ld_lib_type := archive +ld_lib_ar := ar +ld_lib_ranlib := ranlib diff --git a/libxsd-frontend/build/cxx/configuration-dynamic.make b/libxsd-frontend/build/cxx/configuration-dynamic.make new file mode 100644 index 0000000..7485fe9 --- /dev/null +++ b/libxsd-frontend/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) -I$(out_root)/../stage/include +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 := $(out_root)/../stage/lib $(r) diff --git a/libxsd-frontend/build/cxx/gnu/configuration-dynamic.make b/libxsd-frontend/build/cxx/gnu/configuration-dynamic.make new file mode 100644 index 0000000..f3fe64d --- /dev/null +++ b/libxsd-frontend/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/libxsd-frontend/build/import/libboost/configuration-dynamic.make b/libxsd-frontend/build/import/libboost/configuration-dynamic.make new file mode 100644 index 0000000..a33bf20 --- /dev/null +++ b/libxsd-frontend/build/import/libboost/configuration-dynamic.make @@ -0,0 +1 @@ +libboost_installed := y diff --git a/libxsd-frontend/build/import/libcult/configuration-dynamic.make b/libxsd-frontend/build/import/libcult/configuration-dynamic.make new file mode 100644 index 0000000..78c41d3 --- /dev/null +++ b/libxsd-frontend/build/import/libcult/configuration-dynamic.make @@ -0,0 +1 @@ +libcult_installed := y diff --git a/libxsd-frontend/build/import/libfrontend-elements/configuration-dynamic.make b/libxsd-frontend/build/import/libfrontend-elements/configuration-dynamic.make new file mode 100644 index 0000000..6583182 --- /dev/null +++ b/libxsd-frontend/build/import/libfrontend-elements/configuration-dynamic.make @@ -0,0 +1 @@ +libfrontend_elements_installed := y diff --git a/libxsd-frontend/build/import/libxerces-c/configuration-dynamic.make b/libxsd-frontend/build/import/libxerces-c/configuration-dynamic.make new file mode 100644 index 0000000..91f61b2 --- /dev/null +++ b/libxsd-frontend/build/import/libxerces-c/configuration-dynamic.make @@ -0,0 +1 @@ +libxerces_c_installed := y diff --git a/libxsd-frontend/build/ld/configuration-lib-dynamic.make b/libxsd-frontend/build/ld/configuration-lib-dynamic.make new file mode 100644 index 0000000..c2c560c --- /dev/null +++ b/libxsd-frontend/build/ld/configuration-lib-dynamic.make @@ -0,0 +1,3 @@ +ld_lib_type := archive +ld_lib_ar := ar +ld_lib_ranlib := ranlib diff --git a/xsde/build/c/configuration-dynamic.make b/xsde/build/c/configuration-dynamic.make new file mode 100644 index 0000000..c86b863 --- /dev/null +++ b/xsde/build/c/configuration-dynamic.make @@ -0,0 +1,14 @@ +c_id := gnu +c_optimize := n +c_debug := n +c_rpath := n +c_pp_extra_options := $(CPPFLAGS) -I$(out_root)/../stage/include +c_extra_options := $(CFLAGS) +c_ld_extra_options := $(LDFLAGS) +c_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') + +c_extra_lib_paths := $(out_root)/../stage/lib $(r) diff --git a/xsde/build/c/gnu/configuration-dynamic.make b/xsde/build/c/gnu/configuration-dynamic.make new file mode 100644 index 0000000..4062154 --- /dev/null +++ b/xsde/build/c/gnu/configuration-dynamic.make @@ -0,0 +1,8 @@ +ifneq ($(CC),) +c_gnu := $(CC) +else +c_gnu := gcc +endif + +c_gnu_libraries := +c_gnu_optimization_options := diff --git a/xsde/build/configuration-dynamic.make b/xsde/build/configuration-dynamic.make new file mode 100644 index 0000000..cfedaa7 --- /dev/null +++ b/xsde/build/configuration-dynamic.make @@ -0,0 +1,18 @@ +xsde_arch_width := 32 +xsde_byteorder := l +xsde_stl := y +xsde_iostream := y +xsde_exceptions := y +xsde_longlong := y +xsde_snprintf := y +xsde_parser_validation := y +xsde_serializer_validation := y +xsde_reuse_style := tiein +xsde_xdr := n +xsde_cdr := n +xsde_polymorphic := n +xsde_parser_smap_buckets := 53 +xsde_parser_imap_buckets := 97 +xsde_serializer_smap_buckets := 53 +xsde_serializer_smap_bucket_buckets := 53 +xsde_serializer_imap_buckets := 97 diff --git a/xsde/build/cxx/configuration-dynamic.make b/xsde/build/cxx/configuration-dynamic.make new file mode 100644 index 0000000..7485fe9 --- /dev/null +++ b/xsde/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) -I$(out_root)/../stage/include +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 := $(out_root)/../stage/lib $(r) diff --git a/xsde/build/cxx/gnu/configuration-dynamic.make b/xsde/build/cxx/gnu/configuration-dynamic.make new file mode 100644 index 0000000..f3fe64d --- /dev/null +++ b/xsde/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/xsde/build/import/libbackend-elements/configuration-dynamic.make b/xsde/build/import/libbackend-elements/configuration-dynamic.make new file mode 100644 index 0000000..fd03110 --- /dev/null +++ b/xsde/build/import/libbackend-elements/configuration-dynamic.make @@ -0,0 +1 @@ +libbackend_elements_installed := y diff --git a/xsde/build/import/libboost/configuration-dynamic.make b/xsde/build/import/libboost/configuration-dynamic.make new file mode 100644 index 0000000..a33bf20 --- /dev/null +++ b/xsde/build/import/libboost/configuration-dynamic.make @@ -0,0 +1 @@ +libboost_installed := y diff --git a/xsde/build/import/libcult/configuration-dynamic.make b/xsde/build/import/libcult/configuration-dynamic.make new file mode 100644 index 0000000..78c41d3 --- /dev/null +++ b/xsde/build/import/libcult/configuration-dynamic.make @@ -0,0 +1 @@ +libcult_installed := y diff --git a/xsde/build/import/libxsd-frontend/configuration-dynamic.make b/xsde/build/import/libxsd-frontend/configuration-dynamic.make new file mode 100644 index 0000000..1b2d3ca --- /dev/null +++ b/xsde/build/import/libxsd-frontend/configuration-dynamic.make @@ -0,0 +1 @@ +libxsd_frontend_installed := y diff --git a/xsde/build/ld/configuration-lib-dynamic.make b/xsde/build/ld/configuration-lib-dynamic.make new file mode 100644 index 0000000..c2c560c --- /dev/null +++ b/xsde/build/ld/configuration-lib-dynamic.make @@ -0,0 +1,3 @@ +ld_lib_type := archive +ld_lib_ar := ar +ld_lib_ranlib := ranlib |