From 3f3baceadb01fd1b4150a80667de97df29d372c1 Mon Sep 17 00:00:00 2001 From: nobody Date: Tue, 17 Jul 2001 17:41:48 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create branch 'build-development-gcc-unix'. [SVN r10645] --- .gitattributes | 96 ++++++++++++++++++++++++++ build/Jamfile | 182 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 278 insertions(+) create mode 100644 .gitattributes create mode 100644 build/Jamfile diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..3e84d7c7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,96 @@ +* text=auto !eol svneol=native#text/plain +*.gitattributes text svneol=native#text/plain + +# Scriptish formats +*.bat text svneol=native#text/plain +*.bsh text svneol=native#text/x-beanshell +*.cgi text svneol=native#text/plain +*.cmd text svneol=native#text/plain +*.js text svneol=native#text/javascript +*.php text svneol=native#text/x-php +*.pl text svneol=native#text/x-perl +*.pm text svneol=native#text/x-perl +*.py text svneol=native#text/x-python +*.sh eol=lf svneol=LF#text/x-sh +configure eol=lf svneol=LF#text/x-sh + +# Image formats +*.bmp binary svneol=unset#image/bmp +*.gif binary svneol=unset#image/gif +*.ico binary svneol=unset#image/ico +*.jpeg binary svneol=unset#image/jpeg +*.jpg binary svneol=unset#image/jpeg +*.png binary svneol=unset#image/png +*.tif binary svneol=unset#image/tiff +*.tiff binary svneol=unset#image/tiff +*.svg text svneol=native#image/svg%2Bxml + +# Data formats +*.pdf binary svneol=unset#application/pdf +*.avi binary svneol=unset#video/avi +*.doc binary svneol=unset#application/msword +*.dsp text svneol=crlf#text/plain +*.dsw text svneol=crlf#text/plain +*.eps binary svneol=unset#application/postscript +*.gz binary svneol=unset#application/gzip +*.mov binary svneol=unset#video/quicktime +*.mp3 binary svneol=unset#audio/mpeg +*.ppt binary svneol=unset#application/vnd.ms-powerpoint +*.ps binary svneol=unset#application/postscript +*.psd binary svneol=unset#application/photoshop +*.rdf binary svneol=unset#text/rdf +*.rss text svneol=unset#text/xml +*.rtf binary svneol=unset#text/rtf +*.sln text svneol=native#text/plain +*.swf binary svneol=unset#application/x-shockwave-flash +*.tgz binary svneol=unset#application/gzip +*.vcproj text svneol=native#text/xml +*.vcxproj text svneol=native#text/xml +*.vsprops text svneol=native#text/xml +*.wav binary svneol=unset#audio/wav +*.xls binary svneol=unset#application/vnd.ms-excel +*.zip binary svneol=unset#application/zip + +# Text formats +.htaccess text svneol=native#text/plain +*.bbk text svneol=native#text/xml +*.cmake text svneol=native#text/plain +*.css text svneol=native#text/css +*.dtd text svneol=native#text/xml +*.htm text svneol=native#text/html +*.html text svneol=native#text/html +*.ini text svneol=native#text/plain +*.log text svneol=native#text/plain +*.mak text svneol=native#text/plain +*.qbk text svneol=native#text/plain +*.rst text svneol=native#text/plain +*.sql text svneol=native#text/x-sql +*.txt text svneol=native#text/plain +*.xhtml text svneol=native#text/xhtml%2Bxml +*.xml text svneol=native#text/xml +*.xsd text svneol=native#text/xml +*.xsl text svneol=native#text/xml +*.xslt text svneol=native#text/xml +*.xul text svneol=native#text/xul +*.yml text svneol=native#text/plain +boost-no-inspect text svneol=native#text/plain +CHANGES text svneol=native#text/plain +COPYING text svneol=native#text/plain +INSTALL text svneol=native#text/plain +Jamfile text svneol=native#text/plain +Jamroot text svneol=native#text/plain +Jamfile.v2 text svneol=native#text/plain +Jamrules text svneol=native#text/plain +Makefile* text svneol=native#text/plain +README text svneol=native#text/plain +TODO text svneol=native#text/plain + +# Code formats +*.c text svneol=native#text/plain +*.cpp text svneol=native#text/plain +*.h text svneol=native#text/plain +*.hpp text svneol=native#text/plain +*.ipp text svneol=native#text/plain +*.tpp text svneol=native#text/plain +*.jam text svneol=native#text/plain +*.java text svneol=native#text/plain diff --git a/build/Jamfile b/build/Jamfile new file mode 100644 index 00000000..293bf0f8 --- /dev/null +++ b/build/Jamfile @@ -0,0 +1,182 @@ +subproject libs/python/build ; + +# Do some OS-specific setup +if $(NT) +{ + PYTHON_ROOT ?= c:/tools/python ; + PYTHON_INCLUDES ?= $(PYTHON_ROOT)/include <*>/usr/include/python2.1 ; + PYTHON_LIBS ?= c:/cygnus/lib/python2.1/config/libpython2.1.dll.a ; + PYTHON_LIB_PATH = $(PYTHON_ROOT)/libs ; + + # common properties required for compiling any Python module. + PYTHON_PROPERTIES ?= + <*>SIZEOF_LONG=4 + <*>USE_DL_IMPORT + + # if you don't request multithreading, you can't get the DLL runtime, + # which is needed for the python modules to work right + <*>multi + ; + + SHELL_EXPORT ?= set ; +} +else if $(UNIX) +{ + PYTHON_INCLUDES ?= /usr/include/python1.5 ; + PYTHON_LIBS ?= /usr/lib/python1.5/config/libpython1.5.a ; + SHELL_EXPORT ?= export ; +} + +####################### + +# +# Declare the boost python static link library +# +BOOST_PYTHON_INCLUDES = $(BOOST_ROOT) $(PYTHON_INCLUDES) ; + +SOURCES = classes.cpp conversions.cpp extension_class.cpp functions.cpp + init_function.cpp module_builder.cpp + objects.cpp types.cpp cross_module.cpp ; + +SOURCE_DIR = [ join-path $(DOTDOT) src ] ; +lib libboost_python + : $(SOURCE_DIR)$(SLASH)$(SOURCES) + : $(BOOST_PYTHON_INCLUDES) true $(PYTHON_PROPERTIES) ; + +####################### + +# boost-python name : sources : requirements : default-BUILD +# +# Declare a boost python module. Return a list of the DLL files generated. +rule boost-python +{ + dll $(<) + # Add the boost python library to sources + : libboost_python $(>) + + # Add some standard requirements + : $(3) + $(BOOST_PYTHON_INCLUDES) + <*>$(PYTHON_LIB_PATH) + <*>$(PYTHON_LIBS) + $(PYTHON_PROPERTIES) + + : $(4) ; # pass on the default-BUILD, if any +} + +####################### + +# boost-python-test target : sources : requirements : local-build : args +# +# declare two python module tests: $(<).test which builds when out-of-date, and +# $(<).run which builds unconditionally. +rule boost-python-test +{ + SEARCH on $(>[1]) = $(SEARCH_SOURCE) ; + local gPYTHON_TEST_ARGS = $(5) $(PYTHON_TEST_ARGS) ; + declare-local-target $(<:S=.test) : $(2) : $(PYTHON_PROPERTIES) : $(4) : PYTHON_TEST ; + declare-local-target $(<:S=.run) : $(2) : $(PYTHON_PROPERTIES) : $(4) : PYTHON_RUNTEST ; +} + +# how do we invoke python? +PYTHON ?= python ; + +# special rules for two new target types: PYTHON_TEST and PYTHON_RUNTEST. +# These are identical except that PYTHON_TEST runs the test when out-of-date, and +# PYTHON_RUNTEST runs the test unconditionally. These are used by boost-python-test. +SUFPYTHON_TEST = .test ; +gGENERATOR_FUNCTION(PYTHON_TEST) = python-test-target ; +rule python-test-target # test-target : sources : +{ + python-test-aux $(<) : $(>) ; + Clean clean : $(<) ; + type-DEPENDS test : $(<) ; + MakeLocate $(<) : $(LOCATE_TARGET) ; +} +actions python-test-target +{ + $(SHELL_EXPORT)PYTHONPATH="$(PYTHONPATH)" + $(PYTHON) "$(>)" $(ARGS) > "$(<)" +} + +SUFPYTHON_RUNTEST = .run ; +gGENERATOR_FUNCTION(PYTHON_RUNTEST) = python-runtest-target ; +rule python-runtest-target # test-target : sources : +{ + python-test-aux $(<) : $(>) ; + NOTFILE $(<) ; + ALWAYS $(<) ; +} +actions python-runtest-target +{ + $(SHELL_EXPORT)PYTHONPATH="$(PYTHONPATH)" + $(PYTHON) "$(>)" $(ARGS) +} + +rule python-test-aux # target : sources +{ + DEPENDS $(<) : $(>) ; + + ARGS on $(<) += $(gPYTHON_TEST_ARGS) ; + + # Some tests need an extra command-line arg if built with + # msvc. Checking the target grist is a cheap way to + # find out. + switch $(<) + { + case <*\\\\msvc\\\\*>* : ARGS on $(<) += --broken-auto-ptr ; + } + + PYTHONPATH on $(<) = [ join + $(gLOCATE($(>[1]))) # location of python test file + $(gRUN_PATH($(<))) # location of module dependencies + [ join-path $(TOP) libs python test ] # location of doctest + $(PYTHONPATH) # base PYTHONPATH from environment + : $(SPLITPATH) ] ; +} + +############# comprehensive module and test ########### +boost-python boost_python_test : ../test/comprehensive.cpp ; +boost-python-test comprehensive : [ join-path $(DOTDOT) test comprehensive.py ] boost_python_test ; + +############# simple tests from ../example ############ + +rule boost-python-example-test +{ + boost-python $(<) : ../example/$(<).cpp ; + boost-python-test $(<) : [ join-path $(DOTDOT) example test_$(<).py ] $(<) ; +} + + +boost-python-example-test abstract ; +boost-python-example-test getting_started1 ; +boost-python-example-test getting_started2 ; +boost-python-example-test simple_vector ; +boost-python-example-test do_it_yourself_converters ; +boost-python-example-test pickle1 ; +boost-python-example-test pickle2 ; +boost-python-example-test pickle3 ; + + +boost-python ivect : ../example/ivect.cpp ; +boost-python dvect : ../example/dvect.cpp ; +boost-python noncopyable_export : ../example/noncopyable_export.cpp ; +boost-python noncopyable_import : ../example/noncopyable_import.cpp ; + +############## cross-module tests from ../example ########## + +# A simple rule to build a test which depends on multiple modules in the PYTHONPATH +rule boost-python-multi-example-test # test-name : python-file libs +{ + boost-python-test $(<) : ../example/tst_$(<).py $(>) : : : $(PYTHON_VECT_ITERATIONS) ; +} +PYTHON_VECT_ITERATIONS ?= 10 ; + +boost-python-multi-example-test dvect1 : ivect dvect ; +boost-python-multi-example-test dvect2 : ivect dvect ; + +boost-python-multi-example-test ivect1 : ivect dvect ; +boost-python-multi-example-test ivect2 : ivect dvect ; + +boost-python-multi-example-test noncopyable : noncopyable_import noncopyable_export ; +