gmyth-upnp/m4/configure.ac
author renatofilho
Wed May 16 18:46:10 2007 +0100 (2007-05-16)
branchtrunk
changeset 672 4e623a4274a1
permissions -rw-r--r--
[svn r678] implemented progress on gmencoder plugin
rosfran@253
     1
#                                               -*- Autoconf -*-
rosfran@253
     2
# Process this file with autoconf to produce a configure script.
rosfran@253
     3
rosfran@253
     4
AC_PREREQ(2.50)
rosfran@253
     5
rosfran@253
     6
AC_INIT([gmyth],[0.1])
rosfran@253
     7
rosfran@253
     8
dnl AC_CONFIG_SRCDIR([src/mmyth_main.c])
rosfran@253
     9
AC_CONFIG_HEADER(config.h)
rosfran@253
    10
rosfran@253
    11
dnl when going to/from release please set the nano (fourth number) right !
rosfran@253
    12
dnl releases only do Wall, SVN and prerelease does Werror too
rosfran@253
    13
AS_VERSION(gmyth, GMYTH, 0, 1, 0, 3, GMYTH_SVN="no", GMYTH_SVN="yes")
rosfran@253
    14
rosfran@253
    15
GMYTH_MAJORMINOR=$GMYTH_MAJOR_VERSION.$GMYTH_MINOR_VERSION
rosfran@253
    16
rosfran@253
    17
AC_SUBST(GMYTH_MAJORMINOR)
rosfran@253
    18
rosfran@253
    19
dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
rosfran@253
    20
AM_MAINTAINER_MODE
rosfran@253
    21
dnl make aclocal work in maintainer mode
rosfran@253
    22
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
rosfran@253
    23
rosfran@253
    24
# Checks for programs.
rosfran@253
    25
# check for tools
rosfran@253
    26
# Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
rosfran@253
    27
CFLAGS="$CFLAGS -Wall"
rosfran@253
    28
AC_PROG_CC
rosfran@253
    29
AC_PROG_LIBTOOL
rosfran@253
    30
rosfran@253
    31
dnl Generate doxygen documentation
rosfran@253
    32
DX_HTML_FEATURE(ON)
rosfran@253
    33
DX_CHM_FEATURE(OFF)
rosfran@253
    34
DX_CHI_FEATURE(OFF)
rosfran@253
    35
DX_MAN_FEATURE(OFF)
rosfran@253
    36
DX_RTF_FEATURE(OFF)
rosfran@253
    37
DX_XML_FEATURE(OFF)
rosfran@253
    38
DX_PDF_FEATURE(OFF)
rosfran@253
    39
DX_PS_FEATURE(OFF)
rosfran@253
    40
DX_INIT_DOXYGEN(gmyth, doxygen.cfg, docs)
rosfran@253
    41
rosfran@253
    42
rosfran@253
    43
# Checks for libraries.
rosfran@253
    44
rosfran@253
    45
# Checks for header files.
rosfran@253
    46
AC_HEADER_STDC
rosfran@253
    47
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
rosfran@253
    48
rosfran@253
    49
# Checks for typedefs, structures, and compiler characteristics.
rosfran@253
    50
AC_C_CONST
rosfran@253
    51
AC_TYPE_PID_T
rosfran@253
    52
AC_STRUCT_TM
rosfran@253
    53
rosfran@253
    54
# Checks for library functions.
rosfran@253
    55
AC_FUNC_FORK
rosfran@253
    56
AC_PROG_GCC_TRADITIONAL
rosfran@253
    57
AC_FUNC_MALLOC
rosfran@253
    58
AC_FUNC_MKTIME
rosfran@253
    59
AC_FUNC_VPRINTF
rosfran@253
    60
AC_CHECK_FUNCS([memset socket stime strstr strtoul])
rosfran@253
    61
rosfran@253
    62
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
rosfran@253
    63
rosfran@253
    64
# Checks required packages
rosfran@253
    65
rosfran@253
    66
dnl Test if --disable-debug given
rosfran@253
    67
AC_ARG_ENABLE(debug,
rosfran@253
    68
	[AC_HELP_STRING([--disable-debug], [disable debugging mode])],
rosfran@253
    69
	enable_debug="$enableval",
rosfran@253
    70
	enable_debug=yes)
rosfran@253
    71
rosfran@253
    72
if test "x$enable_debug" = "xyes" ; then
rosfran@253
    73
      CFLAGS="$CFLAGS -g"
rosfran@253
    74
else
rosfran@253
    75
      AC_DEFINE( NDEBUG, 1, [disable debug messages] )
rosfran@253
    76
      CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS -DNDEBUG"
rosfran@253
    77
fi          
rosfran@253
    78
rosfran@253
    79
AM_CONDITIONAL( NDEBUG, test "x$enable_debug" = "xyes" )
rosfran@253
    80
