-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
145 lines (131 loc) · 3.8 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
dnl
dnl This file is part of Hecios
dnl
dnl Copyright (C) 2007,2008,2009 Brad Settlemyer
dnl
dnl ALL RIGHTS RESERVED.
dnl
dnl
dnl Process this file with autoconf to produce a configure script
dnl
AC_INIT(Hecios,0.0.0.0)
dnl
dnl Determine source and build directories
dnl
CONFIG_BUILD_DIR=`pwd`
CONFIG_PROJECT_RELATIVE_DIR="$srcdir"
CONFIG_PROJECT_DIR=`cd $srcdir; pwd`
AC_SUBST(CONFIG_BUILD_DIR)
AC_SUBST(CONFIG_PROJECT_DIR)
dnl
dnl Check for programs (needs check for install and ld with partial linking)
dnl
AC_PROG_CXX
AC_LANG_CPLUSPLUS
dnl
dnl Check for C++ headers
dnl
AC_HEADER_STDC
AC_CHECK_HEADER([algorithm],
[],
AC_MSG_ERROR(Must include headers for libstdc++))
AC_CHECK_HEADER([cassert],
[],
AC_MSG_ERROR(Must include headers for libstdc++))
AC_CHECK_HEADER([cstddef],
[],
AC_MSG_ERROR(Must include headers for libstdc++))
AC_CHECK_HEADER([iostream],
[],
AC_MSG_ERROR(Must include headers for libstdc++))
AC_CHECK_HEADER([list],
[],
AC_MSG_ERROR(Must include headers for libstdc++))
AC_CHECK_HEADER([map],
[],
AC_MSG_ERROR(Must include headers for libstdc++))
AC_CHECK_HEADER([string],
[],
AC_MSG_ERROR(Must include headers for libstdc++))
AC_CHECK_HEADER([vector],
[],
AC_MSG_ERROR(Must include headers for libstdc++))
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
dnl
dnl Checks for library functions.
dnl
AC_CHECK_FUNCS([memset])
dnl
dnl Use the OmNet++ distribution
dnl
AC_ARG_WITH([omnet],
[ --with-omnet=<path> Use OmNet++ installation at "path"],
[omnet_dir=$withval],
AC_MSG_FAILURE(--with-omnet must be set to the OmNet++ directory.))
if test x$withval = xyes ; then
AC_MSG_ERROR(--with-omnet must be a given pathname)
else
AC_SUBST(CONFIG_OMNET_DIR, "$omnet_dir")
fi
dnl
dnl Locate the XML library for use by Omnet
dnl
xml_library="none"
if test x$xml_library = xnone ; then
AC_SEARCH_LIBS([xmlInitParser], [xml2], xml_library="-lxml2")
fi
if test x$xml_library = xnone ; then
AC_SEARCH_LIBS([XML_ParserCreate], [expat], xml_library="-lexpat")
fi
if test x$xml_library = xnone ; then
AC_MSG_ERROR(libxml2 or libexpat must be installed)
else
AC_SUBST(CONFIG_XML_LIB, "$xml_library")
fi
dnl
dnl Sets the compilation options
dnl
AC_ARG_WITH([mode],
[ --with-mode=<mode> Specify a compile mode: release or debug],
[comp_mode=$withval],
[comp_mode=debug])
case "$comp_mode" in
debug)
dnl CONFIG_CXXFLAGS="-g -Wno-deprecated -Wno-unused -Wall -Werror -D_GLIBCXX_DEBUG"
dnl CONFIG_LDFLAGS="-g -D_GLIBCXX_DEBUG"
CONFIG_CXXFLAGS="-g -Wno-unused -Wall -Werror -ansi -femit-class-debug-always"
CONFIG_UNSAFE_CXXFLAGS="-g"
CONFIG_LDFLAGS="-g"
;;
release)
CONFIG_CXXFLAGS="-g -O2 -DNDEBUG"
CONFIG_UNSAFE_CXXFLAGS="-g -O2 -DNDEBUG"
CONFIG_LDFLAGS="-g"
;;
strict)
CONFIG_CXXFLAGS="-g -Wno-deprecated -Wno-unused -Wall -Werror -ansi -pedantic"
CONFIG_UNSAFE_CXXFLAGS="-g"
CONFIG_LDFLAGS="-g"
;;
*)
AC_MSG_ERROR(Valid compilation modes are debug or release)
;;
esac
AC_SUBST(CONFIG_CXXFLAGS, "$CONFIG_CXXFLAGS")
AC_SUBST(CONFIG_UNSAFE_CXXFLAGS, "$CONFIG_UNSAFE_CXXFLAGS")
AC_SUBST(CONFIG_LDFLAGS, "$CONFIG_LDFLAGS")
dnl
dnl Set the default installation prefix
dnl
install_prefix='${HOME}/software/hecios'
AC_PREFIX_DEFAULT("$install_prefix")
dnl This shouldn't be needed, but its eating the enclosing {}'s otherwise
AC_SUBST(prefix, "$install_prefix")
dnl
dnl Generate output
dnl
AC_OUTPUT(Makefile)