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], [http://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])
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.cc],
36 [GINAC_WARNING([ginsh will not compile, because lex/flex is missing])])
37 AS_IF([test -z "$YACCEXE" -a ! -f $srcdir/ginsh/ginsh_parser.h],
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.
43 dnl Make sure all the necessary standard headers are installed on the system.
46 dnl We need to have CLN installed.
47 PKG_CHECK_MODULES(CLN, cln >= 1.2.2)
48 AC_LIB_LINKFLAGS_FROM_LIBS([CLN_RPATH], [$CLN_LIBS])
49 LIBS="$LIBS $CLN_LIBS $CLN_RPATH"
50 CPPFLAGS="$CPPFLAGS $CLN_CFLAGS"
51 dnl Include proper rpath into pkg-config meta data, so
52 dnl g++ `pkg-config --cflags --libs ginac`
54 GINACLIB_LIBS='-L${libdir} -lginac'
55 AC_LIB_LINKFLAGS_FROM_LIBS([GINACLIB_RPATH], [$GINACLIB_LIBS])
57 dnl Check for data types which are needed by the hash function
58 dnl (golden_ratio_hash).
59 AC_CHECK_TYPE(long long)
61 dnl Check for stuff needed for building the GiNaC interactive shell (ginsh).
62 AC_CHECK_HEADERS(unistd.h)
65 dnl Python is necessary for building function.{cpp,h}
66 AC_PATH_PROG(PYTHON, python, "")
67 AS_IF([test -z "$PYTHON" -a ! -f "$srcdir/ginac/function.cpp"],
68 [AC_MSG_ERROR([GiNaC will not compile because Python is missing])])
70 dnl Check for dl library (needed for GiNaC::compile).
72 AM_CONDITIONAL(CONFIG_EXCOMPILER, [test "x${CONFIG_EXCOMPILER}" = "xyes"])
74 dnl Check for utilities needed by the different kinds of documentation.
75 dnl Documentation needs only be built when extending it, so never mind if it
76 dnl cannot find those helpers:
77 AC_PATH_PROG(DOXYGEN, doxygen, "")
78 AM_CONDITIONAL(CONFIG_DOXYGEN, [test ! -z "$DOXYGEN"])
79 AC_PATH_PROG(LATEX, latex, "")
80 AC_PATH_PROG(PDFLATEX, pdflatex, "")
81 AC_PATH_PROG(MAKEINDEX, makeindex, "")
82 AC_PATH_PROG(MAKEINFO, makeinfo, "")
83 AC_PATH_PROG(DVIPS, dvips, "")
84 AM_CONDITIONAL(CONFIG_TEX, [test ! \( -z "$LATEX" -o -z $"PDFLATEX" -o -z "$MAKEINDEX" -o -z "$DVIPS" \)])
85 AC_PATH_PROG(FIG2DEV, fig2dev, "")
86 AM_CONDITIONAL(CONFIG_FIG2DEV, [test ! -z "$FIG2DEV"])
87 AS_IF([test -z "$FIG2DEV" -o -z "$MAKEINFO"],
88 [GINAC_WARNING([Documentation may not build, because fig2dev/texinfo is missing.])])
89 AS_IF([test -z "$DOXYGEN"],
90 [GINAC_WARNING([Reference manual will not build, because doxygen is missing.])])
91 AS_IF([test -z "$LATEX" -o -z "$PDFLATEX" -o -z "$DVIPS"],
92 [GINAC_WARNING([Some documentation formats may not build, because latex/pdflatex/dvips is missing.])])
94 dnl Output makefiles etc.
105 tools/ginac-excompiler
107 doc/examples/Makefile
108 doc/tutorial/Makefile
109 doc/reference/Makefile
110 doc/reference/DoxyfileHTML
111 doc/reference/DoxyfileTEX
112 doc/reference/DoxyfilePDF
113 doc/reference/Doxyfooter
117 dnl Display a final warning if there has been a GINAC_ERROR or a GINAC_WARNING