rosfran@253
    81
# Check for pkgconfig
rosfran@253
    82
AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
rosfran@253
    83
# Give error and exit if we don't have pkgconfig
rosfran@253
    84
if test "x$HAVE_PKGCONFIG" = "xno"; then
rosfran@253
    85
  AC_MSG_ERROR(you need to have pkgconfig installed !)
rosfran@253
    86
fi
rosfran@253
    87
rosfran@253
    88
# Check for Glib2.0
rosfran@253
    89
PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
rosfran@253
    90
rosfran@253
    91
# Give error and exit if we don't have glib
rosfran@253
    92
if test "x$HAVE_GLIB" = "xno"; then
rosfran@253
    93
  AC_MSG_ERROR(you need glib-2.0 installed)
rosfran@253
    94
fi
rosfran@253
    95
rosfran@253
    96
# make GLIB_CFLAGS and GLIB_LIBS available
rosfran@253
    97
AC_SUBST(GLIB_CFLAGS)
rosfran@253
    98
AC_SUBST(GLIB_LIBS)
rosfran@253
    99
rosfran@253
   100
# Check for GObject2.0
rosfran@253
   101
PKG_CHECK_MODULES(GOBJECT,
rosfran@253
   102
  gobject-2.0,
rosfran@253
   103
  HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
rosfran@253
   104
rosfran@253
   105
# Give error and exit if we don't have gobject
rosfran@253
   106
if test "x$HAVE_GOBJECT" = "xno"; then
rosfran@253
   107
  AC_MSG_ERROR(you need gobject-2.0 installed)
rosfran@253
   108
fi
rosfran@253
   109
rosfran@253
   110
# make GOBJECT_CFLAGS and GOBJECT_LIBS available
rosfran@253
   111
AC_SUBST(GOBJECT_CFLAGS)
rosfran@253
   112
AC_SUBST(GOBJECT_LIBS)
rosfran@253
   113
rosfran@253
   114
# Check for GTK+-2.0
rosfran@253
   115
PKG_CHECK_MODULES(GTK, gtk+-2.0, HAVE_GTK=yes,HAVE_GTK=no)
rosfran@253
   116
rosfran@253
   117
# Give error and exit if we don't have gtk
rosfran@253
   118
if test "x$HAVE_GTK" = "xyes"; then
rosfran@253
   119
  AC_DEFINE(WITH_GTK, 1, [build with GTK+ related stuff])
rosfran@253
   120
  dnl AC_MSG_ERROR(you need gtk+-2.0 installed)
rosfran@253
   121
else
rosfran@253
   122
  AC_MSG_RESULT(no)
rosfran@253
   123
fi
rosfran@253
   124
rosfran@253
   125
AM_CONDITIONAL(WITH_GTK, test "x$HAVE_GTK" = "xyes" )
rosfran@253
   126
rosfran@253
   127
# make GTK_CFLAGS and GTK_LIBS available
rosfran@253
   128
AC_SUBST(GTK_CFLAGS)
rosfran@253
   129
AC_SUBST(GTK_LIBS)
rosfran@253
   130
rosfran@253
   131
dnl ========== Check for Hildon Libraries
rosfran@253
   132
PKG_CHECK_MODULES(HILDON,
rosfran@253
   133
  hildon-lgpl libosso hildon-status-bar-lib libhildonmenu hildon-base-lib hildon-control-panel hildon-libs,
rosfran@253
   134
  HAVE_HILDON=yes, HAVE_HILDON=no)
rosfran@253
   135
rosfran@253
   136
if test "x$HAVE_HILDON" = "xyes"; then
rosfran@253
   137
  AC_DEFINE(MAEMO_PLATFORM, 1, [build with hildon libs])
rosfran@253
   138
  HILDON_CFLAGS="$HILDON_CFLAGS -DMAEMO_PLATFORM=1"
rosfran@253
   139
else
rosfran@253
   140
  AC_MSG_RESULT(no)
rosfran@253
   141
fi
rosfran@253
   142
rosfran@253
   143
AM_CONDITIONAL(MAEMO_PLATFORM, test "x$HAVE_HILDON" = "xyes")
rosfran@253
   144
rosfran@253
   145
dnl make HILDON_CFLAGS and HILDON_LIBS available
rosfran@253
   146
AC_SUBST(HILDON_CFLAGS)
rosfran@253
   147
AC_SUBST(HILDON_LIBS)
rosfran@253
   148
rosfran@253
   149
# Check for libxml-2.0
rosfran@253
   150
PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no)
rosfran@253
   151
rosfran@253
   152
# Give error and exit if we don't have libxml
rosfran@253
   153
if test "x$HAVE_LIBXML" = "xno"; then
rosfran@253
   154
  AC_MSG_ERROR(you need libxml-2.0 installed)
rosfran@253
   155
fi
rosfran@253
   156
