File: configure.ac

package info (click to toggle)
yacas 1.3.6-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 7,176 kB
  • ctags: 3,520
  • sloc: cpp: 13,960; java: 12,602; sh: 11,401; makefile: 552; perl: 517; ansic: 381
file content (214 lines) | stat: -rw-r--r-- 6,497 bytes parent folder | download
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# Process this file with autoconf to produce a configure script.
AC_INIT(yacas, 1.3.6,  yacas-devel@lists.sourceforge.net, , http://yacas.sourceforge.net)

AC_CONFIG_SRCDIR(src/yacasmain.cpp)

AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE

LT_INIT

AC_CONFIG_MACRO_DIR([m4])

# Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX

AC_CHECK_PROG(have_perl, perl, yes, no)
AC_CHECK_PROG(have_pdflatex, pdflatex, yes, no)
AC_CHECK_PROG(have_makeindex, makeindex, yes, no)
AC_CHECK_PROG(have_gzip, gzip, yes, no)
AC_CHECK_TOOL(AR, ar, :)

if test "$AR" = ":"; then
  AC_MSG_ERROR([The tool 'ar', required for compilation, was not found.])
fi

# If using GNU compilers, use extra flags to get warnings
if test "$GCC" = yes; then
  CFLAGS="$CFLAGS -Wall -pedantic "
fi;
if test "$GXX" = yes; then
  CXXFLAGS="$CXXFLAGS -std=c++11 -Wall -pedantic "
fi;

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h sys/ioctl.h sys/socket.h sys/time.h sys/types.h sys/sysinfo.h)
AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h)
AC_CHECK_HEADERS(dirent.h signal.h)
AC_CHECK_HEADERS(string.h)

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_HEADER_TIME

# Checks for library functions.
AC_CHECK_FUNCS(select socket strchr)

# Check type of signal handler
AC_MSG_CHECKING([type of argument of signal handler])
AC_CACHE_VAL(ac_cv_sighandler_arg,dnl
             [ ac_not_found=yes

               cat > conftest.cpp <<EOF
#include <signal.h>
void handler(int foo) {return;}
int main(int argc, char** argv) {signal(SIGKILL,handler); return 0;}
EOF
               if ${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.cpp 2>&5; then
                  ac_cv_sighandler_arg=int
	          ac_not_found=no
               fi
               rm conftest.cpp

	       if test "$ac_not_found" = yes; then
                  cat > conftest.cpp <<EOF
#include <signal.h>
void handler(void) {return;}
int main(int argc, char** argv) {signal(SIGKILL,handler); return 0;}
EOF
                  if ${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.cpp 2>&5; then
                     ac_cv_sighandler_arg=void
		     ac_not_found=no
                  fi
                  rm conftest.cpp
               fi
             ])
if test "$ac_not_found" = yes; then
   ac_cv_sighandler_arg=int
fi
AC_MSG_RESULT([$ac_cv_sighandler_arg])
if test "$ac_cv_sighandler_arg" = void; then
   AC_DEFINE(SIGHANDLER_NO_ARGS,, [Define if signal hander as set by signal() has no arguments])
fi

# Define PLATFORM_OS to be the Operating System
AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED(PLATFORM_OS, "$host_os", [Operating system])

# specifically for macosx
case "$host_os" in
     darwin*) 
     AC_DEFINE(MACOSX, 1, [Define if workarounds are needed for MacOS X])
     MACOSX="yes"
     ;;
esac
AM_CONDITIONAL(MACOS_REZ, test -n "$MACOSX")

case $host in
    *mingw32*)      YACAS_PLATFORM=win32 ;;
    *x86_64*linux*) YACAS_PLATFORM=linux32 ;;
    *)              YACAS_PLATFORM=linux32 ;;
esac
AC_SUBST([YACAS_PLATFORM])

AM_CONDITIONAL(LINUX, test "$YACAS_PLATFORM" = "linux32")
AM_CONDITIONAL(LINUX64, test "$YACAS_PLATFORM" = "linux64")
AM_CONDITIONAL(WIN32, test "$YACAS_PLATFORM" = "win32")

