-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
137 lines (112 loc) · 3.4 KB
/
configure.ac
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([adms],[2.3.7],[[email protected]])
AC_CONFIG_HEADER([config.h])
# specific configuration.
AC_CONFIG_AUX_DIR([auxconf])
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_YACC
AC_PROG_CC
AC_PROG_CPP
AC_PROG_LEX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_INIT
# Automake Initialisation.
AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CHECK_PROG(GIT,git,yes)
AC_MSG_CHECKING([for git repo])
AX_PROG_FLEX([],[AC_MSG_WARN(Program flex not found (found $LEX))
AC_MSG_ERROR(Please install gnu flex from http://www.gnu.org/software/flex/)])
AX_PROG_BISON([],[AC_MSG_WARN(Program bison not found (found $YACC))
AC_MSG_ERROR(Please install gnu bison from http://www.gnu.org/software/bison/)])
AC_ARG_VAR([BISON], [Path to Bison parser generator])
AC_ARG_VAR([FLEX], [Path to Flex lexical analyser generator])
AC_PATH_PROG([BISON], [bison])
AC_PATH_PROG([FLEX], [flex])
bison_req=2.5
AX_PROG_BISON_VERSION([${bison_req}], [], [
AC_MSG_ERROR([need $BISON >= $bison_req, found $bison_version])
])
#advice use of gcc
AX_COMPILER_VENDOR
if test "x$ax_cv_c_compiler_vendor" != "xgnu"; then
AC_MSG_WARN(Seems that the selected C-compiler is not gnu gcc C-compiler)
AC_MSG_WARN(We advice you to use gcc as C-compiler)
AC_MSG_WARN(You can install it from http://www.gnu.org/software/gcc/)
fi
AX_CFLAGS_WARN_ALL
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lm':
AC_CHECK_LIB([m], [pow])
# Checks for header files.
AC_FUNC_ALLOCA
AC_HEADER_STDC
AC_CHECK_HEADERS([float.h inttypes.h libintl.h locale.h malloc.h stddef.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT8_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
#https://github.com/Qucs/ADMS/issues/3
#AC_FUNC_MALLOC
#AC_FUNC_REALLOC
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_STRTOD
AC_CHECK_FUNCS([floor memset putenv setenv strdup strstr strtol])
# Libtool initialisation.
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_SUBST([LIBTOOL_DEPS])
dnl Perl, XML::LibXML module required
AC_PATH_PROG(PERL, perl, :)
if test "$PERL" = ":"; then
AC_MSG_ERROR([The $PACKAGE package requires an installed perl.])
fi;
AX_PERL_MODULE_VERSION([XML::LibXML 2],[],[
AC_MSG_RESULT(failed)
AC_MSG_ERROR([Perl package XML::LibXML may be downloaded from http://search.cpan.org/dist/libXML])])
# Define preprocessor flag for static build (MinGW).
AS_IF([test "x$enable_shared" = "xno"], [
case $host in
*mingw*)
AC_DEFINE([staticlink], [1], [Define 'staticlink' for MinGW])
;;
esac
])
AC_CONFIG_FILES([Makefile
admsXml/Makefile
scripts/Makefile])
AC_OUTPUT
dnl Print results.
AC_MSG_RESULT([])
AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
AC_MSG_RESULT([
Configure Information:
Host : $host
C Compiler : $CC
DEFS : $DEFS
CFLAGS : $CFLAGS
Linker : $LD
LIBS : $LIBS
Prefix : $prefix
Perl : $PERL
Flex : $FLEX
Bison : $BISON
Build shared library : $enable_shared
])