summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 1f8435b681eb514ed583edfe9e6f9d35f3cc3f00 (plain) (blame)
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
AC_INIT(foobar, 1.0, me@mail.com)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(src)
AC_CONFIG_MACRO_DIR([m4])
#AC_CONFIG_SRCDIR(src/foobar.cpp)

AM_INIT_AUTOMAKE([foreign])

#AC_PROG_CXX
AC_PROG_CC
AM_PROG_CC_C_O
LT_INIT
AC_PROG_LIBTOOL
AC_ENABLE_SHARED
AC_DISABLE_STATIC

AC_ARG_ENABLE(
    [sanitize],
    AC_HELP_STRING(
        [--enable-sanitize],
        [
            Enables or Disables Sanitize Address Checking (SANITIZE is disabled by default)
        ]
    ),
    [
        enable_sanitize="$enableval"
        case $enableval in
            "no");;
            "yes");;
            *) AC_MSG_ERROR([[invalid argument --enable-sanitize=$disableval... stopping]]);;
        esac
    ],
    [enable_sanitize="no"]
)
AM_CONDITIONAL(ENABLE_SANITIZE, test x$enable_sanitize = xyes)

AC_ARG_ENABLE(
    [static],
    AC_HELP_STRING(
        [--enable-static],
        [
            Enables or Disables Statick Linking (STATIC is disabled by default)
        ]
    ),
    [
        enable_static="$enableval"
        case $enableval in
            "no");;
            "yes");;
            *) AC_MSG_ERROR([[invalid argument --enable-static=$disableval... stopping]]);;
        esac
    ],
    [enable_static="no"]
)
AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)

AC_ARG_ENABLE(
    [gprof],
    AC_HELP_STRING(
        [--enable-gprof],
        [
            Enables or Disables Gprof (disabled by default)
        ]
    ),
    [
        enable_gprof="$enableval"
        case $enableval in
            "no");;
            "yes");;
            *) AC_MSG_ERROR([[invalid argument --enable-gprof=$disableval... stopping]]);;
        esac
    ],
    [enable_gprof="no"]
)
AM_CONDITIONAL(ENABLE_GPROF, test x$enable_gprof = xyes)

AC_CHECK_FUNC([strnlen],[CFLAGS="$CFLAGS -DHAVE_STRNLEN"])

AC_CHECK_FUNC([setrlimit],[CLAGS="$CFLAGS -DHAVE_SETRLIMIT"])

AC_OUTPUT(Makefile src/Makefile)