1 dnl ===========================================================================
2 dnl Process this file with GNU Autoconf to produce a configure script. Then
3 dnl call ./configure to create Makefiles. After that say make and make install.
4 dnl See aclocal.m4 for additional self-made macros.
5 dnl ===========================================================================
7 dnl This file is used as a signal that everything is in place:
8 AC_INIT(include/GiNaC/ginac.h)
9 dnl A convenient header file for some additional system-dependend output:
10 AC_CONFIG_HEADER(config.h)
12 dnl Set the Version Number at this place only:
15 GiNaC_Micro_Version=40
16 dnl This composite variable can be inserted where it appears necessary:
17 GiNaC_Version="${GiNaC_Major_Version}.${GiNaC_Minor_Version}.${GiNaC_Micro_Version}"
18 dnl This composition is needed for libtool, if a shared lib shall be built:
19 LibGiNaC_Ver="${GiNaC_Major_Version}:${GiNaC_Micro_Version}:${GiNaC_Minor_Version}"
21 dnl ===========================================================================
22 dnl Several features need to be added to standard-configure:
23 dnl ===========================================================================
25 [ --enable-shared build shared libraries [default=no]
26 (a static library will still be built as well)],
27 shared=${enableval}, shared="no")
29 dnl ===========================================================================
30 dnl Check for the compiler and all the utilities needed for the build:
31 dnl ===========================================================================
32 dnl Which is the C++ Compiler? (whether to use c++, g++, gcc, CC, cxx, cc++...)
34 dnl How to run the C++ preprocessor?
36 dnl Switch to C++ language mode for the following libraries and headers:
38 dnl Make sure the following libraries work by testing for symbols therein.
39 dnl They are automatically added the the variable $LIBS and thus passed into
41 AC_CHECK_LIB(stdc++, cout)
42 dnl Make sure all the necessary new-style headers are installed on the system.
43 dnl If one of them cannot be found the system is probably not ANSI-conform
44 dnl enough so trying the .h-style headers is a waste of time.
45 AC_CHECK_HEADERS(iostream vector map string list typeinfo iterator strstream stdexcept algorithm, ,
46 AC_MSG_ERROR(need to have ANSI compliant headers))
47 dnl We need to have Bruno Haible's CLN installed (macros are in aclocal.m4):
50 dnl We need to distribure install-sh anyways since otherwise configure will
51 dnl refuse to do several things, like divert into subdirs and so:
53 dnl Todd Brunhoff's makedepend utility is needed by make:
54 AC_PATH_PROG(MAKEDEPEND, makedepend, "")
55 dnl We need GNU libtool if the user chose to create a shared lib. (By using a
56 dnl little trick we can safely recycle the variable shlib which is later passed
57 dnl into the Makefile.)
59 "yes"|"Yes"|"YES") # Default-enable ("yes") or user was nitpicking:
61 AC_PATH_PROG(LIBTOOL, libtool, "")
62 if test "${LIBTOOL}" == ""; then
63 AC_MSG_WARN([libtool not found: building static lib only])
67 *) # Default, default-disable ("no") or user entered bogus:
71 dnl Check for helpers needed for building the GiNaC interactive shell (ginsh):
76 AC_CHECK_HEADERS(unistd.h)
77 AC_CHECK_FUNCS(strdup)
78 AC_CHECK_HEADERS(readline/readline.h readline/history.h, , AC_MSG_ERROR(need to have GNU readline headers))
79 AC_CHECK_LIB(readline, readline, , AC_MSG_ERROR(need to have GNU readline library))
80 dnl Check for utilities needed by the different kinds of documentation.
81 dnl Documantation needs only be built when extending it, so never mind if it
82 dnl cannot find those helpers:
83 AC_PATH_PROG(DOXYGEN, doxygen, "")
84 AC_PATH_PROG(LATEX, latex, "")
85 AC_PATH_PROG(MAKEINDEX, makeindex, "")
86 AC_PATH_PROG(DVIPS, dvips, "")
87 AC_PATH_PROG(FIG2DEV, fig2dev, "")
88 AC_PATH_PROG(JADE, jade, "")
89 AC_PATH_PROG(JADETEX, jadetex, "")
91 dnl ===========================================================================
92 dnl Substitute these variables in the Makefile:
93 dnl ===========================================================================
95 AC_SUBST(LibGiNaC_Ver)
97 dnl ===========================================================================
98 dnl Produce a Makefile from Makefile.in:
99 dnl ===========================================================================
100 AC_OUTPUT([Makefile src/Makefile check/Makefile ginsh/Makefile doc/Makefile])