configure.ac
author Mikael Berthe <mikael@lilotux.net>
Sun, 07 Mar 2010 14:51:10 +0100
changeset 1 99fd216641d8
parent 0 d6d9e95a4ae5
child 2 b6516e8751bb
permissions -rw-r--r--
Add module "comment", autotools stuff...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     1
#                                               -*- Autoconf -*-
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     2
# Process this file with autoconf to produce a configure script.
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     3
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     4
AC_PREREQ(2.59)
1
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents: 0
diff changeset
     5
AC_INIT([mcabber-modules],[0.10.0-dev],[mcabber@lilotux.net])
0
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     6
AM_INIT_AUTOMAKE
1
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents: 0
diff changeset
     7
AM_CONFIG_HEADER([config-modules.h])
0
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     8
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     9
AC_PROG_LIBTOOL
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    10
AC_PROG_RANLIB
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    11
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    12
# Checks for programs.
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    13
AC_PROG_CC
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    14
AC_PROG_INSTALL
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    15
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    16
if test "x$GCC" = "xyes"; then
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    17
    dnl Get gcc version
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    18
    AC_MSG_CHECKING([gcc version])
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    19
        gccver=$($CC -dumpversion)
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    20
        gccvermajor=$(echo $gccver | cut -d . -f1)
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    21
        gccverminor=$(echo $gccver | cut -d . -f2)
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    22
        gccvernum=$(expr $gccvermajor "*" 100 + $gccverminor)
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    23
    AC_MSG_RESULT($gccver)
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    24
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    25
    CFLAGS="$CFLAGS -Wall"
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    26
    if test x"$gccvermajor" = x"4" -a x"$gccverminor" = x"2"; then
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    27
        DBGCFLAGS="-fgnu89-inline"
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    28
    fi
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    29
fi
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    30
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    31
AC_SYS_LARGEFILE
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    32
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    33
# Checks for header files.
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    34
AC_HEADER_STDC
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    35
AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h \
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    36
                  stdlib.h string.h strings.h sys/socket.h sys/time.h \
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    37
                  syslog.h termios.h wchar.h wctype.h localcharset.h])
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    38
AC_CHECK_HEADERS([unistd.h], , AC_MSG_ERROR([Missing header file]))
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    39
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    40
# Checks for typedefs, structures, and compiler characteristics.
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    41
AC_HEADER_STDBOOL
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    42
AC_C_CONST
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    43
AC_C_INLINE
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    44
AC_TYPE_SIZE_T
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    45
AC_HEADER_TIME
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    46
AC_STRUCT_TM
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    47
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    48
# Checks for library functions.
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    49
AC_FUNC_ERROR_AT_LINE
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    50
AC_FUNC_MALLOC
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    51
AC_FUNC_MEMCMP
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    52
AC_FUNC_REALLOC
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    53
AC_FUNC_SELECT_ARGTYPES
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    54
AC_TYPE_SIGNAL
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    55
AC_FUNC_STRFTIME
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    56
AC_FUNC_VPRINTF
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    57
AC_CHECK_FUNCS([alarm arc4random bzero gethostbyname gethostname inet_ntoa \
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    58
                isascii memmove memset modf select setlocale socket strcasecmp \
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    59
                strchr strdup strncasecmp strrchr strstr strcasestr vsnprintf \
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    60
                iswblank])
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    61
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    62
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    63
# Check for glib
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    64
AM_PATH_GLIB_2_0(2.14.0,
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    65
                 [AC_DEFINE([HAVE_GLIB_REGEX], 1,
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    66
                            [Define if GLib has regex support])],
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    67
                 [AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]),
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    68
                                  [g_list_append], ["$gmodule_module"])],
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    69
                 [g_regex_new "$gmodule_module"])
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    70
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    71
# Export $libexecdir to the source tree
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    72
AC_DEFINE_DIR(PKGLIB_DIR, "${libdir}/${PACKAGE}", [Modules directory])
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    73
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    74
AC_ARG_ENABLE(debug,
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    75
    [AC_HELP_STRING(--enable-debug, add development compilation options)],
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    76
    debug=$enableval, debug="")
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    77
if test x"${debug}" = x"yes"; then
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    78
    AC_DEFINE_UNQUOTED([ENABLE_DEBUG],[1],[Devel compilation options])
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    79
    if test "x$GCC" = "xyes"; then
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    80
        if test "$gccvernum" -ge "400"; then
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    81
            CFLAGS="$CFLAGS -Wextra"
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    82
        else
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    83
            CFLAGS="$CFLAGS -W"
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    84
        fi
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    85
        CFLAGS="$CFLAGS -Wno-unused-parameter -pedantic -std=gnu99 $DBGCFLAGS -O0"
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    86
    fi # gcc
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    87
    CFLAGS="$CFLAGS -g"
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    88
else
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    89
    CFLAGS="-O2 $CFLAGS"
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    90
fi
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    91
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    92
# We need _GNU_SOURCE for strptime() and strcasestr()
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    93
CFLAGS="$CFLAGS -D_GNU_SOURCE"
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    94
1
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents: 0
diff changeset
    95
AC_CONFIG_FILES([comment/Makefile
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents: 0
diff changeset
    96
                 extsay/Makefile
0
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    97
                 Makefile])
d6d9e95a4ae5 Initial module repository
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    98
AC_OUTPUT