Skip to content
This repository
Browse code

Initial version.

	* ChangeLog: New.
	* Makefile.am: New.
	* bootstrap: New.
	* build-aux/boost.m4: New.
	(BOOST_REQUIRE): New.
	* configure.ac: New.
  • Loading branch information...
commit 78ce9460be49a6a6e59afa53c6ea57a433627b8b 1 parent a3b27b1
Benoit Sigoure authored October 31, 2007
10  ChangeLog
... ...
@@ -0,0 +1,10 @@
  1
+2007-10-31  Benoit Sigoure  <tsuna@lrde.epita.fr>
  2
+
  3
+	Initial version.
  4
+	* ChangeLog: New.
  5
+	* Makefile.am: New.
  6
+	* bootstrap: New.
  7
+	* build-aux/boost.m4: New.
  8
+	(BOOST_REQUIRE): New.
  9
+	* configure.ac: New.
  10
+
16  Makefile.am
... ...
@@ -0,0 +1,16 @@
  1
+# Copyright (C) 2007  Benoit Sigoure <tsuna@lrde.epita.fr>
  2
+#
  3
+# This program is free software: you can redistribute it and/or modify
  4
+# it under the terms of the GNU General Public License as published by
  5
+# the Free Software Foundation, either version 3 of the License, or
  6
+# (at your option) any later version.
  7
+#
  8
+# This program is distributed in the hope that it will be useful,
  9
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
  10
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11
+# GNU General Public License for more details.
  12
+#
  13
+# You should have received a copy of the GNU General Public License
  14
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
  15
+
  16
+ACLOCAL_AMFLAGS = -I build-aux
17  bootstrap
... ...
@@ -0,0 +1,17 @@
  1
+#!/bin/sh
  2
+# Copyright (C) 2007  Benoit Sigoure <tsuna@lrde.epita.fr>
  3
+#
  4
+# This program is free software: you can redistribute it and/or modify
  5
+# it under the terms of the GNU General Public License as published by
  6
+# the Free Software Foundation, either version 3 of the License, or
  7
+# (at your option) any later version.
  8
+#
  9
+# This program is distributed in the hope that it will be useful,
  10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
  11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12
+# GNU General Public License for more details.
  13
+#
  14
+# You should have received a copy of the GNU General Public License
  15
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
  16
+
  17
+autoreconf -fvi
2  build-aux/.gitignore
... ...
@@ -0,0 +1,2 @@
  1
+missing
  2
+install-sh
110  build-aux/boost.m4
... ...
@@ -0,0 +1,110 @@
  1
+# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
  2
+# Copyright (C) 2007  Benoit Sigoure <tsuna@lrde.epita.fr>
  3
+#
  4
+# This program is free software: you can redistribute it and/or modify
  5
+# it under the terms of the GNU General Public License as published by
  6
+# the Free Software Foundation, either version 3 of the License, or
  7
+# (at your option) any later version.
  8
+#
  9
+# This program is distributed in the hope that it will be useful,
  10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
  11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12
+# GNU General Public License for more details.
  13
+#
  14
+# You should have received a copy of the GNU General Public License
  15
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
  16
+
  17
+# serial 1
  18
+
  19
+# BOOST_REQUIRE([VERSION])
  20
+# ------------------------
  21
+# Look for Boost.  If version is given, it must either be a literal of the form
  22
+# "X.Y" where X and Y are integers or a variable "$var".
  23
+# Defines the value BOOST_CPPFLAGS.  This macro only checks for headers with
  24
+# the required version, it does not check for any of the Boost libraries.
  25
