Skip to content

Commit 9933747

Browse files
committed
Start to autoconf build
1 parent 7bfd064 commit 9933747

File tree

5 files changed

+256
-0
lines changed

5 files changed

+256
-0
lines changed

Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ACLOCAL_AMFLAGS = -I m4
2+
3+
SUBDIRS = src

configure.ac

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# libais autoconf build setup.
2+
#
3+
# autoreconf -v --force --install -I m4 && ./configure
4+
# libtoolize --force --copy
5+
6+
AC_PREREQ([2.65])
7+
AC_INIT([libais],[0.15],[[email protected]])
8+
9+
10+
AC_CONFIG_SRCDIR([src/libais/ais.cpp])
11+
AC_CONFIG_MACRO_DIRS([m4])
12+
13+
14+
AM_INIT_AUTOMAKE
15+
AM_MAINTAINER_MODE
16+
17+
AC_PROG_CXX
18+
AC_PROG_CXXCPP
19+
AC_LANG([C++])
20+
AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
21+
22+
AC_PROG_INSTALL
23+
24+
AC_HEADER_STDC
25+
AC_CHECK_HEADERS([array])
26+
AC_CHECK_HEADERS([bitset])
27+
AC_CHECK_HEADERS([cassert])
28+
AC_CHECK_HEADERS([cmath])
29+
AC_CHECK_HEADERS([fstream])
30+
AC_CHECK_HEADERS([iostream])
31+
AC_CHECK_HEADERS([memory])
32+
AC_CHECK_HEADERS([sstream])
33+
AC_CHECK_HEADERS([vector])
34+
AC_CHECK_HEADERS([string])
35+
AC_CHECK_HEADERS([vector])
36+
37+
# Check for signed char.
38+
AC_TYPE_INT8_T
39+
40+
LT_INIT
41+
AC_SUBST([LIBTOOL_DEPS])
42+
LT_LIB_M
43+
44+
AC_CONFIG_FILES([Makefile])
45+
AC_CONFIG_FILES([src/Makefile])
46+
AC_CONFIG_FILES([src/libais/Makefile])
47+
AC_OUTPUT