rosfran@253
   157
# make LIBXML_CFLAGS and LIBXML_LIBS available
rosfran@253
   158
AC_SUBST(LIBXML_CFLAGS)
rosfran@253
   159
AC_SUBST(LIBXML_LIBS)
rosfran@253
   160
rosfran@253
   161
rosfran@253
   162
# check for gstreamer development files
rosfran@253
   163
GST_REQUIRED=0.10
rosfran@253
   164
GST_MAJORMINOR=0.10
rosfran@253
   165
PKG_CHECK_MODULES(GST, \
rosfran@253
   166
  gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
rosfran@253
   167
  HAVE_GST=yes, HAVE_GST=no)
rosfran@253
   168
rosfran@253
   169
# Give error and exit if we don't have gstreamer
rosfran@253
   170
if test "x$HAVE_GST" = "xno"; then
rosfran@253
   171
  AC_MSG_ERROR(you need gstreamer development packages installed !)
rosfran@253
   172
fi
rosfran@253
   173
rosfran@253
   174
# make GST_CFLAGS and GST_LIBS available
rosfran@253
   175
AC_SUBST(GST_CFLAGS)
rosfran@253
   176
AC_SUBST(GST_LIBS)
rosfran@253
   177
rosfran@253
   178
# check for gstreamer-base plugins (xoverlay interface)
rosfran@253
   179
GSTBASE_REQUIRED=0.10
rosfran@253
   180
GSTBASE_MAJORMINOR=0.10
rosfran@253
   181
PKG_CHECK_MODULES(GSTBASE, \
rosfran@253
   182
  gstreamer-base-$GSTBASE_MAJORMINOR >= $GSTBASE_REQUIRED,
rosfran@253
   183
  HAVE_GSTBASE=yes, HAVE_GSTBASE=no)
rosfran@253
   184
rosfran@253
   185
# Give error and exit if we don't have gstreamer base libraries
rosfran@253
   186
if test "x$HAVE_GSTBASE" = "xno"; then
rosfran@253
   187
  AC_MSG_ERROR(you need gstreamer base development packages installed !)
rosfran@253
   188
fi
rosfran@253
   189
rosfran@253
   190
# make GSTBASE_CFLAGS and GSTBASE_LIBS available
rosfran@253
   191
AC_SUBST(GSTBASE_CFLAGS)
rosfran@253
   192
AC_SUBST(GSTBASE_LIBS)
rosfran@253
   193
rosfran@253
   194
rosfran@253
   195
# make GST_MAJORMINOR available in Makefile.am
rosfran@253
   196
AC_SUBST(GST_MAJORMINOR)
rosfran@253
   197
rosfran@253
   198
#
rosfran@253
   199
# mysql libraries
rosfran@253
   200
#
rosfran@253
   201
AC_CHECK_PROG(MYSQL_CFLAGS,mysql_config,`mysql_config --cflags`)
rosfran@253
   202
if test -z "$MYSQL_CFLAGS"; then 
rosfran@253
   203
        AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
rosfran@253
   204
fi
rosfran@253
   205
AC_SUBST(MYSQL_CFLAGS)
rosfran@253
   206
rosfran@253
   207
rosfran@253
   208
AC_CHECK_PROG(MYSQL_LIBS,mysql_config,`mysql_config --libs`)
rosfran@253
   209
if test -z "$MYSQL_LIBS"; then 
rosfran@253
   210
        AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
rosfran@253
   211
fi
rosfran@253
   212
AC_SUBST(MYSQL_LIBS)
rosfran@253
   213
rosfran@253
   214
## Check for gmyth-0.1
rosfran@253
   215
rosfran@253
   216
PKG_CHECK_MODULES(LIBGMYTH, gmyth-0.1, HAVE_LIBGMYTH=yes,HAVE_LIBGMYTH=no)
rosfran@253
   217
rosfran@253
   218
# Give error and exit if we don't have gmyth-0.1
rosfran@253
   219
if test "x$HAVE_LIBGMYTH" = "xno"; then
rosfran@253
   220
  AC_MSG_ERROR(you need gmyth-0.1 installed)
rosfran@253
   221
fi
rosfran@253
   222
rosfran@253
   223
# make LIBXML_CFLAGS and LIBXML_LIBS available
rosfran@253
   224
AC_SUBST(LIBGMYTH_CFLAGS)
rosfran@253
   225
AC_SUBST(LIBGMYTH_LIBS)
rosfran@253
   226
rosfran@253
   227
#dnl Enable gtk-doc
rosfran@253
   228
#GTK_DOC_CHECK(1.4)
rosfran@253
   229
rosfran@253
   230
rosfran@253
   231
AC_CONFIG_FILES([Makefile
rosfran@253
   232
                src/Makefile
rosfran@253
   233
                pixmaps/Makefile])
rosfran@253
   234
AC_OUTPUT