]> www.ginac.de Git - ginac.git/blob - configure.in
Target install should work now more or less.
[ginac.git] / configure.in
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 ===========================================================================
6
7 dnl This file is used as a signal that everything is in place:
8 AC_INIT(include/ginac.h)
9 dnl A convenient header file for some additional system-dependend output:
10 AC_CONFIG_HEADER(config.h)
11
12 dnl Set the Version Number at this place only:
13 GiNaC_Major_Version=0
14 GiNaC_Minor_Version=0
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}"
20
21 dnl ===========================================================================
22 dnl Several features need to be added to standard-configure:
23 dnl ===========================================================================
24 AC_ARG_ENABLE(shared,
25     [  --enable-shared         build shared libraries [default=no]
26                           (a static library will still be built as well)],
27     shared=${enableval}, shared="no")
28
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++...)
33 AC_PROG_CXX
34 dnl How to run the C++ preprocessor?
35 AC_PROG_CXXCPP
36 dnl Switch to C++ language mode for the following libraries and headers:
37 AC_LANG_CPLUSPLUS
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
40 dnl the Makefile:
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):
48 GINAC_CHECK_CLN_H
49 GINAC_CHECK_LIBCLN
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:
52 AC_PROG_INSTALL
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.)
58 case "${shared}" in
59 "yes"|"Yes"|"YES")      # Default-enable ("yes") or user was nitpicking:
60     shared="shlib";
61     AC_PATH_PROG(LIBTOOL, libtool, "")
62     if test "${LIBTOOL}" == ""; then
63         AC_MSG_WARN([libtool not found: building static lib only])
64         shared="";
65     fi
66     ;;
67 *)      # Default, default-disable ("no") or user entered bogus:
68     shared="";
69     ;;
70 esac
71 dnl Check for helpers needed for building the GiNaC interactive shell (ginsh):
72 AC_PROG_LEX
73 AC_PROG_YACC
74 AC_DECL_YYTEXT
75 AC_HEADER_STDC
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, "")
90
91 dnl ===========================================================================
92 dnl Substitute these variables in the Makefile:
93 dnl ===========================================================================
94 AC_SUBST(shared)
95 AC_SUBST(LibGiNaC_Ver)
96
97 dnl ===========================================================================
98 dnl Produce a Makefile from Makefile.in:
99 dnl ===========================================================================
100 AC_OUTPUT([Makefile src/Makefile check/Makefile ginsh/Makefile doc/Makefile])
101 echo "now type make"