Skip to content

Commit 2c270f5

Browse files
committed
Switch to BDB, autotools fixes
1 parent 8a292eb commit 2c270f5

File tree

10 files changed

+1288
-298
lines changed

10 files changed

+1288
-298
lines changed

configure.ac

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
AC_INIT([codemort],[0.0.1],[chris@beneschtech.com])
2+
AC_CONFIG_MACRO_DIR([m4])
3+
AC_CONFIG_HEADERS([config.h])
4+
25
AM_INIT_AUTOMAKE
36
AC_CONFIG_FILES([Makefile src/Makefile src/fakecpp/Makefile])
4-
AC_PROG_CXX
5-
AC_ARG_WITH([llvm],
6-
[AS_HELP_STRING([--with-llvm],[Location of llvm-config executable])],
7-
[LLVMCONFIG=$withval],
8-
[LLVMCONFIG=llvm-config])
9-
AS_IF([test -x $LLVMCONFIG],[AS_ECHO_N('Using LLVM ')],[AS_EXIT([1])])
10-
[
11-
$LLVMCONFIG --version
12-
]
137

14-
AC_CHECK_LIB([sqlite3],[sqlite3_free],
15-
[
16-
],
17-
[
18-
echo "sqlite3 not found"
19-
exit 1
20-
])
8+
## C++ project, need at least c++11
9+
AC_LANG([C++])
10+
AC_PROG_CXX
11+
AX_CXX_COMPILE_STDCXX(11,[],[mandatory])
2112

2213
## Autoscan results
2314
AC_CHECK_FUNCS([memset])
@@ -31,6 +22,26 @@ AC_FUNC_FORK
3122
AC_FUNC_MALLOC
3223
AC_TYPE_PID_T
3324

25+
## External libraries
26+
27+
### BDB
28+
AC_CHECK_HEADERS([db.h],[],
29+
[AS_EXIT(1)])
30+
AC_SEARCH_LIBS([db_strerror],[db],[],[
31+
AS_EXIT(1)])
32+
AC_SUBST(BDB_LIBS,[-ldb])
33+
34+
### LLVM
35+
[
36+
LLVMCONFIG=llvm-config
37+
]
38+
AC_ARG_WITH([llvm],
39+
[AS_HELP_STRING([--with-llvm],[Location of llvm-config executable])],
40+
[LLVMCONFIG=$withval])
41+
AS_IF([test -x $LLVMCONFIG],[AS_ECHO_N('Using LLVM ')],[AS_EXIT([1])])
42+
[
43+
$LLVMCONFIG --version
44+
]
3445
AC_SUBST(LLVMCXXFLAGS,[`$LLVMCONFIG --cxxflags`])
3546
AC_SUBST(LLVMCFLAGS,[`$LLVMCONFIG --cflags`])
3647
AC_SUBST(LLVMLDFLAGS,[`$LLVMCONFIG --ldflags`])

0 commit comments

Comments
 (0)