+AC_DEFUN([BOOST_REQUIRE],
  26
+[dnl First find out what kind of argument we have.
  27
+dnl If we have an empty argument, there is no constraint on the version of
  28
+dnl Boost to use.  If it's a literal version number, we can split it in M4 (so
  29
+dnl the resulting configure script will be smaller/faster).  Otherwise we do
  30
+dnl the splitting at runtime.
  31
+m4_bmatch([$1],
  32
+  [^ *$], [m4_pushdef([BOOST_VERSION_REQ], [])dnl
  33
+           boost_version_major=0
  34
+           boost_version_minor=0
  35
+           boost_version_subminor=0
  36
+],
  37
+  [^[0-9]+\([-._][0-9]+\)*$],
  38
+    [m4_pushdef([BOOST_VERSION_REQ], [ version >= $1])dnl
  39
+     boost_version_major=m4_bregexp([$1], [^\([0-9]+\)], [\1])
  40
+     boost_version_minor=m4_bregexp([$1], [^[0-9]+[-._]\([0-9]+\)], [\1])
  41
+     boost_version_subminor=m4_bregexp([$1], [^[0-9]+[-._][0-9]+[-._]\([0-9]+\)], [\1])
  42
+],
  43
+  [^\$[a-zA-Z_]+$],
  44
+    [m4_pushdef([BOOST_VERSION_REQ], [])dnl
  45
+     boost_version_major=`expr "X$1" : 'X\([[^-._]]*\)'`
  46
+     boost_version_minor=`expr "X$1" : 'X[[0-9]]*[[-._]]\([[^-._]]*\)'`
  47
+     boost_version_subminor=`expr "X$1" : 'X[[0-9]]*[[-._]][[0-9]]*[[-._]]\([[0-9]]*\)'`
  48
+     case $boost_version_major:$boost_version_minor in #(
  49
+       *: | :* | *[[^0-9]]*:* | *:*[[^0-9]]*)
  50
+         AC_MSG_ERROR([[Invalid argument for REQUIRE_BOOST: `$1']])
  51
+         ;;
  52
+     esac
  53
+],
  54
+  [m4_fatal(Invalid argument: `$1')]
  55
+)dnl
  56
+AC_ARG_WITH([boost],
  57
+   [AS_HELP_STRING([--with-boost=DIR],
  58
+                   [prefix of Boost]BOOST_VERSION_REQ[ @<:@guess@:>@])])dnl
  59
+  AC_CACHE_CHECK([for Boost headers[]BOOST_VERSION_REQ],
  60
+    [boost_cv_version],
  61
+    [boost_cv_version=no
  62
+AC_LANG_PUSH([C++])dnl
  63
+    boost_subminor_chk=
  64
+    test x"$boost_version_subminor" != x \
  65
+      && boost_subminor_chk="|| (BOOST_V_MAJ == $boost_version_major \
  66
+&& BOOST_V_MIN == $boost_version_minor \
  67
+&& BOOST_V_SUB % 100 < $boost_version_subminor)"
  68
+    for i in "$with_boost/include" '' \
  69
+             /opt/local/include /usr/local/include /opt/include /usr/include \
  70
+             "$with_boost" C:/Boost/include
  71
+    do
  72
+      boost_save_CPPFLAGS=$CPPFLAGS
  73
+      test x"$i" != x && CPPFLAGS="$CPPFLAGS -I$i"
  74
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/version.hpp>
  75
+#ifndef BOOST_VERSION
  76
+# error BOOST_VERSION is not defined
  77
+#endif
  78
+#define BOOST_V_MAJ (BOOST_VERSION / 10000)
  79
+#define BOOST_V_MIN (BOOST_VERSION / 100 % 1000)
  80
+#define BOOST_V_SUB (BOOST_VERSION % 100)
  81
+#if (BOOST_V_MAJ < $boost_version_major) \
  82
+   || (BOOST_V_MAJ == $boost_version_major \
  83
+       && BOOST_V_MIN / 100 % 1000 < $boost_version_minor) $boost_subminor_chk
  84
+# error Boost headers version < $1
  85
+#endif
  86
+]])], [boost_cv_version=yes], [boost_cv_version=no])
  87
+      CPPFLAGS=$boost_save_CPPFLAGS
  88
+      if test x"$boost_cv_version" = xyes; then
  89
+        if test x"$i" != x; then
  90
+          boost_cv_version=$i
  91
+        fi
  92
+        break
  93
+      fi
  94
+    done
  95
+AC_LANG_POP([C++])dnl
  96
+    ])
  97
+    case $boost_cv_version in #(
  98
+      no)
  99
+        AC_MSG_ERROR([Could not find Boost headers[]BOOST_VERSION_REQ])
  100
+        ;;#(
  101
+      yes)
  102
+        BOOST_CPPFLAGS=
  103
+        ;;#(
  104
+      *)
  105
+        BOOST_CPPFLAGS="-I$boost_cv_version"
  106
+        ;;
  107
+    esac
  108
+AC_SUBST([BOOST_CPPFLAGS])dnl
  109
+m4_popdef([BOOST_VERSION_REQ])dnl
  110
+])
34  configure.ac
... ...
@@ -0,0 +1,34 @@
  1
+# Copyright (C) 2007  Benoit Sigoure <tsuna@lrde.epita.fr>
  2
+#
  3
+# This program is free software: you can redistribute it and/or modify
  4
+# it under the terms of the GNU General Public License as published by
  5
+# the Free Software Foundation, either version 3 of the License, or
  6
+# (at your option) any later version.
  7
+#
  8
+# This program is distributed in the hope that it will be useful,
  9
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
  10
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11
+# GNU General Public License for more details.
  12
+#
  13
+# You should have received a copy of the GNU General Public License
  14
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
  15
+
  16
+AC_INIT([boost-m4-test], [0.1], [tsuna@lrde.epita.fr])
  17
+AC_CONFIG_AUX_DIR([build-aux])
  18
+AM_INIT_AUTOMAKE([foreign])
  19
+
  20
+AC_PROG_CXX
  21
+
  22
+version=1.34
  23
+dnl version=bad
  24
+dnl version=1.
  25
+dnl BOOST_REQUIRE([$version])
  26
+BOOST_REQUIRE([1.34])
  27
+dnl BOOST_REQUIRE
  28
+dnl BOOST_REQUIRE([plop])
  29
+dnl m4_define([b_version], [1.34])
  30
+dnl BOOST_REQUIRE(b_version)
  31
+
  32
+AC_CONFIG_FILES([Makefile])
  33
+
  34
+AC_OUTPUT

0 notes on commit 78ce946

Please sign in to comment.
Something went wrong with that request. Please try again.