forked from texmacs/texmacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
160 lines (139 loc) · 4.7 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#--------------------------------------------------------------------
#
# MODULE : configure.in
# DESCRIPTION : TeXmacs configuration file for autoconf
# COPYRIGHT : (C) 2000-2017 Joris van der Hoeven, Denis Raux
#
# This software falls under the GNU general public license version 3 or later.
# It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
# in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
#
#--------------------------------------------------------------------
AC_INIT
AC_CONFIG_HEADERS([src/System/config.h:src/System/config.in])
AC_CANONICAL_HOST
LC_SHELL_FUNCTIONS
#--------------------------------------------------------------------
# Export version and package name
#--------------------------------------------------------------------
TM_VERSION
TM_SUBVERSION
#--------------------------------------------------------------------
# Checks for C++ compiler
#--------------------------------------------------------------------
# define CFLAGS else it would assigned at -g -O2 later by autoconf
# but keep previous value if any
CFLAGS=${CFLAGS:=""}
CXXFLAGS=${CXXFLAGS:=""}
AC_PROG_CC([clang gcc])
AC_PROG_CXX([clang++ g++])
AC_PROG_OBJC([clang gcc])
AC_PROG_OBJCXX([clang++ g++])
AC_LANG_CPLUSPLUS
AH_TEMPLATE([OLD_GNU_COMPILER],[Use g++ strictly prior to g++ 3.0])
AC_MSG_CHECKING(whether GNU C++ compiler is default)
case "$GXX" in
yes )
GCC_VERSION=`$CC -dumpversion`
GXX_VERSION=`$CXX -dumpversion`
AC_MSG_RESULT(yes)
AC_MSG_CHECKING(version of gcc)
AC_MSG_RESULT($GCC_VERSION)
AC_MSG_CHECKING(version of g++)
AC_MSG_RESULT($GXX_VERSION)
case "$GXX_VERSION" in
0.* | 1.* | 2.*)
AC_MSG_NOTICE(old style GNU compiler)
AC_DEFINE([OLD_GNU_COMPILER],[])
;;
esac
;;
*)
GCC_VERSION="none"
GXX_VERSION="none"
AC_MSG_RESULT(no)
AC_MSG_WARN(cannot find GNU C++ compiler)
;;
esac
AC_CPLUSPLUS_STACK
#--------------------------------------------------------------------
# Checks for standard functionality
#--------------------------------------------------------------------
# Standard C++ library
m4_define([PROG_STDLIB], [AC_LANG_PROGRAM([[
@%:@include <string>
@%:@include <iostream>
]],[[
std::string t="CompileMe";
std::cout <<t.size(); ]])])
if test -n "$STDC_HEADERS";then
AX_CHECK_COMPILE_FLAG([-stdlib=libstdc++],[
LC_APPEND_FLAG([-stdlib=libstdc++],[CXXFLAGS])
LC_APPEND_FLAG([-stdlib=libstdc++],[CFLAGS])
AC_MSG_NOTICE([added libstdc++ in compile flags])])
LC_LINK_IFELSE([stdlibc++], [PROG_STDLIB],[
AC_MSG_NOTICE([compiler has stdlibc++ support])
],[AC_MSG_ERROR([Not able to link with libstdc++])])
fi
AC_CHECK_TYPES(FILE)
AC_CHECK_TYPES(intptr_t)
AC_CHECK_TYPES(time_t)
AC_CHECK_HEADERS(pty.h util.h)
AC_CHECK_FUNCS(gettimeofday)
TM_REPO
TM_PLATFORM
TM_STATIC
#--------------------------------------------------------------------
# External libraries, functions and binaries
#--------------------------------------------------------------------
LC_GUILE
LC_DLOPEN
LC_ICONV
LC_FREETYPE
LC_CAIRO
LC_IMLIB2
LC_AXEL
LC_GS
LC_SQL
LC_SPARKLE
#--------------------------------------------------------------------
# Further TeXmacs settings
#--------------------------------------------------------------------
TM_FASTALLOC
TM_MACOS
TM_WINDOWS
TM_GUI
LC_HUMMUS
TM_DEBUG
TM_OPTIMIZE
TM_INSTALL
TM_SIGN
#--------------------------------------------------------------------
# final adjustement for Texmacs compile and run
#--------------------------------------------------------------------
CPPFLAGS="$CPPFLAGS -include config.h"
#--------------------------------------------------------------------
# Done
#--------------------------------------------------------------------
AC_OUTPUT([
Makefile
src/makefile
misc/admin/admin.makefile
misc/doxygen/Doxyfile:misc/doxygen/Doxyfile.in
misc/man/texmacs.1:misc/man/texmacs.1.in
packages/redhat/TeXmacs.spec:packages/redhat/TeXmacs.spec.in
misc/scripts/fig2ps:misc/scripts/fig2ps.in
misc/scripts/texmacs:misc/scripts/texmacs.in
TeXmacs/examples/plugins/dynlink/Makefile:TeXmacs/examples/plugins/dynlink/Makefile.in
packages/macos/Base.xcconfig:packages/macos/Base.xcconfig.in
packages/macos/Info-Xcode.plist:packages/macos/Info-Xcode.plist.in
packages/macos/Info.plist:packages/macos/Info.plist.in
packages/fedora/TeXmacs.spec:packages/fedora/TeXmacs.spec.in
packages/mandriva/TeXmacs.spec:packages/mandriva/TeXmacs.spec.in
packages/centos/TeXmacs.spec:packages/centos/TeXmacs.spec.in
packages/windows/TeXmacs.iss:packages/windows/TeXmacs.iss.in
packages/windows/resource.rc:packages/windows/resource.rc.in
packages/debian/changelog:packages/debian/changelog.in
packages/debian/control:packages/debian/control.in
src/System/tm_configure.hpp:src/System/tm_configure.in
])