2 # config-host.in a configure sub script for GNU M2.
4 # Copyright (C) 2005-2024 Free Software Foundation, Inc.
5 # Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
7 # This file is part of GNU Modula-2.
9 # GNU Modula-2 is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3, or (at your option)
14 # GNU Modula-2 is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # Under Section 7 of GPL version 3, you are granted additional
20 # permissions described in the GCC Runtime Library Exception, version
21 # 3.1, as published by the Free Software Foundation.
23 # You should have received a copy of the GNU General Public License and
24 # a copy of the GCC Runtime Library Exception along with this program;
25 # see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
26 # <http://www.gnu.org/licenses/>.
28 AC_INIT(ASCII.def, 1.9.5, gm2@nongnu.org)
29 AC_CONFIG_HEADER(gm2-libs-host.h:gm2-libs-host.h.in)
31 # Checks for programs.
33 # Checks for libraries.
35 # Checks for header files.
39 AC_CHECK_HEADER([math.h],
40 [AC_DEFINE([HAVE_MATH_H], [1], [have math.h])])
42 AC_CHECK_HEADERS([limits.h stddef.h string.h strings.h stdlib.h \
44 fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
45 sys/resource.h sys/param.h sys/times.h sys/stat.h \
46 sys/wait.h sys/ioctl.h errno.h sys/errno.h \
47 pwd.h direct.h dirent.h signal.h malloc.h langinfo.h \
48 pthread.h stdarg.h stdio.h sys/types.h termios.h \
49 netinet/in.h netdb.h])
51 # Checks for typedefs, structures, and compiler characteristics.
56 AC_FUNC_SELECT_ARGTYPES
58 # Checks for library functions.
63 AC_CHECK_FUNCS(select)
64 AC_CHECK_FUNCS(strsignal)
65 AC_CHECK_FUNCS(strtod)
66 AC_CHECK_FUNCS(strtold)
67 AC_CHECK_FUNCS(cfmakeraw)
70 # library functions (used by gm2-libs and ulm-lib-gm2)
71 # the results of this configuration are process by
72 # tools-src/createUlmSys in order to produce the runtime system
75 AC_CHECK_FUNCS(access)
80 AC_CHECK_FUNCS(execve)
84 AC_CHECK_FUNCS(getdents)
85 AC_CHECK_FUNCS(getgid)
86 AC_CHECK_FUNCS(getpid)
87 AC_CHECK_FUNCS(gettimeofday)
88 AC_CHECK_FUNCS(getuid)
97 AC_CHECK_FUNCS(setitimer)
98 AC_CHECK_FUNCS(setgid)
99 AC_CHECK_FUNCS(setuid)
101 AC_CHECK_FUNCS(times)
102 AC_CHECK_FUNCS(unlink)
104 AC_CHECK_FUNCS(write)
108 dnl now check for specific types
111 AC_CHECK_SIZEOF([long])
113 dnl this routine has been adopted from the GNU emacs20 distrubution
114 AC_MSG_CHECKING(for struct timeval)
115 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
116 #include <sys/time.h>
119 #ifdef HAVE_SYS_TIME_H
120 #include <sys/time.h>
124 #endif], [static struct timeval x; x.tv_sec = x.tv_usec;],
127 AC_DEFINE([HAVE_TIMEVAL], [1], [struct timeval exists])],
130 AC_DEFINE([HAVE_TIMEVAL], [1], [struct timeval exists]))
133 # AC_CHECK_TYPES(time_t)
137 dnl now check for presence of libraries and functions within libraries.
140 AC_CHECK_LIB(m, exp10, [AC_DEFINE([HAVE_EXP10],[1],[Define to 1 if your system has 'exp10'.])])
141 AC_CHECK_LIB(m, exp10f, [AC_DEFINE([HAVE_EXP10F],[1],[Define to 1 if your system has 'exp10f'.])])
142 AC_CHECK_LIB(m, exp10l, [AC_DEFINE([HAVE_EXP10L],[1],[Define to 1 if your system has 'exp10l'.])])
144 AC_CHECK_LIB(m, signbit, [AC_DEFINE([HAVE_SIGNBIT],[1],[Define to 1 if your system has 'signbit'.])])
145 AC_CHECK_LIB(m, signbitf, [AC_DEFINE([HAVE_SIGNBITF],[1],[Define to 1 if your system has 'signbitf'.])])
146 AC_CHECK_LIB(m, signbitl, [AC_DEFINE([HAVE_SIGNBITL],[1],[Define to 1 if your system has 'signbitl'.])])