Bumped version in configure.ac to 1.5.6 (assuming that "1.5f" is
the next version released). Updated files in mk/autoconf and mk/jam with copies from CS; fixes a GLU detection issue on MinGW. Set msvc/bullet_ico.ico as the default application icon. Disabled exceptions for gcc builds.
This commit is contained in:
130
Jamfile.in
130
Jamfile.in
@@ -1,64 +1,66 @@
|
|||||||
TOP ?= "@top_srcdir@" ;
|
TOP ?= "@top_srcdir@" ;
|
||||||
BUILDTOP ?= "@top_builddir@" ;
|
BUILDTOP ?= "@top_builddir@" ;
|
||||||
|
|
||||||
SubDir TOP ;
|
SubDir TOP ;
|
||||||
|
|
||||||
IncludeDir ;
|
IncludeDir ;
|
||||||
IncludeDir Bullet ;
|
IncludeDir Bullet ;
|
||||||
IncludeDir BulletDynamics ;
|
IncludeDir BulletDynamics ;
|
||||||
IncludeDir LinearMath ;
|
IncludeDir LinearMath ;
|
||||||
|
|
||||||
IncludeDir $(BUILDTOP) : : literal transient ;
|
IncludeDir $(BUILDTOP) : : literal transient ;
|
||||||
|
|
||||||
CleanDir clean :
|
CleanDir clean :
|
||||||
out ;
|
out ;
|
||||||
Clean distclean :
|
Clean distclean :
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
config.h
|
config.h
|
||||||
config.h.in~
|
config.h.in~
|
||||||
config.log
|
config.log
|
||||||
config.status
|
config.status
|
||||||
config.status.lineno
|
config.status.lineno
|
||||||
config.cache
|
config.cache
|
||||||
configure.lineno
|
configure.lineno
|
||||||
Jamconfig
|
Jamconfig
|
||||||
Jamfile ;
|
Jamfile ;
|
||||||
CleanDir distclean :
|
CleanDir distclean :
|
||||||
autom4te.cache ;
|
autom4te.cache ;
|
||||||
Depends distclean : clean ;
|
Depends distclean : clean ;
|
||||||
|
|
||||||
Clean maintainerclean :
|
Clean maintainerclean :
|
||||||
config.h.in
|
config.h.in
|
||||||
configure ;
|
configure ;
|
||||||
Depends maintainerclean : distclean ;
|
Depends maintainerclean : distclean ;
|
||||||
|
|
||||||
Help distclean : "Remove built targets and configuration" ;
|
Help distclean : "Remove built targets and configuration" ;
|
||||||
Help maintainerclean :
|
Help maintainerclean :
|
||||||
"Remove built targets, configuration, and generated files." ;
|
"Remove built targets, configuration, and generated files." ;
|
||||||
|
|
||||||
MsvcGenSubDir TOP msvc : common ;
|
ApplicationIconDefault win32 : all : bullet_ico.ico : $(TOP) msvc ;
|
||||||
MsvcGenSubDir TOP msvc 6 : 6 ;
|
|
||||||
MsvcGenSubDir TOP msvc 7 : 7 ;
|
MsvcGenSubDir TOP msvc : common ;
|
||||||
MsvcGenSubDir TOP msvc 71 : 71 ;
|
MsvcGenSubDir TOP msvc 6 : 6 ;
|
||||||
MsvcGenSubDir TOP msvc 8 : 8 ;
|
MsvcGenSubDir TOP msvc 7 : 7 ;
|
||||||
MsvcGenTemplateDir TOP mk msvcgen ;
|
MsvcGenSubDir TOP msvc 71 : 71 ;
|
||||||
MsvcGenWorkspace bullet ;
|
MsvcGenSubDir TOP msvc 8 : 8 ;
|
||||||
|
MsvcGenTemplateDir TOP mk msvcgen ;
|
||||||
# Set project-specific compiler and linker options for msvcgen.
|
MsvcGenWorkspace bullet ;
|
||||||
MsvcGenConfig GL.AVAILABLE : yes ;
|
|
||||||
MsvcGenConfig GL.LFLAGS : ;
|
# Set project-specific compiler and linker options for msvcgen.
|
||||||
MsvcGenConfig GL.LIBS : opengl32.lib ;
|
MsvcGenConfig GL.AVAILABLE : yes ;
|
||||||
MsvcGenConfig GLUT.AVAILABLE : yes ;
|
MsvcGenConfig GL.LFLAGS : ;
|
||||||
MsvcGenConfig GLUT.CFLAGS : ;
|
MsvcGenConfig GL.LIBS : opengl32.lib ;
|
||||||
MsvcGenConfig GLUT.LFLAGS : ;
|
MsvcGenConfig GLUT.AVAILABLE : yes ;
|
||||||
MsvcGenConfig GLUT.INCDIRS : "../../Glut" ;
|
MsvcGenConfig GLUT.CFLAGS : ;
|
||||||
MsvcGenConfig GLUT.LIBDIRS : "../../Glut" ;
|
MsvcGenConfig GLUT.LFLAGS : ;
|
||||||
MsvcGenConfig GLUT.LIBS : glut32.lib ;
|
MsvcGenConfig GLUT.INCDIRS : "../../Glut" ;
|
||||||
|
MsvcGenConfig GLUT.LIBDIRS : "../../Glut" ;
|
||||||
SubInclude TOP LinearMath ;
|
MsvcGenConfig GLUT.LIBS : glut32.lib ;
|
||||||
SubInclude TOP Bullet ;
|
|
||||||
SubInclude TOP BulletDynamics ;
|
SubInclude TOP LinearMath ;
|
||||||
SubInclude TOP Extras ;
|
SubInclude TOP Bullet ;
|
||||||
SubInclude TOP Demos ;
|
SubInclude TOP BulletDynamics ;
|
||||||
|
SubInclude TOP Extras ;
|
||||||
Depends install_config : [ DoInstall bullet.pc : $(libdir)/pkgconfig ] ;
|
SubInclude TOP Demos ;
|
||||||
|
|
||||||
|
Depends install_config : [ DoInstall bullet.pc : $(libdir)/pkgconfig ] ;
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
Bullet Continuous Collision Detection and Physics Library
|
Bullet Continuous Collision Detection and Physics Library
|
||||||
Erwin Coumans
|
Erwin Coumans
|
||||||
|
|
||||||
|
2006 June 17 Frank Richter <resqu@gmx.ch>
|
||||||
|
Bumped version in configure.ac to 1.5.6 (assuming that "1.5f" is
|
||||||
|
the next version released).
|
||||||
|
Updated files in mk/autoconf and mk/jam with copies from CS; fixes a
|
||||||
|
GLU detection issue on MinGW.
|
||||||
|
Set msvc/bullet_ico.ico as the default application icon.
|
||||||
|
Disabled exceptions for gcc builds.
|
||||||
|
|
||||||
2006 May 24
|
2006 May 24
|
||||||
Improved GJK accuracy, fixed GjkConvexCast issue, thanks to ~MyXa~ for reporting
|
Improved GJK accuracy, fixed GjkConvexCast issue, thanks to ~MyXa~ for reporting
|
||||||
|
|
||||||
|
|||||||
222
configure.ac
222
configure.ac
@@ -1,106 +1,116 @@
|
|||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Autoconf input script. Invoke the ./autogen.sh script to generate a
|
# Autoconf input script. Invoke the ./autogen.sh script to generate a
|
||||||
# configure script from this file.
|
# configure script from this file.
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
AC_PREREQ([2.54])
|
AC_PREREQ([2.54])
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Initialize Autoconf.
|
# Initialize Autoconf.
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
AC_INIT(
|
AC_INIT(
|
||||||
[bullet],
|
[bullet],
|
||||||
[1.1.2006.0319],
|
[1.5.6],
|
||||||
[bullet@erwincoumans.com])
|
[bullet@erwincoumans.com])
|
||||||
CS_PACKAGEINFO(
|
CS_PACKAGEINFO(
|
||||||
[Bullet Continuous Collision Detection and Physics Library],
|
[Bullet Continuous Collision Detection and Physics Library],
|
||||||
[Copyright (c) 2005-2006 Erwin Coumans],
|
[Copyright (c) 2005-2006 Erwin Coumans],
|
||||||
[http://www.continuousphysics.com/Bullet/])
|
[http://www.continuousphysics.com/Bullet/])
|
||||||
AC_CONFIG_SRCDIR([mk/jam/build.jam])
|
AC_CONFIG_SRCDIR([mk/jam/build.jam])
|
||||||
AC_CONFIG_AUX_DIR([mk/autoconf])
|
AC_CONFIG_AUX_DIR([mk/autoconf])
|
||||||
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Setup for the configuration header.
|
# Setup for the configuration header.
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Check for tools.
|
# Check for tools.
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
CS_PROG_CC
|
CS_PROG_CC
|
||||||
AS_IF([test -z "$CC"],
|
AS_IF([test -z "$CC"],
|
||||||
[AC_MSG_ERROR([Could not find a usable C compiler.])])
|
[AC_MSG_ERROR([Could not find a usable C compiler.])])
|
||||||
CS_PROG_CXX
|
CS_PROG_CXX
|
||||||
AS_IF([test -z "$CXX"],
|
AS_IF([test -z "$CXX"],
|
||||||
[AC_MSG_ERROR([Could not find a usable C++ compiler.])])
|
[AC_MSG_ERROR([Could not find a usable C++ compiler.])])
|
||||||
CS_PROG_LINK
|
CS_PROG_LINK
|
||||||
|
|
||||||
CS_CHECK_COMMON_TOOLS_LINK
|
CS_CHECK_COMMON_TOOLS_LINK
|
||||||
CS_CHECK_COMMON_TOOLS_BASIC
|
CS_CHECK_COMMON_TOOLS_BASIC
|
||||||
CS_CHECK_COMMON_TOOLS_DOC_DOXYGEN
|
CS_CHECK_COMMON_TOOLS_DOC_DOXYGEN
|
||||||
|
|
||||||
CS_CHECK_PROGS([PERL], [perl5 perl])
|
CS_CHECK_PROGS([PERL], [perl5 perl])
|
||||||
CS_EMIT_BUILD_PROPERTY([PERL], [$PERL])
|
CS_EMIT_BUILD_PROPERTY([PERL], [$PERL])
|
||||||
|
|
||||||
CS_CHECK_TEMPLATE_TOOLKIT2([emit])
|
CS_CHECK_TEMPLATE_TOOLKIT2([emit])
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Determine system type
|
# Check if C++ exceptions can be disabled.
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
CS_CHECK_HOST
|
CS_EMIT_BUILD_FLAGS([how to disable C++ exceptions],
|
||||||
|
[cs_cv_prog_cxx_disable_exceptions], [CS_CREATE_TUPLE([-fno-exceptions])],
|
||||||
#----------------------------------------------------------------------------
|
[C++], [COMPILER.C++FLAGS.EXCEPTIONS.DISABLE], [],
|
||||||
# Check for syntax problems / header files
|
[CS_EMIT_BUILD_PROPERTY([COMPILER.C++FLAGS],
|
||||||
#----------------------------------------------------------------------------
|
[$cs_cv_prog_cxx_disable_exceptions], [+])])
|
||||||
# Nothing yet.
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Check for GLUT.
|
# Determine system type
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
AS_IF([test $cs_host_family = windows],
|
CS_CHECK_HOST
|
||||||
[# Tack the GLUT that comes with bullet onto compiler & linker flags.
|
|
||||||
_AC_SRCPATHS(["."])
|
#----------------------------------------------------------------------------
|
||||||
glut_cflags="-I$ac_top_srcdir/Glut"
|
# Check for syntax problems / header files
|
||||||
glut_lflags="-L$ac_top_srcdir/Glut"
|
#----------------------------------------------------------------------------
|
||||||
CFLAGS="$CFLAGS $glut_cflags"
|
# Nothing yet.
|
||||||
LDFLAGS="$LDFLAGS $glut_lflags"
|
|
||||||
CS_EMIT_BUILD_PROPERTY([COMPILER.CFLAGS], [$glut_cflags], [+])
|
#----------------------------------------------------------------------------
|
||||||
CS_EMIT_BUILD_PROPERTY([COMPILER.LFLAGS], [$glut_lflags], [+])
|
# Check for GLUT.
|
||||||
])
|
#----------------------------------------------------------------------------
|
||||||
CS_CHECK_GLUT
|
AS_IF([test $cs_host_family = windows],
|
||||||
|
[# Tack the GLUT that comes with bullet onto compiler & linker flags.
|
||||||
#----------------------------------------------------------------------------
|
_AC_SRCPATHS(["."])
|
||||||
# Package configuration switches.
|
glut_cflags="-I$ac_top_srcdir/Glut"
|
||||||
#----------------------------------------------------------------------------
|
glut_lflags="-L$ac_top_srcdir/Glut"
|
||||||
AC_ARG_ENABLE([debug],
|
CFLAGS="$CFLAGS $glut_cflags"
|
||||||
[AC_HELP_STRING([--enable-debug],
|
LDFLAGS="$LDFLAGS $glut_lflags"
|
||||||
[build with debugging information (default NO)])],
|
CS_EMIT_BUILD_PROPERTY([COMPILER.CFLAGS], [$glut_cflags], [+])
|
||||||
[], [enable_debug=no])
|
CS_EMIT_BUILD_PROPERTY([COMPILER.LFLAGS], [$glut_lflags], [+])
|
||||||
|
])
|
||||||
AC_MSG_CHECKING([build mode])
|
CS_CHECK_GLUT
|
||||||
AS_IF([test $enable_debug = yes], [build_mode=debug], [build_mode=optimize])
|
|
||||||
AC_MSG_RESULT([$build_mode])
|
#----------------------------------------------------------------------------
|
||||||
|
# Package configuration switches.
|
||||||
CS_EMIT_BUILD_PROPERTY([MODE], [$build_mode])
|
#----------------------------------------------------------------------------
|
||||||
|
AC_ARG_ENABLE([debug],
|
||||||
#-----------------------------------------------------------------------------
|
[AC_HELP_STRING([--enable-debug],
|
||||||
# Emit install paths and package information.
|
[build with debugging information (default NO)])],
|
||||||
#-----------------------------------------------------------------------------
|
[], [enable_debug=no])
|
||||||
CS_OUTPUT_INSTALLDIRS
|
|
||||||
CS_EMIT_PACKAGEINFO
|
AC_MSG_CHECKING([build mode])
|
||||||
|
AS_IF([test $enable_debug = yes], [build_mode=debug], [build_mode=optimize])
|
||||||
#----------------------------------------------------------------------------
|
AC_MSG_RESULT([$build_mode])
|
||||||
# Emit generated files.
|
|
||||||
#----------------------------------------------------------------------------
|
CS_EMIT_BUILD_PROPERTY([MODE], [$build_mode])
|
||||||
CS_JAMCONFIG_OUTPUT([Jamconfig])
|
|
||||||
AC_CONFIG_FILES([Jamfile bullet.pc])
|
#-----------------------------------------------------------------------------
|
||||||
AC_OUTPUT
|
# Emit install paths and package information.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
AC_MSG_NOTICE([
|
CS_OUTPUT_INSTALLDIRS
|
||||||
|
CS_EMIT_PACKAGEINFO
|
||||||
Please note that this project uses Jam as its build tool,
|
|
||||||
therefore you must type 'jam' to build the project.
|
#----------------------------------------------------------------------------
|
||||||
|
# Emit generated files.
|
||||||
Jam home: http://www.perforce.com/jam/jam.html
|
#----------------------------------------------------------------------------
|
||||||
Jam source: ftp://ftp.perforce.com/jam/
|
CS_JAMCONFIG_OUTPUT([Jamconfig])
|
||||||
])
|
AC_CONFIG_FILES([Jamfile bullet.pc])
|
||||||
|
AC_OUTPUT
|
||||||
|
|
||||||
|
AC_MSG_NOTICE([
|
||||||
|
|
||||||
|
Please note that this project uses Jam as its build tool,
|
||||||
|
therefore you must type 'jam' to build the project.
|
||||||
|
|
||||||
|
Jam home: http://www.perforce.com/jam/jam.html
|
||||||
|
Jam source: ftp://ftp.perforce.com/jam/
|
||||||
|
])
|
||||||
|
|||||||
@@ -1,230 +1,230 @@
|
|||||||
# checkbuild.m4 -*- Autoconf -*-
|
# checkbuild.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_SPLIT_TUPLE(TUPLE, OUTPUT-VARIABLES)
|
# CS_SPLIT_TUPLE(TUPLE, OUTPUT-VARIABLES)
|
||||||
# Split a build-tuple into its component parts. A build tuple is
|
# Split a build-tuple into its component parts. A build tuple is
|
||||||
# constructed by CS_CREATE_TUPLE() and is comprised of compiler flags,
|
# constructed by CS_CREATE_TUPLE() and is comprised of compiler flags,
|
||||||
# linker flags, and library references. OUTPUT-VARIABLES is a
|
# linker flags, and library references. OUTPUT-VARIABLES is a
|
||||||
# comma-delimited list of shell variables which should receive the
|
# comma-delimited list of shell variables which should receive the
|
||||||
# extracted compiler flags, linker flags, and library references,
|
# extracted compiler flags, linker flags, and library references,
|
||||||
# respectively.
|
# respectively.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_SPLIT_TUPLE],
|
AC_DEFUN([CS_SPLIT_TUPLE],
|
||||||
[CS_SPLIT([$1], [cs_dummy,$2], [@])
|
[CS_SPLIT([$1], [cs_dummy,$2], [@])
|
||||||
m4_map([_CS_SPLIT_TUPLE], [$2])])
|
m4_map([_CS_SPLIT_TUPLE], [$2])])
|
||||||
|
|
||||||
AC_DEFUN([_CS_SPLIT_TUPLE],
|
AC_DEFUN([_CS_SPLIT_TUPLE],
|
||||||
[$1=`echo $$1 | sed 'y%@%:@% %'`
|
[$1=`echo $$1 | sed 'y%@%:@% %'`
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CREATE_TUPLE([CFLAGS], [LFLAGS], [LIBS])
|
# CS_CREATE_TUPLE([CFLAGS], [LFLAGS], [LIBS])
|
||||||
# Construct a build-tuple which is comprised of compiler flags, linker
|
# Construct a build-tuple which is comprised of compiler flags, linker
|
||||||
# flags, and library references. Build tuples are encoded so as to
|
# flags, and library references. Build tuples are encoded so as to
|
||||||
# preserve whitespace in each component. This makes it possible for
|
# preserve whitespace in each component. This makes it possible for
|
||||||
# macros (such as CS_BUILD_IFELSE) which employ build tuples to accept
|
# macros (such as CS_BUILD_IFELSE) which employ build tuples to accept
|
||||||
# whitespace-delimited lists of tuples, and for shell "for" statements to
|
# whitespace-delimited lists of tuples, and for shell "for" statements to
|
||||||
# iterate over tuple lists without compromising whitespace embedded
|
# iterate over tuple lists without compromising whitespace embedded
|
||||||
# within individual flags or library references.
|
# within individual flags or library references.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CREATE_TUPLE], [`echo @$1@$2@$3 | sed 'y% %@%:@%'`])
|
AC_DEFUN([CS_CREATE_TUPLE], [`echo @$1@$2@$3 | sed 'y% %@%:@%'`])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_LANG_CFLAGS
|
# CS_LANG_CFLAGS
|
||||||
# Return the literal string CFLAGS if the current language is C. Return
|
# Return the literal string CFLAGS if the current language is C. Return
|
||||||
# the literal string CXXFLAGS if the current language is C++. Generic
|
# the literal string CXXFLAGS if the current language is C++. Generic
|
||||||
# compiler test macros which need to modify or save the compiler flags
|
# compiler test macros which need to modify or save the compiler flags
|
||||||
# can invoke this macro to get the name of the compiler flags environment
|
# can invoke this macro to get the name of the compiler flags environment
|
||||||
# variable (either CFLAGS or CXXFLAGS) depending upon the current
|
# variable (either CFLAGS or CXXFLAGS) depending upon the current
|
||||||
# language. For example:
|
# language. For example:
|
||||||
# CS_LANG_CFLAGS="$CS_LANG_CFLAGS -Wall"
|
# CS_LANG_CFLAGS="$CS_LANG_CFLAGS -Wall"
|
||||||
# With C, this expands to:
|
# With C, this expands to:
|
||||||
# CFLAGS="$CFLAGS -Wall"
|
# CFLAGS="$CFLAGS -Wall"
|
||||||
# With C++, it expands to:
|
# With C++, it expands to:
|
||||||
# CXXFLAGS="$CXXFLAGS -Wall"
|
# CXXFLAGS="$CXXFLAGS -Wall"
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_LANG_CFLAGS], [AC_LANG_CASE([C], [CFLAGS], [C++], [CXXFLAGS])])
|
AC_DEFUN([CS_LANG_CFLAGS], [AC_LANG_CASE([C], [CFLAGS], [C++], [CXXFLAGS])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_BUILD_IFELSE([PROGRAM], [FLAGS], [LANGUAGE], [ACTION-IF-BUILT],
|
# CS_BUILD_IFELSE([PROGRAM], [FLAGS], [LANGUAGE], [ACTION-IF-BUILT],
|
||||||
# [ACTION-IF-NOT-BUILT], [OTHER-CFLAGS], [OTHER-LFLAGS],
|
# [ACTION-IF-NOT-BUILT], [OTHER-CFLAGS], [OTHER-LFLAGS],
|
||||||
# [OTHER-LIBS], [INHIBIT-OTHER-FLAGS], [ERROR-REGEX])
|
# [OTHER-LIBS], [INHIBIT-OTHER-FLAGS], [ERROR-REGEX])
|
||||||
# Try building a program using the supplied compiler flags, linker flags,
|
# Try building a program using the supplied compiler flags, linker flags,
|
||||||
# and library references. PROGRAM is typically a program composed via
|
# and library references. PROGRAM is typically a program composed via
|
||||||
# AC_LANG_PROGRAM(). PROGRAM may be omitted if you are interested only
|
# AC_LANG_PROGRAM(). PROGRAM may be omitted if you are interested only
|
||||||
# in learning if the compiler or linker respects certain flags. LANGUAGE
|
# in learning if the compiler or linker respects certain flags. LANGUAGE
|
||||||
# is typically either C or C++ and specifies which compiler to use for
|
# is typically either C or C++ and specifies which compiler to use for
|
||||||
# the test. If LANGUAGE is omitted, C is used. FLAGS is a whitespace
|
# the test. If LANGUAGE is omitted, C is used. FLAGS is a whitespace
|
||||||
# delimited list of build tuples. Tuples are created with
|
# delimited list of build tuples. Tuples are created with
|
||||||
# CS_CREATE_TUPLE() and are composed of up to three elements each. The
|
# CS_CREATE_TUPLE() and are composed of up to three elements each. The
|
||||||
# first element represents compiler flags, the second linker flags, and
|
# first element represents compiler flags, the second linker flags, and
|
||||||
# the third libraries used when linking the program. Each tuple from
|
# the third libraries used when linking the program. Each tuple from
|
||||||
# FLAGS is attempted in order. If you want a build attempted with no
|
# FLAGS is attempted in order. If you want a build attempted with no
|
||||||
# special flags prior to builds with specialized flags, create an empty
|
# special flags prior to builds with specialized flags, create an empty
|
||||||
# tuple with CS_CREATE_TUPLE() at the start of the FLAGS list. If the
|
# tuple with CS_CREATE_TUPLE() at the start of the FLAGS list. If the
|
||||||
# build is successful, then the shell variables cs_build_ok is set to
|
# build is successful, then the shell variables cs_build_ok is set to
|
||||||
# "yes", cs_build_cflags, cs_build_lflags, and cs_build_libs are set to
|
# "yes", cs_build_cflags, cs_build_lflags, and cs_build_libs are set to
|
||||||
# the tuple elements which resulted in the successful build, and
|
# the tuple elements which resulted in the successful build, and
|
||||||
# ACTION-IF-BUILT is invoked. Upon successful build, no further tuples
|
# ACTION-IF-BUILT is invoked. Upon successful build, no further tuples
|
||||||
# are consulted. If no tuple results in a successful build, then
|
# are consulted. If no tuple results in a successful build, then
|
||||||
# cs_build_ok is set to "no" and ACTION-IF-NOT-BUILT is invoked.
|
# cs_build_ok is set to "no" and ACTION-IF-NOT-BUILT is invoked.
|
||||||
# OTHER-CFLAGS, OTHER-LFLAGS, and OTHER-LIBS specify additional compiler
|
# OTHER-CFLAGS, OTHER-LFLAGS, and OTHER-LIBS specify additional compiler
|
||||||
# flags, linker flags, and libraries which should be used with each tuple
|
# flags, linker flags, and libraries which should be used with each tuple
|
||||||
# build attempt. Upon successful build, these additional flags are also
|
# build attempt. Upon successful build, these additional flags are also
|
||||||
# reflected in the variables cs_build_cflags, cs_build_lflags, and
|
# reflected in the variables cs_build_cflags, cs_build_lflags, and
|
||||||
# cs_build_libs unless INHIBIT-OTHER-FLAGS is a non-empty string. The
|
# cs_build_libs unless INHIBIT-OTHER-FLAGS is a non-empty string. The
|
||||||
# optional ERROR-REGEX places an additional constraint upon the build
|
# optional ERROR-REGEX places an additional constraint upon the build
|
||||||
# check. If specified, ERROR-REGEX, which is a standard `grep' regular
|
# check. If specified, ERROR-REGEX, which is a standard `grep' regular
|
||||||
# expression, is applied to output captured from the compiler and linker.
|
# expression, is applied to output captured from the compiler and linker.
|
||||||
# If ERROR-REGEX matches, then the build is deemed a failure, and
|
# If ERROR-REGEX matches, then the build is deemed a failure, and
|
||||||
# cs_build_ok is set to "no". This facility is useful for broken build
|
# cs_build_ok is set to "no". This facility is useful for broken build
|
||||||
# tools which emit an error message yet still return success as a result.
|
# tools which emit an error message yet still return success as a result.
|
||||||
# In such cases, it should be possible to detect the failure by scanning
|
# In such cases, it should be possible to detect the failure by scanning
|
||||||
# the tools' output.
|
# the tools' output.
|
||||||
#
|
#
|
||||||
# IMPLEMENTATION NOTES
|
# IMPLEMENTATION NOTES
|
||||||
#
|
#
|
||||||
# In Autoconf 2.57 and earlier, AC_LINK_IFELSE() invokes AC_TRY_EVAL(),
|
# In Autoconf 2.57 and earlier, AC_LINK_IFELSE() invokes AC_TRY_EVAL(),
|
||||||
# which does not provide access to the captured output. To work around
|
# which does not provide access to the captured output. To work around
|
||||||
# this limitation, we temporarily re-define AC_TRY_EVAL() as
|
# this limitation, we temporarily re-define AC_TRY_EVAL() as
|
||||||
# _AC_EVAL_STDERR(), which leaves the captured output in conftest.err
|
# _AC_EVAL_STDERR(), which leaves the captured output in conftest.err
|
||||||
# (which we must also delete). In Autoconf 2.58, however,
|
# (which we must also delete). In Autoconf 2.58, however,
|
||||||
# AC_LINK_IFELSE() instead already invokes _AC_EVAL_STDERR() on our
|
# AC_LINK_IFELSE() instead already invokes _AC_EVAL_STDERR() on our
|
||||||
# behalf, however we must be careful to apply ERROR-REGEX within the
|
# behalf, however we must be careful to apply ERROR-REGEX within the
|
||||||
# invocation AC_LINK_IFELSE(), since AC_LINK_IFELSE() deletes
|
# invocation AC_LINK_IFELSE(), since AC_LINK_IFELSE() deletes
|
||||||
# conftest.err before it returns.
|
# conftest.err before it returns.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_BUILD_IFELSE],
|
AC_DEFUN([CS_BUILD_IFELSE],
|
||||||
[AC_LANG_PUSH(m4_default([$3],[C]))
|
[AC_LANG_PUSH(m4_default([$3],[C]))
|
||||||
cs_cflags_save="$CS_LANG_CFLAGS"
|
cs_cflags_save="$CS_LANG_CFLAGS"
|
||||||
cs_lflags_save="$LDFLAGS"
|
cs_lflags_save="$LDFLAGS"
|
||||||
cs_libs_save="$LIBS"
|
cs_libs_save="$LIBS"
|
||||||
cs_build_ok=no
|
cs_build_ok=no
|
||||||
m4_ifval([$10], [m4_pushdef([AC_TRY_EVAL], [_AC_EVAL_STDERR]($$[1]))])
|
m4_ifval([$10], [m4_pushdef([AC_TRY_EVAL], [_AC_EVAL_STDERR]($$[1]))])
|
||||||
|
|
||||||
for cs_build_item in m4_default([$2],[CS_CREATE_TUPLE()])
|
for cs_build_item in m4_default([$2],[CS_CREATE_TUPLE()])
|
||||||
do
|
do
|
||||||
CS_SPLIT_TUPLE(
|
CS_SPLIT_TUPLE(
|
||||||
[$cs_build_item],[cs_cflags_test,cs_lflags_test,cs_libs_test])
|
[$cs_build_item],[cs_cflags_test,cs_lflags_test,cs_libs_test])
|
||||||
CS_LANG_CFLAGS="$cs_cflags_test $6 $cs_cflags_save"
|
CS_LANG_CFLAGS="$cs_cflags_test $6 $cs_cflags_save"
|
||||||
LDFLAGS="$cs_lflags_test $7 $cs_lflags_save"
|
LDFLAGS="$cs_lflags_test $7 $cs_lflags_save"
|
||||||
LIBS="$cs_libs_test $8 $cs_libs_save"
|
LIBS="$cs_libs_test $8 $cs_libs_save"
|
||||||
AC_LINK_IFELSE(m4_default([$1], [AC_LANG_PROGRAM([],[])]),
|
AC_LINK_IFELSE(m4_default([$1], [AC_LANG_PROGRAM([],[])]),
|
||||||
[m4_ifval([$10],
|
[m4_ifval([$10],
|
||||||
[AS_IF([AC_TRY_COMMAND(
|
[AS_IF([AC_TRY_COMMAND(
|
||||||
[grep "AS_ESCAPE([$10])" conftest.err >/dev/null 2>&1])],
|
[grep "AS_ESCAPE([$10])" conftest.err >/dev/null 2>&1])],
|
||||||
[cs_build_ok=no], [cs_build_ok=yes])],
|
[cs_build_ok=no], [cs_build_ok=yes])],
|
||||||
[cs_build_ok=yes])])
|
[cs_build_ok=yes])])
|
||||||
AS_IF([test $cs_build_ok = yes], [break])
|
AS_IF([test $cs_build_ok = yes], [break])
|
||||||
done
|
done
|
||||||
|
|
||||||
m4_ifval([$10], [m4_popdef([AC_TRY_EVAL]) rm -f conftest.err])
|
m4_ifval([$10], [m4_popdef([AC_TRY_EVAL]) rm -f conftest.err])
|
||||||
CS_LANG_CFLAGS=$cs_cflags_save
|
CS_LANG_CFLAGS=$cs_cflags_save
|
||||||
LDFLAGS=$cs_lflags_save
|
LDFLAGS=$cs_lflags_save
|
||||||
LIBS=$cs_libs_save
|
LIBS=$cs_libs_save
|
||||||
AC_LANG_POP(m4_default([$3],[C]))
|
AC_LANG_POP(m4_default([$3],[C]))
|
||||||
|
|
||||||
AS_IF([test $cs_build_ok = yes],
|
AS_IF([test $cs_build_ok = yes],
|
||||||
[cs_build_cflags=CS_TRIM([$cs_cflags_test[]m4_ifval([$9],[],[ $6])])
|
[cs_build_cflags=CS_TRIM([$cs_cflags_test[]m4_ifval([$9],[],[ $6])])
|
||||||
cs_build_lflags=CS_TRIM([$cs_lflags_test[]m4_ifval([$9],[],[ $7])])
|
cs_build_lflags=CS_TRIM([$cs_lflags_test[]m4_ifval([$9],[],[ $7])])
|
||||||
cs_build_libs=CS_TRIM([$cs_libs_test[]m4_ifval([$9],[],[ $8])])
|
cs_build_libs=CS_TRIM([$cs_libs_test[]m4_ifval([$9],[],[ $8])])
|
||||||
$4],
|
$4],
|
||||||
[$5])])
|
[$5])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_BUILD(MESSAGE, CACHE-VAR, [PROGRAM], [FLAGS], [LANGUAGE],
|
# CS_CHECK_BUILD(MESSAGE, CACHE-VAR, [PROGRAM], [FLAGS], [LANGUAGE],
|
||||||
# [ACTION-IF-BUILT], [ACTION-IF-NOT-BUILT], [IGNORE-CACHE],
|
# [ACTION-IF-BUILT], [ACTION-IF-NOT-BUILT], [IGNORE-CACHE],
|
||||||
# [OTHER-CFLAGS], [OTHER-LFLAGS], [OTHER-LIBS],
|
# [OTHER-CFLAGS], [OTHER-LFLAGS], [OTHER-LIBS],
|
||||||
# [INHIBIT-OTHER-FLAGS], [ERROR-REGEX])
|
# [INHIBIT-OTHER-FLAGS], [ERROR-REGEX])
|
||||||
# Like CS_BUILD_IFELSE() but also prints "checking" and result messages,
|
# Like CS_BUILD_IFELSE() but also prints "checking" and result messages,
|
||||||
# and optionally respects the cache. Sets CACHE-VAR to "yes" upon
|
# and optionally respects the cache. Sets CACHE-VAR to "yes" upon
|
||||||
# success, else "no" upon failure. Additionally, sets CACHE-VAR_cflags,
|
# success, else "no" upon failure. Additionally, sets CACHE-VAR_cflags,
|
||||||
# CACHE-VAR_lflags, and CACHE-VAR_libs to the values which resulted in a
|
# CACHE-VAR_lflags, and CACHE-VAR_libs to the values which resulted in a
|
||||||
# successful build. If IGNORE-CACHE is "yes", then the cache variables
|
# successful build. If IGNORE-CACHE is "yes", then the cache variables
|
||||||
# are ignored upon entry to this macro, however they are still set to
|
# are ignored upon entry to this macro, however they are still set to
|
||||||
# appropriate values upon exit.
|
# appropriate values upon exit.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_BUILD],
|
AC_DEFUN([CS_CHECK_BUILD],
|
||||||
[AS_IF([test "$8" != yes],
|
[AS_IF([test "$8" != yes],
|
||||||
[AC_CACHE_CHECK([$1], [$2],
|
[AC_CACHE_CHECK([$1], [$2],
|
||||||
[CS_BUILD_IFELSE([$3], [$4], [$5],
|
[CS_BUILD_IFELSE([$3], [$4], [$5],
|
||||||
[$2=yes
|
[$2=yes
|
||||||
$2_cflags=$cs_build_cflags
|
$2_cflags=$cs_build_cflags
|
||||||
$2_lflags=$cs_build_lflags
|
$2_lflags=$cs_build_lflags
|
||||||
$2_libs=$cs_build_libs],
|
$2_libs=$cs_build_libs],
|
||||||
[$2=no], [$9], [$10], [$11], [$12], [$13])])],
|
[$2=no], [$9], [$10], [$11], [$12], [$13])])],
|
||||||
[AC_MSG_CHECKING([$1])
|
[AC_MSG_CHECKING([$1])
|
||||||
CS_BUILD_IFELSE([$3], [$4], [$5],
|
CS_BUILD_IFELSE([$3], [$4], [$5],
|
||||||
[$2=yes
|
[$2=yes
|
||||||
$2_cflags=$cs_build_cflags
|
$2_cflags=$cs_build_cflags
|
||||||
$2_lflags=$cs_build_lflags
|
$2_lflags=$cs_build_lflags
|
||||||
$2_libs=$cs_build_libs],
|
$2_libs=$cs_build_libs],
|
||||||
[$2=no], [$9], [$10], [$11], [$12], [$13])
|
[$2=no], [$9], [$10], [$11], [$12], [$13])
|
||||||
AC_MSG_RESULT([$$2])])
|
AC_MSG_RESULT([$$2])])
|
||||||
AS_IF([test $$2 = yes], [$6],
|
AS_IF([test $$2 = yes], [$6],
|
||||||
[$2_cflags=''
|
[$2_cflags=''
|
||||||
$2_lflags=''
|
$2_lflags=''
|
||||||
$2_libs=''
|
$2_libs=''
|
||||||
$7])])
|
$7])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_BUILD_FLAGS(MESSAGE, CACHE-VAR, FLAGS, [LANGUAGE],
|
# CS_CHECK_BUILD_FLAGS(MESSAGE, CACHE-VAR, FLAGS, [LANGUAGE],
|
||||||
# [ACTION-IF-RECOGNIZED], [ACTION-IF-NOT-RECOGNIZED],
|
# [ACTION-IF-RECOGNIZED], [ACTION-IF-NOT-RECOGNIZED],
|
||||||
# [OTHER-CFLAGS], [OTHER-LFLAGS], [OTHER-LIBS],
|
# [OTHER-CFLAGS], [OTHER-LFLAGS], [OTHER-LIBS],
|
||||||
# [ERROR-REGEX])
|
# [ERROR-REGEX])
|
||||||
# Like CS_CHECK_BUILD(), but checks only if the compiler or linker
|
# Like CS_CHECK_BUILD(), but checks only if the compiler or linker
|
||||||
# recognizes a command-line option or options. MESSAGE is the "checking"
|
# recognizes a command-line option or options. MESSAGE is the "checking"
|
||||||
# message. CACHE-VAR is the shell cache variable which receives the flag
|
# message. CACHE-VAR is the shell cache variable which receives the flag
|
||||||
# or flags recognized by the compiler or linker. FLAGS is a
|
# or flags recognized by the compiler or linker. FLAGS is a
|
||||||
# whitespace-delimited list of build tuples created with
|
# whitespace-delimited list of build tuples created with
|
||||||
# CS_CREATE_TUPLE(). Each tuple from FLAGS is attempted in order until
|
# CS_CREATE_TUPLE(). Each tuple from FLAGS is attempted in order until
|
||||||
# one is found which is recognized by the compiler. After that, no
|
# one is found which is recognized by the compiler. After that, no
|
||||||
# further flags are checked. LANGUAGE is typically either C or C++ and
|
# further flags are checked. LANGUAGE is typically either C or C++ and
|
||||||
# specifies which compiler to use for the test. If LANGUAGE is omitted,
|
# specifies which compiler to use for the test. If LANGUAGE is omitted,
|
||||||
# C is used. If a command-line option is recognized, then CACHE-VAR is
|
# C is used. If a command-line option is recognized, then CACHE-VAR is
|
||||||
# set to the composite value of $cs_build_cflags, $cs_build_lflags, and
|
# set to the composite value of $cs_build_cflags, $cs_build_lflags, and
|
||||||
# $cs_build_libs of the FLAGS element which succeeded (not including the
|
# $cs_build_libs of the FLAGS element which succeeded (not including the
|
||||||
# "other" flags) and ACTION-IF-RECOGNIZED is invoked. If no options are
|
# "other" flags) and ACTION-IF-RECOGNIZED is invoked. If no options are
|
||||||
# recognized, then CACHE-VAR is set to the empty string, and
|
# recognized, then CACHE-VAR is set to the empty string, and
|
||||||
# ACTION-IF-NOT-RECOGNIZED is invoked. As a convenience, in case
|
# ACTION-IF-NOT-RECOGNIZED is invoked. As a convenience, in case
|
||||||
# comparing CACHE-VAR against the empty string to test for failure is
|
# comparing CACHE-VAR against the empty string to test for failure is
|
||||||
# undesirable, a second variable named CACHE-VAR_ok is set to the literal
|
# undesirable, a second variable named CACHE-VAR_ok is set to the literal
|
||||||
# "no" upon failure, and to the same value as CACHE-VAR upon success.
|
# "no" upon failure, and to the same value as CACHE-VAR upon success.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_BUILD_FLAGS],
|
AC_DEFUN([CS_CHECK_BUILD_FLAGS],
|
||||||
[AC_CACHE_CHECK([$1], [$2_ok],
|
[AC_CACHE_CHECK([$1], [$2_ok],
|
||||||
[CS_BUILD_IFELSE([], [$3], [$4],
|
[CS_BUILD_IFELSE([], [$3], [$4],
|
||||||
[$2=CS_TRIM([$cs_build_cflags $cs_build_lflags $cs_build_libs])
|
[$2=CS_TRIM([$cs_build_cflags $cs_build_lflags $cs_build_libs])
|
||||||
$2_ok="$$2"],
|
$2_ok="$$2"],
|
||||||
[$2=''
|
[$2=''
|
||||||
$2_ok=no], [$7], [$8], [$9], [Y], [$10])])
|
$2_ok=no], [$7], [$8], [$9], [Y], [$10])])
|
||||||
AS_IF([test "$$2_ok" != no], [$5], [$6])])
|
AS_IF([test "$$2_ok" != no], [$5], [$6])])
|
||||||
|
|||||||
@@ -1,111 +1,111 @@
|
|||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003-2006 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003-2006 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_COMMON_TOOLS_LINK
|
# CS_CHECK_COMMON_TOOLS_LINK
|
||||||
# Checks for common tools related to linking.
|
# Checks for common tools related to linking.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_COMMON_TOOLS_LINK],
|
AC_DEFUN([CS_CHECK_COMMON_TOOLS_LINK],
|
||||||
[
|
[
|
||||||
# The default RANLIB in Jambase is wrong on some platforms, and is also
|
# The default RANLIB in Jambase is wrong on some platforms, and is also
|
||||||
# unsuitable during cross-compilation, so we set the value unconditionally
|
# unsuitable during cross-compilation, so we set the value unconditionally
|
||||||
# (sixth argument of CS_EMIT_BUILD_PROPERTY).
|
# (sixth argument of CS_EMIT_BUILD_PROPERTY).
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
CS_EMIT_BUILD_PROPERTY([RANLIB], [$RANLIB], [], [], [], [Y])
|
CS_EMIT_BUILD_PROPERTY([RANLIB], [$RANLIB], [], [], [], [Y])
|
||||||
|
|
||||||
CS_CHECK_TOOLS([DLLTOOL], [dlltool])
|
CS_CHECK_TOOLS([DLLTOOL], [dlltool])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.DLLTOOL], [$DLLTOOL])
|
CS_EMIT_BUILD_PROPERTY([CMD.DLLTOOL], [$DLLTOOL])
|
||||||
|
|
||||||
CS_CHECK_TOOLS([DLLWRAP], [dllwrap])
|
CS_CHECK_TOOLS([DLLWRAP], [dllwrap])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.DLLWRAP], [$DLLWRAP])
|
CS_EMIT_BUILD_PROPERTY([CMD.DLLWRAP], [$DLLWRAP])
|
||||||
|
|
||||||
CS_CHECK_TOOLS([WINDRES], [windres])
|
CS_CHECK_TOOLS([WINDRES], [windres])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.WINDRES], [$WINDRES])
|
CS_EMIT_BUILD_PROPERTY([CMD.WINDRES], [$WINDRES])
|
||||||
|
|
||||||
CS_CHECK_TOOLS([STRINGS], [strings])
|
CS_CHECK_TOOLS([STRINGS], [strings])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.STRINGS], [$STRINGS])
|
CS_EMIT_BUILD_PROPERTY([CMD.STRINGS], [$STRINGS])
|
||||||
|
|
||||||
CS_CHECK_TOOLS([STRINGS], [objcopy])
|
CS_CHECK_TOOLS([OBJCOPY], [objcopy])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.OBJCOPY], [$OBJCOPY])
|
CS_EMIT_BUILD_PROPERTY([CMD.OBJCOPY], [$OBJCOPY])
|
||||||
|
|
||||||
CS_CHECK_LIBTOOL
|
CS_CHECK_LIBTOOL
|
||||||
CS_EMIT_BUILD_PROPERTY([LIBTOOL], [$LIBTOOL])
|
CS_EMIT_BUILD_PROPERTY([LIBTOOL], [$LIBTOOL])
|
||||||
CS_EMIT_BUILD_PROPERTY([APPLE_LIBTOOL], [$APPLE_LIBTOOL])
|
CS_EMIT_BUILD_PROPERTY([APPLE_LIBTOOL], [$APPLE_LIBTOOL])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_COMMON_TOOLS_BASIC
|
# CS_CHECK_COMMON_TOOLS_BASIC
|
||||||
# Checks for basic tools for building things.
|
# Checks for basic tools for building things.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_COMMON_TOOLS_BASIC],
|
AC_DEFUN([CS_CHECK_COMMON_TOOLS_BASIC],
|
||||||
[CS_CHECK_MKDIR
|
[CS_CHECK_MKDIR
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.MKDIR], [$MKDIR])
|
CS_EMIT_BUILD_PROPERTY([CMD.MKDIR], [$MKDIR])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.MKDIRS], [$MKDIRS])
|
CS_EMIT_BUILD_PROPERTY([CMD.MKDIRS], [$MKDIRS])
|
||||||
|
|
||||||
CS_CHECK_PROGS([INSTALL], [install])
|
CS_CHECK_PROGS([INSTALL], [install])
|
||||||
CS_EMIT_BUILD_PROPERTY([INSTALL], [$INSTALL])])
|
CS_EMIT_BUILD_PROPERTY([INSTALL], [$INSTALL])])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_COMMON_TOOLS_DOC_TEXINFO
|
# CS_CHECK_COMMON_TOOLS_DOC_TEXINFO
|
||||||
# Checks for tools to generate documentation from texinfo files.
|
# Checks for tools to generate documentation from texinfo files.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_COMMON_TOOLS_DOC_TEXINFO],
|
AC_DEFUN([CS_CHECK_COMMON_TOOLS_DOC_TEXINFO],
|
||||||
[CS_CHECK_PROGS([TEXI2DVI], [texi2dvi])
|
[CS_CHECK_PROGS([TEXI2DVI], [texi2dvi])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.TEXI2DVI], [$TEXI2DVI])
|
CS_EMIT_BUILD_PROPERTY([CMD.TEXI2DVI], [$TEXI2DVI])
|
||||||
|
|
||||||
CS_CHECK_PROGS([TEXI2PDF], [texi2pdf])
|
CS_CHECK_PROGS([TEXI2PDF], [texi2pdf])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.TEXI2PDF], [$TEXI2PDF])
|
CS_EMIT_BUILD_PROPERTY([CMD.TEXI2PDF], [$TEXI2PDF])
|
||||||
|
|
||||||
CS_CHECK_PROGS([DVIPS], [dvips])
|
CS_CHECK_PROGS([DVIPS], [dvips])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.DVIPS], [$DVIPS])
|
CS_EMIT_BUILD_PROPERTY([CMD.DVIPS], [$DVIPS])
|
||||||
|
|
||||||
CS_CHECK_PROGS([DVIPDF], [dvipdf])
|
CS_CHECK_PROGS([DVIPDF], [dvipdf])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.DVIPDF], [$DVIPDF])
|
CS_EMIT_BUILD_PROPERTY([CMD.DVIPDF], [$DVIPDF])
|
||||||
|
|
||||||
CS_CHECK_PROGS([MAKEINFO], [makeinfo])
|
CS_CHECK_PROGS([MAKEINFO], [makeinfo])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.MAKEINFO], [$MAKEINFO])])
|
CS_EMIT_BUILD_PROPERTY([CMD.MAKEINFO], [$MAKEINFO])])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_COMMON_TOOLS_DOC_DOXYGEN
|
# CS_CHECK_COMMON_TOOLS_DOC_DOXYGEN
|
||||||
# Checks for tools to generate source documentation via doxygen.
|
# Checks for tools to generate source documentation via doxygen.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_COMMON_TOOLS_DOC_DOXYGEN],
|
AC_DEFUN([CS_CHECK_COMMON_TOOLS_DOC_DOXYGEN],
|
||||||
[CS_CHECK_PROGS([DOXYGEN], [doxygen])
|
[CS_CHECK_PROGS([DOXYGEN], [doxygen])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.DOXYGEN], [$DOXYGEN])
|
CS_EMIT_BUILD_PROPERTY([CMD.DOXYGEN], [$DOXYGEN])
|
||||||
|
|
||||||
CS_CHECK_TOOLS([DOT], [dot])
|
CS_CHECK_TOOLS([DOT], [dot])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.DOT], [$DOT])])
|
CS_EMIT_BUILD_PROPERTY([CMD.DOT], [$DOT])])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_COMMON_LIBS
|
# CS_CHECK_COMMON_LIBS
|
||||||
# Check for typical required libraries (libm, libmx, libdl, libnsl).
|
# Check for typical required libraries (libm, libmx, libdl, libnsl).
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_COMMON_LIBS],
|
AC_DEFUN([CS_CHECK_COMMON_LIBS],
|
||||||
[AC_LANG_PUSH([C])
|
[AC_LANG_PUSH([C])
|
||||||
AC_CHECK_LIB([m], [pow], [cs_cv_libm_libs=-lm], [cs_cv_libm_libs=])
|
AC_CHECK_LIB([m], [pow], [cs_cv_libm_libs=-lm], [cs_cv_libm_libs=])
|
||||||
AC_CHECK_LIB([m], [cosf], [cs_cv_libm_libs=-lm])
|
AC_CHECK_LIB([m], [cosf], [cs_cv_libm_libs=-lm])
|
||||||
AC_CHECK_LIB([mx], [cosf])
|
AC_CHECK_LIB([mx], [cosf])
|
||||||
AC_CHECK_LIB([dl], [dlopen], [cs_cv_libdl_libs=-ldl], [cs_cv_libdl_libs=])
|
AC_CHECK_LIB([dl], [dlopen], [cs_cv_libdl_libs=-ldl], [cs_cv_libdl_libs=])
|
||||||
AC_CHECK_LIB([nsl], [gethostbyname])
|
AC_CHECK_LIB([nsl], [gethostbyname])
|
||||||
AC_LANG_POP([C])])
|
AC_LANG_POP([C])])
|
||||||
|
|||||||
@@ -1,51 +1,51 @@
|
|||||||
# checkcppunit.m4 -*- Autoconf -*-
|
# checkcppunit.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_CPPUNIT([EMITTER])
|
# CS_CHECK_CPPUNIT([EMITTER])
|
||||||
# Check if CppUnit (http://cppunit.sourceforge.net/), the unit-testing
|
# Check if CppUnit (http://cppunit.sourceforge.net/), the unit-testing
|
||||||
# framework is available. The shell variable cs_cv_libcppunit is set to
|
# framework is available. The shell variable cs_cv_libcppunit is set to
|
||||||
# "yes" if CppUnit is discovered, else "no". If available, then the
|
# "yes" if CppUnit is discovered, else "no". If available, then the
|
||||||
# variables cs_cv_libcppunit_cflags, cs_cv_libcppunit_lflags, and
|
# variables cs_cv_libcppunit_cflags, cs_cv_libcppunit_lflags, and
|
||||||
# cs_cv_libcppunit_libs are set. If EMITTER is provided, then
|
# cs_cv_libcppunit_libs are set. If EMITTER is provided, then
|
||||||
# CS_EMIT_BUILD_RESULT() is invoked with EMITTER in order to record the
|
# CS_EMIT_BUILD_RESULT() is invoked with EMITTER in order to record the
|
||||||
# results in an output file. As a convenience, if EMITTER is the literal
|
# results in an output file. As a convenience, if EMITTER is the literal
|
||||||
# value "emit" or "yes", then CS_EMIT_BUILD_RESULT()'s default emitter
|
# value "emit" or "yes", then CS_EMIT_BUILD_RESULT()'s default emitter
|
||||||
# will be used.
|
# will be used.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_CPPUNIT],
|
AC_DEFUN([CS_CHECK_CPPUNIT],
|
||||||
[CS_CHECK_LIB_WITH([cppunit],
|
[CS_CHECK_LIB_WITH([cppunit],
|
||||||
[AC_LANG_PROGRAM([[#include <cppunit/ui/text/TestRunner.h>]],
|
[AC_LANG_PROGRAM([[#include <cppunit/ui/text/TestRunner.h>]],
|
||||||
[CppUnit::TextUi::TestRunner r; r.run();])],
|
[CppUnit::TextUi::TestRunner r; r.run();])],
|
||||||
[], [C++])
|
[], [C++])
|
||||||
|
|
||||||
AS_IF([test $cs_cv_libcppunit = yes],
|
AS_IF([test $cs_cv_libcppunit = yes],
|
||||||
[CS_CHECK_BUILD([if cppunit is sufficiently recent],
|
[CS_CHECK_BUILD([if cppunit is sufficiently recent],
|
||||||
[cs_cv_libcppunit_recent],
|
[cs_cv_libcppunit_recent],
|
||||||
[AC_LANG_PROGRAM(
|
[AC_LANG_PROGRAM(
|
||||||
[[#include <cppunit/BriefTestProgressListener.h>]],
|
[[#include <cppunit/BriefTestProgressListener.h>]],
|
||||||
[CppUnit::BriefTestProgressListener b; b.startTest(0);])],
|
[CppUnit::BriefTestProgressListener b; b.startTest(0);])],
|
||||||
[], [C++],
|
[], [C++],
|
||||||
[CS_EMIT_BUILD_RESULT([cs_cv_libcppunit], [CPPUNIT],
|
[CS_EMIT_BUILD_RESULT([cs_cv_libcppunit], [CPPUNIT],
|
||||||
CS_EMITTER_OPTIONAL([$1]))], [], [],
|
CS_EMITTER_OPTIONAL([$1]))], [], [],
|
||||||
[$cs_cv_libcppunit_cflags],
|
[$cs_cv_libcppunit_cflags],
|
||||||
[$cs_cv_libcppunit_lflags],
|
[$cs_cv_libcppunit_lflags],
|
||||||
[$cs_cv_libcppunit_libs])])])
|
[$cs_cv_libcppunit_libs])])])
|
||||||
|
|||||||
@@ -1,312 +1,312 @@
|
|||||||
# checklib.m4 -*- Autoconf -*-
|
# checklib.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003-2005 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003-2005 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# cs_lib_paths_default
|
# cs_lib_paths_default
|
||||||
# Whitespace delimited list of directory tuples in which to search, by
|
# Whitespace delimited list of directory tuples in which to search, by
|
||||||
# default, for external libraries. Each list item can specify an
|
# default, for external libraries. Each list item can specify an
|
||||||
# include|library directory tuple (for example, "/usr/include|/usr/lib"),
|
# include|library directory tuple (for example, "/usr/include|/usr/lib"),
|
||||||
# or a single directory (for example, "/usr"). If the second form is
|
# or a single directory (for example, "/usr"). If the second form is
|
||||||
# used, then "include" and "lib" subdirectories of the directory are
|
# used, then "include" and "lib" subdirectories of the directory are
|
||||||
# searched. If the library resources are not found, then the directory
|
# searched. If the library resources are not found, then the directory
|
||||||
# itself is searched. Thus, "/proj" is shorthand for
|
# itself is searched. Thus, "/proj" is shorthand for
|
||||||
# "/proj/include|/proj/lib /proj|/proj".
|
# "/proj/include|/proj/lib /proj|/proj".
|
||||||
#
|
#
|
||||||
# Present Cases:
|
# Present Cases:
|
||||||
# /usr/local -- Not all compilers search here by default, so we specify
|
# /usr/local -- Not all compilers search here by default, so we specify
|
||||||
# it manually.
|
# it manually.
|
||||||
# /sw -- Fink, the MacOS/X manager of Unix packages, installs here by
|
# /sw -- Fink, the MacOS/X manager of Unix packages, installs here by
|
||||||
# default.
|
# default.
|
||||||
# /opt/local -- DarwinPorts installs here by default.
|
# /opt/local -- DarwinPorts installs here by default.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
m4_define([cs_lib_paths_default],
|
m4_define([cs_lib_paths_default],
|
||||||
[/usr/local/include|/usr/local/lib \
|
[/usr/local/include|/usr/local/lib \
|
||||||
/sw/include|/sw/lib \
|
/sw/include|/sw/lib \
|
||||||
/opt/local/include|/opt/local/lib \
|
/opt/local/include|/opt/local/lib \
|
||||||
/opt/include|/opt/lib])
|
/opt/include|/opt/lib])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# cs_pkg_paths_default
|
# cs_pkg_paths_default
|
||||||
# Comma delimited list of additional directories in which the
|
# Comma delimited list of additional directories in which the
|
||||||
# `pkg-config' command should search for its `.pc' files.
|
# `pkg-config' command should search for its `.pc' files.
|
||||||
#
|
#
|
||||||
# Present Cases:
|
# Present Cases:
|
||||||
# /usr/local/lib/pkgconfig -- Although a common location for .pc files
|
# /usr/local/lib/pkgconfig -- Although a common location for .pc files
|
||||||
# installed by "make install", many `pkg-config' commands neglect
|
# installed by "make install", many `pkg-config' commands neglect
|
||||||
# to search here automatically.
|
# to search here automatically.
|
||||||
# /sw/lib/pkgconfig -- Fink, the MacOS/X manager of Unix packages,
|
# /sw/lib/pkgconfig -- Fink, the MacOS/X manager of Unix packages,
|
||||||
# installs .pc files here by default.
|
# installs .pc files here by default.
|
||||||
# /opt/local/lib/pkgconfig -- DarwinPorts installs .pc files here by
|
# /opt/local/lib/pkgconfig -- DarwinPorts installs .pc files here by
|
||||||
# default.
|
# default.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
m4_define([cs_pkg_paths_default],
|
m4_define([cs_pkg_paths_default],
|
||||||
[/usr/local/lib/pkgconfig,
|
[/usr/local/lib/pkgconfig,
|
||||||
/sw/lib/pkgconfig,
|
/sw/lib/pkgconfig,
|
||||||
/opt/local/lib/pkgconfig,
|
/opt/local/lib/pkgconfig,
|
||||||
/opt/lib/pkgconfig])
|
/opt/lib/pkgconfig])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_LIB_WITH(LIBRARY, PROGRAM, [SEARCH-LIST], [LANGUAGE],
|
# CS_CHECK_LIB_WITH(LIBRARY, PROGRAM, [SEARCH-LIST], [LANGUAGE],
|
||||||
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [OTHER-CFLAGS],
|
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [OTHER-CFLAGS],
|
||||||
# [OTHER-LFLAGS], [OTHER-LIBS], [ALIASES])
|
# [OTHER-LFLAGS], [OTHER-LIBS], [ALIASES])
|
||||||
# Very roughly similar in concept to AC_CHECK_LIB(), but allows caller to
|
# Very roughly similar in concept to AC_CHECK_LIB(), but allows caller to
|
||||||
# to provide list of directories in which to search for LIBRARY; allows
|
# to provide list of directories in which to search for LIBRARY; allows
|
||||||
# user to override library location via --with-LIBRARY=dir; and consults
|
# user to override library location via --with-LIBRARY=dir; and consults
|
||||||
# `pkg-config' (if present) and `LIBRARY-config' (if present, i.e.
|
# `pkg-config' (if present) and `LIBRARY-config' (if present, i.e.
|
||||||
# `sdl-config') in order to obtain compiler and linker flags. LIBRARY is
|
# `sdl-config') in order to obtain compiler and linker flags. LIBRARY is
|
||||||
# the name of the library or MacOS/X framework which is to be located
|
# the name of the library or MacOS/X framework which is to be located
|
||||||
# (for example, "readline" for `libreadline.a' or `readline.framework').
|
# (for example, "readline" for `libreadline.a' or `readline.framework').
|
||||||
# PROGRAM, which is typically composed with AC_LANG_PROGRAM(), is a
|
# PROGRAM, which is typically composed with AC_LANG_PROGRAM(), is a
|
||||||
# program which references at least one function or symbol in LIBRARY.
|
# program which references at least one function or symbol in LIBRARY.
|
||||||
# SEARCH-LIST is a whitespace-delimited list of paths in which to search
|
# SEARCH-LIST is a whitespace-delimited list of paths in which to search
|
||||||
# for the library and its header files, in addition to those searched by
|
# for the library and its header files, in addition to those searched by
|
||||||
# the compiler and linker by default, and those referenced by the
|
# the compiler and linker by default, and those referenced by the
|
||||||
# cs_lib_paths_default macro. Each list item can specify an
|
# cs_lib_paths_default macro. Each list item can specify an
|
||||||
# `include|library' directory tuple (for example,
|
# `include|library' directory tuple (for example,
|
||||||
# "/usr/include|/usr/lib"), or a single directory (for example, "/usr").
|
# "/usr/include|/usr/lib"), or a single directory (for example, "/usr").
|
||||||
# If the second form is used, then "include" and "lib" subdirectories of
|
# If the second form is used, then "include" and "lib" subdirectories of
|
||||||
# the directory are searched. If the library resources are not found,
|
# the directory are searched. If the library resources are not found,
|
||||||
# then the directory itself is searched. Thus, "/proj" is shorthand for
|
# then the directory itself is searched. Thus, "/proj" is shorthand for
|
||||||
# "/proj/include|/proj/lib /proj|/proj". Items in the search list can
|
# "/proj/include|/proj/lib /proj|/proj". Items in the search list can
|
||||||
# include wildcards. SEARCH-LIST can be overridden by the user with the
|
# include wildcards. SEARCH-LIST can be overridden by the user with the
|
||||||
# --with-LIBRARY=dir option, in which case only "dir/include|dir/lib" and
|
# --with-LIBRARY=dir option, in which case only "dir/include|dir/lib" and
|
||||||
# "dir|dir" are searched. If SEARCH-LIST is omitted and the user did not
|
# "dir|dir" are searched. If SEARCH-LIST is omitted and the user did not
|
||||||
# override the search list via --with-LIBRARY=dir, then only the
|
# override the search list via --with-LIBRARY=dir, then only the
|
||||||
# directories normally searched by the compiler and the directories
|
# directories normally searched by the compiler and the directories
|
||||||
# mentioned via cs_lib_paths_default are searched. LANGUAGE is typically
|
# mentioned via cs_lib_paths_default are searched. LANGUAGE is typically
|
||||||
# either C or C++ and specifies which compiler to use for the test. If
|
# either C or C++ and specifies which compiler to use for the test. If
|
||||||
# LANGUAGE is omitted, C is used. OTHER-CFLAGS, OTHER-LFLAGS, and
|
# LANGUAGE is omitted, C is used. OTHER-CFLAGS, OTHER-LFLAGS, and
|
||||||
# OTHER-LIBS can specify additional compiler flags, linker flags, and
|
# OTHER-LIBS can specify additional compiler flags, linker flags, and
|
||||||
# libraries needed to successfully link with LIBRARY. The optional
|
# libraries needed to successfully link with LIBRARY. The optional
|
||||||
# ALIASES is a comma-delimited list of library names for which to search
|
# ALIASES is a comma-delimited list of library names for which to search
|
||||||
# in case LIBRARY is not located (for example "[sdl1.2, sdl12]" for
|
# in case LIBRARY is not located (for example "[sdl1.2, sdl12]" for
|
||||||
# libsdl1.2.a, sdl1.2.framework, libsdl12.a, and sdl12.framework). If
|
# libsdl1.2.a, sdl1.2.framework, libsdl12.a, and sdl12.framework). If
|
||||||
# the library or one of its aliases is found and can be successfully
|
# the library or one of its aliases is found and can be successfully
|
||||||
# linked into a program, then the shell cache variable cs_cv_libLIBRARY
|
# linked into a program, then the shell cache variable cs_cv_libLIBRARY
|
||||||
# is set to "yes"; cs_cv_libLIBRARY_cflags, cs_cv_libLIBRARY_lflags, and
|
# is set to "yes"; cs_cv_libLIBRARY_cflags, cs_cv_libLIBRARY_lflags, and
|
||||||
# cs_cv_libLIBRARY_libs are set, respectively, to the compiler flags
|
# cs_cv_libLIBRARY_libs are set, respectively, to the compiler flags
|
||||||
# (including OTHER-CFLAGS), linker flags (including OTHER-LFLAGS), and
|
# (including OTHER-CFLAGS), linker flags (including OTHER-LFLAGS), and
|
||||||
# library references (including OTHER-LIBS) which resulted in a
|
# library references (including OTHER-LIBS) which resulted in a
|
||||||
# successful build; and ACTION-IF-FOUND is invoked. If the library was
|
# successful build; and ACTION-IF-FOUND is invoked. If the library was
|
||||||
# not found or was unlinkable, or if the user disabled the library via
|
# not found or was unlinkable, or if the user disabled the library via
|
||||||
# --without-LIBRARY, then cs_cv_libLIBRARY is set to "no" and
|
# --without-LIBRARY, then cs_cv_libLIBRARY is set to "no" and
|
||||||
# ACTION-IF-NOT-FOUND is invoked. Note that the exported shell variable
|
# ACTION-IF-NOT-FOUND is invoked. Note that the exported shell variable
|
||||||
# names are always composed from LIBRARY regardless of whether the test
|
# names are always composed from LIBRARY regardless of whether the test
|
||||||
# succeeded because the primary library was discovered or one of the
|
# succeeded because the primary library was discovered or one of the
|
||||||
# aliases.
|
# aliases.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_LIB_WITH],
|
AC_DEFUN([CS_CHECK_LIB_WITH],
|
||||||
[AC_ARG_WITH([$1], [AC_HELP_STRING([--with-$1=dir],
|
[AC_ARG_WITH([$1], [AC_HELP_STRING([--with-$1=dir],
|
||||||
[specify location of lib$1 if not detected automatically; searches
|
[specify location of lib$1 if not detected automatically; searches
|
||||||
dir/include, dir/lib, and dir])])
|
dir/include, dir/lib, and dir])])
|
||||||
|
|
||||||
# Backward compatibility: Recognize --with-lib$1 as alias for --with-$1.
|
# Backward compatibility: Recognize --with-lib$1 as alias for --with-$1.
|
||||||
AS_IF([test -n "$with_lib$1" && test -z "$with_$1"],
|
AS_IF([test -n "$with_lib$1" && test -z "$with_$1"],
|
||||||
[with_$1="$with_lib$1"])
|
[with_$1="$with_lib$1"])
|
||||||
|
|
||||||
AS_IF([test -z "$with_$1"], [with_$1=yes])
|
AS_IF([test -z "$with_$1"], [with_$1=yes])
|
||||||
AS_IF([test "$with_$1" != no],
|
AS_IF([test "$with_$1" != no],
|
||||||
[# If --with-$1 value is same as cached value, then assume other
|
[# If --with-$1 value is same as cached value, then assume other
|
||||||
# cached values are also valid; otherwise, ignore all cached values.
|
# cached values are also valid; otherwise, ignore all cached values.
|
||||||
AS_IF([test "$with_$1" != "$cs_cv_with_$1"],
|
AS_IF([test "$with_$1" != "$cs_cv_with_$1"],
|
||||||
[cs_ignore_cache=yes], [cs_ignore_cache=no])
|
[cs_ignore_cache=yes], [cs_ignore_cache=no])
|
||||||
|
|
||||||
cs_check_lib_flags=''
|
cs_check_lib_flags=''
|
||||||
AS_IF([test $with_$1 = yes],
|
AS_IF([test $with_$1 = yes],
|
||||||
[m4_foreach([cs_check_lib_alias], [$1, $10],
|
[m4_foreach([cs_check_lib_alias], [$1, $10],
|
||||||
[_CS_CHECK_LIB_PKG_CONFIG_FLAGS([cs_check_lib_flags],
|
[_CS_CHECK_LIB_PKG_CONFIG_FLAGS([cs_check_lib_flags],
|
||||||
cs_check_lib_alias)
|
cs_check_lib_alias)
|
||||||
_CS_CHECK_LIB_CONFIG_FLAGS([cs_check_lib_flags],
|
_CS_CHECK_LIB_CONFIG_FLAGS([cs_check_lib_flags],
|
||||||
cs_check_lib_alias)
|
cs_check_lib_alias)
|
||||||
])])
|
])])
|
||||||
|
|
||||||
AS_IF([test $with_$1 != yes],
|
AS_IF([test $with_$1 != yes],
|
||||||
[cs_check_lib_paths=$with_$1],
|
[cs_check_lib_paths=$with_$1],
|
||||||
[cs_check_lib_paths="| cs_lib_paths_default $3"])
|
[cs_check_lib_paths="| cs_lib_paths_default $3"])
|
||||||
m4_foreach([cs_check_lib_alias], [$1, $10],
|
m4_foreach([cs_check_lib_alias], [$1, $10],
|
||||||
[_CS_CHECK_LIB_CREATE_FLAGS([cs_check_lib_flags],
|
[_CS_CHECK_LIB_CREATE_FLAGS([cs_check_lib_flags],
|
||||||
cs_check_lib_alias, [$cs_check_lib_paths])
|
cs_check_lib_alias, [$cs_check_lib_paths])
|
||||||
])
|
])
|
||||||
|
|
||||||
CS_CHECK_BUILD([for lib$1], [cs_cv_lib$1], [$2], [$cs_check_lib_flags],
|
CS_CHECK_BUILD([for lib$1], [cs_cv_lib$1], [$2], [$cs_check_lib_flags],
|
||||||
[$4], [], [], [$cs_ignore_cache], [$7], [$8], [$9])],
|
[$4], [], [], [$cs_ignore_cache], [$7], [$8], [$9])],
|
||||||
[cs_cv_lib$1=no])
|
[cs_cv_lib$1=no])
|
||||||
|
|
||||||
cs_cv_with_$1="$with_$1"
|
cs_cv_with_$1="$with_$1"
|
||||||
AS_IF([test "$cs_cv_lib$1" = yes], [$5], [$6])])
|
AS_IF([test "$cs_cv_lib$1" = yes], [$5], [$6])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_PKG_CONFIG
|
# CS_CHECK_PKG_CONFIG
|
||||||
# Check if the `pkg-config' command is available and reasonably recent.
|
# Check if the `pkg-config' command is available and reasonably recent.
|
||||||
# This program acts as a central repository of build flags for various
|
# This program acts as a central repository of build flags for various
|
||||||
# packages. For example, to determine the compiler flags for FreeType2
|
# packages. For example, to determine the compiler flags for FreeType2
|
||||||
# use, "pkg-config --cflags freetype2"; and "pkg-config --libs freetype2"
|
# use, "pkg-config --cflags freetype2"; and "pkg-config --libs freetype2"
|
||||||
# to determine the linker flags. If `pkg-config' is found and is
|
# to determine the linker flags. If `pkg-config' is found and is
|
||||||
# sufficiently recent, PKG_CONFIG is set and AC_SUBST() invoked.
|
# sufficiently recent, PKG_CONFIG is set and AC_SUBST() invoked.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
m4_define([CS_PKG_CONFIG_MIN], [0.9.0])
|
m4_define([CS_PKG_CONFIG_MIN], [0.9.0])
|
||||||
AC_DEFUN([CS_CHECK_PKG_CONFIG],
|
AC_DEFUN([CS_CHECK_PKG_CONFIG],
|
||||||
[AS_IF([test "$cs_prog_pkg_config_checked" != yes],
|
[AS_IF([test "$cs_prog_pkg_config_checked" != yes],
|
||||||
[CS_CHECK_TOOLS([PKG_CONFIG], [pkg-config])
|
[CS_CHECK_TOOLS([PKG_CONFIG], [pkg-config])
|
||||||
_CS_CHECK_PKG_CONFIG_PREPARE_PATH
|
_CS_CHECK_PKG_CONFIG_PREPARE_PATH
|
||||||
cs_prog_pkg_config_checked=yes])
|
cs_prog_pkg_config_checked=yes])
|
||||||
AS_IF([test -z "$cs_cv_prog_pkg_config_ok"],
|
AS_IF([test -z "$cs_cv_prog_pkg_config_ok"],
|
||||||
[AS_IF([test -n "$PKG_CONFIG"],
|
[AS_IF([test -n "$PKG_CONFIG"],
|
||||||
[AS_IF([$PKG_CONFIG --atleast-pkgconfig-version=CS_PKG_CONFIG_MIN],
|
[AS_IF([$PKG_CONFIG --atleast-pkgconfig-version=CS_PKG_CONFIG_MIN],
|
||||||
[cs_cv_prog_pkg_config_ok=yes],
|
[cs_cv_prog_pkg_config_ok=yes],
|
||||||
[cs_cv_prog_pkg_config_ok=no])],
|
[cs_cv_prog_pkg_config_ok=no])],
|
||||||
[cs_cv_prog_pkg_config_ok=no])])])
|
[cs_cv_prog_pkg_config_ok=no])])])
|
||||||
|
|
||||||
AC_DEFUN([_CS_CHECK_PKG_CONFIG_PREPARE_PATH],
|
AC_DEFUN([_CS_CHECK_PKG_CONFIG_PREPARE_PATH],
|
||||||
[PKG_CONFIG_PATH="m4_foreach([cs_pkg_path], [cs_pkg_paths_default],
|
[PKG_CONFIG_PATH="m4_foreach([cs_pkg_path], [cs_pkg_paths_default],
|
||||||
[cs_pkg_path$PATH_SEPARATOR])$PKG_CONFIG_PATH"
|
[cs_pkg_path$PATH_SEPARATOR])$PKG_CONFIG_PATH"
|
||||||
export PKG_CONFIG_PATH])
|
export PKG_CONFIG_PATH])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# _CS_CHECK_LIB_PKG_CONFIG_FLAGS(VARIABLE, LIBRARY)
|
# _CS_CHECK_LIB_PKG_CONFIG_FLAGS(VARIABLE, LIBRARY)
|
||||||
# Helper macro for CS_CHECK_LIB_WITH(). Checks if `pkg-config' knows
|
# Helper macro for CS_CHECK_LIB_WITH(). Checks if `pkg-config' knows
|
||||||
# about LIBRARY and, if so, appends a build tuple consisting of the
|
# about LIBRARY and, if so, appends a build tuple consisting of the
|
||||||
# compiler and linker flags reported by `pkg-config' to the list of
|
# compiler and linker flags reported by `pkg-config' to the list of
|
||||||
# tuples stored in the shell variable VARIABLE.
|
# tuples stored in the shell variable VARIABLE.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([_CS_CHECK_LIB_PKG_CONFIG_FLAGS],
|
AC_DEFUN([_CS_CHECK_LIB_PKG_CONFIG_FLAGS],
|
||||||
[CS_CHECK_PKG_CONFIG
|
[CS_CHECK_PKG_CONFIG
|
||||||
AS_IF([test $cs_cv_prog_pkg_config_ok = yes],
|
AS_IF([test $cs_cv_prog_pkg_config_ok = yes],
|
||||||
[AC_CACHE_CHECK([if $PKG_CONFIG recognizes $2], [_CS_CLPCF_CVAR([$2])],
|
[AC_CACHE_CHECK([if $PKG_CONFIG recognizes $2], [_CS_CLPCF_CVAR([$2])],
|
||||||
[AS_IF([$PKG_CONFIG --exists $2],
|
[AS_IF([$PKG_CONFIG --exists $2],
|
||||||
[_CS_CLPCF_CVAR([$2])=yes], [_CS_CLPCF_CVAR([$2])=no])])
|
[_CS_CLPCF_CVAR([$2])=yes], [_CS_CLPCF_CVAR([$2])=no])])
|
||||||
AS_IF([test $_CS_CLPCF_CVAR([$2]) = yes],
|
AS_IF([test $_CS_CLPCF_CVAR([$2]) = yes],
|
||||||
[_CS_CHECK_LIB_CONFIG_PROG_FLAGS([$1], [pkg_config_$2],
|
[_CS_CHECK_LIB_CONFIG_PROG_FLAGS([$1], [pkg_config_$2],
|
||||||
[$PKG_CONFIG], [$2])])])])
|
[$PKG_CONFIG], [$2])])])])
|
||||||
|
|
||||||
AC_DEFUN([_CS_CLPCF_CVAR], [AS_TR_SH([cs_cv_prog_pkg_config_$1])])
|
AC_DEFUN([_CS_CLPCF_CVAR], [AS_TR_SH([cs_cv_prog_pkg_config_$1])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# _CS_CHECK_LIB_CONFIG_FLAGS(VARIABLE, LIBRARY)
|
# _CS_CHECK_LIB_CONFIG_FLAGS(VARIABLE, LIBRARY)
|
||||||
# Helper macro for CS_CHECK_LIB_WITH(). Checks if `LIBRARY-config'
|
# Helper macro for CS_CHECK_LIB_WITH(). Checks if `LIBRARY-config'
|
||||||
# (i.e. `sdl-config') exists and, if so, appends a build tuple consisting
|
# (i.e. `sdl-config') exists and, if so, appends a build tuple consisting
|
||||||
# of the compiler and linker flags reported by `LIBRARY-config' to the
|
# of the compiler and linker flags reported by `LIBRARY-config' to the
|
||||||
# list of tuples stored in the shell variable VARIABLE.
|
# list of tuples stored in the shell variable VARIABLE.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([_CS_CHECK_LIB_CONFIG_FLAGS],
|
AC_DEFUN([_CS_CHECK_LIB_CONFIG_FLAGS],
|
||||||
[CS_CHECK_TOOLS(_CS_CLCF_SHVAR([$2]), [$2-config])
|
[CS_CHECK_TOOLS(_CS_CLCF_SHVAR([$2]), [$2-config])
|
||||||
AS_IF([test -n "$_CS_CLCF_SHVAR([$2])"],
|
AS_IF([test -n "$_CS_CLCF_SHVAR([$2])"],
|
||||||
[AS_IF([test -z "$_CS_CLCF_CVAR([$2])"],
|
[AS_IF([test -z "$_CS_CLCF_CVAR([$2])"],
|
||||||
[AS_IF([$_CS_CLCF_SHVAR([$2]) --cflags --libs >/dev/null 2>&1],
|
[AS_IF([$_CS_CLCF_SHVAR([$2]) --cflags --libs >/dev/null 2>&1],
|
||||||
[_CS_CLCF_CVAR([$2])=yes], [_CS_CLCF_CVAR([$2])=no])])
|
[_CS_CLCF_CVAR([$2])=yes], [_CS_CLCF_CVAR([$2])=no])])
|
||||||
AS_IF([test $_CS_CLCF_CVAR([$2]) = yes],
|
AS_IF([test $_CS_CLCF_CVAR([$2]) = yes],
|
||||||
[_CS_CHECK_LIB_CONFIG_PROG_FLAGS([$1], [config_$2],
|
[_CS_CHECK_LIB_CONFIG_PROG_FLAGS([$1], [config_$2],
|
||||||
[$_CS_CLCF_SHVAR([$2])])])])])
|
[$_CS_CLCF_SHVAR([$2])])])])])
|
||||||
|
|
||||||
AC_DEFUN([_CS_CLCF_CVAR], [AS_TR_SH([cs_cv_prog_config_$1_ok])])
|
AC_DEFUN([_CS_CLCF_CVAR], [AS_TR_SH([cs_cv_prog_config_$1_ok])])
|
||||||
AC_DEFUN([_CS_CLCF_SHVAR], [m4_toupper(AS_TR_SH([CONFIG_$1]))])
|
AC_DEFUN([_CS_CLCF_SHVAR], [m4_toupper(AS_TR_SH([CONFIG_$1]))])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# _CS_CHECK_LIB_CONFIG_PROG_FLAGS(VARIABLE, TAG, CONFIG-PROGRAM, [ARGS])
|
# _CS_CHECK_LIB_CONFIG_PROG_FLAGS(VARIABLE, TAG, CONFIG-PROGRAM, [ARGS])
|
||||||
# Helper macro for _CS_CHECK_LIB_PKG_CONFIG_FLAGS() and
|
# Helper macro for _CS_CHECK_LIB_PKG_CONFIG_FLAGS() and
|
||||||
# _CS_CHECK_LIB_CONFIG_FLAGS(). CONFIG-PROGRAM is a command which
|
# _CS_CHECK_LIB_CONFIG_FLAGS(). CONFIG-PROGRAM is a command which
|
||||||
# responds to the --cflags and --libs options and returns suitable
|
# responds to the --cflags and --libs options and returns suitable
|
||||||
# compiler and linker flags for some package. ARGS, if supplied, is
|
# compiler and linker flags for some package. ARGS, if supplied, is
|
||||||
# passed to CONFIG-PROGRAM after the --cflags or --libs argument. The
|
# passed to CONFIG-PROGRAM after the --cflags or --libs argument. The
|
||||||
# results of the --cflags and --libs options are packed into a build
|
# results of the --cflags and --libs options are packed into a build
|
||||||
# tuple and appended to the list of tuples stored in the shell variable
|
# tuple and appended to the list of tuples stored in the shell variable
|
||||||
# VARIABLE. TAG is used to compose the name of the cache variable. A good
|
# VARIABLE. TAG is used to compose the name of the cache variable. A good
|
||||||
# choice for TAG is some unique combination of the library name and
|
# choice for TAG is some unique combination of the library name and
|
||||||
# configuration program.
|
# configuration program.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([_CS_CHECK_LIB_CONFIG_PROG_FLAGS],
|
AC_DEFUN([_CS_CHECK_LIB_CONFIG_PROG_FLAGS],
|
||||||
[AS_IF([test -z "$_CS_CLCPF_CVAR([$2])"],
|
[AS_IF([test -z "$_CS_CLCPF_CVAR([$2])"],
|
||||||
[cs_check_lib_cflag=CS_RUN_PATH_NORMALIZE([$3 --cflags $4])
|
[cs_check_lib_cflag=CS_RUN_PATH_NORMALIZE([$3 --cflags $4])
|
||||||
cs_check_lib_lflag=''
|
cs_check_lib_lflag=''
|
||||||
cs_check_lib_libs=CS_RUN_PATH_NORMALIZE([$3 --libs $4])
|
cs_check_lib_libs=CS_RUN_PATH_NORMALIZE([$3 --libs $4])
|
||||||
_CS_CLCPF_CVAR([$2])=CS_CREATE_TUPLE(
|
_CS_CLCPF_CVAR([$2])=CS_CREATE_TUPLE(
|
||||||
[$cs_check_lib_cflag],
|
[$cs_check_lib_cflag],
|
||||||
[$cs_check_lib_lflag],
|
[$cs_check_lib_lflag],
|
||||||
[$cs_check_lib_libs])])
|
[$cs_check_lib_libs])])
|
||||||
$1="$$1 $_CS_CLCPF_CVAR([$2])"])
|
$1="$$1 $_CS_CLCPF_CVAR([$2])"])
|
||||||
|
|
||||||
AC_DEFUN([_CS_CLCPF_CVAR], [AS_TR_SH([cs_cv_prog_$1_flags])])
|
AC_DEFUN([_CS_CLCPF_CVAR], [AS_TR_SH([cs_cv_prog_$1_flags])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# _CS_CHECK_LIB_CREATE_FLAGS(VARIABLE, LIBRARY, PATHS)
|
# _CS_CHECK_LIB_CREATE_FLAGS(VARIABLE, LIBRARY, PATHS)
|
||||||
# Helper macro for CS_CHECK_LIB_WITH(). Constructs a list of build
|
# Helper macro for CS_CHECK_LIB_WITH(). Constructs a list of build
|
||||||
# tuples suitable for CS_CHECK_BUILD() and appends the tuple list to the
|
# tuples suitable for CS_CHECK_BUILD() and appends the tuple list to the
|
||||||
# shell variable VARIABLE. LIBRARY and PATHS have the same meanings as
|
# shell variable VARIABLE. LIBRARY and PATHS have the same meanings as
|
||||||
# the like-named arguments of CS_CHECK_LIB_WITH().
|
# the like-named arguments of CS_CHECK_LIB_WITH().
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([_CS_CHECK_LIB_CREATE_FLAGS],
|
AC_DEFUN([_CS_CHECK_LIB_CREATE_FLAGS],
|
||||||
[for cs_lib_item in $3
|
[for cs_lib_item in $3
|
||||||
do
|
do
|
||||||
case $cs_lib_item in
|
case $cs_lib_item in
|
||||||
*\|*) CS_SPLIT(
|
*\|*) CS_SPLIT(
|
||||||
[$cs_lib_item], [cs_check_incdir,cs_check_libdir], [|])
|
[$cs_lib_item], [cs_check_incdir,cs_check_libdir], [|])
|
||||||
_CS_CHECK_LIB_CREATE_FLAG([$1],
|
_CS_CHECK_LIB_CREATE_FLAG([$1],
|
||||||
[$cs_check_incdir], [$cs_check_libdir], [$2])
|
[$cs_check_incdir], [$cs_check_libdir], [$2])
|
||||||
;;
|
;;
|
||||||
*) _CS_CHECK_LIB_CREATE_FLAG([$1],
|
*) _CS_CHECK_LIB_CREATE_FLAG([$1],
|
||||||
[$cs_lib_item/include], [$cs_lib_item/lib], [$2])
|
[$cs_lib_item/include], [$cs_lib_item/lib], [$2])
|
||||||
_CS_CHECK_LIB_CREATE_FLAG(
|
_CS_CHECK_LIB_CREATE_FLAG(
|
||||||
[$1], [$cs_lib_item], [$cs_lib_item], [$2])
|
[$1], [$cs_lib_item], [$cs_lib_item], [$2])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done])
|
done])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# _CS_CHECK_LIB_CREATE_FLAG(VARIABLE, HEADER-DIR, LIBRARY-DIR, LIBRARY)
|
# _CS_CHECK_LIB_CREATE_FLAG(VARIABLE, HEADER-DIR, LIBRARY-DIR, LIBRARY)
|
||||||
# Helper macro for _CS_CHECK_LIB_CREATE_FLAGS(). Constructs build tuples
|
# Helper macro for _CS_CHECK_LIB_CREATE_FLAGS(). Constructs build tuples
|
||||||
# suitable for CS_CHECK_BUILD() for given header and library directories,
|
# suitable for CS_CHECK_BUILD() for given header and library directories,
|
||||||
# and appends the tuples to the shell variable VARIABLE. Synthesizes
|
# and appends the tuples to the shell variable VARIABLE. Synthesizes
|
||||||
# tuples which check for LIBRARY as a MacOS/X framework, and a standard
|
# tuples which check for LIBRARY as a MacOS/X framework, and a standard
|
||||||
# link library.
|
# link library.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([_CS_CHECK_LIB_CREATE_FLAG],
|
AC_DEFUN([_CS_CHECK_LIB_CREATE_FLAG],
|
||||||
[AS_IF([test -n "$2"], [cs_check_lib_cflag="-I$2"], [cs_check_lib_cflag=''])
|
[AS_IF([test -n "$2"], [cs_check_lib_cflag="-I$2"], [cs_check_lib_cflag=''])
|
||||||
AS_IF([test -n "$3"], [cs_check_lib_lflag="-L$3"], [cs_check_lib_lflag=''])
|
AS_IF([test -n "$3"], [cs_check_lib_lflag="-L$3"], [cs_check_lib_lflag=''])
|
||||||
AS_IF([test -n "$4"],
|
AS_IF([test -n "$4"],
|
||||||
[cs_check_lib_libs="-l$4"
|
[cs_check_lib_libs="-l$4"
|
||||||
cs_check_lib_framework="-framework $4"],
|
cs_check_lib_framework="-framework $4"],
|
||||||
[cs_check_lib_libs=''
|
[cs_check_lib_libs=''
|
||||||
cs_check_lib_framework=''])
|
cs_check_lib_framework=''])
|
||||||
$1="$$1
|
$1="$$1
|
||||||
CS_CREATE_TUPLE(
|
CS_CREATE_TUPLE(
|
||||||
[$cs_check_lib_cflag],
|
[$cs_check_lib_cflag],
|
||||||
[$cs_check_lib_lflag],
|
[$cs_check_lib_lflag],
|
||||||
[$cs_check_lib_framework])
|
[$cs_check_lib_framework])
|
||||||
CS_CREATE_TUPLE(
|
CS_CREATE_TUPLE(
|
||||||
[$cs_check_lib_cflag],
|
[$cs_check_lib_cflag],
|
||||||
[$cs_check_lib_lflag],
|
[$cs_check_lib_lflag],
|
||||||
[$cs_check_lib_libs])"])
|
[$cs_check_lib_libs])"])
|
||||||
|
|||||||
@@ -1,68 +1,68 @@
|
|||||||
# checklibtool.m4 -*- Autoconf -*-
|
# checklibtool.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_LIBTOOL
|
# CS_CHECK_LIBTOOL
|
||||||
# Find and identify the various implementations of libtool. In
|
# Find and identify the various implementations of libtool. In
|
||||||
# particular, this macro is aware of GNU libtool and Apple's libtool
|
# particular, this macro is aware of GNU libtool and Apple's libtool
|
||||||
# (which serves a completely different purpose). On MacOS/X, GNU libtool
|
# (which serves a completely different purpose). On MacOS/X, GNU libtool
|
||||||
# is typically named glibtool, however a user might also use Fink to
|
# is typically named glibtool, however a user might also use Fink to
|
||||||
# install the unadorned libtool; and the Fink-installed version might
|
# install the unadorned libtool; and the Fink-installed version might
|
||||||
# shadow Apple's own libtool if it appears in the PATH before the Apple
|
# shadow Apple's own libtool if it appears in the PATH before the Apple
|
||||||
# tool. This macro jumps through the necessary hoops to distinguish and
|
# tool. This macro jumps through the necessary hoops to distinguish and
|
||||||
# locate the various implementations. Sets the shell variable LIBTOOL to
|
# locate the various implementations. Sets the shell variable LIBTOOL to
|
||||||
# the located GNU libtool (if any), and APPLE_LIBTOOL to the located
|
# the located GNU libtool (if any), and APPLE_LIBTOOL to the located
|
||||||
# Apple libtool. Invokes AC_SUBST() for LIBTOOL and APPLE_LIBTOOL.
|
# Apple libtool. Invokes AC_SUBST() for LIBTOOL and APPLE_LIBTOOL.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_LIBTOOL],
|
AC_DEFUN([CS_CHECK_LIBTOOL],
|
||||||
[# GNU: Search for libtool before glibtool since Fink version is likely newer.
|
[# GNU: Search for libtool before glibtool since Fink version is likely newer.
|
||||||
m4_define([cs_lt_path_gnu],
|
m4_define([cs_lt_path_gnu],
|
||||||
[/sw/bin$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR$PATH])
|
[/sw/bin$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR$PATH])
|
||||||
AS_IF([test -z "$LIBTOOL"],
|
AS_IF([test -z "$LIBTOOL"],
|
||||||
[CS_CHECK_TOOLS([LIBTOOL_TEST], [libtool glibtool gnulibtool], [],
|
[CS_CHECK_TOOLS([LIBTOOL_TEST], [libtool glibtool gnulibtool], [],
|
||||||
[cs_lt_path_gnu])
|
[cs_lt_path_gnu])
|
||||||
AS_IF([test -n "$LIBTOOL_TEST"],
|
AS_IF([test -n "$LIBTOOL_TEST"],
|
||||||
[CS_PATH_PROG([LIBTOOL_PATH], [$LIBTOOL_TEST], [], [cs_lt_path_gnu])
|
[CS_PATH_PROG([LIBTOOL_PATH], [$LIBTOOL_TEST], [], [cs_lt_path_gnu])
|
||||||
CS_LIBTOOL_CLASSIFY([$LIBTOOL_PATH],
|
CS_LIBTOOL_CLASSIFY([$LIBTOOL_PATH],
|
||||||
[LIBTOOL="$LIBTOOL_PATH"],
|
[LIBTOOL="$LIBTOOL_PATH"],
|
||||||
[AS_IF([test -z "$APPLE_LIBTOOL"], [APPLE_LIBTOOL="$LIBTOOL_PATH"])
|
[AS_IF([test -z "$APPLE_LIBTOOL"], [APPLE_LIBTOOL="$LIBTOOL_PATH"])
|
||||||
CS_CHECK_TOOLS([LIBTOOL], [glibtool gnulibtool])])])])
|
CS_CHECK_TOOLS([LIBTOOL], [glibtool gnulibtool])])])])
|
||||||
AC_SUBST([LIBTOOL])
|
AC_SUBST([LIBTOOL])
|
||||||
|
|
||||||
# Apple: Ensure that Apple libtool will be found before GNU libtool from Fink.
|
# Apple: Ensure that Apple libtool will be found before GNU libtool from Fink.
|
||||||
m4_define([cs_lt_path_apple],[/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH])
|
m4_define([cs_lt_path_apple],[/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH])
|
||||||
AS_IF([test -z "$APPLE_LIBTOOL"],
|
AS_IF([test -z "$APPLE_LIBTOOL"],
|
||||||
[CS_PATH_PROG([CS_LT_APPLE], [libtool], [], [cs_lt_path_apple])
|
[CS_PATH_PROG([CS_LT_APPLE], [libtool], [], [cs_lt_path_apple])
|
||||||
CS_LIBTOOL_CLASSIFY([$CS_LT_APPLE], [],
|
CS_LIBTOOL_CLASSIFY([$CS_LT_APPLE], [],
|
||||||
[APPLE_LIBTOOL="$CS_LT_APPLE"])])
|
[APPLE_LIBTOOL="$CS_LT_APPLE"])])
|
||||||
AC_SUBST([APPLE_LIBTOOL])])
|
AC_SUBST([APPLE_LIBTOOL])])
|
||||||
|
|
||||||
AC_DEFUN([CS_LIBTOOL_CLASSIFY],
|
AC_DEFUN([CS_LIBTOOL_CLASSIFY],
|
||||||
[AS_IF([test -n "$1"],
|
[AS_IF([test -n "$1"],
|
||||||
[AC_MSG_CHECKING([classification of $1])
|
[AC_MSG_CHECKING([classification of $1])
|
||||||
CS_LIBTOOL_GNU_IFELSE([$1],
|
CS_LIBTOOL_GNU_IFELSE([$1],
|
||||||
[AC_MSG_RESULT([gnu])
|
[AC_MSG_RESULT([gnu])
|
||||||
$2],
|
$2],
|
||||||
[AC_MSG_RESULT([apple])
|
[AC_MSG_RESULT([apple])
|
||||||
$3])])])
|
$3])])])
|
||||||
|
|
||||||
AC_DEFUN([CS_LIBTOOL_GNU_IFELSE],
|
AC_DEFUN([CS_LIBTOOL_GNU_IFELSE],
|
||||||
[AS_IF([AC_RUN_LOG([$1 --version 1>&2])], [$2], [$3])])
|
[AS_IF([AC_RUN_LOG([$1 --version 1>&2])], [$2], [$3])])
|
||||||
|
|||||||
@@ -1,235 +1,235 @@
|
|||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003-2006 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003-2006 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_OPENGL
|
# CS_CHECK_OPENGL
|
||||||
# Check for OpenGL.
|
# Check for OpenGL.
|
||||||
#
|
#
|
||||||
# IMPLEMENTATION NOTES
|
# IMPLEMENTATION NOTES
|
||||||
#
|
#
|
||||||
# Some Mesa installations require pthread, so pthread flags are employed if
|
# Some Mesa installations require pthread, so pthread flags are employed if
|
||||||
# available.
|
# available.
|
||||||
#
|
#
|
||||||
# The check for opengl32 needs to precede other checks because Cygwin users
|
# The check for opengl32 needs to precede other checks because Cygwin users
|
||||||
# often have Mesa installed, and Mesa's OpenGL library is compiled without the
|
# often have Mesa installed, and Mesa's OpenGL library is compiled without the
|
||||||
# __stdcall flags which results in link errors, whereas Microsoft's native
|
# __stdcall flags which results in link errors, whereas Microsoft's native
|
||||||
# opengl32 works fine. Conversely, some Unix implementations have Wine
|
# opengl32 works fine. Conversely, some Unix implementations have Wine
|
||||||
# installed (Windows emulation layer) which includes an opengl32.so library.
|
# installed (Windows emulation layer) which includes an opengl32.so library.
|
||||||
# We need to avoid detection of this library on Unix since it would cause an
|
# We need to avoid detection of this library on Unix since it would cause an
|
||||||
# undesirable dependence upon Wine.
|
# undesirable dependence upon Wine.
|
||||||
#
|
#
|
||||||
# Many OpenGL libraries on Unix already contain GLX, so there is no separate
|
# Many OpenGL libraries on Unix already contain GLX, so there is no separate
|
||||||
# GLX library, thus we first check for GLX using the discovered OpenGL library
|
# GLX library, thus we first check for GLX using the discovered OpenGL library
|
||||||
# before attempting to locate a separate GLX-specific library.
|
# before attempting to locate a separate GLX-specific library.
|
||||||
#
|
#
|
||||||
# On MacOS/X, some users have XFree86 installed which creates a link from
|
# On MacOS/X, some users have XFree86 installed which creates a link from
|
||||||
# /usr/include/GL to /usr/X11R6/include/GL. We want to ignore this directory
|
# /usr/include/GL to /usr/X11R6/include/GL. We want to ignore this directory
|
||||||
# and instead check for Apple's OpenGL.framework, if we are not cross-building
|
# and instead check for Apple's OpenGL.framework, if we are not cross-building
|
||||||
# for Darwin. We accomplish this by placing the OpenGL.framework test ahead of
|
# for Darwin. We accomplish this by placing the OpenGL.framework test ahead of
|
||||||
# the other tests.
|
# the other tests.
|
||||||
#
|
#
|
||||||
# At least one user (Jorrit) has a strange installation in which inclusion of
|
# At least one user (Jorrit) has a strange installation in which inclusion of
|
||||||
# <windows.h> fails if an int32 is not present, thus we must take this into
|
# <windows.h> fails if an int32 is not present, thus we must take this into
|
||||||
# account.
|
# account.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
m4_define([cs_define_int32],
|
m4_define([cs_define_int32],
|
||||||
[[#if !HAVE_TYPE_INT32
|
[[#if !HAVE_TYPE_INT32
|
||||||
typedef long int32;
|
typedef long int32;
|
||||||
#endif
|
#endif
|
||||||
]])
|
]])
|
||||||
|
|
||||||
# CS_GL_INCLUDE(CPP-MACRO,FALLBACK,HEADER)
|
# CS_GL_INCLUDE(CPP-MACRO,FALLBACK,HEADER)
|
||||||
AC_DEFUN([CS_GL_INCLUDE],
|
AC_DEFUN([CS_GL_INCLUDE],
|
||||||
[[#if HAVE_WINDOWS_H
|
[[#if HAVE_WINDOWS_H
|
||||||
#if !HAVE_TYPE_INT32
|
#if !HAVE_TYPE_INT32
|
||||||
typedef long int32;
|
typedef long int32;
|
||||||
#endif
|
#endif
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
#ifndef CS_HEADER_GLOBAL
|
#ifndef CS_HEADER_GLOBAL
|
||||||
#define CS_HEADER_GLOBAL(X,Y) CS_HEADER_GLOBAL_COMPOSE(X,Y)
|
#define CS_HEADER_GLOBAL(X,Y) CS_HEADER_GLOBAL_COMPOSE(X,Y)
|
||||||
#define CS_HEADER_GLOBAL_COMPOSE(X,Y) <X/Y>
|
#define CS_HEADER_GLOBAL_COMPOSE(X,Y) <X/Y>
|
||||||
#endif
|
#endif
|
||||||
#ifdef $1
|
#ifdef $1
|
||||||
#include CS_HEADER_GLOBAL($1,$3)
|
#include CS_HEADER_GLOBAL($1,$3)
|
||||||
#else
|
#else
|
||||||
#include <$2/$3>
|
#include <$2/$3>
|
||||||
#endif]])
|
#endif]])
|
||||||
|
|
||||||
AC_DEFUN([CS_CHECK_OPENGL],
|
AC_DEFUN([CS_CHECK_OPENGL],
|
||||||
[AC_REQUIRE([CS_CHECK_HOST])
|
[AC_REQUIRE([CS_CHECK_HOST])
|
||||||
AC_REQUIRE([CS_CHECK_COMMON_LIBS])
|
AC_REQUIRE([CS_CHECK_COMMON_LIBS])
|
||||||
AC_REQUIRE([CS_CHECK_PTHREAD])
|
AC_REQUIRE([CS_CHECK_PTHREAD])
|
||||||
AC_REQUIRE([AC_PATH_X])
|
AC_REQUIRE([AC_PATH_X])
|
||||||
AC_REQUIRE([AC_PATH_XTRA])
|
AC_REQUIRE([AC_PATH_XTRA])
|
||||||
AC_CHECK_TYPE([int32], [AC_DEFINE([HAVE_TYPE_INT32], [],
|
AC_CHECK_TYPE([int32], [AC_DEFINE([HAVE_TYPE_INT32], [],
|
||||||
[Whether the int32 type is available])], [])
|
[Whether the int32 type is available])], [])
|
||||||
AC_CHECK_HEADERS([windows.h], [], [], [cs_define_int32])
|
AC_CHECK_HEADERS([windows.h], [], [], [cs_define_int32])
|
||||||
|
|
||||||
# Apply plaform-specific flags if necessary.
|
# Apply plaform-specific flags if necessary.
|
||||||
cs_gl_plat_cflags=''
|
cs_gl_plat_cflags=''
|
||||||
cs_gl_plat_lflags=''
|
cs_gl_plat_lflags=''
|
||||||
cs_gl_plat_libs=''
|
cs_gl_plat_libs=''
|
||||||
AS_IF([test -n "$cs_cv_libm_cflags$cs_cv_libm_lflags$cs_cv_libm_libs"],
|
AS_IF([test -n "$cs_cv_libm_cflags$cs_cv_libm_lflags$cs_cv_libm_libs"],
|
||||||
[cs_gl_plat_cflags="$cs_cv_libm_cflags $cs_gl_plat_cflags"
|
[cs_gl_plat_cflags="$cs_cv_libm_cflags $cs_gl_plat_cflags"
|
||||||
cs_gl_plat_lflags="$cs_cv_libm_lflags $cs_gl_plat_lflags"
|
cs_gl_plat_lflags="$cs_cv_libm_lflags $cs_gl_plat_lflags"
|
||||||
cs_gl_plat_libs="$cs_cv_libm_libs $cs_gl_plat_libs"])
|
cs_gl_plat_libs="$cs_cv_libm_libs $cs_gl_plat_libs"])
|
||||||
AS_IF([test $cs_cv_sys_pthread = yes],
|
AS_IF([test $cs_cv_sys_pthread = yes],
|
||||||
[cs_gl_plat_cflags="$cs_cv_sys_pthread_cflags $cs_gl_plat_cflags"
|
[cs_gl_plat_cflags="$cs_cv_sys_pthread_cflags $cs_gl_plat_cflags"
|
||||||
cs_gl_plat_lflags="$cs_cv_sys_pthread_lflags $cs_gl_plat_lflags"
|
cs_gl_plat_lflags="$cs_cv_sys_pthread_lflags $cs_gl_plat_lflags"
|
||||||
cs_gl_plat_libs="$cs_cv_sys_pthread_libs $cs_gl_plat_libs"])
|
cs_gl_plat_libs="$cs_cv_sys_pthread_libs $cs_gl_plat_libs"])
|
||||||
AS_IF([test "$no_x" != yes],
|
AS_IF([test "$no_x" != yes],
|
||||||
[cs_gl_plat_cflags="$X_CFLAGS $cs_gl_plat_cflags"
|
[cs_gl_plat_cflags="$X_CFLAGS $cs_gl_plat_cflags"
|
||||||
cs_gl_plat_lflags="$cs_gl_plat_lflags"
|
cs_gl_plat_lflags="$cs_gl_plat_lflags"
|
||||||
cs_gl_plat_libs="
|
cs_gl_plat_libs="
|
||||||
$X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS $cs_gl_plat_libs"])
|
$X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS $cs_gl_plat_libs"])
|
||||||
|
|
||||||
# Mesa requested?
|
# Mesa requested?
|
||||||
AC_ARG_WITH([mesa], [AC_HELP_STRING([--with-mesa],
|
AC_ARG_WITH([mesa], [AC_HELP_STRING([--with-mesa],
|
||||||
[use Mesa OpenGL library if available (default YES)])],
|
[use Mesa OpenGL library if available (default YES)])],
|
||||||
[], [with_mesa=yes])
|
[], [with_mesa=yes])
|
||||||
|
|
||||||
AS_IF([test $with_mesa != no],
|
AS_IF([test $with_mesa != no],
|
||||||
[cs_mesa_gl=CS_CREATE_TUPLE([],[],[-lMesaGL])])
|
[cs_mesa_gl=CS_CREATE_TUPLE([],[],[-lMesaGL])])
|
||||||
|
|
||||||
# MacOS/X or Darwin?
|
# MacOS/X or Darwin?
|
||||||
AS_IF([test "x$cs_host_macosx" = "xyes"],
|
AS_IF([test "x$cs_host_macosx" = "xyes"],
|
||||||
[cs_osx_gl=CS_CREATE_TUPLE([-DCS_OPENGL_PATH=OpenGL],[],[-framework OpenGL])])
|
[cs_osx_gl=CS_CREATE_TUPLE([-DCS_OPENGL_PATH=OpenGL],[],[-framework OpenGL])])
|
||||||
|
|
||||||
# Windows?
|
# Windows?
|
||||||
AS_IF([test $cs_host_family = windows],
|
AS_IF([test $cs_host_family = windows],
|
||||||
[cs_win32_gl=CS_CREATE_TUPLE([],[],[-lopengl32])])
|
[cs_win32_gl=CS_CREATE_TUPLE([],[],[-lopengl32])])
|
||||||
|
|
||||||
# Check for OpenGL.
|
# Check for OpenGL.
|
||||||
CS_CHECK_BUILD([for OpenGL], [cs_cv_libgl],
|
CS_CHECK_BUILD([for OpenGL], [cs_cv_libgl],
|
||||||
[AC_LANG_PROGRAM([CS_GL_INCLUDE([CS_OPENGL_PATH],[GL],[gl.h])],[glEnd()])],
|
[AC_LANG_PROGRAM([CS_GL_INCLUDE([CS_OPENGL_PATH],[GL],[gl.h])],[glEnd()])],
|
||||||
[$cs_win32_gl \
|
[$cs_win32_gl \
|
||||||
$cs_osx_gl \
|
$cs_osx_gl \
|
||||||
CS_CREATE_TUPLE([],[],[-lGL]) \
|
CS_CREATE_TUPLE([],[],[-lGL]) \
|
||||||
CS_CREATE_TUPLE([],[],[-lgl]) \
|
CS_CREATE_TUPLE([],[],[-lgl]) \
|
||||||
$cs_mesa_gl], [],
|
$cs_mesa_gl], [],
|
||||||
[CS_EMIT_BUILD_RESULT([cs_cv_libgl], [GL])], [], [],
|
[CS_EMIT_BUILD_RESULT([cs_cv_libgl], [GL])], [], [],
|
||||||
[$cs_gl_plat_cflags], [$cs_gl_plat_lflags], [$cs_gl_plat_libs])])
|
[$cs_gl_plat_cflags], [$cs_gl_plat_lflags], [$cs_gl_plat_libs])])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_GLU
|
# CS_CHECK_GLU
|
||||||
# Check for GLU.
|
# Check for GLU.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_GLU],
|
AC_DEFUN([CS_CHECK_GLU],
|
||||||
[AC_REQUIRE([CS_CHECK_OPENGL])
|
[AC_REQUIRE([CS_CHECK_OPENGL])
|
||||||
AS_IF([test $cs_cv_libgl = yes],
|
AS_IF([test $cs_cv_libgl = yes],
|
||||||
[AS_IF([test $with_mesa != no],
|
[AS_IF([test $with_mesa != no],
|
||||||
[cs_mesa_glu=CS_CREATE_TUPLE([],[],[-lMesaGLU])])
|
[cs_mesa_glu=CS_CREATE_TUPLE([],[],[-lMesaGLU])])
|
||||||
|
|
||||||
# MacOS/X or Darwin?
|
# MacOS/X or Darwin?
|
||||||
AS_IF([test "x$cs_host_macosx" = "xyes"],
|
AS_IF([test "x$cs_host_macosx" = "xyes"],
|
||||||
[cs_osx_glu=CS_CREATE_TUPLE([-DCS_GLU_PATH=OpenGL],[],[-framework OpenGL])])
|
[cs_osx_glu=CS_CREATE_TUPLE([-DCS_GLU_PATH=OpenGL],[],[-framework OpenGL])])
|
||||||
|
|
||||||
# Windows?
|
# Windows?
|
||||||
AS_IF([test $cs_host_family = windows],
|
AS_IF([test $cs_host_family = windows],
|
||||||
[cs_win32_gl=CS_CREATE_TUPLE([],[],[-lopengl32])])
|
[cs_win32_glu=CS_CREATE_TUPLE([],[],[-lglu32])])
|
||||||
|
|
||||||
# Check for GLU.
|
# Check for GLU.
|
||||||
CS_CHECK_BUILD([for GLU], [cs_cv_libglu],
|
CS_CHECK_BUILD([for GLU], [cs_cv_libglu],
|
||||||
[AC_LANG_PROGRAM(
|
[AC_LANG_PROGRAM(
|
||||||
[CS_GL_INCLUDE([CS_GLU_PATH],[GL],[glu.h])], [gluNewQuadric()])],
|
[CS_GL_INCLUDE([CS_GLU_PATH],[GL],[glu.h])], [gluNewQuadric()])],
|
||||||
[$cs_osx_glu \
|
[$cs_osx_glu \
|
||||||
CS_CREATE_TUPLE() \
|
CS_CREATE_TUPLE() \
|
||||||
$cs_win32_glu \
|
$cs_win32_glu \
|
||||||
CS_CREATE_TUPLE([],[],[-lGLU]) \
|
CS_CREATE_TUPLE([],[],[-lGLU]) \
|
||||||
CS_CREATE_TUPLE([],[],[-lglu]) \
|
CS_CREATE_TUPLE([],[],[-lglu]) \
|
||||||
$cs_mesa_glu], [],
|
$cs_mesa_glu], [],
|
||||||
[CS_EMIT_BUILD_RESULT([cs_cv_libglu], [GLU])], [], [],
|
[CS_EMIT_BUILD_RESULT([cs_cv_libglu], [GLU])], [], [],
|
||||||
[$cs_cv_libgl_cflags], [$cs_cv_libgl_lflags], [$cs_cv_libgl_libs])])])
|
[$cs_cv_libgl_cflags], [$cs_cv_libgl_lflags], [$cs_cv_libgl_libs])])])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_GLX
|
# CS_CHECK_GLX
|
||||||
# Check for GLX.
|
# Check for GLX.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_GLX],
|
AC_DEFUN([CS_CHECK_GLX],
|
||||||
[AC_REQUIRE([CS_CHECK_OPENGL])
|
[AC_REQUIRE([CS_CHECK_OPENGL])
|
||||||
AS_IF([test $cs_cv_libgl = yes],
|
AS_IF([test $cs_cv_libgl = yes],
|
||||||
[AS_IF([test $with_mesa != no],
|
[AS_IF([test $with_mesa != no],
|
||||||
[cs_mesa_glx=CS_CREATE_TUPLE([],[],[-lMesaGLX])])
|
[cs_mesa_glx=CS_CREATE_TUPLE([],[],[-lMesaGLX])])
|
||||||
|
|
||||||
# Check for GLX.
|
# Check for GLX.
|
||||||
AS_IF([test "$no_x" != yes],
|
AS_IF([test "$no_x" != yes],
|
||||||
[CS_CHECK_BUILD([for GLX], [cs_cv_libglx],
|
[CS_CHECK_BUILD([for GLX], [cs_cv_libglx],
|
||||||
[AC_LANG_PROGRAM([[#include <GL/glx.h>]], [glXWaitGL()])],
|
[AC_LANG_PROGRAM([[#include <GL/glx.h>]], [glXWaitGL()])],
|
||||||
[CS_CREATE_TUPLE() \
|
[CS_CREATE_TUPLE() \
|
||||||
CS_CREATE_TUPLE([],[],[-lGLX]) \
|
CS_CREATE_TUPLE([],[],[-lGLX]) \
|
||||||
CS_CREATE_TUPLE([],[],[-lglx]) \
|
CS_CREATE_TUPLE([],[],[-lglx]) \
|
||||||
$cs_mesa_glx], [],
|
$cs_mesa_glx], [],
|
||||||
[CS_EMIT_BUILD_RESULT([cs_cv_libglx], [GLX])], [], [],
|
[CS_EMIT_BUILD_RESULT([cs_cv_libglx], [GLX])], [], [],
|
||||||
[$cs_cv_libgl_cflags], [$cs_cv_libgl_lflags], [$cs_cv_libgl_libs])])])])
|
[$cs_cv_libgl_cflags], [$cs_cv_libgl_lflags], [$cs_cv_libgl_libs])])])])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_GLXEXT([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
# CS_CHECK_GLXEXT([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||||
# Check for GLX extensions.
|
# Check for GLX extensions.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_GLXEXT],
|
AC_DEFUN([CS_CHECK_GLXEXT],
|
||||||
[AC_REQUIRE([CS_CHECK_GLX])
|
[AC_REQUIRE([CS_CHECK_GLX])
|
||||||
AS_IF([test x$cs_cv_libglx = "xyes"],
|
AS_IF([test x$cs_cv_libglx = "xyes"],
|
||||||
[# Check for GLX extensions.
|
[# Check for GLX extensions.
|
||||||
CS_CHECK_BUILD([for GLX extensions], [cs_cv_libglx_extensions],
|
CS_CHECK_BUILD([for GLX extensions], [cs_cv_libglx_extensions],
|
||||||
[AC_LANG_PROGRAM(
|
[AC_LANG_PROGRAM(
|
||||||
[[#define GLX_GLXEXT_PROTOTYPES
|
[[#define GLX_GLXEXT_PROTOTYPES
|
||||||
#include <GL/glx.h>]],
|
#include <GL/glx.h>]],
|
||||||
[glXGetProcAddressARB(0)])],
|
[glXGetProcAddressARB(0)])],
|
||||||
[CS_CREATE_TUPLE(
|
[CS_CREATE_TUPLE(
|
||||||
[$cs_cv_libglx_cflags],
|
[$cs_cv_libglx_cflags],
|
||||||
[$cs_cv_libglx_lflags],
|
[$cs_cv_libglx_lflags],
|
||||||
[$cs_cv_libglx_libs])],
|
[$cs_cv_libglx_libs])],
|
||||||
[], [$1], [$2])])])
|
[], [$1], [$2])])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_GLUT
|
# CS_CHECK_GLUT
|
||||||
# Check for GLUT.
|
# Check for GLUT.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_GLUT],
|
AC_DEFUN([CS_CHECK_GLUT],
|
||||||
[AC_REQUIRE([CS_CHECK_GLU])
|
[AC_REQUIRE([CS_CHECK_GLU])
|
||||||
AS_IF([test x$cs_cv_libglu = "xyes"],
|
AS_IF([test x$cs_cv_libglu = "xyes"],
|
||||||
[# MacOS/X or Darwin?
|
[# MacOS/X or Darwin?
|
||||||
AS_IF([test "x$cs_host_macosx" = "xyes"],
|
AS_IF([test "x$cs_host_macosx" = "xyes"],
|
||||||
[cs_osx_glut=CS_CREATE_TUPLE([-DCS_GLUT_PATH=GLUT],[],[-framework GLUT])])
|
[cs_osx_glut=CS_CREATE_TUPLE([-DCS_GLUT_PATH=GLUT],[],[-framework GLUT])])
|
||||||
|
|
||||||
# Windows?
|
# Windows?
|
||||||
AS_IF([test $cs_host_family = windows],
|
AS_IF([test $cs_host_family = windows],
|
||||||
[cs_win32_glut=CS_CREATE_TUPLE([],[],[-lglut32])])
|
[cs_win32_glut=CS_CREATE_TUPLE([],[],[-lglut32])])
|
||||||
|
|
||||||
# Check for GLUT.
|
# Check for GLUT.
|
||||||
CS_CHECK_BUILD([for GLUT], [cs_cv_libglut],
|
CS_CHECK_BUILD([for GLUT], [cs_cv_libglut],
|
||||||
[AC_LANG_PROGRAM(
|
[AC_LANG_PROGRAM(
|
||||||
[CS_GL_INCLUDE([CS_GLUT_PATH],[GL],[glut.h])], [glutSwapBuffers()])],
|
[CS_GL_INCLUDE([CS_GLUT_PATH],[GL],[glut.h])], [glutSwapBuffers()])],
|
||||||
[$cs_osx_glut \
|
[$cs_osx_glut \
|
||||||
CS_CREATE_TUPLE() \
|
CS_CREATE_TUPLE() \
|
||||||
$cs_win32_glut \
|
$cs_win32_glut \
|
||||||
CS_CREATE_TUPLE([],[],[-lGLUT]) \
|
CS_CREATE_TUPLE([],[],[-lGLUT]) \
|
||||||
CS_CREATE_TUPLE([],[],[-lglut])], [],
|
CS_CREATE_TUPLE([],[],[-lglut])], [],
|
||||||
[CS_EMIT_BUILD_RESULT([cs_cv_libglut], [GLUT])], [], [],
|
[CS_EMIT_BUILD_RESULT([cs_cv_libglut], [GLUT])], [], [],
|
||||||
[$cs_cv_libgl_cflags $cs_cv_libglu_cflags],
|
[$cs_cv_libgl_cflags $cs_cv_libglu_cflags],
|
||||||
[$cs_cv_libgl_lflags $cs_cv_libglu_lflags],
|
[$cs_cv_libgl_lflags $cs_cv_libglu_lflags],
|
||||||
[$cs_cv_libgl_libs $cs_cv_libglu_libs])])])
|
[$cs_cv_libgl_libs $cs_cv_libglu_libs])])])
|
||||||
|
|
||||||
|
|||||||
@@ -1,59 +1,59 @@
|
|||||||
# checkpic.m4 -*- Autoconf -*-
|
# checkpic.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_COMPILER_PIC([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
# CS_COMPILER_PIC([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
||||||
# [ACTION-IF-NOT-FOUND])
|
# [ACTION-IF-NOT-FOUND])
|
||||||
# Check if compiler can be instructed to produce
|
# Check if compiler can be instructed to produce
|
||||||
# position-independent-code (PIC). This feature is required by some
|
# position-independent-code (PIC). This feature is required by some
|
||||||
# platforms when building plugin modules and shared libraries. If
|
# platforms when building plugin modules and shared libraries. If
|
||||||
# LANGUAGE is not provided, then `C' is assumed (other options include
|
# LANGUAGE is not provided, then `C' is assumed (other options include
|
||||||
# `C++'). If CACHE-VAR is not provided, then it defaults to the name
|
# `C++'). If CACHE-VAR is not provided, then it defaults to the name
|
||||||
# "cs_cv_prog_compiler_pic". If a PIC-enabling option (such as `-fPIC')
|
# "cs_cv_prog_compiler_pic". If a PIC-enabling option (such as `-fPIC')
|
||||||
# is discovered, then it is assigned to CACHE-VAR and ACTION-IF-FOUND is
|
# is discovered, then it is assigned to CACHE-VAR and ACTION-IF-FOUND is
|
||||||
# invoked; otherwise the empty string is assigned to CACHE-VAR and
|
# invoked; otherwise the empty string is assigned to CACHE-VAR and
|
||||||
# ACTION-IF-NOT-FOUND is invoked.
|
# ACTION-IF-NOT-FOUND is invoked.
|
||||||
#
|
#
|
||||||
# IMPLEMENTATION NOTES
|
# IMPLEMENTATION NOTES
|
||||||
#
|
#
|
||||||
# On some platforms (such as Windows), the -fPIC option is superfluous
|
# On some platforms (such as Windows), the -fPIC option is superfluous
|
||||||
# and emits a warning "-fPIC ignored for target (all code is position
|
# and emits a warning "-fPIC ignored for target (all code is position
|
||||||
# independent)", despite the fact that the compiler accepts the option
|
# independent)", despite the fact that the compiler accepts the option
|
||||||
# and returns a success code. We want to re-interpret the warning as a
|
# and returns a success code. We want to re-interpret the warning as a
|
||||||
# failure in order to avoid unnecessary compiler diagnostics in case the
|
# failure in order to avoid unnecessary compiler diagnostics in case the
|
||||||
# client inserts the result of this check into CFLAGS, for instance. We
|
# client inserts the result of this check into CFLAGS, for instance. We
|
||||||
# do so by attempting to promote warnings to errors using the result of
|
# do so by attempting to promote warnings to errors using the result of
|
||||||
# CS_COMPILER_ERRORS(). As an extra safe-guard, we also scan the compiler
|
# CS_COMPILER_ERRORS(). As an extra safe-guard, we also scan the compiler
|
||||||
# output for an appropriate diagnostic because some gcc warnings fail to
|
# output for an appropriate diagnostic because some gcc warnings fail to
|
||||||
# promote to error status despite use of -Werror.
|
# promote to error status despite use of -Werror.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_COMPILER_PIC],
|
AC_DEFUN([CS_COMPILER_PIC],
|
||||||
[CS_COMPILER_ERRORS([$1],
|
[CS_COMPILER_ERRORS([$1],
|
||||||
[m4_default([$2_werror],[cs_cv_prog_compiler_pic_werror])])
|
[m4_default([$2_werror],[cs_cv_prog_compiler_pic_werror])])
|
||||||
CS_CHECK_BUILD_FLAGS(
|
CS_CHECK_BUILD_FLAGS(
|
||||||
[how to enable m4_default([$1],[C]) PIC generation],
|
[how to enable m4_default([$1],[C]) PIC generation],
|
||||||
[m4_default([$2],[cs_cv_prog_compiler_pic])],
|
[m4_default([$2],[cs_cv_prog_compiler_pic])],
|
||||||
[CS_CREATE_TUPLE([-fPIC])], [$1], [$3], [$4],
|
[CS_CREATE_TUPLE([-fPIC])], [$1], [$3], [$4],
|
||||||
[m4_default([$$2_werror],[$cs_cv_prog_compiler_pic_werror])], [], [],
|
[m4_default([$$2_werror],[$cs_cv_prog_compiler_pic_werror])], [], [],
|
||||||
[fPIC])])
|
[fPIC])])
|
||||||
|
|
||||||
# Backward-compatiblity alias.
|
# Backward-compatiblity alias.
|
||||||
AC_DEFUN([CS_CHECK_COMPILER_PIC], [CS_COMPILER_PIC([$1],[$2],[$3],[$4])])
|
AC_DEFUN([CS_CHECK_COMPILER_PIC], [CS_COMPILER_PIC([$1],[$2],[$3],[$4])])
|
||||||
|
|||||||
@@ -1,138 +1,138 @@
|
|||||||
# checkprog.m4 -*- Autoconf -*-
|
# checkprog.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# cs_bin_paths_default
|
# cs_bin_paths_default
|
||||||
# Comma delimited list of additional directories in which tools and
|
# Comma delimited list of additional directories in which tools and
|
||||||
# commands might be found.
|
# commands might be found.
|
||||||
#
|
#
|
||||||
# Present Cases:
|
# Present Cases:
|
||||||
# /usr/local/bin -- Although a common location for executables, it is
|
# /usr/local/bin -- Although a common location for executables, it is
|
||||||
# now-and-then absent from the default PATH setting.
|
# now-and-then absent from the default PATH setting.
|
||||||
# /sw/bin -- Fink, the MacOS/X manager of Unix packages, installs
|
# /sw/bin -- Fink, the MacOS/X manager of Unix packages, installs
|
||||||
# executables here.
|
# executables here.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
m4_define([cs_bin_paths_default], [/usr/local/bin, /sw/bin])
|
m4_define([cs_bin_paths_default], [/usr/local/bin, /sw/bin])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_PROG(VARIABLE, PROGRAM, VALUE-IF-FOUND, [VALUE-IF-NOT-FOUND],
|
# CS_CHECK_PROG(VARIABLE, PROGRAM, VALUE-IF-FOUND, [VALUE-IF-NOT-FOUND],
|
||||||
# [PATH], [REJECT])
|
# [PATH], [REJECT])
|
||||||
# Simple wrapper for AC_CHECK_PROG() which ensures that the search path
|
# Simple wrapper for AC_CHECK_PROG() which ensures that the search path
|
||||||
# is augmented by the directories mentioned in cs_bin_paths_default.
|
# is augmented by the directories mentioned in cs_bin_paths_default.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_PROG],
|
AC_DEFUN([CS_CHECK_PROG],
|
||||||
[_CS_PROG_PATH_PREPARE
|
[_CS_PROG_PATH_PREPARE
|
||||||
AC_CHECK_PROG([$1], [$2], [$3], [$4],
|
AC_CHECK_PROG([$1], [$2], [$3], [$4],
|
||||||
m4_ifval([$5], [_CS_PROG_CLIENT_PATH([$5])]), [$6])])
|
m4_ifval([$5], [_CS_PROG_CLIENT_PATH([$5])]), [$6])])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_PROGS(VARIABLE, PROGRAMS, [VALUE-IF-NOT-FOUND], [PATH])
|
# CS_CHECK_PROGS(VARIABLE, PROGRAMS, [VALUE-IF-NOT-FOUND], [PATH])
|
||||||
# Simple wrapper for AC_CHECK_PROGS() which ensures that the search path
|
# Simple wrapper for AC_CHECK_PROGS() which ensures that the search path
|
||||||
# is augmented by the directories mentioned in cs_bin_paths_default.
|
# is augmented by the directories mentioned in cs_bin_paths_default.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_PROGS],
|
AC_DEFUN([CS_CHECK_PROGS],
|
||||||
[_CS_PROG_PATH_PREPARE
|
[_CS_PROG_PATH_PREPARE
|
||||||
AC_CHECK_PROGS([$1], [$2], [$3],
|
AC_CHECK_PROGS([$1], [$2], [$3],
|
||||||
m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
|
m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_TOOL(VARIABLE, TOOL, [VALUE-IF-NOT-FOUND], [PATH])
|
# CS_CHECK_TOOL(VARIABLE, TOOL, [VALUE-IF-NOT-FOUND], [PATH])
|
||||||
# Simple wrapper for AC_CHECK_TOOL() which ensures that the search path
|
# Simple wrapper for AC_CHECK_TOOL() which ensures that the search path
|
||||||
# is augmented by the directories mentioned in cs_bin_paths_default.
|
# is augmented by the directories mentioned in cs_bin_paths_default.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_TOOL],
|
AC_DEFUN([CS_CHECK_TOOL],
|
||||||
[_CS_PROG_PATH_PREPARE
|
[_CS_PROG_PATH_PREPARE
|
||||||
AC_CHECK_TOOL([$1], [$2], [$3],
|
AC_CHECK_TOOL([$1], [$2], [$3],
|
||||||
m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
|
m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_TOOLS(VARIABLE, TOOLS, [VALUE-IF-NOT-FOUND], [PATH])
|
# CS_CHECK_TOOLS(VARIABLE, TOOLS, [VALUE-IF-NOT-FOUND], [PATH])
|
||||||
# Simple wrapper for AC_CHECK_TOOLS() which ensures that the search path
|
# Simple wrapper for AC_CHECK_TOOLS() which ensures that the search path
|
||||||
# is augmented by the directories mentioned in cs_bin_paths_default.
|
# is augmented by the directories mentioned in cs_bin_paths_default.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_TOOLS],
|
AC_DEFUN([CS_CHECK_TOOLS],
|
||||||
[_CS_PROG_PATH_PREPARE
|
[_CS_PROG_PATH_PREPARE
|
||||||
AC_CHECK_TOOLS([$1], [$2], [$3],
|
AC_CHECK_TOOLS([$1], [$2], [$3],
|
||||||
m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
|
m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_PATH_PROG(VARIABLE, PROGRAM, [VALUE-IF-NOT-FOUND], [PATH])
|
# CS_PATH_PROG(VARIABLE, PROGRAM, [VALUE-IF-NOT-FOUND], [PATH])
|
||||||
# Simple wrapper for AC_PATH_PROG() which ensures that the search path
|
# Simple wrapper for AC_PATH_PROG() which ensures that the search path
|
||||||
# is augmented by the directories mentioned in cs_bin_paths_default.
|
# is augmented by the directories mentioned in cs_bin_paths_default.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_PATH_PROG],
|
AC_DEFUN([CS_PATH_PROG],
|
||||||
[_CS_PROG_PATH_PREPARE
|
[_CS_PROG_PATH_PREPARE
|
||||||
AC_PATH_PROG([$1], [$2], [$3],
|
AC_PATH_PROG([$1], [$2], [$3],
|
||||||
m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
|
m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_PATH_PROGS(VARIABLE, PROGRAMS, [VALUE-IF-NOT-FOUND], [PATH])
|
# CS_PATH_PROGS(VARIABLE, PROGRAMS, [VALUE-IF-NOT-FOUND], [PATH])
|
||||||
# Simple wrapper for AC_PATH_PROGS() which ensures that the search path
|
# Simple wrapper for AC_PATH_PROGS() which ensures that the search path
|
||||||
# is augmented by the directories mentioned in cs_bin_paths_default.
|
# is augmented by the directories mentioned in cs_bin_paths_default.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_PATH_PROGS],
|
AC_DEFUN([CS_PATH_PROGS],
|
||||||
[_CS_PROG_PATH_PREPARE
|
[_CS_PROG_PATH_PREPARE
|
||||||
AC_PATH_PROGS([$1], [$2], [$3],
|
AC_PATH_PROGS([$1], [$2], [$3],
|
||||||
m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
|
m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_PATH_TOOL(VARIABLE, TOOL, [VALUE-IF-NOT-FOUND], [PATH])
|
# CS_PATH_TOOL(VARIABLE, TOOL, [VALUE-IF-NOT-FOUND], [PATH])
|
||||||
# Simple wrapper for AC_PATH_TOOL() which ensures that the search path
|
# Simple wrapper for AC_PATH_TOOL() which ensures that the search path
|
||||||
# is augmented by the directories mentioned in cs_bin_paths_default.
|
# is augmented by the directories mentioned in cs_bin_paths_default.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_PATH_TOOL],
|
AC_DEFUN([CS_PATH_TOOL],
|
||||||
[_CS_PROG_PATH_PREPARE
|
[_CS_PROG_PATH_PREPARE
|
||||||
AC_PATH_TOOL([$1], [$2], [$3],
|
AC_PATH_TOOL([$1], [$2], [$3],
|
||||||
m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
|
m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# _CS_PROG_PATH_PREPARE
|
# _CS_PROG_PATH_PREPARE
|
||||||
# Ensure that the PATH environment variable mentions the set of
|
# Ensure that the PATH environment variable mentions the set of
|
||||||
# directories listed in cs_bin_paths_default. These directories may not
|
# directories listed in cs_bin_paths_default. These directories may not
|
||||||
# appear by default in the typical PATH, yet they might be common
|
# appear by default in the typical PATH, yet they might be common
|
||||||
# locations for tools and commands.
|
# locations for tools and commands.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([_CS_PROG_PATH_PREPARE],
|
AC_DEFUN([_CS_PROG_PATH_PREPARE],
|
||||||
[AS_REQUIRE([_AS_PATH_SEPARATOR_PREPARE])
|
[AS_REQUIRE([_AS_PATH_SEPARATOR_PREPARE])
|
||||||
AS_IF([test "$cs_prog_path_prepared" != yes],
|
AS_IF([test "$cs_prog_path_prepared" != yes],
|
||||||
[cs_prog_path_prepared=yes
|
[cs_prog_path_prepared=yes
|
||||||
PATH="$PATH[]m4_foreach([cs_bin_path], [cs_bin_paths_default],
|
PATH="$PATH[]m4_foreach([cs_bin_path], [cs_bin_paths_default],
|
||||||
[$PATH_SEPARATOR[]cs_bin_path])"
|
[$PATH_SEPARATOR[]cs_bin_path])"
|
||||||
export PATH])])
|
export PATH])])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# _CS_PROG_CLIENT_PATH(CLIENT-PATH)
|
# _CS_PROG_CLIENT_PATH(CLIENT-PATH)
|
||||||
# Given a client-supplied replacement for PATH, augment the list by
|
# Given a client-supplied replacement for PATH, augment the list by
|
||||||
# appending the locations mentioned in cs_bin_paths_default.
|
# appending the locations mentioned in cs_bin_paths_default.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([_CS_PROG_CLIENT_PATH],
|
AC_DEFUN([_CS_PROG_CLIENT_PATH],
|
||||||
[AS_REQUIRE([_AS_PATH_SEPARATOR_PREPARE])dnl
|
[AS_REQUIRE([_AS_PATH_SEPARATOR_PREPARE])dnl
|
||||||
$1[]m4_foreach([cs_bin_path], [cs_bin_paths_default],
|
$1[]m4_foreach([cs_bin_path], [cs_bin_paths_default],
|
||||||
[$PATH_SEPARATOR[]cs_bin_path])])
|
[$PATH_SEPARATOR[]cs_bin_path])])
|
||||||
|
|||||||
@@ -1,102 +1,121 @@
|
|||||||
# checkpthread.m4 -*- Autoconf -*-
|
# checkpthread.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003-2005 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003-2005 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_PTHREAD([REJECT-MASK])
|
# CS_CHECK_PTHREAD([REJECT-MASK])
|
||||||
# Check for pthread. Also check if the pthread implementation supports
|
# Check for pthread. Also check if the pthread implementation supports
|
||||||
# the recursive and timed mutex extensions. (Timed mutexes are needed for
|
# the recursive and timed mutex extensions. (Timed mutexes are needed for
|
||||||
# the NPTL: New Posix Thread Library on GNU/Linux if the mutex is going
|
# the NPTL: New Posix Thread Library on GNU/Linux if the mutex is going
|
||||||
# to be used with any of the timed condition-wait functions.) The shell
|
# to be used with any of the timed condition-wait functions.) The shell
|
||||||
# variable cs_cv_sys_pthread is set to "yes" if pthread is available,
|
# variable cs_cv_sys_pthread is set to "yes" if pthread is available,
|
||||||
# else "no". If available, then the variables cs_cv_sys_pthread_cflags,
|
# else "no". If available, then the variables cs_cv_sys_pthread_cflags,
|
||||||
# cs_cv_sys_pthread_lflags, and cs_cv_sys_pthread_libs are set. (As a
|
# cs_cv_sys_pthread_lflags, and cs_cv_sys_pthread_libs are set. (As a
|
||||||
# convenience, these variables can be emitted to an output file with
|
# convenience, these variables can be emitted to an output file with
|
||||||
# CS_EMIT_BUILD_RESULT() by passing "cs_cv_sys_pthread" as its CACHE-VAR
|
# CS_EMIT_BUILD_RESULT() by passing "cs_cv_sys_pthread" as its CACHE-VAR
|
||||||
# argument.) If the recursive mutex extension is supported, then
|
# argument.) If the recursive mutex extension is supported, then
|
||||||
# cs_cv_sys_pthread_mutex_recursive will be set with the literal name of
|
# cs_cv_sys_pthread_mutex_recursive will be set with the literal name of
|
||||||
# the constant which must be passed to pthread_mutexattr_settype() to
|
# the constant which must be passed to pthread_mutexattr_settype() to
|
||||||
# enable this feature. The constant name will be typically
|
# enable this feature. The constant name will be typically
|
||||||
# PTHREAD_MUTEX_RECURSIVE or PTHREAD_MUTEX_RECURSIVE_NP. If the recursive
|
# PTHREAD_MUTEX_RECURSIVE or PTHREAD_MUTEX_RECURSIVE_NP. If the recursive
|
||||||
# mutex extension is not available, then
|
# mutex extension is not available, then
|
||||||
# cs_cv_sys_pthread_mutex_recursive will be set to "no". If the timed
|
# cs_cv_sys_pthread_mutex_recursive will be set to "no". If the timed
|
||||||
# mutex extension is supported, then cs_cv_sys_pthread_mutex_timed will
|
# mutex extension is supported, then cs_cv_sys_pthread_mutex_timed will
|
||||||
# be set with the literal name of the constant which must be passed to
|
# be set with the literal name of the constant which must be passed to
|
||||||
# pthread_mutexattr_settype() to enable this feature. The constant name
|
# pthread_mutexattr_settype() to enable this feature. The constant name
|
||||||
# will be typically PTHREAD_MUTEX_TIMED or PTHREAD_MUTEX_TIMED_NP. If the
|
# will be typically PTHREAD_MUTEX_TIMED or PTHREAD_MUTEX_TIMED_NP. If the
|
||||||
# timed mutex extension is not available, then
|
# timed mutex extension is not available, then
|
||||||
# cs_cv_sys_pthread_mutex_timed will be set to "no". REJECT-MASK can be
|
# cs_cv_sys_pthread_mutex_timed will be set to "no". REJECT-MASK can be
|
||||||
# used to limit the platforms on which the pthread test is performed. It
|
# used to limit the platforms on which the pthread test is performed. It
|
||||||
# is compared against $host_os; matches are rejected. If omitted, then
|
# is compared against $host_os; matches are rejected. If omitted, then
|
||||||
# the test is performed on all platforms. Examples: To avoid testing on
|
# the test is performed on all platforms. Examples: To avoid testing on
|
||||||
# Cygwin, use "cygwin*"; to avoid testing on Cygwin and AIX, use
|
# Cygwin, use "cygwin*"; to avoid testing on Cygwin and AIX, use
|
||||||
# "cygwin*|aix*".
|
# "cygwin*|aix*".
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_PTHREAD],
|
AC_DEFUN([CS_CHECK_PTHREAD],
|
||||||
[AC_REQUIRE([AC_CANONICAL_HOST])
|
[AC_REQUIRE([AC_CANONICAL_HOST])
|
||||||
case $host_os in
|
case $host_os in
|
||||||
m4_ifval([$1],
|
m4_ifval([$1],
|
||||||
[$1)
|
[$1)
|
||||||
cs_cv_sys_pthread=no
|
cs_cv_sys_pthread=no
|
||||||
;;
|
;;
|
||||||
])
|
])
|
||||||
*)
|
*)
|
||||||
CS_CHECK_BUILD([for pthread], [cs_cv_sys_pthread],
|
CS_CHECK_BUILD([for pthread], [cs_cv_sys_pthread],
|
||||||
[AC_LANG_PROGRAM(
|
[AC_LANG_PROGRAM(
|
||||||
[[#include <pthread.h>
|
[[#include <pthread.h>
|
||||||
#include <semaphore.h>
|
#include <semaphore.h>
|
||||||
void* worker(void* p) { (void)p; return p; }]],
|
void* worker(void* p) { (void)p; return p; }]],
|
||||||
[pthread_t tid;
|
[pthread_t tid;
|
||||||
sem_t sem;
|
sem_t sem;
|
||||||
pthread_create(&tid, 0, worker, 0);
|
pthread_create(&tid, 0, worker, 0);
|
||||||
sem_init(&sem, 0, 0);
|
sem_init(&sem, 0, 0);
|
||||||
sem_destroy(&sem);])],
|
sem_destroy(&sem);])],
|
||||||
[cs_pthread_flags])
|
[cs_pthread_flags])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
_CS_CHECK_MUTEX_FEATURE([PTHREAD_MUTEX_RECURSIVE],
|
_CS_CHECK_MUTEX_FEATURE([PTHREAD_MUTEX_RECURSIVE],
|
||||||
[cs_cv_sys_pthread_mutex_recursive], [for pthread recursive mutexes])])
|
[cs_cv_sys_pthread_mutex_recursive], [for pthread recursive mutexes])])
|
||||||
|
|
||||||
# _CS_CHECK_MUTEX_FEATURE(FEATURE, CACHE-VAR, MESSAGE)
|
# _CS_CHECK_MUTEX_FEATURE(FEATURE, CACHE-VAR, MESSAGE)
|
||||||
AC_DEFUN([_CS_CHECK_MUTEX_FEATURE],
|
AC_DEFUN([_CS_CHECK_MUTEX_FEATURE],
|
||||||
[AS_IF([test $cs_cv_sys_pthread = yes],
|
[AS_IF([test $cs_cv_sys_pthread = yes],
|
||||||
[AC_CACHE_CHECK([$3], [$2],
|
[AC_CACHE_CHECK([$3], [$2],
|
||||||
[CS_BUILD_IFELSE(
|
[CS_BUILD_IFELSE(
|
||||||
[AC_LANG_PROGRAM(
|
[AC_LANG_PROGRAM(
|
||||||
[[#include <pthread.h>]],
|
[[#include <pthread.h>]],
|
||||||
[pthread_mutexattr_t attr;
|
[pthread_mutexattr_t attr;
|
||||||
pthread_mutexattr_settype(&attr, CS_MUTEX_FEATURE);])],
|
pthread_mutexattr_settype(&attr, CS_MUTEX_FEATURE);])],
|
||||||
[CS_CREATE_TUPLE([-DCS_MUTEX_FEATURE=$1]) \
|
[CS_CREATE_TUPLE([-DCS_MUTEX_FEATURE=$1]) \
|
||||||
CS_CREATE_TUPLE([-DCS_MUTEX_FEATURE=$1_NP])],
|
CS_CREATE_TUPLE([-DCS_MUTEX_FEATURE=$1_NP])],
|
||||||
[],
|
[],
|
||||||
[$2=`echo $cs_build_cflags | sed 's/.*\($1_*N*P*\).*/\1/'`],
|
[$2=`echo $cs_build_cflags | sed 's/.*\($1_*N*P*\).*/\1/'`],
|
||||||
[$2=no],
|
[$2=no],
|
||||||
[$cs_cv_sys_pthread_cflags -D_GNU_SOURCE],
|
[$cs_cv_sys_pthread_cflags -D_GNU_SOURCE],
|
||||||
[$cs_cv_sys_pthread_lflags],
|
[$cs_cv_sys_pthread_lflags],
|
||||||
[$cs_cv_sys_pthread_libs])])],
|
[$cs_cv_sys_pthread_libs])])],
|
||||||
[$2=no])])
|
[$2=no])])
|
||||||
|
|
||||||
m4_define([cs_pthread_flags],
|
#------------------------------------------------------------------------------
|
||||||
[CS_CREATE_TUPLE() \
|
# CS_CHECK_PTHREAD_ATFORK(CACHE-VAR)
|
||||||
CS_CREATE_TUPLE([], [], [-lpthread]) \
|
# Checks whether the pthread library contains pthread_atfork(). Sets
|
||||||
CS_CREATE_TUPLE([], [], [-lpthread -lrt]) \
|
# CACHE-VAR to "yes" or "no", according to the test result.
|
||||||
CS_CREATE_TUPLE([-pthread], [-pthread], []) \
|
#------------------------------------------------------------------------------
|
||||||
CS_CREATE_TUPLE([-pthread], [-pthread], [-lpthread]) \
|
AC_DEFUN([CS_CHECK_PTHREAD_ATFORK],
|
||||||
CS_CREATE_TUPLE([-pthread], [-pthread], [-lc_r])])
|
[AS_IF([test $cs_cv_sys_pthread = yes],
|
||||||
|
[AC_CACHE_CHECK([for pthread_atfork support], [$1],
|
||||||
|
[CS_BUILD_IFELSE(
|
||||||
|
[AC_LANG_PROGRAM(
|
||||||
|
[[#include <pthread.h>]],
|
||||||
|
[pthread_atfork (0, 0, 0);])],
|
||||||
|
[], [],
|
||||||
|
[$1=yes], [$1=no],
|
||||||
|
[$cs_cv_sys_pthread_cflags -D_GNU_SOURCE],
|
||||||
|
[$cs_cv_sys_pthread_lflags],
|
||||||
|
[$cs_cv_sys_pthread_libs])])],
|
||||||
|
[$1=no])])
|
||||||
|
|
||||||
|
m4_define([cs_pthread_flags],
|
||||||
|
[CS_CREATE_TUPLE() \
|
||||||
|
CS_CREATE_TUPLE([], [], [-lpthread]) \
|
||||||
|
CS_CREATE_TUPLE([], [], [-lpthread -lrt]) \
|
||||||
|
CS_CREATE_TUPLE([-pthread], [-pthread], []) \
|
||||||
|
CS_CREATE_TUPLE([-pthread], [-pthread], [-lpthread]) \
|
||||||
|
CS_CREATE_TUPLE([-pthread], [-pthread], [-lc_r])])
|
||||||
|
|||||||
@@ -1,45 +1,45 @@
|
|||||||
# checktt2.m4 -*- Autoconf -*-
|
# checktt2.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2004,2005 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2004,2005 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_TEMPLATE_TOOLKIT2([EMITTER])
|
# CS_CHECK_TEMPLATE_TOOLKIT2([EMITTER])
|
||||||
# Check if Template Toolkit 2 (http://www.tt2.org/) is available. The
|
# Check if Template Toolkit 2 (http://www.tt2.org/) is available. The
|
||||||
# shell variable cs_cv_perl_tt2 is set to "yes" if the package is
|
# shell variable cs_cv_perl_tt2 is set to "yes" if the package is
|
||||||
# discovered, else "no". Also sets the shell variable TTREE to the name
|
# discovered, else "no". Also sets the shell variable TTREE to the name
|
||||||
# path of the 'ttree' utility program and invokes AC_SUBST(). If EMITTER
|
# path of the 'ttree' utility program and invokes AC_SUBST(). If EMITTER
|
||||||
# is provided and the package was discovered, then
|
# is provided and the package was discovered, then
|
||||||
# CS_EMIT_BUILD_PROPERTY() is invoked with EMITTER in order to record the
|
# CS_EMIT_BUILD_PROPERTY() is invoked with EMITTER in order to record the
|
||||||
# value of the TTREE variable in an output file. As a convenience, if
|
# value of the TTREE variable in an output file. As a convenience, if
|
||||||
# EMITTER is the literal value "emit" or "yes", then
|
# EMITTER is the literal value "emit" or "yes", then
|
||||||
# CS_EMIT_BUILD_RESULT()'s default emitter will be used.
|
# CS_EMIT_BUILD_RESULT()'s default emitter will be used.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_TEMPLATE_TOOLKIT2],
|
AC_DEFUN([CS_CHECK_TEMPLATE_TOOLKIT2],
|
||||||
[CS_CHECK_PROGS([PERL], [perl5 perl])
|
[CS_CHECK_PROGS([PERL], [perl5 perl])
|
||||||
AS_IF([test -n "$PERL"],
|
AS_IF([test -n "$PERL"],
|
||||||
[AC_CACHE_CHECK([for TemplateToolkit], [cs_cv_perl_tt2],
|
[AC_CACHE_CHECK([for TemplateToolkit], [cs_cv_perl_tt2],
|
||||||
[AS_IF([AC_RUN_LOG(
|
[AS_IF([AC_RUN_LOG(
|
||||||
[$PERL -M'Template 2.11' -MTemplate::Plugin -e 0 1>&2])],
|
[$PERL -M'Template 2.11' -MTemplate::Plugin -e 0 1>&2])],
|
||||||
[cs_cv_perl_tt2=yes],
|
[cs_cv_perl_tt2=yes],
|
||||||
[cs_cv_perl_tt2=no])])
|
[cs_cv_perl_tt2=no])])
|
||||||
CS_PATH_PROGS([TTREE], [ttree])
|
CS_PATH_PROGS([TTREE], [ttree])
|
||||||
AS_IF([test $cs_cv_perl_tt2 = yes && test -n "$TTREE"],
|
AS_IF([test $cs_cv_perl_tt2 = yes && test -n "$TTREE"],
|
||||||
[CS_EMIT_BUILD_PROPERTY([TTREE], [$TTREE], [], [],
|
[CS_EMIT_BUILD_PROPERTY([TTREE], [$TTREE], [], [],
|
||||||
CS_EMITTER_OPTIONAL([$1]))])])])
|
CS_EMITTER_OPTIONAL([$1]))])])])
|
||||||
|
|||||||
@@ -1,99 +1,100 @@
|
|||||||
# compiler.m4 -*- Autoconf -*-
|
# compiler.m4 -*- Autoconf -*-
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Copyright (C)2003 by Matze Braun <matze@braunis.de>
|
# Copyright (C)2003 by Matze Braun <matze@braunis.de>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Detection of C and C++ compilers and setting flags
|
# Detection of C and C++ compilers and setting flags
|
||||||
#
|
#
|
||||||
# CS_PROG_CC
|
# CS_PROG_CC
|
||||||
# Detects the C compiler. Also takes care of the CFLAGS, CPPFLAGS and CC
|
# Detects the C compiler. Also takes care of the CFLAGS, CPPFLAGS and CC
|
||||||
# environment variables. This will filter out all -g and -O from the
|
# environment variables. This will filter out all -g and -O from the
|
||||||
# CFLAGS variable because Autoconf's -g and -O defaults are not always
|
# CFLAGS variable because Autoconf's -g and -O defaults are not always
|
||||||
# desired. This will also set the CMD.CC and COMPILER.CFLAGS variables
|
# desired. This will also set the CMD.CC and COMPILER.CFLAGS variables
|
||||||
# in Jamconfig
|
# in Jamconfig
|
||||||
# CS_PROG_CXX
|
# CS_PROG_CXX
|
||||||
# Detects the C++ compiler. Also takes care of the CXXFLAGS, CPPFLAGS
|
# Detects the C++ compiler. Also takes care of the CXXFLAGS, CPPFLAGS
|
||||||
# and CXX environment variables. This will filter out all -g and -O from
|
# and CXX environment variables. This will filter out all -g and -O from
|
||||||
# the CXXFLAGS variable because Autoconf's -g and -O defaults are not
|
# the CXXFLAGS variable because Autoconf's -g and -O defaults are not
|
||||||
# always desired. This will also set the CMD.C++ and COMPILER.C++FLAGS
|
# always desired. This will also set the CMD.C++ and COMPILER.C++FLAGS
|
||||||
# variables in Jamconfig
|
# variables in Jamconfig
|
||||||
# CS_PROG_LINK
|
# CS_PROG_LINK
|
||||||
# Tries to determine a linker. This is done by checking if a C++ or
|
# Tries to determine a linker. This is done by checking if a C++ or
|
||||||
# Objecctive-C++ compiler is available in which case it is used for
|
# Objecctive-C++ compiler is available in which case it is used for
|
||||||
# linking; otherwise the C or Objective-C compiler is used. This also
|
# linking; otherwise the C or Objective-C compiler is used. This also
|
||||||
# sets the CMD.LINK and COMPILER.LFLAGS variables in Jamconfig and
|
# sets the CMD.LINK and COMPILER.LFLAGS variables in Jamconfig and
|
||||||
# respects the LDFLAGS environment variable. Finally, checks if linker
|
# respects the LDFLAGS environment variable. Finally, checks if linker
|
||||||
# recognizes -shared and sets PLUGIN.LFLAGS; and checks if linker
|
# recognizes -shared and sets PLUGIN.LFLAGS; and checks if linker
|
||||||
# recognizes -soname and sets PLUGIN.LFLAGS.USE_SONAME to "yes".
|
# recognizes -soname and sets PLUGIN.LFLAGS.USE_SONAME to "yes".
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_PROG_CC],[
|
AC_DEFUN([CS_PROG_CC],[
|
||||||
CFLAGS="$CFLAGS" # Filter undesired flags
|
CFLAGS="$CFLAGS" # Filter undesired flags
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AS_IF([test -n "$CC"],[
|
AS_IF([test -n "$CC"],[
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.CC], [$CC])
|
CS_EMIT_BUILD_PROPERTY([CMD.CC], [$CC])
|
||||||
CS_EMIT_BUILD_PROPERTY([COMPILER.CFLAGS], [$CPPFLAGS $CFLAGS], [+])
|
CS_EMIT_BUILD_PROPERTY([COMPILER.CFLAGS], [$CPPFLAGS $CFLAGS], [+])
|
||||||
|
|
||||||
# Check if compiler recognizes -pipe directive.
|
# Check if compiler recognizes -pipe directive.
|
||||||
CS_EMIT_BUILD_FLAGS([if $CC accepts -pipe], [cs_cv_prog_cc_pipe],
|
CS_EMIT_BUILD_FLAGS([if $CC accepts -pipe], [cs_cv_prog_cc_pipe],
|
||||||
[CS_CREATE_TUPLE([-pipe])], [C], [COMPILER.CFLAGS], [+])
|
[CS_CREATE_TUPLE([-pipe])], [C], [COMPILER.CFLAGS], [+])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([CS_PROG_CXX],[
|
AC_DEFUN([CS_PROG_CXX],[
|
||||||
CXXFLAGS="$CXXFLAGS" # Filter undesired flags
|
CXXFLAGS="$CXXFLAGS" # Filter undesired flags
|
||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
AS_IF([test -n "$CXX"],[
|
AS_IF([test -n "$CXX"],[
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.C++], [$CXX])
|
CS_EMIT_BUILD_PROPERTY([CMD.C++], [$CXX])
|
||||||
|
|
||||||
CS_EMIT_BUILD_PROPERTY([COMPILER.C++FLAGS], [$CPPFLAGS $CXXFLAGS], [+])
|
CS_EMIT_BUILD_PROPERTY([COMPILER.C++FLAGS], [$CPPFLAGS $CXXFLAGS], [+])
|
||||||
|
|
||||||
# Check if compiler can be instructed to produce position-independent-code
|
# Check if compiler can be instructed to produce position-independent-code
|
||||||
# (PIC). This feature is required by some platforms when building plugin
|
# (PIC). This feature is required by some platforms when building plugin
|
||||||
# modules and shared libraries.
|
# modules and shared libraries.
|
||||||
CS_COMPILER_PIC([C++], [cs_cv_prog_cxx_pic],
|
CS_COMPILER_PIC([C++], [cs_cv_prog_cxx_pic],
|
||||||
[CS_EMIT_BUILD_PROPERTY([COMPILER.C++FLAGS.PIC],
|
[CS_EMIT_BUILD_PROPERTY([COMPILER.C++FLAGS.PIC],
|
||||||
[$cs_cv_prog_cxx_pic])])
|
[$cs_cv_prog_cxx_pic])])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([CS_PROG_LINK],[
|
AC_DEFUN([CS_PROG_LINK],[
|
||||||
AS_IF([test -n "$CXX"],
|
AC_REQUIRE([CS_PROG_CXX])
|
||||||
[CS_EMIT_BUILD_PROPERTY([CMD.LINK], [AS_ESCAPE([$(CMD.C++)])])],
|
AS_IF([test -n "$CXX"],
|
||||||
[CS_EMIT_BUILD_PROPERTY([CMD.LINK], [AS_ESCAPE([$(CMD.CC)])])])
|
[CS_EMIT_BUILD_PROPERTY([CMD.LINK], [AS_ESCAPE([$(CMD.C++)])])],
|
||||||
|
[CS_EMIT_BUILD_PROPERTY([CMD.LINK], [AS_ESCAPE([$(CMD.CC)])])])
|
||||||
CS_EMIT_BUILD_PROPERTY([COMPILER.LFLAGS], [$LDFLAGS], [+])
|
|
||||||
|
CS_EMIT_BUILD_PROPERTY([COMPILER.LFLAGS], [$LDFLAGS], [+])
|
||||||
# Check if compiler/linker recognizes -shared directive which is needed for
|
|
||||||
# linking plugin modules. Unfortunately, the Apple compiler (and possibly
|
# Check if compiler/linker recognizes -shared directive which is needed for
|
||||||
# others) requires extra effort. Even though the compiler does not recognize
|
# linking plugin modules. Unfortunately, the Apple compiler (and possibly
|
||||||
# the -shared option, it nevertheless returns a "success" result after emitting
|
# others) requires extra effort. Even though the compiler does not recognize
|
||||||
# the warning "unrecognized option `-shared'". Worse, even -Werror fails to
|
# the -shared option, it nevertheless returns a "success" result after emitting
|
||||||
# promote the warning to an error, so we must instead scan the compiler's
|
# the warning "unrecognized option `-shared'". Worse, even -Werror fails to
|
||||||
# output for an appropriate diagnostic.
|
# promote the warning to an error, so we must instead scan the compiler's
|
||||||
CS_CHECK_BUILD_FLAGS([if -shared is accepted], [cs_cv_prog_link_shared],
|
# output for an appropriate diagnostic.
|
||||||
[CS_CREATE_TUPLE([-shared])], [C++],
|
CS_CHECK_BUILD_FLAGS([if -shared is accepted], [cs_cv_prog_link_shared],
|
||||||
[CS_EMIT_BUILD_PROPERTY([PLUGIN.LFLAGS], [-shared], [+])], [],
|
[CS_CREATE_TUPLE([-shared $cs_cv_prog_cxx_pic])], [C++],
|
||||||
[], [], [], [shared])
|
[CS_EMIT_BUILD_PROPERTY([PLUGIN.LFLAGS], [-shared], [+])], [],
|
||||||
|
[], [], [], [shared])
|
||||||
# Check if linker recognizes -soname which is used to assign a name internally
|
|
||||||
# to plugin modules.
|
# Check if linker recognizes -soname which is used to assign a name internally
|
||||||
CS_CHECK_BUILD([if -soname is accepted], [cs_cv_prog_link_soname], [],
|
# to plugin modules.
|
||||||
[CS_CREATE_TUPLE([-Wl,-soname,foobar])], [C++],
|
CS_CHECK_BUILD([if -soname is accepted], [cs_cv_prog_link_soname], [],
|
||||||
[CS_EMIT_BUILD_PROPERTY([PLUGIN.LFLAGS.USE_SONAME], [yes])])
|
[CS_CREATE_TUPLE([-Wl,-soname,foobar])], [C++],
|
||||||
])
|
[CS_EMIT_BUILD_PROPERTY([PLUGIN.LFLAGS.USE_SONAME], [yes])])
|
||||||
|
])
|
||||||
|
|||||||
2918
mk/autoconf/config.guess
vendored
2918
mk/autoconf/config.guess
vendored
File diff suppressed because it is too large
Load Diff
3098
mk/autoconf/config.sub
vendored
3098
mk/autoconf/config.sub
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,144 +1,144 @@
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Determine host platform. Recognized families: Unix, Windows, MacOS/X.
|
# Determine host platform. Recognized families: Unix, Windows, MacOS/X.
|
||||||
# Orginial Macros Copyright (C)2003 Eric Sunshine <sunshine@sunshineco.com>
|
# Orginial Macros Copyright (C)2003 Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Determine host CPU.
|
# Determine host CPU.
|
||||||
#
|
#
|
||||||
# CS_CHECK_HOST_CPU
|
# CS_CHECK_HOST_CPU
|
||||||
# Set the shell variable cs_host_cpu to a normalized form of the CPU name
|
# Set the shell variable cs_host_cpu to a normalized form of the CPU name
|
||||||
# returned by config.guess/config.sub. Typically, Crystal Space's
|
# returned by config.guess/config.sub. Typically, Crystal Space's
|
||||||
# conception of CPU name is the same as that returned by
|
# conception of CPU name is the same as that returned by
|
||||||
# config.guess/config.sub, but there may be exceptions as seen in the
|
# config.guess/config.sub, but there may be exceptions as seen in the
|
||||||
# `case' statement. Also takes the normalized name, uppercases it to
|
# `case' statement. Also takes the normalized name, uppercases it to
|
||||||
# form a name suitable for the C preprocessor. Additionally sets the
|
# form a name suitable for the C preprocessor. Additionally sets the
|
||||||
# TARGET.PROCESSOR Jamconfig property.
|
# TARGET.PROCESSOR Jamconfig property.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_HOST_CPU],
|
AC_DEFUN([CS_CHECK_HOST_CPU],
|
||||||
[AC_REQUIRE([AC_CANONICAL_HOST])
|
[AC_REQUIRE([AC_CANONICAL_HOST])
|
||||||
case $host_cpu in
|
case $host_cpu in
|
||||||
[[Ii][3-9]86*|[Xx]86*]) cs_host_cpu=x86 ;;
|
[[Ii][3-9]86*|[Xx]86*]) cs_host_cpu=x86 ;;
|
||||||
*) cs_host_cpu=$host_cpu ;;
|
*) cs_host_cpu=$host_cpu ;;
|
||||||
esac
|
esac
|
||||||
cs_host_cpu_normalized="AS_TR_CPP([$cs_host_cpu])"
|
cs_host_cpu_normalized="AS_TR_CPP([$cs_host_cpu])"
|
||||||
CS_JAMCONFIG_PROPERTY([TARGET.PROCESSOR], [$cs_host_cpu_normalized])
|
CS_JAMCONFIG_PROPERTY([TARGET.PROCESSOR], [$cs_host_cpu_normalized])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_HOST
|
# CS_CHECK_HOST
|
||||||
# Sets the shell variables cs_host_target cs_host_family,
|
# Sets the shell variables cs_host_target cs_host_family,
|
||||||
# cs_host_os_normalized, and cs_host_os_normalized_uc. Emits appropriate
|
# cs_host_os_normalized, and cs_host_os_normalized_uc. Emits appropriate
|
||||||
# CS_PLATFORM_UNIX, CS_PLATFORM_WIN32, CS_PLATFORM_MACOSX via
|
# CS_PLATFORM_UNIX, CS_PLATFORM_WIN32, CS_PLATFORM_MACOSX via
|
||||||
# AC_DEFINE(), and TARGET.OS and TARGET.OS.NORMALIZED to Jamconfig.
|
# AC_DEFINE(), and TARGET.OS and TARGET.OS.NORMALIZED to Jamconfig.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_HOST],
|
AC_DEFUN([CS_CHECK_HOST],
|
||||||
[AC_REQUIRE([AC_CANONICAL_HOST])
|
[AC_REQUIRE([AC_CANONICAL_HOST])
|
||||||
CS_CHECK_HOST_CPU
|
CS_CHECK_HOST_CPU
|
||||||
cs_host_os_normalized=''
|
cs_host_os_normalized=''
|
||||||
case $host_os in
|
case $host_os in
|
||||||
mingw*|cygwin*)
|
mingw*|cygwin*)
|
||||||
cs_host_target=win32gcc
|
cs_host_target=win32gcc
|
||||||
cs_host_family=windows
|
cs_host_family=windows
|
||||||
;;
|
;;
|
||||||
darwin*)
|
darwin*)
|
||||||
_CS_CHECK_HOST_DARWIN
|
_CS_CHECK_HOST_DARWIN
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# Everything else is assumed to be Unix or Unix-like.
|
# Everything else is assumed to be Unix or Unix-like.
|
||||||
cs_host_target=unix
|
cs_host_target=unix
|
||||||
cs_host_family=unix
|
cs_host_family=unix
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case $cs_host_family in
|
case $cs_host_family in
|
||||||
windows)
|
windows)
|
||||||
AC_DEFINE([CS_PLATFORM_WIN32], [],
|
AC_DEFINE([CS_PLATFORM_WIN32], [],
|
||||||
[Define when compiling for Win32])
|
[Define when compiling for Win32])
|
||||||
AS_IF([test -z "$cs_host_os_normalized"],
|
AS_IF([test -z "$cs_host_os_normalized"],
|
||||||
[cs_host_os_normalized='Win32'])
|
[cs_host_os_normalized='Win32'])
|
||||||
;;
|
;;
|
||||||
unix)
|
unix)
|
||||||
AC_DEFINE([CS_PLATFORM_UNIX], [],
|
AC_DEFINE([CS_PLATFORM_UNIX], [],
|
||||||
[Define when compiling for Unix and Unix-like (i.e. MacOS/X)])
|
[Define when compiling for Unix and Unix-like (i.e. MacOS/X)])
|
||||||
AS_IF([test -z "$cs_host_os_normalized"],
|
AS_IF([test -z "$cs_host_os_normalized"],
|
||||||
[cs_host_os_normalized='Unix'])
|
[cs_host_os_normalized='Unix'])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
cs_host_os_normalized_uc="AS_TR_CPP([$cs_host_os_normalized])"
|
cs_host_os_normalized_uc="AS_TR_CPP([$cs_host_os_normalized])"
|
||||||
CS_JAMCONFIG_PROPERTY([TARGET.OS], [$cs_host_os_normalized_uc])
|
CS_JAMCONFIG_PROPERTY([TARGET.OS], [$cs_host_os_normalized_uc])
|
||||||
CS_JAMCONFIG_PROPERTY([TARGET.OS.NORMALIZED], [$cs_host_os_normalized])
|
CS_JAMCONFIG_PROPERTY([TARGET.OS.NORMALIZED], [$cs_host_os_normalized])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([_CS_CHECK_HOST_DARWIN],
|
AC_DEFUN([_CS_CHECK_HOST_DARWIN],
|
||||||
[AC_REQUIRE([CS_PROG_CC])
|
[AC_REQUIRE([CS_PROG_CC])
|
||||||
AC_REQUIRE([CS_PROG_CXX])
|
AC_REQUIRE([CS_PROG_CXX])
|
||||||
|
|
||||||
# Both MacOS/X and Darwin are identified via $host_os as "darwin". We need
|
# Both MacOS/X and Darwin are identified via $host_os as "darwin". We need
|
||||||
# a way to distinguish between the two. If Carbon.h is present, then
|
# a way to distinguish between the two. If Carbon.h is present, then
|
||||||
# assume MacOX/S; if not, assume Darwin. If --with-x=yes was invoked, and
|
# assume MacOX/S; if not, assume Darwin. If --with-x=yes was invoked, and
|
||||||
# Carbon.h is present, then assume that user wants to cross-build for
|
# Carbon.h is present, then assume that user wants to cross-build for
|
||||||
# Darwin even though build host is MacOS/X.
|
# Darwin even though build host is MacOS/X.
|
||||||
# IMPLEMENTATION NOTE *1*
|
# IMPLEMENTATION NOTE *1*
|
||||||
# The QuickTime 7.0 installer removes <CarbonSound/CarbonSound.h>, which
|
# The QuickTime 7.0 installer removes <CarbonSound/CarbonSound.h>, which
|
||||||
# causes #include <Carbon/Carbon.h> to fail unconditionally. Re-installing
|
# causes #include <Carbon/Carbon.h> to fail unconditionally. Re-installing
|
||||||
# the QuickTime SDK should restore the header, however not all developers
|
# the QuickTime SDK should restore the header, however not all developers
|
||||||
# know to do this, so we work around the problem of the missing
|
# know to do this, so we work around the problem of the missing
|
||||||
# CarbonSound.h by #defining __CARBONSOUND__ in the test in order to
|
# CarbonSound.h by #defining __CARBONSOUND__ in the test in order to
|
||||||
# prevent Carbon.h from attempting to #include the missing header.
|
# prevent Carbon.h from attempting to #include the missing header.
|
||||||
# IMPLEMENTATION NOTE *2*
|
# IMPLEMENTATION NOTE *2*
|
||||||
# At least one MacOS/X user switches between gcc 2.95 and gcc 3.3 with a
|
# At least one MacOS/X user switches between gcc 2.95 and gcc 3.3 with a
|
||||||
# script which toggles the values of CC, CXX, and CPP. Unfortunately, CPP
|
# script which toggles the values of CC, CXX, and CPP. Unfortunately, CPP
|
||||||
# was being set to run the preprocessor directly ("cpp", for instance)
|
# was being set to run the preprocessor directly ("cpp", for instance)
|
||||||
# rather than running it via the compiler ("gcc -E", for instance). The
|
# rather than running it via the compiler ("gcc -E", for instance). The
|
||||||
# problem with running the preprocessor directly is that __APPLE__ and
|
# problem with running the preprocessor directly is that __APPLE__ and
|
||||||
# __GNUC__ are not defined, which causes the Carbon.h check to fail. We
|
# __GNUC__ are not defined, which causes the Carbon.h check to fail. We
|
||||||
# avoid this problem by supplying a non-empty fourth argument to
|
# avoid this problem by supplying a non-empty fourth argument to
|
||||||
# AC_CHECK_HEADER(), which causes it to test compile the header only (which
|
# AC_CHECK_HEADER(), which causes it to test compile the header only (which
|
||||||
# is a more robust test), rather than also testing it via the preprocessor.
|
# is a more robust test), rather than also testing it via the preprocessor.
|
||||||
|
|
||||||
AC_DEFINE([__CARBONSOUND__], [],
|
AC_DEFINE([__CARBONSOUND__], [],
|
||||||
[Avoid problem caused by missing <Carbon/CarbonSound.h>])
|
[Avoid problem caused by missing <Carbon/CarbonSound.h>])
|
||||||
AC_CHECK_HEADER([Carbon/Carbon.h],
|
AC_CHECK_HEADER([Carbon/Carbon.h],
|
||||||
[cs_host_macosx=yes], [cs_host_macosx=no], [/* force compile */])
|
[cs_host_macosx=yes], [cs_host_macosx=no], [/* force compile */])
|
||||||
|
|
||||||
AS_IF([test $cs_host_macosx = yes],
|
AS_IF([test $cs_host_macosx = yes],
|
||||||
[AC_MSG_CHECKING([for --with-x])
|
[AC_MSG_CHECKING([for --with-x])
|
||||||
AS_IF([test "${with_x+set}" = set && test "$with_x" = "yes"],
|
AS_IF([test "${with_x+set}" = set && test "$with_x" = "yes"],
|
||||||
[AC_MSG_RESULT([yes (assume Darwin)])
|
[AC_MSG_RESULT([yes (assume Darwin)])
|
||||||
cs_host_macosx=no],
|
cs_host_macosx=no],
|
||||||
[AC_MSG_RESULT([no])])])
|
[AC_MSG_RESULT([no])])])
|
||||||
|
|
||||||
AS_IF([test $cs_host_macosx = yes],
|
AS_IF([test $cs_host_macosx = yes],
|
||||||
[cs_host_target=macosx
|
[cs_host_target=macosx
|
||||||
cs_host_family=unix
|
cs_host_family=unix
|
||||||
cs_host_os_normalized='MacOS/X'
|
cs_host_os_normalized='MacOS/X'
|
||||||
AC_DEFINE([CS_PLATFORM_MACOSX], [],
|
AC_DEFINE([CS_PLATFORM_MACOSX], [],
|
||||||
[Define when compiling for MacOS/X])
|
[Define when compiling for MacOS/X])
|
||||||
|
|
||||||
AC_CACHE_CHECK([for Objective-C compiler], [cs_cv_prog_objc],
|
AC_CACHE_CHECK([for Objective-C compiler], [cs_cv_prog_objc],
|
||||||
[cs_cv_prog_objc="$CC"])
|
[cs_cv_prog_objc="$CC"])
|
||||||
CS_JAMCONFIG_PROPERTY([CMD.OBJC], [$cs_cv_prog_objc])
|
CS_JAMCONFIG_PROPERTY([CMD.OBJC], [$cs_cv_prog_objc])
|
||||||
AC_CACHE_CHECK([for Objective-C++ compiler], [cs_cv_prog_objcxx],
|
AC_CACHE_CHECK([for Objective-C++ compiler], [cs_cv_prog_objcxx],
|
||||||
[cs_cv_prog_objcxx="$CXX"])
|
[cs_cv_prog_objcxx="$CXX"])
|
||||||
CS_JAMCONFIG_PROPERTY([CMD.OBJC++], [$cs_cv_prog_objcxx])],
|
CS_JAMCONFIG_PROPERTY([CMD.OBJC++], [$cs_cv_prog_objcxx])],
|
||||||
|
|
||||||
[cs_host_target=unix
|
[cs_host_target=unix
|
||||||
cs_host_family=unix])])
|
cs_host_family=unix])])
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
# diagnose.m4 -*- Autoconf -*-
|
# diagnose.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_MSG_ERROR(ERROR-DESCRIPTION, [EXIT-STATUS])
|
# CS_MSG_ERROR(ERROR-DESCRIPTION, [EXIT-STATUS])
|
||||||
# A convenience wrapper for AC_MSG_ERROR() which invokes AC_CACHE_SAVE()
|
# A convenience wrapper for AC_MSG_ERROR() which invokes AC_CACHE_SAVE()
|
||||||
# before aborting the script. Saving the cache should make subsequent
|
# before aborting the script. Saving the cache should make subsequent
|
||||||
# re-invocations of the configure script faster once the user has
|
# re-invocations of the configure script faster once the user has
|
||||||
# corrected the problem(s) which caused the failure.
|
# corrected the problem(s) which caused the failure.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_MSG_ERROR],
|
AC_DEFUN([CS_MSG_ERROR],
|
||||||
[AC_CACHE_SAVE
|
[AC_CACHE_SAVE
|
||||||
AC_MSG_ERROR([$1], [$2])])
|
AC_MSG_ERROR([$1], [$2])])
|
||||||
|
|||||||
@@ -1,222 +1,222 @@
|
|||||||
# embed.m4 -*- Autoconf -*-
|
# embed.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003,2005 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003,2005 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_META_INFO_EMBED([EMITTER], [GPL-OKAY])
|
# CS_META_INFO_EMBED([EMITTER], [GPL-OKAY])
|
||||||
# Determine if plugin meta-information should be embedded or if it should
|
# Determine if plugin meta-information should be embedded or if it should
|
||||||
# exist in a stand-alone .csplugin file, and check if necessary tools and
|
# exist in a stand-alone .csplugin file, and check if necessary tools and
|
||||||
# libraries are present. Sets the shell variable
|
# libraries are present. Sets the shell variable
|
||||||
# enable_meta_info_embedding to "yes" if the user requested embedding or
|
# enable_meta_info_embedding to "yes" if the user requested embedding or
|
||||||
# if it was enabled by default; otherwise sets it to "no".
|
# if it was enabled by default; otherwise sets it to "no".
|
||||||
#
|
#
|
||||||
# If EMITTER is provided, then a subset of the following variables
|
# If EMITTER is provided, then a subset of the following variables
|
||||||
# (depending upon platform and availability) are recorded by invoking
|
# (depending upon platform and availability) are recorded by invoking
|
||||||
# CS_EMIT_BUILD_PROPERTY() with EMITTER. As a convenience, if EMITTER is
|
# CS_EMIT_BUILD_PROPERTY() with EMITTER. As a convenience, if EMITTER is
|
||||||
# the literal value "emit" or "yes", then CS_EMIT_BUILD_RESULT()'s
|
# the literal value "emit" or "yes", then CS_EMIT_BUILD_RESULT()'s
|
||||||
# default emitter will be used.
|
# default emitter will be used.
|
||||||
#
|
#
|
||||||
# EMBED_META := yes or no
|
# EMBED_META := yes or no
|
||||||
# EMBED_META.CFLAGS := compiler flags
|
# EMBED_META.CFLAGS := compiler flags
|
||||||
# EMBED_META.LFLAGS := linker flags
|
# EMBED_META.LFLAGS := linker flags
|
||||||
# CMD.WINDRES := windres.exe
|
# CMD.WINDRES := windres.exe
|
||||||
# OBJCOPY.AVAILABLE := yes or no
|
# OBJCOPY.AVAILABLE := yes or no
|
||||||
# CMD.OBJCOPY := objcopy.exe
|
# CMD.OBJCOPY := objcopy.exe
|
||||||
# LIBBFD.AVAILABLE := yes or no
|
# LIBBFD.AVAILABLE := yes or no
|
||||||
# LIBBFD.CFLAGS := libbfd compiler flags
|
# LIBBFD.CFLAGS := libbfd compiler flags
|
||||||
# LIBBFD.LFLAGS := libbfd linker flags
|
# LIBBFD.LFLAGS := libbfd linker flags
|
||||||
# ELF.AVAILABLE := yes or no
|
# ELF.AVAILABLE := yes or no
|
||||||
#
|
#
|
||||||
# In general, clients need only concern themselves with the various
|
# In general, clients need only concern themselves with the various
|
||||||
# EMBED_META-related variables. For building plugin modules, utilize
|
# EMBED_META-related variables. For building plugin modules, utilize
|
||||||
# EMBED_META.CFLAGS when compiling, and EMBED_META.LFLAGS when linking.
|
# EMBED_META.CFLAGS when compiling, and EMBED_META.LFLAGS when linking.
|
||||||
#
|
#
|
||||||
# On Unix, when CS' own ELF metadata reader can't be used (because the
|
# On Unix, when CS' own ELF metadata reader can't be used (because the
|
||||||
# necessary header file elf.h was not found) embedding is accomplished
|
# necessary header file elf.h was not found) embedding is accomplished
|
||||||
# via libbfd, which carries a GPL license. Projects which carry licenses
|
# via libbfd, which carries a GPL license. Projects which carry licenses
|
||||||
# not compatible with GPL should consider carefully before enabling
|
# not compatible with GPL should consider carefully before enabling
|
||||||
# embedding on Unix. If your project is GPL-compatible, then set GPL-OKAY
|
# embedding on Unix. If your project is GPL-compatible, then set GPL-OKAY
|
||||||
# to "yes". This will indicate that it is safe to use libbfd if the ELF
|
# to "yes". This will indicate that it is safe to use libbfd if the ELF
|
||||||
# reader can not be used. If your project is not GPL-compatible, then
|
# reader can not be used. If your project is not GPL-compatible, then
|
||||||
# set it to "no" in order to disable embedding on Unix if the ELF reader
|
# set it to "no" in order to disable embedding on Unix if the ELF reader
|
||||||
# is not usable. (The user can still manually override the setting via
|
# is not usable. (The user can still manually override the setting via
|
||||||
# the --enable-meta-info-embedding option.)
|
# the --enable-meta-info-embedding option.)
|
||||||
#
|
#
|
||||||
# IMPLEMENTATION NOTES
|
# IMPLEMENTATION NOTES
|
||||||
#
|
#
|
||||||
# Recent versions of Mingw supply libbfd and libiberty. Since Crystal
|
# Recent versions of Mingw supply libbfd and libiberty. Since Crystal
|
||||||
# Space uses native Win32 API for meta-information embedding on Windows,
|
# Space uses native Win32 API for meta-information embedding on Windows,
|
||||||
# we do not require these libraries on Windows. More importantly, users
|
# we do not require these libraries on Windows. More importantly, users
|
||||||
# do not want to see these GPL-licensed libraries appear in the link
|
# do not want to see these GPL-licensed libraries appear in the link
|
||||||
# statement for plugin modules, thus we explicitly disable the libbfd
|
# statement for plugin modules, thus we explicitly disable the libbfd
|
||||||
# test on Windows.
|
# test on Windows.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_META_INFO_EMBED],
|
AC_DEFUN([CS_META_INFO_EMBED],
|
||||||
[AC_REQUIRE([AC_CANONICAL_HOST])
|
[AC_REQUIRE([AC_CANONICAL_HOST])
|
||||||
_CS_META_INFO_EMBED_ENABLE([$1], [$2])
|
_CS_META_INFO_EMBED_ENABLE([$1], [$2])
|
||||||
AS_IF([test $enable_meta_info_embedding = yes],
|
AS_IF([test $enable_meta_info_embedding = yes],
|
||||||
[_CS_META_INFO_EMBED_TOOLS([$1])
|
[_CS_META_INFO_EMBED_TOOLS([$1])
|
||||||
AS_IF([test $cs_header_elf_h = yes],
|
AS_IF([test $cs_header_elf_h = yes],
|
||||||
[CS_EMIT_BUILD_PROPERTY([ELF.AVAILABLE], [yes], [], [],
|
[CS_EMIT_BUILD_PROPERTY([ELF.AVAILABLE], [yes], [], [],
|
||||||
CS_EMITTER_OPTIONAL([$1]))],
|
CS_EMITTER_OPTIONAL([$1]))],
|
||||||
[case $host_os in
|
[case $host_os in
|
||||||
mingw*|cygwin*) ;;
|
mingw*|cygwin*) ;;
|
||||||
*)
|
*)
|
||||||
CS_CHECK_LIBBFD([$1],
|
CS_CHECK_LIBBFD([$1],
|
||||||
[CS_EMIT_BUILD_PROPERTY([EMBED_META.CFLAGS],
|
[CS_EMIT_BUILD_PROPERTY([EMBED_META.CFLAGS],
|
||||||
[$cs_cv_libbfd_ok_cflags], [+], [],
|
[$cs_cv_libbfd_ok_cflags], [+], [],
|
||||||
CS_EMITTER_OPTIONAL([$1]))
|
CS_EMITTER_OPTIONAL([$1]))
|
||||||
CS_EMIT_BUILD_PROPERTY([EMBED_META.LFLAGS],
|
CS_EMIT_BUILD_PROPERTY([EMBED_META.LFLAGS],
|
||||||
[$cs_cv_libbfd_ok_lflags $cs_cv_libbfd_ok_libs],
|
[$cs_cv_libbfd_ok_lflags $cs_cv_libbfd_ok_libs],
|
||||||
[+], [], CS_EMITTER_OPTIONAL([$1]))])
|
[+], [], CS_EMITTER_OPTIONAL([$1]))])
|
||||||
;;
|
;;
|
||||||
esac])])])
|
esac])])])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# _CS_META_INFO_EMBED_ENABLE([EMITTER], [GPL-OKAY])
|
# _CS_META_INFO_EMBED_ENABLE([EMITTER], [GPL-OKAY])
|
||||||
# Helper for CS_META_INFO_EMBED which adds an
|
# Helper for CS_META_INFO_EMBED which adds an
|
||||||
# --enable-meta-info-embedding option to the configure script allowing
|
# --enable-meta-info-embedding option to the configure script allowing
|
||||||
# the user to control embedding. Sets the shell variable
|
# the user to control embedding. Sets the shell variable
|
||||||
# enable_meta_info_embedding to yes or no.
|
# enable_meta_info_embedding to yes or no.
|
||||||
#
|
#
|
||||||
# IMPLEMENTATION NOTES
|
# IMPLEMENTATION NOTES
|
||||||
#
|
#
|
||||||
# On Unix, embedding is enabled by default if elf.h is found and disabled
|
# On Unix, embedding is enabled by default if elf.h is found and disabled
|
||||||
# by default unless overridden via GPL-OKAY because libbfd carries a GPL
|
# by default unless overridden via GPL-OKAY because libbfd carries a GPL
|
||||||
# license which may be incompatible with a project's own license (such as
|
# license which may be incompatible with a project's own license (such as
|
||||||
# LGPL).
|
# LGPL).
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([_CS_META_INFO_EMBED_ENABLE],
|
AC_DEFUN([_CS_META_INFO_EMBED_ENABLE],
|
||||||
[AC_REQUIRE([CS_CHECK_HOST])
|
[AC_REQUIRE([CS_CHECK_HOST])
|
||||||
AC_CHECK_HEADERS([elf.h], [cs_header_elf_h=yes], [cs_header_elf_h=no])
|
AC_CHECK_HEADERS([elf.h], [cs_header_elf_h=yes], [cs_header_elf_h=no])
|
||||||
AC_MSG_CHECKING([whether to embed plugin meta-information])
|
AC_MSG_CHECKING([whether to embed plugin meta-information])
|
||||||
case $cs_host_target in
|
case $cs_host_target in
|
||||||
unix) AS_IF([test $cs_header_elf_h = yes],
|
unix) AS_IF([test $cs_header_elf_h = yes],
|
||||||
[cs_embed_meta_info_default=yes],
|
[cs_embed_meta_info_default=yes],
|
||||||
[cs_embed_meta_info_default=m4_ifval([$2],[$2],[no])]) ;;
|
[cs_embed_meta_info_default=m4_ifval([$2],[$2],[no])]) ;;
|
||||||
*) cs_embed_meta_info_default=yes ;;
|
*) cs_embed_meta_info_default=yes ;;
|
||||||
esac
|
esac
|
||||||
AC_ARG_ENABLE([meta-info-embedding],
|
AC_ARG_ENABLE([meta-info-embedding],
|
||||||
[AC_HELP_STRING([--enable-meta-info-embedding],
|
[AC_HELP_STRING([--enable-meta-info-embedding],
|
||||||
[store plugin meta-information directly inside plugin modules if
|
[store plugin meta-information directly inside plugin modules if
|
||||||
supported by platform; if disabled, meta-information is stored in
|
supported by platform; if disabled, meta-information is stored in
|
||||||
stand-alone .csplugin files; this option is enabled by default for
|
stand-alone .csplugin files; this option is enabled by default for
|
||||||
non-Unix platforms and on Unix platforms with ELF-format object
|
non-Unix platforms and on Unix platforms with ELF-format object
|
||||||
files; it is disabled by default on Unix platforms if ELF is not
|
files; it is disabled by default on Unix platforms if ELF is not
|
||||||
available and the project uses a non-GPL-compatible license (such
|
available and the project uses a non-GPL-compatible license (such
|
||||||
as LGPL) since the non-ELF Unix embedding technology requires the
|
as LGPL) since the non-ELF Unix embedding technology requires the
|
||||||
GPL-licensed libbfd library; if ELF is not available, enable this
|
GPL-licensed libbfd library; if ELF is not available, enable this
|
||||||
option on Unix only if you are certain you want a GPL-licensed
|
option on Unix only if you are certain you want a GPL-licensed
|
||||||
library infecting your project])],
|
library infecting your project])],
|
||||||
[], [enable_meta_info_embedding=$cs_embed_meta_info_default])
|
[], [enable_meta_info_embedding=$cs_embed_meta_info_default])
|
||||||
AC_MSG_RESULT([$enable_meta_info_embedding])
|
AC_MSG_RESULT([$enable_meta_info_embedding])
|
||||||
CS_EMIT_BUILD_PROPERTY([EMBED_META], [$enable_meta_info_embedding],
|
CS_EMIT_BUILD_PROPERTY([EMBED_META], [$enable_meta_info_embedding],
|
||||||
[], [], CS_EMITTER_OPTIONAL([$1]))])
|
[], [], CS_EMITTER_OPTIONAL([$1]))])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# _CS_META_INFO_EMBED_TOOLS([EMITTER])
|
# _CS_META_INFO_EMBED_TOOLS([EMITTER])
|
||||||
# Helper for CS_META_INFO_EMBED() which searches for tools required for
|
# Helper for CS_META_INFO_EMBED() which searches for tools required for
|
||||||
# plugin meta-info embedding.
|
# plugin meta-info embedding.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([_CS_META_INFO_EMBED_TOOLS],
|
AC_DEFUN([_CS_META_INFO_EMBED_TOOLS],
|
||||||
[CS_CHECK_TOOLS([WINDRES], [windres])
|
[CS_CHECK_TOOLS([WINDRES], [windres])
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.WINDRES], [$WINDRES], [], [],
|
CS_EMIT_BUILD_PROPERTY([CMD.WINDRES], [$WINDRES], [], [],
|
||||||
CS_EMITTER_OPTIONAL([$1]))
|
CS_EMITTER_OPTIONAL([$1]))
|
||||||
|
|
||||||
CS_CHECK_TOOLS([OBJCOPY], [objcopy])
|
CS_CHECK_TOOLS([OBJCOPY], [objcopy])
|
||||||
AS_IF([test -n "$OBJCOPY"],
|
AS_IF([test -n "$OBJCOPY"],
|
||||||
[CS_EMIT_BUILD_PROPERTY([OBJCOPY.AVAILABLE], [yes], [], [],
|
[CS_EMIT_BUILD_PROPERTY([OBJCOPY.AVAILABLE], [yes], [], [],
|
||||||
CS_EMITTER_OPTIONAL([$1]))
|
CS_EMITTER_OPTIONAL([$1]))
|
||||||
CS_EMIT_BUILD_PROPERTY([CMD.OBJCOPY], [$OBJCOPY], [], [],
|
CS_EMIT_BUILD_PROPERTY([CMD.OBJCOPY], [$OBJCOPY], [], [],
|
||||||
CS_EMITTER_OPTIONAL([$1]))])])
|
CS_EMITTER_OPTIONAL([$1]))])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_LIBBFD([EMITTER], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
# CS_CHECK_LIBBFD([EMITTER], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||||
# Exhaustive check for a usable GPL-licensed libbfd, the Binary File
|
# Exhaustive check for a usable GPL-licensed libbfd, the Binary File
|
||||||
# Descriptor library, a component of binutils, which allows low-level
|
# Descriptor library, a component of binutils, which allows low-level
|
||||||
# manipulation of executable and object files. If EMITTER is provided,
|
# manipulation of executable and object files. If EMITTER is provided,
|
||||||
# then the following variables are recorded by invoking
|
# then the following variables are recorded by invoking
|
||||||
# CS_EMIT_BUILD_PROPERTY() with EMITTER. As a convenience, if EMITTER is
|
# CS_EMIT_BUILD_PROPERTY() with EMITTER. As a convenience, if EMITTER is
|
||||||
# the literal value "emit" or "yes", then CS_EMIT_BUILD_RESULT()'s
|
# the literal value "emit" or "yes", then CS_EMIT_BUILD_RESULT()'s
|
||||||
# default emitter will be used.
|
# default emitter will be used.
|
||||||
#
|
#
|
||||||
# LIBBFD.AVAILABLE := yes or no
|
# LIBBFD.AVAILABLE := yes or no
|
||||||
# LIBBFD.CFLAGS := libbfd compiler flags
|
# LIBBFD.CFLAGS := libbfd compiler flags
|
||||||
# LIBBFD.LFLAGS := libbfd linker flags
|
# LIBBFD.LFLAGS := libbfd linker flags
|
||||||
#
|
#
|
||||||
# The shell variable cs_cv_libbfd_ok is set to yes if a usable libbfd was
|
# The shell variable cs_cv_libbfd_ok is set to yes if a usable libbfd was
|
||||||
# discovered, else no. If found, the additional shell variables
|
# discovered, else no. If found, the additional shell variables
|
||||||
# cs_cv_libbfd_ok_cflags, cs_cv_libbfd_ok_lflags, and
|
# cs_cv_libbfd_ok_cflags, cs_cv_libbfd_ok_lflags, and
|
||||||
# cs_cv_libbfd_ok_libs are also set.
|
# cs_cv_libbfd_ok_libs are also set.
|
||||||
#
|
#
|
||||||
# WARNING
|
# WARNING
|
||||||
#
|
#
|
||||||
# libbfd carries a GPL license which is incompatible with the LGPL
|
# libbfd carries a GPL license which is incompatible with the LGPL
|
||||||
# license of Crystal Space. Do not use this library with projects under
|
# license of Crystal Space. Do not use this library with projects under
|
||||||
# less restrictive licenses, such as LGPL.
|
# less restrictive licenses, such as LGPL.
|
||||||
#
|
#
|
||||||
# IMPLEMENTATION NOTES
|
# IMPLEMENTATION NOTES
|
||||||
#
|
#
|
||||||
# It seems that some platforms have two version of libiberty installed:
|
# It seems that some platforms have two version of libiberty installed:
|
||||||
# one from binutils and one from gcc. The binutils version resides in
|
# one from binutils and one from gcc. The binutils version resides in
|
||||||
# /usr/lib, whereas the gcc version resides in the gcc installation
|
# /usr/lib, whereas the gcc version resides in the gcc installation
|
||||||
# directory. The gcc version, by default, takes precedence at link time
|
# directory. The gcc version, by default, takes precedence at link time
|
||||||
# over the binutils version. Unfortunately, in broken cases, the gcc
|
# over the binutils version. Unfortunately, in broken cases, the gcc
|
||||||
# version of libiberty is missing htab_create_alloc() which is required
|
# version of libiberty is missing htab_create_alloc() which is required
|
||||||
# by some libbfd functions. The extensive secondary check of libbfd
|
# by some libbfd functions. The extensive secondary check of libbfd
|
||||||
# catches this anomalous case of broken gcc libiberty. It turns out that
|
# catches this anomalous case of broken gcc libiberty. It turns out that
|
||||||
# it is possible to make the linker prefer the binutils version by
|
# it is possible to make the linker prefer the binutils version by
|
||||||
# specifying -L/usr/lib, thus the extensive test attempts to do so in an
|
# specifying -L/usr/lib, thus the extensive test attempts to do so in an
|
||||||
# effort to resolve this unfortunate issue.
|
# effort to resolve this unfortunate issue.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_LIBBFD],
|
AC_DEFUN([CS_CHECK_LIBBFD],
|
||||||
[CS_CHECK_LIB_WITH([bfd],
|
[CS_CHECK_LIB_WITH([bfd],
|
||||||
[AC_LANG_PROGRAM([[#include <bfd.h>]], [bfd_init();])],
|
[AC_LANG_PROGRAM([[#include <bfd.h>]], [bfd_init();])],
|
||||||
[], [], [], [], [], [], [-liberty])
|
[], [], [], [], [], [], [-liberty])
|
||||||
|
|
||||||
AS_IF([test $cs_cv_libbfd = yes],
|
AS_IF([test $cs_cv_libbfd = yes],
|
||||||
[CS_CHECK_BUILD([if libbfd is usable], [cs_cv_libbfd_ok],
|
[CS_CHECK_BUILD([if libbfd is usable], [cs_cv_libbfd_ok],
|
||||||
[AC_LANG_PROGRAM([[#include <bfd.h>]],
|
[AC_LANG_PROGRAM([[#include <bfd.h>]],
|
||||||
[bfd* p;
|
[bfd* p;
|
||||||
asection* s;
|
asection* s;
|
||||||
bfd_init();
|
bfd_init();
|
||||||
p = bfd_openr(0,0);
|
p = bfd_openr(0,0);
|
||||||
bfd_check_format(p,bfd_object);
|
bfd_check_format(p,bfd_object);
|
||||||
bfd_get_section_by_name(p,0);
|
bfd_get_section_by_name(p,0);
|
||||||
bfd_section_size(p,s);
|
bfd_section_size(p,s);
|
||||||
bfd_get_section_contents(p,s,0,0,0);
|
bfd_get_section_contents(p,s,0,0,0);
|
||||||
bfd_close(p);])],
|
bfd_close(p);])],
|
||||||
[CS_CREATE_TUPLE() CS_CREATE_TUPLE([],[-L/usr/lib],[])],
|
[CS_CREATE_TUPLE() CS_CREATE_TUPLE([],[-L/usr/lib],[])],
|
||||||
[], [], [], [],
|
[], [], [], [],
|
||||||
[$cs_cv_libbfd_cflags],
|
[$cs_cv_libbfd_cflags],
|
||||||
[$cs_cv_libbfd_lflags],
|
[$cs_cv_libbfd_lflags],
|
||||||
[$cs_cv_libbfd_libs])],
|
[$cs_cv_libbfd_libs])],
|
||||||
[cs_cv_libbfd_ok=no])
|
[cs_cv_libbfd_ok=no])
|
||||||
|
|
||||||
AS_IF([test $cs_cv_libbfd_ok = yes],
|
AS_IF([test $cs_cv_libbfd_ok = yes],
|
||||||
[CS_EMIT_BUILD_RESULT([cs_cv_libbfd_ok], [LIBBFD],
|
[CS_EMIT_BUILD_RESULT([cs_cv_libbfd_ok], [LIBBFD],
|
||||||
CS_EMITTER_OPTIONAL([$1]))
|
CS_EMITTER_OPTIONAL([$1]))
|
||||||
$2],
|
$2],
|
||||||
[$3])])
|
[$3])])
|
||||||
|
|||||||
@@ -1,172 +1,172 @@
|
|||||||
# emit.m4 -*- Autoconf -*-
|
# emit.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003-2005 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003-2005 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_EMIT_BUILD_PROPERTY(KEY, VALUE, [APPEND], [EMPTY-OKAY], [EMITTER],
|
# CS_EMIT_BUILD_PROPERTY(KEY, VALUE, [APPEND], [EMPTY-OKAY], [EMITTER],
|
||||||
# [UNCONDITIONAL])
|
# [UNCONDITIONAL])
|
||||||
# A utility function which invokes an emitter to record the KEY/VALUE
|
# A utility function which invokes an emitter to record the KEY/VALUE
|
||||||
# tuple if VALUE is not the empty string (after leading and trailing
|
# tuple if VALUE is not the empty string (after leading and trailing
|
||||||
# whitespace is stripped). If EMPTY-OKAY is not an empty string, then the
|
# whitespace is stripped). If EMPTY-OKAY is not an empty string, then the
|
||||||
# property is emitted even if VALUE is empty; that is, it is emitted
|
# property is emitted even if VALUE is empty; that is, it is emitted
|
||||||
# unconditionally. If APPEND is the empty string, then the emitter sets
|
# unconditionally. If APPEND is the empty string, then the emitter sets
|
||||||
# the key's value directly (though it may be overridden by the
|
# the key's value directly (though it may be overridden by the
|
||||||
# environment), otherwise the emitter appends VALUE to the existing value
|
# environment), otherwise the emitter appends VALUE to the existing value
|
||||||
# of the key. EMITTER is a macro name, such as CS_JAMCONFIG_PROPERTY or
|
# of the key. EMITTER is a macro name, such as CS_JAMCONFIG_PROPERTY or
|
||||||
# CS_MAKEFILE_PROPERTY, which performs the actual task of emitting the
|
# CS_MAKEFILE_PROPERTY, which performs the actual task of emitting the
|
||||||
# KEY/VALUE tuple; it should also accept APPEND as an optional third
|
# KEY/VALUE tuple; it should also accept APPEND as an optional third
|
||||||
# argument. If EMITTER is omitted, CS_JAMCONFIG_PROPERTY is used. Some
|
# argument. If EMITTER is omitted, CS_JAMCONFIG_PROPERTY is used. Some
|
||||||
# emitters accept an optional fourth argument, UNCONDITIONAL, which
|
# emitters accept an optional fourth argument, UNCONDITIONAL, which
|
||||||
# instructs it to set KEY's value unconditionally, even if KEY already
|
# instructs it to set KEY's value unconditionally, even if KEY already
|
||||||
# had been assigned a value via some other mechanism (such as imported
|
# had been assigned a value via some other mechanism (such as imported
|
||||||
# from the environment, or from Jambase, in the case of
|
# from the environment, or from Jambase, in the case of
|
||||||
# CS_JAMCONFIG_PROPERTY).
|
# CS_JAMCONFIG_PROPERTY).
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_EMIT_BUILD_PROPERTY],
|
AC_DEFUN([CS_EMIT_BUILD_PROPERTY],
|
||||||
[cs_build_prop_val="$2"
|
[cs_build_prop_val="$2"
|
||||||
cs_build_prop_val=CS_TRIM([$cs_build_prop_val])
|
cs_build_prop_val=CS_TRIM([$cs_build_prop_val])
|
||||||
m4_ifval([$4],
|
m4_ifval([$4],
|
||||||
[CS_JAMCONFIG_PROPERTY([$1], [$cs_build_prop_val], [$3])],
|
[CS_JAMCONFIG_PROPERTY([$1], [$cs_build_prop_val], [$3])],
|
||||||
AS_IF([test -n "$cs_build_prop_val"],
|
AS_IF([test -n "$cs_build_prop_val"],
|
||||||
[m4_default([$5],[CS_JAMCONFIG_PROPERTY])(
|
[m4_default([$5],[CS_JAMCONFIG_PROPERTY])(
|
||||||
[$1], [$cs_build_prop_val], [$3], [$6])]))])
|
[$1], [$cs_build_prop_val], [$3], [$6])]))])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_EMIT_BUILD_RESULT(CACHE-VAR, PREFIX, [EMITTER])
|
# CS_EMIT_BUILD_RESULT(CACHE-VAR, PREFIX, [EMITTER])
|
||||||
# Record the results of CS_CHECK_BUILD() or CS_CHECK_LIB_WITH() via some
|
# Record the results of CS_CHECK_BUILD() or CS_CHECK_LIB_WITH() via some
|
||||||
# emitter. If CACHE-VAR indicates that the build succeeded, then the
|
# emitter. If CACHE-VAR indicates that the build succeeded, then the
|
||||||
# following properties are emitted:
|
# following properties are emitted:
|
||||||
#
|
#
|
||||||
# PREFIX.AVAILABLE = yes
|
# PREFIX.AVAILABLE = yes
|
||||||
# PREFIX.CFLAGS = $CACHE-VAR_cflags
|
# PREFIX.CFLAGS = $CACHE-VAR_cflags
|
||||||
# PREFIX.LFLAGS = $CACHE-VAR_lflags $CACHE-VAR_libs
|
# PREFIX.LFLAGS = $CACHE-VAR_lflags $CACHE-VAR_libs
|
||||||
#
|
#
|
||||||
# EMITTER is a macro name, such as CS_JAMCONFIG_PROPERTY or
|
# EMITTER is a macro name, such as CS_JAMCONFIG_PROPERTY or
|
||||||
# CS_MAKEFILE_PROPERTY, which performs the actual task of emitting the
|
# CS_MAKEFILE_PROPERTY, which performs the actual task of emitting the
|
||||||
# KEY/VALUE tuple. If EMITTER is omitted, CS_JAMCONFIG_PROPERTY is used.
|
# KEY/VALUE tuple. If EMITTER is omitted, CS_JAMCONFIG_PROPERTY is used.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_EMIT_BUILD_RESULT],
|
AC_DEFUN([CS_EMIT_BUILD_RESULT],
|
||||||
[AS_IF([test "$$1" = yes],
|
[AS_IF([test "$$1" = yes],
|
||||||
[CS_EMIT_BUILD_PROPERTY([$2.AVAILABLE], [yes], [], [], [$3])
|
[CS_EMIT_BUILD_PROPERTY([$2.AVAILABLE], [yes], [], [], [$3])
|
||||||
CS_EMIT_BUILD_PROPERTY([$2.CFLAGS], [$$1_cflags], [], [], [$3])
|
CS_EMIT_BUILD_PROPERTY([$2.CFLAGS], [$$1_cflags], [], [], [$3])
|
||||||
CS_EMIT_BUILD_PROPERTY([$2.LFLAGS], [$$1_lflags $$1_libs],
|
CS_EMIT_BUILD_PROPERTY([$2.LFLAGS], [$$1_lflags $$1_libs],
|
||||||
[], [], [$3])])])
|
[], [], [$3])])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_EMIT_BUILD_FLAGS(MESSAGE, CACHE-VAR, FLAGS, [LANGUAGE], EMITTER-KEY,
|
# CS_EMIT_BUILD_FLAGS(MESSAGE, CACHE-VAR, FLAGS, [LANGUAGE], EMITTER-KEY,
|
||||||
# [APPEND], [ACTION-IF-RECOGNIZED],
|
# [APPEND], [ACTION-IF-RECOGNIZED],
|
||||||
# [ACTION-IF-NOT-RECOGNIZED], [EMITTER])
|
# [ACTION-IF-NOT-RECOGNIZED], [EMITTER])
|
||||||
# A convenience wrapper for CS_CHECK_BUILD_FLAGS() which also records the
|
# A convenience wrapper for CS_CHECK_BUILD_FLAGS() which also records the
|
||||||
# results via CS_EMIT_BUILD_PROPERTY(). Checks if the compiler or linker
|
# results via CS_EMIT_BUILD_PROPERTY(). Checks if the compiler or linker
|
||||||
# recognizes a command-line option. MESSAGE is the "checking" message.
|
# recognizes a command-line option. MESSAGE is the "checking" message.
|
||||||
# CACHE-VAR is the shell cache variable which receives the flag
|
# CACHE-VAR is the shell cache variable which receives the flag
|
||||||
# recognized by the compiler or linker, or "no" if the flag was not
|
# recognized by the compiler or linker, or "no" if the flag was not
|
||||||
# recognized. FLAGS is a whitespace- delimited list of build tuples
|
# recognized. FLAGS is a whitespace- delimited list of build tuples
|
||||||
# created with CS_CREATE_TUPLE(). Each tuple from FLAGS is attempted in
|
# created with CS_CREATE_TUPLE(). Each tuple from FLAGS is attempted in
|
||||||
# order until one is found which is recognized by the compiler. After
|
# order until one is found which is recognized by the compiler. After
|
||||||
# that, no further flags are checked. LANGUAGE is typically either C or
|
# that, no further flags are checked. LANGUAGE is typically either C or
|
||||||
# C++ and specifies which compiler to use for the test. If LANGUAGE is
|
# C++ and specifies which compiler to use for the test. If LANGUAGE is
|
||||||
# omitted, C is used. EMITTER-KEY is the name to pass as the emitter's
|
# omitted, C is used. EMITTER-KEY is the name to pass as the emitter's
|
||||||
# "key" argument if a usable flag is encountered. If APPEND is not the
|
# "key" argument if a usable flag is encountered. If APPEND is not the
|
||||||
# empty string, then the discovered flag is appended to the existing
|
# empty string, then the discovered flag is appended to the existing
|
||||||
# value of the EMITTER-KEY. If the command-line option was recognized,
|
# value of the EMITTER-KEY. If the command-line option was recognized,
|
||||||
# then ACTION-IF-RECOGNIZED is invoked, otherwise
|
# then ACTION-IF-RECOGNIZED is invoked, otherwise
|
||||||
# ACTION-IF-NOT-RECOGNIZED is invoked. EMITTER is a macro name, such as
|
# ACTION-IF-NOT-RECOGNIZED is invoked. EMITTER is a macro name, such as
|
||||||
# CS_JAMCONFIG_PROPERTY or CS_MAKEFILE_PROPERTY, which performs the
|
# CS_JAMCONFIG_PROPERTY or CS_MAKEFILE_PROPERTY, which performs the
|
||||||
# actual task of emitting the KEY/VALUE tuple; it should also accept
|
# actual task of emitting the KEY/VALUE tuple; it should also accept
|
||||||
# APPEND as an optional third argument. If EMITTER is omitted,
|
# APPEND as an optional third argument. If EMITTER is omitted,
|
||||||
# CS_JAMCONFIG_PROPERTY is used.
|
# CS_JAMCONFIG_PROPERTY is used.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_EMIT_BUILD_FLAGS],
|
AC_DEFUN([CS_EMIT_BUILD_FLAGS],
|
||||||
[CS_CHECK_BUILD_FLAGS([$1], [$2], [$3], [$4],
|
[CS_CHECK_BUILD_FLAGS([$1], [$2], [$3], [$4],
|
||||||
[CS_EMIT_BUILD_PROPERTY([$5], [$$2], [$6], [], [$9])
|
[CS_EMIT_BUILD_PROPERTY([$5], [$$2], [$6], [], [$9])
|
||||||
$7],
|
$7],
|
||||||
[$8])])
|
[$8])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_EMITTER_OPTIONAL([EMITTER])
|
# CS_EMITTER_OPTIONAL([EMITTER])
|
||||||
# The CS_EMIT_FOO() macros optionally accept an emitter. If no emitter is
|
# The CS_EMIT_FOO() macros optionally accept an emitter. If no emitter is
|
||||||
# supplied to those macros, then a default emitter is chosen. Other
|
# supplied to those macros, then a default emitter is chosen. Other
|
||||||
# macros, however, which perform testing and optionally emit the results
|
# macros, however, which perform testing and optionally emit the results
|
||||||
# may wish to interpret an omitted EMITTER as a request not to emit the
|
# may wish to interpret an omitted EMITTER as a request not to emit the
|
||||||
# results. CS_EMITTER_OPTIONAL() is a convenience macro to help in these
|
# results. CS_EMITTER_OPTIONAL() is a convenience macro to help in these
|
||||||
# cases. It should be passed to one of the CS_EMIT_FOO() macros in place
|
# cases. It should be passed to one of the CS_EMIT_FOO() macros in place
|
||||||
# of the literal EMITTER argument. It functions by re-interpretating
|
# of the literal EMITTER argument. It functions by re-interpretating
|
||||||
# EMITTER as follows:
|
# EMITTER as follows:
|
||||||
#
|
#
|
||||||
# - If EMITTER is omitted, then CS_NULL_EMITTER is returned, effectively
|
# - If EMITTER is omitted, then CS_NULL_EMITTER is returned, effectively
|
||||||
# disabling output by the CS_EMIT_FOO() macro.
|
# disabling output by the CS_EMIT_FOO() macro.
|
||||||
# - If EMITTER is the literal string "emit" or "yes", then it returns an
|
# - If EMITTER is the literal string "emit" or "yes", then it returns an
|
||||||
# empty string, which signals to the CS_EMIT_FOO() macro that is should
|
# empty string, which signals to the CS_EMIT_FOO() macro that is should
|
||||||
# use its default emitter.
|
# use its default emitter.
|
||||||
# - Any other value for EMITTER is passed along as-is to the
|
# - Any other value for EMITTER is passed along as-is to the
|
||||||
# CS_EMIT_FOO() macro.
|
# CS_EMIT_FOO() macro.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_EMITTER_OPTIONAL],
|
AC_DEFUN([CS_EMITTER_OPTIONAL],
|
||||||
[m4_case([$1],
|
[m4_case([$1],
|
||||||
[], [[CS_NULL_EMITTER]],
|
[], [[CS_NULL_EMITTER]],
|
||||||
[emit], [],
|
[emit], [],
|
||||||
[yes], [],
|
[yes], [],
|
||||||
[[$1]])])
|
[[$1]])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_NULL_EMITTER(KEY, VALUE, [APPEND])
|
# CS_NULL_EMITTER(KEY, VALUE, [APPEND])
|
||||||
# A do-nothing emitter suitable for use as the EMITTER argument of one of
|
# A do-nothing emitter suitable for use as the EMITTER argument of one of
|
||||||
# the CS_EMIT_FOO() macros.
|
# the CS_EMIT_FOO() macros.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_NULL_EMITTER], [:
|
AC_DEFUN([CS_NULL_EMITTER], [:
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_SUBST_EMITTER(KEY, VALUE, [APPEND])
|
# CS_SUBST_EMITTER(KEY, VALUE, [APPEND])
|
||||||
# An emitter wrapped around AC_SUBST(). Invokes
|
# An emitter wrapped around AC_SUBST(). Invokes
|
||||||
# AC_SUBST(AS_TR_SH(KEY),VALUE). The APPEND argument is ignored.
|
# AC_SUBST(AS_TR_SH(KEY),VALUE). The APPEND argument is ignored.
|
||||||
# Suitable for use as the EMITTER argument of one of the CS_EMIT_FOO()
|
# Suitable for use as the EMITTER argument of one of the CS_EMIT_FOO()
|
||||||
# macros. The call to AS_TR_SH() ensures that KEY is transformed into a
|
# macros. The call to AS_TR_SH() ensures that KEY is transformed into a
|
||||||
# valid shell variable. For instance, if a macro attempts to emit
|
# valid shell variable. For instance, if a macro attempts to emit
|
||||||
# MYLIB.CFLAGS and MYLIB.LFLAGS via CS_SUBST_EMITTER(), then the names
|
# MYLIB.CFLAGS and MYLIB.LFLAGS via CS_SUBST_EMITTER(), then the names
|
||||||
# will be transformed to MYLIB_CFLAGS and MYLIB_LFLAGS, respectively, for
|
# will be transformed to MYLIB_CFLAGS and MYLIB_LFLAGS, respectively, for
|
||||||
# the invocation of AC_SUBST().
|
# the invocation of AC_SUBST().
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_SUBST_EMITTER], [AC_SUBST(AS_TR_SH([$1]),[$2])])
|
AC_DEFUN([CS_SUBST_EMITTER], [AC_SUBST(AS_TR_SH([$1]),[$2])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_DEFINE_EMITTER(KEY, VALUE, [APPEND])
|
# CS_DEFINE_EMITTER(KEY, VALUE, [APPEND])
|
||||||
# An emitter wrapped around AC_DEFINE_UNQUOTED(). Invokes
|
# An emitter wrapped around AC_DEFINE_UNQUOTED(). Invokes
|
||||||
# AC_DEFINE_UNQUOTED(AS_TR_CPP(KEY),VALUE). The APPEND argument is
|
# AC_DEFINE_UNQUOTED(AS_TR_CPP(KEY),VALUE). The APPEND argument is
|
||||||
# ignored. Suitable for use as the EMITTER argument of one of the
|
# ignored. Suitable for use as the EMITTER argument of one of the
|
||||||
# CS_EMIT_FOO() macros. The call to AS_TR_CPP() ensures that KEY is a
|
# CS_EMIT_FOO() macros. The call to AS_TR_CPP() ensures that KEY is a
|
||||||
# well-formed token for the C-preprocessor.
|
# well-formed token for the C-preprocessor.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_DEFINE_EMITTER],
|
AC_DEFUN([CS_DEFINE_EMITTER],
|
||||||
[AC_DEFINE_UNQUOTED(AS_TR_CPP([$1]),[$2],
|
[AC_DEFINE_UNQUOTED(AS_TR_CPP([$1]),[$2],
|
||||||
[Define when feature is available])])
|
[Define when feature is available])])
|
||||||
|
|||||||
@@ -1,48 +1,48 @@
|
|||||||
# headercache.m4 -*- Autoconf -*-
|
# headercache.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Text cache facility for C-style #define properties. The cache is stored in
|
# Text cache facility for C-style #define properties. The cache is stored in
|
||||||
# the shell variable cs_header_text.
|
# the shell variable cs_header_text.
|
||||||
#
|
#
|
||||||
# CS_HEADER_APPEND(TEXT)
|
# CS_HEADER_APPEND(TEXT)
|
||||||
# Append text to the C header text cache. This is a cover for
|
# Append text to the C header text cache. This is a cover for
|
||||||
# CS_TEXT_CACHE_APPEND().
|
# CS_TEXT_CACHE_APPEND().
|
||||||
#
|
#
|
||||||
# CS_HEADER_PREPEND(TEXT)
|
# CS_HEADER_PREPEND(TEXT)
|
||||||
# Prepend text to the C header text cache. This is a cover for
|
# Prepend text to the C header text cache. This is a cover for
|
||||||
# CS_TEXT_CACHE_PREPEND().
|
# CS_TEXT_CACHE_PREPEND().
|
||||||
#
|
#
|
||||||
# CS_HEADER_PROPERTY(KEY, [VALUE])
|
# CS_HEADER_PROPERTY(KEY, [VALUE])
|
||||||
# Append a line of the form "#define KEY VALUE" to the C header text
|
# Append a line of the form "#define KEY VALUE" to the C header text
|
||||||
# cache. If the VALUE argument is omitted, then the appended line has
|
# cache. If the VALUE argument is omitted, then the appended line has
|
||||||
# the simplified form "#define KEY".
|
# the simplified form "#define KEY".
|
||||||
#
|
#
|
||||||
# CS_HEADER_OUTPUT(FILENAME)
|
# CS_HEADER_OUTPUT(FILENAME)
|
||||||
# Instruct config.status to write the C header text cache to the given
|
# Instruct config.status to write the C header text cache to the given
|
||||||
# filename. This is a cover for CS_TEXT_CACHE_OUTPUT().
|
# filename. This is a cover for CS_TEXT_CACHE_OUTPUT().
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_HEADER_APPEND], [CS_TEXT_CACHE_APPEND([cs_header_text], [$1])])
|
AC_DEFUN([CS_HEADER_APPEND], [CS_TEXT_CACHE_APPEND([cs_header_text], [$1])])
|
||||||
AC_DEFUN([CS_HEADER_PREPEND], [CS_TEXT_CACHE_PREPEND([cs_header_text], [$1])])
|
AC_DEFUN([CS_HEADER_PREPEND], [CS_TEXT_CACHE_PREPEND([cs_header_text], [$1])])
|
||||||
AC_DEFUN([CS_HEADER_PROPERTY],
|
AC_DEFUN([CS_HEADER_PROPERTY],
|
||||||
[CS_HEADER_APPEND([@%:@define $1[]m4_ifval([$2], [ $2], [])
|
[CS_HEADER_APPEND([@%:@define $1[]m4_ifval([$2], [ $2], [])
|
||||||
])])
|
])])
|
||||||
AC_DEFUN([CS_HEADER_OUTPUT], [CS_TEXT_CACHE_OUTPUT([cs_header_text], [$1])])
|
AC_DEFUN([CS_HEADER_OUTPUT], [CS_TEXT_CACHE_OUTPUT([cs_header_text], [$1])])
|
||||||
|
|||||||
@@ -1,322 +1,322 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# install - install a program, script, or datafile
|
# install - install a program, script, or datafile
|
||||||
|
|
||||||
scriptversion=2004-07-05.00
|
scriptversion=2004-07-05.00
|
||||||
|
|
||||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||||
# following copyright and license.
|
# following copyright and license.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1994 X Consortium
|
# Copyright (C) 1994 X Consortium
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
# of this software and associated documentation files (the "Software"), to
|
# of this software and associated documentation files (the "Software"), to
|
||||||
# deal in the Software without restriction, including without limitation the
|
# deal in the Software without restriction, including without limitation the
|
||||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
# sell copies of the Software, and to permit persons to whom the Software is
|
# sell copies of the Software, and to permit persons to whom the Software is
|
||||||
# furnished to do so, subject to the following conditions:
|
# furnished to do so, subject to the following conditions:
|
||||||
#
|
#
|
||||||
# The above copyright notice and this permission notice shall be included in
|
# The above copyright notice and this permission notice shall be included in
|
||||||
# all copies or substantial portions of the Software.
|
# all copies or substantial portions of the Software.
|
||||||
#
|
#
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#
|
#
|
||||||
# Except as contained in this notice, the name of the X Consortium shall not
|
# Except as contained in this notice, the name of the X Consortium shall not
|
||||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||||
# ings in this Software without prior written authorization from the X Consor-
|
# ings in this Software without prior written authorization from the X Consor-
|
||||||
# tium.
|
# tium.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# FSF changes to this file are in the public domain.
|
# FSF changes to this file are in the public domain.
|
||||||
#
|
#
|
||||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||||
# `make' implicit rules from creating a file called install from it
|
# `make' implicit rules from creating a file called install from it
|
||||||
# when there is no Makefile.
|
# when there is no Makefile.
|
||||||
#
|
#
|
||||||
# This script is compatible with the BSD install script, but was written
|
# This script is compatible with the BSD install script, but was written
|
||||||
# from scratch. It can only install one file at a time, a restriction
|
# from scratch. It can only install one file at a time, a restriction
|
||||||
# shared with many OS's install programs.
|
# shared with many OS's install programs.
|
||||||
|
|
||||||
# set DOITPROG to echo to test this script
|
# set DOITPROG to echo to test this script
|
||||||
|
|
||||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||||
doit="${DOITPROG-}"
|
doit="${DOITPROG-}"
|
||||||
|
|
||||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||||
|
|
||||||
mvprog="${MVPROG-mv}"
|
mvprog="${MVPROG-mv}"
|
||||||
cpprog="${CPPROG-cp}"
|
cpprog="${CPPROG-cp}"
|
||||||
chmodprog="${CHMODPROG-chmod}"
|
chmodprog="${CHMODPROG-chmod}"
|
||||||
chownprog="${CHOWNPROG-chown}"
|
chownprog="${CHOWNPROG-chown}"
|
||||||
chgrpprog="${CHGRPPROG-chgrp}"
|
chgrpprog="${CHGRPPROG-chgrp}"
|
||||||
stripprog="${STRIPPROG-strip}"
|
stripprog="${STRIPPROG-strip}"
|
||||||
rmprog="${RMPROG-rm}"
|
rmprog="${RMPROG-rm}"
|
||||||
mkdirprog="${MKDIRPROG-mkdir}"
|
mkdirprog="${MKDIRPROG-mkdir}"
|
||||||
|
|
||||||
chmodcmd="$chmodprog 0755"
|
chmodcmd="$chmodprog 0755"
|
||||||
chowncmd=
|
chowncmd=
|
||||||
chgrpcmd=
|
chgrpcmd=
|
||||||
stripcmd=
|
stripcmd=
|
||||||
rmcmd="$rmprog -f"
|
rmcmd="$rmprog -f"
|
||||||
mvcmd="$mvprog"
|
mvcmd="$mvprog"
|
||||||
src=
|
src=
|
||||||
dst=
|
dst=
|
||||||
dir_arg=
|
dir_arg=
|
||||||
dstarg=
|
dstarg=
|
||||||
no_target_directory=
|
no_target_directory=
|
||||||
|
|
||||||
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||||
or: $0 [OPTION]... -d DIRECTORIES...
|
or: $0 [OPTION]... -d DIRECTORIES...
|
||||||
|
|
||||||
In the 1st form, copy SRCFILE to DSTFILE.
|
In the 1st form, copy SRCFILE to DSTFILE.
|
||||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||||
In the 4th, create DIRECTORIES.
|
In the 4th, create DIRECTORIES.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-c (ignored)
|
-c (ignored)
|
||||||
-d create directories instead of installing files.
|
-d create directories instead of installing files.
|
||||||
-g GROUP $chgrpprog installed files to GROUP.
|
-g GROUP $chgrpprog installed files to GROUP.
|
||||||
-m MODE $chmodprog installed files to MODE.
|
-m MODE $chmodprog installed files to MODE.
|
||||||
-o USER $chownprog installed files to USER.
|
-o USER $chownprog installed files to USER.
|
||||||
-s $stripprog installed files.
|
-s $stripprog installed files.
|
||||||
-t DIRECTORY install into DIRECTORY.
|
-t DIRECTORY install into DIRECTORY.
|
||||||
-T report an error if DSTFILE is a directory.
|
-T report an error if DSTFILE is a directory.
|
||||||
--help display this help and exit.
|
--help display this help and exit.
|
||||||
--version display version info and exit.
|
--version display version info and exit.
|
||||||
|
|
||||||
Environment variables override the default commands:
|
Environment variables override the default commands:
|
||||||
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||||
"
|
"
|
||||||
|
|
||||||
while test -n "$1"; do
|
while test -n "$1"; do
|
||||||
case $1 in
|
case $1 in
|
||||||
-c) shift
|
-c) shift
|
||||||
continue;;
|
continue;;
|
||||||
|
|
||||||
-d) dir_arg=true
|
-d) dir_arg=true
|
||||||
shift
|
shift
|
||||||
continue;;
|
continue;;
|
||||||
|
|
||||||
-g) chgrpcmd="$chgrpprog $2"
|
-g) chgrpcmd="$chgrpprog $2"
|
||||||
shift
|
shift
|
||||||
shift
|
shift
|
||||||
continue;;
|
continue;;
|
||||||
|
|
||||||
--help) echo "$usage"; exit 0;;
|
--help) echo "$usage"; exit 0;;
|
||||||
|
|
||||||
-m) chmodcmd="$chmodprog $2"
|
-m) chmodcmd="$chmodprog $2"
|
||||||
shift
|
shift
|
||||||
shift
|
shift
|
||||||
continue;;
|
continue;;
|
||||||
|
|
||||||
-o) chowncmd="$chownprog $2"
|
-o) chowncmd="$chownprog $2"
|
||||||
shift
|
shift
|
||||||
shift
|
shift
|
||||||
continue;;
|
continue;;
|
||||||
|
|
||||||
-s) stripcmd=$stripprog
|
-s) stripcmd=$stripprog
|
||||||
shift
|
shift
|
||||||
continue;;
|
continue;;
|
||||||
|
|
||||||
-t) dstarg=$2
|
-t) dstarg=$2
|
||||||
shift
|
shift
|
||||||
shift
|
shift
|
||||||
continue;;
|
continue;;
|
||||||
|
|
||||||
-T) no_target_directory=true
|
-T) no_target_directory=true
|
||||||
shift
|
shift
|
||||||
continue;;
|
continue;;
|
||||||
|
|
||||||
--version) echo "$0 $scriptversion"; exit 0;;
|
--version) echo "$0 $scriptversion"; exit 0;;
|
||||||
|
|
||||||
*) # When -d is used, all remaining arguments are directories to create.
|
*) # When -d is used, all remaining arguments are directories to create.
|
||||||
# When -t is used, the destination is already specified.
|
# When -t is used, the destination is already specified.
|
||||||
test -n "$dir_arg$dstarg" && break
|
test -n "$dir_arg$dstarg" && break
|
||||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||||
for arg
|
for arg
|
||||||
do
|
do
|
||||||
if test -n "$dstarg"; then
|
if test -n "$dstarg"; then
|
||||||
# $@ is not empty: it contains at least $arg.
|
# $@ is not empty: it contains at least $arg.
|
||||||
set fnord "$@" "$dstarg"
|
set fnord "$@" "$dstarg"
|
||||||
shift # fnord
|
shift # fnord
|
||||||
fi
|
fi
|
||||||
shift # arg
|
shift # arg
|
||||||
dstarg=$arg
|
dstarg=$arg
|
||||||
done
|
done
|
||||||
break;;
|
break;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if test -z "$1"; then
|
if test -z "$1"; then
|
||||||
if test -z "$dir_arg"; then
|
if test -z "$dir_arg"; then
|
||||||
echo "$0: no input file specified." >&2
|
echo "$0: no input file specified." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# It's OK to call `install-sh -d' without argument.
|
# It's OK to call `install-sh -d' without argument.
|
||||||
# This can happen when creating conditional directories.
|
# This can happen when creating conditional directories.
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for src
|
for src
|
||||||
do
|
do
|
||||||
# Protect names starting with `-'.
|
# Protect names starting with `-'.
|
||||||
case $src in
|
case $src in
|
||||||
-*) src=./$src ;;
|
-*) src=./$src ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
if test -n "$dir_arg"; then
|
||||||
dst=$src
|
dst=$src
|
||||||
src=
|
src=
|
||||||
|
|
||||||
if test -d "$dst"; then
|
if test -d "$dst"; then
|
||||||
mkdircmd=:
|
mkdircmd=:
|
||||||
chmodcmd=
|
chmodcmd=
|
||||||
else
|
else
|
||||||
mkdircmd=$mkdirprog
|
mkdircmd=$mkdirprog
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||||
# might cause directories to be created, which would be especially bad
|
# might cause directories to be created, which would be especially bad
|
||||||
# if $src (and thus $dsttmp) contains '*'.
|
# if $src (and thus $dsttmp) contains '*'.
|
||||||
if test ! -f "$src" && test ! -d "$src"; then
|
if test ! -f "$src" && test ! -d "$src"; then
|
||||||
echo "$0: $src does not exist." >&2
|
echo "$0: $src does not exist." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "$dstarg"; then
|
if test -z "$dstarg"; then
|
||||||
echo "$0: no destination specified." >&2
|
echo "$0: no destination specified." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dst=$dstarg
|
dst=$dstarg
|
||||||
# Protect names starting with `-'.
|
# Protect names starting with `-'.
|
||||||
case $dst in
|
case $dst in
|
||||||
-*) dst=./$dst ;;
|
-*) dst=./$dst ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# If destination is a directory, append the input filename; won't work
|
# If destination is a directory, append the input filename; won't work
|
||||||
# if double slashes aren't ignored.
|
# if double slashes aren't ignored.
|
||||||
if test -d "$dst"; then
|
if test -d "$dst"; then
|
||||||
if test -n "$no_target_directory"; then
|
if test -n "$no_target_directory"; then
|
||||||
echo "$0: $dstarg: Is a directory" >&2
|
echo "$0: $dstarg: Is a directory" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
dst=$dst/`basename "$src"`
|
dst=$dst/`basename "$src"`
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# This sed command emulates the dirname command.
|
# This sed command emulates the dirname command.
|
||||||
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||||
|
|
||||||
# Make sure that the destination directory exists.
|
# Make sure that the destination directory exists.
|
||||||
|
|
||||||
# Skip lots of stat calls in the usual case.
|
# Skip lots of stat calls in the usual case.
|
||||||
if test ! -d "$dstdir"; then
|
if test ! -d "$dstdir"; then
|
||||||
defaultIFS='
|
defaultIFS='
|
||||||
'
|
'
|
||||||
IFS="${IFS-$defaultIFS}"
|
IFS="${IFS-$defaultIFS}"
|
||||||
|
|
||||||
oIFS=$IFS
|
oIFS=$IFS
|
||||||
# Some sh's can't handle IFS=/ for some reason.
|
# Some sh's can't handle IFS=/ for some reason.
|
||||||
IFS='%'
|
IFS='%'
|
||||||
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
|
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||||
IFS=$oIFS
|
IFS=$oIFS
|
||||||
|
|
||||||
pathcomp=
|
pathcomp=
|
||||||
|
|
||||||
while test $# -ne 0 ; do
|
while test $# -ne 0 ; do
|
||||||
pathcomp=$pathcomp$1
|
pathcomp=$pathcomp$1
|
||||||
shift
|
shift
|
||||||
if test ! -d "$pathcomp"; then
|
if test ! -d "$pathcomp"; then
|
||||||
$mkdirprog "$pathcomp"
|
$mkdirprog "$pathcomp"
|
||||||
# mkdir can fail with a `File exist' error in case several
|
# mkdir can fail with a `File exist' error in case several
|
||||||
# install-sh are creating the directory concurrently. This
|
# install-sh are creating the directory concurrently. This
|
||||||
# is OK.
|
# is OK.
|
||||||
test -d "$pathcomp" || exit
|
test -d "$pathcomp" || exit
|
||||||
fi
|
fi
|
||||||
pathcomp=$pathcomp/
|
pathcomp=$pathcomp/
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
if test -n "$dir_arg"; then
|
||||||
$doit $mkdircmd "$dst" \
|
$doit $mkdircmd "$dst" \
|
||||||
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
|
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
|
||||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
|
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
|
||||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
|
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
|
||||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
|
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
|
||||||
|
|
||||||
else
|
else
|
||||||
dstfile=`basename "$dst"`
|
dstfile=`basename "$dst"`
|
||||||
|
|
||||||
# Make a couple of temp file names in the proper directory.
|
# Make a couple of temp file names in the proper directory.
|
||||||
dsttmp=$dstdir/_inst.$$_
|
dsttmp=$dstdir/_inst.$$_
|
||||||
rmtmp=$dstdir/_rm.$$_
|
rmtmp=$dstdir/_rm.$$_
|
||||||
|
|
||||||
# Trap to clean up those temp files at exit.
|
# Trap to clean up those temp files at exit.
|
||||||
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
|
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
|
||||||
trap '(exit $?); exit' 1 2 13 15
|
trap '(exit $?); exit' 1 2 13 15
|
||||||
|
|
||||||
# Copy the file name to the temp name.
|
# Copy the file name to the temp name.
|
||||||
$doit $cpprog "$src" "$dsttmp" &&
|
$doit $cpprog "$src" "$dsttmp" &&
|
||||||
|
|
||||||
# and set any options; do chmod last to preserve setuid bits.
|
# and set any options; do chmod last to preserve setuid bits.
|
||||||
#
|
#
|
||||||
# If any of these fail, we abort the whole thing. If we want to
|
# If any of these fail, we abort the whole thing. If we want to
|
||||||
# ignore errors from any of these, just make sure not to ignore
|
# ignore errors from any of these, just make sure not to ignore
|
||||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||||
#
|
#
|
||||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
|
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
|
||||||
|
|
||||||
# Now rename the file to the real destination.
|
# Now rename the file to the real destination.
|
||||||
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|
||||||
|| {
|
|| {
|
||||||
# The rename failed, perhaps because mv can't rename something else
|
# The rename failed, perhaps because mv can't rename something else
|
||||||
# to itself, or perhaps because mv is so ancient that it does not
|
# to itself, or perhaps because mv is so ancient that it does not
|
||||||
# support -f.
|
# support -f.
|
||||||
|
|
||||||
# Now remove or move aside any old file at destination location.
|
# Now remove or move aside any old file at destination location.
|
||||||
# We try this two ways since rm can't unlink itself on some
|
# We try this two ways since rm can't unlink itself on some
|
||||||
# systems and the destination file might be busy for other
|
# systems and the destination file might be busy for other
|
||||||
# reasons. In this case, the final cleanup might fail but the new
|
# reasons. In this case, the final cleanup might fail but the new
|
||||||
# file should still install successfully.
|
# file should still install successfully.
|
||||||
{
|
{
|
||||||
if test -f "$dstdir/$dstfile"; then
|
if test -f "$dstdir/$dstfile"; then
|
||||||
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|
||||||
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|
||||||
|| {
|
|| {
|
||||||
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
|
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
|
||||||
(exit 1); exit
|
(exit 1); exit
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
:
|
:
|
||||||
fi
|
fi
|
||||||
} &&
|
} &&
|
||||||
|
|
||||||
# Now rename the file to the real destination.
|
# Now rename the file to the real destination.
|
||||||
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
|
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fi || { (exit 1); exit; }
|
fi || { (exit 1); exit; }
|
||||||
done
|
done
|
||||||
|
|
||||||
# The final little trick to "correctly" pass the exit status to the exit trap.
|
# The final little trick to "correctly" pass the exit status to the exit trap.
|
||||||
{
|
{
|
||||||
(exit 0); exit
|
(exit 0); exit
|
||||||
}
|
}
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
# time-stamp-start: "scriptversion="
|
# time-stamp-start: "scriptversion="
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
# time-stamp-end: "$"
|
# time-stamp-end: "$"
|
||||||
# End:
|
# End:
|
||||||
|
|||||||
@@ -1,100 +1,100 @@
|
|||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# installdirs.m4 (c) Matze Braun <matze@braunis.de>
|
# installdirs.m4 (c) Matze Braun <matze@braunis.de>
|
||||||
# Macro for emitting the installation paths gathered by Autoconf.
|
# Macro for emitting the installation paths gathered by Autoconf.
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# CS_OUTPUT_INSTALLDIRS([EMITTER], [RAW-BACKSLASHES])
|
# CS_OUTPUT_INSTALLDIRS([EMITTER], [RAW-BACKSLASHES])
|
||||||
# Emit installation directories collected by Autoconf. EMITTER is a macro
|
# Emit installation directories collected by Autoconf. EMITTER is a macro
|
||||||
# name, such as CS_JAMCONFIG_PROPERTY or CS_MAKEFILE_PROPERTY, which performs
|
# name, such as CS_JAMCONFIG_PROPERTY or CS_MAKEFILE_PROPERTY, which performs
|
||||||
# the actual task of emitting the KEY/VALUE tuple. If EMITTER is omitted,
|
# the actual task of emitting the KEY/VALUE tuple. If EMITTER is omitted,
|
||||||
# CS_JAMCONFIG_PROPERTY is used. If RAW-BACKSLASHES is not provided, then
|
# CS_JAMCONFIG_PROPERTY is used. If RAW-BACKSLASHES is not provided, then
|
||||||
# backslashes in emitted values are each escaped with an additional
|
# backslashes in emitted values are each escaped with an additional
|
||||||
# backslash. If RAW-BACKSLASHES is not the null value, then backslashes are
|
# backslash. If RAW-BACKSLASHES is not the null value, then backslashes are
|
||||||
# emitted raw. The following properties are emitted:
|
# emitted raw. The following properties are emitted:
|
||||||
#
|
#
|
||||||
# prefix
|
# prefix
|
||||||
# exec_prefix
|
# exec_prefix
|
||||||
# bindir
|
# bindir
|
||||||
# sbindir
|
# sbindir
|
||||||
# libexecdir
|
# libexecdir
|
||||||
# datadir
|
# datadir
|
||||||
# sysconfdir
|
# sysconfdir
|
||||||
# sharedstatedir
|
# sharedstatedir
|
||||||
# localstatedir
|
# localstatedir
|
||||||
# libdir
|
# libdir
|
||||||
# includedir
|
# includedir
|
||||||
# oldincludedir
|
# oldincludedir
|
||||||
# infodir
|
# infodir
|
||||||
# mandir
|
# mandir
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_OUTPUT_INSTALLDIRS],[
|
AC_DEFUN([CS_OUTPUT_INSTALLDIRS],[
|
||||||
# Handle the case when no prefix is given, and the special case when a path
|
# Handle the case when no prefix is given, and the special case when a path
|
||||||
# contains more than 2 slashes, these paths seem to be correct but Jam fails
|
# contains more than 2 slashes, these paths seem to be correct but Jam fails
|
||||||
# on them.
|
# on them.
|
||||||
AS_IF([test $prefix = NONE],
|
AS_IF([test $prefix = NONE],
|
||||||
[cs_install_prefix="$ac_default_prefix"],
|
[cs_install_prefix="$ac_default_prefix"],
|
||||||
[cs_install_prefix=`echo "$prefix" | sed -e 's:///*:/:g'`])
|
[cs_install_prefix=`echo "$prefix" | sed -e 's:///*:/:g'`])
|
||||||
AS_IF([test $exec_prefix = NONE],
|
AS_IF([test $exec_prefix = NONE],
|
||||||
[cs_install_exec_prefix="AS_ESCAPE([$(prefix)])"],
|
[cs_install_exec_prefix="AS_ESCAPE([$(prefix)])"],
|
||||||
[cs_install_exec_prefix=`echo "$exec_prefix" | sed -e 's:///*:/:g'`])
|
[cs_install_exec_prefix=`echo "$exec_prefix" | sed -e 's:///*:/:g'`])
|
||||||
|
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [prefix],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [prefix],
|
||||||
[CS_PREPARE_INSTALLPATH([$cs_install_prefix], [$2])])
|
[CS_PREPARE_INSTALLPATH([$cs_install_prefix], [$2])])
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [exec_prefix],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [exec_prefix],
|
||||||
[CS_PREPARE_INSTALLPATH([$cs_install_exec_prefix], [$2])])
|
[CS_PREPARE_INSTALLPATH([$cs_install_exec_prefix], [$2])])
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [bindir],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [bindir],
|
||||||
[CS_PREPARE_INSTALLPATH([$bindir], [$2])])
|
[CS_PREPARE_INSTALLPATH([$bindir], [$2])])
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [sbindir],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [sbindir],
|
||||||
[CS_PREPARE_INSTALLPATH([$sbindir], [$2])])
|
[CS_PREPARE_INSTALLPATH([$sbindir], [$2])])
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [libexecdir],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [libexecdir],
|
||||||
[CS_PREPARE_INSTALLPATH([$libexecdir], [$2])])
|
[CS_PREPARE_INSTALLPATH([$libexecdir], [$2])])
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [datadir],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [datadir],
|
||||||
[CS_PREPARE_INSTALLPATH([$datadir], [$2])])
|
[CS_PREPARE_INSTALLPATH([$datadir], [$2])])
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [sysconfdir],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [sysconfdir],
|
||||||
[CS_PREPARE_INSTALLPATH([$sysconfdir], [$2])])
|
[CS_PREPARE_INSTALLPATH([$sysconfdir], [$2])])
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [sharedstatedir],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [sharedstatedir],
|
||||||
[CS_PREPARE_INSTALLPATH([$sharedstatedir], [$2])])
|
[CS_PREPARE_INSTALLPATH([$sharedstatedir], [$2])])
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [localstatedir],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [localstatedir],
|
||||||
[CS_PREPARE_INSTALLPATH([$localstatedir], [$2])])
|
[CS_PREPARE_INSTALLPATH([$localstatedir], [$2])])
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [libdir],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [libdir],
|
||||||
[CS_PREPARE_INSTALLPATH([$libdir], [$2])])
|
[CS_PREPARE_INSTALLPATH([$libdir], [$2])])
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [includedir],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [includedir],
|
||||||
[CS_PREPARE_INSTALLPATH([$includedir], [$2])])
|
[CS_PREPARE_INSTALLPATH([$includedir], [$2])])
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [oldincludedir],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [oldincludedir],
|
||||||
[CS_PREPARE_INSTALLPATH([$oldincludedir], [$2])])
|
[CS_PREPARE_INSTALLPATH([$oldincludedir], [$2])])
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [infodir],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [infodir],
|
||||||
[CS_PREPARE_INSTALLPATH([$infodir], [$2])])
|
[CS_PREPARE_INSTALLPATH([$infodir], [$2])])
|
||||||
_CS_OUTPUT_INSTALL_DIRS([$1], [mandir],
|
_CS_OUTPUT_INSTALL_DIRS([$1], [mandir],
|
||||||
[CS_PREPARE_INSTALLPATH([$mandir], [$2])])
|
[CS_PREPARE_INSTALLPATH([$mandir], [$2])])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([_CS_OUTPUT_INSTALL_DIRS],
|
AC_DEFUN([_CS_OUTPUT_INSTALL_DIRS],
|
||||||
[m4_default([$1], [CS_JAMCONFIG_PROPERTY])([$2], [$3])])
|
[m4_default([$1], [CS_JAMCONFIG_PROPERTY])([$2], [$3])])
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# CS_PREPARE_INSTALLPATH(VALUE, [RAW-BACKSLASHES])
|
# CS_PREPARE_INSTALLPATH(VALUE, [RAW-BACKSLASHES])
|
||||||
# Transform variable references of the form ${bla} to $(bla) in VALUE and
|
# Transform variable references of the form ${bla} to $(bla) in VALUE and
|
||||||
# correctly quotes backslashes. This is needed if you need to emit some of
|
# correctly quotes backslashes. This is needed if you need to emit some of
|
||||||
# the paths from Autoconf. RAW-BACKSLASHES has the same meaning as in
|
# the paths from Autoconf. RAW-BACKSLASHES has the same meaning as in
|
||||||
# CS_OUTPUT_INSTALLDIRS.
|
# CS_OUTPUT_INSTALLDIRS.
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_PREPARE_INSTALLPATH],
|
AC_DEFUN([CS_PREPARE_INSTALLPATH],
|
||||||
[`echo "$1" | sed 's/\${\([[a-zA-Z_][a-zA-Z_]]*\)}/$(\1)/g;m4_ifval([$2],
|
[`echo "$1" | sed 's/\${\([[a-zA-Z_][a-zA-Z_]]*\)}/$(\1)/g;m4_ifval([$2],
|
||||||
[s/\\/\\\\/g], [s/\\\\/\\\\\\\\/g])'`])
|
[s/\\/\\\\/g], [s/\\\\/\\\\\\\\/g])'`])
|
||||||
|
|||||||
@@ -1,58 +1,58 @@
|
|||||||
# jamcache.m4 -*- Autoconf -*-
|
# jamcache.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Text cache facility for Jam-style properties. The cache is stored in
|
# Text cache facility for Jam-style properties. The cache is stored in
|
||||||
# the shell variable cs_jamfile_text.
|
# the shell variable cs_jamfile_text.
|
||||||
#
|
#
|
||||||
# CS_JAMCONFIG_APPEND(TEXT)
|
# CS_JAMCONFIG_APPEND(TEXT)
|
||||||
# Append text to the Jam text cache. This is a cover for
|
# Append text to the Jam text cache. This is a cover for
|
||||||
# CS_TEXT_CACHE_APPEND().
|
# CS_TEXT_CACHE_APPEND().
|
||||||
#
|
#
|
||||||
# CS_JAMCONFIG_PREPEND(TEXT)
|
# CS_JAMCONFIG_PREPEND(TEXT)
|
||||||
# Prepend text to the Jam text cache. This is a cover for
|
# Prepend text to the Jam text cache. This is a cover for
|
||||||
# CS_TEXT_CACHE_PREPEND().
|
# CS_TEXT_CACHE_PREPEND().
|
||||||
#
|
#
|
||||||
# CS_JAMCONFIG_PROPERTY(KEY, VALUE, [APPEND], [UNCONDITIONAL])
|
# CS_JAMCONFIG_PROPERTY(KEY, VALUE, [APPEND], [UNCONDITIONAL])
|
||||||
# Append a line of the form "KEY ?= VALUE" to the Jam text cache. If the
|
# Append a line of the form "KEY ?= VALUE" to the Jam text cache. If the
|
||||||
# APPEND argument is not the empty string, then VALUE is appended to the
|
# APPEND argument is not the empty string, then VALUE is appended to the
|
||||||
# existing value of KEY using the form "KEY += VALUE". If the
|
# existing value of KEY using the form "KEY += VALUE". If the
|
||||||
# UNCONDITIONAL argument is not empty, then the value of KEY is set
|
# UNCONDITIONAL argument is not empty, then the value of KEY is set
|
||||||
# unconditionally "KEY = VALUE", rather than via "KEY ?= VALUE". APPEND
|
# unconditionally "KEY = VALUE", rather than via "KEY ?= VALUE". APPEND
|
||||||
# takes precedence over UNCONDITIONAL. Note that if VALUE references
|
# takes precedence over UNCONDITIONAL. Note that if VALUE references
|
||||||
# other Jam variables, for example $(OBJS), then be sure to protect the
|
# other Jam variables, for example $(OBJS), then be sure to protect the
|
||||||
# value with AS_ESCAPE(). For example:
|
# value with AS_ESCAPE(). For example:
|
||||||
# CS_JAMCONFIG_PROPERTY([ALLOBJS], [AS_ESCAPE([$(OBJS) $(LIBOBJS)])])
|
# CS_JAMCONFIG_PROPERTY([ALLOBJS], [AS_ESCAPE([$(OBJS) $(LIBOBJS)])])
|
||||||
#
|
#
|
||||||
# CS_JAMCONFIG_OUTPUT(FILENAME)
|
# CS_JAMCONFIG_OUTPUT(FILENAME)
|
||||||
# Instruct config.status to write the Jam text cache to the given
|
# Instruct config.status to write the Jam text cache to the given
|
||||||
# filename. This is a cover for CS_TEXT_CACHE_OUTPUT().
|
# filename. This is a cover for CS_TEXT_CACHE_OUTPUT().
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_JAMCONFIG_APPEND],
|
AC_DEFUN([CS_JAMCONFIG_APPEND],
|
||||||
[CS_TEXT_CACHE_APPEND([cs_jamconfig_text], [$1])])
|
[CS_TEXT_CACHE_APPEND([cs_jamconfig_text], [$1])])
|
||||||
AC_DEFUN([CS_JAMCONFIG_PREPEND],
|
AC_DEFUN([CS_JAMCONFIG_PREPEND],
|
||||||
[CS_TEXT_CACHE_PREPEND([cs_jamconfig_text], [$1])])
|
[CS_TEXT_CACHE_PREPEND([cs_jamconfig_text], [$1])])
|
||||||
AC_DEFUN([CS_JAMCONFIG_PROPERTY],
|
AC_DEFUN([CS_JAMCONFIG_PROPERTY],
|
||||||
[CS_JAMCONFIG_APPEND(
|
[CS_JAMCONFIG_APPEND(
|
||||||
[$1 m4_ifval([$3], [+=], m4_ifval([$4], [=], [?=])) \"$2\" ;
|
[$1 m4_ifval([$3], [+=], m4_ifval([$4], [=], [?=])) \"$2\" ;
|
||||||
])])
|
])])
|
||||||
AC_DEFUN([CS_JAMCONFIG_OUTPUT],
|
AC_DEFUN([CS_JAMCONFIG_OUTPUT],
|
||||||
[CS_TEXT_CACHE_OUTPUT([cs_jamconfig_text], [$1])])
|
[CS_TEXT_CACHE_OUTPUT([cs_jamconfig_text], [$1])])
|
||||||
|
|||||||
@@ -1,53 +1,53 @@
|
|||||||
# makecache.m4 -*- Autoconf -*-
|
# makecache.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Text cache facility for makefile-style properties. The cache is stored in
|
# Text cache facility for makefile-style properties. The cache is stored in
|
||||||
# the shell variable cs_makefile_text.
|
# the shell variable cs_makefile_text.
|
||||||
#
|
#
|
||||||
# CS_MAKEFILE_APPEND(TEXT)
|
# CS_MAKEFILE_APPEND(TEXT)
|
||||||
# Append text to the makefile text cache. This is a cover for
|
# Append text to the makefile text cache. This is a cover for
|
||||||
# CS_TEXT_CACHE_APPEND().
|
# CS_TEXT_CACHE_APPEND().
|
||||||
#
|
#
|
||||||
# CS_MAKEFILE_PREPEND(TEXT)
|
# CS_MAKEFILE_PREPEND(TEXT)
|
||||||
# Prepend text to the makefile text cache. This is a cover for
|
# Prepend text to the makefile text cache. This is a cover for
|
||||||
# CS_TEXT_CACHE_PREPEND().
|
# CS_TEXT_CACHE_PREPEND().
|
||||||
#
|
#
|
||||||
# CS_MAKEFILE_PROPERTY(KEY, VALUE, [APPEND])
|
# CS_MAKEFILE_PROPERTY(KEY, VALUE, [APPEND])
|
||||||
# Append a line of the form "KEY = VALUE" to the makefile text cache. If
|
# Append a line of the form "KEY = VALUE" to the makefile text cache. If
|
||||||
# the APPEND argument is not the empty string, then VALUE is appended to
|
# the APPEND argument is not the empty string, then VALUE is appended to
|
||||||
# the existing value of KEY using the form "KEY += VALUE". Note that if
|
# the existing value of KEY using the form "KEY += VALUE". Note that if
|
||||||
# VALUE references other makefile variables, for example $(OBJS), then be
|
# VALUE references other makefile variables, for example $(OBJS), then be
|
||||||
# sure to protect the value with AS_ESCAPE(). For example:
|
# sure to protect the value with AS_ESCAPE(). For example:
|
||||||
# CS_MAKEFILE_PROPERTY([ALLOBJS], [AS_ESCAPE([$(OBJS) $(LIBOBJS)])])
|
# CS_MAKEFILE_PROPERTY([ALLOBJS], [AS_ESCAPE([$(OBJS) $(LIBOBJS)])])
|
||||||
#
|
#
|
||||||
# CS_MAKEFILE_OUTPUT(FILENAME)
|
# CS_MAKEFILE_OUTPUT(FILENAME)
|
||||||
# Instruct config.status to write the makefile text cache to the given
|
# Instruct config.status to write the makefile text cache to the given
|
||||||
# filename. This is a cover for CS_TEXT_CACHE_OUTPUT().
|
# filename. This is a cover for CS_TEXT_CACHE_OUTPUT().
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_MAKEFILE_APPEND],
|
AC_DEFUN([CS_MAKEFILE_APPEND],
|
||||||
[CS_TEXT_CACHE_APPEND([cs_makefile_text], [$1])])
|
[CS_TEXT_CACHE_APPEND([cs_makefile_text], [$1])])
|
||||||
AC_DEFUN([CS_MAKEFILE_PREPEND],
|
AC_DEFUN([CS_MAKEFILE_PREPEND],
|
||||||
[CS_TEXT_CACHE_PREPEND([cs_makefile_text], [$1])])
|
[CS_TEXT_CACHE_PREPEND([cs_makefile_text], [$1])])
|
||||||
AC_DEFUN([CS_MAKEFILE_PROPERTY],
|
AC_DEFUN([CS_MAKEFILE_PROPERTY],
|
||||||
[CS_MAKEFILE_APPEND([$1 m4_ifval([$3], [+=], [=]) $2
|
[CS_MAKEFILE_APPEND([$1 m4_ifval([$3], [+=], [=]) $2
|
||||||
])])
|
])])
|
||||||
AC_DEFUN([CS_MAKEFILE_OUTPUT],[CS_TEXT_CACHE_OUTPUT([cs_makefile_text], [$1])])
|
AC_DEFUN([CS_MAKEFILE_OUTPUT],[CS_TEXT_CACHE_OUTPUT([cs_makefile_text], [$1])])
|
||||||
|
|||||||
@@ -1,93 +1,93 @@
|
|||||||
# mkdir.m4 -*- Autoconf -*-
|
# mkdir.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_CHECK_MKDIR
|
# CS_CHECK_MKDIR
|
||||||
# Determine how to create a directory and a directory tree. Sets the
|
# Determine how to create a directory and a directory tree. Sets the
|
||||||
# shell variable MKDIR to the command which creates a directory, and
|
# shell variable MKDIR to the command which creates a directory, and
|
||||||
# MKDIRS to the command which creates a directory tree. Invokes
|
# MKDIRS to the command which creates a directory tree. Invokes
|
||||||
# AC_SUBST() for MKDIR and MKDIRS.
|
# AC_SUBST() for MKDIR and MKDIRS.
|
||||||
#
|
#
|
||||||
# IMPLEMENTATION NOTES
|
# IMPLEMENTATION NOTES
|
||||||
# We need to know the exact commands, so that we can emit them, thus the
|
# We need to know the exact commands, so that we can emit them, thus the
|
||||||
# AS_MKDIR_P function is not what we want to use here since it does not
|
# AS_MKDIR_P function is not what we want to use here since it does not
|
||||||
# provide access to the commands (and might not even discover suitable
|
# provide access to the commands (and might not even discover suitable
|
||||||
# commands). First try "mkdir -p", then try the older "mkdirs".
|
# commands). First try "mkdir -p", then try the older "mkdirs".
|
||||||
# Finally, if the mkdir command failed to recognize -p, then it might
|
# Finally, if the mkdir command failed to recognize -p, then it might
|
||||||
# have created a directory named "-p", so clean up that bogus directory.
|
# have created a directory named "-p", so clean up that bogus directory.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_CHECK_MKDIR],
|
AC_DEFUN([CS_CHECK_MKDIR],
|
||||||
[AC_CACHE_CHECK([how to create a directory], [cs_cv_shell_mkdir],
|
[AC_CACHE_CHECK([how to create a directory], [cs_cv_shell_mkdir],
|
||||||
[cs_cv_shell_mkdir='mkdir'])
|
[cs_cv_shell_mkdir='mkdir'])
|
||||||
AC_SUBST([MKDIR], [$cs_cv_shell_mkdir])
|
AC_SUBST([MKDIR], [$cs_cv_shell_mkdir])
|
||||||
|
|
||||||
AC_CACHE_CHECK([how to create a directory tree], [cs_cv_shell_mkdir_p],
|
AC_CACHE_CHECK([how to create a directory tree], [cs_cv_shell_mkdir_p],
|
||||||
[if $cs_cv_shell_mkdir -p . 2>/dev/null; then
|
[if $cs_cv_shell_mkdir -p . 2>/dev/null; then
|
||||||
cs_cv_shell_mkdir_p='mkdir -p'
|
cs_cv_shell_mkdir_p='mkdir -p'
|
||||||
elif mkdirs . 2>/dev/null; then
|
elif mkdirs . 2>/dev/null; then
|
||||||
cs_cv_shell_mkdir_p='mkdirs'
|
cs_cv_shell_mkdir_p='mkdirs'
|
||||||
fi
|
fi
|
||||||
test -d ./-p && rmdir ./-p])
|
test -d ./-p && rmdir ./-p])
|
||||||
AS_VAR_SET_IF([cs_cv_shell_mkdir_p],
|
AS_VAR_SET_IF([cs_cv_shell_mkdir_p],
|
||||||
[AC_SUBST([MKDIRS], [$cs_cv_shell_mkdir_p])],
|
[AC_SUBST([MKDIRS], [$cs_cv_shell_mkdir_p])],
|
||||||
[CS_MSG_ERROR([do not know how to create a directory tree])])])
|
[CS_MSG_ERROR([do not know how to create a directory tree])])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Replacement for AS_MKDIR_P() from m4sugar/m4sh.m4 which fixes two problems
|
# Replacement for AS_MKDIR_P() from m4sugar/m4sh.m4 which fixes two problems
|
||||||
# which are present in Autoconf 2.57 and probably all earlier 2.5x versions.
|
# which are present in Autoconf 2.57 and probably all earlier 2.5x versions.
|
||||||
# This bug, along with a patch, was submitted to the Autoconf GNATS database by
|
# This bug, along with a patch, was submitted to the Autoconf GNATS database by
|
||||||
# Eric Sunshine as #227 on 17-Dec-2002. The bogus "-p" directory bug was fixed
|
# Eric Sunshine as #227 on 17-Dec-2002. The bogus "-p" directory bug was fixed
|
||||||
# for Autoconf 2.58 on 26-Sep-2003. The "mkdirs" optimization was not accepted
|
# for Autoconf 2.58 on 26-Sep-2003. The "mkdirs" optimization was not accepted
|
||||||
# (since it is unnecessary; it's only an optimization).
|
# (since it is unnecessary; it's only an optimization).
|
||||||
#
|
#
|
||||||
# 1) Removes bogus "-p" directory which the stock AS_MKDIR_P() leaves laying
|
# 1) Removes bogus "-p" directory which the stock AS_MKDIR_P() leaves laying
|
||||||
# around in the working directory if the mkdir command does not recognize
|
# around in the working directory if the mkdir command does not recognize
|
||||||
# the -p option.
|
# the -p option.
|
||||||
# 2) Takes advantage of the older "mkdirs" program if it exists and if "mkdir
|
# 2) Takes advantage of the older "mkdirs" program if it exists and if "mkdir
|
||||||
# -p" does not work.
|
# -p" does not work.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
m4_defun([_AS_MKDIR_P_PREPARE],
|
m4_defun([_AS_MKDIR_P_PREPARE],
|
||||||
[if mkdir -p . 2>/dev/null; then
|
[if mkdir -p . 2>/dev/null; then
|
||||||
as_mkdir_p='mkdir -p'
|
as_mkdir_p='mkdir -p'
|
||||||
elif mkdirs . 2>/dev/null; then
|
elif mkdirs . 2>/dev/null; then
|
||||||
as_mkdir_p='mkdirs'
|
as_mkdir_p='mkdirs'
|
||||||
else
|
else
|
||||||
as_mkdir_p=''
|
as_mkdir_p=''
|
||||||
fi
|
fi
|
||||||
test -d ./-p && rmdir ./-p
|
test -d ./-p && rmdir ./-p
|
||||||
])# _AS_MKDIR_P_PREPARE
|
])# _AS_MKDIR_P_PREPARE
|
||||||
|
|
||||||
m4_define([AS_MKDIR_P],
|
m4_define([AS_MKDIR_P],
|
||||||
[AS_REQUIRE([_$0_PREPARE])dnl
|
[AS_REQUIRE([_$0_PREPARE])dnl
|
||||||
{ if test -n "$as_mkdir_p"; then
|
{ if test -n "$as_mkdir_p"; then
|
||||||
$as_mkdir_p $1
|
$as_mkdir_p $1
|
||||||
else
|
else
|
||||||
as_dir=$1
|
as_dir=$1
|
||||||
as_dirs=
|
as_dirs=
|
||||||
while test ! -d "$as_dir"; do
|
while test ! -d "$as_dir"; do
|
||||||
as_dirs="$as_dir $as_dirs"
|
as_dirs="$as_dir $as_dirs"
|
||||||
as_dir=`AS_DIRNAME("$as_dir")`
|
as_dir=`AS_DIRNAME("$as_dir")`
|
||||||
done
|
done
|
||||||
test ! -n "$as_dirs" || mkdir $as_dirs
|
test ! -n "$as_dirs" || mkdir $as_dirs
|
||||||
fi || AS_ERROR([cannot create directory $1]); }
|
fi || AS_ERROR([cannot create directory $1]); }
|
||||||
])# AS_MKDIR_P
|
])# AS_MKDIR_P
|
||||||
|
|||||||
@@ -1,68 +1,68 @@
|
|||||||
#==============================================================================
|
#==============================================================================
|
||||||
# packageinfo.m4
|
# packageinfo.m4
|
||||||
# Macros for setting general info on the package, such as name and version
|
# Macros for setting general info on the package, such as name and version
|
||||||
# numbers and propagate them to the generated make and Jam property files.
|
# numbers and propagate them to the generated make and Jam property files.
|
||||||
#
|
#
|
||||||
# Copyright (C)2003 by Matthias Braun <matze@braunis.de>
|
# Copyright (C)2003 by Matthias Braun <matze@braunis.de>
|
||||||
# Copyright (C)2003,2004 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003,2004 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_PACKAGEINFO([LONGNAME], [COPYRIGHT, [HOMEPAGE])
|
# CS_PACKAGEINFO([LONGNAME], [COPYRIGHT, [HOMEPAGE])
|
||||||
# Set additional information for the package. Note that the version
|
# Set additional information for the package. Note that the version
|
||||||
# number of your application should only contain numbers, because on
|
# number of your application should only contain numbers, because on
|
||||||
# Windows you can only set numerical values in some of the file
|
# Windows you can only set numerical values in some of the file
|
||||||
# properties (such as versioninfo .rc files).
|
# properties (such as versioninfo .rc files).
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_PACKAGEINFO],
|
AC_DEFUN([CS_PACKAGEINFO],
|
||||||
[PACKAGE_LONGNAME="[$1]"
|
[PACKAGE_LONGNAME="[$1]"
|
||||||
PACKAGE_COPYRIGHT="[$2]"
|
PACKAGE_COPYRIGHT="[$2]"
|
||||||
PACKAGE_HOMEPAGE="[$3]"
|
PACKAGE_HOMEPAGE="[$3]"
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_EMIT_PACKAGEINFO([EMITTER])
|
# CS_EMIT_PACKAGEINFO([EMITTER])
|
||||||
# Emit extended package information using the provided EMITTER. EMITTER
|
# Emit extended package information using the provided EMITTER. EMITTER
|
||||||
# is a macro name, such as CS_JAMCONFIG_PROPERTY or CS_MAKEFILE_PROPERTY,
|
# is a macro name, such as CS_JAMCONFIG_PROPERTY or CS_MAKEFILE_PROPERTY,
|
||||||
# which performs the actual task of emitting the KEY/VALUE tuple. If
|
# which performs the actual task of emitting the KEY/VALUE tuple. If
|
||||||
# EMITTER is omitted, CS_JAMCONFIG_PROPERTY is used. For backward
|
# EMITTER is omitted, CS_JAMCONFIG_PROPERTY is used. For backward
|
||||||
# compatibility, if EMITTER is the literal value "jam", then
|
# compatibility, if EMITTER is the literal value "jam", then
|
||||||
# CS_JAMCONFIG_PROPERTY is used; if it is "make", then
|
# CS_JAMCONFIG_PROPERTY is used; if it is "make", then
|
||||||
# CS_MAKEFILE_PROPERTY is used; however use of these literal names is
|
# CS_MAKEFILE_PROPERTY is used; however use of these literal names is
|
||||||
# highly discouraged.
|
# highly discouraged.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_EMIT_PACKAGEINFO],
|
AC_DEFUN([CS_EMIT_PACKAGEINFO],
|
||||||
[_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_NAME], [$PACKAGE_NAME])
|
[_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_NAME], [$PACKAGE_NAME])
|
||||||
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_VERSION], [$PACKAGE_VERSION])
|
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_VERSION], [$PACKAGE_VERSION])
|
||||||
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_STRING], [$PACKAGE_STRING])
|
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_STRING], [$PACKAGE_STRING])
|
||||||
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_BUGREPORT], [$PACKAGE_BUGREPORT])
|
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_BUGREPORT], [$PACKAGE_BUGREPORT])
|
||||||
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_LONGNAME], [$PACKAGE_LONGNAME])
|
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_LONGNAME], [$PACKAGE_LONGNAME])
|
||||||
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_HOMEPAGE], [$PACKAGE_HOMEPAGE])
|
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_HOMEPAGE], [$PACKAGE_HOMEPAGE])
|
||||||
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_COPYRIGHT], [$PACKAGE_COPYRIGHT])
|
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_COPYRIGHT], [$PACKAGE_COPYRIGHT])
|
||||||
for cs_veritem in m4_translit(AC_PACKAGE_VERSION, [.], [ ]); do
|
for cs_veritem in m4_translit(AC_PACKAGE_VERSION, [.], [ ]); do
|
||||||
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_VERSION_LIST], [$cs_veritem], [+])
|
_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_VERSION_LIST], [$cs_veritem], [+])
|
||||||
done
|
done
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([_CS_EMIT_PACKAGEINFO],
|
AC_DEFUN([_CS_EMIT_PACKAGEINFO],
|
||||||
[m4_case([$1],
|
[m4_case([$1],
|
||||||
[make], [CS_MAKEFILE_PROPERTY([$2], [$3], [$4])],
|
[make], [CS_MAKEFILE_PROPERTY([$2], [$3], [$4])],
|
||||||
[jam], [CS_JAMCONFIG_PROPERTY([$2], [$3], [$4])],
|
[jam], [CS_JAMCONFIG_PROPERTY([$2], [$3], [$4])],
|
||||||
[], [CS_JAMCONFIG_PROPERTY([$2], [$3], [$4])],
|
[], [CS_JAMCONFIG_PROPERTY([$2], [$3], [$4])],
|
||||||
[$1([$2], [$3], [$4])])])
|
[$1([$2], [$3], [$4])])])
|
||||||
|
|||||||
@@ -1,37 +1,37 @@
|
|||||||
# path.m4 -*- Autoconf -*-
|
# path.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_PATH_NORMALIZE(STRING)
|
# CS_PATH_NORMALIZE(STRING)
|
||||||
# Normalize a pathname at run-time by transliterating Windows/DOS
|
# Normalize a pathname at run-time by transliterating Windows/DOS
|
||||||
# backslashes to forward slashes. Also collapses whitespace.
|
# backslashes to forward slashes. Also collapses whitespace.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_PATH_NORMALIZE],
|
AC_DEFUN([CS_PATH_NORMALIZE],
|
||||||
[`echo "x$1" | tr '\\\\' '/' | sed 's/^x//;s/ */ /g;s/^ //;s/ $//'`])
|
[`echo "x$1" | tr '\\\\' '/' | sed 's/^x//;s/ */ /g;s/^ //;s/ $//'`])
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_RUN_PATH_NORMALIZE(COMMAND)
|
# CS_RUN_PATH_NORMALIZE(COMMAND)
|
||||||
# Normalize the pathname emitted by COMMAND by transliterating
|
# Normalize the pathname emitted by COMMAND by transliterating
|
||||||
# Windows/DOS backslashes to forward slashes. Also collapses whitespace.
|
# Windows/DOS backslashes to forward slashes. Also collapses whitespace.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_RUN_PATH_NORMALIZE],
|
AC_DEFUN([CS_RUN_PATH_NORMALIZE],
|
||||||
[`AC_RUN_LOG([$1]) | tr '\\\\' '/' | sed 's/^x//;s/ */ /g;s/^ //;s/ $//'`])
|
[`AC_RUN_LOG([$1]) | tr '\\\\' '/' | sed 's/^x//;s/ */ /g;s/^ //;s/ $//'`])
|
||||||
|
|||||||
@@ -1,207 +1,207 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# progver.m4
|
# progver.m4
|
||||||
# Written by Norman Kramer <norman@users.sourceforge.net>
|
# Written by Norman Kramer <norman@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# From the input pattern we create regular expressions we send through sed
|
# From the input pattern we create regular expressions we send through sed
|
||||||
# to extract the version information from the standard input to sed.
|
# to extract the version information from the standard input to sed.
|
||||||
# Then we extract from the resulting version string subparts.
|
# Then we extract from the resulting version string subparts.
|
||||||
# The same happens with the supplied version string. It too is split into its
|
# The same happens with the supplied version string. It too is split into its
|
||||||
# subparts according to the pattern.
|
# subparts according to the pattern.
|
||||||
# Then the subparts from the gathered version string and the supplied one are
|
# Then the subparts from the gathered version string and the supplied one are
|
||||||
# compared.
|
# compared.
|
||||||
#
|
#
|
||||||
# How does the pattern look like ?
|
# How does the pattern look like ?
|
||||||
# It is a sequence of 9s and _s and separators.
|
# It is a sequence of 9s and _s and separators.
|
||||||
# 9 denotes a non empty sequence of digits.
|
# 9 denotes a non empty sequence of digits.
|
||||||
# _ denotes a non empty sequence of characters from the class [a-zA-Z].
|
# _ denotes a non empty sequence of characters from the class [a-zA-Z].
|
||||||
# | everything behind is optional
|
# | everything behind is optional
|
||||||
# Everything else is treated as a separator.
|
# Everything else is treated as a separator.
|
||||||
# Consecutive 9s and _s are compressed to contain only one of each type.
|
# Consecutive 9s and _s are compressed to contain only one of each type.
|
||||||
# For instance "99_.9.__abc9_" will become "9_.9._abc9_".
|
# For instance "99_.9.__abc9_" will become "9_.9._abc9_".
|
||||||
#
|
#
|
||||||
# How we find the parts we compare ?
|
# How we find the parts we compare ?
|
||||||
# From this transformed string we yield the parts we will later compare.
|
# From this transformed string we yield the parts we will later compare.
|
||||||
# We break up the string as follows:
|
# We break up the string as follows:
|
||||||
# Any sequence of separators represent one breakup. Additional breakups are
|
# Any sequence of separators represent one breakup. Additional breakups are
|
||||||
# placed behind every 9 and _ .
|
# placed behind every 9 and _ .
|
||||||
# So the example from above will give:
|
# So the example from above will give:
|
||||||
#
|
#
|
||||||
# "99_.9.__abc9_" ===compress==> "9_.9._abc9_" ===breakup==> "9" "_" "9" "_" "9" "_"
|
# "99_.9.__abc9_" ===compress==> "9_.9._abc9_" ===breakup==> "9" "_" "9" "_" "9" "_"
|
||||||
#
|
#
|
||||||
# How we create the regular expressions ?
|
# How we create the regular expressions ?
|
||||||
# We take the compressed pattern and quote every separator.
|
# We take the compressed pattern and quote every separator.
|
||||||
# The we replace the 9s with [0-9][0-9]*
|
# The we replace the 9s with [0-9][0-9]*
|
||||||
# and the _s with [a-zA-Z][a-zA-Z]* .
|
# and the _s with [a-zA-Z][a-zA-Z]* .
|
||||||
# The above example will become:
|
# The above example will become:
|
||||||
#
|
#
|
||||||
# "99_.9.__abc9_" ===compress==> "9_.9._abc9_" ===rexify==>
|
# "99_.9.__abc9_" ===compress==> "9_.9._abc9_" ===rexify==>
|
||||||
# [0-9][0-9]*[a-zA-Z][a-zA-Z]*\.[0-9][0-9]*\.[a-zA-Z][a-zA-Z]*\a\b\c[0-9][0-9]*[a-zA-Z][a-zA-Z]*
|
# [0-9][0-9]*[a-zA-Z][a-zA-Z]*\.[0-9][0-9]*\.[a-zA-Z][a-zA-Z]*\a\b\c[0-9][0-9]*[a-zA-Z][a-zA-Z]*
|
||||||
#
|
#
|
||||||
# Voila.
|
# Voila.
|
||||||
#
|
#
|
||||||
# To yield the subparts from the string we additionally enclose the
|
# To yield the subparts from the string we additionally enclose the
|
||||||
# 9s and _s with \( and \).
|
# 9s and _s with \( and \).
|
||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# ****************************************************************
|
# ****************************************************************
|
||||||
# ** helper definitions **
|
# ** helper definitions **
|
||||||
# ****************************************************************
|
# ****************************************************************
|
||||||
m4_define([CS_VCHK_RUNTH], [m4_pushdef([i], [$1])m4_if($1,0,,[CS_VCHK_RUNTH(m4_decr($1), [$2])][$2])m4_popdef([i])])
|
m4_define([CS_VCHK_RUNTH], [m4_pushdef([i], [$1])m4_if($1,0,,[CS_VCHK_RUNTH(m4_decr($1), [$2])][$2])m4_popdef([i])])
|
||||||
m4_define([CS_VCHK_PREFIX], [])
|
m4_define([CS_VCHK_PREFIX], [])
|
||||||
m4_define([CS_VCHK_SUFFIX], [])
|
m4_define([CS_VCHK_SUFFIX], [])
|
||||||
m4_define([CS_VCHK_GROUPPREFIX], [\(])
|
m4_define([CS_VCHK_GROUPPREFIX], [\(])
|
||||||
m4_define([CS_VCHK_GROUPSUFFIX], [\)])
|
m4_define([CS_VCHK_GROUPSUFFIX], [\)])
|
||||||
m4_define([CS_VCHK_CHAR], [[[[a-zA-Z]]]])
|
m4_define([CS_VCHK_CHAR], [[[[a-zA-Z]]]])
|
||||||
m4_define([CS_VCHK_DIGIT], [[[0-9]]])
|
m4_define([CS_VCHK_DIGIT], [[[0-9]]])
|
||||||
m4_define([CS_VCHK_SEQUENCE], [CS_VCHK_PREFIX[]CS_VCHK_SINGLE[]CS_VCHK_SINGLE[]*CS_VCHK_SUFFIX[]])
|
m4_define([CS_VCHK_SEQUENCE], [CS_VCHK_PREFIX[]CS_VCHK_SINGLE[]CS_VCHK_SINGLE[]*CS_VCHK_SUFFIX[]])
|
||||||
m4_define([CS_VCHK_OPTSEQUENCE], [CS_VCHK_PREFIX[]CS_VCHK_SINGLE[]*CS_VCHK_SUFFIX[]])
|
m4_define([CS_VCHK_OPTSEQUENCE], [CS_VCHK_PREFIX[]CS_VCHK_SINGLE[]*CS_VCHK_SUFFIX[]])
|
||||||
m4_define([CS_VCHK_REXSEQ], [m4_bpatsubst($1, [$2], [[]CS_VCHK_SEQUENCE[]])])
|
m4_define([CS_VCHK_REXSEQ], [m4_bpatsubst($1, [$2], [[]CS_VCHK_SEQUENCE[]])])
|
||||||
m4_define([CS_VCHK_GROUPINGON], [m4_pushdef([CS_VCHK_PREFIX], [CS_VCHK_GROUPPREFIX])m4_pushdef([CS_VCHK_SUFFIX], [CS_VCHK_GROUPSUFFIX])])
|
m4_define([CS_VCHK_GROUPINGON], [m4_pushdef([CS_VCHK_PREFIX], [CS_VCHK_GROUPPREFIX])m4_pushdef([CS_VCHK_SUFFIX], [CS_VCHK_GROUPSUFFIX])])
|
||||||
m4_define([CS_VCHK_GROUPINGOFF], [m4_popdef([CS_VCHK_SUFFIX])m4_popdef([CS_VCHK_PREFIX])])
|
m4_define([CS_VCHK_GROUPINGOFF], [m4_popdef([CS_VCHK_SUFFIX])m4_popdef([CS_VCHK_PREFIX])])
|
||||||
m4_define([CS_VCHK_OPTON], [m4_pushdef([CS_VCHK_SEQUENCE], [CS_VCHK_OPTSEQUENCE])])
|
m4_define([CS_VCHK_OPTON], [m4_pushdef([CS_VCHK_SEQUENCE], [CS_VCHK_OPTSEQUENCE])])
|
||||||
m4_define([CS_VCHK_OPTOFF], [m4_popdef([CS_VCHK_SEQUENCE])])
|
m4_define([CS_VCHK_OPTOFF], [m4_popdef([CS_VCHK_SEQUENCE])])
|
||||||
m4_define([CS_VCHK_RMOPT], [CS_VCHK_RMCHAR([$1], m4_index([$1], [|]))])
|
m4_define([CS_VCHK_RMOPT], [CS_VCHK_RMCHAR([$1], m4_index([$1], [|]))])
|
||||||
m4_define([CS_VCHK_RMCHAR], [m4_if($2,-1,[$1],m4_substr([$1], 0, $2)[]m4_substr([$1], m4_incr($2)))])
|
m4_define([CS_VCHK_RMCHAR], [m4_if($2,-1,[$1],m4_substr([$1], 0, $2)[]m4_substr([$1], m4_incr($2)))])
|
||||||
m4_define([CS_VCHK_RMALL], [m4_translit([$1], [|], [])])
|
m4_define([CS_VCHK_RMALL], [m4_translit([$1], [|], [])])
|
||||||
m4_define([CS_VCHK_CUTOFF], [m4_if(m4_index($1,[|]),-1, [$1], [m4_substr($1, 0, m4_index($1,[|]))])])
|
m4_define([CS_VCHK_CUTOFF], [m4_if(m4_index($1,[|]),-1, [$1], [m4_substr($1, 0, m4_index($1,[|]))])])
|
||||||
m4_define([CS_VCHK_CYCLEOPT], [
|
m4_define([CS_VCHK_CYCLEOPT], [
|
||||||
m4_if($2,-1,, [m4_pushdef([i], CS_VCHK_CUTOFF([$1])) m4_pushdef([j], CS_VCHK_DUMMY_TAIL([$1])) CS_VCHK_CYCLEOPT( CS_VCHK_RMOPT([$1]), m4_index($1, [|]), [$3])$3 m4_popdef([i]) m4_popdef([j])])
|
m4_if($2,-1,, [m4_pushdef([i], CS_VCHK_CUTOFF([$1])) m4_pushdef([j], CS_VCHK_DUMMY_TAIL([$1])) CS_VCHK_CYCLEOPT( CS_VCHK_RMOPT([$1]), m4_index($1, [|]), [$3])$3 m4_popdef([i]) m4_popdef([j])])
|
||||||
])
|
])
|
||||||
m4_define([CS_VCHK_TAIL], [m4_if(m4_index($1,[|]),-1, [], [m4_substr($1, m4_incr(m4_index($1,[|])))])])
|
m4_define([CS_VCHK_TAIL], [m4_if(m4_index($1,[|]),-1, [], [m4_substr($1, m4_incr(m4_index($1,[|])))])])
|
||||||
m4_define([CS_VCHK_DUMMY_COMPRESS], [m4_bpatsubst(m4_bpatsubst([$1], [__*], [A]), [99*], [0])])
|
m4_define([CS_VCHK_DUMMY_COMPRESS], [m4_bpatsubst(m4_bpatsubst([$1], [__*], [A]), [99*], [0])])
|
||||||
m4_define([CS_VCHK_DUMMY_TAIL], [CS_VCHK_DUMMY_COMPRESS(m4_translit(CS_VCHK_TAIL([$1]), [|], []))])
|
m4_define([CS_VCHK_DUMMY_TAIL], [CS_VCHK_DUMMY_COMPRESS(m4_translit(CS_VCHK_TAIL([$1]), [|], []))])
|
||||||
|
|
||||||
# ****************************************************************
|
# ****************************************************************
|
||||||
# ** FlagsOn / FlagsOff **
|
# ** FlagsOn / FlagsOff **
|
||||||
# ****************************************************************
|
# ****************************************************************
|
||||||
m4_define([CS_VCHK_FLAGSON],
|
m4_define([CS_VCHK_FLAGSON],
|
||||||
[m4_if($#, 0, [],
|
[m4_if($#, 0, [],
|
||||||
$1, [], [],
|
$1, [], [],
|
||||||
[$1], [group], [CS_VCHK_GROUPINGON[]],
|
[$1], [group], [CS_VCHK_GROUPINGON[]],
|
||||||
[$1], [opt], [CS_VCHK_OPTON[]])dnl
|
[$1], [opt], [CS_VCHK_OPTON[]])dnl
|
||||||
m4_if($#, 0, [], $1, [], [], [CS_VCHK_FLAGSON(m4_shift($@))])])
|
m4_if($#, 0, [], $1, [], [], [CS_VCHK_FLAGSON(m4_shift($@))])])
|
||||||
|
|
||||||
m4_define([CS_VCHK_FLAGSOFF],
|
m4_define([CS_VCHK_FLAGSOFF],
|
||||||
[m4_if($#, 0, [],
|
[m4_if($#, 0, [],
|
||||||
$1, [], [],
|
$1, [], [],
|
||||||
$1, [group], [CS_VCHK_GROUPINGOFF[]],
|
$1, [group], [CS_VCHK_GROUPINGOFF[]],
|
||||||
[$1], [opt], [CS_VCHK_OPTOFF[]])dnl
|
[$1], [opt], [CS_VCHK_OPTOFF[]])dnl
|
||||||
m4_if($#, 0, [], $1, [], [], [CS_VCHK_FLAGSOFF(m4_shift($@))])])
|
m4_if($#, 0, [], $1, [], [], [CS_VCHK_FLAGSOFF(m4_shift($@))])])
|
||||||
|
|
||||||
# ****************************************************************
|
# ****************************************************************
|
||||||
# ** rexify / sedify **
|
# ** rexify / sedify **
|
||||||
# ****************************************************************
|
# ****************************************************************
|
||||||
m4_define([CS_VCHK_REXIFY],
|
m4_define([CS_VCHK_REXIFY],
|
||||||
[m4_pushdef([CS_VCHK_SINGLE], [$1])dnl
|
[m4_pushdef([CS_VCHK_SINGLE], [$1])dnl
|
||||||
CS_VCHK_FLAGSON(m4_shift(m4_shift(m4_shift($@))))dnl
|
CS_VCHK_FLAGSON(m4_shift(m4_shift(m4_shift($@))))dnl
|
||||||
CS_VCHK_REXSEQ([$3], [$2])dnl
|
CS_VCHK_REXSEQ([$3], [$2])dnl
|
||||||
CS_VCHK_FLAGSOFF(m4_shift(m4_shift(m4_shift($@))))dnl
|
CS_VCHK_FLAGSOFF(m4_shift(m4_shift(m4_shift($@))))dnl
|
||||||
m4_popdef([CS_VCHK_SINGLE])])
|
m4_popdef([CS_VCHK_SINGLE])])
|
||||||
|
|
||||||
m4_define([CS_VCHK_QUOTESEP], [m4_bpatsubst($1, [[^9_]], [\\\&])])
|
m4_define([CS_VCHK_QUOTESEP], [m4_bpatsubst($1, [[^9_]], [\\\&])])
|
||||||
|
|
||||||
m4_define([CS_VCHK_REXCHAR], [CS_VCHK_REXIFY([CS_VCHK_CHAR], [__*], $@)])
|
m4_define([CS_VCHK_REXCHAR], [CS_VCHK_REXIFY([CS_VCHK_CHAR], [__*], $@)])
|
||||||
m4_define([CS_VCHK_REXDIGIT], [CS_VCHK_REXIFY([CS_VCHK_DIGIT], [99*], $@)])
|
m4_define([CS_VCHK_REXDIGIT], [CS_VCHK_REXIFY([CS_VCHK_DIGIT], [99*], $@)])
|
||||||
m4_define([CS_VCHK_SEDIFY], [CS_VCHK_REXDIGIT([CS_VCHK_REXCHAR([CS_VCHK_QUOTESEP([$1])], m4_shift($@))], m4_shift($@))])
|
m4_define([CS_VCHK_SEDIFY], [CS_VCHK_REXDIGIT([CS_VCHK_REXCHAR([CS_VCHK_QUOTESEP([$1])], m4_shift($@))], m4_shift($@))])
|
||||||
m4_define([CS_VCHK_SEDEXPRALL], [/CS_VCHK_SEDIFY([$1])/!d;s/.*\(CS_VCHK_SEDIFY([$1])\).*/\1/;q])
|
m4_define([CS_VCHK_SEDEXPRALL], [/CS_VCHK_SEDIFY([$1])/!d;s/.*\(CS_VCHK_SEDIFY([$1])\).*/\1/;q])
|
||||||
m4_define([CS_VCHK_SEDEXPRNTH], [/CS_VCHK_SEDIFY([$1])/!d;s/.*CS_VCHK_SEDIFY([$1],[group]).*/\$2/])
|
m4_define([CS_VCHK_SEDEXPRNTH], [/CS_VCHK_SEDIFY([$1])/!d;s/.*CS_VCHK_SEDIFY([$1],[group]).*/\$2/])
|
||||||
|
|
||||||
# ****************************************************************
|
# ****************************************************************
|
||||||
# ** Pattern splitting **
|
# ** Pattern splitting **
|
||||||
# ****************************************************************
|
# ****************************************************************
|
||||||
m4_define([CS_VCHK_SPLITSEP], [CS_VCHK_REXIFY([s], [[^9_][^9_]*], $@)])
|
m4_define([CS_VCHK_SPLITSEP], [CS_VCHK_REXIFY([s], [[^9_][^9_]*], $@)])
|
||||||
m4_define([CS_VCHK_SPLITDIGIT], [CS_VCHK_REXIFY([d], [99*], $@)])
|
m4_define([CS_VCHK_SPLITDIGIT], [CS_VCHK_REXIFY([d], [99*], $@)])
|
||||||
m4_define([CS_VCHK_SPLITCHAR], [CS_VCHK_REXIFY([c], [__*], $@)])
|
m4_define([CS_VCHK_SPLITCHAR], [CS_VCHK_REXIFY([c], [__*], $@)])
|
||||||
|
|
||||||
# ****************************************************************
|
# ****************************************************************
|
||||||
# ** return a list of 's' 'd' 'c' 'e' chars denoting the kind **
|
# ** return a list of 's' 'd' 'c' 'e' chars denoting the kind **
|
||||||
# ** pattern parts: separator, digit, char, end **
|
# ** pattern parts: separator, digit, char, end **
|
||||||
# ****************************************************************
|
# ****************************************************************
|
||||||
m4_define([CS_VCHK_PATTERNLIST], [m4_pushdef([CS_VCHK_SEQUENCE], [CS_VCHK_SINGLE ])dnl
|
m4_define([CS_VCHK_PATTERNLIST], [m4_pushdef([CS_VCHK_SEQUENCE], [CS_VCHK_SINGLE ])dnl
|
||||||
m4_translit(CS_VCHK_SPLITDIGIT([CS_VCHK_SPLITCHAR([CS_VCHK_SPLITSEP([$1])])]), [ ], m4_if([$2],[],[ ],[$2]))e[]dnl
|
m4_translit(CS_VCHK_SPLITDIGIT([CS_VCHK_SPLITCHAR([CS_VCHK_SPLITSEP([$1])])]), [ ], m4_if([$2],[],[ ],[$2]))e[]dnl
|
||||||
m4_popdef([CS_VCHK_SEQUENCE])])
|
m4_popdef([CS_VCHK_SEQUENCE])])
|
||||||
|
|
||||||
# ****************************************************************
|
# ****************************************************************
|
||||||
# ** Build the shell commands we emit to the configure script. **
|
# ** Build the shell commands we emit to the configure script. **
|
||||||
# ****************************************************************
|
# ****************************************************************
|
||||||
m4_define([CS_VCHK_PATCOUNT], [m4_len(m4_bpatsubst(CS_VCHK_PATTERNLIST([$1]), [[^dc]]))])
|
m4_define([CS_VCHK_PATCOUNT], [m4_len(m4_bpatsubst(CS_VCHK_PATTERNLIST([$1]), [[^dc]]))])
|
||||||
|
|
||||||
# ****************************************************************************************
|
# ****************************************************************************************
|
||||||
# ** CS_VCHK_EXTRACTVERSION(EXTRACT_CALL, MIN_VERSION, PATTERN, PRGPREFIX, COMPARISION) **
|
# ** CS_VCHK_EXTRACTVERSION(EXTRACT_CALL, MIN_VERSION, PATTERN, PRGPREFIX, COMPARISION) **
|
||||||
# ****************************************************************************************
|
# ****************************************************************************************
|
||||||
m4_define([CS_VCHK_EXTRACTVERSION],
|
m4_define([CS_VCHK_EXTRACTVERSION],
|
||||||
[cs_prog_$4_is_version=
|
[cs_prog_$4_is_version=
|
||||||
cs_prog_$4_min_version=
|
cs_prog_$4_min_version=
|
||||||
cs_prog_$4_is_suffix=
|
cs_prog_$4_is_suffix=
|
||||||
cs_prog_$4_min_suffix=
|
cs_prog_$4_min_suffix=
|
||||||
cs_prog_$4_is_suffix_done=
|
cs_prog_$4_is_suffix_done=
|
||||||
cs_prog_$4_min_suffix_done=
|
cs_prog_$4_min_suffix_done=
|
||||||
CS_VCHK_CYCLEOPT([$3], [],
|
CS_VCHK_CYCLEOPT([$3], [],
|
||||||
[test -z $cs_prog_$4_is_version && cs_prog_$4_is_version=`$1 | sed 'CS_VCHK_SEDEXPRALL([i])'`
|
[test -z $cs_prog_$4_is_version && cs_prog_$4_is_version=`$1 | sed 'CS_VCHK_SEDEXPRALL([i])'`
|
||||||
test -n "$cs_prog_$4_is_version" && test -z $cs_prog_$4_is_suffix_done && { cs_prog_$4_is_suffix_done=yes ; cs_prog_$4_is_suffix=j ; }
|
test -n "$cs_prog_$4_is_version" && test -z $cs_prog_$4_is_suffix_done && { cs_prog_$4_is_suffix_done=yes ; cs_prog_$4_is_suffix=j ; }
|
||||||
])
|
])
|
||||||
CS_VCHK_CYCLEOPT([$3], ,
|
CS_VCHK_CYCLEOPT([$3], ,
|
||||||
[test -z $cs_prog_$4_min_version && cs_prog_$4_min_version=`echo $2 | sed 'CS_VCHK_SEDEXPRALL([i])'`
|
[test -z $cs_prog_$4_min_version && cs_prog_$4_min_version=`echo $2 | sed 'CS_VCHK_SEDEXPRALL([i])'`
|
||||||
test -n "$cs_prog_$4_min_version" && test -z $cs_prog_$4_min_suffix_done && { cs_prog_$4_min_suffix_done=yes ; cs_prog_$4_min_suffix=j ; }
|
test -n "$cs_prog_$4_min_version" && test -z $cs_prog_$4_min_suffix_done && { cs_prog_$4_min_suffix_done=yes ; cs_prog_$4_min_suffix=j ; }
|
||||||
])
|
])
|
||||||
CS_VCHK_RUNTH([CS_VCHK_PATCOUNT([$3])],
|
CS_VCHK_RUNTH([CS_VCHK_PATCOUNT([$3])],
|
||||||
[cs_prog_$4_is_ver_[]i=`echo ${cs_prog_$4_is_version}${cs_prog_$4_is_suffix} | sed 'CS_VCHK_SEDEXPRNTH([CS_VCHK_RMALL([$3])], [i])'`
|
[cs_prog_$4_is_ver_[]i=`echo ${cs_prog_$4_is_version}${cs_prog_$4_is_suffix} | sed 'CS_VCHK_SEDEXPRNTH([CS_VCHK_RMALL([$3])], [i])'`
|
||||||
])
|
])
|
||||||
CS_VCHK_RUNTH([CS_VCHK_PATCOUNT([$3])],
|
CS_VCHK_RUNTH([CS_VCHK_PATCOUNT([$3])],
|
||||||
[cs_prog_$4_min_ver_[]i=`echo $cs_prog_$4_min_version${cs_prog_$4_min_suffix} | sed 'CS_VCHK_SEDEXPRNTH([CS_VCHK_RMALL([$3])], [i])'`
|
[cs_prog_$4_min_ver_[]i=`echo $cs_prog_$4_min_version${cs_prog_$4_min_suffix} | sed 'CS_VCHK_SEDEXPRNTH([CS_VCHK_RMALL([$3])], [i])'`
|
||||||
])
|
])
|
||||||
cs_cv_prog_$4_version_ok=''
|
cs_cv_prog_$4_version_ok=''
|
||||||
CS_VCHK_RUNTH([CS_VCHK_PATCOUNT([$3])],
|
CS_VCHK_RUNTH([CS_VCHK_PATCOUNT([$3])],
|
||||||
[test -z "$cs_cv_prog_$4_version_ok" && { expr "$cs_prog_$4_is_ver_[]i" "$5" "$cs_prog_$4_min_ver_[]i" >/dev/null || cs_cv_prog_$4_version_ok=no ; }
|
[test -z "$cs_cv_prog_$4_version_ok" && { expr "$cs_prog_$4_is_ver_[]i" "$5" "$cs_prog_$4_min_ver_[]i" >/dev/null || cs_cv_prog_$4_version_ok=no ; }
|
||||||
test -z "$cs_cv_prog_$4_version_ok" && { expr "$cs_prog_$4_min_ver_[]i" "$5" "$cs_prog_$4_is_ver_[]i" >/dev/null || cs_cv_prog_$4_version_ok=yes ; }
|
test -z "$cs_cv_prog_$4_version_ok" && { expr "$cs_prog_$4_min_ver_[]i" "$5" "$cs_prog_$4_is_ver_[]i" >/dev/null || cs_cv_prog_$4_version_ok=yes ; }
|
||||||
])
|
])
|
||||||
AS_IF([test -z "$cs_cv_prog_$4_version_ok"], [cs_cv_prog_$4_version_ok=yes])
|
AS_IF([test -z "$cs_cv_prog_$4_version_ok"], [cs_cv_prog_$4_version_ok=yes])
|
||||||
cs_cv_prog_$4_version_ok_annotated="$cs_cv_prog_$4_version_ok"
|
cs_cv_prog_$4_version_ok_annotated="$cs_cv_prog_$4_version_ok"
|
||||||
AS_IF([test -n "$cs_prog_$4_is_version"],
|
AS_IF([test -n "$cs_prog_$4_is_version"],
|
||||||
[cs_cv_prog_$4_version_ok_annotated="$cs_cv_prog_$4_version_ok_annotated (version $cs_prog_$4_is_version)"])
|
[cs_cv_prog_$4_version_ok_annotated="$cs_cv_prog_$4_version_ok_annotated (version $cs_prog_$4_is_version)"])
|
||||||
])
|
])
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# CS_CHECK_PROG_VERSION(PROG, EXTRACT_CALL, VERSION, PATTERN,
|
# CS_CHECK_PROG_VERSION(PROG, EXTRACT_CALL, VERSION, PATTERN,
|
||||||
# [ACTION-IF-OKAY], [ACTION-IF-NOT-OKAY], [CMP])
|
# [ACTION-IF-OKAY], [ACTION-IF-NOT-OKAY], [CMP])
|
||||||
# Check the version of a program PROG.
|
# Check the version of a program PROG.
|
||||||
# Version information is emitted by EXTRACT_CALL (for instance "bison -V").
|
# Version information is emitted by EXTRACT_CALL (for instance "bison -V").
|
||||||
# The discovered program version is compared against VERSION.
|
# The discovered program version is compared against VERSION.
|
||||||
# The pattern of the version string matches PATTERN
|
# The pattern of the version string matches PATTERN
|
||||||
# The extracted version and the supplied version are compared with the CMP
|
# The extracted version and the supplied version are compared with the CMP
|
||||||
# operator. i.e. EXTRACTED_VERSION CMP SUPPLIED_VERSION
|
# operator. i.e. EXTRACTED_VERSION CMP SUPPLIED_VERSION
|
||||||
# CMP defaults to >= if not specified.
|
# CMP defaults to >= if not specified.
|
||||||
# ACTION-IF-OKAY is invoked if comparision yields true, otherwise
|
# ACTION-IF-OKAY is invoked if comparision yields true, otherwise
|
||||||
# ACTION-IF-NOT-OKAY is invoked.
|
# ACTION-IF-NOT-OKAY is invoked.
|
||||||
#
|
#
|
||||||
# PATTERN literals: 9 .. marks a non empty sequence of digits
|
# PATTERN literals: 9 .. marks a non empty sequence of digits
|
||||||
# _ .. marks a non empty sequence of characters from [a-zA-Z]
|
# _ .. marks a non empty sequence of characters from [a-zA-Z]
|
||||||
# | .. everything behind is optional
|
# | .. everything behind is optional
|
||||||
# .. everything else is taken as separator - it is better
|
# .. everything else is taken as separator - it is better
|
||||||
# to not try stuff like space, slash or comma.
|
# to not try stuff like space, slash or comma.
|
||||||
#
|
#
|
||||||
# The test results in cs_cv_prog_PROG_version_ok being either yes or no.
|
# The test results in cs_cv_prog_PROG_version_ok being either yes or no.
|
||||||
##############################################################################
|
##############################################################################
|
||||||
AC_DEFUN([CS_CHECK_PROG_VERSION],
|
AC_DEFUN([CS_CHECK_PROG_VERSION],
|
||||||
[AC_CACHE_CHECK([if $1 version m4_default([$7],[>=]) $3],
|
[AC_CACHE_CHECK([if $1 version m4_default([$7],[>=]) $3],
|
||||||
[AS_TR_SH([cs_cv_prog_$1_version_ok_annotated])],
|
[AS_TR_SH([cs_cv_prog_$1_version_ok_annotated])],
|
||||||
[CS_VCHK_EXTRACTVERSION([$2], [$3], [$4], AS_TR_SH([$1]),
|
[CS_VCHK_EXTRACTVERSION([$2], [$3], [$4], AS_TR_SH([$1]),
|
||||||
m4_default([$7],[>=]))])
|
m4_default([$7],[>=]))])
|
||||||
AS_IF([test "$AS_TR_SH([cs_cv_prog_$1_version_ok])" = yes], [$5], [$6])])
|
AS_IF([test "$AS_TR_SH([cs_cv_prog_$1_version_ok])" = yes], [$5], [$6])])
|
||||||
|
|||||||
@@ -1,46 +1,46 @@
|
|||||||
# qualify.m4 -*- Autoconf -*-
|
# qualify.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_SYMBOL_QUALIFIER(MESSAGE, CACHE-VAR, QUALIFIERS, [SYMBOL], [LANG],
|
# CS_SYMBOL_QUALIFIER(MESSAGE, CACHE-VAR, QUALIFIERS, [SYMBOL], [LANG],
|
||||||
# [ACTION-IF-ACCEPTED], [ACTION-IF-NOT-ACCEPTED])
|
# [ACTION-IF-ACCEPTED], [ACTION-IF-NOT-ACCEPTED])
|
||||||
# Test if a symbol can be qualified by one of the elements of the
|
# Test if a symbol can be qualified by one of the elements of the
|
||||||
# comma-separated list of QUALIFIERS. Examples of qualifiers include
|
# comma-separated list of QUALIFIERS. Examples of qualifiers include
|
||||||
# __attribute__((deprecated)), __declspec(dllimport), etc. MESSAGE is the
|
# __attribute__((deprecated)), __declspec(dllimport), etc. MESSAGE is the
|
||||||
# "checking" message. CACHE-VAR is the variable which receives the
|
# "checking" message. CACHE-VAR is the variable which receives the
|
||||||
# qualifier which succeeded, or the the literal "no" if none were
|
# qualifier which succeeded, or the the literal "no" if none were
|
||||||
# accepted. SYMBOL is the symbol to which the qualifier should be
|
# accepted. SYMBOL is the symbol to which the qualifier should be
|
||||||
# applied. If omitted, then SYMBOL defaults to "void f();". LANG is the
|
# applied. If omitted, then SYMBOL defaults to "void f();". LANG is the
|
||||||
# language of the test, typically "C" or "C++". It defaults to "C" if
|
# language of the test, typically "C" or "C++". It defaults to "C" if
|
||||||
# omitted. ACTION-IF-ACCEPTED is invoked after CACHE-VAR is set if one of
|
# omitted. ACTION-IF-ACCEPTED is invoked after CACHE-VAR is set if one of
|
||||||
# the qualifiers is accepted, else ACTION-IF-NOT-ACCEPTED is invoked.
|
# the qualifiers is accepted, else ACTION-IF-NOT-ACCEPTED is invoked.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_SYMBOL_QUALIFIER],
|
AC_DEFUN([CS_SYMBOL_QUALIFIER],
|
||||||
[AC_CACHE_CHECK([$1], [$2],
|
[AC_CACHE_CHECK([$1], [$2],
|
||||||
[$2='no'
|
[$2='no'
|
||||||
m4_foreach([cs_symbol_qualifier], [$3],
|
m4_foreach([cs_symbol_qualifier], [$3],
|
||||||
[AS_IF([test "$$2" = no],
|
[AS_IF([test "$$2" = no],
|
||||||
[CS_BUILD_IFELSE(
|
[CS_BUILD_IFELSE(
|
||||||
[AC_LANG_PROGRAM(
|
[AC_LANG_PROGRAM(
|
||||||
[cs_symbol_qualifier m4_default([$4],[void f()]);],
|
[cs_symbol_qualifier m4_default([$4],[void f()]);],
|
||||||
[])],
|
[])],
|
||||||
[], [$5], [$2='cs_symbol_qualifier'], [$2='no'])])])])
|
[], [$5], [$2='cs_symbol_qualifier'], [$2='no'])])])])
|
||||||
AS_IF([test $$2 != no], [$6], [$7])])
|
AS_IF([test $$2 != no], [$6], [$7])])
|
||||||
|
|||||||
@@ -1,49 +1,49 @@
|
|||||||
# split.m4 -*- Autoconf -*-
|
# split.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_SPLIT(LINE, [OUTPUT-VARIABLES], [DELIMITER], [FILLER])
|
# CS_SPLIT(LINE, [OUTPUT-VARIABLES], [DELIMITER], [FILLER])
|
||||||
# Split LINE into individual tokens. Tokens are delimited by DELIMITER,
|
# Split LINE into individual tokens. Tokens are delimited by DELIMITER,
|
||||||
# which is the space character if omitted. OUTPUT-VARIABLES is a
|
# which is the space character if omitted. OUTPUT-VARIABLES is a
|
||||||
# comma-delimited list of shell variables which should receive the
|
# comma-delimited list of shell variables which should receive the
|
||||||
# extracted tokens. If there are too few tokens to fill the output
|
# extracted tokens. If there are too few tokens to fill the output
|
||||||
# variables, then the excess variables will be assigned the empty string.
|
# variables, then the excess variables will be assigned the empty string.
|
||||||
# If there are too few output variables, then the excess tokens will be
|
# If there are too few output variables, then the excess tokens will be
|
||||||
# ignored. If OUTPUT-VARIABLES is omitted, then the split tokens will be
|
# ignored. If OUTPUT-VARIABLES is omitted, then the split tokens will be
|
||||||
# assigned to the shell meta-variables $1, $2, $3, etc. When
|
# assigned to the shell meta-variables $1, $2, $3, etc. When
|
||||||
# OUTPUT-VARIABLES is omitted, FILLER is assigned to meta-variables in
|
# OUTPUT-VARIABLES is omitted, FILLER is assigned to meta-variables in
|
||||||
# cases where DELIMITER delimits a zero-length token. FILLER defaults
|
# cases where DELIMITER delimits a zero-length token. FILLER defaults
|
||||||
# to "filler". For example, if DELIMITER is "+" and OUTPUT-VARIABLES is
|
# to "filler". For example, if DELIMITER is "+" and OUTPUT-VARIABLES is
|
||||||
# omitted, given the line "one++three", $1 will be "one", $2 will be
|
# omitted, given the line "one++three", $1 will be "one", $2 will be
|
||||||
# "filler", and $3 will be "three".
|
# "filler", and $3 will be "three".
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_SPLIT],
|
AC_DEFUN([CS_SPLIT],
|
||||||
[m4_define([cs_split_filler], m4_default([$4],[filler]))
|
[m4_define([cs_split_filler], m4_default([$4],[filler]))
|
||||||
set cs_split_filler `echo "$1" | awk 'BEGIN { FS="m4_default([$3],[ ])" }
|
set cs_split_filler `echo "$1" | awk 'BEGIN { FS="m4_default([$3],[ ])" }
|
||||||
{ for (i=1; i <= NF; ++i)
|
{ for (i=1; i <= NF; ++i)
|
||||||
{ if ($i == "") print "cs_split_filler"; else print $i } }'`
|
{ if ($i == "") print "cs_split_filler"; else print $i } }'`
|
||||||
shift
|
shift
|
||||||
m4_map([_CS_SPLIT], [$2])])
|
m4_map([_CS_SPLIT], [$2])])
|
||||||
|
|
||||||
AC_DEFUN([_CS_SPLIT],
|
AC_DEFUN([_CS_SPLIT],
|
||||||
[AS_IF([test $[@%:@] -eq 0], [$1=''],
|
[AS_IF([test $[@%:@] -eq 0], [$1=''],
|
||||||
[AS_IF([test "$[1]" = cs_split_filler], [$1=''], [$1=$[1]])
|
[AS_IF([test "$[1]" = cs_split_filler], [$1=''], [$1=$[1]])
|
||||||
shift])])
|
shift])])
|
||||||
|
|||||||
@@ -1,78 +1,78 @@
|
|||||||
# textcache.m4 -*- Autoconf -*-
|
# textcache.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Text cache facility. These macros provide a way to incrementally store
|
# Text cache facility. These macros provide a way to incrementally store
|
||||||
# arbitrary text in a shell variable, and to write the saved text to a file.
|
# arbitrary text in a shell variable, and to write the saved text to a file.
|
||||||
#
|
#
|
||||||
# CS_TEXT_CACHE_APPEND(VARIABLE, TEXT)
|
# CS_TEXT_CACHE_APPEND(VARIABLE, TEXT)
|
||||||
# Append text to the contents of the named shell variable. If the text
|
# Append text to the contents of the named shell variable. If the text
|
||||||
# contains references to shell variables (such as $foo), then those
|
# contains references to shell variables (such as $foo), then those
|
||||||
# references will be expanded. If expansion is not desired, then protect
|
# references will be expanded. If expansion is not desired, then protect
|
||||||
# the text with AS_ESCAPE().
|
# the text with AS_ESCAPE().
|
||||||
#
|
#
|
||||||
# CS_TEXT_CACHE_PREPEND(VARIABLE, TEXT)
|
# CS_TEXT_CACHE_PREPEND(VARIABLE, TEXT)
|
||||||
# Prepend text to the contents of the named shell variable. If the text
|
# Prepend text to the contents of the named shell variable. If the text
|
||||||
# contains references to shell variables (such as $foo), then those
|
# contains references to shell variables (such as $foo), then those
|
||||||
# references will be expanded. If expansion is not desired, then protect
|
# references will be expanded. If expansion is not desired, then protect
|
||||||
# the text with AS_ESCAPE().
|
# the text with AS_ESCAPE().
|
||||||
#
|
#
|
||||||
# CS_TEXT_CACHE_OUTPUT(VARIABLE, FILENAME)
|
# CS_TEXT_CACHE_OUTPUT(VARIABLE, FILENAME)
|
||||||
# Instruct config.status to write the contents of the named shell
|
# Instruct config.status to write the contents of the named shell
|
||||||
# variable to the given filename. If the file resides in a directory,
|
# variable to the given filename. If the file resides in a directory,
|
||||||
# the directory will be created, if necessary. If the output file
|
# the directory will be created, if necessary. If the output file
|
||||||
# already exists, and if the cached text is identical to the contents of
|
# already exists, and if the cached text is identical to the contents of
|
||||||
# the existing file, then the existing file is left alone, thus its time
|
# the existing file, then the existing file is left alone, thus its time
|
||||||
# stamp remains unmolested. This heuristic may help to minimize rebuilds
|
# stamp remains unmolested. This heuristic may help to minimize rebuilds
|
||||||
# when the file is listed as a dependency in a makefile.
|
# when the file is listed as a dependency in a makefile.
|
||||||
#
|
#
|
||||||
# *NOTE*
|
# *NOTE*
|
||||||
# There is a bug in Autoconf 2.57 and probably all earlier 2.5x versions
|
# There is a bug in Autoconf 2.57 and probably all earlier 2.5x versions
|
||||||
# which results in errors if AC_CONFIG_COMMANDS is invoked for a `tag'
|
# which results in errors if AC_CONFIG_COMMANDS is invoked for a `tag'
|
||||||
# which represents a file in a directory which does not yet exist.
|
# which represents a file in a directory which does not yet exist.
|
||||||
# Unfortunately, even invoking AS_MKDIR_P in the `cmd' portion of
|
# Unfortunately, even invoking AS_MKDIR_P in the `cmd' portion of
|
||||||
# AC_CONFIG_COMMANDS does not solve the problem because the generated
|
# AC_CONFIG_COMMANDS does not solve the problem because the generated
|
||||||
# configure script attempts to access information about the directory
|
# configure script attempts to access information about the directory
|
||||||
# before AS_MKDIR_P has a chance to create it. This forces us to invoke
|
# before AS_MKDIR_P has a chance to create it. This forces us to invoke
|
||||||
# AS_MKDIR_P in the third argument to AC_CONFIG_COMMANDS (the
|
# AS_MKDIR_P in the third argument to AC_CONFIG_COMMANDS (the
|
||||||
# `init-cmds') rather than the second (the `cmds'). This is undesirable
|
# `init-cmds') rather than the second (the `cmds'). This is undesirable
|
||||||
# because it means that the directory will be created anytime
|
# because it means that the directory will be created anytime
|
||||||
# config.status is invoked (even for a simple --help), rather than being
|
# config.status is invoked (even for a simple --help), rather than being
|
||||||
# created only when requested to output the text cache. This bug was
|
# created only when requested to output the text cache. This bug was
|
||||||
# submitted to the Autoconf GNATS database by Eric Sunshine as #228 on
|
# submitted to the Autoconf GNATS database by Eric Sunshine as #228 on
|
||||||
# 27-Dec-2002. It was fixed for Autoconf 2.58 on 26-Sep-2003. The
|
# 27-Dec-2002. It was fixed for Autoconf 2.58 on 26-Sep-2003. The
|
||||||
# official fix makes the assumption that `tag' always represents a file
|
# official fix makes the assumption that `tag' always represents a file
|
||||||
# (as opposed to some generic target), and creates the file's directory
|
# (as opposed to some generic target), and creates the file's directory
|
||||||
# is not present.
|
# is not present.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_TEXT_CACHE_APPEND], [$1="${$1}$2"])
|
AC_DEFUN([CS_TEXT_CACHE_APPEND], [$1="${$1}$2"])
|
||||||
AC_DEFUN([CS_TEXT_CACHE_PREPEND], [$1="$2${$1}"])
|
AC_DEFUN([CS_TEXT_CACHE_PREPEND], [$1="$2${$1}"])
|
||||||
AC_DEFUN([CS_TEXT_CACHE_OUTPUT],
|
AC_DEFUN([CS_TEXT_CACHE_OUTPUT],
|
||||||
[AC_CONFIG_COMMANDS([$2],
|
[AC_CONFIG_COMMANDS([$2],
|
||||||
[echo $ECHO_N "$$1$ECHO_C" > $tmp/tcache
|
[echo $ECHO_N "$$1$ECHO_C" > $tmp/tcache
|
||||||
AS_IF([diff $2 $tmp/tcache >/dev/null 2>&1],
|
AS_IF([diff $2 $tmp/tcache >/dev/null 2>&1],
|
||||||
[AC_MSG_NOTICE([$2 is unchanged])],
|
[AC_MSG_NOTICE([$2 is unchanged])],
|
||||||
[rm -f $2
|
[rm -f $2
|
||||||
cp $tmp/tcache $2])
|
cp $tmp/tcache $2])
|
||||||
rm -f $tmp/tcache],
|
rm -f $tmp/tcache],
|
||||||
[$1='$$1'
|
[$1='$$1'
|
||||||
cs_dir=`AS_DIRNAME([$2])`
|
cs_dir=`AS_DIRNAME([$2])`
|
||||||
AS_ESCAPE(AS_MKDIR_P([$cs_dir]), [$`\])])])
|
AS_ESCAPE(AS_MKDIR_P([$cs_dir]), [$`\])])])
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
# trim.m4 -*- Autoconf -*-
|
# trim.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_TRIM(STRING)
|
# CS_TRIM(STRING)
|
||||||
# Strip leading and trailing spaces from STRING and collapse internal
|
# Strip leading and trailing spaces from STRING and collapse internal
|
||||||
# runs of multiple spaces to a single space.
|
# runs of multiple spaces to a single space.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_TRIM], [`echo x$1 | sed 's/^x//;s/ */ /g;s/^ //;s/ $//'`])
|
AC_DEFUN([CS_TRIM], [`echo x$1 | sed 's/^x//;s/ */ /g;s/^ //;s/ $//'`])
|
||||||
|
|||||||
@@ -1,151 +1,151 @@
|
|||||||
# warnings.m4 -*- Autoconf -*-
|
# warnings.m4 -*- Autoconf -*-
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_COMPILER_WARNINGS([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
# CS_COMPILER_WARNINGS([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
||||||
# [ACTION-IF-NOT-FOUND])
|
# [ACTION-IF-NOT-FOUND])
|
||||||
# Check how to enable compilation warnings. If LANGUAGE is not provided,
|
# Check how to enable compilation warnings. If LANGUAGE is not provided,
|
||||||
# then `C' is assumed (other options include `C++'). If CACHE-VAR is not
|
# then `C' is assumed (other options include `C++'). If CACHE-VAR is not
|
||||||
# provided, then it defaults to the name
|
# provided, then it defaults to the name
|
||||||
# "cs_cv_prog_compiler_enable_warnings". If an option for enabling
|
# "cs_cv_prog_compiler_enable_warnings". If an option for enabling
|
||||||
# warnings (such as `-Wall') is discovered, then it is assigned to
|
# warnings (such as `-Wall') is discovered, then it is assigned to
|
||||||
# CACHE-VAR and ACTION-IF-FOUND is invoked; otherwise the empty string is
|
# CACHE-VAR and ACTION-IF-FOUND is invoked; otherwise the empty string is
|
||||||
# assigned to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
|
# assigned to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
|
||||||
#
|
#
|
||||||
# IMPLEMENTATION NOTES
|
# IMPLEMENTATION NOTES
|
||||||
#
|
#
|
||||||
# On some platforms, it is more appropriate to use -Wmost rather than
|
# On some platforms, it is more appropriate to use -Wmost rather than
|
||||||
# -Wall even if the compiler understands both, thus we attempt -Wmost
|
# -Wall even if the compiler understands both, thus we attempt -Wmost
|
||||||
# before -Wall.
|
# before -Wall.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_COMPILER_WARNINGS],
|
AC_DEFUN([CS_COMPILER_WARNINGS],
|
||||||
[CS_CHECK_BUILD_FLAGS(
|
[CS_CHECK_BUILD_FLAGS(
|
||||||
[how to enable m4_default([$1],[C]) compilation warnings],
|
[how to enable m4_default([$1],[C]) compilation warnings],
|
||||||
[m4_default([$2],[cs_cv_prog_compiler_enable_warnings])],
|
[m4_default([$2],[cs_cv_prog_compiler_enable_warnings])],
|
||||||
[CS_CREATE_TUPLE([-Wmost]) CS_CREATE_TUPLE([-Wall])],
|
[CS_CREATE_TUPLE([-Wmost]) CS_CREATE_TUPLE([-Wall])],
|
||||||
[$1], [$3], [$4])])
|
[$1], [$3], [$4])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_COMPILER_ERRORS([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
# CS_COMPILER_ERRORS([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
||||||
# [ACTION-IF-NOT-FOUND])
|
# [ACTION-IF-NOT-FOUND])
|
||||||
# Check how to promote compilation diganostics from warning to error
|
# Check how to promote compilation diganostics from warning to error
|
||||||
# status. If LANGUAGE is not provided, then `C' is assumed (other options
|
# status. If LANGUAGE is not provided, then `C' is assumed (other options
|
||||||
# include `C++'). If CACHE-VAR is not provided, then it defaults to the
|
# include `C++'). If CACHE-VAR is not provided, then it defaults to the
|
||||||
# name "cs_cv_prog_compiler_enable_errors". If an option for performing
|
# name "cs_cv_prog_compiler_enable_errors". If an option for performing
|
||||||
# this promotion (such as `-Werror') is discovered, then it is assigned
|
# this promotion (such as `-Werror') is discovered, then it is assigned
|
||||||
# to CACHE-VAR and ACTION-IF-FOUND is invoked; otherwise the empty string
|
# to CACHE-VAR and ACTION-IF-FOUND is invoked; otherwise the empty string
|
||||||
# is assigned to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
|
# is assigned to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_COMPILER_ERRORS],
|
AC_DEFUN([CS_COMPILER_ERRORS],
|
||||||
[CS_CHECK_BUILD_FLAGS(
|
[CS_CHECK_BUILD_FLAGS(
|
||||||
[how to treat m4_default([$1],[C]) warnings as errors],
|
[how to treat m4_default([$1],[C]) warnings as errors],
|
||||||
[m4_default([$2],[cs_cv_prog_compiler_enable_errors])],
|
[m4_default([$2],[cs_cv_prog_compiler_enable_errors])],
|
||||||
[CS_CREATE_TUPLE([-Werror])], [$1], [$3], [$4])])
|
[CS_CREATE_TUPLE([-Werror])], [$1], [$3], [$4])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_COMPILER_IGNORE_UNUSED([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
# CS_COMPILER_IGNORE_UNUSED([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
||||||
# [ACTION-IF-NOT-FOUND])
|
# [ACTION-IF-NOT-FOUND])
|
||||||
# Check how to instruct compiler to ignore unused variables and
|
# Check how to instruct compiler to ignore unused variables and
|
||||||
# arguments. This option may be useful for code generated by tools, such
|
# arguments. This option may be useful for code generated by tools, such
|
||||||
# as Swig, Bison, and Flex, over which the client has no control, yet
|
# as Swig, Bison, and Flex, over which the client has no control, yet
|
||||||
# wishes to compile without excessive diagnostic spew. If LANGUAGE is
|
# wishes to compile without excessive diagnostic spew. If LANGUAGE is
|
||||||
# not provided, then `C' is assumed (other options include `C++'). If
|
# not provided, then `C' is assumed (other options include `C++'). If
|
||||||
# CACHE-VAR is not provided, then it defaults to the name
|
# CACHE-VAR is not provided, then it defaults to the name
|
||||||
# "cs_cv_prog_compiler_ignore_unused". If an option (such as
|
# "cs_cv_prog_compiler_ignore_unused". If an option (such as
|
||||||
# `-Wno-unused') is discovered, then it is assigned to CACHE-VAR and
|
# `-Wno-unused') is discovered, then it is assigned to CACHE-VAR and
|
||||||
# ACTION-IF-FOUND is invoked; otherwise the empty string is assigned to
|
# ACTION-IF-FOUND is invoked; otherwise the empty string is assigned to
|
||||||
# CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
|
# CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_COMPILER_IGNORE_UNUSED],
|
AC_DEFUN([CS_COMPILER_IGNORE_UNUSED],
|
||||||
[CS_CHECK_BUILD_FLAGS(
|
[CS_CHECK_BUILD_FLAGS(
|
||||||
[how to suppress m4_default([$1],[C]) unused variable warnings],
|
[how to suppress m4_default([$1],[C]) unused variable warnings],
|
||||||
[m4_default([$2],[cs_cv_prog_compiler_ignore_unused])],
|
[m4_default([$2],[cs_cv_prog_compiler_ignore_unused])],
|
||||||
[CS_CREATE_TUPLE([-Wno-unused])], [$1], [$3], [$4])])
|
[CS_CREATE_TUPLE([-Wno-unused])], [$1], [$3], [$4])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_COMPILER_IGNORE_UNINITIALIZED([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
# CS_COMPILER_IGNORE_UNINITIALIZED([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
||||||
# [ACTION-IF-NOT-FOUND])
|
# [ACTION-IF-NOT-FOUND])
|
||||||
# Check how to instruct compiler to ignore uninitialized variables. This
|
# Check how to instruct compiler to ignore uninitialized variables. This
|
||||||
# option may be useful for code generated by tools, such as Swig, Bison,
|
# option may be useful for code generated by tools, such as Swig, Bison,
|
||||||
# and Flex, over which the client has no control, yet wishes to compile
|
# and Flex, over which the client has no control, yet wishes to compile
|
||||||
# without excessive diagnostic spew. If LANGUAGE is not provided, then
|
# without excessive diagnostic spew. If LANGUAGE is not provided, then
|
||||||
# `C' is assumed (other options include `C++'). If CACHE-VAR is not
|
# `C' is assumed (other options include `C++'). If CACHE-VAR is not
|
||||||
# provided, then it defaults to the name
|
# provided, then it defaults to the name
|
||||||
# "cs_cv_prog_compiler_ignore_uninitialized". If an option (such as
|
# "cs_cv_prog_compiler_ignore_uninitialized". If an option (such as
|
||||||
# `-Wno-uninitialized') is discovered, then it is assigned to CACHE-VAR
|
# `-Wno-uninitialized') is discovered, then it is assigned to CACHE-VAR
|
||||||
# and ACTION-IF-FOUND is invoked; otherwise the empty string is assigned
|
# and ACTION-IF-FOUND is invoked; otherwise the empty string is assigned
|
||||||
# to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
|
# to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_COMPILER_IGNORE_UNINITIALIZED],
|
AC_DEFUN([CS_COMPILER_IGNORE_UNINITIALIZED],
|
||||||
[CS_CHECK_BUILD_FLAGS(
|
[CS_CHECK_BUILD_FLAGS(
|
||||||
[how to suppress m4_default([$1],[C]) uninitialized warnings],
|
[how to suppress m4_default([$1],[C]) uninitialized warnings],
|
||||||
[m4_default([$2],
|
[m4_default([$2],
|
||||||
[cs_cv_prog_compiler_ignore_uninitialized_variables])],
|
[cs_cv_prog_compiler_ignore_uninitialized_variables])],
|
||||||
[CS_CREATE_TUPLE([-Wno-uninitialized])], [$1], [$3], [$4])])
|
[CS_CREATE_TUPLE([-Wno-uninitialized])], [$1], [$3], [$4])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_COMPILER_IGNORE_PRAGMAS([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
# CS_COMPILER_IGNORE_PRAGMAS([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
||||||
# [ACTION-IF-NOT-FOUND])
|
# [ACTION-IF-NOT-FOUND])
|
||||||
# Check how to instruct compiler to ignore unrecognized #pragma
|
# Check how to instruct compiler to ignore unrecognized #pragma
|
||||||
# directives. This option may be useful for code which contains
|
# directives. This option may be useful for code which contains
|
||||||
# unprotected #pragmas which are not understood by all compilers. If
|
# unprotected #pragmas which are not understood by all compilers. If
|
||||||
# LANGUAGE is not provided, then `C' is assumed (other options include
|
# LANGUAGE is not provided, then `C' is assumed (other options include
|
||||||
# `C++'). If CACHE-VAR is not provided, then it defaults to the name
|
# `C++'). If CACHE-VAR is not provided, then it defaults to the name
|
||||||
# "cs_cv_prog_compiler_ignore_unknown_pragmas". If an option (such as
|
# "cs_cv_prog_compiler_ignore_unknown_pragmas". If an option (such as
|
||||||
# `-Wno-unknown-pragmas') is discovered, then it is assigned to CACHE-VAR
|
# `-Wno-unknown-pragmas') is discovered, then it is assigned to CACHE-VAR
|
||||||
# and ACTION-IF-FOUND is invoked; otherwise the empty string is assigned
|
# and ACTION-IF-FOUND is invoked; otherwise the empty string is assigned
|
||||||
# to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
|
# to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_COMPILER_IGNORE_PRAGMAS],
|
AC_DEFUN([CS_COMPILER_IGNORE_PRAGMAS],
|
||||||
[CS_CHECK_BUILD_FLAGS(
|
[CS_CHECK_BUILD_FLAGS(
|
||||||
[how to suppress m4_default([$1],[C]) unknown [#pragma] warnings],
|
[how to suppress m4_default([$1],[C]) unknown [#pragma] warnings],
|
||||||
[m4_default([$2],[cs_cv_prog_compiler_ignore_unknown_pragmas])],
|
[m4_default([$2],[cs_cv_prog_compiler_ignore_unknown_pragmas])],
|
||||||
[CS_CREATE_TUPLE([-Wno-unknown-pragmas])], [$1], [$3], [$4])])
|
[CS_CREATE_TUPLE([-Wno-unknown-pragmas])], [$1], [$3], [$4])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# CS_COMPILER_IGNORE_LONG_DOUBLE([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
# CS_COMPILER_IGNORE_LONG_DOUBLE([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
|
||||||
# [ACTION-IF-NOT-FOUND])
|
# [ACTION-IF-NOT-FOUND])
|
||||||
# Check how to instruct compiler to suppress warnings about `long double'
|
# Check how to instruct compiler to suppress warnings about `long double'
|
||||||
# usage. This option may be useful for code generated by tools, such as
|
# usage. This option may be useful for code generated by tools, such as
|
||||||
# Swig, Bison, and Flex, over which the client has no control, yet wishes
|
# Swig, Bison, and Flex, over which the client has no control, yet wishes
|
||||||
# to compile without excessive diagnostic spew. If LANGUAGE is not
|
# to compile without excessive diagnostic spew. If LANGUAGE is not
|
||||||
# provided, then `C' is assumed (other options include `C++'). If
|
# provided, then `C' is assumed (other options include `C++'). If
|
||||||
# CACHE-VAR is not provided, then it defaults to the name
|
# CACHE-VAR is not provided, then it defaults to the name
|
||||||
# "cs_cv_prog_compiler_ignore_long_double". If an option (such as
|
# "cs_cv_prog_compiler_ignore_long_double". If an option (such as
|
||||||
# `-Wno-long-double') is discovered, then it is assigned to CACHE-VAR and
|
# `-Wno-long-double') is discovered, then it is assigned to CACHE-VAR and
|
||||||
# ACTION-IF-FOUND is invoked; otherwise the empty string is assigned to
|
# ACTION-IF-FOUND is invoked; otherwise the empty string is assigned to
|
||||||
# CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
|
# CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
AC_DEFUN([CS_COMPILER_IGNORE_LONG_DOUBLE],
|
AC_DEFUN([CS_COMPILER_IGNORE_LONG_DOUBLE],
|
||||||
[CS_CHECK_BUILD_FLAGS(
|
[CS_CHECK_BUILD_FLAGS(
|
||||||
[how to suppress m4_default([$1],[C]) `long double' warnings],
|
[how to suppress m4_default([$1],[C]) `long double' warnings],
|
||||||
[m4_default([$2],[cs_cv_prog_compiler_ignore_long_double])],
|
[m4_default([$2],[cs_cv_prog_compiler_ignore_long_double])],
|
||||||
[CS_CREATE_TUPLE([-Wno-long-double])], [$1], [$3], [$4])])
|
[CS_CREATE_TUPLE([-Wno-long-double])], [$1], [$3], [$4])])
|
||||||
|
|||||||
@@ -1,151 +1,164 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for compiling applications
|
# Rules for compiling applications
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
# Use a more sensible and typical mode for executables than Jam's default.
|
# Use a more sensible and typical mode for executables than Jam's default.
|
||||||
if "$(EXEMODE)" = "711" { EXEMODE = "+x" ; }
|
if "$(EXEMODE)" = "711" { EXEMODE = "+x" ; }
|
||||||
|
|
||||||
## Application appname : sources [ : options ]
|
## Application appname : sources [ : options ]
|
||||||
## Build an application out of sourcefiles. All sourcefiles will be passed
|
## Build an application out of sourcefiles. All sourcefiles will be passed
|
||||||
## to the Objects rule which tries to compile them into object-files. You
|
## to the Objects rule which tries to compile them into object-files. You
|
||||||
## can create rules for your own filetypes with the UserObject rule. Header
|
## can create rules for your own filetypes with the UserObject rule. Header
|
||||||
## files will just be ignored. They are only used for MSVC projectfile
|
## files will just be ignored. They are only used for MSVC projectfile
|
||||||
## generation.
|
## generation.
|
||||||
## Possible options are "noinstall" if you don't want a default install
|
## Possible options are "noinstall" if you don't want a default install
|
||||||
## target to be created and "console" if you're building a console
|
## target to be created and "console" if you're building a console
|
||||||
## application (an application without any graphical output which is
|
## application (an application without any graphical output which is
|
||||||
## intended to be used on commandline)
|
## intended to be used on commandline)
|
||||||
## Some notes: You should not add the .exe extension to the appname - jam
|
## Some notes: You should not add the .exe extension to the appname - jam
|
||||||
## will do that on win32.
|
## will do that on win32.
|
||||||
## Options:
|
## Options:
|
||||||
## console: Create a console application
|
## console: Create a console application
|
||||||
## noinstall: Do not set up a default installation targets.
|
## noinstall: Do not set up a default installation targets.
|
||||||
## independent: The target will not be made a dependency of the apps and
|
## independent: The target will not be made a dependency of the apps and
|
||||||
## all target.
|
## all target.
|
||||||
## nohelp: Do not invoke Help for this target.
|
## nohelp: Do not invoke Help for this target.
|
||||||
## notest: Do not set up unit-testing support for this target.
|
## notest: Do not set up unit-testing support for this target.
|
||||||
## nomanifest: (Win32/MSVC) Don't generate manifest for application.
|
## nomanifest: (Win32/MSVC) Don't generate manifest for application.
|
||||||
rule Application
|
rule Application
|
||||||
{
|
{
|
||||||
# check options
|
# check options
|
||||||
CheckOptions noinstall console independent nohelp notest nomanifest : $(3) : $(<) ;
|
CheckOptions noinstall console independent nohelp notest nomanifest : $(3) : $(<) ;
|
||||||
|
|
||||||
local target = [ ConstructApplicationTarget $(<) : $(3) ] ;
|
local target = [ ConstructApplicationTarget $(<) : $(3) ] ;
|
||||||
local sources = [ DoSourceGrist $(>) ] ;
|
local sources = [ DoSourceGrist $(>) ] ;
|
||||||
local objects = [ CompileObjects $(sources) ] ;
|
local objects = [ CompileObjects $(sources) ] ;
|
||||||
|
|
||||||
$(<)_TYPE = application ;
|
$(<)_TYPE = application ;
|
||||||
$(<)_OBJECTS = $(objects) ;
|
$(<)_OBJECTS = $(objects) ;
|
||||||
$(<)_SOURCES = $(sources) ;
|
$(<)_SOURCES = $(sources) ;
|
||||||
$(<)_TARGET = $(target) ;
|
$(<)_TARGET = $(target) ;
|
||||||
|
|
||||||
# create target clean rule
|
# so 'jam foo' works when it's really foo.exe (Windows) or foo.app (MacOS/X)
|
||||||
Always $(<)clean ;
|
if $(target) != $(<)
|
||||||
NotFile $(<)clean ;
|
{
|
||||||
Clean $(<)clean : $(objects) ; # create target clean rule
|
Depends $(<) : $(target) ;
|
||||||
|
NotFile $(<) ;
|
||||||
# so 'jam foo' works when it's really foo.exe (Windows) or foo.app (MacOS/X)
|
}
|
||||||
if $(target) != $(<)
|
|
||||||
{
|
# make dependency on apps target
|
||||||
Depends $(<) : $(target) ;
|
if ! [ IsElem independent : $(3) ]
|
||||||
NotFile $(<) ;
|
{
|
||||||
}
|
Depends apps : $(<) ;
|
||||||
|
}
|
||||||
# make dependency on apps target
|
|
||||||
if ! [ IsElem independent : $(3) ]
|
# construct Install target
|
||||||
{
|
if ! [ IsElem noinstall : $(3) ]
|
||||||
Depends apps : $(<) ;
|
{
|
||||||
}
|
local install_opts ;
|
||||||
|
if [ IsElem console : $(3) ]
|
||||||
# construct Install target
|
{
|
||||||
if ! [ IsElem noinstall : $(3) ]
|
install_opts += console ;
|
||||||
{
|
}
|
||||||
local install_opts ;
|
SystemInstallApplication $(target) : : $(install_opts) ;
|
||||||
if [ IsElem console : $(3) ]
|
}
|
||||||
{
|
|
||||||
install_opts += console ;
|
# Link
|
||||||
}
|
MakeLocate $(target) : $(LOCATE.TARGETS) ;
|
||||||
SystemInstallApplication $(target) : : $(install_opts) ;
|
SystemLinkApplication $(<) : $(objects) : $(3) ;
|
||||||
}
|
|
||||||
|
local cleanextra ;
|
||||||
# Link
|
if $(LINK.DEBUG.INFO.SEPARATE) = "yes"
|
||||||
MakeLocate $(target) : $(LOCATE.TARGETS) ;
|
{
|
||||||
SystemLinkApplication $(<) : $(objects) : $(3) ;
|
local debugfile = [ SplitDebugInfo $(target) ] ;
|
||||||
|
cleanextra += $(debugfile) ;
|
||||||
CFlags $(<) : $(APPLICATION.CFLAGS) ;
|
if ! [ IsElem noinstall : $(3) ]
|
||||||
LFlags $(<) : $(LINKLIBS) $(APPLICATION.LFLAGS) ;
|
{
|
||||||
|
NoCare $(debugfile) ;
|
||||||
if ! [ IsElem nohelp : $(3) ]
|
Depends install_bin : [ DoInstall $(debugfile) : $(bindir) : $(INSTALL_DATA) ] ;
|
||||||
{
|
}
|
||||||
local desc = [ Description $(<) ] ;
|
}
|
||||||
if ! $(desc) { desc = "$(<) application" ; }
|
|
||||||
Help $(<) : "Build the $(desc)" ;
|
CFlags $(<) : $(APPLICATION.CFLAGS) ;
|
||||||
}
|
LFlags $(<) : $(LINKLIBS) $(APPLICATION.LFLAGS) ;
|
||||||
|
|
||||||
if ! [ IsElem notest : $(options) ]
|
# create target clean rule
|
||||||
{
|
Always $(<)clean ;
|
||||||
# @@@ Disabled for now; see docs/todo_jam.txt
|
NotFile $(<)clean ;
|
||||||
#UnitTest $(<) ;
|
Clean $(<)clean : $(objects) $(cleanextra) ;
|
||||||
}
|
Clean clean : $(cleanextra) ;
|
||||||
}
|
|
||||||
|
if ! [ IsElem nohelp : $(3) ]
|
||||||
## ShellScript scriptname : rule [ : options ]
|
{
|
||||||
## Build a shell script by invoking `rule', the script creation rule, which
|
local desc = [ Description $(<) ] ;
|
||||||
## is passed `scriptname' and `options'.
|
if ! $(desc) { desc = "$(<) application" ; }
|
||||||
## Options:
|
Help $(<) : "Build the $(desc)" ;
|
||||||
## noinstall: Do not set up a default installation target.
|
}
|
||||||
## nohelp: Do not invoke Help for this target.
|
|
||||||
rule ShellScript
|
if ! [ IsElem notest : $(options) ]
|
||||||
{
|
{
|
||||||
CheckOptions noinstall nohelp : $(3) : $(<) ;
|
# @@@ Disabled for now; see docs/todo_jam.txt
|
||||||
|
#UnitTest $(<) ;
|
||||||
Always $(<)clean ;
|
}
|
||||||
NotFile $(<)clean ;
|
}
|
||||||
Clean clean : $(<) ;
|
|
||||||
Clean $(<)clean : $(<) ;
|
## ShellScript scriptname : rule [ : options ]
|
||||||
Depends apps : $(<) ;
|
## Build a shell script by invoking `rule', the script creation rule, which
|
||||||
MakeLocate $(<) : $(LOCATE.TARGETS) ;
|
## is passed `scriptname' and `options'.
|
||||||
|
## Options:
|
||||||
if ! [ IsElem noinstall : $(3) ]
|
## noinstall: Do not set up a default installation target.
|
||||||
{
|
## nohelp: Do not invoke Help for this target.
|
||||||
Depends install_bin : [ DoInstall $(<) : $(bindir) : $(INSTALL_PROGRAM) ] ;
|
rule ShellScript
|
||||||
}
|
{
|
||||||
|
CheckOptions noinstall nohelp : $(3) : $(<) ;
|
||||||
$(2) $(<) : $(3) ;
|
|
||||||
|
Always $(<)clean ;
|
||||||
MODE on $(<) = $(EXEMODE) ;
|
NotFile $(<)clean ;
|
||||||
SUBDIR on $(<) = $(SUBDIR) ;
|
Clean clean : $(<) ;
|
||||||
Chmod $(<) ;
|
Clean $(<)clean : $(<) ;
|
||||||
|
Depends apps : $(<) ;
|
||||||
if ! [ IsElem nohelp : $(3) ]
|
MakeLocate $(<) : $(LOCATE.TARGETS) ;
|
||||||
{
|
|
||||||
local desc = [ Description $(<) ] ;
|
if ! [ IsElem noinstall : $(3) ]
|
||||||
if ! $(desc) { desc = "$(<) script" ; }
|
{
|
||||||
Help $(<) : "Build the $(desc)" ;
|
Depends install_bin : [ DoInstall $(<) : $(bindir) : $(INSTALL_PROGRAM) ] ;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
$(2) $(<) : $(3) ;
|
||||||
#----------------------------------------------------------------------------
|
|
||||||
# private part
|
MODE on $(<) = $(EXEMODE) ;
|
||||||
|
SUBDIR on $(<) = $(SUBDIR) ;
|
||||||
# Construct pseudo target apps which is used instead of the pseudo target exe
|
Chmod $(<) ;
|
||||||
# in Jambase
|
|
||||||
Depends exe : apps ;
|
if ! [ IsElem nohelp : $(3) ]
|
||||||
NotFile apps ;
|
{
|
||||||
Help apps : "Build all applications" ;
|
local desc = [ Description $(<) ] ;
|
||||||
|
if ! $(desc) { desc = "$(<) script" ; }
|
||||||
|
Help $(<) : "Build the $(desc)" ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# private part
|
||||||
|
|
||||||
|
# Construct pseudo target apps which is used instead of the pseudo target exe
|
||||||
|
# in Jambase
|
||||||
|
Depends exe : apps ;
|
||||||
|
NotFile apps ;
|
||||||
|
Help apps : "Build all applications" ;
|
||||||
|
|||||||
@@ -1,50 +1,50 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for handling assembler files
|
# Rules for handling assembler files
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
if $(CMD.NASM)
|
if $(CMD.NASM)
|
||||||
{
|
{
|
||||||
|
|
||||||
rule NasmRule
|
rule NasmRule
|
||||||
{
|
{
|
||||||
local object = [ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
|
local object = [ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
|
||||||
Nasm $(object) : $(<) ;
|
Nasm $(object) : $(<) ;
|
||||||
return $(object) ;
|
return $(object) ;
|
||||||
}
|
}
|
||||||
RegisterFileType NasmRule : .asm ;
|
RegisterFileType NasmRule : .asm ;
|
||||||
|
|
||||||
rule Nasm
|
rule Nasm
|
||||||
{
|
{
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) ;
|
||||||
NASM.FLAGS on $(<) += $(NASM.FLAGS) ;
|
NASM.FLAGS on $(<) += $(NASM.FLAGS) ;
|
||||||
# NASM doesn't scan for headers in current dir of the files, so add the dir of
|
# NASM doesn't scan for headers in current dir of the files, so add the dir of
|
||||||
# the file to the -I flags
|
# the file to the -I flags
|
||||||
local includeflags = [ FIncludes $(SEARCH_SOURCE)/$(<:D) $(SUBDIRHDRS) $(HDRS) ] ;
|
local includeflags = [ FIncludes $(SEARCH_SOURCE)/$(<:D) $(SUBDIRHDRS) $(HDRS) ] ;
|
||||||
# NASM requires that -I paths have a trailing slash.
|
# NASM requires that -I paths have a trailing slash.
|
||||||
INCLUDEFLAGS on $(<) = $(includeflags)$(SLASH) ;
|
INCLUDEFLAGS on $(<) = $(includeflags)$(SLASH) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
NASM.HDRPATTERN = "^[ ]*%[ ]*include[ ]*[<\"]([^\">]*)[\">].*$" ;
|
NASM.HDRPATTERN = "^[ ]*%[ ]*include[ ]*[<\"]([^\">]*)[\">].*$" ;
|
||||||
RegisterHeaderRule HeaderRule : $(NASM.HDRPATTERN) : .asm .ash ;
|
RegisterHeaderRule HeaderRule : $(NASM.HDRPATTERN) : .asm .ash ;
|
||||||
|
|
||||||
actions Nasm
|
actions Nasm
|
||||||
{
|
{
|
||||||
$(CMD.NASM) $(NASM.FLAGS) $(INCLUDEFLAGS) -o $(<) $(>)
|
$(CMD.NASM) $(NASM.FLAGS) $(INCLUDEFLAGS) -o $(<) $(>)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,165 +1,165 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for flex and bison
|
# Rules for flex and bison
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
if $(CMD.FLEX)
|
if $(CMD.FLEX)
|
||||||
{
|
{
|
||||||
# Some versions of Flex-generated files want to include <unistd.h> which is
|
# Some versions of Flex-generated files want to include <unistd.h> which is
|
||||||
# not normally available on Windows, so we need to protect it. We also
|
# not normally available on Windows, so we need to protect it. We also
|
||||||
# filter out CVS `Header' keywords in order to prevent CVS from thinking that
|
# filter out CVS `Header' keywords in order to prevent CVS from thinking that
|
||||||
# the file has changed simply because the Header information is different.
|
# the file has changed simply because the Header information is different.
|
||||||
FLEX.SED_SCRIPT =
|
FLEX.SED_SCRIPT =
|
||||||
"'s/\\([ ]*#[ ]*include[ ][ ]*<unistd.h>\\)/#ifndef WIN32\\
|
"'s/\\([ ]*#[ ]*include[ ][ ]*<unistd.h>\\)/#ifndef WIN32\\
|
||||||
\\1\\
|
\\1\\
|
||||||
#endif/;/\$Header:/d'" ;
|
#endif/;/\$Header:/d'" ;
|
||||||
|
|
||||||
# Compilers such as MSVC do not like #line directives. Since the generated
|
# Compilers such as MSVC do not like #line directives. Since the generated
|
||||||
# file might get stored in CVS and used by MSVC users (even if generated on
|
# file might get stored in CVS and used by MSVC users (even if generated on
|
||||||
# Unix, for instance), we want to suppress #line directives in all cases.
|
# Unix, for instance), we want to suppress #line directives in all cases.
|
||||||
FLEX.FLAGS += -L ;
|
FLEX.FLAGS += -L ;
|
||||||
|
|
||||||
rule FlexRule
|
rule FlexRule
|
||||||
{
|
{
|
||||||
local object ;
|
local object ;
|
||||||
local cfile = [ DoObjectGrist $(<:S=.c) ] ;
|
local cfile = [ DoObjectGrist $(<:S=.c) ] ;
|
||||||
|
|
||||||
MakeLocate $(cfile) : $(LOCATE_TARGET) ;
|
MakeLocate $(cfile) : $(LOCATE_TARGET) ;
|
||||||
SEARCH on $(cfile) = $(LOCATE_TARGET) ;
|
SEARCH on $(cfile) = $(LOCATE_TARGET) ;
|
||||||
|
|
||||||
Flex $(cfile) : $(<) ;
|
Flex $(cfile) : $(<) ;
|
||||||
object = [ CompileObjects $(cfile) : $(>) ] ;
|
object = [ CompileObjects $(cfile) : $(>) ] ;
|
||||||
|
|
||||||
return $(object) ;
|
return $(object) ;
|
||||||
}
|
}
|
||||||
RegisterFileType FlexRule : .l ;
|
RegisterFileType FlexRule : .l ;
|
||||||
|
|
||||||
rule Flex++Rule
|
rule Flex++Rule
|
||||||
{
|
{
|
||||||
local object ;
|
local object ;
|
||||||
local cppfile = [ DoObjectGrist $(<:S=.cpp) ] ;
|
local cppfile = [ DoObjectGrist $(<:S=.cpp) ] ;
|
||||||
|
|
||||||
MakeLocate $(cppfile) : $(LOCATE_TARGET) ;
|
MakeLocate $(cppfile) : $(LOCATE_TARGET) ;
|
||||||
SEARCH on $(cppfile) = $(LOCATE_TARGET) ;
|
SEARCH on $(cppfile) = $(LOCATE_TARGET) ;
|
||||||
|
|
||||||
Flex $(cppfile) : $(<) ;
|
Flex $(cppfile) : $(<) ;
|
||||||
object = [ CompileObjects $(cppfile) : $(>) ] ;
|
object = [ CompileObjects $(cppfile) : $(>) ] ;
|
||||||
|
|
||||||
return $(object) ;
|
return $(object) ;
|
||||||
}
|
}
|
||||||
RegisterFileType Flex++Rule : .ll ;
|
RegisterFileType Flex++Rule : .ll ;
|
||||||
|
|
||||||
rule Flex
|
rule Flex
|
||||||
{
|
{
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) ;
|
||||||
FLEX.FLAGS on $(<) += $(FLEX.FLAGS) ;
|
FLEX.FLAGS on $(<) += $(FLEX.FLAGS) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Use -t and output redirection to avoid flex choosing undesirable names for
|
# Use -t and output redirection to avoid flex choosing undesirable names for
|
||||||
# its output files. Also apply FLEX.SED_SCRIPT.
|
# its output files. Also apply FLEX.SED_SCRIPT.
|
||||||
actions Flex
|
actions Flex
|
||||||
{
|
{
|
||||||
$(CMD.FLEX) -t $(FLEX.FLAGS) $(>) | $(SED) $(FLEX.SED_SCRIPT) > $(<)
|
$(CMD.FLEX) -t $(FLEX.FLAGS) $(>) | $(SED) $(FLEX.SED_SCRIPT) > $(<)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $(CMD.BISON)
|
if $(CMD.BISON)
|
||||||
{
|
{
|
||||||
rule BisonRule
|
rule BisonRule
|
||||||
{
|
{
|
||||||
local object ;
|
local object ;
|
||||||
local cfile = [ DoObjectGrist $(<:S=.c) ] ;
|
local cfile = [ DoObjectGrist $(<:S=.c) ] ;
|
||||||
local headerfile = [ DoObjectGrist $(<:S=.h) ] ;
|
local headerfile = [ DoObjectGrist $(<:S=.h) ] ;
|
||||||
|
|
||||||
# Jam's header file scannning doesn't use grist so we have to workaround
|
# Jam's header file scannning doesn't use grist so we have to workaround
|
||||||
# this here.
|
# this here.
|
||||||
Includes $(headerfile:G=$(SOURCE_GRIST:E)!$(SUBVARIANT:J=!)) : $(headerfile) ;
|
Includes $(headerfile:G=$(SOURCE_GRIST:E)!$(SUBVARIANT:J=!)) : $(headerfile) ;
|
||||||
|
|
||||||
MakeLocate $(cfile) $(headerfile) : $(LOCATE_TARGET) ;
|
MakeLocate $(cfile) $(headerfile) : $(LOCATE_TARGET) ;
|
||||||
|
|
||||||
BISON.FLAGS on $(cfile) =
|
BISON.FLAGS on $(cfile) =
|
||||||
[ on [ DoSourceGrist $(<:S=.c) ] GetVar BISON.FLAGS ] ;
|
[ on [ DoSourceGrist $(<:S=.c) ] GetVar BISON.FLAGS ] ;
|
||||||
Bison $(cfile) : $(<) ;
|
Bison $(cfile) : $(<) ;
|
||||||
# Work around for jam warning about independant target when we put both
|
# Work around for jam warning about independant target when we put both
|
||||||
# headerfile and cppfile in the bison line...
|
# headerfile and cppfile in the bison line...
|
||||||
Includes $(cppfile) : $(headerfile) ;
|
Includes $(cppfile) : $(headerfile) ;
|
||||||
object = [ CompileObjects $(cfile) : $(>) ] ;
|
object = [ CompileObjects $(cfile) : $(>) ] ;
|
||||||
SEARCH on $(cfile) = $(LOCATE_TARGET) ;
|
SEARCH on $(cfile) = $(LOCATE_TARGET) ;
|
||||||
SEARCH on $(headerfile) = $(LOCATE_TARGET) ;
|
SEARCH on $(headerfile) = $(LOCATE_TARGET) ;
|
||||||
|
|
||||||
return $(object) ;
|
return $(object) ;
|
||||||
}
|
}
|
||||||
RegisterFileType BisonRule : .y ;
|
RegisterFileType BisonRule : .y ;
|
||||||
|
|
||||||
rule Bison++Rule
|
rule Bison++Rule
|
||||||
{
|
{
|
||||||
local object ;
|
local object ;
|
||||||
local cppfile = [ DoObjectGrist $(<:S=.cpp) ] ;
|
local cppfile = [ DoObjectGrist $(<:S=.cpp) ] ;
|
||||||
local headerfile = [ DoObjectGrist $(<:S=.hpp) ] ;
|
local headerfile = [ DoObjectGrist $(<:S=.hpp) ] ;
|
||||||
|
|
||||||
# Jam's header file scannning doesn't use grist so we have to workaround
|
# Jam's header file scannning doesn't use grist so we have to workaround
|
||||||
# this here.
|
# this here.
|
||||||
Includes $(headerfile:G=$(SOURCE_GRIST:E)!$(SUBVARIANT:J=!)) : $(headerfile) ;
|
Includes $(headerfile:G=$(SOURCE_GRIST:E)!$(SUBVARIANT:J=!)) : $(headerfile) ;
|
||||||
|
|
||||||
MakeLocate $(cppfile) : $(LOCATE_TARGET) ;
|
MakeLocate $(cppfile) : $(LOCATE_TARGET) ;
|
||||||
MakeLocate $(headerfile) : $(LOCATE_TARGET) ;
|
MakeLocate $(headerfile) : $(LOCATE_TARGET) ;
|
||||||
|
|
||||||
BISON.FLAGS on $(cppfile) =
|
BISON.FLAGS on $(cppfile) =
|
||||||
[ on [ DoSourceGrist $(<:S=.cpp) ] GetVar BISON.FLAGS ] ;
|
[ on [ DoSourceGrist $(<:S=.cpp) ] GetVar BISON.FLAGS ] ;
|
||||||
Bison $(cppfile) : $(<) ;
|
Bison $(cppfile) : $(<) ;
|
||||||
# Work around for jam warning about independant target when we put both
|
# Work around for jam warning about independant target when we put both
|
||||||
# headerfile and cppfile in the bison line...
|
# headerfile and cppfile in the bison line...
|
||||||
Includes $(cppfile) : $(headerfile) ;
|
Includes $(cppfile) : $(headerfile) ;
|
||||||
object = [ CompileObjects $(cppfile) : $(>) ] ;
|
object = [ CompileObjects $(cppfile) : $(>) ] ;
|
||||||
SEARCH on $(cppfile) = $(LOCATE_TARGET) ;
|
SEARCH on $(cppfile) = $(LOCATE_TARGET) ;
|
||||||
SEARCH on $(headerfile) = $(LOCATE_TARGET) ;
|
SEARCH on $(headerfile) = $(LOCATE_TARGET) ;
|
||||||
|
|
||||||
return $(object) ;
|
return $(object) ;
|
||||||
}
|
}
|
||||||
RegisterFileType Bison++Rule : .yy ;
|
RegisterFileType Bison++Rule : .yy ;
|
||||||
|
|
||||||
rule Bison
|
rule Bison
|
||||||
{
|
{
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) ;
|
||||||
BISON.FLAGS on $(<) += $(BISON.FLAGS) ;
|
BISON.FLAGS on $(<) += $(BISON.FLAGS) ;
|
||||||
}
|
}
|
||||||
rule BisonFlags
|
rule BisonFlags
|
||||||
{
|
{
|
||||||
local target ;
|
local target ;
|
||||||
|
|
||||||
if $(<:S) = .yy
|
if $(<:S) = .yy
|
||||||
{
|
{
|
||||||
target = [ DoSourceGrist $(<:S=.cpp) $(<:S=.hpp) ] ;
|
target = [ DoSourceGrist $(<:S=.cpp) $(<:S=.hpp) ] ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
target = [ DoSourceGrist $(<:S=.c) $(<:S=.h) ] ;
|
target = [ DoSourceGrist $(<:S=.c) $(<:S=.h) ] ;
|
||||||
}
|
}
|
||||||
BISON.FLAGS on $(target) += $(>) ;
|
BISON.FLAGS on $(target) += $(>) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Compilers such as MSVC do not like #line directives. Since the generated
|
# Compilers such as MSVC do not like #line directives. Since the generated
|
||||||
# file might get stored in CVS and used by MSVC users (even if generated on
|
# file might get stored in CVS and used by MSVC users (even if generated on
|
||||||
# Unix, for instance), we want to suppress #line directives in all cases.
|
# Unix, for instance), we want to suppress #line directives in all cases.
|
||||||
BISON.FLAGS += --no-lines ;
|
BISON.FLAGS += --no-lines ;
|
||||||
|
|
||||||
actions Bison
|
actions Bison
|
||||||
{
|
{
|
||||||
$(CMD.BISON) -d $(BISON.FLAGS) -o $(<[1]) $(>)
|
$(CMD.BISON) -d $(BISON.FLAGS) -o $(<[1]) $(>)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
165
mk/jam/build.jam
165
mk/jam/build.jam
@@ -1,82 +1,83 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Main rules file - Includes all important rulefiles in correct order
|
# Main rules file - Includes all important rulefiles in correct order
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
# Enable if you want debug messages.
|
# Enable if you want debug messages.
|
||||||
JAM_DEBUG ?= 1 ;
|
JAM_DEBUG ?= 1 ;
|
||||||
|
|
||||||
jamrulesdir = $(TOP)/mk/jam ;
|
jamrulesdir = $(TOP)/mk/jam ;
|
||||||
|
|
||||||
# Utility and compatibility rules used by all other scripts.
|
# Utility and compatibility rules used by all other scripts.
|
||||||
include $(jamrulesdir)/jamcompatibility.jam ;
|
include $(jamrulesdir)/jamcompatibility.jam ;
|
||||||
include $(jamrulesdir)/subdir.jam ;
|
include $(jamrulesdir)/subdir.jam ;
|
||||||
include $(jamrulesdir)/property.jam ;
|
include $(jamrulesdir)/property.jam ;
|
||||||
|
|
||||||
# This needs to be included before _and_ after all other includes (except the
|
# This needs to be included before _and_ after all other includes (except the
|
||||||
# super low-level utility files above) since it optionally overrides built-in
|
# super low-level utility files above) since it optionally overrides built-in
|
||||||
# rules to glean information about targets being defined.
|
# rules to glean information about targets being defined.
|
||||||
include $(jamrulesdir)/dump.jam ;
|
include $(jamrulesdir)/dump.jam ;
|
||||||
|
|
||||||
include $(jamrulesdir)/options.jam ;
|
include $(jamrulesdir)/options.jam ;
|
||||||
include $(jamrulesdir)/variant.jam ;
|
include $(jamrulesdir)/variant.jam ;
|
||||||
include $(jamrulesdir)/resource.jam ;
|
include $(jamrulesdir)/resource.jam ;
|
||||||
|
|
||||||
include $(jamrulesdir)/helper.jam ;
|
include $(jamrulesdir)/helper.jam ;
|
||||||
include $(jamrulesdir)/help.jam ;
|
include $(jamrulesdir)/help.jam ;
|
||||||
include $(jamrulesdir)/groups.jam ;
|
include $(jamrulesdir)/groups.jam ;
|
||||||
include $(jamrulesdir)/install.jam ;
|
include $(jamrulesdir)/install.jam ;
|
||||||
include $(jamrulesdir)/clean.jam ;
|
include $(jamrulesdir)/clean.jam ;
|
||||||
|
|
||||||
include $(jamrulesdir)/objects.jam ;
|
include $(jamrulesdir)/objects.jam ;
|
||||||
include $(jamrulesdir)/compiler.jam ;
|
include $(jamrulesdir)/compiler.jam ;
|
||||||
include $(jamrulesdir)/objectivec.jam ;
|
include $(jamrulesdir)/objectivec.jam ;
|
||||||
include $(jamrulesdir)/assembler.jam ;
|
include $(jamrulesdir)/assembler.jam ;
|
||||||
include $(jamrulesdir)/bisonflex.jam ;
|
include $(jamrulesdir)/bisonflex.jam ;
|
||||||
include $(jamrulesdir)/swig.jam ;
|
include $(jamrulesdir)/swig.jam ;
|
||||||
|
include $(jamrulesdir)/strip.jam ;
|
||||||
include $(jamrulesdir)/flags.jam ;
|
|
||||||
include $(jamrulesdir)/library.jam ;
|
include $(jamrulesdir)/flags.jam ;
|
||||||
include $(jamrulesdir)/static.jam ;
|
include $(jamrulesdir)/library.jam ;
|
||||||
include $(jamrulesdir)/application.jam ;
|
include $(jamrulesdir)/static.jam ;
|
||||||
include $(jamrulesdir)/plugin.jam ;
|
include $(jamrulesdir)/application.jam ;
|
||||||
include $(jamrulesdir)/docs.jam ;
|
include $(jamrulesdir)/plugin.jam ;
|
||||||
include $(jamrulesdir)/unittest.jam ;
|
include $(jamrulesdir)/docs.jam ;
|
||||||
|
include $(jamrulesdir)/unittest.jam ;
|
||||||
# Include OS specific rules
|
|
||||||
switch $(TARGET.OS)
|
# Include OS specific rules
|
||||||
{
|
switch $(TARGET.OS)
|
||||||
case WIN32 :
|
{
|
||||||
include $(jamrulesdir)/win32.jam ;
|
case WIN32 :
|
||||||
case MACOS_X :
|
include $(jamrulesdir)/win32.jam ;
|
||||||
include $(jamrulesdir)/macosx.jam ;
|
case MACOS_X :
|
||||||
case UNIX :
|
include $(jamrulesdir)/macosx.jam ;
|
||||||
include $(jamrulesdir)/unix.jam ;
|
case UNIX :
|
||||||
case * :
|
include $(jamrulesdir)/unix.jam ;
|
||||||
echo "WARNING: TARGET.OS not defined. Using unix" ;
|
case * :
|
||||||
include $(jamrulesdir)/unix.jam ;
|
echo "WARNING: TARGET.OS not defined. Using unix" ;
|
||||||
}
|
include $(jamrulesdir)/unix.jam ;
|
||||||
|
}
|
||||||
# This needs to be included after all others because it overrides some of the
|
|
||||||
# earlier defined rules when enabled. It even overrides Win32 rules, so it
|
# This needs to be included after all others because it overrides some of the
|
||||||
# needs to be after platform-specific includes, as well.
|
# earlier defined rules when enabled. It even overrides Win32 rules, so it
|
||||||
include $(jamrulesdir)/msvcgen.jam ;
|
# needs to be after platform-specific includes, as well.
|
||||||
|
include $(jamrulesdir)/msvcgen.jam ;
|
||||||
# This needs to included be before _and_ after all other includes since it
|
|
||||||
# optionally overrides rules defined earlier.
|
# This needs to included be before _and_ after all other includes since it
|
||||||
include $(jamrulesdir)/dump.jam ;
|
# optionally overrides rules defined earlier.
|
||||||
|
include $(jamrulesdir)/dump.jam ;
|
||||||
|
|||||||
@@ -1,37 +1,37 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for cleaning build detritus.
|
# Rules for cleaning build detritus.
|
||||||
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
# CleanDir <tag> : <dir> ...
|
# CleanDir <tag> : <dir> ...
|
||||||
# Forcibly delete a set of directories, even if they are not empty.
|
# Forcibly delete a set of directories, even if they are not empty.
|
||||||
# Tag is one of the standard targets used with the "Clean" rule, such as
|
# Tag is one of the standard targets used with the "Clean" rule, such as
|
||||||
# "clean" or "distclean".
|
# "clean" or "distclean".
|
||||||
rule CleanDir
|
rule CleanDir
|
||||||
{
|
{
|
||||||
Always $(<) ;
|
Always $(<) ;
|
||||||
NotFile $(<) ;
|
NotFile $(<) ;
|
||||||
NoCare $(>) ;
|
NoCare $(>) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
actions piecemeal together existing CleanDir
|
actions piecemeal together existing CleanDir
|
||||||
{
|
{
|
||||||
$(DELTREE) $(>)
|
$(DELTREE) $(>)
|
||||||
}
|
}
|
||||||
|
|
||||||
Help clean : "Remove all built targets from project" ;
|
Help clean : "Remove all built targets from project" ;
|
||||||
|
|||||||
@@ -1,76 +1,76 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for C and C++ files
|
# Rules for C and C++ files
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
if $(CMD.CC)
|
if $(CMD.CC)
|
||||||
{
|
{
|
||||||
|
|
||||||
rule CcRule
|
rule CcRule
|
||||||
{
|
{
|
||||||
local object =
|
local object =
|
||||||
[ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
|
[ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
|
||||||
Cc $(object) : $(<) ;
|
Cc $(object) : $(<) ;
|
||||||
return $(object) ;
|
return $(object) ;
|
||||||
}
|
}
|
||||||
RegisterFileType CcRule : .c ;
|
RegisterFileType CcRule : .c ;
|
||||||
RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .c ;
|
RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .c ;
|
||||||
|
|
||||||
rule Cc
|
rule Cc
|
||||||
{
|
{
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) ;
|
||||||
|
|
||||||
CCFLAGS on $(<) += $(CCFLAGS) $(SUBDIRCCFLAGS) ;
|
CCFLAGS on $(<) += $(CCFLAGS) $(SUBDIRCCFLAGS) ;
|
||||||
CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
|
CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
|
||||||
CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
|
CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
actions Cc
|
actions Cc
|
||||||
{
|
{
|
||||||
$(CMD.CC) -c -o $(<) $(CCHDRS) $(CCFLAGS) $(CCDEFS) $(>)
|
$(CMD.CC) -c -o $(<) $(CCHDRS) $(CCFLAGS) $(CCDEFS) $(>)
|
||||||
}
|
}
|
||||||
} # end if $(CMD.CC)
|
} # end if $(CMD.CC)
|
||||||
|
|
||||||
if $(CMD.C++)
|
if $(CMD.C++)
|
||||||
{
|
{
|
||||||
|
|
||||||
rule C++Rule
|
rule C++Rule
|
||||||
{
|
{
|
||||||
local object =
|
local object =
|
||||||
[ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
|
[ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
|
||||||
C++ $(object) : $(<) ;
|
C++ $(object) : $(<) ;
|
||||||
return $(object) ;
|
return $(object) ;
|
||||||
}
|
}
|
||||||
RegisterFileType C++Rule : .cpp .cc .c++ ;
|
RegisterFileType C++Rule : .cpp .cc .c++ ;
|
||||||
RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .cpp .cc .c++ ;
|
RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .cpp .cc .c++ ;
|
||||||
|
|
||||||
rule C++
|
rule C++
|
||||||
{
|
{
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) ;
|
||||||
|
|
||||||
C++FLAGS on $(<) += $(C++FLAGS) $(SUBDIRC++FLAGS) ;
|
C++FLAGS on $(<) += $(C++FLAGS) $(SUBDIRC++FLAGS) ;
|
||||||
CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
|
CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
|
||||||
CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
|
CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
actions C++
|
actions C++
|
||||||
{
|
{
|
||||||
$(CMD.C++) -c -o $(<) $(CCHDRS) $(C++FLAGS) $(CCDEFS) $(>)
|
$(CMD.C++) -c -o $(<) $(CCHDRS) $(C++FLAGS) $(CCDEFS) $(>)
|
||||||
}
|
}
|
||||||
} # end if $(CMD:C++)
|
} # end if $(CMD:C++)
|
||||||
|
|
||||||
|
|||||||
1376
mk/jam/docs.jam
1376
mk/jam/docs.jam
File diff suppressed because it is too large
Load Diff
256
mk/jam/dump.jam
256
mk/jam/dump.jam
@@ -1,128 +1,128 @@
|
|||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Utility functions for collecting information about the Jam environment.
|
# Utility functions for collecting information about the Jam environment.
|
||||||
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# When the target "dumptargets" is invoked, dump the top-level, user-visible
|
# When the target "dumptargets" is invoked, dump the top-level, user-visible
|
||||||
# build targets as a whitespace-delimited list to the file named by the Jam
|
# build targets as a whitespace-delimited list to the file named by the Jam
|
||||||
# variable DUMPTARGETS_FILE. Example:
|
# variable DUMPTARGETS_FILE. Example:
|
||||||
#
|
#
|
||||||
# jam -sDUMPTARGETS_FILE=targets.txt dumptargets
|
# jam -sDUMPTARGETS_FILE=targets.txt dumptargets
|
||||||
#
|
#
|
||||||
# This output might be useful, for instance, when composing documentation (via
|
# This output might be useful, for instance, when composing documentation (via
|
||||||
# some automated mechanism) which lists the targets visible to the user.
|
# some automated mechanism) which lists the targets visible to the user.
|
||||||
#
|
#
|
||||||
# IMPLEMENTATION NOTES
|
# IMPLEMENTATION NOTES
|
||||||
#
|
#
|
||||||
# The emitted target names are collected from several locations:
|
# The emitted target names are collected from several locations:
|
||||||
#
|
#
|
||||||
# - All single-word arguments to NotFile composed of ._- and alphanumerics.
|
# - All single-word arguments to NotFile composed of ._- and alphanumerics.
|
||||||
#
|
#
|
||||||
# - Targets defined by the Application rule. Unlike other rules (Plugin,
|
# - Targets defined by the Application rule. Unlike other rules (Plugin,
|
||||||
# Library, etc.) which compose a top-level pseudo-target using NotFile
|
# Library, etc.) which compose a top-level pseudo-target using NotFile
|
||||||
# (which is thus caught by the above case), on Unix, the Application rule
|
# (which is thus caught by the above case), on Unix, the Application rule
|
||||||
# does not invoke NotFile since the top-level target has the same name as
|
# does not invoke NotFile since the top-level target has the same name as
|
||||||
# the generated executable.
|
# the generated executable.
|
||||||
#
|
#
|
||||||
# - Targets defined by the ShellScript rule, since the emitted shell scripts
|
# - Targets defined by the ShellScript rule, since the emitted shell scripts
|
||||||
# have the same name as the top-level target.
|
# have the same name as the top-level target.
|
||||||
#
|
#
|
||||||
# Collection occurs in two phases. This file must be included by build.jam
|
# Collection occurs in two phases. This file must be included by build.jam
|
||||||
# before any other utility *.jam files are included, and it must also be
|
# before any other utility *.jam files are included, and it must also be
|
||||||
# included after all other utility *.jam files are included. In the first
|
# included after all other utility *.jam files are included. In the first
|
||||||
# phase, the NotFile rule is re-defined so that we can catch pseudo-targets
|
# phase, the NotFile rule is re-defined so that we can catch pseudo-targets
|
||||||
# created by the other utility *.jam files (we must re-define NotFile before
|
# created by the other utility *.jam files (we must re-define NotFile before
|
||||||
# they are included), as well as any NotFile pseudo-targets created by Jamfiles
|
# they are included), as well as any NotFile pseudo-targets created by Jamfiles
|
||||||
# throughout the project. In the second phase, the Application and ShellScript
|
# throughout the project. In the second phase, the Application and ShellScript
|
||||||
# rules are re-defined (we must do so after application.jam has defined the
|
# rules are re-defined (we must do so after application.jam has defined the
|
||||||
# implementations which we override). These overrides allow us to catch
|
# implementations which we override). These overrides allow us to catch
|
||||||
# application and shell-script targets which project-wide Jamfiles define.
|
# application and shell-script targets which project-wide Jamfiles define.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
if $(DUMPTARGETS_FILE)
|
if $(DUMPTARGETS_FILE)
|
||||||
{
|
{
|
||||||
# Jam does not support arithmetic, so we fake it with Roman numerals.
|
# Jam does not support arithmetic, so we fake it with Roman numerals.
|
||||||
DUMPTARGETS_PASS ?= "" ;
|
DUMPTARGETS_PASS ?= "" ;
|
||||||
DUMPTARGETS_PASS = "$(DUMPTARGETS_PASS)I" ;
|
DUMPTARGETS_PASS = "$(DUMPTARGETS_PASS)I" ;
|
||||||
|
|
||||||
switch $(DUMPTARGETS_PASS)
|
switch $(DUMPTARGETS_PASS)
|
||||||
{
|
{
|
||||||
case I :
|
case I :
|
||||||
|
|
||||||
actions InitPseudoTargets
|
actions InitPseudoTargets
|
||||||
{
|
{
|
||||||
$(RM) $(<)
|
$(RM) $(<)
|
||||||
}
|
}
|
||||||
|
|
||||||
rule DumpPseudoTargets
|
rule DumpPseudoTargets
|
||||||
{
|
{
|
||||||
NotFile $(<) ;
|
NotFile $(<) ;
|
||||||
Always $(<) ;
|
Always $(<) ;
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) ;
|
||||||
Always $(>) ;
|
Always $(>) ;
|
||||||
InitPseudoTargets $(>) ;
|
InitPseudoTargets $(>) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
DumpPseudoTargets dumptargets : "$(DUMPTARGETS_FILE)" ;
|
DumpPseudoTargets dumptargets : "$(DUMPTARGETS_FILE)" ;
|
||||||
|
|
||||||
actions together piecemeal EmitPseudoTarget
|
actions together piecemeal EmitPseudoTarget
|
||||||
{
|
{
|
||||||
echo "$(>)" >> $(<)
|
echo "$(>)" >> $(<)
|
||||||
}
|
}
|
||||||
|
|
||||||
rule PossiblePseudoTarget
|
rule PossiblePseudoTarget
|
||||||
{
|
{
|
||||||
# NoCare and Includes are not actually required; they are used here merely to
|
# NoCare and Includes are not actually required; they are used here merely to
|
||||||
# avoid Jam's "using independent target" warning. Note, however, that Jam
|
# avoid Jam's "using independent target" warning. Note, however, that Jam
|
||||||
# 2.4 and BoostJam try building the target despite the fact that we NoCare
|
# 2.4 and BoostJam try building the target despite the fact that we NoCare
|
||||||
# about it. (Presumably this is because the targets have updating actions,
|
# about it. (Presumably this is because the targets have updating actions,
|
||||||
# and those actions override the NoCare.) Consequently, we have to put up
|
# and those actions override the NoCare.) Consequently, we have to put up
|
||||||
# with the "using independent target" warnings for these older Jam versions.
|
# with the "using independent target" warnings for these older Jam versions.
|
||||||
NoCare $(<) ;
|
NoCare $(<) ;
|
||||||
if $(JAMVERSION) != 2.4 { Includes dumptargets : $(<) ; }
|
if $(JAMVERSION) != 2.4 { Includes dumptargets : $(<) ; }
|
||||||
|
|
||||||
local i ;
|
local i ;
|
||||||
for i in $(<)
|
for i in $(<)
|
||||||
{
|
{
|
||||||
local s = [ Match ^([A-Za-z0-9_.-]+)$ : $(i) ] ;
|
local s = [ Match ^([A-Za-z0-9_.-]+)$ : $(i) ] ;
|
||||||
if $(s)
|
if $(s)
|
||||||
{
|
{
|
||||||
EmitPseudoTarget "$(DUMPTARGETS_FILE)" : $(i) ;
|
EmitPseudoTarget "$(DUMPTARGETS_FILE)" : $(i) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rule NotFile
|
rule NotFile
|
||||||
{
|
{
|
||||||
PossiblePseudoTarget $(<) ;
|
PossiblePseudoTarget $(<) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
case II :
|
case II :
|
||||||
|
|
||||||
rule Application
|
rule Application
|
||||||
{
|
{
|
||||||
PossiblePseudoTarget $(<) $(<)clean ;
|
PossiblePseudoTarget $(<) $(<)clean ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule ShellScript
|
rule ShellScript
|
||||||
{
|
{
|
||||||
PossiblePseudoTarget $(<) $(<)clean ;
|
PossiblePseudoTarget $(<) $(<)clean ;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
344
mk/jam/flags.jam
344
mk/jam/flags.jam
@@ -1,172 +1,172 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for specifying compiler and linker flags
|
# Rules for specifying compiler and linker flags
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
## LinkWith target : libs
|
## LinkWith target : libs
|
||||||
## Link an application with libraries. The specified libraries should have
|
## Link an application with libraries. The specified libraries should have
|
||||||
## build rules in the same project. For external libraries use the
|
## build rules in the same project. For external libraries use the
|
||||||
## ExternalLibs rule. Specify the library names without any extensions or
|
## ExternalLibs rule. Specify the library names without any extensions or
|
||||||
## the leading "lib".
|
## the leading "lib".
|
||||||
rule LinkWith
|
rule LinkWith
|
||||||
{
|
{
|
||||||
local rawlibs = [ ResolveLibs $(>) ] ;
|
local rawlibs = [ ResolveLibs $(>) ] ;
|
||||||
|
|
||||||
if ( $($(<)_TYPE) = library ) && ( "$($(<)_SHARED)" = "" )
|
if ( $($(<)_TYPE) = library ) && ( "$($(<)_SHARED)" = "" )
|
||||||
{
|
{
|
||||||
# LibDepends for shared libs invokes LinkWith, so prevent recursion
|
# LibDepends for shared libs invokes LinkWith, so prevent recursion
|
||||||
LibDepends $(<) : $(rawlibs) ;
|
LibDepends $(<) : $(rawlibs) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
local i libs ;
|
local i libs ;
|
||||||
for i in $(rawlibs)
|
for i in $(rawlibs)
|
||||||
{
|
{
|
||||||
libs += [ ConstructLibraryLinkTarget $(i) : $($(i)_SHARED) ] ;
|
libs += [ ConstructLibraryLinkTarget $(i) : $($(i)_SHARED) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
Depends $($(<)_TARGET) : $(libs) ;
|
Depends $($(<)_TARGET) : $(libs) ;
|
||||||
NEEDLIBS on $($(<)_TARGET) += $(libs) ;
|
NEEDLIBS on $($(<)_TARGET) += $(libs) ;
|
||||||
$(<).NEEDLIBS += $(rawlibs) ;
|
$(<).NEEDLIBS += $(rawlibs) ;
|
||||||
|
|
||||||
LFlags $(<) : $($($(rawlibs).EXTERNALLIBS).LFLAGS) ;
|
LFlags $(<) : $($($(rawlibs).EXTERNALLIBS).LFLAGS) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## CFlags target : flags [ : options ]
|
## CFlags target : flags [ : options ]
|
||||||
## Sets cflags on all sourcefiles of a library, plugin or application target
|
## Sets cflags on all sourcefiles of a library, plugin or application target
|
||||||
## This rule affects c++ and c compiler flags.
|
## This rule affects c++ and c compiler flags.
|
||||||
rule CFlags
|
rule CFlags
|
||||||
{
|
{
|
||||||
CheckOptions nostatic : $(3) : $(<) ;
|
CheckOptions nostatic : $(3) : $(<) ;
|
||||||
|
|
||||||
CCFLAGS on $($(<)_OBJECTS) += $(>) ;
|
CCFLAGS on $($(<)_OBJECTS) += $(>) ;
|
||||||
C++FLAGS on $($(<)_OBJECTS) += $(>) ;
|
C++FLAGS on $($(<)_OBJECTS) += $(>) ;
|
||||||
|
|
||||||
UnitTestCFlags $(<) : $(>) : $(3) ;
|
UnitTestCFlags $(<) : $(>) : $(3) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## MergeLFlags flags1 : flags2
|
## MergeLFlags flags1 : flags2
|
||||||
## Merge two arrays of linker flags. Removes duplicate entries, however,
|
## Merge two arrays of linker flags. Removes duplicate entries, however,
|
||||||
## ensures that the correct relative right-to-left order of both flag arrays
|
## ensures that the correct relative right-to-left order of both flag arrays
|
||||||
## is kept.
|
## is kept.
|
||||||
rule MergeLFlags
|
rule MergeLFlags
|
||||||
{
|
{
|
||||||
local result = ;
|
local result = ;
|
||||||
local libs2 = $(2) ;
|
local libs2 = $(2) ;
|
||||||
for l in $(1)
|
for l in $(1)
|
||||||
{
|
{
|
||||||
if [ IsElem $(l) : $(libs2) ]
|
if [ IsElem $(l) : $(libs2) ]
|
||||||
{
|
{
|
||||||
# If a flag from set 1 is in set 2, add all flags from start of set 2
|
# If a flag from set 1 is in set 2, add all flags from start of set 2
|
||||||
# to the occurance of the flag to result.
|
# to the occurance of the flag to result.
|
||||||
while "$(libs2[1])" != "" && $(libs2[1]) != $(l)
|
while "$(libs2[1])" != "" && $(libs2[1]) != $(l)
|
||||||
{
|
{
|
||||||
result += $(libs2[1]) ;
|
result += $(libs2[1]) ;
|
||||||
libs2 = $(libs2[2-]) ;
|
libs2 = $(libs2[2-]) ;
|
||||||
}
|
}
|
||||||
result += $(libs2[1]) ;
|
result += $(libs2[1]) ;
|
||||||
libs2 = $(libs2[2-]) ;
|
libs2 = $(libs2[2-]) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
# Just add the flag.
|
# Just add the flag.
|
||||||
result += $(l) ;
|
result += $(l) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result += $(libs2) ;
|
result += $(libs2) ;
|
||||||
return $(result) ;
|
return $(result) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## LFlags target : flags [ : options ]
|
## LFlags target : flags [ : options ]
|
||||||
## Sets linker flags for a library, plugin or application target
|
## Sets linker flags for a library, plugin or application target
|
||||||
rule LFlags
|
rule LFlags
|
||||||
{
|
{
|
||||||
CheckOptions nostatic : $(3) : $(<) ;
|
CheckOptions nostatic : $(3) : $(<) ;
|
||||||
|
|
||||||
NotFile $(>) ;
|
NotFile $(>) ;
|
||||||
NEEDLIBS on $($(<)_TARGET) += $(>) ;
|
NEEDLIBS on $($(<)_TARGET) += $(>) ;
|
||||||
$(<).LFLAGS += $(>) ;
|
$(<).LFLAGS += $(>) ;
|
||||||
|
|
||||||
UnitTestLFlags $(<) : $(>) : $(3) ;
|
UnitTestLFlags $(<) : $(>) : $(3) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## ExternalLibs target : identifiers
|
## ExternalLibs target : identifiers
|
||||||
## Specify a dependency between 'target' and the external libraries
|
## Specify a dependency between 'target' and the external libraries
|
||||||
## indicated by 'identifiers'. If 'target' is an application or plugin,
|
## indicated by 'identifiers'. If 'target' is an application or plugin,
|
||||||
## then it is linked against the indicated external libraries. If 'target'
|
## then it is linked against the indicated external libraries. If 'target'
|
||||||
## is a library, then its dependency upon 'identifiers' is noted, and
|
## is a library, then its dependency upon 'identifiers' is noted, and
|
||||||
## applications or plugins which link against 'target' will also be linked
|
## applications or plugins which link against 'target' will also be linked
|
||||||
## against the libraries indicated by 'identifiers'. 'identifiers' is a
|
## against the libraries indicated by 'identifiers'. 'identifiers' is a
|
||||||
## list of base names of a set of variables which provide build tool
|
## list of base names of a set of variables which provide build tool
|
||||||
## information about each external library. In particular, assuming that
|
## information about each external library. In particular, assuming that
|
||||||
## `ident' is one element of `identifiers', the value of $(ident).CFLAGS
|
## `ident' is one element of `identifiers', the value of $(ident).CFLAGS
|
||||||
## should provide compiler flags needed for the external library indicated
|
## should provide compiler flags needed for the external library indicated
|
||||||
## by 'ident'; and $(ident).LFLAGS should provide linker flags for the
|
## by 'ident'; and $(ident).LFLAGS should provide linker flags for the
|
||||||
## library.
|
## library.
|
||||||
rule ExternalLibs
|
rule ExternalLibs
|
||||||
{
|
{
|
||||||
local extlib ;
|
local extlib ;
|
||||||
for extlib in $(>)
|
for extlib in $(>)
|
||||||
{
|
{
|
||||||
CFlags $(<) : $($(extlib).CFLAGS) ;
|
CFlags $(<) : $($(extlib).CFLAGS) ;
|
||||||
LFlags $(<) : $($(extlib).LFLAGS) ;
|
LFlags $(<) : $($(extlib).LFLAGS) ;
|
||||||
|
|
||||||
$(<).EXTERNALLIBS += $(extlib) ;
|
$(<).EXTERNALLIBS += $(extlib) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
## ExtraObjects target : objectfiles [ : options ]
|
## ExtraObjects target : objectfiles [ : options ]
|
||||||
## Link additional object files with a target.
|
## Link additional object files with a target.
|
||||||
## Options:
|
## Options:
|
||||||
## inheritcflags: The mentioned object files will inherit compiler flags
|
## inheritcflags: The mentioned object files will inherit compiler flags
|
||||||
## assigned to target's normal object files (in addition to any flags
|
## assigned to target's normal object files (in addition to any flags
|
||||||
## already set manually).
|
## already set manually).
|
||||||
rule ExtraObjects
|
rule ExtraObjects
|
||||||
{
|
{
|
||||||
CheckOptions inheritcflags : $(3) : $(<) ;
|
CheckOptions inheritcflags : $(3) : $(<) ;
|
||||||
if [ IsElem inheritcflags : $(3) ]
|
if [ IsElem inheritcflags : $(3) ]
|
||||||
{
|
{
|
||||||
$(<)_OBJECTS += $(>) ;
|
$(<)_OBJECTS += $(>) ;
|
||||||
}
|
}
|
||||||
EXTRAOBJECTS on $($(<)_TARGET) += $(>) ;
|
EXTRAOBJECTS on $($(<)_TARGET) += $(>) ;
|
||||||
Depends $($(<)_TARGET) : $(>) ;
|
Depends $($(<)_TARGET) : $(>) ;
|
||||||
Clean $(<)clean : $(>) ;
|
Clean $(<)clean : $(>) ;
|
||||||
Clean clean : $(>) ;
|
Clean clean : $(>) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# private part
|
# private part
|
||||||
|
|
||||||
## ResolveLibs libs
|
## ResolveLibs libs
|
||||||
## Given a list of libraries, augment the list by adding other libraries
|
## Given a list of libraries, augment the list by adding other libraries
|
||||||
## upon which the given libraries depend. Dependencies between libraries
|
## upon which the given libraries depend. Dependencies between libraries
|
||||||
## are specified via LibDepends (or LinkWith when the target is a library).
|
## are specified via LibDepends (or LinkWith when the target is a library).
|
||||||
## The returned list is ordered such that it is suitable for Unix linkers
|
## The returned list is ordered such that it is suitable for Unix linkers
|
||||||
## which are sensitive to the order of libraries in the invocation
|
## which are sensitive to the order of libraries in the invocation
|
||||||
## statement.
|
## statement.
|
||||||
rule ResolveLibs
|
rule ResolveLibs
|
||||||
{
|
{
|
||||||
local i libs ;
|
local i libs ;
|
||||||
for i in $(<)
|
for i in $(<)
|
||||||
{
|
{
|
||||||
libs += $(i) $($(i)_depends) ;
|
libs += $(i) $($(i)_depends) ;
|
||||||
}
|
}
|
||||||
# We must eliminate the duplicates in reverse order in order to ensure that
|
# We must eliminate the duplicates in reverse order in order to ensure that
|
||||||
# we do not destroy the overall library ordering since Unix linkers are
|
# we do not destroy the overall library ordering since Unix linkers are
|
||||||
# order-sensitive.
|
# order-sensitive.
|
||||||
return [ Reverse [ RemoveDups [ Reverse $(libs) ] ] ] ;
|
return [ Reverse [ RemoveDups [ Reverse $(libs) ] ] ] ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,61 +1,61 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for building compile groups
|
# Rules for building compile groups
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
COMPILE_GROUPS = ;
|
COMPILE_GROUPS = ;
|
||||||
|
|
||||||
## CompileGroups target : groups
|
## CompileGroups target : groups
|
||||||
## Adds a target to a list of compile groups. A compile group is a virtual
|
## Adds a target to a list of compile groups. A compile group is a virtual
|
||||||
## target which combines several targets. This is useful for things like a
|
## target which combines several targets. This is useful for things like a
|
||||||
## creating a target which compiles all image loaders, all renderers, etc.
|
## creating a target which compiles all image loaders, all renderers, etc.
|
||||||
rule CompileGroups
|
rule CompileGroups
|
||||||
{
|
{
|
||||||
local _i ;
|
local _i ;
|
||||||
|
|
||||||
for _i in $(>)
|
for _i in $(>)
|
||||||
{
|
{
|
||||||
Depends $(_i) : $(<) ;
|
Depends $(_i) : $(<) ;
|
||||||
Depends $(_i)clean : $(<)clean ;
|
Depends $(_i)clean : $(<)clean ;
|
||||||
|
|
||||||
if ! [ IsElem $(_i) : $(COMPILE_GROUPS) ]
|
if ! [ IsElem $(_i) : $(COMPILE_GROUPS) ]
|
||||||
{
|
{
|
||||||
NotFile $(_i) ;
|
NotFile $(_i) ;
|
||||||
Echo "Warning: $(_i) not registered via RegisterCompileGroups" ;
|
Echo "Warning: $(_i) not registered via RegisterCompileGroups" ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
## RegisterCompileGroups
|
## RegisterCompileGroups
|
||||||
## Registers compile groups. You must specify all compile groups here before
|
## Registers compile groups. You must specify all compile groups here before
|
||||||
## can use them.
|
## can use them.
|
||||||
rule RegisterCompileGroups
|
rule RegisterCompileGroups
|
||||||
{
|
{
|
||||||
NotFile $(<) ;
|
NotFile $(<) ;
|
||||||
COMPILE_GROUPS += $(<) ;
|
COMPILE_GROUPS += $(<) ;
|
||||||
|
|
||||||
local i ;
|
local i ;
|
||||||
for i in $(<)
|
for i in $(<)
|
||||||
{
|
{
|
||||||
local desc = [ Description $(i) ] ;
|
local desc = [ Description $(i) ] ;
|
||||||
if $(desc)
|
if $(desc)
|
||||||
{
|
{
|
||||||
Help $(i) : "Build the $(desc)" ;
|
Help $(i) : "Build the $(desc)" ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
170
mk/jam/help.jam
170
mk/jam/help.jam
@@ -1,85 +1,85 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for collecting and emitting descriptions about targets
|
# Rules for collecting and emitting descriptions about targets
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
## Description target [ : description ]
|
## Description target [ : description ]
|
||||||
## Provides access to the description of 'target'. The description may be
|
## Provides access to the description of 'target'. The description may be
|
||||||
## used by other rules, such as those which generate project files, or which
|
## used by other rules, such as those which generate project files, or which
|
||||||
## present informative messages to the user regarding 'target'. If invoked
|
## present informative messages to the user regarding 'target'. If invoked
|
||||||
## with two arguments, then it sets the description of 'target'. If invoked
|
## with two arguments, then it sets the description of 'target'. If invoked
|
||||||
## with one argument, then it returns the description of 'target'. You
|
## with one argument, then it returns the description of 'target'. You
|
||||||
## should invoke this rule to set the description before invoking other
|
## should invoke this rule to set the description before invoking other
|
||||||
## rules which might need access to target's description, such as the
|
## rules which might need access to target's description, such as the
|
||||||
## Application, Library, and Plugin rules. As a convenience, several generic
|
## Application, Library, and Plugin rules. As a convenience, several generic
|
||||||
## rules, such as Application, Library, and Plugin will automatically invoke
|
## rules, such as Application, Library, and Plugin will automatically invoke
|
||||||
## the Help rule for 'target' using the provided 'description'.
|
## the Help rule for 'target' using the provided 'description'.
|
||||||
rule Description
|
rule Description
|
||||||
{
|
{
|
||||||
local desc = $(>) ;
|
local desc = $(>) ;
|
||||||
if $(desc)
|
if $(desc)
|
||||||
{
|
{
|
||||||
$(<)_description = $(desc) ;
|
$(<)_description = $(desc) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
desc = $($(<)_description) ;
|
desc = $($(<)_description) ;
|
||||||
}
|
}
|
||||||
return $(desc) ;
|
return $(desc) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
## Help target : description
|
## Help target : description
|
||||||
## Specify the 'description' to emit for 'target' when the user invokes "jam
|
## Specify the 'description' to emit for 'target' when the user invokes "jam
|
||||||
## help".
|
## help".
|
||||||
rule Help
|
rule Help
|
||||||
{
|
{
|
||||||
local target = $(<) ;
|
local target = $(<) ;
|
||||||
local desc = $(>) ;
|
local desc = $(>) ;
|
||||||
|
|
||||||
if ! $(target) { target = "" ; }
|
if ! $(target) { target = "" ; }
|
||||||
if ! $(desc) { desc = "" ; }
|
if ! $(desc) { desc = "" ; }
|
||||||
|
|
||||||
# target width:20, description width:54
|
# target width:20, description width:54
|
||||||
local target_pad = " " ;
|
local target_pad = " " ;
|
||||||
local target_pat = "...................." ;
|
local target_pat = "...................." ;
|
||||||
local desc_pad = " " ;
|
local desc_pad = " " ;
|
||||||
local desc_pat = "......................................................" ;
|
local desc_pat = "......................................................" ;
|
||||||
|
|
||||||
local m = Match ; # Indirect invocation allows variables in pattern regex.
|
local m = Match ; # Indirect invocation allows variables in pattern regex.
|
||||||
local target_str = [ $(m) "($(target_pat)).*" : "$(target)$(target_pad)" ] ;
|
local target_str = [ $(m) "($(target_pat)).*" : "$(target)$(target_pad)" ] ;
|
||||||
local desc_str = [ $(m) "($(desc_pat)).*" : "$(desc)$(desc_pad)" ] ;
|
local desc_str = [ $(m) "($(desc_pat)).*" : "$(desc)$(desc_pad)" ] ;
|
||||||
local help = "jam $(target_str) $(desc_str)" ;
|
local help = "jam $(target_str) $(desc_str)" ;
|
||||||
|
|
||||||
target = $(target:G=help) ;
|
target = $(target:G=help) ;
|
||||||
Depends help : $(target) ;
|
Depends help : $(target) ;
|
||||||
NotFile $(help) ;
|
NotFile $(help) ;
|
||||||
PrintHelp $(target) : $(help) ;
|
PrintHelp $(target) : $(help) ;
|
||||||
Always $(target) ;
|
Always $(target) ;
|
||||||
NotFile $(target) ;
|
NotFile $(target) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
actions quietly PrintHelp
|
actions quietly PrintHelp
|
||||||
{
|
{
|
||||||
echo "$(>)"
|
echo "$(>)"
|
||||||
}
|
}
|
||||||
|
|
||||||
NotFile help ;
|
NotFile help ;
|
||||||
Always help ;
|
Always help ;
|
||||||
Help all : "Build the entire project" ;
|
Help all : "Build the entire project" ;
|
||||||
|
|||||||
1188
mk/jam/helper.jam
1188
mk/jam/helper.jam
File diff suppressed because it is too large
Load Diff
@@ -1,213 +1,213 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for installation
|
# Rules for installation
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
INSTALL ?= "install" ;
|
INSTALL ?= "install" ;
|
||||||
INSTALL_PROGRAM ?= $(INSTALL) ;
|
INSTALL_PROGRAM ?= $(INSTALL) ;
|
||||||
INSTALL_DATA ?= "$(INSTALL) -m 644" ;
|
INSTALL_DATA ?= "$(INSTALL) -m 644" ;
|
||||||
|
|
||||||
# set some paths
|
# set some paths
|
||||||
appdatadir ?= [ ConcatDirs $(datadir) $(PACKAGE_NAME) ] ;
|
appdatadir ?= [ ConcatDirs $(datadir) $(PACKAGE_NAME) ] ;
|
||||||
appdocdir ?= [ ConcatDirs $(datadir) doc $(PACKAGE_NAME)-$(PACKAGE_VERSION) ] ;
|
appdocdir ?= [ ConcatDirs $(datadir) doc $(PACKAGE_NAME)-$(PACKAGE_VERSION) ] ;
|
||||||
appconfdir ?= [ ConcatDirs $(sysconfdir) $(PACKAGE_NAME) ] ;
|
appconfdir ?= [ ConcatDirs $(sysconfdir) $(PACKAGE_NAME) ] ;
|
||||||
appincdir ?= [ ConcatDirs $(includedir) $(PACKAGE_NAME) ] ;
|
appincdir ?= [ ConcatDirs $(includedir) $(PACKAGE_NAME) ] ;
|
||||||
plugindir ?= [ ConcatDirs $(libdir) $(PACKAGE_NAME) ] ;
|
plugindir ?= [ ConcatDirs $(libdir) $(PACKAGE_NAME) ] ;
|
||||||
|
|
||||||
rule GristInstall
|
rule GristInstall
|
||||||
{
|
{
|
||||||
local i, files ;
|
local i, files ;
|
||||||
for i in $(<)
|
for i in $(<)
|
||||||
{
|
{
|
||||||
if $(i:G) { files += $(i) ; }
|
if $(i:G) { files += $(i) ; }
|
||||||
else { files += $(i:G=$(SUBDIR)) ; }
|
else { files += $(i:G=$(SUBDIR)) ; }
|
||||||
}
|
}
|
||||||
return $(files) ;
|
return $(files) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## InstallHeader headername [ : subdir ]
|
## InstallHeader headername [ : subdir ]
|
||||||
## DoInstall a header file into the includedir directory. A subdirectory
|
## DoInstall a header file into the includedir directory. A subdirectory
|
||||||
## relative to the includedir can be specified.
|
## relative to the includedir can be specified.
|
||||||
rule InstallHeader
|
rule InstallHeader
|
||||||
{
|
{
|
||||||
local files = [ GristInstall $(<) ] ;
|
local files = [ GristInstall $(<) ] ;
|
||||||
SEARCH on $(files) = $(SUBDIR) ;
|
SEARCH on $(files) = $(SUBDIR) ;
|
||||||
Depends install_include : [ DoInstall $(files) : $(appincdir) $(2) ] ;
|
Depends install_include : [ DoInstall $(files) : $(appincdir) $(2) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## InstallData files [ : subdir ]
|
## InstallData files [ : subdir ]
|
||||||
## Installs data files
|
## Installs data files
|
||||||
rule InstallData
|
rule InstallData
|
||||||
{
|
{
|
||||||
local files = [ GristInstall $(<) ] ;
|
local files = [ GristInstall $(<) ] ;
|
||||||
SEARCH on $(files) = $(SUBDIR) ;
|
SEARCH on $(files) = $(SUBDIR) ;
|
||||||
Depends install_data : [ DoInstall $(files) : $(appdatadir) $(2) ] ;
|
Depends install_data : [ DoInstall $(files) : $(appdatadir) $(2) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## InstallConfig files [ : subdir ]
|
## InstallConfig files [ : subdir ]
|
||||||
## Installs configuration files
|
## Installs configuration files
|
||||||
rule InstallConfig
|
rule InstallConfig
|
||||||
{
|
{
|
||||||
local files = [ GristInstall $(<) ] ;
|
local files = [ GristInstall $(<) ] ;
|
||||||
SEARCH on $(files) = $(SUBDIR) ;
|
SEARCH on $(files) = $(SUBDIR) ;
|
||||||
Depends install_config : [ DoInstall $(files) : $(appconfdir) $(2) ] ;
|
Depends install_config : [ DoInstall $(files) : $(appconfdir) $(2) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## InstallDoc files [ : subdir ]
|
## InstallDoc files [ : subdir ]
|
||||||
## Installs documentation files
|
## Installs documentation files
|
||||||
rule InstallDoc
|
rule InstallDoc
|
||||||
{
|
{
|
||||||
local files = [ GristInstall $(<) ] ;
|
local files = [ GristInstall $(<) ] ;
|
||||||
SEARCH on $(files) = $(SUBDIR) ;
|
SEARCH on $(files) = $(SUBDIR) ;
|
||||||
Depends install_doc : [ DoInstall $(files) : $(appdocdir) $(2) ] ;
|
Depends install_doc : [ DoInstall $(files) : $(appdocdir) $(2) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## InstallMan files
|
## InstallMan files
|
||||||
## Installs Unix manual files
|
## Installs Unix manual files
|
||||||
rule InstallMan
|
rule InstallMan
|
||||||
{
|
{
|
||||||
local files = [ GristInstall $(<) ] ;
|
local files = [ GristInstall $(<) ] ;
|
||||||
SEARCH on $(files) = $(SUBDIR) ;
|
SEARCH on $(files) = $(SUBDIR) ;
|
||||||
|
|
||||||
local i ;
|
local i ;
|
||||||
for i in $(files)
|
for i in $(files)
|
||||||
{
|
{
|
||||||
local dir = $(mandir) ;
|
local dir = $(mandir) ;
|
||||||
switch $(i:S)
|
switch $(i:S)
|
||||||
{
|
{
|
||||||
case .1 : dir += man1 ;
|
case .1 : dir += man1 ;
|
||||||
case .2 : dir += man2 ;
|
case .2 : dir += man2 ;
|
||||||
case .3 : dir += man3 ;
|
case .3 : dir += man3 ;
|
||||||
case .4 : dir += man4 ;
|
case .4 : dir += man4 ;
|
||||||
case .5 : dir += man5 ;
|
case .5 : dir += man5 ;
|
||||||
case .6 : dir += man6 ;
|
case .6 : dir += man6 ;
|
||||||
case .7 : dir += man7 ;
|
case .7 : dir += man7 ;
|
||||||
case .8 : dir += man8 ;
|
case .8 : dir += man8 ;
|
||||||
case .9 : dir += man9 ;
|
case .9 : dir += man9 ;
|
||||||
case * :
|
case * :
|
||||||
echo "WARNING: manfile has no *.[0-9] ending." ;
|
echo "WARNING: manfile has no *.[0-9] ending." ;
|
||||||
}
|
}
|
||||||
Depends install_man : [ DoInstall $(i) : $(dir) ] ;
|
Depends install_man : [ DoInstall $(i) : $(dir) ] ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
## InstallProgram files [ : directories ]
|
## InstallProgram files [ : directories ]
|
||||||
## Installs program files (executable or shell script). This is a
|
## Installs program files (executable or shell script). This is a
|
||||||
## convenience wrapper for DoInstall when the resources to be installed is
|
## convenience wrapper for DoInstall when the resources to be installed is
|
||||||
## of an invocable nature. It sets SEARCH on `files', and uses
|
## of an invocable nature. It sets SEARCH on `files', and uses
|
||||||
## $(INSTALL_PROGRAM) to perform the actual installation. Unlike
|
## $(INSTALL_PROGRAM) to perform the actual installation. Unlike
|
||||||
## SystemInstallApplication, it does not assume that all such targets should
|
## SystemInstallApplication, it does not assume that all such targets should
|
||||||
## be installed into $(bindir); instead, you can provide `directories' to
|
## be installed into $(bindir); instead, you can provide `directories' to
|
||||||
## specify the installation location. If `directories' is not given, then
|
## specify the installation location. If `directories' is not given, then
|
||||||
## $(bindir) is assumed. Also, unlike SystemInstallApplication, this rule
|
## $(bindir) is assumed. Also, unlike SystemInstallApplication, this rule
|
||||||
## does not have any platform-specific knowledge (such as how to install a
|
## does not have any platform-specific knowledge (such as how to install a
|
||||||
## Cocoa application wrapper on MacOS/X). Always use
|
## Cocoa application wrapper on MacOS/X). Always use
|
||||||
## SystemInstallApplication for installation of full-fledged applications. A
|
## SystemInstallApplication for installation of full-fledged applications. A
|
||||||
## typical use for InstallProgram would be to install an already-existing
|
## typical use for InstallProgram would be to install an already-existing
|
||||||
## shell script. This differs from the ShellScript rule which both creates a
|
## shell script. This differs from the ShellScript rule which both creates a
|
||||||
## shell script from scratch at build time, and arranges for it to be
|
## shell script from scratch at build time, and arranges for it to be
|
||||||
## installed. Like DoInstall, this rule returns the names of the installed
|
## installed. Like DoInstall, this rule returns the names of the installed
|
||||||
## targets, so it is convenient to use the results as the input for another
|
## targets, so it is convenient to use the results as the input for another
|
||||||
## rule, such as Depends.
|
## rule, such as Depends.
|
||||||
rule InstallProgram
|
rule InstallProgram
|
||||||
{
|
{
|
||||||
local files = [ GristInstall $(1) ] ;
|
local files = [ GristInstall $(1) ] ;
|
||||||
local dir = $(2) ;
|
local dir = $(2) ;
|
||||||
if ! $(dir) { dir = $(bindir) ; }
|
if ! $(dir) { dir = $(bindir) ; }
|
||||||
SEARCH on $(files) = $(SUBDIR) ;
|
SEARCH on $(files) = $(SUBDIR) ;
|
||||||
return [ DoInstall $(files) : $(dir) : $(INSTALL_PROGRAM) ] ;
|
return [ DoInstall $(files) : $(dir) : $(INSTALL_PROGRAM) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## DoInstall sourcenames : directories [ : installapp : [ postinstallrules ]]
|
## DoInstall sourcenames : directories [ : installapp : [ postinstallrules ]]
|
||||||
## Creates a new install target for the given sources named by
|
## Creates a new install target for the given sources named by
|
||||||
## `sourcenames'. `directories' is a list of directory components
|
## `sourcenames'. `directories' is a list of directory components
|
||||||
## indicating the installation directory for `sourcename'. `installapp' is
|
## indicating the installation directory for `sourcename'. `installapp' is
|
||||||
## the actual program to run to install the sources. If not specified, then
|
## the actual program to run to install the sources. If not specified, then
|
||||||
## $(INSTALL_DATA) is used. If the optional `postinstallrules' is provided,
|
## $(INSTALL_DATA) is used. If the optional `postinstallrules' is provided,
|
||||||
## it is a list of Jam rules to invoke on the installed target after it is
|
## it is a list of Jam rules to invoke on the installed target after it is
|
||||||
## installed. Each rule is invoked with the installed target as the first
|
## installed. Each rule is invoked with the installed target as the first
|
||||||
## argument, and the source target as the second. An obvious instance where
|
## argument, and the source target as the second. An obvious instance where
|
||||||
## `postinstallrules' proves useful is when the Ranlib rule should be
|
## `postinstallrules' proves useful is when the Ranlib rule should be
|
||||||
## invoked on just-installed static library (.a) files. The DoInstall rule
|
## invoked on just-installed static library (.a) files. The DoInstall rule
|
||||||
## returns the names of the installed targets, so it is convenient to use
|
## returns the names of the installed targets, so it is convenient to use
|
||||||
## the results as the input for another rule. For example:
|
## the results as the input for another rule. For example:
|
||||||
## Depends install : [ DoInstall $(docfiles) : $(installdocdir) ] ;
|
## Depends install : [ DoInstall $(docfiles) : $(installdocdir) ] ;
|
||||||
## (Implementation Note: We did not name this rule Install, because Jambase
|
## (Implementation Note: We did not name this rule Install, because Jambase
|
||||||
## already defines an action named Install :-/)
|
## already defines an action named Install :-/)
|
||||||
rule DoInstall
|
rule DoInstall
|
||||||
{
|
{
|
||||||
local targets target i dir gdir ;
|
local targets target i dir gdir ;
|
||||||
dir = [ ConcatDirs $(DESTDIR) $(2) ] ;
|
dir = [ ConcatDirs $(DESTDIR) $(2) ] ;
|
||||||
|
|
||||||
gdir = $(dir:G=dir) ;
|
gdir = $(dir:G=dir) ;
|
||||||
MkDir $(gdir) ;
|
MkDir $(gdir) ;
|
||||||
|
|
||||||
for i in $(1)
|
for i in $(1)
|
||||||
{
|
{
|
||||||
target = $(i:BSR=$(dir):G=install) ;
|
target = $(i:BSR=$(dir):G=install) ;
|
||||||
targets += $(target) ;
|
targets += $(target) ;
|
||||||
Depends $(target) : $(gdir) $(i) ;
|
Depends $(target) : $(gdir) $(i) ;
|
||||||
Install1 $(target) : $(i) ;
|
Install1 $(target) : $(i) ;
|
||||||
|
|
||||||
if "$(3)"
|
if "$(3)"
|
||||||
{
|
{
|
||||||
INSTALL_APP on $(target) = $(3) ;
|
INSTALL_APP on $(target) = $(3) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
INSTALL_APP on $(target) = $(INSTALL_DATA) ;
|
INSTALL_APP on $(target) = $(INSTALL_DATA) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if "$(4)"
|
if "$(4)"
|
||||||
{
|
{
|
||||||
local postrule ;
|
local postrule ;
|
||||||
for postrule in $(4)
|
for postrule in $(4)
|
||||||
{
|
{
|
||||||
$(postrule) $(target) : $(i) ;
|
$(postrule) $(target) : $(i) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Always $(targets) ;
|
Always $(targets) ;
|
||||||
return $(targets) ;
|
return $(targets) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
INSTALLTARGETS = install_bin install_plugin install_lib install_include
|
INSTALLTARGETS = install_bin install_plugin install_lib install_include
|
||||||
install_data install_config install_doc ;
|
install_data install_config install_doc ;
|
||||||
|
|
||||||
Always install $(INSTALLTARGETS) ;
|
Always install $(INSTALLTARGETS) ;
|
||||||
NotFile install $(INSTALLTARGETS) ;
|
NotFile install $(INSTALLTARGETS) ;
|
||||||
Depends install : $(INSTALLTARGETS) ;
|
Depends install : $(INSTALLTARGETS) ;
|
||||||
|
|
||||||
if ! $(PACKAGE_INSTALL_NAME) { PACKAGE_INSTALL_NAME = $(PACKAGE_LONGNAME) ; }
|
if ! $(PACKAGE_INSTALL_NAME) { PACKAGE_INSTALL_NAME = $(PACKAGE_LONGNAME) ; }
|
||||||
if ! $(PACKAGE_INSTALL_NAME) { PACKAGE_INSTALL_NAME = $(PACKAGE_NAME) ; }
|
if ! $(PACKAGE_INSTALL_NAME) { PACKAGE_INSTALL_NAME = $(PACKAGE_NAME) ; }
|
||||||
if ! $(PACKAGE_INSTALL_NAME) { PACKAGE_INSTALL_NAME = "the project" ; }
|
if ! $(PACKAGE_INSTALL_NAME) { PACKAGE_INSTALL_NAME = "the project" ; }
|
||||||
Help install : "Install $(PACKAGE_INSTALL_NAME)" ;
|
Help install : "Install $(PACKAGE_INSTALL_NAME)" ;
|
||||||
|
|
||||||
actions Install1
|
actions Install1
|
||||||
{
|
{
|
||||||
$(INSTALL_APP) $(INSTALLFLAGS) $(>) $(<)
|
$(INSTALL_APP) $(INSTALLFLAGS) $(>) $(<)
|
||||||
}
|
}
|
||||||
|
|
||||||
actions CopyDirs
|
actions CopyDirs
|
||||||
{
|
{
|
||||||
$(DEEPCOPY) $(>) $(<)
|
$(DEEPCOPY) $(>) $(<)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,349 +1,349 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Several hacks to make the build compatible with certain old/broken jam
|
# Several hacks to make the build compatible with certain old/broken jam
|
||||||
# versions
|
# versions
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
# BoostJam is evil: It is compatible to Jam 2.4 but has a version number 3.1,
|
# BoostJam is evil: It is compatible to Jam 2.4 but has a version number 3.1,
|
||||||
# we try to detect BoostJam with the ARGV extension.
|
# we try to detect BoostJam with the ARGV extension.
|
||||||
if $(ARGV[0])
|
if $(ARGV[0])
|
||||||
{
|
{
|
||||||
# BoostJam hacks.
|
# BoostJam hacks.
|
||||||
JAMVERSION = 2.4 ;
|
JAMVERSION = 2.4 ;
|
||||||
rule FIncludes
|
rule FIncludes
|
||||||
{
|
{
|
||||||
return -I$(<) ;
|
return -I$(<) ;
|
||||||
}
|
}
|
||||||
rule FDefines
|
rule FDefines
|
||||||
{
|
{
|
||||||
return -D$(<) ;
|
return -D$(<) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $(JAMVERSION) < 2.4
|
if $(JAMVERSION) < 2.4
|
||||||
{
|
{
|
||||||
EXIT "Error: This buildsystem requires jam version 2.4 or later." ;
|
EXIT "Error: This buildsystem requires jam version 2.4 or later." ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# All scripts invoked by the build system expect a Bourne or compatible shell.
|
# All scripts invoked by the build system expect a Bourne or compatible shell.
|
||||||
# Reject C-shell and its variants (such as tcsh). Unfortunately, this is a bit
|
# Reject C-shell and its variants (such as tcsh). Unfortunately, this is a bit
|
||||||
# of an ugly hack. It would be nicer to perform this logic at the very end of
|
# of an ugly hack. It would be nicer to perform this logic at the very end of
|
||||||
# this file as a last-minute assertion. Unfortunately, however, it seems that
|
# this file as a last-minute assertion. Unfortunately, however, it seems that
|
||||||
# references to $(SHELL) in any of the included files get bound at the point
|
# references to $(SHELL) in any of the included files get bound at the point
|
||||||
# of reference, thus we need to perform this filtering as early as possible.
|
# of reference, thus we need to perform this filtering as early as possible.
|
||||||
# Furthermore, on Windows, if the MSYS installation path contains a space (such
|
# Furthermore, on Windows, if the MSYS installation path contains a space (such
|
||||||
# as "c:\Program Files\msys"), the space will cause `actions' to fail which
|
# as "c:\Program Files\msys"), the space will cause `actions' to fail which
|
||||||
# employ $(SHELL) indirectly through some other variable. Therefore, handle
|
# employ $(SHELL) indirectly through some other variable. Therefore, handle
|
||||||
# this case as well.
|
# this case as well.
|
||||||
if [ Match (csh) : $(SHELL) ] || $(SHELL[2])
|
if [ Match (csh) : $(SHELL) ] || $(SHELL[2])
|
||||||
{
|
{
|
||||||
SHELL = "/bin/sh" ;
|
SHELL = "/bin/sh" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Jam 2.4's SubDir rule had some problems and misses the useful SUBDIRRULES
|
# Jam 2.4's SubDir rule had some problems and misses the useful SUBDIRRULES
|
||||||
# extension. So we override it here with a better version (from jam 2.5rc3).
|
# extension. So we override it here with a better version (from jam 2.5rc3).
|
||||||
# Likewise, 2.4 is missing FReverse and FStrip, which are needed by SubDir and
|
# Likewise, 2.4 is missing FReverse and FStrip, which are needed by SubDir and
|
||||||
# other custom rules we define.
|
# other custom rules we define.
|
||||||
if $(JAMVERSION) = 2.4
|
if $(JAMVERSION) = 2.4
|
||||||
{
|
{
|
||||||
|
|
||||||
rule FReverse
|
rule FReverse
|
||||||
{
|
{
|
||||||
# FReverse a1 a2 a3 ... ;
|
# FReverse a1 a2 a3 ... ;
|
||||||
# return ... a3 a2 a1 ;
|
# return ... a3 a2 a1 ;
|
||||||
|
|
||||||
if $(1) { return [ FReverse $(1[2-]) ] $(1[1]) ; }
|
if $(1) { return [ FReverse $(1[2-]) ] $(1[1]) ; }
|
||||||
}
|
}
|
||||||
|
|
||||||
rule FStripCommon
|
rule FStripCommon
|
||||||
{
|
{
|
||||||
# FStripCommon v1 : v2 ;
|
# FStripCommon v1 : v2 ;
|
||||||
|
|
||||||
# Strip common initial elements of variables v1 and v2.
|
# Strip common initial elements of variables v1 and v2.
|
||||||
# Modifies the variable values themselves.
|
# Modifies the variable values themselves.
|
||||||
|
|
||||||
if $($(<)[1]) && $($(<)[1]) = $($(>)[1])
|
if $($(<)[1]) && $($(<)[1]) = $($(>)[1])
|
||||||
{
|
{
|
||||||
$(<) = $($(<)[2-]) ;
|
$(<) = $($(<)[2-]) ;
|
||||||
$(>) = $($(>)[2-]) ;
|
$(>) = $($(>)[2-]) ;
|
||||||
FStripCommon $(<) : $(>) ;
|
FStripCommon $(<) : $(>) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rule SubDir
|
rule SubDir
|
||||||
{
|
{
|
||||||
#
|
#
|
||||||
# SubDir TOP d1 d2 ... ;
|
# SubDir TOP d1 d2 ... ;
|
||||||
#
|
#
|
||||||
# Support for a project tree spanning multiple directories.
|
# Support for a project tree spanning multiple directories.
|
||||||
#
|
#
|
||||||
# SubDir declares a Jamfile's location in a project tree, setting
|
# SubDir declares a Jamfile's location in a project tree, setting
|
||||||
# Jambase variables (SEARCH_SOURCE, LOCATE_TARGET) so that source
|
# Jambase variables (SEARCH_SOURCE, LOCATE_TARGET) so that source
|
||||||
# files can be found.
|
# files can be found.
|
||||||
#
|
#
|
||||||
# TOP is a user-select variable name for root of the tree, and
|
# TOP is a user-select variable name for root of the tree, and
|
||||||
# d1 d2 ... are the directory elements that lead from the root
|
# d1 d2 ... are the directory elements that lead from the root
|
||||||
# of the tree to the directory of the Jamfile.
|
# of the tree to the directory of the Jamfile.
|
||||||
#
|
#
|
||||||
# TOP can be set externally, but normally the first SubDir call
|
# TOP can be set externally, but normally the first SubDir call
|
||||||
# computes TOP as the path up from the current directory; the
|
# computes TOP as the path up from the current directory; the
|
||||||
# path contains one ../ for each of d1 d2 ...
|
# path contains one ../ for each of d1 d2 ...
|
||||||
#
|
#
|
||||||
# SubDir reads once the project-specific rules file Jamrules
|
# SubDir reads once the project-specific rules file Jamrules
|
||||||
# in the TOP directory, if present. This can be overridden
|
# in the TOP directory, if present. This can be overridden
|
||||||
# with the variable TOPRULES.
|
# with the variable TOPRULES.
|
||||||
#
|
#
|
||||||
# SubDir supports multiple, overlaid project trees: SubDir
|
# SubDir supports multiple, overlaid project trees: SubDir
|
||||||
# invocations with different TOPs can appear in the same Jamfile.
|
# invocations with different TOPs can appear in the same Jamfile.
|
||||||
# The location established by the first SubDir call is used set
|
# The location established by the first SubDir call is used set
|
||||||
# the TOPs for the subsequent SubDir calls.
|
# the TOPs for the subsequent SubDir calls.
|
||||||
#
|
#
|
||||||
# SubDir's public variables:
|
# SubDir's public variables:
|
||||||
#
|
#
|
||||||
# $(TOP) = path from CWD to root.
|
# $(TOP) = path from CWD to root.
|
||||||
# $(SUBDIR) = path from CWD to the directory SubDir names.
|
# $(SUBDIR) = path from CWD to the directory SubDir names.
|
||||||
# $(SUBDIR_TOKENS) = path from $(TOP) to $(SUBDIR) as dir names
|
# $(SUBDIR_TOKENS) = path from $(TOP) to $(SUBDIR) as dir names
|
||||||
# $(SEARCH_SOURCE) = $(SUBDIR)
|
# $(SEARCH_SOURCE) = $(SUBDIR)
|
||||||
# $(LOCATE_SOURCE) = $(ALL_LOCATE_TARGET) $(SUBDIR)
|
# $(LOCATE_SOURCE) = $(ALL_LOCATE_TARGET) $(SUBDIR)
|
||||||
# $(LOCATE_TARGET) = $(ALL_LOCATE_TARGET) $(SUBDIR)
|
# $(LOCATE_TARGET) = $(ALL_LOCATE_TARGET) $(SUBDIR)
|
||||||
# $(SOURCE_GRIST) = $(SUBDIR_TOKENS) with !'s
|
# $(SOURCE_GRIST) = $(SUBDIR_TOKENS) with !'s
|
||||||
#
|
#
|
||||||
|
|
||||||
local _top = $(<[1]) ;
|
local _top = $(<[1]) ;
|
||||||
local _tokens = $(<[2-]) ;
|
local _tokens = $(<[2-]) ;
|
||||||
|
|
||||||
#
|
#
|
||||||
# First time through sets up relative root and includes Jamrules.
|
# First time through sets up relative root and includes Jamrules.
|
||||||
#
|
#
|
||||||
|
|
||||||
if ! $(_top)
|
if ! $(_top)
|
||||||
{
|
{
|
||||||
Exit SubDir syntax error ;
|
Exit SubDir syntax error ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ! $($(_top)-SET)
|
if ! $($(_top)-SET)
|
||||||
{
|
{
|
||||||
$(_top)-SET = true ;
|
$(_top)-SET = true ;
|
||||||
|
|
||||||
# First time we've seen this TOP.
|
# First time we've seen this TOP.
|
||||||
# We'll initialize a number of internal variables:
|
# We'll initialize a number of internal variables:
|
||||||
#
|
#
|
||||||
# $(TOP-UP) = directories from ROOT to a common point
|
# $(TOP-UP) = directories from ROOT to a common point
|
||||||
# $(TOP-DOWN) = directories from common point to TOP
|
# $(TOP-DOWN) = directories from common point to TOP
|
||||||
# $(TOP-ROOT) = root directory for UP/DOWN -- normally CWD
|
# $(TOP-ROOT) = root directory for UP/DOWN -- normally CWD
|
||||||
# $(SUBDIR_UP) = current value of $(TOP-UP)
|
# $(SUBDIR_UP) = current value of $(TOP-UP)
|
||||||
# $(SUBDIR_DOWN) = current value of $(TOP-DOWN)
|
# $(SUBDIR_DOWN) = current value of $(TOP-DOWN)
|
||||||
# $(SUBDIR_ROOT) = current value of $(TOP-ROOT)
|
# $(SUBDIR_ROOT) = current value of $(TOP-ROOT)
|
||||||
#
|
#
|
||||||
|
|
||||||
if $($(_top))
|
if $($(_top))
|
||||||
{
|
{
|
||||||
# TOP externally set.
|
# TOP externally set.
|
||||||
# We'll ignore the relative (UP/DOWN) path that
|
# We'll ignore the relative (UP/DOWN) path that
|
||||||
# got us here, and instead remember the hard ROOT.
|
# got us here, and instead remember the hard ROOT.
|
||||||
|
|
||||||
$(_top)-UP = ;
|
$(_top)-UP = ;
|
||||||
$(_top)-DOWN = ;
|
$(_top)-DOWN = ;
|
||||||
$(_top)-ROOT = $($(_top)) ;
|
$(_top)-ROOT = $($(_top)) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
# TOP not preset.
|
# TOP not preset.
|
||||||
|
|
||||||
# Establishing a new TOP. In the simplest case,
|
# Establishing a new TOP. In the simplest case,
|
||||||
# (SUBDIR_UP/SUBDIR_DOWN/SUBDIR_ROOT unset), it's
|
# (SUBDIR_UP/SUBDIR_DOWN/SUBDIR_ROOT unset), it's
|
||||||
# merely a certain number of directories down from
|
# merely a certain number of directories down from
|
||||||
# the current directory, and FSubDirPath will set
|
# the current directory, and FSubDirPath will set
|
||||||
# TOP to a path consisting of ../ for each of the
|
# TOP to a path consisting of ../ for each of the
|
||||||
# elements of _tokens, because that represents how
|
# elements of _tokens, because that represents how
|
||||||
# far below TOP the current directory sits.
|
# far below TOP the current directory sits.
|
||||||
#
|
#
|
||||||
# In the more complicated case, the starting directory
|
# In the more complicated case, the starting directory
|
||||||
# isn't the directory of jam's invocation but an
|
# isn't the directory of jam's invocation but an
|
||||||
# location established by previous SubDir call. The
|
# location established by previous SubDir call. The
|
||||||
# starting directory is SUBDIR_UP directories up from
|
# starting directory is SUBDIR_UP directories up from
|
||||||
# SUBDIR_ROOT, and then SUBDIR_DOWN directories down
|
# SUBDIR_ROOT, and then SUBDIR_DOWN directories down
|
||||||
# from that. If SUBDIR_ROOT is not set, that means
|
# from that. If SUBDIR_ROOT is not set, that means
|
||||||
# SUBDIR_DOWN and SUBDIR_UP represent the path from
|
# SUBDIR_DOWN and SUBDIR_UP represent the path from
|
||||||
# the directory of jam's invocation.
|
# the directory of jam's invocation.
|
||||||
#
|
#
|
||||||
# In the most complicated case, the _tokens also
|
# In the most complicated case, the _tokens also
|
||||||
# represents directories down, because TOP is being
|
# represents directories down, because TOP is being
|
||||||
# estalished in a directory other than TOP's root.
|
# estalished in a directory other than TOP's root.
|
||||||
# Hopefully, _tokens and SUBDIR_DOWN represent the
|
# Hopefully, _tokens and SUBDIR_DOWN represent the
|
||||||
# same final directory, relative to the new TOP and
|
# same final directory, relative to the new TOP and
|
||||||
# the previous SubDIr's TOP. To find the new TOP,
|
# the previous SubDIr's TOP. To find the new TOP,
|
||||||
# we have to chop off any common directories from
|
# we have to chop off any common directories from
|
||||||
# then ends of _tokens and SUBDIR_DOWN. To do so,
|
# then ends of _tokens and SUBDIR_DOWN. To do so,
|
||||||
# we reverse each of them, call FStripCommon to
|
# we reverse each of them, call FStripCommon to
|
||||||
# remove the initial common elements, and then
|
# remove the initial common elements, and then
|
||||||
# reverse them again. After this process, if
|
# reverse them again. After this process, if
|
||||||
# both _tokens and SUBDIR_DOWN have elements, it
|
# both _tokens and SUBDIR_DOWN have elements, it
|
||||||
# means the directory names estalished by the two
|
# means the directory names estalished by the two
|
||||||
# SubDir calls don't match, and a warning is issued.
|
# SubDir calls don't match, and a warning is issued.
|
||||||
# All hell will likely break loose at this point,
|
# All hell will likely break loose at this point,
|
||||||
# since the whole SubDir scheme relies on the SubDir
|
# since the whole SubDir scheme relies on the SubDir
|
||||||
# calls accurately naming the current directory.
|
# calls accurately naming the current directory.
|
||||||
|
|
||||||
# Strip common trailing elements of _tokens and SUBDIR_DOWN.
|
# Strip common trailing elements of _tokens and SUBDIR_DOWN.
|
||||||
|
|
||||||
_tokens = [ FReverse $(_tokens) ] ;
|
_tokens = [ FReverse $(_tokens) ] ;
|
||||||
SUBDIR_DOWN = [ FReverse $(SUBDIR_DOWN) ] ;
|
SUBDIR_DOWN = [ FReverse $(SUBDIR_DOWN) ] ;
|
||||||
FStripCommon _tokens : SUBDIR_DOWN ;
|
FStripCommon _tokens : SUBDIR_DOWN ;
|
||||||
SUBDIR_DOWN = [ FReverse $(SUBDIR_DOWN) ] ;
|
SUBDIR_DOWN = [ FReverse $(SUBDIR_DOWN) ] ;
|
||||||
_tokens = [ FReverse $(_tokens) ] ;
|
_tokens = [ FReverse $(_tokens) ] ;
|
||||||
|
|
||||||
if $(SUBDIR_DOWN) && $(_tokens)
|
if $(SUBDIR_DOWN) && $(_tokens)
|
||||||
{
|
{
|
||||||
Echo Warning: SubDir $(<) misplaced! ;
|
Echo Warning: SubDir $(<) misplaced! ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# We'll remember the relative (UP/DOWN) path that
|
# We'll remember the relative (UP/DOWN) path that
|
||||||
# got us here, plus any hard ROOT starting point
|
# got us here, plus any hard ROOT starting point
|
||||||
# for the UP/DOWN. If TOP is never set externally,
|
# for the UP/DOWN. If TOP is never set externally,
|
||||||
# ROOT will always be "" (directory of jam's invocation).
|
# ROOT will always be "" (directory of jam's invocation).
|
||||||
|
|
||||||
$(_top)-UP = $(SUBDIR_UP) $(_tokens) ;
|
$(_top)-UP = $(SUBDIR_UP) $(_tokens) ;
|
||||||
$(_top)-DOWN = $(SUBDIR_DOWN) ;
|
$(_top)-DOWN = $(SUBDIR_DOWN) ;
|
||||||
$(_top)-ROOT = $(SUBDIR_ROOT:E="") ;
|
$(_top)-ROOT = $(SUBDIR_ROOT:E="") ;
|
||||||
$(_top) = [ FSubDirPath $(_top) ] ;
|
$(_top) = [ FSubDirPath $(_top) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set subdir vars for the inclusion of the Jamrules,
|
# Set subdir vars for the inclusion of the Jamrules,
|
||||||
# just in case they have SubDir rules of their own.
|
# just in case they have SubDir rules of their own.
|
||||||
# Note that SUBDIR_DOWN is empty: it's all the way
|
# Note that SUBDIR_DOWN is empty: it's all the way
|
||||||
# up where the Jamrules live. These gets overrided
|
# up where the Jamrules live. These gets overrided
|
||||||
# just after the inclusion.
|
# just after the inclusion.
|
||||||
|
|
||||||
SUBDIR_UP = $($(_top)-UP) ;
|
SUBDIR_UP = $($(_top)-UP) ;
|
||||||
SUBDIR_DOWN = ;
|
SUBDIR_DOWN = ;
|
||||||
SUBDIR_ROOT = $($(_top)-ROOT) ;
|
SUBDIR_ROOT = $($(_top)-ROOT) ;
|
||||||
|
|
||||||
# Include $(TOPRULES) or $(TOP)/Jamrules.
|
# Include $(TOPRULES) or $(TOP)/Jamrules.
|
||||||
# Include $(TOPRULES) if set.
|
# Include $(TOPRULES) if set.
|
||||||
# Otherwise include $(TOP)/Jamrules if present.
|
# Otherwise include $(TOP)/Jamrules if present.
|
||||||
|
|
||||||
if $($(_top)RULES) {
|
if $($(_top)RULES) {
|
||||||
include $($(_top)RULES) ;
|
include $($(_top)RULES) ;
|
||||||
} else {
|
} else {
|
||||||
NoCare $(JAMRULES:R=$($(_top)):G=$(_top)) ;
|
NoCare $(JAMRULES:R=$($(_top)):G=$(_top)) ;
|
||||||
include $(JAMRULES:R=$($(_top)):G=$(_top)) ;
|
include $(JAMRULES:R=$($(_top)):G=$(_top)) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get path from $(TOP) to named directory.
|
# Get path from $(TOP) to named directory.
|
||||||
# Save dir tokens for other potential uses.
|
# Save dir tokens for other potential uses.
|
||||||
|
|
||||||
SUBDIR_UP = $($(_top)-UP) ;
|
SUBDIR_UP = $($(_top)-UP) ;
|
||||||
SUBDIR_DOWN = $($(_top)-DOWN) $(_tokens) ;
|
SUBDIR_DOWN = $($(_top)-DOWN) $(_tokens) ;
|
||||||
SUBDIR_ROOT = $($(_top)-ROOT) ;
|
SUBDIR_ROOT = $($(_top)-ROOT) ;
|
||||||
SUBDIR_TOKENS = $(SUBDIR_DOWN) ;
|
SUBDIR_TOKENS = $(SUBDIR_DOWN) ;
|
||||||
|
|
||||||
SUBDIR = [ FSubDirPath $(<) ] ;
|
SUBDIR = [ FSubDirPath $(<) ] ;
|
||||||
|
|
||||||
# Now set up SEARCH_SOURCE, LOCATE_TARGET, SOURCE_GRIST
|
# Now set up SEARCH_SOURCE, LOCATE_TARGET, SOURCE_GRIST
|
||||||
# These can be reset if needed. For example, if the source
|
# These can be reset if needed. For example, if the source
|
||||||
# directory should not hold object files, LOCATE_TARGET can
|
# directory should not hold object files, LOCATE_TARGET can
|
||||||
# subsequently be redefined.
|
# subsequently be redefined.
|
||||||
|
|
||||||
SEARCH_SOURCE = $(SUBDIR) ;
|
SEARCH_SOURCE = $(SUBDIR) ;
|
||||||
LOCATE_SOURCE = $(ALL_LOCATE_TARGET) $(SUBDIR) ;
|
LOCATE_SOURCE = $(ALL_LOCATE_TARGET) $(SUBDIR) ;
|
||||||
LOCATE_TARGET = $(ALL_LOCATE_TARGET) $(SUBDIR) ;
|
LOCATE_TARGET = $(ALL_LOCATE_TARGET) $(SUBDIR) ;
|
||||||
SOURCE_GRIST = [ FGrist $(SUBDIR_TOKENS) ] ;
|
SOURCE_GRIST = [ FGrist $(SUBDIR_TOKENS) ] ;
|
||||||
|
|
||||||
# Reset per-directory ccflags, hdrs, etc,
|
# Reset per-directory ccflags, hdrs, etc,
|
||||||
# listed in SUBDIRRESET.
|
# listed in SUBDIRRESET.
|
||||||
# Note use of variable expanded assignment var
|
# Note use of variable expanded assignment var
|
||||||
|
|
||||||
SUBDIR$(SUBDIRRESET) = ;
|
SUBDIR$(SUBDIRRESET) = ;
|
||||||
|
|
||||||
# Invoke user-specific SubDir extensions,
|
# Invoke user-specific SubDir extensions,
|
||||||
# rule names listed in SUBDIRRULES.
|
# rule names listed in SUBDIRRULES.
|
||||||
# Note use of variable expanded rule invocation
|
# Note use of variable expanded rule invocation
|
||||||
|
|
||||||
$(SUBDIRRULES) $(<) ;
|
$(SUBDIRRULES) $(<) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule FSubDirPath
|
rule FSubDirPath
|
||||||
{
|
{
|
||||||
# FSubDirPath TOP d1 ... ;
|
# FSubDirPath TOP d1 ... ;
|
||||||
|
|
||||||
# Returns path to named directory.
|
# Returns path to named directory.
|
||||||
|
|
||||||
# If jam is invoked in a subdirectory of the TOP, then we
|
# If jam is invoked in a subdirectory of the TOP, then we
|
||||||
# need to prepend a ../ for every level we must climb up
|
# need to prepend a ../ for every level we must climb up
|
||||||
# (TOP-UP), and then append the directory names we must
|
# (TOP-UP), and then append the directory names we must
|
||||||
# climb down (TOP-DOWN), plus the named directories d1 ...
|
# climb down (TOP-DOWN), plus the named directories d1 ...
|
||||||
# If TOP was set externally, or computed from another TOP
|
# If TOP was set externally, or computed from another TOP
|
||||||
# that was, we'll have to reroot the whole thing at TOP-ROOT.
|
# that was, we'll have to reroot the whole thing at TOP-ROOT.
|
||||||
|
|
||||||
local _r = [ FRelPath $($(<[1])-UP) : $($(<[1])-DOWN) $(<[2-]) ] ;
|
local _r = [ FRelPath $($(<[1])-UP) : $($(<[1])-DOWN) $(<[2-]) ] ;
|
||||||
|
|
||||||
return $(_r:R=$($(<[1])-ROOT)) ;
|
return $(_r:R=$($(<[1])-ROOT)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule SubInclude
|
rule SubInclude
|
||||||
{
|
{
|
||||||
# SubInclude TOP d1 ... ;
|
# SubInclude TOP d1 ... ;
|
||||||
#
|
#
|
||||||
# Include a subdirectory's Jamfile.
|
# Include a subdirectory's Jamfile.
|
||||||
|
|
||||||
# We use SubDir to get there, in case the included Jamfile
|
# We use SubDir to get there, in case the included Jamfile
|
||||||
# either doesn't have its own SubDir (naughty) or is a subtree
|
# either doesn't have its own SubDir (naughty) or is a subtree
|
||||||
# with its own TOP.
|
# with its own TOP.
|
||||||
|
|
||||||
if ! $($(<[1]))
|
if ! $($(<[1]))
|
||||||
{
|
{
|
||||||
Exit SubInclude $(<[1]) without prior SubDir $(<[1]) ;
|
Exit SubInclude $(<[1]) without prior SubDir $(<[1]) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
SubDir $(<) ;
|
SubDir $(<) ;
|
||||||
|
|
||||||
include $(JAMFILE:D=$(SUBDIR)) ;
|
include $(JAMFILE:D=$(SUBDIR)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule SubRules
|
rule SubRules
|
||||||
{
|
{
|
||||||
# SubRules TOP d1 ... : Other-TOP ;
|
# SubRules TOP d1 ... : Other-TOP ;
|
||||||
#
|
#
|
||||||
# Read another tree's Jamrules, by giving it's path according
|
# Read another tree's Jamrules, by giving it's path according
|
||||||
# to this tree and it's own name.
|
# to this tree and it's own name.
|
||||||
|
|
||||||
if ! $($(<[1]))
|
if ! $($(<[1]))
|
||||||
{
|
{
|
||||||
Exit SubRules $(<[1]) without prior SubDir $(<[1]) ;
|
Exit SubRules $(<[1]) without prior SubDir $(<[1]) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
SubDir $(<) ;
|
SubDir $(<) ;
|
||||||
SubDir $(>) ;
|
SubDir $(>) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## Now we try to fix up the already messed settings
|
## Now we try to fix up the already messed settings
|
||||||
## XXX We can only hope that Jam 2.4 users don't try starting Jam from
|
## XXX We can only hope that Jam 2.4 users don't try starting Jam from
|
||||||
## subdirectories
|
## subdirectories
|
||||||
TOP-SET = true ;
|
TOP-SET = true ;
|
||||||
TOP-UP = ;
|
TOP-UP = ;
|
||||||
TOP-DOWN = ;
|
TOP-DOWN = ;
|
||||||
TOP-ROOT = $(TOP) ;
|
TOP-ROOT = $(TOP) ;
|
||||||
SUBDIR_UP = $(TOP-UP) ;
|
SUBDIR_UP = $(TOP-UP) ;
|
||||||
SUBDIR_DOWN = ;
|
SUBDIR_DOWN = ;
|
||||||
SUBDIR_ROOT = $(TOP-ROOT) ;
|
SUBDIR_ROOT = $(TOP-ROOT) ;
|
||||||
|
|
||||||
#SubDir TOP ;
|
#SubDir TOP ;
|
||||||
|
|
||||||
} # end if $(JAMVERSION) = 2.4
|
} # end if $(JAMVERSION) = 2.4
|
||||||
|
|||||||
@@ -1,314 +1,323 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for library creation
|
# Rules for library creation
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
# Suppress ar's noisy report that it created the archive we asked it to create.
|
# Suppress ar's noisy report that it created the archive we asked it to create.
|
||||||
if $(AR) && $(AR[2]) = ru { AR = $(AR[1]) ruc ; }
|
if $(AR) && $(AR[2]) = ru { AR = $(AR[1]) ruc ; }
|
||||||
|
|
||||||
## Library libname : sources [ : options ]
|
## Library libname : sources [ : options ]
|
||||||
## Build a library out of sourcefiles. All sourcefiles will be passed
|
## Build a library out of sourcefiles. All sourcefiles will be passed
|
||||||
## to the Objects rule which tries to compile them into object-files. You
|
## to the Objects rule which tries to compile them into object-files. You
|
||||||
## can create rules for your own filetypes with the UserObject rule. Header
|
## can create rules for your own filetypes with the UserObject rule. Header
|
||||||
## files will just be ignored. They are only used for MSVC projectfile
|
## files will just be ignored. They are only used for MSVC projectfile
|
||||||
## generation.
|
## generation.
|
||||||
## Available options are 'shared' if you want to build a shared library on
|
## Available options are 'shared' if you want to build a shared library on
|
||||||
## platforms which support that. You can specify the 'noinstall' option if
|
## platforms which support that. You can specify the 'noinstall' option if
|
||||||
## you don't want an install target generated.
|
## you don't want an install target generated.
|
||||||
## Don't specify any extensions for the library name, also leave out the
|
## Don't specify any extensions for the library name, also leave out the
|
||||||
## leading "lib".
|
## leading "lib".
|
||||||
## Options:
|
## Options:
|
||||||
## noinstall: Do not set up a default installation target.
|
## noinstall: Do not set up a default installation target.
|
||||||
## independent: The target will not be made a dependency of the libs and
|
## independent: The target will not be made a dependency of the libs and
|
||||||
## all targets.
|
## all targets.
|
||||||
## shared: Create as a shared library on supported platforms.
|
## shared: Create as a shared library on supported platforms.
|
||||||
## nohelp: Do not invoke Help for this target.
|
## nohelp: Do not invoke Help for this target.
|
||||||
## notest: Do not set up unit-testing support for this target.
|
## notest: Do not set up unit-testing support for this target.
|
||||||
## optional: Affects handling of the library in cs-config; it is only
|
## optional: Affects handling of the library in cs-config; it is only
|
||||||
## reported as available when actually built.
|
## reported as available when actually built.
|
||||||
rule Library
|
rule Library
|
||||||
{
|
{
|
||||||
local options = $(3) ;
|
local options = $(3) ;
|
||||||
CheckOptions noinstall independent shared nohelp notest optional : $(options) : $(<) ;
|
CheckOptions noinstall independent shared nohelp notest optional : $(options) : $(<) ;
|
||||||
|
|
||||||
local target = [ ConstructLibraryTarget $(<) : $(options) ] ;
|
local target = [ ConstructLibraryTarget $(<) : $(options) ] ;
|
||||||
local sources = [ DoSourceGrist $(>) ] ;
|
local sources = [ DoSourceGrist $(>) ] ;
|
||||||
local objects ;
|
local objects ;
|
||||||
local i ;
|
local i ;
|
||||||
for i in $(sources)
|
for i in $(sources)
|
||||||
{
|
{
|
||||||
if $(i:S) = $(SUFOBJ)
|
if $(i:S) = $(SUFOBJ)
|
||||||
{
|
{
|
||||||
objects += $(i) ;
|
objects += $(i) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
objects += [ CompileObjects $(i) ] ;
|
objects += [ CompileObjects $(i) ] ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(<)_TYPE = library ;
|
$(<)_TYPE = library ;
|
||||||
$(<)_OBJECTS = $(objects) ;
|
$(<)_OBJECTS = $(objects) ;
|
||||||
$(<)_SOURCES = $(sources) ;
|
$(<)_SOURCES = $(sources) ;
|
||||||
$(<)_TARGET = $(target) ;
|
$(<)_TARGET = $(target) ;
|
||||||
|
|
||||||
# create target clean rule
|
# so 'jam foo' works when it's really foo.exe (Windows) or foo.app (MacOS/X)
|
||||||
Always $(<)clean ;
|
if $(target) != $(<)
|
||||||
NotFile $(<)clean ;
|
{
|
||||||
Clean $(<)clean : $(objects) ; # create target clean rule
|
Depends $(<) : $(target) ;
|
||||||
|
NotFile $(<) ;
|
||||||
# so 'jam foo' works when it's really foo.exe (Windows) or foo.app (MacOS/X)
|
}
|
||||||
if $(target) != $(<)
|
|
||||||
{
|
# library depends on its member objects
|
||||||
Depends $(<) : $(target) ;
|
if ! [ IsElem independent : $(options) ]
|
||||||
NotFile $(<) ;
|
{
|
||||||
}
|
if $(KEEPOBJS)
|
||||||
|
{
|
||||||
# library depends on its member objects
|
Depends obj : $(objects) ;
|
||||||
if ! [ IsElem independent : $(options) ]
|
}
|
||||||
{
|
else
|
||||||
if $(KEEPOBJS)
|
{
|
||||||
{
|
Depends libs : $(<) ;
|
||||||
Depends obj : $(objects) ;
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
if ( ! [ IsElem shared : $(options) ] ) || ( $(BUILD_SHARED_LIBS) != "yes" )
|
||||||
Depends libs : $(<) ;
|
{
|
||||||
}
|
$(<)_SHARED = "" ;
|
||||||
}
|
LibraryStatic $(<) : $(objects) : [ Filter $(options) : shared ] :
|
||||||
|
$(target) ;
|
||||||
if ( ! [ IsElem shared : $(options) ] ) || ( $(BUILD_SHARED_LIBS) != "yes" )
|
}
|
||||||
{
|
else
|
||||||
$(<)_SHARED = "" ;
|
{
|
||||||
LibraryStatic $(<) : $(objects) : [ Filter $(options) : shared ] :
|
$(<)_SHARED = "shared" ;
|
||||||
$(target) ;
|
LibraryShared $(<) : $(objects) : $(options) : $(target) ;
|
||||||
}
|
}
|
||||||
else
|
CFlags $(<) : $(LIBRARY.CFLAGS) ;
|
||||||
{
|
LFlags $(<) : $(LIBRARY.LFLAGS) ;
|
||||||
$(<)_SHARED = "shared" ;
|
|
||||||
LibraryShared $(<) : $(objects) : $(options) : $(target) ;
|
# create target clean rule
|
||||||
}
|
Always $(<)clean ;
|
||||||
CFlags $(<) : $(LIBRARY.CFLAGS) ;
|
NotFile $(<)clean ;
|
||||||
LFlags $(<) : $(LIBRARY.LFLAGS) ;
|
Clean $(<)clean : $(objects) $($(<)_CLEANEXTRA) ;
|
||||||
|
Clean clean : $($(<)_CLEANEXTRA) ;
|
||||||
if ! [ IsElem nohelp : $(options) ]
|
|
||||||
{
|
if ! [ IsElem nohelp : $(options) ]
|
||||||
local desc = [ Description $(<) ] ;
|
{
|
||||||
if ! $(desc) { desc = "$(<) library" ; }
|
local desc = [ Description $(<) ] ;
|
||||||
Help $(<) : "Build the $(desc)" ;
|
if ! $(desc) { desc = "$(<) library" ; }
|
||||||
}
|
Help $(<) : "Build the $(desc)" ;
|
||||||
|
}
|
||||||
if ! [ IsElem notest : $(options) ]
|
|
||||||
{
|
if ! [ IsElem notest : $(options) ]
|
||||||
UnitTest $(<) ;
|
{
|
||||||
}
|
UnitTest $(<) ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
## LibDepends libname : dependant libraries
|
|
||||||
## Make Library dependant on other libraries. This will tell the build
|
## LibDepends libname : dependant libraries
|
||||||
## system that your library uses functions from other libraries in the
|
## Make Library dependant on other libraries. This will tell the build
|
||||||
## project. Note that a library shouldn't be linked with any external
|
## system that your library uses functions from other libraries in the
|
||||||
## library that should be done by the final application which uses the
|
## project. Note that a library shouldn't be linked with any external
|
||||||
## library.
|
## library that should be done by the final application which uses the
|
||||||
rule LibDepends
|
## library.
|
||||||
{
|
rule LibDepends
|
||||||
$(<)_depends += $(>) ;
|
{
|
||||||
|
$(<)_depends += $(>) ;
|
||||||
if "$($(<)_SHARED)"
|
|
||||||
{
|
if "$($(<)_SHARED)"
|
||||||
LinkWith $(<) : $(>) ;
|
{
|
||||||
}
|
LinkWith $(<) : $(>) ;
|
||||||
|
}
|
||||||
UnitTestLibDepends $(<) : $(>) ;
|
|
||||||
}
|
UnitTestLibDepends $(<) : $(>) ;
|
||||||
|
}
|
||||||
#----------------------------------------------------------------------------
|
|
||||||
# private part
|
#----------------------------------------------------------------------------
|
||||||
|
# private part
|
||||||
# LibraryStatic libname : sources : options : decoratedtarget
|
|
||||||
rule LibraryStatic
|
# LibraryStatic libname : sources : options : decoratedtarget
|
||||||
{
|
rule LibraryStatic
|
||||||
local objects = $(>) ;
|
{
|
||||||
local options = $(3) ;
|
local objects = $(>) ;
|
||||||
local target = $(4) ;
|
local options = $(3) ;
|
||||||
|
local target = $(4) ;
|
||||||
# Set LOCATE for the library and its contents. The bound
|
|
||||||
# value shows up as $(NEEDLIBS) on the Link actions.
|
# Set LOCATE for the library and its contents. The bound
|
||||||
# For compatibility, we only do this if the library doesn't
|
# value shows up as $(NEEDLIBS) on the Link actions.
|
||||||
# already have a path.
|
# For compatibility, we only do this if the library doesn't
|
||||||
if ! $(target:D)
|
# already have a path.
|
||||||
{
|
if ! $(target:D)
|
||||||
MakeLocate $(target) $(target)($(objects:BS)) : $(LOCATE.OBJECTS)/libs ;
|
{
|
||||||
}
|
MakeLocate $(target) $(target)($(objects:BS)) : $(LOCATE.OBJECTS)/libs ;
|
||||||
|
}
|
||||||
if $(NOARSCAN)
|
|
||||||
{
|
if $(NOARSCAN)
|
||||||
# If we can't scan the library to timestamp its contents,
|
{
|
||||||
# we have to just make the library depend directly on the
|
# If we can't scan the library to timestamp its contents,
|
||||||
# on-disk object files.
|
# we have to just make the library depend directly on the
|
||||||
Depends $(target) : $(objects) ;
|
# on-disk object files.
|
||||||
}
|
Depends $(target) : $(objects) ;
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
# If we can scan the library, we make the library depend
|
{
|
||||||
# on its members and each member depend on the on-disk
|
# If we can scan the library, we make the library depend
|
||||||
# object file.
|
# on its members and each member depend on the on-disk
|
||||||
Depends $(target) : $(target)($(objects:BS)) ;
|
# object file.
|
||||||
|
Depends $(target) : $(target)($(objects:BS)) ;
|
||||||
local i ;
|
|
||||||
for i in $(objects)
|
local i ;
|
||||||
{
|
for i in $(objects)
|
||||||
Depends $(target)($(i:BS)) : $(i) ;
|
{
|
||||||
}
|
Depends $(target)($(i:BS)) : $(i) ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
# Generate install rules
|
|
||||||
if ! [ IsElem noinstall : $(options) ]
|
# Generate install rules
|
||||||
{
|
if ! [ IsElem noinstall : $(options) ]
|
||||||
if "$(RANLIB)"
|
{
|
||||||
{
|
if "$(RANLIB)"
|
||||||
Depends install_lib : [ DoInstall $(target) : $(libdir) : : Ranlib ] ;
|
{
|
||||||
}
|
Depends install_lib : [ DoInstall $(target) : $(libdir) : : Ranlib ] ;
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
Depends install_lib : [ DoInstall $(target) : $(libdir) ] ;
|
{
|
||||||
}
|
Depends install_lib : [ DoInstall $(target) : $(libdir) ] ;
|
||||||
|
}
|
||||||
# Add to global library list
|
|
||||||
if [ IsElem optional : $(options) ]
|
# Add to global library list
|
||||||
{
|
if [ IsElem optional : $(options) ]
|
||||||
INSTALLEDLIBS_OPTIONAL += $(<) ;
|
{
|
||||||
}
|
INSTALLEDLIBS_OPTIONAL += $(<) ;
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
INSTALLEDLIBS += $(<) ;
|
{
|
||||||
}
|
INSTALLEDLIBS += $(<) ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if $(CRELIB)
|
|
||||||
{
|
if $(CRELIB)
|
||||||
CreLib $(target) : $(objects[1]) ;
|
{
|
||||||
}
|
CreLib $(target) : $(objects[1]) ;
|
||||||
|
}
|
||||||
Archive $(target) : $(objects) ;
|
|
||||||
Clean $(<)clean : $(target) ;
|
Archive $(target) : $(objects) ;
|
||||||
Depends clean : $(<)clean ;
|
|
||||||
|
if $(RANLIB)
|
||||||
if $(RANLIB)
|
{
|
||||||
{
|
Ranlib $(target) ;
|
||||||
Ranlib $(target) ;
|
}
|
||||||
}
|
|
||||||
|
# If we can't scan the library, we have to leave the .o's around.
|
||||||
# If we can't scan the library, we have to leave the .o's around.
|
if ! ( $(NOARSCAN) || $(NOARUPDATE) || $(KEEPOBJS) )
|
||||||
if ! ( $(NOARSCAN) || $(NOARUPDATE) || $(KEEPOBJS) )
|
{
|
||||||
{
|
RmTemps $(target) : $(objects) ;
|
||||||
RmTemps $(target) : $(objects) ;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
# LibraryStatic libname : sources : options : decoratedtarget
|
||||||
# LibraryStatic libname : sources : options : decoratedtarget
|
rule LibraryShared
|
||||||
rule LibraryShared
|
{
|
||||||
{
|
local objects = $(>) ;
|
||||||
local objects = $(>) ;
|
local options = $(3) ;
|
||||||
local options = $(3) ;
|
local target = $(4) ;
|
||||||
local target = $(4) ;
|
local linklib = [ ConstructSharedLibraryLinkLib $(<) : $(options) ] ;
|
||||||
local linklib = [ ConstructSharedLibraryLinkLib $(<) : $(options) ] ;
|
local deplibs ;
|
||||||
local deplibs ;
|
|
||||||
|
local i ;
|
||||||
local i ;
|
for i in $(LIBDEPENDS)
|
||||||
for i in $(LIBDEPENDS)
|
{
|
||||||
{
|
deplibs += [ ConstructLibraryLinkTarget $(i) : $(options) ] ;
|
||||||
deplibs += [ ConstructLibraryLinkTarget $(i) : $(options) ] ;
|
}
|
||||||
}
|
|
||||||
|
# Generate install rules
|
||||||
# Generate install rules
|
if ! [ IsElem noinstall : $(options) ]
|
||||||
if ! [ IsElem noinstall : $(options) ]
|
{
|
||||||
{
|
if $(TARGET.OS) != WIN32
|
||||||
if $(TARGET.OS) != WIN32
|
{
|
||||||
{
|
Depends install_lib : [ DoInstall $(target) : $(libdir) ] ;
|
||||||
Depends install_lib : [ DoInstall $(target) : $(libdir) ] ;
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
Depends install_lib : [ DoInstall $(target) : $(bindir) ] ;
|
||||||
Depends install_lib : [ DoInstall $(target) : $(bindir) ] ;
|
Depends install_lib : [ DoInstall $(linklib) : $(libdir) ] ;
|
||||||
Depends install_lib : [ DoInstall $(linklib) : $(libdir) ] ;
|
}
|
||||||
}
|
|
||||||
|
# Add to global library list
|
||||||
# Add to global library list
|
if [ IsElem optional : $(options) ]
|
||||||
if [ IsElem optional : $(options) ]
|
{
|
||||||
{
|
INSTALLEDLIBS_OPTIONAL += $(<) ;
|
||||||
INSTALLEDLIBS_OPTIONAL += $(<) ;
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
INSTALLEDLIBS += $(<) ;
|
||||||
INSTALLEDLIBS += $(<) ;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Depends $(<) : $(linklib) ;
|
||||||
Depends $(<) : $(linklib) ;
|
if $(linklib) != $(target)
|
||||||
if $(linklib) != $(target)
|
{
|
||||||
{
|
Depends $(linklib) : $(target) ;
|
||||||
Depends $(linklib) : $(target) ;
|
MakeLocate $(linklib) : $(LOCATE.OBJECTS)/libs ;
|
||||||
MakeLocate $(linklib) : $(LOCATE.OBJECTS)/libs ;
|
SEARCH on $(linklib) = $(LOCATE.OBJECTS)/libs ;
|
||||||
SEARCH on $(linklib) = $(LOCATE.OBJECTS)/libs ;
|
}
|
||||||
}
|
Depends $(target) : $(objects) ;
|
||||||
Depends $(target) : $(objects) ;
|
$(<)_CLEANEXTRA += $(target) ;
|
||||||
Clean $(<)clean : $(linklib) $(target) ;
|
Depends $(target) : $(deplibs) ;
|
||||||
Depends clean : $(<)clean ;
|
|
||||||
Depends $(target) : $(deplibs) ;
|
CFlags $(<) : [ FDefines CS_$(<:U)_LIB ] ;
|
||||||
|
LFlags $(<) : $(LINKLIBS) ;
|
||||||
CFlags $(<) : [ FDefines CS_$(<:U)_LIB ] ;
|
|
||||||
LFlags $(<) : $(LINKLIBS) ;
|
SystemLinkSharedLibrary $(target) : $(objects) $(deplibs) : $(linklib) ;
|
||||||
|
|
||||||
SystemLinkSharedLibrary $(target) : $(objects) $(deplibs) : $(linklib) ;
|
if $(LINK.DEBUG.INFO.SEPARATE) = "yes"
|
||||||
}
|
{
|
||||||
|
local debugfile = [ SplitDebugInfo $(target) ] ;
|
||||||
rule ConstructLibraryTarget
|
$(<)_CLEANEXTRA += $(debugfile) ;
|
||||||
{
|
if ! [ IsElem noinstall : $(options) ]
|
||||||
if ( ! [ IsElem shared : $(>) ] ) || ( $(BUILD_SHARED_LIBS) != "yes" )
|
{
|
||||||
{
|
NoCare $(debugfile) ;
|
||||||
return [ ConstructStaticLibraryTarget $(<) : [ Filter $(>) : shared ] ] ;
|
Depends install_lib : [ DoInstall $(debugfile) : $(libdir) : $(INSTALL_DATA) ] ;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
}
|
||||||
return [ ConstructSharedLibraryTarget $(<) : $(>) ] ;
|
|
||||||
}
|
rule ConstructLibraryTarget
|
||||||
}
|
{
|
||||||
|
if ( ! [ IsElem shared : $(>) ] ) || ( $(BUILD_SHARED_LIBS) != "yes" )
|
||||||
rule ConstructLibraryLinkTarget
|
{
|
||||||
{
|
return [ ConstructStaticLibraryTarget $(<) : [ Filter $(>) : shared ] ] ;
|
||||||
if ( ! [ IsElem shared : $(>) ] ) || ( $(BUILD_SHARED_LIBS) != "yes" )
|
}
|
||||||
{
|
else
|
||||||
return [ ConstructStaticLibraryTarget $(<) : [ Filter $(>) : shared ] ] ;
|
{
|
||||||
}
|
return [ ConstructSharedLibraryTarget $(<) : $(>) ] ;
|
||||||
else
|
}
|
||||||
{
|
}
|
||||||
return [ ConstructSharedLibraryLinkLib $(<) : $(>) ] ;
|
|
||||||
}
|
rule ConstructLibraryLinkTarget
|
||||||
}
|
{
|
||||||
|
if ( ! [ IsElem shared : $(>) ] ) || ( $(BUILD_SHARED_LIBS) != "yes" )
|
||||||
actions together Ranlib
|
{
|
||||||
{
|
return [ ConstructStaticLibraryTarget $(<) : [ Filter $(>) : shared ] ] ;
|
||||||
$(RANLIB) $(<)
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
# Construct pseudo target libs which is used instead of the pseudo target lib
|
return [ ConstructSharedLibraryLinkLib $(<) : $(>) ] ;
|
||||||
# in Jambase
|
}
|
||||||
Depends lib : libs ;
|
}
|
||||||
NotFile libs ;
|
|
||||||
Help libs : "Build all link libraries" ;
|
actions together Ranlib
|
||||||
|
{
|
||||||
|
$(RANLIB) $(<)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Construct pseudo target libs which is used instead of the pseudo target lib
|
||||||
|
# in Jambase
|
||||||
|
Depends lib : libs ;
|
||||||
|
NotFile libs ;
|
||||||
|
Help libs : "Build all link libraries" ;
|
||||||
|
|||||||
@@ -1,354 +1,354 @@
|
|||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Jam configuration and actions for MacOS/X
|
# Jam configuration and actions for MacOS/X
|
||||||
# Copyright (C) 2003-2005 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C) 2003-2005 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
SHELL ?= "/bin/sh" ;
|
SHELL ?= "/bin/sh" ;
|
||||||
|
|
||||||
MACOSX_ENVIRONMENT = "export MACOSX_DEPLOYMENT_TARGET=10.2" ;
|
MACOSX_ENVIRONMENT = "export MACOSX_DEPLOYMENT_TARGET=10.2" ;
|
||||||
PLUGIN.LFLAGS += "-bundle" ;
|
PLUGIN.LFLAGS += "-bundle" ;
|
||||||
# We use the ugly -Wl form, which does not contain embedded whitespace (unlike
|
# We use the ugly -Wl form, which does not contain embedded whitespace (unlike
|
||||||
# "-framework AppKit"), to help external projects which use the result of
|
# "-framework AppKit"), to help external projects which use the result of
|
||||||
# "cs-config --libs" in conjunction with GNU libtool, since libtool likes to
|
# "cs-config --libs" in conjunction with GNU libtool, since libtool likes to
|
||||||
# re-arrange arguments, not realizing that "-framwork" and "AppKit" need to
|
# re-arrange arguments, not realizing that "-framwork" and "AppKit" need to
|
||||||
# stay together.
|
# stay together.
|
||||||
LINKLIBS += "-Wl,-framework,AppKit" "-Wl,-framework,Foundation" ;
|
LINKLIBS += "-Wl,-framework,AppKit" "-Wl,-framework,Foundation" ;
|
||||||
|
|
||||||
# Jambase in Jam 2.4 has a bug where it incorrectly defines RANLIB as "" for
|
# Jambase in Jam 2.4 has a bug where it incorrectly defines RANLIB as "" for
|
||||||
# MacOS/X, and this bogus value will override a RANLIB set via ?= in Jamconfig,
|
# MacOS/X, and this bogus value will override a RANLIB set via ?= in Jamconfig,
|
||||||
# by a configure script, thus we must give RANLIB an appropriate value here if
|
# by a configure script, thus we must give RANLIB an appropriate value here if
|
||||||
# we find that it has the bogus value. Jam 2.5 does not contain this bug.
|
# we find that it has the bogus value. Jam 2.5 does not contain this bug.
|
||||||
# Furthermore, MacOS/X Panther expects us to use the -s option with ranlib.
|
# Furthermore, MacOS/X Panther expects us to use the -s option with ranlib.
|
||||||
if ! $(RANLIB) { RANLIB = "ranlib" ; }
|
if ! $(RANLIB) { RANLIB = "ranlib" ; }
|
||||||
RANLIB += "-s" ;
|
RANLIB += "-s" ;
|
||||||
|
|
||||||
# Experience seems to indicate that library scanning misbehaves on MacOS/X with
|
# Experience seems to indicate that library scanning misbehaves on MacOS/X with
|
||||||
# Jam 2.4, consequently we disable it.
|
# Jam 2.4, consequently we disable it.
|
||||||
NOARSCAN = true ;
|
NOARSCAN = true ;
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Public rules.
|
# Public rules.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# ConstructApplicationTarget target : options
|
# ConstructApplicationTarget target : options
|
||||||
# Constructs the application target name.
|
# Constructs the application target name.
|
||||||
rule ConstructApplicationTarget
|
rule ConstructApplicationTarget
|
||||||
{
|
{
|
||||||
return $(<) ;
|
return $(<) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# ConstructStaticLibraryTarget target : options
|
# ConstructStaticLibraryTarget target : options
|
||||||
# Constructs the static library target name.
|
# Constructs the static library target name.
|
||||||
rule ConstructStaticLibraryTarget
|
rule ConstructStaticLibraryTarget
|
||||||
{
|
{
|
||||||
return lib$(<)$(SUFLIB) ;
|
return lib$(<)$(SUFLIB) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# ConstructSharedLibraryTarget target : options
|
# ConstructSharedLibraryTarget target : options
|
||||||
# Constructs the shared library target name.
|
# Constructs the shared library target name.
|
||||||
rule ConstructSharedLibraryTarget
|
rule ConstructSharedLibraryTarget
|
||||||
{
|
{
|
||||||
return lib$(<).$(PACKAGE_VERSION).dylib ;
|
return lib$(<).$(PACKAGE_VERSION).dylib ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# ConstructSharedLibraryLinkLib target : options
|
# ConstructSharedLibraryLinkLib target : options
|
||||||
# Constructs the name of a shared library against which some other target
|
# Constructs the name of a shared library against which some other target
|
||||||
# links.
|
# links.
|
||||||
rule ConstructSharedLibraryLinkLib
|
rule ConstructSharedLibraryLinkLib
|
||||||
{
|
{
|
||||||
return lib$(<).$(PACKAGE_VERSION).dylib ;
|
return lib$(<).$(PACKAGE_VERSION).dylib ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# ConstructPluginTarget target : options
|
# ConstructPluginTarget target : options
|
||||||
# Constructs the plugin target name.
|
# Constructs the plugin target name.
|
||||||
rule ConstructPluginTarget
|
rule ConstructPluginTarget
|
||||||
{
|
{
|
||||||
return $(<).csbundle ;
|
return $(<).csbundle ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# SystemLinkApplication target : objects : options
|
# SystemLinkApplication target : objects : options
|
||||||
# Apply appropriate rule to link the application based upon the options.
|
# Apply appropriate rule to link the application based upon the options.
|
||||||
rule SystemLinkApplication
|
rule SystemLinkApplication
|
||||||
{
|
{
|
||||||
local target = $($(<)_TARGET) ;
|
local target = $($(<)_TARGET) ;
|
||||||
Depends $(target) : $(>) ;
|
Depends $(target) : $(>) ;
|
||||||
if [ IsElem console : $(3) ]
|
if [ IsElem console : $(3) ]
|
||||||
{
|
{
|
||||||
LinkApplicationConsole $(target) : $(>) ;
|
LinkApplicationConsole $(target) : $(>) ;
|
||||||
Clean clean : $(target) ;
|
Clean clean : $(target) ;
|
||||||
Clean $(<)clean : $(target) ;
|
Clean $(<)clean : $(target) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CreateApplicationWrapper $(target) : $(>) ;
|
CreateApplicationWrapper $(target) : $(>) ;
|
||||||
CleanDir clean : [ Wrapper $(<) : app ] ;
|
CleanDir clean : [ Wrapper $(<) : app ] ;
|
||||||
CleanDir $(<)clean : [ Wrapper $(<) : app ] ;
|
CleanDir $(<)clean : [ Wrapper $(<) : app ] ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# SystemInstallApplication target : subdirs : options
|
# SystemInstallApplication target : subdirs : options
|
||||||
# Apply appropriate rule to install the application based upon the options.
|
# Apply appropriate rule to install the application based upon the options.
|
||||||
rule SystemInstallApplication
|
rule SystemInstallApplication
|
||||||
{
|
{
|
||||||
if [ IsElem console : $(3) ]
|
if [ IsElem console : $(3) ]
|
||||||
{
|
{
|
||||||
Depends install_bin :
|
Depends install_bin :
|
||||||
[ DoInstall $(<) : $(bindir) $(2) : $(INSTALL_PROGRAM) ] ;
|
[ DoInstall $(<) : $(bindir) $(2) : $(INSTALL_PROGRAM) ] ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
InstallApplicationGUI $(<) : $(bindir) $(2) ;
|
InstallApplicationGUI $(<) : $(bindir) $(2) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# SystemInstallPlugin target : subdirs : options
|
# SystemInstallPlugin target : subdirs : options
|
||||||
# Apply appropriate rule to install the plugin based upon the options.
|
# Apply appropriate rule to install the plugin based upon the options.
|
||||||
rule SystemInstallPlugin
|
rule SystemInstallPlugin
|
||||||
{
|
{
|
||||||
Depends install_plugin :
|
Depends install_plugin :
|
||||||
[ DoInstall $(<) : $(plugindir) $(2) : $(INSTALL_PROGRAM) ] ;
|
[ DoInstall $(<) : $(plugindir) $(2) : $(INSTALL_PROGRAM) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# SystemLinkPlugin target : objects : options
|
# SystemLinkPlugin target : objects : options
|
||||||
# Link a plugin module and handle meta-data appropriately.
|
# Link a plugin module and handle meta-data appropriately.
|
||||||
rule SystemLinkPlugin
|
rule SystemLinkPlugin
|
||||||
{
|
{
|
||||||
local target = $($(<)_TARGET) ;
|
local target = $($(<)_TARGET) ;
|
||||||
Depends $(target) : $(>) ;
|
Depends $(target) : $(>) ;
|
||||||
LinkPlugin $(target) : $(>) ;
|
LinkPlugin $(target) : $(>) ;
|
||||||
PluginMetaData $(<) : $($(<)_METAFILE) : $(3) ;
|
PluginMetaData $(<) : $($(<)_METAFILE) : $(3) ;
|
||||||
Clean clean : $(target) ;
|
Clean clean : $(target) ;
|
||||||
Clean $(<)clean : $(target) ;
|
Clean $(<)clean : $(target) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# LinkPlugin plugin : objects
|
# LinkPlugin plugin : objects
|
||||||
# Link a plugin module from a set of object files.
|
# Link a plugin module from a set of object files.
|
||||||
actions LinkPlugin bind NEEDLIBS bind EXTRAOBJECTS
|
actions LinkPlugin bind NEEDLIBS bind EXTRAOBJECTS
|
||||||
{
|
{
|
||||||
$(MACOSX_ENVIRONMENT)
|
$(MACOSX_ENVIRONMENT)
|
||||||
$(CMD.LINK) -bundle -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
|
$(CMD.LINK) -bundle -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
|
||||||
}
|
}
|
||||||
|
|
||||||
# LinkApplicationConsole exe : objects
|
# LinkApplicationConsole exe : objects
|
||||||
# Link a console (non-GUI) appliation from a set of object files.
|
# Link a console (non-GUI) appliation from a set of object files.
|
||||||
actions LinkApplicationConsole bind NEEDLIBS bind EXTRAOBJECTS
|
actions LinkApplicationConsole bind NEEDLIBS bind EXTRAOBJECTS
|
||||||
{
|
{
|
||||||
$(MACOSX_ENVIRONMENT)
|
$(MACOSX_ENVIRONMENT)
|
||||||
$(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
|
$(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
|
||||||
}
|
}
|
||||||
|
|
||||||
# CreateApplicationWrapper basename : objects
|
# CreateApplicationWrapper basename : objects
|
||||||
# Create a complete, though minimal, application wrapper given a set of
|
# Create a complete, though minimal, application wrapper given a set of
|
||||||
# object files. The rules ApplicationIconDefault and ApplicationIcon
|
# object files. The rules ApplicationIconDefault and ApplicationIcon
|
||||||
# control the icon associated with the application wrapper.
|
# control the icon associated with the application wrapper.
|
||||||
rule CreateApplicationWrapper
|
rule CreateApplicationWrapper
|
||||||
{
|
{
|
||||||
WrapFile $(<) : $(<) : Contents MacOS : AppExe : $(>) ;
|
WrapFile $(<) : $(<) : Contents MacOS : AppExe : $(>) ;
|
||||||
WrapFile $(<) : PkgInfo : Contents : AppPkgInfo : $(>) ;
|
WrapFile $(<) : PkgInfo : Contents : AppPkgInfo : $(>) ;
|
||||||
WrapFile $(<) : version.plist : Contents : AppVersionPlist : $(>) ;
|
WrapFile $(<) : version.plist : Contents : AppVersionPlist : $(>) ;
|
||||||
WrapFile $(<) : Info.plist : Contents : AppInfoPlist : $(>) ;
|
WrapFile $(<) : Info.plist : Contents : AppInfoPlist : $(>) ;
|
||||||
WrapFile $(<) : InfoPlist.strings : Contents Resources English.lproj :
|
WrapFile $(<) : InfoPlist.strings : Contents Resources English.lproj :
|
||||||
AppInfoPlistStrings : $(>) ;
|
AppInfoPlistStrings : $(>) ;
|
||||||
|
|
||||||
local icon = [ ApplicationIcon macosx : $(<) ] ;
|
local icon = [ ApplicationIcon macosx : $(<) ] ;
|
||||||
if ! $(icon)
|
if ! $(icon)
|
||||||
{
|
{
|
||||||
local apptype = gui ;
|
local apptype = gui ;
|
||||||
if [ IsElem console : $(>) ] { apptype = console ; }
|
if [ IsElem console : $(>) ] { apptype = console ; }
|
||||||
icon = [ ApplicationIconDefault macosx : $(apptype) ] ;
|
icon = [ ApplicationIconDefault macosx : $(apptype) ] ;
|
||||||
}
|
}
|
||||||
if $(icon)
|
if $(icon)
|
||||||
{
|
{
|
||||||
$(<)_APPICON = $(icon) ;
|
$(<)_APPICON = $(icon) ;
|
||||||
AppIcon $(<) : $(icon) ;
|
AppIcon $(<) : $(icon) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Wrapper basename : suffix [ : pathcomponents ]
|
# Wrapper basename : suffix [ : pathcomponents ]
|
||||||
# Returns wrapper name in the directory specified by pathcomponents for
|
# Returns wrapper name in the directory specified by pathcomponents for
|
||||||
# the given basename. If pathcomponents is omitted, LOCATE.TARGETS is
|
# the given basename. If pathcomponents is omitted, LOCATE.TARGETS is
|
||||||
# used.
|
# used.
|
||||||
rule Wrapper
|
rule Wrapper
|
||||||
{
|
{
|
||||||
local dir ;
|
local dir ;
|
||||||
if $(3) { dir = [ FDirName $(3) ] ; }
|
if $(3) { dir = [ FDirName $(3) ] ; }
|
||||||
else { dir = $(LOCATE.TARGETS) ; }
|
else { dir = $(LOCATE.TARGETS) ; }
|
||||||
return [ FDirName $(dir) $(1).$(2) ] ;
|
return [ FDirName $(dir) $(1).$(2) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# WrapFile basename : file : pathcomponents : rule [ : objects : [ suffix ] ]
|
# WrapFile basename : file : pathcomponents : rule [ : objects : [ suffix ] ]
|
||||||
# Generate a file within a wrapper. pathcomponents is a list of names
|
# Generate a file within a wrapper. pathcomponents is a list of names
|
||||||
# which compose the relative path within the wrapper where file should be
|
# which compose the relative path within the wrapper where file should be
|
||||||
# placed. pathcomponents may be the empty list if the file should reside
|
# placed. pathcomponents may be the empty list if the file should reside
|
||||||
# at the top-level of the wrapper. rule is rule/action which should be
|
# at the top-level of the wrapper. rule is rule/action which should be
|
||||||
# invoked to generate file. rule is invoked with arguments
|
# invoked to generate file. rule is invoked with arguments
|
||||||
# <basename.suffix/pathcomponents/file>, <objects>, and <basename>.
|
# <basename.suffix/pathcomponents/file>, <objects>, and <basename>.
|
||||||
# objects is an optional list of files from which file should be built. It
|
# objects is an optional list of files from which file should be built. It
|
||||||
# may be omitted if file does not depend upon any other files. suffix is
|
# may be omitted if file does not depend upon any other files. suffix is
|
||||||
# the extension of the wrapper (not of file). If suffix is omitted, "app"
|
# the extension of the wrapper (not of file). If suffix is omitted, "app"
|
||||||
# is assumed.
|
# is assumed.
|
||||||
#
|
#
|
||||||
# Implementation note: If basename and file are the same, then we do not
|
# Implementation note: If basename and file are the same, then we do not
|
||||||
# grist file. (Obviously, we also do not want to set the file dependent
|
# grist file. (Obviously, we also do not want to set the file dependent
|
||||||
# upon itself.) The reason we do not grist file in this case is that the
|
# upon itself.) The reason we do not grist file in this case is that the
|
||||||
# LinkWith, and LFlags rules associate the variables NEEDLIBS and
|
# LinkWith, and LFlags rules associate the variables NEEDLIBS and
|
||||||
# LINKLIBS with the ungristed name, therefore in order to get access to
|
# LINKLIBS with the ungristed name, therefore in order to get access to
|
||||||
# these variables at AppExe action time, we must use the same (ungristed)
|
# these variables at AppExe action time, we must use the same (ungristed)
|
||||||
# name. It is otherwise impossible to gain access to those variables.
|
# name. It is otherwise impossible to gain access to those variables.
|
||||||
# This is an unfortunate hack which pollutes the otherwise general-purpose
|
# This is an unfortunate hack which pollutes the otherwise general-purpose
|
||||||
# WrapFile rule.
|
# WrapFile rule.
|
||||||
rule WrapFile
|
rule WrapFile
|
||||||
{
|
{
|
||||||
local suffix ;
|
local suffix ;
|
||||||
if $(6) { suffix = $(6) ; } else { suffix = app ; }
|
if $(6) { suffix = $(6) ; } else { suffix = app ; }
|
||||||
local target = $(2) ;
|
local target = $(2) ;
|
||||||
if $(target) != $(1)
|
if $(target) != $(1)
|
||||||
{
|
{
|
||||||
target = $(target:G=$(1)) ;
|
target = $(target:G=$(1)) ;
|
||||||
Depends $(1) : $(target) ;
|
Depends $(1) : $(target) ;
|
||||||
}
|
}
|
||||||
local dir = [ FDirName [ Wrapper $(1) : $(suffix) ] $(3) ] ;
|
local dir = [ FDirName [ Wrapper $(1) : $(suffix) ] $(3) ] ;
|
||||||
MakeLocate $(target) : $(dir) ;
|
MakeLocate $(target) : $(dir) ;
|
||||||
if $(5) { Depends $(target) : $(5) ; }
|
if $(5) { Depends $(target) : $(5) ; }
|
||||||
BASENAME on $(target) = $(1) ;
|
BASENAME on $(target) = $(1) ;
|
||||||
$(4) $(target) : $(5) : $(1) ;
|
$(4) $(target) : $(5) : $(1) ;
|
||||||
|
|
||||||
Clean clean : [ FDirName $(dir) $(target) ] ;
|
Clean clean : [ FDirName $(dir) $(target) ] ;
|
||||||
Clean $(1)clean : [ FDirName $(dir) $(target) ] ;
|
Clean $(1)clean : [ FDirName $(dir) $(target) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# LinkApplication exe : objects
|
# LinkApplication exe : objects
|
||||||
actions AppExe bind NEEDLIBS bind EXTRAOBJECTS
|
actions AppExe bind NEEDLIBS bind EXTRAOBJECTS
|
||||||
{
|
{
|
||||||
$(MACOSX_ENVIRONMENT)
|
$(MACOSX_ENVIRONMENT)
|
||||||
$(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
|
$(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
|
||||||
}
|
}
|
||||||
|
|
||||||
# AppPkgInfo file
|
# AppPkgInfo file
|
||||||
actions AppPkgInfo
|
actions AppPkgInfo
|
||||||
{
|
{
|
||||||
echo 'APPL????' > $(<) ;
|
echo 'APPL????' > $(<) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# AppInfoPlistStrings file
|
# AppInfoPlistStrings file
|
||||||
actions AppInfoPlistStrings
|
actions AppInfoPlistStrings
|
||||||
{
|
{
|
||||||
cat << EOT > $(<)
|
cat << EOT > $(<)
|
||||||
CFBundleName = "$(BASENAME)";
|
CFBundleName = "$(BASENAME)";
|
||||||
CFBundleShortVersionString = "$(PACKAGE_VERSION)";
|
CFBundleShortVersionString = "$(PACKAGE_VERSION)";
|
||||||
CFBundleGetInfoString = "$(BASENAME), $(PACKAGE_VERSION)";
|
CFBundleGetInfoString = "$(BASENAME), $(PACKAGE_VERSION)";
|
||||||
EOT
|
EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
# AppVersionPlist file
|
# AppVersionPlist file
|
||||||
actions AppVersionPlist
|
actions AppVersionPlist
|
||||||
{
|
{
|
||||||
cat << EOT > $(<)
|
cat << EOT > $(<)
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
|
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
|
||||||
<plist version="0.9">
|
<plist version="0.9">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>$(PACKAGE_VERSION)</string>
|
<string>$(PACKAGE_VERSION)</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>$(PACKAGE_VERSION)</string>
|
<string>$(PACKAGE_VERSION)</string>
|
||||||
<key>ProjectName</key>
|
<key>ProjectName</key>
|
||||||
<string>$(BASENAME)</string>
|
<string>$(BASENAME)</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
EOT
|
EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
# AppInfoPlist filename : placeholder : basename
|
# AppInfoPlist filename : placeholder : basename
|
||||||
# Implementation Note: $(BASENAME)_APPICON might be empty in the actions of
|
# Implementation Note: $(BASENAME)_APPICON might be empty in the actions of
|
||||||
# this rule, if the client did not specify a default icon or a
|
# this rule, if the client did not specify a default icon or a
|
||||||
# target-specific icon, in which case we need to omit both the
|
# target-specific icon, in which case we need to omit both the
|
||||||
# CFBundleIconFile key and value. To accomplish this, the key and value
|
# CFBundleIconFile key and value. To accomplish this, the key and value
|
||||||
# are placed on a single line with no intervening whitespace. When Jam
|
# are placed on a single line with no intervening whitespace. When Jam
|
||||||
# interpolates a variable, if the variable is empty, it removes all
|
# interpolates a variable, if the variable is empty, it removes all
|
||||||
# adjacent text (the key and value, in this case) which is just what we
|
# adjacent text (the key and value, in this case) which is just what we
|
||||||
# desire.
|
# desire.
|
||||||
actions AppInfoPlist
|
actions AppInfoPlist
|
||||||
{
|
{
|
||||||
cat << EOT > $(<)
|
cat << EOT > $(<)
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
|
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
|
||||||
<plist version="0.9">
|
<plist version="0.9">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>English</string>
|
<string>English</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>$(BASENAME)</string>
|
<string>$(BASENAME)</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>$(BASENAME)</string>
|
<string>$(BASENAME)</string>
|
||||||
<key>CFBundleIconFile</key><string>$($(BASENAME)_APPICON)</string>
|
<key>CFBundleIconFile</key><string>$($(BASENAME)_APPICON)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>0</string>
|
<string>0</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>$(PACKAGE_VERSION)</string>
|
<string>$(PACKAGE_VERSION)</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string>NSApplication</string>
|
<string>NSApplication</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
EOT
|
EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
# AppIcon <basename> : <icon>
|
# AppIcon <basename> : <icon>
|
||||||
# Copy an icon into the wrapper. It is assumed that some other agent has
|
# Copy an icon into the wrapper. It is assumed that some other agent has
|
||||||
# already set SEARCH on the icon, if necessary.
|
# already set SEARCH on the icon, if necessary.
|
||||||
rule AppIcon
|
rule AppIcon
|
||||||
{
|
{
|
||||||
local icon = $(>:G=$(<)) ;
|
local icon = $(>:G=$(<)) ;
|
||||||
Depends $(<) : $(icon) ;
|
Depends $(<) : $(icon) ;
|
||||||
Depends $(icon) : $(>) ;
|
Depends $(icon) : $(>) ;
|
||||||
MakeLocate $(icon) :
|
MakeLocate $(icon) :
|
||||||
[ FDirName [ Wrapper $(<) : app ] Contents Resources ] ;
|
[ FDirName [ Wrapper $(<) : app ] Contents Resources ] ;
|
||||||
Copy $(icon) : $(>) ;
|
Copy $(icon) : $(>) ;
|
||||||
Clean clean : $(icon) ;
|
Clean clean : $(icon) ;
|
||||||
Clean $(<)clean : $(icon) ;
|
Clean $(<)clean : $(icon) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# InstallApplicationGUI app : installdirs
|
# InstallApplicationGUI app : installdirs
|
||||||
# Install a GUI application. Unlike applications on other platforms which
|
# Install a GUI application. Unlike applications on other platforms which
|
||||||
# exist as a single executable file, on MacOS/X, an application is wrapped
|
# exist as a single executable file, on MacOS/X, an application is wrapped
|
||||||
# in a directory hierarchy, thus a deep copy is needed (i.e. the typical
|
# in a directory hierarchy, thus a deep copy is needed (i.e. the typical
|
||||||
# Install rule does not work).
|
# Install rule does not work).
|
||||||
rule InstallApplicationGUI
|
rule InstallApplicationGUI
|
||||||
{
|
{
|
||||||
local wrapper = $(<).app ;
|
local wrapper = $(<).app ;
|
||||||
Depends $(wrapper) : $(<) ;
|
Depends $(wrapper) : $(<) ;
|
||||||
SEARCH on $(wrapper) = $(LOCATE.TARGETS) ;
|
SEARCH on $(wrapper) = $(LOCATE.TARGETS) ;
|
||||||
|
|
||||||
# Yuck! Internal knowledge of how DoInstall composes 'dir' and 'target'.
|
# Yuck! Internal knowledge of how DoInstall composes 'dir' and 'target'.
|
||||||
local dir = [ ConcatDirs $(DESTDIR) $(2) ] ;
|
local dir = [ ConcatDirs $(DESTDIR) $(2) ] ;
|
||||||
local target = $(wrapper:BSR=$(dir):G=install) ;
|
local target = $(wrapper:BSR=$(dir):G=install) ;
|
||||||
|
|
||||||
InstallApplicationWrapperPrepare $(target) ;
|
InstallApplicationWrapperPrepare $(target) ;
|
||||||
Depends install_bin :
|
Depends install_bin :
|
||||||
[ DoInstall $(wrapper) : $(2) : "$(DEEPCOPY)" ] ;
|
[ DoInstall $(wrapper) : $(2) : "$(DEEPCOPY)" ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
actions InstallApplicationWrapperPrepare
|
actions InstallApplicationWrapperPrepare
|
||||||
{
|
{
|
||||||
$(DELTREE) $(<) ;
|
$(DELTREE) $(<) ;
|
||||||
}
|
}
|
||||||
|
|||||||
3110
mk/jam/msvcgen.jam
3110
mk/jam/msvcgen.jam
File diff suppressed because it is too large
Load Diff
@@ -1,80 +1,80 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for compiling Objective-C and Objective-C++ files
|
# Rules for compiling Objective-C and Objective-C++ files
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
if $(CMD.OBJC)
|
if $(CMD.OBJC)
|
||||||
{
|
{
|
||||||
|
|
||||||
rule ObjCRule
|
rule ObjCRule
|
||||||
{
|
{
|
||||||
local object = [ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
|
local object = [ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
|
||||||
ObjC $(object) : $(<) ;
|
ObjC $(object) : $(<) ;
|
||||||
return $(object) ;
|
return $(object) ;
|
||||||
}
|
}
|
||||||
RegisterFileType ObjCRule : .m ;
|
RegisterFileType ObjCRule : .m ;
|
||||||
RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .m ;
|
RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .m ;
|
||||||
|
|
||||||
rule ObjC
|
rule ObjC
|
||||||
{
|
{
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) ;
|
||||||
|
|
||||||
CCFLAGS on $(<) += $(CCFLAGS) $(SUBDIRCCFLAGS) ;
|
CCFLAGS on $(<) += $(CCFLAGS) $(SUBDIRCCFLAGS) ;
|
||||||
OBJCFLAGS on $(<) += $(OBJCFLAGS) ;
|
OBJCFLAGS on $(<) += $(OBJCFLAGS) ;
|
||||||
CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
|
CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
|
||||||
CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
|
CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
actions ObjC
|
actions ObjC
|
||||||
{
|
{
|
||||||
$(CMD.OBJC) -c -o $(<) $(CCHDRS) $(CCFLAGS) $(OBJCFLAGS) $(CCDEFS) $(>)
|
$(CMD.OBJC) -c -o $(<) $(CCHDRS) $(CCFLAGS) $(OBJCFLAGS) $(CCDEFS) $(>)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $(CMD.OBJC++)
|
if $(CMD.OBJC++)
|
||||||
{
|
{
|
||||||
rule ObjC++Rule
|
rule ObjC++Rule
|
||||||
{
|
{
|
||||||
local object = [ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
|
local object = [ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
|
||||||
ObjC++ $(object) : $(<) ;
|
ObjC++ $(object) : $(<) ;
|
||||||
return $(object) ;
|
return $(object) ;
|
||||||
}
|
}
|
||||||
RegisterFileType ObjC++Rule : .mm .M ;
|
RegisterFileType ObjC++Rule : .mm .M ;
|
||||||
RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .mm .M ;
|
RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .mm .M ;
|
||||||
|
|
||||||
rule ObjC++
|
rule ObjC++
|
||||||
{
|
{
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) ;
|
||||||
|
|
||||||
# Ugly hack: Apple's gcc4 does not accept -fvisibility-inlines-hidden in
|
# Ugly hack: Apple's gcc4 does not accept -fvisibility-inlines-hidden in
|
||||||
# Objective-C++ mode. Ideally, this issue should be resolved by the
|
# Objective-C++ mode. Ideally, this issue should be resolved by the
|
||||||
# configure script, but it does not currently distinguish between flags
|
# configure script, but it does not currently distinguish between flags
|
||||||
# intended for the C++ compiler and those intended for the Objective-C++
|
# intended for the C++ compiler and those intended for the Objective-C++
|
||||||
# compiler.
|
# compiler.
|
||||||
local rejects = -fvisibility-inlines-hidden ;
|
local rejects = -fvisibility-inlines-hidden ;
|
||||||
C++FLAGS on $(<) += [ Filter $(C++FLAGS) $(SUBDIRC++FLAGS) : $(rejects) ] ;
|
C++FLAGS on $(<) += [ Filter $(C++FLAGS) $(SUBDIRC++FLAGS) : $(rejects) ] ;
|
||||||
OBJC++FLAGS on $(<) += [ Filter $(OBJC++FLAGS) : $(rejects) ] ;
|
OBJC++FLAGS on $(<) += [ Filter $(OBJC++FLAGS) : $(rejects) ] ;
|
||||||
CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
|
CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
|
||||||
CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
|
CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
actions ObjC++
|
actions ObjC++
|
||||||
{
|
{
|
||||||
$(CMD.OBJC++) -c -o $(<) $(CCHDRS) $(C++FLAGS) $(OBJC++FLAGS) $(CCDEFS) $(>)
|
$(CMD.OBJC++) -c -o $(<) $(CCHDRS) $(C++FLAGS) $(OBJC++FLAGS) $(CCDEFS) $(>)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,250 +1,250 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for compiling a set of sources to object files
|
# Rules for compiling a set of sources to object files
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
# These are slightly modified versions of the Object and Objects rules from
|
# These are slightly modified versions of the Object and Objects rules from
|
||||||
# jam. The problem with the original rules in Jambase is the handling of
|
# jam. The problem with the original rules in Jambase is the handling of
|
||||||
# custom file types. The solution with the UserObject rule is monolithic, you
|
# custom file types. The solution with the UserObject rule is monolithic, you
|
||||||
# can only have 1 such rule. Thus we construct a more flexible toolkit here
|
# can only have 1 such rule. Thus we construct a more flexible toolkit here
|
||||||
# which let's you register rules for certain filetypes.
|
# which let's you register rules for certain filetypes.
|
||||||
|
|
||||||
## RegisterFileType Rulename : extensions
|
## RegisterFileType Rulename : extensions
|
||||||
## Register a rule which is used to compile a filetype into object
|
## Register a rule which is used to compile a filetype into object
|
||||||
## files. The registered rule is called with the name of the
|
## files. The registered rule is called with the name of the
|
||||||
## sourcefile as argument and should return a list of objectfiles which are
|
## sourcefile as argument and should return a list of objectfiles which are
|
||||||
## created. You should set the grist of the object files by using the
|
## created. You should set the grist of the object files by using the
|
||||||
## DoObjectGrist function.
|
## DoObjectGrist function.
|
||||||
rule RegisterFileType
|
rule RegisterFileType
|
||||||
{
|
{
|
||||||
local suffix ;
|
local suffix ;
|
||||||
for suffix in $(>)
|
for suffix in $(>)
|
||||||
{
|
{
|
||||||
FILETYPE_$(suffix) = $(<) ;
|
FILETYPE_$(suffix) = $(<) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
## RegisterHeaderRule rulename : regexpattern : extensions
|
## RegisterHeaderRule rulename : regexpattern : extensions
|
||||||
## Registers a rule and a regular expression which will be used for header
|
## Registers a rule and a regular expression which will be used for header
|
||||||
## file scanning of the specified extensions.
|
## file scanning of the specified extensions.
|
||||||
rule RegisterHeaderRule
|
rule RegisterHeaderRule
|
||||||
{
|
{
|
||||||
local suffix ;
|
local suffix ;
|
||||||
for suffix in $(3)
|
for suffix in $(3)
|
||||||
{
|
{
|
||||||
HDRRULE_$(suffix) = $(<) ;
|
HDRRULE_$(suffix) = $(<) ;
|
||||||
HDRPATTERN_$(suffix) = $(>) ;
|
HDRPATTERN_$(suffix) = $(>) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
## CompileObjects sources [: objectfileprefix]
|
## CompileObjects sources [: objectfileprefix]
|
||||||
## Compile a set of sourcefiles into objectfiles (extension: SUFOBJ,
|
## Compile a set of sourcefiles into objectfiles (extension: SUFOBJ,
|
||||||
## usually .o). This rule takes care of setting the SEARCH and LOCATE
|
## usually .o). This rule takes care of setting the SEARCH and LOCATE
|
||||||
## variables to the values of $(SEARCH_SOURCE) and $(LOCATE_TARGET).
|
## variables to the values of $(SEARCH_SOURCE) and $(LOCATE_TARGET).
|
||||||
## The Application, Plugin and Library rules already use this rule
|
## The Application, Plugin and Library rules already use this rule
|
||||||
## internally. You should only use this rule if you have to avoid the
|
## internally. You should only use this rule if you have to avoid the
|
||||||
## Application, Plugin or Library rules.
|
## Application, Plugin or Library rules.
|
||||||
rule CompileObjects
|
rule CompileObjects
|
||||||
{
|
{
|
||||||
local source ;
|
local source ;
|
||||||
local targets ;
|
local targets ;
|
||||||
|
|
||||||
# Search the source
|
# Search the source
|
||||||
SEARCH on $(<) = $(SEARCH_SOURCE) ;
|
SEARCH on $(<) = $(SEARCH_SOURCE) ;
|
||||||
|
|
||||||
for source in $(<)
|
for source in $(<)
|
||||||
{
|
{
|
||||||
# compile the sourcefile to targetfile
|
# compile the sourcefile to targetfile
|
||||||
targets += [ CompileObject $(source) : $(>) ] ;
|
targets += [ CompileObject $(source) : $(>) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# locate the targets
|
# locate the targets
|
||||||
MakeLocate $(targets) : $(LOCATE_TARGET) ;
|
MakeLocate $(targets) : $(LOCATE_TARGET) ;
|
||||||
|
|
||||||
return $(targets) ;
|
return $(targets) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## PrefixSuffix [prefix] : filename : suffix
|
## PrefixSuffix [prefix] : filename : suffix
|
||||||
## Replaces the suffix of 'filename' with 'suffix' and prepends 'prefix' to
|
## Replaces the suffix of 'filename' with 'suffix' and prepends 'prefix' to
|
||||||
## it.
|
## it.
|
||||||
rule PrefixSuffix
|
rule PrefixSuffix
|
||||||
{
|
{
|
||||||
local prefix = $(1) ;
|
local prefix = $(1) ;
|
||||||
local name = $(2) ;
|
local name = $(2) ;
|
||||||
local suffix = $(3) ;
|
local suffix = $(3) ;
|
||||||
if ! $(prefix) { prefix = "" ; }
|
if ! $(prefix) { prefix = "" ; }
|
||||||
return $(name:B=$(prefix)$(name:B):S=$(suffix)) ;
|
return $(name:B=$(prefix)$(name:B):S=$(suffix)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# private part
|
# private part
|
||||||
|
|
||||||
# helper rule: Compiles a source file to an object file. Does header file
|
# helper rule: Compiles a source file to an object file. Does header file
|
||||||
# scanning, sets LOCATE and SEARCH for source and target, grists the files
|
# scanning, sets LOCATE and SEARCH for source and target, grists the files
|
||||||
# with the current subdir and searches for the correct registered rule.
|
# with the current subdir and searches for the correct registered rule.
|
||||||
rule CompileObject
|
rule CompileObject
|
||||||
{
|
{
|
||||||
# handle #includes for source: Jam scans for headers with
|
# handle #includes for source: Jam scans for headers with
|
||||||
# the regexp pattern $(HDRSCAN) and then invokes $(HDRRULE)
|
# the regexp pattern $(HDRSCAN) and then invokes $(HDRRULE)
|
||||||
# with the scanned file as the target and the found headers
|
# with the scanned file as the target and the found headers
|
||||||
# as the sources. HDRSEARCH is the value of SEARCH used for
|
# as the sources. HDRSEARCH is the value of SEARCH used for
|
||||||
# the found header files. Finally, if jam must deal with
|
# the found header files. Finally, if jam must deal with
|
||||||
# header files of the same name in different directories,
|
# header files of the same name in different directories,
|
||||||
# they can be distinguished with HDRGRIST.
|
# they can be distinguished with HDRGRIST.
|
||||||
|
|
||||||
# $(SEARCH_SOURCE:E) is where cc first looks for #include
|
# $(SEARCH_SOURCE:E) is where cc first looks for #include
|
||||||
# "foo.h" files. If the source file is in a distant directory,
|
# "foo.h" files. If the source file is in a distant directory,
|
||||||
# look there. Else, look in "" (the current directory).
|
# look there. Else, look in "" (the current directory).
|
||||||
if $(HDRRULE_$(<:S))
|
if $(HDRRULE_$(<:S))
|
||||||
{
|
{
|
||||||
HDRSEARCH on $(<) =
|
HDRSEARCH on $(<) =
|
||||||
$(SEARCH_SOURCE:E) $(SUBDIRHDRS) $(HDRS) $(STDHDRS) ;
|
$(SEARCH_SOURCE:E) $(SUBDIRHDRS) $(HDRS) $(STDHDRS) ;
|
||||||
HDRGRIST on $(<) = $(HDRGRIST) ;
|
HDRGRIST on $(<) = $(HDRGRIST) ;
|
||||||
HDRRULE on $(<) = $(HDRRULE_$(<:S)) ;
|
HDRRULE on $(<) = $(HDRRULE_$(<:S)) ;
|
||||||
HDRSCAN on $(<) = $(HDRPATTERN_$(<:S)) ;
|
HDRSCAN on $(<) = $(HDRPATTERN_$(<:S)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
local targets ;
|
local targets ;
|
||||||
# Invoke filetype specific rule
|
# Invoke filetype specific rule
|
||||||
if $(FILETYPE_$(<:S))
|
if $(FILETYPE_$(<:S))
|
||||||
{
|
{
|
||||||
targets = [ $(FILETYPE_$(<:S)) $(<) : $(>) ] ;
|
targets = [ $(FILETYPE_$(<:S)) $(<) : $(>) ] ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo Warning: no rules for file type $(<:S) defined (at file $(<)). ;
|
echo Warning: no rules for file type $(<:S) defined (at file $(<)). ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if $(targets)
|
if $(targets)
|
||||||
{
|
{
|
||||||
# construct clean target
|
# construct clean target
|
||||||
Clean clean : $(targets) ;
|
Clean clean : $(targets) ;
|
||||||
|
|
||||||
# Save HDRS for -I$(HDRS) on compile.
|
# Save HDRS for -I$(HDRS) on compile.
|
||||||
# We shouldn't need -I$(SEARCH_SOURCE) as cc can find headers
|
# We shouldn't need -I$(SEARCH_SOURCE) as cc can find headers
|
||||||
# in the .c file's directory, but generated .c files (from
|
# in the .c file's directory, but generated .c files (from
|
||||||
# yacc, lex, etc) are located in $(LOCATE_TARGET), possibly
|
# yacc, lex, etc) are located in $(LOCATE_TARGET), possibly
|
||||||
# different from $(SEARCH_SOURCE).
|
# different from $(SEARCH_SOURCE).
|
||||||
HDRS on $(<) = $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ;
|
HDRS on $(<) = $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ;
|
||||||
|
|
||||||
# propagate target specific-defines
|
# propagate target specific-defines
|
||||||
DEFINES on $(<) += $(DEFINES) ;
|
DEFINES on $(<) += $(DEFINES) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $(targets) ;
|
return $(targets) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## HeaderRule source : headers
|
## HeaderRule source : headers
|
||||||
## This rule is the default header rule used by the objects rules. You
|
## This rule is the default header rule used by the objects rules. You
|
||||||
## might register custom rules with the RegisterHeaderRule rule.
|
## might register custom rules with the RegisterHeaderRule rule.
|
||||||
rule HeaderRule
|
rule HeaderRule
|
||||||
{
|
{
|
||||||
# N.B. This rule is called during binding, potentially after
|
# N.B. This rule is called during binding, potentially after
|
||||||
# the fate of many targets has been determined, and must be
|
# the fate of many targets has been determined, and must be
|
||||||
# used with caution: don't add dependencies to unrelated
|
# used with caution: don't add dependencies to unrelated
|
||||||
# targets, and don't set variables on $(<).
|
# targets, and don't set variables on $(<).
|
||||||
|
|
||||||
# Tell Jam that anything depending on $(<) also depends on $(>),
|
# Tell Jam that anything depending on $(<) also depends on $(>),
|
||||||
# set SEARCH so Jam can find the headers, but then say we don't
|
# set SEARCH so Jam can find the headers, but then say we don't
|
||||||
# care if we can't actually find the headers (they may have been
|
# care if we can't actually find the headers (they may have been
|
||||||
# within ifdefs),
|
# within ifdefs),
|
||||||
local s = $(>:G=$(HDRGRIST:E)) ;
|
local s = $(>:G=$(HDRGRIST:E)) ;
|
||||||
|
|
||||||
Includes $(<) : $(s) ;
|
Includes $(<) : $(s) ;
|
||||||
SEARCH on $(s) = $(HDRSEARCH) ;
|
SEARCH on $(s) = $(HDRSEARCH) ;
|
||||||
NoCare $(s) ;
|
NoCare $(s) ;
|
||||||
|
|
||||||
local i ;
|
local i ;
|
||||||
for i in $(s)
|
for i in $(s)
|
||||||
{
|
{
|
||||||
HDRGRIST on $(i) = $(HDRGRIST) ;
|
HDRGRIST on $(i) = $(HDRGRIST) ;
|
||||||
HDRSEARCH on $(i) = $(HDRSEARCH) ;
|
HDRSEARCH on $(i) = $(HDRSEARCH) ;
|
||||||
HDRRULE on $(i) = [ on $(<) GetVar HDRRULE ] ;
|
HDRRULE on $(i) = [ on $(<) GetVar HDRRULE ] ;
|
||||||
HDRSCAN on $(i) = [ on $(<) GetVar HDRPATTERN ] ;
|
HDRSCAN on $(i) = [ on $(<) GetVar HDRPATTERN ] ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $(JAMVERSION) < 2.5
|
if $(JAMVERSION) < 2.5
|
||||||
{
|
{
|
||||||
## XXX XXX XXX a bug in jam 2.4 let's the version above fail. I'll let this
|
## XXX XXX XXX a bug in jam 2.4 let's the version above fail. I'll let this
|
||||||
## non-optimal version in here until jam 2.5 is out.
|
## non-optimal version in here until jam 2.5 is out.
|
||||||
|
|
||||||
rule HeaderRule
|
rule HeaderRule
|
||||||
{
|
{
|
||||||
local s = $(>:G=$(HDRGRIST:E)) ;
|
local s = $(>:G=$(HDRGRIST:E)) ;
|
||||||
|
|
||||||
Includes $(<) : $(s) ;
|
Includes $(<) : $(s) ;
|
||||||
SEARCH on $(s) = $(HDRSEARCH) ;
|
SEARCH on $(s) = $(HDRSEARCH) ;
|
||||||
NoCare $(s) ;
|
NoCare $(s) ;
|
||||||
|
|
||||||
local i ;
|
local i ;
|
||||||
for i in $(s)
|
for i in $(s)
|
||||||
{
|
{
|
||||||
if $(HDRRULE_$(i:S))
|
if $(HDRRULE_$(i:S))
|
||||||
{
|
{
|
||||||
HDRGRIST on $(i) = $(HDRGRIST) ;
|
HDRGRIST on $(i) = $(HDRGRIST) ;
|
||||||
HDRSEARCH on $(i) = $(HDRSEARCH) ;
|
HDRSEARCH on $(i) = $(HDRSEARCH) ;
|
||||||
HDRRULE on $(i) = $(HDRRULE_$(i:S)) ;
|
HDRRULE on $(i) = $(HDRRULE_$(i:S)) ;
|
||||||
HDRSCAN on $(i) = $(HDRPATTERN_$(i:S)) ;
|
HDRSCAN on $(i) = $(HDRPATTERN_$(i:S)) ;
|
||||||
}
|
}
|
||||||
else if $(JAM_DEBUG)
|
else if $(JAM_DEBUG)
|
||||||
{
|
{
|
||||||
#echo "No Header rule for $(i:S) file $(i) " ;
|
#echo "No Header rule for $(i:S) file $(i) " ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} # end of if $(JAMVERSION) < 1.5
|
} # end of if $(JAMVERSION) < 1.5
|
||||||
|
|
||||||
# Dummy rule: .o files are used as is.
|
# Dummy rule: .o files are used as is.
|
||||||
rule UseObjectFile
|
rule UseObjectFile
|
||||||
{
|
{
|
||||||
return $(<) ;
|
return $(<) ;
|
||||||
}
|
}
|
||||||
RegisterFileType UseObjectFile : .o ;
|
RegisterFileType UseObjectFile : .o ;
|
||||||
|
|
||||||
# Ignore header files.
|
# Ignore header files.
|
||||||
rule UseHeaderFile
|
rule UseHeaderFile
|
||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
RegisterFileType UseHeaderFile : .h .hpp ;
|
RegisterFileType UseHeaderFile : .h .hpp ;
|
||||||
RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .h .hpp .inc ;
|
RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .h .hpp .inc ;
|
||||||
|
|
||||||
# Generates a grist suitable for output objects based on
|
# Generates a grist suitable for output objects based on
|
||||||
# SUBVARIANT and SUBDIR variable.
|
# SUBVARIANT and SUBDIR variable.
|
||||||
rule DoObjectGrist
|
rule DoObjectGrist
|
||||||
{
|
{
|
||||||
return $(<:G=$(SOURCE_GRIST:E)!$(SUBVARIANT:J=!)) ;
|
return $(<:G=$(SOURCE_GRIST:E)!$(SUBVARIANT:J=!)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Generates a grist suitable for source files based on SUBDIR variable.
|
# Generates a grist suitable for source files based on SUBDIR variable.
|
||||||
# Doesn't change an existing grist.
|
# Doesn't change an existing grist.
|
||||||
rule DoSourceGrist
|
rule DoSourceGrist
|
||||||
{
|
{
|
||||||
local gristed ;
|
local gristed ;
|
||||||
for g in $(<)
|
for g in $(<)
|
||||||
{
|
{
|
||||||
local grist ;
|
local grist ;
|
||||||
if $(g:G)
|
if $(g:G)
|
||||||
{
|
{
|
||||||
grist = $(g:G) ;
|
grist = $(g:G) ;
|
||||||
}
|
}
|
||||||
gristed += $(g:G=$(grist:E=$(SOURCE_GRIST:E))) ;
|
gristed += $(g:G=$(grist:E=$(SOURCE_GRIST:E))) ;
|
||||||
}
|
}
|
||||||
return $(gristed) ;
|
return $(gristed) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,38 +1,38 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rule for setting options at targets
|
# Rule for setting options at targets
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# private rule - please specify the options in Application, Plugin or Library
|
# private rule - please specify the options in Application, Plugin or Library
|
||||||
# rule and don't use this rule here directly.
|
# rule and don't use this rule here directly.
|
||||||
|
|
||||||
## CheckOptions candidates : Options : target
|
## CheckOptions candidates : Options : target
|
||||||
rule CheckOptions
|
rule CheckOptions
|
||||||
{
|
{
|
||||||
local i ;
|
local i ;
|
||||||
|
|
||||||
for i in $(>)
|
for i in $(>)
|
||||||
{
|
{
|
||||||
if ! [ IsElem $(i) : $(<) ]
|
if ! [ IsElem $(i) : $(<) ]
|
||||||
{
|
{
|
||||||
echo "WARNING: Unknown option $(i) specified at $(3)." ;
|
echo "WARNING: Unknown option $(i) specified at $(3)." ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,166 +1,179 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for plugin creation
|
# Rules for plugin creation
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
SUFMETA ?= .csplugin ;
|
SUFMETA ?= .csplugin ;
|
||||||
GRISTMETA ?= pluginmeta ;
|
GRISTMETA ?= pluginmeta ;
|
||||||
|
|
||||||
## Plugin pluginname : sources [ : options ]
|
## Plugin pluginname : sources [ : options ]
|
||||||
## Build a plugin out of sourcefiles. All sourcefiles will be passed
|
## Build a plugin out of sourcefiles. All sourcefiles will be passed
|
||||||
## to the Objects rule which tries to compile them into object-files. You
|
## to the Objects rule which tries to compile them into object-files. You
|
||||||
## can create rules for your own filetypes with the UserObject rule. Header
|
## can create rules for your own filetypes with the UserObject rule. Header
|
||||||
## files will just be ignored. They are only used for MSVC projectfile
|
## files will just be ignored. They are only used for MSVC projectfile
|
||||||
## generator.
|
## generator.
|
||||||
## You can specify the noinstall option if you don't want that an install
|
## You can specify the noinstall option if you don't want that an install
|
||||||
## target is created.
|
## target is created.
|
||||||
## Options:
|
## Options:
|
||||||
## noinstall: Don't setup a default installation target.
|
## noinstall: Don't setup a default installation target.
|
||||||
## independent: The target will not be made a dependency of the plugins
|
## independent: The target will not be made a dependency of the plugins
|
||||||
## and all target.
|
## and all target.
|
||||||
## nohelp: Do not invoke Help for this target.
|
## nohelp: Do not invoke Help for this target.
|
||||||
## notest: Do not set up unit-testing support for this target.
|
## notest: Do not set up unit-testing support for this target.
|
||||||
rule Plugin
|
rule Plugin
|
||||||
{
|
{
|
||||||
# check options
|
# check options
|
||||||
CheckOptions noinstall independent nohelp notest : $(3) : $(<) ;
|
CheckOptions noinstall independent nohelp notest : $(3) : $(<) ;
|
||||||
|
|
||||||
local metafile ;
|
local metafile ;
|
||||||
metafile = [ FAppendSuffix $(<) : $(SUFMETA) ] ;
|
metafile = [ FAppendSuffix $(<) : $(SUFMETA) ] ;
|
||||||
SEARCH on $(metafile) = $(SEARCH_SOURCE) ;
|
SEARCH on $(metafile) = $(SEARCH_SOURCE) ;
|
||||||
|
|
||||||
local target = [ ConstructPluginTarget $(<) : $(3) ] ;
|
local target = [ ConstructPluginTarget $(<) : $(3) ] ;
|
||||||
local sources = [ DoSourceGrist $(>) ] ;
|
local sources = [ DoSourceGrist $(>) ] ;
|
||||||
local objects = [ CompileObjects $(sources) ] ;
|
local objects = [ CompileObjects $(sources) ] ;
|
||||||
|
|
||||||
$(<)_TYPE = plugin ;
|
$(<)_TYPE = plugin ;
|
||||||
$(<)_OBJECTS = $(objects) ;
|
$(<)_OBJECTS = $(objects) ;
|
||||||
$(<)_SOURCES = $(sources) ;
|
$(<)_SOURCES = $(sources) ;
|
||||||
$(<)_TARGET = $(target) ;
|
$(<)_TARGET = $(target) ;
|
||||||
$(<)_METAFILE = $(metafile) ;
|
$(<)_METAFILE = $(metafile) ;
|
||||||
|
|
||||||
# create target clean rule
|
# Create a target for eventual static linking
|
||||||
Always $(<)clean ;
|
if ! $(NO_STATIC_LINKING)
|
||||||
NotFile $(<)clean ;
|
{
|
||||||
Clean $(<)clean : $(objects) ; # create target clean rule
|
SubVariant static ;
|
||||||
|
local staticreginfoobject = [ BuildStaticRegFile $(<) : $(statictarget) ] ;
|
||||||
# Create a target for eventual static linking
|
|
||||||
if ! $(NO_STATIC_LINKING)
|
# Add objects to the list of candidates for potential inclusion in a
|
||||||
{
|
# monolithic static library containing objects for all plugins (useful for
|
||||||
SubVariant static ;
|
# statically linking the plugins into an application if the client so
|
||||||
local staticreginfoobject = [ BuildStaticRegFile $(<) : $(statictarget) ] ;
|
# desires).
|
||||||
|
local staticobjects = [ CompileObjects $(sources) : $(<) ] ;
|
||||||
# Add objects to the list of candidates for potential inclusion in a
|
|
||||||
# monolithic static library containing objects for all plugins (useful for
|
local obj_remain = $(objects) ;
|
||||||
# statically linking the plugins into an application if the client so
|
local staticobj_remain = $(staticobjects) ;
|
||||||
# desires).
|
|
||||||
local staticobjects = [ CompileObjects $(sources) : $(<) ] ;
|
while $(obj_remain)
|
||||||
|
{
|
||||||
local obj_remain = $(objects) ;
|
local obj = $(obj_remain[1]) ;
|
||||||
local staticobj_remain = $(staticobjects) ;
|
local staticobj = $(staticobj_remain[1]) ;
|
||||||
|
|
||||||
while $(obj_remain)
|
STATICPLUGINS.OBJECTS.$(staticobj) = $(obj) ;
|
||||||
{
|
|
||||||
local obj = $(obj_remain[1]) ;
|
obj_remain = $(obj_remain[2-]) ;
|
||||||
local staticobj = $(staticobj_remain[1]) ;
|
staticobj_remain = $(staticobj_remain[2-]) ;
|
||||||
|
}
|
||||||
STATICPLUGINS.OBJECTS.$(staticobj) = $(obj) ;
|
|
||||||
|
MakeLocate $(staticobjects) : $(LOCATE_TARGET) ;
|
||||||
obj_remain = $(obj_remain[2-]) ;
|
STATICPLUGINS.OBJECTS.$(<) += $(staticreginfoobject) ;
|
||||||
staticobj_remain = $(staticobj_remain[2-]) ;
|
STATICPLUGINS.OBJECTS.$(<) += $(staticobjects) ;
|
||||||
}
|
STATICPLUGINS.SUBTARGETS += $(<) ;
|
||||||
|
|
||||||
MakeLocate $(staticobjects) : $(LOCATE_TARGET) ;
|
SubVariant ;
|
||||||
STATICPLUGINS.OBJECTS.$(<) += $(staticreginfoobject) ;
|
}
|
||||||
STATICPLUGINS.OBJECTS.$(<) += $(staticobjects) ;
|
|
||||||
STATICPLUGINS.SUBTARGETS += $(<) ;
|
# so 'jam foo' works when it's really foo.dll (Windows) or foo.csbundle
|
||||||
|
# (MacOS/X)
|
||||||
SubVariant ;
|
if $(target) != $(<)
|
||||||
}
|
{
|
||||||
|
Depends $(<) : $(target) ;
|
||||||
# so 'jam foo' works when it's really foo.dll (Windows) or foo.csbundle
|
NotFile $(<) ;
|
||||||
# (MacOS/X)
|
}
|
||||||
if $(target) != $(<)
|
|
||||||
{
|
if ! [ IsElem independent : $(3) ]
|
||||||
Depends $(<) : $(target) ;
|
{
|
||||||
NotFile $(<) ;
|
Depends plugins : $(<) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ! [ IsElem independent : $(3) ]
|
# construct install target
|
||||||
{
|
if ! [ IsElem noinstall : $(3) ]
|
||||||
Depends plugins : $(<) ;
|
{
|
||||||
}
|
SystemInstallPlugin $(target) ;
|
||||||
|
}
|
||||||
# construct install target
|
|
||||||
if ! [ IsElem noinstall : $(3) ]
|
# Link
|
||||||
{
|
MakeLocate $(target) : $(LOCATE.TARGETS) ;
|
||||||
SystemInstallPlugin $(target) ;
|
SystemLinkPlugin $(<) : $(objects) : $(3) ;
|
||||||
}
|
|
||||||
|
local cleanextra ;
|
||||||
# Link
|
if $(LINK.DEBUG.INFO.SEPARATE) = "yes"
|
||||||
MakeLocate $(target) : $(LOCATE.TARGETS) ;
|
{
|
||||||
SystemLinkPlugin $(<) : $(objects) : $(3) ;
|
local debugfile = [ SplitDebugInfo $(target) ] ;
|
||||||
|
cleanextra += $(debugfile) ;
|
||||||
CFlags $(<) : $(PLUGIN.CFLAGS) : nostatic ;
|
if ! [ IsElem noinstall : $(3) ]
|
||||||
LFlags $(<) : $(LINKLIBS) $(PLUGIN.LFLAGS) : nostatic ;
|
{
|
||||||
|
NoCare $(debugfile) ;
|
||||||
if ! [ IsElem nohelp : $(3) ]
|
Depends install_plugin : [ DoInstall $(debugfile) : $(plugindir) : $(INSTALL_DATA) ] ;
|
||||||
{
|
}
|
||||||
local desc = [ Description $(<) ] ;
|
}
|
||||||
if ! $(desc) { desc = "$(<) plugin" ; }
|
|
||||||
Help $(<) : "Build the $(desc)" ;
|
CFlags $(<) : $(PLUGIN.CFLAGS) : nostatic ;
|
||||||
}
|
LFlags $(<) : $(LINKLIBS) $(PLUGIN.LFLAGS) : nostatic ;
|
||||||
|
|
||||||
if ! [ IsElem notest : $(options) ]
|
# create target clean rule
|
||||||
{
|
Always $(<)clean ;
|
||||||
# @@@ Disabled for now; see docs/todo_jam.txt
|
NotFile $(<)clean ;
|
||||||
#UnitTest $(<) ;
|
Clean $(<)clean : $(objects) $(cleanextra) ;
|
||||||
}
|
Clean clean : $(cleanextra) ;
|
||||||
}
|
|
||||||
|
if ! [ IsElem nohelp : $(3) ]
|
||||||
#----------------------------------------------------------------------------
|
{
|
||||||
# private rules
|
local desc = [ Description $(<) ] ;
|
||||||
|
if ! $(desc) { desc = "$(<) plugin" ; }
|
||||||
# PluginMetaData pluginname : metafile [ : options ]
|
Help $(<) : "Build the $(desc)" ;
|
||||||
# Copy a plugin's meta file so that it resides alongside the generated
|
}
|
||||||
# plugin module. This utility rule may be used by SystemLinkPlugin rules
|
|
||||||
# which employ the default behavior of having a plugin's meta-data file
|
if ! [ IsElem notest : $(options) ]
|
||||||
# reside alongside the plugin executable (as opposed to bundling the
|
{
|
||||||
# metadata directly into the plugin).
|
# @@@ Disabled for now; see docs/todo_jam.txt
|
||||||
# Options:
|
#UnitTest $(<) ;
|
||||||
# noinstall: Don't setup a default installation target.
|
}
|
||||||
rule PluginMetaData
|
}
|
||||||
{
|
|
||||||
local target = $(>:G=$(GRISTMETA)) ;
|
#----------------------------------------------------------------------------
|
||||||
Depends $(<) : $(target) ;
|
# private rules
|
||||||
Depends $(target) : $(>) ;
|
|
||||||
MakeLocate $(target) : $(LOCATE.TARGETS) ;
|
# PluginMetaData pluginname : metafile [ : options ]
|
||||||
Copy $(target) : $(>) ;
|
# Copy a plugin's meta file so that it resides alongside the generated
|
||||||
Clean clean : $(target) ;
|
# plugin module. This utility rule may be used by SystemLinkPlugin rules
|
||||||
Clean $(<)clean : $(target) ;
|
# which employ the default behavior of having a plugin's meta-data file
|
||||||
|
# reside alongside the plugin executable (as opposed to bundling the
|
||||||
if ! [ IsElem noinstall : $(3) ]
|
# metadata directly into the plugin).
|
||||||
{
|
# Options:
|
||||||
Depends install_plugin : [ DoInstall $(target) : $(plugindir) ] ;
|
# noinstall: Don't setup a default installation target.
|
||||||
}
|
rule PluginMetaData
|
||||||
}
|
{
|
||||||
|
local target = $(>:G=$(GRISTMETA)) ;
|
||||||
# Construct pseudo target plugins
|
Depends $(<) : $(target) ;
|
||||||
Depends exe : plugins ;
|
Depends $(target) : $(>) ;
|
||||||
NotFile plugins ;
|
MakeLocate $(target) : $(LOCATE.TARGETS) ;
|
||||||
Help plugins : "Build all plugin modules" ;
|
Copy $(target) : $(>) ;
|
||||||
|
Clean clean : $(target) ;
|
||||||
|
Clean $(<)clean : $(target) ;
|
||||||
|
|
||||||
|
if ! [ IsElem noinstall : $(3) ]
|
||||||
|
{
|
||||||
|
Depends install_plugin : [ DoInstall $(target) : $(plugindir) ] ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Construct pseudo target plugins
|
||||||
|
Depends exe : plugins ;
|
||||||
|
NotFile plugins ;
|
||||||
|
Help plugins : "Build all plugin modules" ;
|
||||||
|
|||||||
@@ -1,58 +1,58 @@
|
|||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Generic property-bag mechanism.
|
# Generic property-bag mechanism.
|
||||||
# Copyright (C) 2004 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C) 2004 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
||||||
# Property bag : name
|
# Property bag : name
|
||||||
# Returns the value of property 'name' in container 'bag' if present, else
|
# Returns the value of property 'name' in container 'bag' if present, else
|
||||||
# returns a null value. 'bag' and 'name' should be simple identifiers
|
# returns a null value. 'bag' and 'name' should be simple identifiers
|
||||||
# composed of alphanumeric characters and underscore, and with an alphabetic
|
# composed of alphanumeric characters and underscore, and with an alphabetic
|
||||||
# or an underscore as the first character.
|
# or an underscore as the first character.
|
||||||
rule Property
|
rule Property
|
||||||
{
|
{
|
||||||
local p = [ _PropertyName $(<) : $(>) ] ;
|
local p = [ _PropertyName $(<) : $(>) ] ;
|
||||||
return $($(p)) ;
|
return $($(p)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# SetProperty bag : name [ : value ]
|
# SetProperty bag : name [ : value ]
|
||||||
# Add property 'name' to container 'bag'. If 'value' is not provided, sets
|
# Add property 'name' to container 'bag'. If 'value' is not provided, sets
|
||||||
# the property to "true".
|
# the property to "true".
|
||||||
rule SetProperty
|
rule SetProperty
|
||||||
{
|
{
|
||||||
local p = [ _PropertyName $(<) : $(>) ] ;
|
local p = [ _PropertyName $(<) : $(>) ] ;
|
||||||
local v = $(3) ;
|
local v = $(3) ;
|
||||||
if ! $(v) { v = "true" ; }
|
if ! $(v) { v = "true" ; }
|
||||||
$(p) = $(v) ;
|
$(p) = $(v) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# ClearProperty bag : name
|
# ClearProperty bag : name
|
||||||
# Remove property 'name' from container 'bag'.
|
# Remove property 'name' from container 'bag'.
|
||||||
rule ClearProperty
|
rule ClearProperty
|
||||||
{
|
{
|
||||||
local p = [ _PropertyName $(<) : $(>) ] ;
|
local p = [ _PropertyName $(<) : $(>) ] ;
|
||||||
$(p) = "" ;
|
$(p) = "" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Private utilitiy rules.
|
# Private utilitiy rules.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
rule _PropertyName
|
rule _PropertyName
|
||||||
{
|
{
|
||||||
return "__property_$(<)_$(>)" ;
|
return "__property_$(<)_$(>)" ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,109 +1,109 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for handling additional resources.
|
# Rules for handling additional resources.
|
||||||
# Platform-specific Jam files may override these if needed.
|
# Platform-specific Jam files may override these if needed.
|
||||||
#
|
#
|
||||||
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
## ApplicationIconDefault platform : type [ : icon [ : pathcomponents ]]
|
## ApplicationIconDefault platform : type [ : icon [ : pathcomponents ]]
|
||||||
## If invoked with three or more arguments, specifies the default icon for
|
## If invoked with three or more arguments, specifies the default icon for
|
||||||
## applications of the specified type for the given platform, which may be
|
## applications of the specified type for the given platform, which may be
|
||||||
## 'macosx', 'win32', or 'unix'. Type should be 'all', 'gui', or 'console'.
|
## 'macosx', 'win32', or 'unix'. Type should be 'all', 'gui', or 'console'.
|
||||||
## If pathcomponents is omitted, SEARCH_SOURCE is used. This setting can be
|
## If pathcomponents is omitted, SEARCH_SOURCE is used. This setting can be
|
||||||
## overriden for an individual application with the ApplicationIcon rule.
|
## overriden for an individual application with the ApplicationIcon rule.
|
||||||
## This rule must be invoked before invoking any Application rules if it is
|
## This rule must be invoked before invoking any Application rules if it is
|
||||||
## to have any effect. If invoked with two arguments, returns the default
|
## to have any effect. If invoked with two arguments, returns the default
|
||||||
## icon (if any) for the given platform and type.
|
## icon (if any) for the given platform and type.
|
||||||
rule ApplicationIconDefault
|
rule ApplicationIconDefault
|
||||||
{
|
{
|
||||||
local platform = $(1) ;
|
local platform = $(1) ;
|
||||||
local type = $(2) ;
|
local type = $(2) ;
|
||||||
local icon = $(3) ;
|
local icon = $(3) ;
|
||||||
local iconpath = $(4) ;
|
local iconpath = $(4) ;
|
||||||
local key = default_$(platform)_$(type) ;
|
local key = default_$(platform)_$(type) ;
|
||||||
|
|
||||||
if $(icon)
|
if $(icon)
|
||||||
{
|
{
|
||||||
SetProperty appicon : $(key) : $(icon) ;
|
SetProperty appicon : $(key) : $(icon) ;
|
||||||
if $(iconpath)
|
if $(iconpath)
|
||||||
{
|
{
|
||||||
SEARCH on $(icon) = [ ConcatDirs $(iconpath) ] ;
|
SEARCH on $(icon) = [ ConcatDirs $(iconpath) ] ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SEARCH on $(icon) = $(SEARCH_SOURCE) ;
|
SEARCH on $(icon) = $(SEARCH_SOURCE) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local result = [ Property appicon : $(key) ] ;
|
local result = [ Property appicon : $(key) ] ;
|
||||||
if ! $(result) && $(type) != all
|
if ! $(result) && $(type) != all
|
||||||
{
|
{
|
||||||
result = [ Property appicon : default_$(platform)_all ] ;
|
result = [ Property appicon : default_$(platform)_all ] ;
|
||||||
}
|
}
|
||||||
return $(result) ;
|
return $(result) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## ApplicationIcon platform : basename [ : icon [ : pathcomponents ]]
|
## ApplicationIcon platform : basename [ : icon [ : pathcomponents ]]
|
||||||
## If invoked with three or more arguments, specifies the icon for the
|
## If invoked with three or more arguments, specifies the icon for the
|
||||||
## application given by basename for the indicated platform, which may be
|
## application given by basename for the indicated platform, which may be
|
||||||
## 'macosx', 'win32', or 'unix'. If pathcomponents is omitted,
|
## 'macosx', 'win32', or 'unix'. If pathcomponents is omitted,
|
||||||
## SEARCH_SOURCE is used. If this rule is not invoked, then the icon
|
## SEARCH_SOURCE is used. If this rule is not invoked, then the icon
|
||||||
## specified via ApplicationIconDefault is used, if any. This rule must be
|
## specified via ApplicationIconDefault is used, if any. This rule must be
|
||||||
## invoked before the Application rule to which this icon will apply. If
|
## invoked before the Application rule to which this icon will apply. If
|
||||||
## invoked with two arguments, returns the icon (if any) explicitly
|
## invoked with two arguments, returns the icon (if any) explicitly
|
||||||
## registered for basename for the given platform.
|
## registered for basename for the given platform.
|
||||||
rule ApplicationIcon
|
rule ApplicationIcon
|
||||||
{
|
{
|
||||||
local platform = $(1) ;
|
local platform = $(1) ;
|
||||||
local target = $(2) ;
|
local target = $(2) ;
|
||||||
local icon = $(3) ;
|
local icon = $(3) ;
|
||||||
local iconpath = $(4) ;
|
local iconpath = $(4) ;
|
||||||
local key = app_$(platform)_$(target) ;
|
local key = app_$(platform)_$(target) ;
|
||||||
|
|
||||||
if $(icon)
|
if $(icon)
|
||||||
{
|
{
|
||||||
SetProperty appicon : $(key) : $(icon) ;
|
SetProperty appicon : $(key) : $(icon) ;
|
||||||
if $(iconpath)
|
if $(iconpath)
|
||||||
{
|
{
|
||||||
SEARCH on $(icon) = [ ConcatDirs $(iconpath) ] ;
|
SEARCH on $(icon) = [ ConcatDirs $(iconpath) ] ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SEARCH on $(icon) = $(SEARCH_SOURCE) ;
|
SEARCH on $(icon) = $(SEARCH_SOURCE) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# An ugly but effective way to detect incorrect usage.
|
# An ugly but effective way to detect incorrect usage.
|
||||||
if $($(target)_TARGET)
|
if $($(target)_TARGET)
|
||||||
{
|
{
|
||||||
Echo "Warning: `ApplicationIcon:$(target):$(icon)' incorrectly invoked"
|
Echo "Warning: `ApplicationIcon:$(target):$(icon)' incorrectly invoked"
|
||||||
"after Application rule." ;
|
"after Application rule." ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return [ Property appicon : $(key) ] ;
|
return [ Property appicon : $(key) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## Win32Resource basename : rcfiles
|
## Win32Resource basename : rcfiles
|
||||||
## Specify .rc files for the target known as basename. The .rc files should
|
## Specify .rc files for the target known as basename. The .rc files should
|
||||||
## already have SEARCH set appropriately.
|
## already have SEARCH set appropriately.
|
||||||
rule Win32Resource { }
|
rule Win32Resource { }
|
||||||
|
|
||||||
## Win32RcFlags basename : rcfiles
|
## Win32RcFlags basename : rcfiles
|
||||||
## Specify flags passed to the resource compiler when compiling resources
|
## Specify flags passed to the resource compiler when compiling resources
|
||||||
## for the target known as basename.
|
## for the target known as basename.
|
||||||
rule Win32RcFlags { }
|
rule Win32RcFlags { }
|
||||||
|
|||||||
@@ -1,353 +1,353 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Utility rules for static builds without plugins
|
# Utility rules for static builds without plugins
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
# all private
|
# all private
|
||||||
|
|
||||||
rule GenerateStaticPluginBoilerplate
|
rule GenerateStaticPluginBoilerplate
|
||||||
{
|
{
|
||||||
ResponseFile $(<) :
|
ResponseFile $(<) :
|
||||||
"// This file is automatically generated."
|
"// This file is automatically generated."
|
||||||
"#include \"cssysdef.h\""
|
"#include \"cssysdef.h\""
|
||||||
"#include \"csutil/scf.h\""
|
"#include \"csutil/scf.h\""
|
||||||
""
|
""
|
||||||
"// Put static linking stuff into own section."
|
"// Put static linking stuff into own section."
|
||||||
"// The idea is that this allows the section to be swapped out but not"
|
"// The idea is that this allows the section to be swapped out but not"
|
||||||
"// swapped in again b/c something else in it was needed."
|
"// swapped in again b/c something else in it was needed."
|
||||||
"#if !defined(CS_DEBUG) && defined(CS_COMPILER_MSVC)"
|
"#if !defined(CS_DEBUG) && defined(CS_COMPILER_MSVC)"
|
||||||
"#pragma const_seg(\".CSmetai\")"
|
"#pragma const_seg(\".CSmetai\")"
|
||||||
"#pragma comment(linker, \"/section:.CSmetai,r\")"
|
"#pragma comment(linker, \"/section:.CSmetai,r\")"
|
||||||
"#pragma code_seg(\".CSmeta\")"
|
"#pragma code_seg(\".CSmeta\")"
|
||||||
"#pragma comment(linker, \"/section:.CSmeta,er\")"
|
"#pragma comment(linker, \"/section:.CSmeta,er\")"
|
||||||
"#pragma comment(linker, \"/merge:.CSmetai=.CSmeta\")"
|
"#pragma comment(linker, \"/merge:.CSmetai=.CSmeta\")"
|
||||||
"#endif"
|
"#endif"
|
||||||
: notfile ;
|
: notfile ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule GenerateStaticPluginInstantiation
|
rule GenerateStaticPluginInstantiation
|
||||||
{
|
{
|
||||||
GenerateStaticPluginBoilerplate $(<) ;
|
GenerateStaticPluginBoilerplate $(<) ;
|
||||||
ResponseFile $(<) : "SCF_USE_STATIC_PLUGIN($(>:B))" : notfile ;
|
ResponseFile $(<) : "SCF_USE_STATIC_PLUGIN($(>:B))" : notfile ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule GenerateStaticPluginRegistration
|
rule GenerateStaticPluginRegistration
|
||||||
{
|
{
|
||||||
GenerateStaticPluginBoilerplate $(<) ;
|
GenerateStaticPluginBoilerplate $(<) ;
|
||||||
GenerateStaticPluginRegistration1 $(<) : $(>) ;
|
GenerateStaticPluginRegistration1 $(<) : $(>) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule BuildStaticRegFile
|
rule BuildStaticRegFile
|
||||||
{
|
{
|
||||||
local statictarget = $(>) ;
|
local statictarget = $(>) ;
|
||||||
# prepare source files
|
# prepare source files
|
||||||
local sources = [ DoObjectGrist _$(<)_static_reg.cpp ] ;
|
local sources = [ DoObjectGrist _$(<)_static_reg.cpp ] ;
|
||||||
local object = [ CompileObject $(sources) ] ;
|
local object = [ CompileObject $(sources) ] ;
|
||||||
|
|
||||||
MakeLocate $(sources) : $(LOCATE_TARGET) ;
|
MakeLocate $(sources) : $(LOCATE_TARGET) ;
|
||||||
MakeLocate $(object) : $(LOCATE_TARGET) ;
|
MakeLocate $(object) : $(LOCATE_TARGET) ;
|
||||||
|
|
||||||
local metalist metafile i ;
|
local metalist metafile i ;
|
||||||
for i in $(<)
|
for i in $(<)
|
||||||
{
|
{
|
||||||
metafile = $($(i)_METAFILE) ;
|
metafile = $($(i)_METAFILE) ;
|
||||||
metalist += $(metafile) ;
|
metalist += $(metafile) ;
|
||||||
Depends $(sources) : $(metafile) ;
|
Depends $(sources) : $(metafile) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
GenerateStaticPluginRegistration $(sources) : $(metalist) ;
|
GenerateStaticPluginRegistration $(sources) : $(metalist) ;
|
||||||
Clean $(statictarget)clean : $(sources) ;
|
Clean $(statictarget)clean : $(sources) ;
|
||||||
Clean $(statictarget)clean : $(object) ;
|
Clean $(statictarget)clean : $(object) ;
|
||||||
return $(object) ;
|
return $(object) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule BuildStaticUseFile
|
rule BuildStaticUseFile
|
||||||
{
|
{
|
||||||
local statictarget = $(2) ;
|
local statictarget = $(2) ;
|
||||||
local package = $(3) ;
|
local package = $(3) ;
|
||||||
# prepare source files
|
# prepare source files
|
||||||
local sources ;
|
local sources ;
|
||||||
if $(3)
|
if $(3)
|
||||||
{
|
{
|
||||||
sources = [ DoObjectGrist _cs_static_use_$(package).cpp ] ;
|
sources = [ DoObjectGrist _cs_static_use_$(package).cpp ] ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sources = [ DoObjectGrist _cs_static_use.cpp ] ;
|
sources = [ DoObjectGrist _cs_static_use.cpp ] ;
|
||||||
}
|
}
|
||||||
local object = [ CompileObject $(sources) ] ;
|
local object = [ CompileObject $(sources) ] ;
|
||||||
|
|
||||||
MakeLocate $(sources) : $(LOCATE_TARGET) ;
|
MakeLocate $(sources) : $(LOCATE_TARGET) ;
|
||||||
SEARCH on $(sources) = $(LOCATE_TARGET) ;
|
SEARCH on $(sources) = $(LOCATE_TARGET) ;
|
||||||
MakeLocate $(object) : $(LOCATE_TARGET) ;
|
MakeLocate $(object) : $(LOCATE_TARGET) ;
|
||||||
|
|
||||||
C++FLAGS on $(object) += $($($(>).EXTERNALLIBS).CFLAGS) ;
|
C++FLAGS on $(object) += $($($(>).EXTERNALLIBS).CFLAGS) ;
|
||||||
|
|
||||||
GenerateStaticPluginInstantiation $(sources) : $(<) ;
|
GenerateStaticPluginInstantiation $(sources) : $(<) ;
|
||||||
Clean $(statictarget)clean : $(sources) ;
|
Clean $(statictarget)clean : $(sources) ;
|
||||||
Clean $(statictarget)clean : $(object) ;
|
Clean $(statictarget)clean : $(object) ;
|
||||||
return $(object) ;
|
return $(object) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## LinkStaticPlugins target : plugins [: optionalplugins] [: package]
|
## LinkStaticPlugins target : plugins [: optionalplugins] [: package]
|
||||||
## Builds the plugins in 'plugins' (and 'optionalplugins') statically into
|
## Builds the plugins in 'plugins' (and 'optionalplugins') statically into
|
||||||
## 'target'. Can be used both for static plugins from the local project or
|
## 'target'. Can be used both for static plugins from the local project or
|
||||||
## an external project. In the latter case, the project's static plugin
|
## an external project. In the latter case, the project's static plugin
|
||||||
## library has to have been built, also, the "<package>.STATICDEPS"
|
## library has to have been built, also, the "<package>.STATICDEPS"
|
||||||
## variable must contain a path to a specially generated Jamfile that
|
## variable must contain a path to a specially generated Jamfile that
|
||||||
## contains information about the plugins provided by as well as external
|
## contains information about the plugins provided by as well as external
|
||||||
## dependencies. The static plugins library for both local and external
|
## dependencies. The static plugins library for both local and external
|
||||||
## package must be explicitly linked into 'target'.
|
## package must be explicitly linked into 'target'.
|
||||||
rule LinkStaticPlugins
|
rule LinkStaticPlugins
|
||||||
{
|
{
|
||||||
local package target plugins optplugins ;
|
local package target plugins optplugins ;
|
||||||
# Fetch the parameters
|
# Fetch the parameters
|
||||||
target = $(1) ;
|
target = $(1) ;
|
||||||
plugins = $(2) ;
|
plugins = $(2) ;
|
||||||
optplugins = $(3) ;
|
optplugins = $(3) ;
|
||||||
package = $(4) ;
|
package = $(4) ;
|
||||||
|
|
||||||
if $(package)
|
if $(package)
|
||||||
{
|
{
|
||||||
# External static plugins.
|
# External static plugins.
|
||||||
# First include static plugin info
|
# First include static plugin info
|
||||||
if ! $(HAVE_STATICDEPS.$(package))
|
if ! $(HAVE_STATICDEPS.$(package))
|
||||||
{
|
{
|
||||||
include $($(package).STATICDEPS) ;
|
include $($(package).STATICDEPS) ;
|
||||||
HAVE_STATICDEPS.$(package) = yes ;
|
HAVE_STATICDEPS.$(package) = yes ;
|
||||||
}
|
}
|
||||||
local lflags p ;
|
local lflags p ;
|
||||||
# Collect optional plugins
|
# Collect optional plugins
|
||||||
for p in $(optplugins)
|
for p in $(optplugins)
|
||||||
{
|
{
|
||||||
if [ IsElem $(p) : $(STATICPLUGINS.AVAILABLE) ]
|
if [ IsElem $(p) : $(STATICPLUGINS.AVAILABLE) ]
|
||||||
{
|
{
|
||||||
plugins += $(p) ;
|
plugins += $(p) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# Grab flags
|
# Grab flags
|
||||||
for p in $(plugins)
|
for p in $(plugins)
|
||||||
{
|
{
|
||||||
NotFile $(p) ;
|
NotFile $(p) ;
|
||||||
CFlags $(target) : $(STATICPLUGIN.$(p).CFLAGS) ;
|
CFlags $(target) : $(STATICPLUGIN.$(p).CFLAGS) ;
|
||||||
lflags = [ MergeLFlags $(lflags) : $(STATICPLUGIN.$(p).LFLAGS) ] ;
|
lflags = [ MergeLFlags $(lflags) : $(STATICPLUGIN.$(p).LFLAGS) ] ;
|
||||||
}
|
}
|
||||||
LFlags $(target) : $(lflags) ;
|
LFlags $(target) : $(lflags) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
# Local static plugins
|
# Local static plugins
|
||||||
local lflags libs p ;
|
local lflags libs p ;
|
||||||
# Collect optional plugins
|
# Collect optional plugins
|
||||||
for p in $(optplugins)
|
for p in $(optplugins)
|
||||||
{
|
{
|
||||||
if $($(p)_TARGET)
|
if $($(p)_TARGET)
|
||||||
{
|
{
|
||||||
plugins += $(p) ;
|
plugins += $(p) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# Grab flags
|
# Grab flags
|
||||||
for p in $(plugins)
|
for p in $(plugins)
|
||||||
{
|
{
|
||||||
lflags += [ Filter $($(p).LFLAGS) : $(LINKLIBS) $(PLUGIN.LFLAGS) ] ;
|
lflags += [ Filter $($(p).LFLAGS) : $(LINKLIBS) $(PLUGIN.LFLAGS) ] ;
|
||||||
libs += $($(p).NEEDLIBS) ;
|
libs += $($(p).NEEDLIBS) ;
|
||||||
}
|
}
|
||||||
LFlags $(target) : [ Reverse [ RemoveDups [ Reverse $(lflags) ] ] ] ;
|
LFlags $(target) : [ Reverse [ RemoveDups [ Reverse $(lflags) ] ] ] ;
|
||||||
LinkWith $(target) : [ Reverse [ RemoveDups [ Reverse $(libs) ] ] ] ;
|
LinkWith $(target) : [ Reverse [ RemoveDups [ Reverse $(libs) ] ] ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# construct initialization sourcefile
|
# construct initialization sourcefile
|
||||||
local staticobject = [ BuildStaticUseFile $(plugins) : $(target) : $(package) ] ;
|
local staticobject = [ BuildStaticUseFile $(plugins) : $(target) : $(package) ] ;
|
||||||
ExtraObjects $(target) : $(staticobject) : inheritcflags ;
|
ExtraObjects $(target) : $(staticobject) : inheritcflags ;
|
||||||
}
|
}
|
||||||
|
|
||||||
## StaticPluginLibrary name [: rejects]
|
## StaticPluginLibrary name [: rejects]
|
||||||
## Create a library that monolithically contains statically linkable
|
## Create a library that monolithically contains statically linkable
|
||||||
## versions of all plugins, and also provides a target to install this
|
## versions of all plugins, and also provides a target to install this
|
||||||
## library ("install_staticplugins") as well as resources to facilitate the
|
## library ("install_staticplugins") as well as resources to facilitate the
|
||||||
## use of that library from external projects. Also, most plugins will
|
## use of that library from external projects. Also, most plugins will
|
||||||
## probably themselves depend on other libraries; while those are correctly
|
## probably themselves depend on other libraries; while those are correctly
|
||||||
## linked in with the static plugins, they are not built or installed when
|
## linked in with the static plugins, they are not built or installed when
|
||||||
## the static plugin library is.
|
## the static plugin library is.
|
||||||
## This library is intended to be used together with the
|
## This library is intended to be used together with the
|
||||||
## "LinkStaticPlugins" rule.
|
## "LinkStaticPlugins" rule.
|
||||||
rule StaticPluginLibrary
|
rule StaticPluginLibrary
|
||||||
{
|
{
|
||||||
local name = $(<) ;
|
local name = $(<) ;
|
||||||
local rejects = $(>) ;
|
local rejects = $(>) ;
|
||||||
local t ;
|
local t ;
|
||||||
|
|
||||||
local targets = $(STATICPLUGINS.SUBTARGETS) ;
|
local targets = $(STATICPLUGINS.SUBTARGETS) ;
|
||||||
if $(rejects)
|
if $(rejects)
|
||||||
{
|
{
|
||||||
targets = [ Filter $(targets) : $(rejects) ] ;
|
targets = [ Filter $(targets) : $(rejects) ] ;
|
||||||
}
|
}
|
||||||
local objects ;
|
local objects ;
|
||||||
for t in $(targets)
|
for t in $(targets)
|
||||||
{
|
{
|
||||||
objects += $(STATICPLUGINS.OBJECTS.$(t)) ;
|
objects += $(STATICPLUGINS.OBJECTS.$(t)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set up library
|
# Set up library
|
||||||
Library $(name) : $(objects) : noinstall notest independent nohelp ;
|
Library $(name) : $(objects) : noinstall notest independent nohelp ;
|
||||||
SEARCH on $(name) += $(LOCATE_TARGET) ;
|
SEARCH on $(name) += $(LOCATE_TARGET) ;
|
||||||
MsvcDefine $(name) : $(STATICPLUGINS.MSVC_DEFINES) ;
|
MsvcDefine $(name) : $(STATICPLUGINS.MSVC_DEFINES) ;
|
||||||
CFlags $(name) :
|
CFlags $(name) :
|
||||||
[ FDefines CS_STATIC_LINKED ]
|
[ FDefines CS_STATIC_LINKED ]
|
||||||
: nostatic ;
|
: nostatic ;
|
||||||
|
|
||||||
# Copy a variety of flags
|
# Copy a variety of flags
|
||||||
local o ;
|
local o ;
|
||||||
for o in $(objects)
|
for o in $(objects)
|
||||||
{
|
{
|
||||||
local sourceobj = $(STATICPLUGINS.OBJECTS.$(o)) ;
|
local sourceobj = $(STATICPLUGINS.OBJECTS.$(o)) ;
|
||||||
if $(sourceobj)
|
if $(sourceobj)
|
||||||
{
|
{
|
||||||
CCFLAGS on $(o) += [ on $(sourceobj) GetVar CCFLAGS ] ;
|
CCFLAGS on $(o) += [ on $(sourceobj) GetVar CCFLAGS ] ;
|
||||||
C++FLAGS on $(o) += [ on $(sourceobj) GetVar C++FLAGS ] ;
|
C++FLAGS on $(o) += [ on $(sourceobj) GetVar C++FLAGS ] ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Write out needed CFLAGS, LFLAGS
|
# Write out needed CFLAGS, LFLAGS
|
||||||
STATICPLUGINS.DEPENDENCIES = $(name).jam ;
|
STATICPLUGINS.DEPENDENCIES = $(name).jam ;
|
||||||
MakeLocate $(STATICPLUGINS.DEPENDENCIES) : $(LOCATE.OBJECTS)/libs ;
|
MakeLocate $(STATICPLUGINS.DEPENDENCIES) : $(LOCATE.OBJECTS)/libs ;
|
||||||
for t in $(targets)
|
for t in $(targets)
|
||||||
{
|
{
|
||||||
WriteDependencies $(STATICPLUGINS.DEPENDENCIES) : $(t) : $(name) ;
|
WriteDependencies $(STATICPLUGINS.DEPENDENCIES) : $(t) : $(name) ;
|
||||||
}
|
}
|
||||||
Depends $(name) : $(STATICPLUGINS.DEPENDENCIES) ;
|
Depends $(name) : $(STATICPLUGINS.DEPENDENCIES) ;
|
||||||
Clean $(name)clean : $(STATICPLUGINS.DEPENDENCIES) ;
|
Clean $(name)clean : $(STATICPLUGINS.DEPENDENCIES) ;
|
||||||
|
|
||||||
# Install targets
|
# Install targets
|
||||||
Depends install_staticplugins :
|
Depends install_staticplugins :
|
||||||
[ DoInstall [ ConstructLibraryTarget $(name) ] : $(libdir) ] ;
|
[ DoInstall [ ConstructLibraryTarget $(name) ] : $(libdir) ] ;
|
||||||
Depends install_staticplugins : $(STATICPLUGINS.DEPENDENCIES) ;
|
Depends install_staticplugins : $(STATICPLUGINS.DEPENDENCIES) ;
|
||||||
Depends install_staticplugins :
|
Depends install_staticplugins :
|
||||||
[ DoInstall $(STATICPLUGINS.DEPENDENCIES) : $(libdir) ] ;
|
[ DoInstall $(STATICPLUGINS.DEPENDENCIES) : $(libdir) ] ;
|
||||||
Depends install_staticplugins : install_libs ;
|
Depends install_staticplugins : install_libs ;
|
||||||
|
|
||||||
INSTALLEDLIBS_OPTIONAL += $(name) ;
|
INSTALLEDLIBS_OPTIONAL += $(name) ;
|
||||||
|
|
||||||
# Collect library dependencies. The idea is to built all libs needed by the
|
# Collect library dependencies. The idea is to built all libs needed by the
|
||||||
# static plugins when "jam staticplugins" is invoked.
|
# static plugins when "jam staticplugins" is invoked.
|
||||||
for t in $(targets)
|
for t in $(targets)
|
||||||
{
|
{
|
||||||
local deplibs ;
|
local deplibs ;
|
||||||
if $($(t).NEEDLIBS)
|
if $($(t).NEEDLIBS)
|
||||||
{
|
{
|
||||||
deplibs += $($(t).NEEDLIBS) ;
|
deplibs += $($(t).NEEDLIBS) ;
|
||||||
}
|
}
|
||||||
deplibs = [ RemoveDups $(deplibs) ] ;
|
deplibs = [ RemoveDups $(deplibs) ] ;
|
||||||
Depends staticplugins : $(deplibs) ;
|
Depends staticplugins : $(deplibs) ;
|
||||||
}
|
}
|
||||||
Help staticplugins :
|
Help staticplugins :
|
||||||
"Build the library with static versions of all plugins" ;
|
"Build the library with static versions of all plugins" ;
|
||||||
Depends staticplugins : libs $(name) ;
|
Depends staticplugins : libs $(name) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
# Write out CFLAGS, LFLAGS needed by a plugin
|
# Write out CFLAGS, LFLAGS needed by a plugin
|
||||||
rule WriteDependencies
|
rule WriteDependencies
|
||||||
{
|
{
|
||||||
local cflags ;
|
local cflags ;
|
||||||
local lflags ;
|
local lflags ;
|
||||||
local depfile = $(<) ;
|
local depfile = $(<) ;
|
||||||
local plugin = $(>) ;
|
local plugin = $(>) ;
|
||||||
local name = $(3) ;
|
local name = $(3) ;
|
||||||
local depfile_gristed = $(depfile:G=$(plugin)) ;
|
local depfile_gristed = $(depfile:G=$(plugin)) ;
|
||||||
MakeLocate $(depfile_gristed) : [ on $(depfile) GetVar LOCATE ] ;
|
MakeLocate $(depfile_gristed) : [ on $(depfile) GetVar LOCATE ] ;
|
||||||
|
|
||||||
# Collect flags
|
# Collect flags
|
||||||
lflags += -l$(name) ;
|
lflags += -l$(name) ;
|
||||||
local libs = [ ResolveLibs $($(plugin).NEEDLIBS) ] ;
|
local libs = [ ResolveLibs $($(plugin).NEEDLIBS) ] ;
|
||||||
lflags += -l$(libs) ;
|
lflags += -l$(libs) ;
|
||||||
|
|
||||||
local l ;
|
local l ;
|
||||||
for l in $($(plugin).EXTERNALLIBS)
|
for l in $($(plugin).EXTERNALLIBS)
|
||||||
{
|
{
|
||||||
cflags += $($(l).CFLAGS) ;
|
cflags += $($(l).CFLAGS) ;
|
||||||
lflags += [ Filter $($(l).LFLAGS) : $(LINKLIBS) $(PLUGIN.LFLAGS) ] ;
|
lflags += [ Filter $($(l).LFLAGS) : $(LINKLIBS) $(PLUGIN.LFLAGS) ] ;
|
||||||
}
|
}
|
||||||
lflags += [ Filter $($(plugin).LFLAGS) : $(LINKLIBS) $(PLUGIN.LFLAGS) ] ;
|
lflags += [ Filter $($(plugin).LFLAGS) : $(LINKLIBS) $(PLUGIN.LFLAGS) ] ;
|
||||||
CFLAGS on $(depfile_gristed) = "$(cflags)" ;
|
CFLAGS on $(depfile_gristed) = "$(cflags)" ;
|
||||||
LFLAGS on $(depfile_gristed) = "$(lflags)" ;
|
LFLAGS on $(depfile_gristed) = "$(lflags)" ;
|
||||||
|
|
||||||
if $($(depfile).FIRSTTIME) != "yes"
|
if $($(depfile).FIRSTTIME) != "yes"
|
||||||
{
|
{
|
||||||
WriteDepFlags1 $(depfile_gristed) : $(plugin) ;
|
WriteDepFlags1 $(depfile_gristed) : $(plugin) ;
|
||||||
$(depfile).FIRSTTIME = "yes" ;
|
$(depfile).FIRSTTIME = "yes" ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WriteDepFlags2 $(depfile_gristed) : $(plugin) ;
|
WriteDepFlags2 $(depfile_gristed) : $(plugin) ;
|
||||||
}
|
}
|
||||||
Depends $(depfile) : $(depfile_gristed) ;
|
Depends $(depfile) : $(depfile_gristed) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
actions WriteDepFlags1
|
actions WriteDepFlags1
|
||||||
{
|
{
|
||||||
cat << EOT > $(<)
|
cat << EOT > $(<)
|
||||||
STATICPLUGINS.AVAILABLE += $(>) ;
|
STATICPLUGINS.AVAILABLE += $(>) ;
|
||||||
STATICPLUGIN.$(>).CFLAGS = $(CFLAGS) ;
|
STATICPLUGIN.$(>).CFLAGS = $(CFLAGS) ;
|
||||||
STATICPLUGIN.$(>).LFLAGS = $(LFLAGS) ;
|
STATICPLUGIN.$(>).LFLAGS = $(LFLAGS) ;
|
||||||
EOT
|
EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
actions WriteDepFlags2
|
actions WriteDepFlags2
|
||||||
{
|
{
|
||||||
cat << EOT >> $(<)
|
cat << EOT >> $(<)
|
||||||
STATICPLUGINS.AVAILABLE += $(>) ;
|
STATICPLUGINS.AVAILABLE += $(>) ;
|
||||||
STATICPLUGIN.$(>).CFLAGS = $(CFLAGS) ;
|
STATICPLUGIN.$(>).CFLAGS = $(CFLAGS) ;
|
||||||
STATICPLUGIN.$(>).LFLAGS = $(LFLAGS) ;
|
STATICPLUGIN.$(>).LFLAGS = $(LFLAGS) ;
|
||||||
EOT
|
EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
actions piecemeal GenerateStaticPluginRegistration1
|
actions piecemeal GenerateStaticPluginRegistration1
|
||||||
{
|
{
|
||||||
echo 'namespace csStaticPluginInit' >> $(<)
|
echo 'namespace csStaticPluginInit' >> $(<)
|
||||||
echo '{' >> $(<)
|
echo '{' >> $(<)
|
||||||
for x in $(>)
|
for x in $(>)
|
||||||
do
|
do
|
||||||
n=`basename $x $(SUFMETA)`
|
n=`basename $x $(SUFMETA)`
|
||||||
echo "static char const metainfo_${n}[] =" >> $(<)
|
echo "static char const metainfo_${n}[] =" >> $(<)
|
||||||
$(SED) 's:\\:\\\\:g;s:":\\":g;s:\(.*\):"\1":' < $x >>$(<)
|
$(SED) 's:\\:\\\\:g;s:":\\":g;s:\(.*\):"\1":' < $x >>$(<)
|
||||||
echo ";" >> $(<)
|
echo ";" >> $(<)
|
||||||
$(SED) '/<implementation>/!d;s:[ ]*<implementation>\(..*\)</implementation>: #ifndef \1_FACTORY_REGISTER_DEFINED \
|
$(SED) '/<implementation>/!d;s:[ ]*<implementation>\(..*\)</implementation>: #ifndef \1_FACTORY_REGISTER_DEFINED \
|
||||||
#define \1_FACTORY_REGISTER_DEFINED \
|
#define \1_FACTORY_REGISTER_DEFINED \
|
||||||
SCF_DEFINE_FACTORY_FUNC_REGISTRATION(\1) \
|
SCF_DEFINE_FACTORY_FUNC_REGISTRATION(\1) \
|
||||||
#endif:g' < $x >> $(<)
|
#endif:g' < $x >> $(<)
|
||||||
done
|
done
|
||||||
echo '' >> $(<)
|
echo '' >> $(<)
|
||||||
for x in $(>)
|
for x in $(>)
|
||||||
do
|
do
|
||||||
n=`basename $x $(SUFMETA)`
|
n=`basename $x $(SUFMETA)`
|
||||||
echo "class ${n}" >> $(<)
|
echo "class ${n}" >> $(<)
|
||||||
echo "{" >> $(<)
|
echo "{" >> $(<)
|
||||||
echo "SCF_REGISTER_STATIC_LIBRARY($n,metainfo_${n})" >>$(<)
|
echo "SCF_REGISTER_STATIC_LIBRARY($n,metainfo_${n})" >>$(<)
|
||||||
$(SED) '/<implementation>/!d;s:[ ]*<implementation>\(..*\)</implementation>: #ifndef \1_FACTORY_REGISTERED \
|
$(SED) '/<implementation>/!d;s:[ ]*<implementation>\(..*\)</implementation>: #ifndef \1_FACTORY_REGISTERED \
|
||||||
#define \1_FACTORY_REGISTERED \
|
#define \1_FACTORY_REGISTERED \
|
||||||
\1_StaticInit \1_static_init__; \
|
\1_StaticInit \1_static_init__; \
|
||||||
#endif:g' < $x >> $(<)
|
#endif:g' < $x >> $(<)
|
||||||
echo "public:" >> $(<)
|
echo "public:" >> $(<)
|
||||||
echo " ${n}();" >> $(<)
|
echo " ${n}();" >> $(<)
|
||||||
echo "};" >> $(<)
|
echo "};" >> $(<)
|
||||||
echo "$n::$n() {}" >> $(<)
|
echo "$n::$n() {}" >> $(<)
|
||||||
echo "" >> $(<)
|
echo "" >> $(<)
|
||||||
done
|
done
|
||||||
echo '}' >> $(<)
|
echo '}' >> $(<)
|
||||||
}
|
}
|
||||||
|
|||||||
36
mk/jam/strip.jam
Normal file
36
mk/jam/strip.jam
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#============================================================================
|
||||||
|
# Rules for stripping binaries
|
||||||
|
# Copyright (C)2006 by Frank Richter
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU Library General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
|
# option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful, but
|
||||||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
|
# License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Library General Public License
|
||||||
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
#
|
||||||
|
#============================================================================
|
||||||
|
|
||||||
|
## SplitDebugInfo binary
|
||||||
|
## Strips the debugging information into a separate external file.
|
||||||
|
rule SplitDebugInfo
|
||||||
|
{
|
||||||
|
local binary = $(1) ;
|
||||||
|
DoSplitDebugInfo $(binary) ;
|
||||||
|
return $(binary).dbg ;
|
||||||
|
}
|
||||||
|
|
||||||
|
actions DoSplitDebugInfo
|
||||||
|
{
|
||||||
|
$(CMD.OBJCOPY) --only-keep-debug $(<) $(<).dbg
|
||||||
|
$(CMD.OBJCOPY) --strip-unneeded $(<)
|
||||||
|
$(CMD.OBJCOPY) --add-gnu-debuglink=$(<).dbg $(<)
|
||||||
|
if [ "$(CHMOD)" ] ; then $(CHMOD) a-x $(<).dbg ; fi
|
||||||
|
}
|
||||||
@@ -1,109 +1,109 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Work around problems the SubDir rule of Jambase
|
# Work around problems the SubDir rule of Jambase
|
||||||
# (until jampeople accept my patches :-/ )
|
# (until jampeople accept my patches :-/ )
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
LOCATE.OBJECTS ?= $(BUILDTOP)/out/$(OSFULL[1]:L) ;
|
LOCATE.OBJECTS ?= $(BUILDTOP)/out/$(OSFULL[1]:L) ;
|
||||||
LOCATE.TARGETS ?= $(BUILDTOP) ;
|
LOCATE.TARGETS ?= $(BUILDTOP) ;
|
||||||
LOCATE.DOCS ?= $(BUILDTOP)/out/docs ;
|
LOCATE.DOCS ?= $(BUILDTOP)/out/docs ;
|
||||||
|
|
||||||
SUBDIRRULES += FixSubDirPath ;
|
SUBDIRRULES += FixSubDirPath ;
|
||||||
|
|
||||||
CMD.MKDIR ?= mkdir ;
|
CMD.MKDIR ?= mkdir ;
|
||||||
CMD.MKDIRS ?= "$(CMD.MKDIR) -p" ;
|
CMD.MKDIRS ?= "$(CMD.MKDIR) -p" ;
|
||||||
|
|
||||||
rule FixSubDirPath
|
rule FixSubDirPath
|
||||||
{
|
{
|
||||||
LOCATE_SOURCE = [ FDirName $(LOCATE.OBJECTS) $(SUBDIR_TOKENS) ] ;
|
LOCATE_SOURCE = [ FDirName $(LOCATE.OBJECTS) $(SUBDIR_TOKENS) ] ;
|
||||||
LOCATE_TARGET = [ FDirName $(LOCATE.OBJECTS) $(SUBDIR_TOKENS) ] ;
|
LOCATE_TARGET = [ FDirName $(LOCATE.OBJECTS) $(SUBDIR_TOKENS) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Fix bug in Jambase where SubInclude in the middle of a Jamfile made it break.
|
# Fix bug in Jambase where SubInclude in the middle of a Jamfile made it break.
|
||||||
rule SubInclude
|
rule SubInclude
|
||||||
{
|
{
|
||||||
if ! $($(<[1]))
|
if ! $($(<[1]))
|
||||||
{
|
{
|
||||||
Exit SubInclude $(<[1]) without prior SubDir $(<[1]) ;
|
Exit SubInclude $(<[1]) without prior SubDir $(<[1]) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
local save_SUBDIR_TOKENS = $(SUBDIR_TOKENS) ;
|
local save_SUBDIR_TOKENS = $(SUBDIR_TOKENS) ;
|
||||||
|
|
||||||
SubDir $(<) ;
|
SubDir $(<) ;
|
||||||
|
|
||||||
include $(JAMFILE:D=$(SUBDIR)) ;
|
include $(JAMFILE:D=$(SUBDIR)) ;
|
||||||
|
|
||||||
SubDir $(<[1]) $(save_SUBDIR_TOKENS) ;
|
SubDir $(<[1]) $(save_SUBDIR_TOKENS) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# This MakeLocate rule differs from the Jambase one in that it also works with
|
# This MakeLocate rule differs from the Jambase one in that it also works with
|
||||||
# files being in subdirectories.
|
# files being in subdirectories.
|
||||||
rule MakeLocate
|
rule MakeLocate
|
||||||
{
|
{
|
||||||
# MakeLocate targets : directory ;
|
# MakeLocate targets : directory ;
|
||||||
|
|
||||||
# Sets special variable LOCATE on targets, and arranges
|
# Sets special variable LOCATE on targets, and arranges
|
||||||
# with MkDir to create target directory.
|
# with MkDir to create target directory.
|
||||||
|
|
||||||
# Note we grist the directory name with 'dir',
|
# Note we grist the directory name with 'dir',
|
||||||
# so that directory path components and other
|
# so that directory path components and other
|
||||||
# targets don't conflict.
|
# targets don't conflict.
|
||||||
|
|
||||||
if $(>) && $(>) != ""
|
if $(>) && $(>) != ""
|
||||||
{
|
{
|
||||||
local i ;
|
local i ;
|
||||||
for i in $(<)
|
for i in $(<)
|
||||||
{
|
{
|
||||||
LOCATE on $(i) = $(>) ;
|
LOCATE on $(i) = $(>) ;
|
||||||
|
|
||||||
local targetfile = $(i:R=$(>)) ;
|
local targetfile = $(i:R=$(>)) ;
|
||||||
local targetdir = $(targetfile:D) ;
|
local targetdir = $(targetfile:D) ;
|
||||||
if ! $(targetdir) { targetdir = "." ; }
|
if ! $(targetdir) { targetdir = "." ; }
|
||||||
targetdir = $(targetdir:G=dir) ;
|
targetdir = $(targetdir:G=dir) ;
|
||||||
Depends $(i) : $(targetdir) ;
|
Depends $(i) : $(targetdir) ;
|
||||||
MkDir $(targetdir) ;
|
MkDir $(targetdir) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# The default MkDir rule in Jambase has problems when paths contains a sequence
|
# The default MkDir rule in Jambase has problems when paths contains a sequence
|
||||||
# of multiple slashes (ie. bla////fup). We solve these problems and greatly
|
# of multiple slashes (ie. bla////fup). We solve these problems and greatly
|
||||||
# simply this rule by using the "mkdir -p" or mkdirs command.
|
# simply this rule by using the "mkdir -p" or mkdirs command.
|
||||||
rule MkDir
|
rule MkDir
|
||||||
{
|
{
|
||||||
# MkDir directory ;
|
# MkDir directory ;
|
||||||
|
|
||||||
# Make a directory and all its parent directories.
|
# Make a directory and all its parent directories.
|
||||||
|
|
||||||
# Ignore timestamps on directories: we only care if they
|
# Ignore timestamps on directories: we only care if they
|
||||||
# exist.
|
# exist.
|
||||||
|
|
||||||
NoUpdate $(<) ;
|
NoUpdate $(<) ;
|
||||||
|
|
||||||
# don't create the dir multiple times
|
# don't create the dir multiple times
|
||||||
if ! $($(<)-mkdir)
|
if ! $($(<)-mkdir)
|
||||||
{
|
{
|
||||||
$(<)-mkdir = true ;
|
$(<)-mkdir = true ;
|
||||||
MkDir1 $(<) ;
|
MkDir1 $(<) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
actions MkDir1
|
actions MkDir1
|
||||||
{
|
{
|
||||||
$(CMD.MKDIRS) "$(<)"
|
$(CMD.MKDIRS) "$(<)"
|
||||||
}
|
}
|
||||||
|
|||||||
450
mk/jam/swig.jam
450
mk/jam/swig.jam
@@ -1,225 +1,225 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Rules for swig
|
# Rules for swig
|
||||||
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
if $(CMD.SWIG)
|
if $(CMD.SWIG)
|
||||||
{
|
{
|
||||||
# Post-processing of the Swig-generated C++ file.
|
# Post-processing of the Swig-generated C++ file.
|
||||||
#
|
#
|
||||||
# (1) We need to ensure that <stdint.h> defines INT64_C() and cousins, which
|
# (1) We need to ensure that <stdint.h> defines INT64_C() and cousins, which
|
||||||
# means that the __STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS macros must
|
# means that the __STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS macros must
|
||||||
# be defined before <stdint.h> is included. In some Python installations,
|
# be defined before <stdint.h> is included. In some Python installations,
|
||||||
# Python.h includes <stdint.h>, and Swig-generated output includes Python.h
|
# Python.h includes <stdint.h>, and Swig-generated output includes Python.h
|
||||||
# before we ever have a chance to define the __STDC_* macros. There is no
|
# before we ever have a chance to define the __STDC_* macros. There is no
|
||||||
# Swig-supported mechanism allowing us to insert these #defines before
|
# Swig-supported mechanism allowing us to insert these #defines before
|
||||||
# Python.h is included, so we post-process the output file.
|
# Python.h is included, so we post-process the output file.
|
||||||
#
|
#
|
||||||
# (2) We #undefine _DEBUG, to ensure that python23.lib is used by MSVC
|
# (2) We #undefine _DEBUG, to ensure that python23.lib is used by MSVC
|
||||||
# instead of python23_d.lib.
|
# instead of python23_d.lib.
|
||||||
#
|
#
|
||||||
# (3) Delete any lines containing the CVS `Header' keyword to ensure that CVS
|
# (3) Delete any lines containing the CVS `Header' keyword to ensure that CVS
|
||||||
# does not consider the file changed simply because `Header' expansion
|
# does not consider the file changed simply because `Header' expansion
|
||||||
# differs.
|
# differs.
|
||||||
#
|
#
|
||||||
# (4) Swig 1.3.22 for Perl emits illegal expressions `new (sometype)[n]'
|
# (4) Swig 1.3.22 for Perl emits illegal expressions `new (sometype)[n]'
|
||||||
# rather than `new sometype[n]' (at least gcc considers it illegal),
|
# rather than `new sometype[n]' (at least gcc considers it illegal),
|
||||||
# therefore, we transform the expression by dropping the parentheses.
|
# therefore, we transform the expression by dropping the parentheses.
|
||||||
#
|
#
|
||||||
# (5) cs_pyth.cpp contains a macro "#define SWIG_init init_cspace". However,
|
# (5) cs_pyth.cpp contains a macro "#define SWIG_init init_cspace". However,
|
||||||
# cs_pyth.cpp may reside in a shared lib, so we rather want the name
|
# cs_pyth.cpp may reside in a shared lib, so we rather want the name
|
||||||
# SWIG_init and define init_cspace as a simple forwared ourselves.
|
# SWIG_init and define init_cspace as a simple forwared ourselves.
|
||||||
#
|
#
|
||||||
# (6) perl.h includes dirent.h on some configurations which conflicts with
|
# (6) perl.h includes dirent.h on some configurations which conflicts with
|
||||||
# the CS definitions of dirent, opendir, etc. So define _DIRENT_H_ to
|
# the CS definitions of dirent, opendir, etc. So define _DIRENT_H_ to
|
||||||
# make dirent.h skip its body. This is hackish but no better solution
|
# make dirent.h skip its body. This is hackish but no better solution
|
||||||
# has been found.
|
# has been found.
|
||||||
#
|
#
|
||||||
# (Despite the fact that these customizations might seem project-specific,
|
# (Despite the fact that these customizations might seem project-specific,
|
||||||
# they should be safe for all projects.)
|
# they should be safe for all projects.)
|
||||||
SWIG.SED_SCRIPT =
|
SWIG.SED_SCRIPT =
|
||||||
"'s/\\([ ]*#[ ]*include[ ][ ]*[<\"]Python.h[>\"]\\)/\\
|
"'s/\\([ ]*#[ ]*include[ ][ ]*[<\"]Python.h[>\"]\\)/\\
|
||||||
#ifndef __STDC_CONSTANT_MACROS\\
|
#ifndef __STDC_CONSTANT_MACROS\\
|
||||||
#define __STDC_CONSTANT_MACROS\\
|
#define __STDC_CONSTANT_MACROS\\
|
||||||
#endif\\
|
#endif\\
|
||||||
#ifndef __STDC_LIMIT_MACROS\\
|
#ifndef __STDC_LIMIT_MACROS\\
|
||||||
#define __STDC_LIMIT_MACROS\\
|
#define __STDC_LIMIT_MACROS\\
|
||||||
#endif\\
|
#endif\\
|
||||||
#ifndef DEBUG_PYTHON\\
|
#ifndef DEBUG_PYTHON\\
|
||||||
#undef _DEBUG\\
|
#undef _DEBUG\\
|
||||||
#endif\\
|
#endif\\
|
||||||
\\1/g
|
\\1/g
|
||||||
/\$Header:/d
|
/\$Header:/d
|
||||||
s/new[ ][ ]*(\\([^)][^)]*\\))[ ]*\\[/new \\1 [/g
|
s/new[ ][ ]*(\\([^)][^)]*\\))[ ]*\\[/new \\1 [/g
|
||||||
s/[ ]*#[ ]*define[ ][ ]*SWIG_init[ ]*init_\\(.*\\)/#define SWIG_init SWIG_init_\\1/g
|
s/[ ]*#[ ]*define[ ][ ]*SWIG_init[ ]*init_\\(.*\\)/#define SWIG_init SWIG_init_\\1/g
|
||||||
s/\\([ ]*#[ ]*include[ ][ ]*[<\"]perl.h[>\"]\\)/\\
|
s/\\([ ]*#[ ]*include[ ][ ]*[<\"]perl.h[>\"]\\)/\\
|
||||||
#ifndef _DIRENT_H_\\
|
#ifndef _DIRENT_H_\\
|
||||||
#define _DIRENT_H_\\
|
#define _DIRENT_H_\\
|
||||||
#endif\\
|
#endif\\
|
||||||
\\1/g'" ;
|
\\1/g'" ;
|
||||||
|
|
||||||
## Swig targets : swigfile : language [ : swigflags [ : swigincdirs
|
## Swig targets : swigfile : language [ : swigflags [ : swigincdirs
|
||||||
## [ : swigfiledir [ : frozendirs [ : tag [ : outdir ]]]]]]
|
## [ : swigfiledir [ : frozendirs [ : tag [ : outdir ]]]]]]
|
||||||
## Given a Swig input file `swigfile', generate `targets' for scripting
|
## Given a Swig input file `swigfile', generate `targets' for scripting
|
||||||
## language `language'. The first element of `targets' should name the
|
## language `language'. The first element of `targets' should name the
|
||||||
## generated C or C++ file, and the remaining optional elements should name
|
## generated C or C++ file, and the remaining optional elements should name
|
||||||
## any other language-specific scripting files which Swig will generate.
|
## any other language-specific scripting files which Swig will generate.
|
||||||
## For instance, the files widgets.cpp and widgets.py might be emitted by
|
## For instance, the files widgets.cpp and widgets.py might be emitted by
|
||||||
## Swig for the input file widgets.i. The generated files are placed in
|
## Swig for the input file widgets.i. The generated files are placed in
|
||||||
## $(LOCATE_TARGET). `swigflags' specifies additional flags to pass to
|
## $(LOCATE_TARGET). `swigflags' specifies additional flags to pass to
|
||||||
## Swig. `swigincdirs' is a list of additional directories which Swig
|
## Swig. `swigincdirs' is a list of additional directories which Swig
|
||||||
## should search for files which it includes. `swigfiledir' specifies the
|
## should search for files which it includes. `swigfiledir' specifies the
|
||||||
## location of `swigfile' if it does not reside in the present source
|
## location of `swigfile' if it does not reside in the present source
|
||||||
## directory. This rule defines top-level targets named "$(tag)swig",
|
## directory. This rule defines top-level targets named "$(tag)swig",
|
||||||
## which generates `targets' on-demand; and "$(tag)swigclean", which
|
## which generates `targets' on-demand; and "$(tag)swigclean", which
|
||||||
## deletes the generated files. `tag' is a simple identifier out of which
|
## deletes the generated files. `tag' is a simple identifier out of which
|
||||||
## top-level pseudo-targets names are constructed. If `tag' is not
|
## top-level pseudo-targets names are constructed. If `tag' is not
|
||||||
## provided, then `language' is used instead. If `frozentargdirs' is
|
## provided, then `language' is used instead. If `frozentargdirs' is
|
||||||
## provided, then an additional top-level target named "$(tag)freeze" is
|
## provided, then an additional top-level target named "$(tag)freeze" is
|
||||||
## defined, which copies the generated files to the specified directories.
|
## defined, which copies the generated files to the specified directories.
|
||||||
## If `frozentargdirs' contains only one element, then all generated files
|
## If `frozentargdirs' contains only one element, then all generated files
|
||||||
## are copied to that directory. If it contains two elements, then the
|
## are copied to that directory. If it contains two elements, then the
|
||||||
## first element of `targets' is copied to the first element of
|
## first element of `targets' is copied to the first element of
|
||||||
## `frozentargdirs', and all remaining elements of `targets' are copied to
|
## `frozentargdirs', and all remaining elements of `targets' are copied to
|
||||||
## the second element of `frozentargdirs'. `outdir', if provided, is a list
|
## the second element of `frozentargdirs'. `outdir', if provided, is a list
|
||||||
## of path components which specify a subdirectory in which Swig should
|
## of path components which specify a subdirectory in which Swig should
|
||||||
## place the language-specific support files, rather than placing them in
|
## place the language-specific support files, rather than placing them in
|
||||||
## $(LOCATE_TARGET). This might be useful, for instance, when Swig is in
|
## $(LOCATE_TARGET). This might be useful, for instance, when Swig is in
|
||||||
## Java mode, and the .java files must be placed in a directory hierarchy
|
## Java mode, and the .java files must be placed in a directory hierarchy
|
||||||
## which reflects the full package name.
|
## which reflects the full package name.
|
||||||
rule Swig
|
rule Swig
|
||||||
{
|
{
|
||||||
local target = $(1[1]) ;
|
local target = $(1[1]) ;
|
||||||
local othertargets = $(1[2-]) ;
|
local othertargets = $(1[2-]) ;
|
||||||
local swigfile = $(2) ;
|
local swigfile = $(2) ;
|
||||||
local language = $(3) ;
|
local language = $(3) ;
|
||||||
local swigflags = $(4) ;
|
local swigflags = $(4) ;
|
||||||
local swigincdirs = $(5) ;
|
local swigincdirs = $(5) ;
|
||||||
local swigfiledir = $(6) ;
|
local swigfiledir = $(6) ;
|
||||||
local frozentargetdir = $(7[1]) ;
|
local frozentargetdir = $(7[1]) ;
|
||||||
local frozenotherdir = $(7[2-]) ;
|
local frozenotherdir = $(7[2-]) ;
|
||||||
local tag = $(8) ;
|
local tag = $(8) ;
|
||||||
local outdir = $(9) ;
|
local outdir = $(9) ;
|
||||||
|
|
||||||
if ! $(frozenotherdir) { frozenotherdir = $(frozentargetdir) ; }
|
if ! $(frozenotherdir) { frozenotherdir = $(frozentargetdir) ; }
|
||||||
if ! $(tag) { tag = $(language) ; }
|
if ! $(tag) { tag = $(language) ; }
|
||||||
if ! $(outdir) { outdir = $(LOCATE_TARGET) ; }
|
if ! $(outdir) { outdir = $(LOCATE_TARGET) ; }
|
||||||
|
|
||||||
Depends $(target) : $(swigfile) ;
|
Depends $(target) : $(swigfile) ;
|
||||||
MakeLocate $(target) : $(LOCATE_TARGET) ;
|
MakeLocate $(target) : $(LOCATE_TARGET) ;
|
||||||
if $(othertargets)
|
if $(othertargets)
|
||||||
{
|
{
|
||||||
MakeLocate $(othertargets) : $(outdir) ;
|
MakeLocate $(othertargets) : $(outdir) ;
|
||||||
|
|
||||||
# If any target, such as an install target, depends upon the other files,
|
# If any target, such as an install target, depends upon the other files,
|
||||||
# we force them to be built with a dependency upon the target.
|
# we force them to be built with a dependency upon the target.
|
||||||
Depends $(othertargets) : $(target) ;
|
Depends $(othertargets) : $(target) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIG.FLAGS on $(target) +=
|
SWIG.FLAGS on $(target) +=
|
||||||
$(SWIG.FLAGS) -$(language) $(swigflags) -I$(swigincdirs)
|
$(SWIG.FLAGS) -$(language) $(swigflags) -I$(swigincdirs)
|
||||||
-outdir [ ConcatDirs $(outdir) ] ;
|
-outdir [ ConcatDirs $(outdir) ] ;
|
||||||
|
|
||||||
# Allow Swig input file to reside at location other than $(SEARCH_SOURCE).
|
# Allow Swig input file to reside at location other than $(SEARCH_SOURCE).
|
||||||
if $(swigfiledir)
|
if $(swigfiledir)
|
||||||
{
|
{
|
||||||
SEARCH on $(swigfile) = $(swigfiledir) ;
|
SEARCH on $(swigfile) = $(swigfiledir) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SEARCH on $(swigfile) = $(SEARCH_SOURCE) ;
|
SEARCH on $(swigfile) = $(SEARCH_SOURCE) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Scan for special Swig includes.
|
# Scan for special Swig includes.
|
||||||
HDRGRIST on $(swigfile) = $(HDRGRIST) ;
|
HDRGRIST on $(swigfile) = $(HDRGRIST) ;
|
||||||
HDRSEARCH on $(swigfile) =
|
HDRSEARCH on $(swigfile) =
|
||||||
$(SEARCH_SOURCE:E) $(SUBDIRHDRS) $(HDRS) $(STDHDRS) ;
|
$(SEARCH_SOURCE:E) $(SUBDIRHDRS) $(HDRS) $(STDHDRS) ;
|
||||||
HDRRULE on $(swigfile) = HeaderRule ;
|
HDRRULE on $(swigfile) = HeaderRule ;
|
||||||
HDRSCAN on $(swigfile) = $(SWIG.HDRPATTERN) ;
|
HDRSCAN on $(swigfile) = $(SWIG.HDRPATTERN) ;
|
||||||
|
|
||||||
RunSwig $(target) : $(swigfile) ;
|
RunSwig $(target) : $(swigfile) ;
|
||||||
Depends $(tag)swig : $(target) ;
|
Depends $(tag)swig : $(target) ;
|
||||||
NotFile $(tag)swig ;
|
NotFile $(tag)swig ;
|
||||||
Always $(tag)swig ;
|
Always $(tag)swig ;
|
||||||
Help $(tag)swig : "Generate Swig files for $(tag)" ;
|
Help $(tag)swig : "Generate Swig files for $(tag)" ;
|
||||||
|
|
||||||
Clean $(tag)swigclean : $(target) $(othertargets) ;
|
Clean $(tag)swigclean : $(target) $(othertargets) ;
|
||||||
Depends clean : $(tag)swigclean ;
|
Depends clean : $(tag)swigclean ;
|
||||||
|
|
||||||
if $(frozentargetdir)
|
if $(frozentargetdir)
|
||||||
{
|
{
|
||||||
local frozen_target = $(target:G=$(tag)freeze) ;
|
local frozen_target = $(target:G=$(tag)freeze) ;
|
||||||
MakeLocate $(frozen_target) : $(frozentargetdir) ;
|
MakeLocate $(frozen_target) : $(frozentargetdir) ;
|
||||||
Depends $(frozen_target) : $(target) ;
|
Depends $(frozen_target) : $(target) ;
|
||||||
Copy $(frozen_target) : $(target) ;
|
Copy $(frozen_target) : $(target) ;
|
||||||
Depends $(tag)freeze : $(frozen_target) ;
|
Depends $(tag)freeze : $(frozen_target) ;
|
||||||
|
|
||||||
if $(othertargets)
|
if $(othertargets)
|
||||||
{
|
{
|
||||||
local frozen_other = $(othertargets:G=$(tag)freeze) ;
|
local frozen_other = $(othertargets:G=$(tag)freeze) ;
|
||||||
MakeLocate $(frozen_other) : $(frozenotherdir) ;
|
MakeLocate $(frozen_other) : $(frozenotherdir) ;
|
||||||
Depends $(frozen_other) : $(othertargets) ;
|
Depends $(frozen_other) : $(othertargets) ;
|
||||||
Copy $(frozen_other) : $(othertargets) ;
|
Copy $(frozen_other) : $(othertargets) ;
|
||||||
Depends $(tag)freeze : $(frozen_other) ;
|
Depends $(tag)freeze : $(frozen_other) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
NotFile $(tag)freeze ;
|
NotFile $(tag)freeze ;
|
||||||
Help $(tag)freeze : "Copy generated Swig files to source directory" ;
|
Help $(tag)freeze : "Copy generated Swig files to source directory" ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
actions RunSwig
|
actions RunSwig
|
||||||
{
|
{
|
||||||
$(CMD.SWIG) $(SWIG.FLAGS) -o $(<) $(>)
|
$(CMD.SWIG) $(SWIG.FLAGS) -o $(<) $(>)
|
||||||
$(SED) $(SWIG.SED_SCRIPT) < $(<) > $(<).sed
|
$(SED) $(SWIG.SED_SCRIPT) < $(<) > $(<).sed
|
||||||
$(RM) $(<)
|
$(RM) $(<)
|
||||||
$(MV) $(<).sed $(<)
|
$(MV) $(<).sed $(<)
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIG.SIMPLE.LANGUAGE ?= python ;
|
SWIG.SIMPLE.LANGUAGE ?= python ;
|
||||||
SWIG.SIMPLE.EXT ?= py ;
|
SWIG.SIMPLE.EXT ?= py ;
|
||||||
SWIG.SIMPLE.FLAGS ?= -c++ -shadow ;
|
SWIG.SIMPLE.FLAGS ?= -c++ -shadow ;
|
||||||
|
|
||||||
## SimpleSwig swigfile
|
## SimpleSwig swigfile
|
||||||
## Given a Swig input file (.i), invokes Swig to generate a .cpp file with
|
## Given a Swig input file (.i), invokes Swig to generate a .cpp file with
|
||||||
## the same basename, and a script file with the same basename.
|
## the same basename, and a script file with the same basename.
|
||||||
## SWIG.SIMPLE.LANGUAGE specifies the language for which Swig should emit a
|
## SWIG.SIMPLE.LANGUAGE specifies the language for which Swig should emit a
|
||||||
## binding; SWIG.SIMPLE.EXT indicates the file extension of the generated
|
## binding; SWIG.SIMPLE.EXT indicates the file extension of the generated
|
||||||
## script file; SWIG.SIMPLE.FLAGS specifies additional flags for Swig.
|
## script file; SWIG.SIMPLE.FLAGS specifies additional flags for Swig.
|
||||||
rule SimpleSwig
|
rule SimpleSwig
|
||||||
{
|
{
|
||||||
local object = [ DoObjectGrist $(<:S=$(SUFOBJ)) ] ;
|
local object = [ DoObjectGrist $(<:S=$(SUFOBJ)) ] ;
|
||||||
local cppfile = $(<:S=.cpp) ;
|
local cppfile = $(<:S=.cpp) ;
|
||||||
local script = $(<:S=.$(SWIG.SIMPLE.EXT)) ;
|
local script = $(<:S=.$(SWIG.SIMPLE.EXT)) ;
|
||||||
|
|
||||||
C++ $(object) : $(cppfile) ;
|
C++ $(object) : $(cppfile) ;
|
||||||
Swig $(cppfile) $(script) : $(<) : $(SWIG.SIMPLE.LANGUAGE) :
|
Swig $(cppfile) $(script) : $(<) : $(SWIG.SIMPLE.LANGUAGE) :
|
||||||
$(SWIG.SIMPLE.FLAGS) ;
|
$(SWIG.SIMPLE.FLAGS) ;
|
||||||
|
|
||||||
return $(object) ;
|
return $(object) ;
|
||||||
}
|
}
|
||||||
RegisterFileType SimpleSwig : .i ;
|
RegisterFileType SimpleSwig : .i ;
|
||||||
|
|
||||||
if ! $(NO_SWIG_HEADER_SCANNING)
|
if ! $(NO_SWIG_HEADER_SCANNING)
|
||||||
{
|
{
|
||||||
SWIG.HDRPATTERN =
|
SWIG.HDRPATTERN =
|
||||||
"^[ ]*[%#][ ]*include[ ]*[<\"]([^\">]*)[\">].*$" ;
|
"^[ ]*[%#][ ]*include[ ]*[<\"]([^\">]*)[\">].*$" ;
|
||||||
RegisterHeaderRule HeaderRule : $(SWIG.HDRPATTERN) : .i ;
|
RegisterHeaderRule HeaderRule : $(SWIG.HDRPATTERN) : .i ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1152
mk/jam/unittest.jam
1152
mk/jam/unittest.jam
File diff suppressed because it is too large
Load Diff
310
mk/jam/unix.jam
310
mk/jam/unix.jam
@@ -1,151 +1,159 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Jam configuration and actions for Unix (GNU/Linux, BSD, Darwin, etc.)
|
# Jam configuration and actions for Unix (GNU/Linux, BSD, Darwin, etc.)
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
SHELL ?= "/bin/sh" ;
|
SHELL ?= "/bin/sh" ;
|
||||||
|
|
||||||
# Only use nasm on x86 for now...
|
# Only use nasm on x86 for now...
|
||||||
NASM.FLAGS += -f elf ;
|
NASM.FLAGS += -f elf ;
|
||||||
|
|
||||||
PLUGIN.CFLAGS += $(COMPILER.C++FLAGS.PIC) ;
|
PLUGIN.CFLAGS += $(COMPILER.C++FLAGS.PIC) ;
|
||||||
LIBRARY.CFLAGS += $(COMPILER.C++FLAGS.PIC) ;
|
LIBRARY.CFLAGS += $(COMPILER.C++FLAGS.PIC) ;
|
||||||
|
|
||||||
# The BFD tag name under which to embed meta-information into a plugin module.
|
# The BFD tag name under which to embed meta-information into a plugin module.
|
||||||
# This much match the name expected by csGetPluginMetadata() (bfdplugins.cpp).
|
# This much match the name expected by csGetPluginMetadata() (bfdplugins.cpp).
|
||||||
SECTION_TAG_NAME ?= .crystalspace ;
|
SECTION_TAG_NAME ?= .crystalspace ;
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# platform specific rules
|
# platform specific rules
|
||||||
|
|
||||||
## ConstructApplicationTarget target : options
|
## ConstructApplicationTarget target : options
|
||||||
## Constructs the application target name (ie. foo.exe for foo)
|
## Constructs the application target name (ie. foo.exe for foo)
|
||||||
rule ConstructApplicationTarget
|
rule ConstructApplicationTarget
|
||||||
{
|
{
|
||||||
return $(<) ;
|
return $(<) ;
|
||||||
}
|
}
|
||||||
rule ConstructStaticLibraryTarget
|
rule ConstructStaticLibraryTarget
|
||||||
{
|
{
|
||||||
return lib$(<)$(SUFLIB) ;
|
return lib$(<)$(SUFLIB) ;
|
||||||
}
|
}
|
||||||
rule ConstructSharedLibraryTarget
|
rule ConstructSharedLibraryTarget
|
||||||
{
|
{
|
||||||
return lib$(<).so.$(PACKAGE_VERSION) ;
|
return lib$(<).so.$(PACKAGE_VERSION) ;
|
||||||
}
|
}
|
||||||
rule ConstructSharedLibraryLinkLib
|
rule ConstructSharedLibraryLinkLib
|
||||||
{
|
{
|
||||||
return lib$(<).so.$(PACKAGE_VERSION) ;
|
return lib$(<).so.$(PACKAGE_VERSION) ;
|
||||||
}
|
}
|
||||||
rule ConstructPluginTarget
|
rule ConstructPluginTarget
|
||||||
{
|
{
|
||||||
return $(<).so ;
|
return $(<).so ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# SystemLinkApplication target : objects : options
|
# SystemLinkApplication target : objects : options
|
||||||
# do system specific actions needed for linking the application and construct
|
# do system specific actions needed for linking the application and construct
|
||||||
# correct clean targets.
|
# correct clean targets.
|
||||||
rule SystemLinkApplication
|
rule SystemLinkApplication
|
||||||
{
|
{
|
||||||
local target = $($(<)_TARGET) ;
|
local target = $($(<)_TARGET) ;
|
||||||
|
|
||||||
Depends $(target) : $(>) ;
|
Depends $(target) : $(>) ;
|
||||||
LinkApplication $(target) : $(>) ;
|
LinkApplication $(target) : $(>) ;
|
||||||
# setup clean rules
|
# setup clean rules
|
||||||
Clean clean : $(target) ;
|
Clean clean : $(target) ;
|
||||||
Clean $(<)clean : $(target) ;
|
Clean $(<)clean : $(target) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule SystemInstallApplication
|
rule SystemInstallApplication
|
||||||
{
|
{
|
||||||
Depends install_bin :
|
Depends install_bin :
|
||||||
[ DoInstall $(<) : $(bindir) $(2) : $(INSTALL_PROGRAM) ] ;
|
[ DoInstall $(<) : $(bindir) $(2) : $(INSTALL_PROGRAM) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule SystemInstallPlugin
|
rule SystemInstallPlugin
|
||||||
{
|
{
|
||||||
Depends install_plugin : [ DoInstall $(<) : $(plugindir) $(2) :
|
Depends install_plugin : [ DoInstall $(<) : $(plugindir) $(2) :
|
||||||
$(INSTALL_PROGRAM) ] ;
|
$(INSTALL_PROGRAM) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Put the meta data into the object file headers
|
# Put the meta data into the object file headers
|
||||||
rule ObjTagMetaData
|
rule ObjTagMetaData
|
||||||
{
|
{
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) ;
|
||||||
}
|
}
|
||||||
actions ObjTagMetaData
|
actions ObjTagMetaData
|
||||||
{
|
{
|
||||||
$(CMD.OBJCOPY) --add-section $(SECTION_TAG_NAME)=$(>) $(<)
|
$(CMD.OBJCOPY) --add-section $(SECTION_TAG_NAME)=$(>) $(<)
|
||||||
}
|
}
|
||||||
|
|
||||||
# SystemLinkPlugin target : objects : options
|
# SystemLinkPlugin target : objects : options
|
||||||
# do system specific actions needed for linking the plugin and construct
|
# do system specific actions needed for linking the plugin and construct
|
||||||
# correct clean targets.
|
# correct clean targets.
|
||||||
rule SystemLinkPlugin
|
rule SystemLinkPlugin
|
||||||
{
|
{
|
||||||
local target = $($(<)_TARGET) ;
|
local target = $($(<)_TARGET) ;
|
||||||
|
|
||||||
Depends $(target) : $(>) ;
|
Depends $(target) : $(>) ;
|
||||||
LinkPlugin $(target) : $(>) ;
|
LinkPlugin $(target) : $(>) ;
|
||||||
if $(EMBED_META) = "yes" && $(OBJCOPY.AVAILABLE) = "yes"
|
if $(EMBED_META) = "yes" && $(OBJCOPY.AVAILABLE) = "yes"
|
||||||
{
|
{
|
||||||
ObjTagMetaData $(target) : $($(<)_METAFILE) ;
|
ObjTagMetaData $(target) : $($(<)_METAFILE) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PluginMetaData $(<) : $($(<)_METAFILE) : $(3) ;
|
PluginMetaData $(<) : $($(<)_METAFILE) : $(3) ;
|
||||||
}
|
}
|
||||||
# setup clean rules
|
# setup clean rules
|
||||||
Clean clean : $(target) ;
|
Clean clean : $(target) ;
|
||||||
Clean $(<)clean : $(target) ;
|
Clean $(<)clean : $(target) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule SystemLinkSharedLibrary
|
rule SystemLinkSharedLibrary
|
||||||
{
|
{
|
||||||
LFlags $(<) : $(LINKLIBS) ;
|
LFlags $(<) : $(LINKLIBS) ;
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) ;
|
||||||
LinkSharedLibrary $(<) : $(>) : $(3) ;
|
local response = $(<).resp ;
|
||||||
|
MakeLocate $(response) : $(LOCATE.OBJECTS)/libs ;
|
||||||
Clean clean : $(<) ;
|
ResponseFile $(response) : $(>) ;
|
||||||
Clean $(<)clean : $(<) ;
|
# @@@ FIXME: response files are only supported on newer binutils
|
||||||
}
|
# But quite useful to avoid blowing jam's 10240 max action length.
|
||||||
|
#Depends $(response) : $(>) ;
|
||||||
actions LinkApplication bind NEEDLIBS bind EXTRAOBJECTS
|
#Depends $(<) : $(response) ;
|
||||||
{
|
#LinkSharedLibrary $(<) : $(response) ;
|
||||||
$(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
|
LinkSharedLibrary $(<) : $(>) ;
|
||||||
}
|
|
||||||
|
Clean clean : $(<) ;
|
||||||
if $(PLUGIN.LFLAGS.USE_SONAME) = "yes"
|
Clean $(<)clean : $(<) ;
|
||||||
{
|
}
|
||||||
actions LinkPlugin bind NEEDLIBS bind EXTRAOBJECTS
|
|
||||||
{
|
actions LinkApplication bind NEEDLIBS bind EXTRAOBJECTS
|
||||||
$(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS) \
|
{
|
||||||
-Wl,-soname,$(<:BS)
|
$(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
if $(PLUGIN.LFLAGS.USE_SONAME) = "yes"
|
||||||
{
|
{
|
||||||
actions LinkPlugin bind NEEDLIBS bind EXTRAOBJECTS
|
actions LinkPlugin bind NEEDLIBS bind EXTRAOBJECTS
|
||||||
{
|
{
|
||||||
$(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
|
$(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS) \
|
||||||
}
|
-Wl,-soname,$(<:BS)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
actions LinkSharedLibrary bind NEEDLIBS bind EXTRAOBJECTS
|
else
|
||||||
{
|
{
|
||||||
$(CMD.LINK) -shared -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS) \
|
actions LinkPlugin bind NEEDLIBS bind EXTRAOBJECTS
|
||||||
-Wl,-soname,$(<:BS)
|
{
|
||||||
}
|
$(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
actions LinkSharedLibrary bind NEEDLIBS bind EXTRAOBJECTS
|
||||||
|
{
|
||||||
|
$(CMD.LINK) -shared -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS) \
|
||||||
|
-Wl,-soname,$(<:BS)
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,58 +1,58 @@
|
|||||||
#============================================================================
|
#============================================================================
|
||||||
# Setup of compiler/linker flags for debug/optimize mode
|
# Setup of compiler/linker flags for debug/optimize mode
|
||||||
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
# This library is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU Library General Public License as published by
|
# under the terms of the GNU Library General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or (at your
|
# the Free Software Foundation; either version 2 of the License, or (at your
|
||||||
# option) any later version.
|
# option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful, but
|
# This library is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||||
# License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Library General Public License
|
# You should have received a copy of the GNU Library General Public License
|
||||||
# along with this library; if not, write to the Free Software Foundation,
|
# along with this library; if not, write to the Free Software Foundation,
|
||||||
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
if ! $(VARIANT)
|
if ! $(VARIANT)
|
||||||
{
|
{
|
||||||
VARIANT = $(MODE) ;
|
VARIANT = $(MODE) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if $(VARIANT) != "debug" && $(VARIANT) != "optimize" && $(VARIANT) != "profile"
|
if $(VARIANT) != "debug" && $(VARIANT) != "optimize" && $(VARIANT) != "profile"
|
||||||
{
|
{
|
||||||
exit "Invalid modus set, please set VARIANT to debug, profile or optimize" ;
|
exit "Invalid modus set, please set VARIANT to debug, profile or optimize" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set modus related flags
|
# Set modus related flags
|
||||||
CCFLAGS += $(COMPILER.CFLAGS) $(COMPILER.CFLAGS.$(VARIANT)) ;
|
CCFLAGS += $(COMPILER.CFLAGS) $(COMPILER.CFLAGS.$(VARIANT)) ;
|
||||||
C++FLAGS += $(COMPILER.CFLAGS) $(COMPILER.C++FLAGS)
|
C++FLAGS += $(COMPILER.CFLAGS) $(COMPILER.C++FLAGS)
|
||||||
$(COMPILER.CFLAGS.$(VARIANT)) $(COMPILER.C++FLAGS.$(VARIANT)) ;
|
$(COMPILER.CFLAGS.$(VARIANT)) $(COMPILER.C++FLAGS.$(VARIANT)) ;
|
||||||
LINKLIBS += $(COMPILER.LFLAGS) $(COMPILER.LFLAGS.$(VARIANT)) ;
|
LINKLIBS += $(COMPILER.LFLAGS) $(COMPILER.LFLAGS.$(VARIANT)) ;
|
||||||
LOCATE.OBJECTS = $(LOCATE.OBJECTS)/$(VARIANT) ;
|
LOCATE.OBJECTS = $(LOCATE.OBJECTS)/$(VARIANT) ;
|
||||||
|
|
||||||
## SubVariant variantname
|
## SubVariant variantname
|
||||||
## Specify subvariant which are placed in separate compilation directories.
|
## Specify subvariant which are placed in separate compilation directories.
|
||||||
SUBVARIANT ?= "" ;
|
SUBVARIANT ?= "" ;
|
||||||
SAVED_LOCATE_TARGET = "" ;
|
SAVED_LOCATE_TARGET = "" ;
|
||||||
rule SubVariant
|
rule SubVariant
|
||||||
{
|
{
|
||||||
if ! $(<)
|
if ! $(<)
|
||||||
{
|
{
|
||||||
SUBVARIANT = $(SUBVARIANT[2]) ;
|
SUBVARIANT = $(SUBVARIANT[2]) ;
|
||||||
SUBVARIANT ?= "" ;
|
SUBVARIANT ?= "" ;
|
||||||
LOCATE_TARGET = $(SAVED_LOCATE_TARGET[1]) ;
|
LOCATE_TARGET = $(SAVED_LOCATE_TARGET[1]) ;
|
||||||
SAVED_LOCATE_TARGET = $(SAVED_LOCATE_TARGET[2-]) ;
|
SAVED_LOCATE_TARGET = $(SAVED_LOCATE_TARGET[2-]) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SUBVARIANT = $(<) $(SUBVARIANT) ;
|
SUBVARIANT = $(<) $(SUBVARIANT) ;
|
||||||
SAVED_LOCATE_TARGET = $(LOCATE_TARGET) $(SAVED_LOCATE_TARGET) ;
|
SAVED_LOCATE_TARGET = $(LOCATE_TARGET) $(SAVED_LOCATE_TARGET) ;
|
||||||
LOCATE_TARGET = $(LOCATE_TARGET)/$(<) ;
|
LOCATE_TARGET = $(LOCATE_TARGET)/$(<) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1126
mk/jam/win32.jam
1126
mk/jam/win32.jam
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user