summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-03-16 21:11:39 +0000
committerDana Jansens <danakj@orodu.net>2003-03-16 21:11:39 +0000
commitf8a47de5ec444c452093371e3db16857eb39a490 (patch)
tree31db2567842d98232775f9980f7a8d2586c0ac71 /m4
parent8ba0586bcbdc7fe9648f1063812126d71a041670 (diff)
merge the C branch into HEAD
Diffstat (limited to 'm4')
-rw-r--r--m4/openbox.m457
-rw-r--r--m4/swig.m490
2 files changed, 33 insertions, 114 deletions
diff --git a/m4/openbox.m4 b/m4/openbox.m4
index 645301fd..aef68281 100644
--- a/m4/openbox.m4
+++ b/m4/openbox.m4
@@ -2,6 +2,7 @@
#
# Check if the user has requested a debug build.
# Sets the DEBUG or NDEBUG variables as appropriate
+# Sets the CVS environment variable when building CVS sources.
AC_DEFUN([OB_DEBUG],
[
DEBUG="no"
@@ -28,47 +29,55 @@ AC_DEFUN([OB_DEBUG],
# keep the asserts in
# AC_DEFINE([NDEBUG], [1], [Creating a release build])
fi
+
+ AM_CONDITIONAL(CVS, test "$CVS" = "yes")
])
# OB_COMPILER_FLAGS()
#
# Check what compiler is being used for compilation.
-# It sets the CXXFLAGS variable appropriately for the compiler, including flags
+# It sets the CFLAGS variable appropriately for the compiler, including flags
# for debug builds.
AC_DEFUN([OB_COMPILER_FLAGS],
[
- AC_REQUIRE([AC_PROG_CXXCPP])
- AC_REQUIRE([AC_PROG_CXX])
+ AC_REQUIRE([AC_PROG_CPP])
+ AC_REQUIRE([AC_PROG_CC])
FLAGS=""
# Check what compiler we are using
- AC_MSG_CHECKING([for GNU C++])
- if test "$GXX" = "yes"; then
+ AC_MSG_CHECKING([for GNU CC])
+ if test "$GCC" = "yes"; then
AC_MSG_RESULT([yes])
- FLAGS="-Wall -W -fno-check-new -fno-exceptions"
- # -pedantic
- test "$DEBUG" = "yes" && FLAGS="$FLAGS -g -fno-inline"
- else
- AC_MSG_RESULT([no, trying other compilers])
- AC_MSG_CHECKING(for MIPSpro)
- mips_pro_ver=`$CXX -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
- if test -z "$mips_pro_ver"; then
- AC_MSG_RESULT([no])
+ if test "$DEBUG" = "yes"; then
+ FLAGS="-g -fno-inline"
+ FLAGS="$FLAGS -Wall -Wsign-compare -Waggregate-return"
+ FLAGS="$FLAGS -Wcast-qual -Wbad-function-cast -Wpointer-arith"
+ # for Python.h
+ FLAGS="$FLAGS -Wno-long-long"
else
- AC_MSG_RESULT([yes, version $mips_pro_ver.])
- AC_MSG_CHECKING(for -LANG:std in CXXFLAGS)
- lang_std_not_set=`echo $CXXFLAGS | grep "\-LANG:std"`
- if test "x$lang_std_not_set" = "x"; then
- AC_MSG_RESULT([not set, setting.])
- FLAGS="-LANG:std"
- else
- AC_MSG_RESULT([already set.])
- fi
+ FLAGS=""
fi
+# else
+# AC_MSG_RESULT([no, trying other compilers])
+# AC_MSG_CHECKING(for MIPSpro)
+# mips_pro_ver=`$CC -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
+# if test -z "$mips_pro_ver"; then
+# AC_MSG_RESULT([no])
+# else
+# AC_MSG_RESULT([yes, version $mips_pro_ver.])
+# AC_MSG_CHECKING(for -LANG:std in CFLAGS)
+# lang_std_not_set=`echo $CFLAGS | grep "\-LANG:std"`
+# if test "x$lang_std_not_set" = "x"; then
+# AC_MSG_RESULT([not set, setting.])
+# FLAGS="-LANG:std"
+# else
+# AC_MSG_RESULT([already set.])
+# fi
+# fi
fi
AC_MSG_CHECKING([for compiler specific flags])
AC_MSG_RESULT([$FLAGS])
- CXXFLAGS="$CXXFLAGS $FLAGS"
+ CFLAGS="$CFLAGS $FLAGS"
])
diff --git a/m4/swig.m4 b/m4/swig.m4
deleted file mode 100644
index ad6d1393..00000000
--- a/m4/swig.m4
+++ /dev/null
@@ -1,90 +0,0 @@
-# SWIG_PROG([required-version])
-#
-# Checks for the SWIG program. If found you can (and should) call SWIG via $(SWIG).
-# You can use the optional first argument to check if the version of the available SWIG
-# is greater or equal to the value of the argument. It should have the format:
-# N[.N[.N]] (N is a number between 0 and 999. Only the first N is mandatory.)
-AC_DEFUN([SWIG_PROG],[
- AC_REQUIRE([AC_PROG_MAKE_SET])
- AC_CHECK_PROG(SWIG,swig,[`which swig`])
- if test -z "$SWIG" ; then
- AC_MSG_WARN([cannot find 'swig' program])
- SWIG=false
- elif test -n "$1" ; then
- AC_MSG_CHECKING([for SWIG version])
- swig_version=`$SWIG -version 2>&1 | \
- awk '/^SWIG Version [[0-9]+\.[0-9]+\.[0-9]]+.*$/ { split($[3],a,"[[^.0-9]]"); print a[[1]] }'`
- AC_MSG_RESULT([$swig_version])
- if test -n "$swig_version" ; then
- swig_version=`echo $swig_version | \
- awk '{ split($[1],a,"\."); print [a[1]*1000000+a[2]*1000+a[3]] }' 2>/dev/null`
- swig_required_version=`echo $1 | \
- awk '{ split($[1],a,"\."); print [a[1]*1000000+a[2]*1000+a[3]] }' 2>/dev/null`
- if test $swig_required_version -gt $swig_version ; then
- AC_MSG_WARN([SWIG version $1 required])
- fi
- else
- AC_MSG_WARN([cannot determine SWIG version])
- fi
- fi
-])
-
-# SWIG_ENABLE_CXX()
-#
-# Enable swig C++ support. This effects all invocations of $(SWIG).
-AC_DEFUN([SWIG_ENABLE_CXX],[
- AC_REQUIRE([SWIG_PROG])
- AC_REQUIRE([AC_PROG_CXX])
- if test "$SWIG" != "false" ; then
- SWIG="$SWIG -c++"
- fi
-])
-
-# SWIG_MULTI_MODULE_SUPPORT()
-#
-# Enable support for multiple modules. This effects all invocations of $(SWIG).
-# You have to link all generated modules against the appropriate SWIG library.
-# If you want to build Python modules for example, use the SWIG_PYTHON() macro
-# and link the modules against $(SWIG_PYTHON_LIB). The $(SWIG_LDFLAGS) variable
-# can be used to help the linker to find this library.
-AC_DEFUN([SWIG_MULTI_MODULE_SUPPORT],[
- AC_REQUIRE([SWIG_PROG])
- if test "$SWIG" != "false" ; then
- SWIG="$SWIG -c"
-
- # Check for SWIG library path
- AC_MSG_CHECKING([for SWIG library path])
- swig_path=${SWIG%/bin*}/lib
- swig_path=`find $swig_path -type f -name libswig*.a -o -name libswig*.so -print`
- for i in $swig_path ; do
- swig_path=${i%/libswig*}
- break
- done
- AC_MSG_RESULT([$swig_path])
- if test -n "$swig_path" ; then
- AC_SUBST(SWIG_LDFLAGS,[-L$swig_path])
- else
- AC_MSG_WARN([cannot find SWIG library path])
- fi
- fi
-])
-
-# SWIG_PYTHON([use-shadow-classes])
-#
-# Checks for Python and provides the $(SWIG_PYTHON_CFLAGS), $(SWIG_PYTHON_LIB) and
-# $(SWIG_PYTHON_OPT) output variables. $(SWIG_PYTHON_OPT) contains all necessary swig
-# options to generate code for Python. Shadow classes are enabled unless the
-# value of the optional first argument is exactly 'no'. If you need multi module
-# support use $(SWIG_PYTHON_LIB) (provided by the SWIG_MULTI_MODULE_SUPPORT() macro)
-# to link against the appropriate library. It contains the SWIG Python runtime library
-# that is needed by the type check system for example.
-AC_DEFUN([SWIG_PYTHON],[
- AC_REQUIRE([SWIG_PROG])
- AC_REQUIRE([PYTHON_DEVEL])
- if test "$SWIG" != "false" ; then
- AC_SUBST(SWIG_PYTHON_LIB,[`$SWIG -python -ldflags`])
- test ! "x$1" = "xno" && swig_shadow=" -shadow" || swig_shadow=""
- AC_SUBST(SWIG_PYTHON_OPT,[-python$swig_shadow])
- fi
- AC_SUBST(SWIG_PYTHON_CFLAGS,[$PYTHON_CFLAGS])
-])