1 dnl Pull version info from the ginac/version.h file.
2 dnl GiNaC release number:
3 m4_define([ginac_major_version], GINAC_GET_VERSION([MAJOR]))
4 m4_define([ginac_minor_version], GINAC_GET_VERSION([MINOR]))
5 m4_define([ginac_micro_version], GINAC_GET_VERSION([MICRO]))
6 m4_define([ginac_version], [ginac_major_version.ginac_minor_version.ginac_micro_version])
7 m4_define([ginac_release], [ginac_major_version.ginac_minor_version])
8 dnl GiNaC library version information. It has very little to do with GiNaC
9 dnl version number. In particular, library version is OS dependent.
10 m4_define([ginac_lt_current], GINAC_GET_LTVERSION([CURRENT]))
11 m4_define([ginac_lt_age], GINAC_GET_LTVERSION([AGE]))
12 m4_define([ginac_lt_revision], GINAC_GET_LTVERSION([REVISION]))
14 AC_INIT([GiNaC], [ginac_version], [ginac-list@ginac.de], [ginac], [https://www.ginac.de/])
16 AC_CONFIG_SRCDIR(ginac/basic.cpp)
17 AC_CONFIG_AUX_DIR([config])
18 AC_CONFIG_HEADERS([config/config.h])
19 AC_CONFIG_MACRO_DIR([m4])
20 dnl This defines PACKAGE and VERSION.
21 AM_INIT_AUTOMAKE([gnu 1.8 dist-bzip2 subdir-objects])
23 dnl libtool versioning
24 LT_VERSION_INFO="ginac_lt_current:ginac_lt_revision:ginac_lt_age"
25 AC_SUBST(LT_VERSION_INFO)
27 dnl Check for the compiler and all the utilities needed for the build.
34 AC_PATH_PROG(YACCEXE, $YACC, "")
35 AS_IF([test "x$LEX" = "x:" -a ! -f $srcdir/ginsh/ginsh_lexer.cpp],
36 [GINAC_WARNING([ginsh will not compile, because lex/flex is missing])])
37 AS_IF([test -z "$YACCEXE" -a ! -f $srcdir/ginsh/ginsh_parser.hpp],
38 [GINAC_WARNING([ginsh will not compile, because yacc/bison is missing])])
40 dnl Switch to C++ language mode for the following libraries and headers.
42 AX_CXX_COMPILE_STDCXX([11])
44 dnl We need to have CLN installed.
45 PKG_CHECK_MODULES(CLN, cln >= 1.2.2)
46 AC_LIB_LINKFLAGS_FROM_LIBS([CLN_RPATH], [$CLN_LIBS])
47 LIBS="$LIBS $CLN_LIBS $CLN_RPATH"
48 CPPFLAGS="$CPPFLAGS $CLN_CFLAGS"
49 dnl Include proper rpath into pkg-config meta data, so
50 dnl g++ `pkg-config --cflags --libs ginac`
52 GINACLIB_LIBS='-L${libdir} -lginac'
53 AC_LIB_LINKFLAGS_FROM_LIBS([GINACLIB_RPATH], [$GINACLIB_LIBS])
55 dnl Check for stuff needed for building the GiNaC interactive shell (ginsh).
56 AC_CHECK_HEADERS(unistd.h)
59 dnl Python is necessary for building function.{cpp,h}
60 AM_PATH_PYTHON([2.7],,
61 [AC_MSG_ERROR([GiNaC will not compile because Python is missing])])
63 dnl Check for dl library (needed for GiNaC::compile).
65 AM_CONDITIONAL(CONFIG_EXCOMPILER, [test "x${CONFIG_EXCOMPILER}" = "xyes"])
67 dnl Check for utilities needed by the different kinds of documentation.
68 dnl Documentation needs only be built when extending it, so never mind if it
69 dnl cannot find those helpers:
70 AC_PATH_PROG(DOXYGEN, doxygen, "")
71 AM_CONDITIONAL(CONFIG_DOXYGEN, [test ! -z "$DOXYGEN"])
72 AC_PATH_PROG(LATEX, latex, "")
73 AC_PATH_PROG(PDFLATEX, pdflatex, "")
74 AC_PATH_PROG(MAKEINDEX, makeindex, "")
75 AC_PATH_PROG(MAKEINFO, makeinfo, "")
76 AC_PATH_PROG(DVIPS, dvips, "")
77 AM_CONDITIONAL(CONFIG_TEX, [test ! \( -z "$LATEX" -o -z "$PDFLATEX" -o -z "$MAKEINDEX" -o -z "$DVIPS" \)])
78 AC_PATH_PROG(FIG2DEV, fig2dev, "")
79 AM_CONDITIONAL(CONFIG_FIG2DEV, [test ! -z "$FIG2DEV"])
80 AS_IF([test -z "$FIG2DEV" -o -z "$MAKEINFO"],
81 [GINAC_WARNING([Documentation may not build, because fig2dev/texinfo is missing.])])
82 AS_IF([test -z "$DOXYGEN"],
83 [GINAC_WARNING([Reference manual will not build, because doxygen is missing.])])
84 AS_IF([test -z "$LATEX" -o -z "$PDFLATEX" -o -z "$DVIPS"],
85 [GINAC_WARNING([Some documentation formats may not build, because latex/pdflatex/dvips is missing.])])
87 dnl Output makefiles etc.
98 tools/ginac-excompiler
100 doc/examples/Makefile
101 doc/tutorial/Makefile
102 doc/reference/Makefile
103 doc/reference/DoxyfileHTML
104 doc/reference/DoxyfileTEX
105 doc/reference/DoxyfilePDF
106 doc/reference/Doxyfooter
110 dnl Display a final warning if there has been a GINAC_ERROR or a GINAC_WARNING