-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.in
87 lines (69 loc) · 1.92 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
dnl Copyright 2002-2004 by Zhang Le <[email protected]>
AC_INIT(Jamrules.in)
AC_CONFIG_HEADER(config.h)
AC_CONFIG_AUX_DIR(script)
dnl Check platform
AC_CANONICAL_HOST
dnl use C++ do lib checking
AC_LANG_CPLUSPLUS
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_C_BIGENDIAN
wi_ARG_DISABLE_CCDV
dnl check for compiler flags and debug options
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],
[compile for debug mode, useful for developers. (default=no)]),
[if test "x$enableval" = "xyes"; then
enable_debug=yes
else
enable_debug=no
fi])
AC_ARG_ENABLE(static,
[ --enable-static build static binaries (default=no)],
[if test "x$enableval" = "xyes"; then
enable_static=yes
else
enable_static=no
fi])
dnl AC_CHECK_PROGS(MAKE, gmake make)
dnl AC_SUBST(MAKE)
wi_PROG_CCDV
dnl Checks for header files.
dnl AC_CHECK_HEADERS([fcntl.h string.h sys/ioctl.h termios.h unistd.h])
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for library functions.
AC_FUNC_MMAP
AC_CHECK_LIB(gnugetopt, getopt)
AM_ICONV
if test "$am_cv_func_iconv" != 'yes'; then
echo ""
echo "*** iconv() not found on this system, please install libiconv from"
echo "*** http://www.gnu.org/software/libiconv/ first!"
echo ""
exit 1
fi
if test "$enable_debug" = 'yes'; then
CFLAGS="$CFLAGS $CPPFLAGS -g -Wall -DHAVE_CONFIG_H"
CXXFLAGS="$CXXFLAGS $CPPFLAGS -g -Wall -DHAVE_CONFIG_H"
OPTIM="-O0"
TARGET_DIR=""
else
CFLAGS="$CFLAGS $CPPFLAGS -Wall -DNDEBUG -DHAVE_CONFIG_H"
CXXFLAGS="$CXXFLAGS $CPPFLAGS -Wall -DNDEBUG -DHAVE_CONFIG_H"
OPTIM="-O3"
TARGET_DIR="src/opt"
fi
if test "$enable_static" = 'yes'; then
LINK="$CXX $LDFLAGS -static"
else
LINK="$CXX $LDFLAGS"
fi
AC_SUBST(OPTIM)
AC_SUBST(LINK)
AC_SUBST(TARGET_DIR)
AC_SUBST(host_cpu)
AC_SUBST(host_os)
AC_SUBST(host_vendor)
AC_OUTPUT(Jamrules)