|
| 1 | +# -*- Autoconf -*- |
| 2 | +# Process this file with autoconf to produce a configure script. |
| 3 | + |
| 4 | +AC_PREREQ([2.69]) |
| 5 | +AC_INIT([CASM], |
| 6 | + m4_esyscmd([tr -d '\n' < ./build-aux/casm_version.txt]), |
| 7 | + [casm-developers@lists.engr.ucsb.edu], |
| 8 | + [], |
| 9 | + [https://github.com/prisms-center/CASMcode]) |
| 10 | +AC_CONFIG_AUX_DIR([build-aux]) #This is my doing |
| 11 | +AC_CONFIG_MACRO_DIR([build-aux/m4]) |
| 12 | +#Rules to apply to every Makefile.am. Using tar-ustar due to loooooong file names (I'm looking at you Eigen) |
| 13 | +AM_INIT_AUTOMAKE([foreign subdir-objects 1.9 tar-ustar]) |
| 14 | + |
| 15 | + |
| 16 | +AC_CONFIG_SRCDIR([src/casm/CASM_global_definitions.cc]) |
| 17 | +AC_CONFIG_HEADERS([config.h]) |
| 18 | + |
| 19 | +# Checks for programs. |
| 20 | +AC_PROG_CXX |
| 21 | +AC_PROG_CC |
| 22 | +AC_PROG_CPP |
| 23 | + |
| 24 | +## Checks for libraries. |
| 25 | +## FIXME: Replace `main' with a function in `-lgzstream': |
| 26 | +#AC_CHECK_LIB([gzstream], [main]) |
| 27 | +## FIXME: Replace `main' with a function in `-lz': |
| 28 | +AC_CHECK_LIB([z], [gzread], [], AC_MSG_ERROR(gzread from z library not found!)) |
| 29 | +AC_CHECK_LIB([dl], [dlopen], [], AC_MSG_ERROR(dlopen from dl library not found!)) |
| 30 | +#AC_CHECK_LIB([z], [gzwrite]) |
| 31 | +#AC_CHECK_LIB([z], [gzopen]) |
| 32 | +#AC_CHECK_LIB([z], [gzclose]) |
| 33 | + |
| 34 | +#I added this |
| 35 | +LT_INIT([shared disable-static]) |
| 36 | +AC_PROG_LIBTOOL |
| 37 | +LT_LIB_DLLOAD |
| 38 | +AC_DISABLE_STATIC |
| 39 | +if test "$enable_static" != "no"; then |
| 40 | + echo "Sorry Dave, I can't let you do that. Static libraries are currently disabled."; |
| 41 | + exit 1; |
| 42 | +fi; |
| 43 | + |
| 44 | +AX_CXX_COMPILE_STDCXX_11 |
| 45 | +BOOSTV=1.54 |
| 46 | +AX_BOOST_BASE([$BOOSTV],[],AC_MSG_ERROR(You need Boost $BOOSTV libraries or higher.)) |
| 47 | +AX_BOOST_FILESYSTEM |
| 48 | +AX_BOOST_SYSTEM |
| 49 | +AX_BOOST_REGEX |
| 50 | +AX_BOOST_CHRONO |
| 51 | +AX_BOOST_PROGRAM_OPTIONS |
| 52 | +AX_BOOST_UNIT_TEST_FRAMEWORK |
| 53 | + |
| 54 | +#Where to install bash completion |
| 55 | +AC_ARG_WITH([bash-completion-dir], |
| 56 | + AS_HELP_STRING([--with-bash-completion-dir[=PATH]], |
| 57 | + [Install the bash auto-completion script in this directory. @<:@default=yes@:>@]), |
| 58 | + [], |
| 59 | + [with_bash_completion_dir=yes]) |
| 60 | + |
| 61 | +if test "x$with_bash_completion_dir" = "xyes"; then |
| 62 | + PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], |
| 63 | + [BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"], |
| 64 | + [BASH_COMPLETION_DIR="$datadir/bash-completion/completions"]) |
| 65 | +else |
| 66 | + BASH_COMPLETION_DIR="$with_bash_completion_dir" |
| 67 | +fi |
| 68 | + |
| 69 | +AC_SUBST([BASH_COMPLETION_DIR]) |
| 70 | +AM_CONDITIONAL([ENABLE_BASH_COMPLETION],[test "x$with_bash_completion_dir" != "xno"]) |
| 71 | + |
| 72 | + |
| 73 | +#Require at least this version |
| 74 | +AM_PATH_PYTHON([2.6]) |
| 75 | + |
| 76 | +# Checks for header files. |
| 77 | +AC_CHECK_HEADERS([float.h limits.h stdlib.h string.h sys/time.h unistd.h]) |
| 78 | + |
| 79 | +# Checks for typedefs, structures, and compiler characteristics. |
| 80 | +AC_CHECK_HEADER_STDBOOL |
| 81 | +AC_C_INLINE |
| 82 | +AC_TYPE_INT32_T |
| 83 | +AC_TYPE_INT64_T |
| 84 | +AC_C_RESTRICT |
| 85 | +AC_TYPE_SIZE_T |
| 86 | +AC_TYPE_UINT64_T |
| 87 | +AC_CHECK_TYPES([ptrdiff_t]) |
| 88 | + |
| 89 | +# Checks for library functions. |
| 90 | +AC_FUNC_ERROR_AT_LINE |
| 91 | +AC_FUNC_MALLOC |
| 92 | +AC_HEADER_MAJOR |
| 93 | +AC_FUNC_REALLOC |
| 94 | +AC_FUNC_STRTOD |
| 95 | +AC_CHECK_FUNCS([floor iswprint memmove memset mkdir pow rmdir select sqrt strchr strpbrk strrchr strstr strtol]) |
| 96 | + |
| 97 | +#Generate all the necessary files from *.in |
| 98 | +AC_CONFIG_FILES([Makefile]) |
| 99 | +AC_CONFIG_FILES([tests/unit/App/run_test_App], [chmod +x tests/unit/App/run_test_App]) |
| 100 | +AC_CONFIG_FILES([tests/unit/casm_io/run_test_casm_io], [chmod +x tests/unit/casm_io/run_test_casm_io]) |
| 101 | +AC_CONFIG_FILES([tests/unit/clex/run_test_clex], [chmod +x tests/unit/clex/run_test_clex]) |
| 102 | +AC_CONFIG_FILES([tests/unit/clusterography/run_test_clusterography], [chmod +x tests/unit/clusterography/run_test_clusterography]) |
| 103 | +AC_CONFIG_FILES([tests/unit/container/run_test_container], [chmod +x tests/unit/container/run_test_container]) |
| 104 | +AC_CONFIG_FILES([tests/unit/crystallography/run_test_crystallography], [chmod +x tests/unit/crystallography/run_test_crystallography]) |
| 105 | +AC_CONFIG_FILES([tests/unit/monte_carlo/run_test_monte_carlo], [chmod +x tests/unit/monte_carlo/run_test_monte_carlo]) |
| 106 | +AC_CONFIG_FILES([tests/unit/system/run_test_system], [chmod +x tests/unit/system/run_test_system]) |
| 107 | + |
| 108 | + |
| 109 | +AC_OUTPUT |
0 commit comments