forked from ovis-hpc/sos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
95 lines (85 loc) · 2.65 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
AC_PREREQ(2.63)
AC_INIT([sosdb], 4.2.1, [email protected])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([foreign])
AM_PROG_LIBTOOL
COMMIT_ID="$(git rev-parse HEAD 2>/dev/null)"
if test -z "$COMMIT_ID"; then
dnl Git OK from ovis repo.
AC_MSG_RESULT([The git command is not available, commit_id is "00..."])
COMMIT_ID="0000000000000000000000000000000000000000"
fi
AC_DEFINE_UNQUOTED([ODS_COMMIT_ID],["$COMMIT_ID"], [Git commit id])
AC_SUBST([ODS_COMMIT_ID],["$COMMIT_ID"])
dnl Checks for programs
AC_PROG_CC
dnl this will add document options. Please see m4/options.m4.
OPTION_DOC
OPTION_DEFAULT_DISABLE([debug], [ENABLE_DEBUG])
OPTION_DEFAULT_ENABLE([python], [ENABLE_PYTHON])
if test -z "$ENABLE_PYTHON_TRUE"
then
AM_PATH_PYTHON(,,[:])
NUMPY_INCLUDE_PATH=$($PYTHON -c "import numpy; print(numpy.get_include())")
which cython >/dev/null 2>&1 || AC_MSG_ERROR("cython not found")
test -n "$NUMPY_INCLUDE_PATH" || AC_MSG_ERROR("numpy not found.")
AX_PYTHON_DEVEL()
AC_MSG_RESULT([${NUMPY_INCLUDE_PATH}])
AC_SUBST([NUMPY_INCLUDE_PATH])
fi
dnl Check for tcmalloc
OCFLAGS=$CFLAGS
CFLAGS=""
LIB_TCMALLOC=""
AC_CHECK_LIB(tcmalloc,
malloc,
[LIB_TCMALLOC="-ltcmalloc"],
[AC_MSG_WARN(You may wish to install libtcmalloc for better performance)])
AC_SUBST([LIB_TCMALLOC])
CFLAGS=$OCFLAGS
distdir=${PACKAGE_NAME}-${PACKAGE_VERSION}
AC_SUBST(ac_configure_args)
AC_SUBST(prefix)
AC_SUBST(distdir)
AC_SUBST([SOS_SUBST_RULE],["sed \
-e 's,[[@]]mandir[[@]],\$(mandir),g' \
-e 's,[[@]]localedir[[@]],\$(localedir),g' \
-e 's,[[@]]libdir[[@]],\$(libdir),g' \
-e 's,[[@]]psdir[[@]],\$(psdir),g' \
-e 's,[[@]]pdfdir[[@]],\$(pdfdir),g' \
-e 's,[[@]]dvidir[[@]],\$(dvidir),g' \
-e 's,[[@]]htmldir[[@]],\$(htmldir),g' \
-e 's,[[@]]infodir[[@]],\$(infodir),g' \
-e 's,[[@]]docdir[[@]],\$(docdir),g' \
-e 's,[[@]]includedir[[@]],\$(includedir),g' \
-e 's,[[@]]localstatedir[[@]],\$(localstatedir),g' \
-e 's,[[@]]sharedstatedir[[@]],\$(sharedstatedir),g' \
-e 's,[[@]]sysconfdir[[@]],\$(sysconfdir),g' \
-e 's,[[@]]datadir[[@]],\$(datadir),g' \
-e 's,[[@]]datarootdir[[@]],\$(datarootdir),g' \
-e 's,[[@]]libexecdir[[@]],\$(libexecdir),g' \
-e 's,[[@]]sbindir[[@]],\$(sbindir),g' \
-e 's,[[@]]bindir[[@]],\$(bindir),g' \
-e 's,[[@]]prefix[[@]],\$(prefix),g' \
-e 's,[[@]]exec_prefix[[@]],\$(exec_prefix),g' \
-e 's,[[@]]pkglibdir[[@]],\$(pkglibdir),g' \
-e 's,[[@]]PYTHON[[@]],\$(PYTHON),g' \
-e 's,[[@]]pythondir[[@]],\$(pythondir),g' \
"
])
AC_CONFIG_FILES([
Makefile
doc/Doxyfile
doc/Makefile
ods/Makefile
ods/include/Makefile
ods/src/Makefile
sos/Makefile
sos/include/Makefile
sos/src/Makefile
sos/python/Makefile
rpm/sosdb.spec
])
AC_OUTPUT