m4/ax_cxx_compile_stdcxx_11.m4

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# ============================================================================
2+
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
3+
# ============================================================================
4+
#
5+
# SYNOPSIS
6+
#
7+
# AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional])
8+
#
9+
# DESCRIPTION
10+
#
11+
# Check for baseline language coverage in the compiler for the C++11
12+
# standard; if necessary, add switches to CXXFLAGS to enable support.
13+
#
14+
# The first argument, if specified, indicates whether you insist on an
15+
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
16+
# -std=c++11). If neither is specified, you get whatever works, with
17+
# preference for an extended mode.
18+
#
19+
# The second argument, if specified 'mandatory' or if left unspecified,
20+
# indicates that baseline C++11 support is required and that the macro
21+
# should error out if no mode with that support is found. If specified
22+
# 'optional', then configuration proceeds regardless, after defining
23+
# HAVE_CXX11 if and only if a supporting mode is found.
24+
#
25+
# LICENSE
26+
#
27+
# Copyright (c) 2008 Benjamin Kosnik <[email protected]>
28+
# Copyright (c) 2012 Zack Weinberg <[email protected]>
29+
# Copyright (c) 2013 Roy Stogner <[email protected]>
30+
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <[email protected]>
31+
#
32+
# Copying and distribution of this file, with or without modification, are
33+
# permitted in any medium without royalty provided the copyright notice
34+
# and this notice are preserved. This file is offered as-is, without any
35+
# warranty.
36+
37+
#serial 10
38+
39+
m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[
40+
template <typename T>
41+
struct check
42+
{
43+
static_assert(sizeof(int) <= sizeof(T), "not big enough");
44+
};
45+
46+
struct Base {
47+
virtual void f() {}
48+
};
49+
struct Child : public Base {
50+
virtual void f() override {}
51+
};
52+
53+
typedef check<check<bool>> right_angle_brackets;
54+
55+
int a;
56+
decltype(a) b;
57+
58+
typedef check<int> check_type;
59+
check_type c;
60+
check_type&& cr = static_cast<check_type&&>(c);
61+
62+
auto d = a;
63+
auto l = [](){};
64+
// Prevent Clang error: unused variable 'l' [-Werror,-Wunused-variable]
65+
struct use_l { use_l() { l(); } };
66+
67+
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
68+
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function because of this
69+
namespace test_template_alias_sfinae {
70+
struct foo {};
71+
72+
template<typename T>
73+
using member = typename T::member_type;
74+
75+
template<typename T>
76+
void func(...) {}
77+
78+
template<typename T>
79+
void func(member<T>*) {}
80+
81+
void test();
82+
83+
void test() {
84+
func<foo>(0);
85+
}
86+
}
87+
]])
88+
89+
AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
90+
m4_if([$1], [], [],
91+
[$1], [ext], [],
92+
[$1], [noext], [],
93+
[m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl
94+
m4_if([$2], [], [ax_cxx_compile_cxx11_required=true],
95+
[$2], [mandatory], [ax_cxx_compile_cxx11_required=true],
96+
[$2], [optional], [ax_cxx_compile_cxx11_required=false],
97+
[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])])
98+
AC_LANG_PUSH([C++])dnl
99+
ac_success=no
100+
AC_CACHE_CHECK(whether $CXX supports C++11 features by default,
101+
ax_cv_cxx_compile_cxx11,
102+
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
103+
[ax_cv_cxx_compile_cxx11=yes],
104+
[ax_cv_cxx_compile_cxx11=no])])
105+
if test x$ax_cv_cxx_compile_cxx11 = xyes; then
106+
ac_success=yes
107+
fi
108+
109+
m4_if([$1], [noext], [], [dnl
110+
if test x$ac_success = xno; then
111+
for switch in -std=gnu++11 -std=gnu++0x; do
112+
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
113+
AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
114+
$cachevar,
115+
[ac_save_CXXFLAGS="$CXXFLAGS"
116+
CXXFLAGS="$CXXFLAGS $switch"
117+
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
118+
[eval $cachevar=yes],
119+
[eval $cachevar=no])
120+
CXXFLAGS="$ac_save_CXXFLAGS"])
121+
if eval test x\$$cachevar = xyes; then
122+
CXXFLAGS="$CXXFLAGS $switch"
123+
ac_success=yes
124+
break
125+
fi
126+
done
127+
fi])
128+
129+
m4_if([$1], [ext], [], [dnl
130+
if test x$ac_success = xno; then
131+
for switch in -std=c++11 -std=c++0x; do
132+
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
133+
AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
134+
$cachevar,
135+
[ac_save_CXXFLAGS="$CXXFLAGS"
136+
CXXFLAGS="$CXXFLAGS $switch"
137+
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
138+
[eval $cachevar=yes],
139+
[eval $cachevar=no])
140+
CXXFLAGS="$ac_save_CXXFLAGS"])
141+
if eval test x\$$cachevar = xyes; then
142+
CXXFLAGS="$CXXFLAGS $switch"
143+
ac_success=yes
144+
break
145+
fi
146+
done
147+
fi])
148+
AC_LANG_POP([C++])
149+
if test x$ax_cxx_compile_cxx11_required = xtrue; then
150+
if test x$ac_success = xno; then
151+
AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.])
152+
fi
153+
else
154+
if test x$ac_success = xno; then
155+
HAVE_CXX11=0
156+
AC_MSG_NOTICE([No compiler with C++11 support was found])
157+
else
158+
HAVE_CXX11=1
159+
AC_DEFINE(HAVE_CXX11,1,
160+
[define if the compiler supports basic C++11 syntax])
161+
fi
162+
163+
AC_SUBST(HAVE_CXX11)
164+
fi
165+
])
166+

src/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SUBDIRS = libais

src/libais/Makefile.am

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
lib_LTLIBRARIES = libais.la
2+
3+
include_HEADERS = ais.h
4+
5+
libais_la_LDFLAGS = -version-info 0:0:0
6+
7+
libais_la_SOURCES = \
8+
$(libais_a_HEADERS) \
9+
ais.cpp \
10+
ais1_2_3.cpp \
11+
ais4_11.cpp \
12+
ais5.cpp \
13+
ais6.cpp \
14+
ais7_13.cpp \
15+
ais8.cpp \
16+
ais8_1_22.cpp \
17+
ais8_1_26.cpp \
18+
ais8_200.cpp \
19+
ais8_366.cpp \
20+
ais8_366_22.cpp \
21+
ais8_367.cpp \
22+
ais9.cpp \
23+
ais10.cpp \
24+
ais12.cpp \
25+
ais14.cpp \
26+
ais15.cpp \
27+
ais16.cpp \
28+
ais17.cpp \
29+
ais18.cpp \
30+
ais19.cpp \
31+
ais20.cpp \
32+
ais21.cpp \
33+
ais22.cpp \
34+
ais23.cpp \
35+
ais24.cpp \
36+
ais25.cpp \
37+
ais26.cpp \
38+
ais27.cpp
39+

0 commit comments

Comments
 (0)