gmyth/configure.ac
author rosfran
Fri Feb 02 22:44:59 2007 +0000 (2007-02-02)
branchtrunk
changeset 323 6523ab923c00
parent 275 d2192075f563
child 360 6d5596b9eb95
permissions -rw-r--r--
[svn r325] Minor changes, separated process of opening LiveTV FileTransfer from the LiveTV setup.
leo_sobral@1
     1
#                                               -*- Autoconf -*-
leo_sobral@1
     2
# Process this file with autoconf to produce a configure script.
leo_sobral@1
     3
leo_sobral@1
     4
AC_PREREQ(2.50)
leo_sobral@1
     5
leo_sobral@1
     6
AC_INIT([gmyth],[0.1])
leo_sobral@1
     7
leo_sobral@1
     8
dnl AC_CONFIG_SRCDIR([src/mmyth_main.c])
leo_sobral@1
     9
AC_CONFIG_HEADER(config.h)
leo_sobral@1
    10
leo_sobral@1
    11
dnl when going to/from release please set the nano (fourth number) right !
leo_sobral@1
    12
dnl releases only do Wall, SVN and prerelease does Werror too
rosfran@134
    13
AS_VERSION(gmyth, GMYTH, 0, 1, 0, 3, GMYTH_SVN="no", GMYTH_SVN="yes")
rosfran@134
    14
GMYTH_MAJORMINOR=$GMYTH_MAJOR_VERSION.$GMYTH_MINOR_VERSION
rosfran@134
    15
AC_SUBST(GMYTH_MAJORMINOR)
leo_sobral@1
    16
leo_sobral@1
    17
dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
leo_sobral@1
    18
AM_MAINTAINER_MODE
leo_sobral@1
    19
dnl make aclocal work in maintainer mode
leo_sobral@1
    20
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
leo_sobral@1
    21
leo_sobral@1
    22
# Checks for programs.
leo_sobral@1
    23
# check for tools
leo_sobral@1
    24
# Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
leo_sobral@1
    25
CFLAGS="$CFLAGS -Wall"
leo_sobral@1
    26
AC_PROG_CC
leo_sobral@1
    27
AC_PROG_LIBTOOL
leo_sobral@1
    28
leo_sobral@1
    29
dnl Generate doxygen documentation
leo_sobral@1
    30
DX_HTML_FEATURE(ON)
leo_sobral@1
    31
DX_CHM_FEATURE(OFF)
leo_sobral@1
    32
DX_CHI_FEATURE(OFF)
leo_sobral@1
    33
DX_MAN_FEATURE(OFF)
leo_sobral@1
    34
DX_RTF_FEATURE(OFF)
leo_sobral@1
    35
DX_XML_FEATURE(OFF)
leo_sobral@1
    36
DX_PDF_FEATURE(OFF)
leo_sobral@1
    37
DX_PS_FEATURE(OFF)
leo_sobral@1
    38
DX_INIT_DOXYGEN(gmyth, doxygen.cfg, docs)
leo_sobral@1
    39
leo_sobral@1
    40
# Checks for libraries.
leo_sobral@1
    41
leo_sobral@1
    42
# Checks for header files.
leo_sobral@1
    43
AC_HEADER_STDC
leo_sobral@1
    44
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
leo_sobral@1
    45
leo_sobral@1
    46
# Checks for typedefs, structures, and compiler characteristics.
leo_sobral@1
    47
AC_C_CONST
leo_sobral@1
    48
AC_TYPE_PID_T
leo_sobral@1
    49
AC_STRUCT_TM
rosfran@134
    50
AC_HEADER_TIME
rosfran@134
    51
AC_HEADER_STDBOOL
rosfran@134
    52
leo_sobral@1
    53
# Checks for library functions.
leo_sobral@1
    54
AC_FUNC_FORK
rosfran@134
    55
AC_FUNC_STRFTIME
rosfran@134
    56
AC_FUNC_SELECT_ARGTYPES
leo_sobral@1
    57
AC_PROG_GCC_TRADITIONAL
leo_sobral@1
    58
AC_FUNC_MALLOC
leo_sobral@1
    59
AC_FUNC_MKTIME
rosfran@215
    60
AC_FUNC_STRFTIME
leo_sobral@1
    61
AC_FUNC_VPRINTF
rosfran@215
    62
AC_CHECK_FUNCS([memset socket stime strstr strtoul gethostname inet_ntoa localtime_r select strrchr localtime strptime])
leo_sobral@1
    63
rosfran@261
    64
##############################
rosfran@261
    65
# Checks for Network functions
rosfran@261
    66
##############################
rosfran@261
    67
rosfran@261
    68
AC_CHECK_FUNCS([socket])
rosfran@261
    69
AC_CHECK_FUNCS([inet_ntoa])
rosfran@261
    70
AC_CHECK_HEADERS([ifaddrs.h])
rosfran@261
    71
AC_CHECK_FUNCS([getifaddrs])
rosfran@261
    72
AC_CHECK_FUNCS([time])
rosfran@261
    73
leo_sobral@1
    74
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
leo_sobral@1
    75
rosfran@246
    76
CFLAGS="$CFLAGS -I/usr/include"
rosfran@246
    77
LDFLAGS="$LDFLAGS -L/usr/lib"
rosfran@246
    78
leo_sobral@1
    79
# Checks required packages
leo_sobral@1
    80
leo_sobral@1
    81
dnl Test if --disable-debug given
leo_sobral@1
    82
AC_ARG_ENABLE(debug,
renatofilho@131
    83
	AC_HELP_STRING([--disable-debug], [enable debugging mode]))
renatofilho@131
    84
if test x"$enable_debug" != xno; then
renatofilho@131
    85
    CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG"