# Support for the debug version
AC_ARG_ENABLE(debug, [  --enable-debug          build the debug version [default=no]])
AC_MSG_CHECKING([whether to build the debug version])
AC_MSG_RESULT($enable_debug)
if test "$enable_debug" = "yes" ; then
  AC_DEFINE(YACAS_DEBUG,, [Define to build the debug version])
  AC_DEFINE(USE_ASSERT,, [Define to build the debug version])
fi

# Support for the network server version
AC_ARG_ENABLE(server, [  --enable-server         build the network server version [default=no]])
AC_MSG_CHECKING([whether to enable the server mode])
AC_MSG_RESULT($enable_server)
if test "$enable_server" = "yes" ; then
  AC_DEFINE([ACCEPT_TYPE_ARG1], , [Define to the type of arg 1 for `accept'.])
  AC_DEFINE([ACCEPT_TYPE_ARG2], , [Define to the type of arg 2 for `accept'.])
  AC_DEFINE([ACCEPT_TYPE_ARG3], , [Define to the type of arg 3 for `accept'.])
  AC_FUNC_ACCEPT_ARGTYPES
  AC_DEFINE(SUPPORT_SERVER,, [Define to build the network server version])
fi

# Generate HTML documentation?
AC_ARG_ENABLE(html-doc, [  --disable-html-doc      do not generate HTML documentation [default=enable]])
if test "x$enable_html_doc" = x; then
	enable_html_doc=$have_perl
	if test "x$have_perl" = xno; then
		AC_MSG_WARN([
		Perl was not found. Therefore, the generation of 
		HTML documentation has been disabled.])
	fi
elif test "x$enable_html_doc" = xyes; then
	if test "x$have_perl" = xno; then
		AC_MSG_ERROR([
		Generation of HTML documentation was explicitly 
		requested. However, this requires Perl, which
		was not found.])
	fi
fi
if test "x$enable_html_doc" = xyes; then
	BOOKS_HTML=manicon.html
	INSTALL_HTML=install-html
fi
AC_SUBST(BOOKS_HTML)
AC_SUBST(INSTALL_HTML)

# Generate PDF documentation?
AC_ARG_ENABLE(pdf-doc, [  --enable-pdf-doc        generate PDF documentation [default=no]])
if test "x$enable_pdf_doc" = xyes; then
	if test "x$have_perl" = xno || test "x$have_pdflatex" = xno \
	   || test "x$have_makeindex" = xno; then
		AC_MSG_ERROR([need perl, pdflatex, and makeindex to generate PDF docs])
	fi
	PDF_DOCS=pdf-docs
fi
AC_SUBST(PDF_DOCS)

# Choice of directories
scriptdir=${datadir}/yacas/scripts/
AC_SUBST(scriptdir)

AC_ARG_WITH(html-dir, [  --with-html-dir=DIR     HTML documentation in DIR [DATADIR/yacas/documentation]])
if test -n "$with_html_dir" ; then
	htmldir=$with_html_dir
else
	htmldir=${datadir}/yacas/documentation/
fi
AC_SUBST(htmldir)

AC_ARG_WITH(pdf-dir, [  --with-pdf-dir=DIR       PDF documentation in DIR [HTMLDIR]])
if test -n "$with_pdf_dir" ; then
	psdir=$with_pdf_dir
else
	psdir=${htmldir}
fi
AC_SUBST(pdfdir)

dnl jb_PREFIX_EXPAND(VARNAME)
dnl -------------------------
dnl Expand $prefix and $exec_prefix in $VARNAME and assign the
dnl result to jb_expanded_VARNAME.
dnl
dnl Written by Alexandre Duret-Lutz
dnl Adapted from AC_DEFINE_DIR by Alexandre Oliva
dnl See http://www.geocrawler.com/archives/3/402/2001/12/0/7416783/
AC_DEFUN([jb_PREFIX_EXPAND],[
        jb_expanded_$1=`(
            test "x$prefix" = xNONE && prefix="$ac_default_prefix"
            test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
            eval eval echo \""[$]$1"\"
        )`])

jb_PREFIX_EXPAND([libdir])

# All done
AC_OUTPUT(Makefile
	docs/Makefile
	scripts/Makefile
	JavaYacas/Makefile
	tests/Makefile
        manmake/Makefile
	src/Makefile)