-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path_configure.ac
154 lines (128 loc) · 6.13 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
######################################################################
AC_PREREQ([2.69])
AC_INIT([CASM Utilities], [0.1.0], [[email protected]])
AC_CONFIG_SRCDIR([src/casmutils])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([build-aux/m4])
AM_INIT_AUTOMAKE([subdir-objects 1.9 tar-pax])
#BEWARE CIRCULAR SYMBOLIC LINKS IN CLI11 (and elsewhere?)
#IT WILL PREVENT YOUR `make dist` command from ever finishing collecting files
######################################################################
######################################################################
#We'll be making shared libraries
LT_INIT
# Checks for programs.
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_17
######################################################################
AC_ARG_ENABLE([python],
AS_HELP_STRING([--disable-python],[Do not install casmutils python module.]))
# By default, aborts if no suitable Python is found:
# Will assume the Python interpreter previously identified by AM_PATH_PYTHON:
AS_IF([test "x$enable_python" != "xno"], [
AM_PATH_PYTHON([3.4])
AX_PYTHON_DEVEL
])
AM_CONDITIONAL([CASMUTILS_PYTHON],[test x$enable_python != "xno"])
######################################################################
AC_ARG_ENABLE([library],
AS_HELP_STRING([--disable-library],[Do not build casmutils as a shared library.]))
AM_CONDITIONAL([CASMUTILS_LIBRARY],[test x$enable_library != "xno"])
######################################################################
# Add debug support
# AC_ARG_ENABLE(debug,
# AS_HELP_STRING(
# [--enable-debug],
# [enable debugging, default: no]),
# [case "${enableval}" in
# yes) debug=true ;;
# no) debug=false ;;
# *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
# esac],
# [debug=false])
# AM_CONDITIONAL(DEBUG, test x"$debug" = x"true")
# AM_COND_IF(DEBUG,
# AC_DEFINE(DEBUG, 1, [Define to 0 if this is a release build]),
# AC_DEFINE(DEBUG, 0, [Define to 1 or higher if this is a debug build]))
######################################################################
AC_ARG_ENABLE([plugins],
AS_HELP_STRING([--disable-plugins],[No plugins, only libraries and modules.]))
AM_CONDITIONAL([WITH_PLUGINS],[test x$enable_plugins != "xno"])
######################################################################
#------Enables full casm---------------------------------------
AC_ARG_ENABLE(fullcasm,
AS_HELP_STRING(
[--enable-fullcasm],
[When enabled installs all the modules of casm, default: no]),
[case "${enableval}" in
yes) fullcasm=true ;;
no) fullcasm=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-fullcasm]) ;;
esac],
[fullcasm=false])
AS_IF([test x"$fullcasm" = x"true"],[
BOOSTV=1.52
AX_BOOST_BASE([$BOOSTV],[],[AC_MSG_ERROR(You need Boost $BOOSTV libraries or higher.)])
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
AX_BOOST_CHRONO
AX_BOOST_REGEX
AX_BOOST_PROGRAM_OPTIONS
AX_CHECK_ZLIB([],AC_MSG_ERROR(zlib library not found!))
])
AM_CONDITIONAL(FULL_CASM, test x"$fullcasm" = x"true")
###################################################################################
# Checks for libraries.
AX_PTHREAD([],AC_MSG_WARN(pthread is required to run tests!))
AC_SEARCH_LIBS(dlopen, dl, [], AC_MSG_ERROR(dl library not found!))
######################################################################
# AC_SEARCH_LIBS(std::filesystem::status_known,stdc++fs,[], AC_MSG_ERROR(stdc++fs not found!),[])
# Why is this such a pain in the butt? I just want to -lstdc++fs, I could be doing this in the
# Makefile, but instead I'm following this example:
# https://github.com/LibreOffice/online/blob/master/configure.ac
#Commented out because I think you don't need the -lstd++fs flag anymore
#AC_MSG_CHECKING(for std::filesystem features in -lstdc++fs)
#STD_FILESYSTEM=
# save_CXXFLAGS=$CXXFLAGS
# CXXFLAGS="$CXXFLAGS -Werror"
# save_LIBS=$LIBS
# LIBS="$save_LIBS -lstdc++fs"
# AC_LANG_PUSH([C++])
# AC_LINK_IFELSE([AC_LANG_SOURCE([[
# #include <filesystem>
# int main()
# {
# if (!std::filesystem::temp_directory_path().empty())
# return 0;
# return 1;
# }
# ]])],[STD_FILESYSTEM=TRUE], AC_MSG_ERROR(stdc++fs not found!))
# AC_LANG_POP([C++])
# CXXFLAGS=$save_CXXFLAGS
# LIBS=$save_LIBS
#if test -n "$STD_FILESYSTEM" ; then
# LIBS="$LIBS -lstdc++fs"
# AC_MSG_RESULT(yes)
#else
# AC_MSG_ERROR("libstdc++fs library not found!)
#fi
######################################################################
AC_CONFIG_FILES([Makefile])
##############Prepares all tests scripts related to python modules#################
AC_CONFIG_FILES([tests/py/stage.py],[chmod +x tests/py/stage.py])
AC_CONFIG_FILES([tests/py/casmutils/xtal/coordinate.py],[chmod +x tests/py/casmutils/xtal/coordinate.py])
AC_CONFIG_FILES([tests/py/casmutils/xtal/site.py],[chmod +x tests/py/casmutils/xtal/site.py])
AC_CONFIG_FILES([tests/py/casmutils/xtal/lattice.py],[chmod +x tests/py/casmutils/xtal/lattice.py])
AC_CONFIG_FILES([tests/py/casmutils/xtal/structure.py],[chmod +x tests/py/casmutils/xtal/structure.py])
AC_CONFIG_FILES([tests/py/casmutils/xtal/structure_tools.py],[chmod +x tests/py/casmutils/xtal/structure_tools.py])
AC_CONFIG_FILES([tests/py/casmutils/mapping/mapping.py],[chmod +x tests/py/casmutils/mapping/mapping.py])
AC_CONFIG_FILES([tests/py/casmutils/mapping/structure.py],[chmod +x tests/py/casmutils/mapping/structure.py])
AC_CONFIG_FILES([tests/py/casmutils/sym/cart.py],[chmod +x tests/py/casmutils/sym/cart.py])
AC_CONFIG_FILES([tests/py/casmutils/xtal/symmetry.py],[chmod +x tests/py/casmutils/xtal/symmetry.py])
AC_CONFIG_FILES([tests/py/casmutils/xtal/frankenstein/frankenstein.py],[chmod +x tests/py/casmutils/xtal/frankenstein/frankenstein.py])
AC_CONFIG_FILES([tests/integration/phony_module_installation.sh])
AC_CONFIG_FILES([tests/integration/cu-import.py],[chmod +x tests/integration/cu-import.py])
###############################PLUGIN SECTIONS BELOW################################