leo_sobral@1
    86
else
renatofilho@131
    87
    CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
leo_sobral@1
    88
fi          
leo_sobral@1
    89
leo_sobral@1
    90
# Check for pkgconfig
leo_sobral@1
    91
AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
leo_sobral@1
    92
# Give error and exit if we don't have pkgconfig
leo_sobral@1
    93
if test "x$HAVE_PKGCONFIG" = "xno"; then
leo_sobral@1
    94
  AC_MSG_ERROR(you need to have pkgconfig installed !)
leo_sobral@1
    95
fi
leo_sobral@1
    96
leo_sobral@1
    97
# Check for Glib2.0
leo_sobral@1
    98
PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
leo_sobral@1
    99
leo_sobral@1
   100
# Give error and exit if we don't have glib
leo_sobral@1
   101
if test "x$HAVE_GLIB" = "xno"; then
leo_sobral@1
   102
  AC_MSG_ERROR(you need glib-2.0 installed)
leo_sobral@1
   103
fi
leo_sobral@1
   104
leo_sobral@1
   105
# make GLIB_CFLAGS and GLIB_LIBS available
leo_sobral@1
   106
AC_SUBST(GLIB_CFLAGS)
leo_sobral@1
   107
AC_SUBST(GLIB_LIBS)
leo_sobral@1
   108
leo_sobral@1
   109
# Check for GObject2.0
leo_sobral@1
   110
PKG_CHECK_MODULES(GOBJECT,
leo_sobral@1
   111
  gobject-2.0,
leo_sobral@1
   112
  HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
leo_sobral@1
   113
leo_sobral@1
   114
# Give error and exit if we don't have gobject
leo_sobral@1
   115
if test "x$HAVE_GOBJECT" = "xno"; then
leo_sobral@1
   116
  AC_MSG_ERROR(you need gobject-2.0 installed)
leo_sobral@1
   117
fi
leo_sobral@1
   118
leo_sobral@1
   119
# make GOBJECT_CFLAGS and GOBJECT_LIBS available
leo_sobral@1
   120
AC_SUBST(GOBJECT_CFLAGS)
leo_sobral@1
   121
AC_SUBST(GOBJECT_LIBS)
leo_sobral@1
   122
leo_sobral@1
   123
# Check for libxml-2.0
leo_sobral@1
   124
PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no)
leo_sobral@1
   125
renatofilho@18
   126
# Give error and exit if we don't have libxml
leo_sobral@1
   127
if test "x$HAVE_LIBXML" = "xno"; then
leo_sobral@1
   128
  AC_MSG_ERROR(you need libxml-2.0 installed)
leo_sobral@1
   129
fi
leo_sobral@1
   130
leo_sobral@1
   131
# make LIBXML_CFLAGS and LIBXML_LIBS available
leo_sobral@1
   132
AC_SUBST(LIBXML_CFLAGS)
leo_sobral@1
   133
AC_SUBST(LIBXML_LIBS)
leo_sobral@1
   134
morphbr@268
   135
# Check for libcurl
morphbr@268
   136
PKG_CHECK_MODULES(LIBCURL, libcurl, HAVE_LIBCRUL=yes, HAVE_LIBCURL=no)
morphbr@268
   137
morphbr@268
   138
# Give error and exit if we don't have libcurl
morphbr@268
   139
if test "x$HAVE_LIBCURL" = "xno"; then
morphbr@268
   140
  AC_MSG_ERROR(you need libcurl installed)
morphbr@268
   141
fi
morphbr@268
   142
morphbr@268
   143
# make LIBCURL_CFLAGS and LIBCURL_LIBS available
morphbr@268
   144
AC_SUBST(LIBCURL_CFLAGS)
morphbr@268
   145
AC_SUBST(LIBCURL_LIBS)
morphbr@268
   146
leo_sobral@1
   147
leo_sobral@1
   148
#
leo_sobral@1
   149
# mysql libraries
leo_sobral@1
   150
#
melunko@257
   151
AC_CHECK_PROG(MYSQL_CFLAGS,mysql_config,`mysql_config --cflags`)
melunko@257
   152
if test -z "$MYSQL_CFLAGS"; then
melunko@257
   153
        AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
melunko@257
   154
fi
melunko@257
   155
AC_SUBST(MYSQL_CFLAGS)
rosfran@246
   156
rosfran@240
   157
melunko@257
   158
AC_CHECK_PROG(MYSQL_LIBS,mysql_config,`mysql_config --libs`)
melunko@257
   159
if test -z "$MYSQL_LIBS"; then
melunko@257
   160
        AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
melunko@257
   161
fi
leo_sobral@1
   162
AC_SUBST(MYSQL_LIBS)
leo_sobral@1
   163
leo_sobral@1
   164
#dnl Enable gtk-doc
leo_sobral@1
   165
#GTK_DOC_CHECK(1.4)
leo_sobral@1
   166
rosfran@246
   167
AC_SUBST(CFLAGS)
rosfran@246
   168
AC_SUBST(LDFLAGS)
rosfran@246
   169
AC_SUBST(LIBS)
rosfran@246
   170
renatofilho@131
   171
AC_OUTPUT([
renatofilho@131
   172
Makefile
renatofilho@131
   173
src/Makefile
renatofilho@148
   174
tests/Makefile
renatofilho@131
   175
gmyth.pc])
renatofilho@131
   176
rosfran@261
   177
if test "x$enable_debug" != "xno"; then
renatofilho@131
   178
    AC_MSG_NOTICE([Debug: Enabled])
renatofilho@131
   179
else
renatofilho@131
   180
    AC_MSG_NOTICE([Debug: Disabled])
renatofilho@131
   181
fi          
renatofilho@131
   182