1#/********************************************************** 2# * 3# * libmp3splt -- library based on mp3splt, 4# * for mp3/ogg splitting without decoding 5# * 6# * Copyright (c) 2002-2005 M. Trotta - <mtrotta@users.sourceforge.net> 7# * Copyright (c) 2005-2014 Munteanu Alexandru - m@ioalex.net 8# * 9# * http://mp3splt.sourceforge.net 10# * 11# *********************************************************/ 12 13#/********************************************************** 14# 15# This program is free software; you can redistribute it and/or modify 16# it under the terms of the GNU General Public License as published by 17# the Free Software Foundation; either version 2 of the License, or 18# (at your option) any later version. 19# 20# This program is distributed in the hope that it will be useful, 21# but WITHOUT ANY WARRANTY; without even the implied warranty of 22# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23# GNU General Public License for more details. 24# 25# You should have received a copy of the GNU General Public License 26# along with this program; if not, write to the Free Software 27# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 28# USA. 29# 30# *********************************************************/ 31 32################################################# 33# Basic initialisations 34################################################# 35 36#inspired from gtk sources 37m4_define([libmp3splt_major_version], [0]) 38m4_define([libmp3splt_minor_version], [9]) 39m4_define([libmp3splt_micro_version], [2]) 40m4_define([libmp3splt_version], 41 [libmp3splt_major_version.libmp3splt_minor_version.libmp3splt_micro_version]) 42 43AC_PREREQ([2.62]) 44AC_INIT([libmp3splt],[libmp3splt_version],[m@ioalex.net]) 45AC_CONFIG_AUX_DIR([libltdl/config]) 46AM_INIT_AUTOMAKE 47AC_CONFIG_HEADERS([config.h]) 48AM_MAINTAINER_MODE([enable]) 49 50LIBMP3SPLT_MAJOR_VERSION=libmp3splt_major_version 51AC_SUBST(LIBMP3SPLT_MAJOR_VERSION) 52LIBMP3SPLT_MINOR_VERSION=libmp3splt_minor_version 53AC_SUBST(LIBMP3SPLT_MINOR_VERSION) 54LIBMP3SPLT_MICRO_VERSION=libmp3splt_micro_version 55AC_SUBST(LIBMP3SPLT_MICRO_VERSION) 56 57################################################# 58# Check for programs 59################################################# 60 61AC_PROG_CC 62AC_PROG_INSTALL 63AC_PROG_LN_S 64 65AC_CHECK_HEADERS([unistd.h]) 66AM_GNU_GETTEXT([external]) 67AM_GNU_GETTEXT_VERSION([0.13.1]) 68 69################################################################# 70# Checks for typedefs, structures, and compiler characteristics 71################################################################# 72 73AC_C_BIGENDIAN 74AC_C_CONST 75 76SONAME=0 77AC_SUBST(SONAME) 78AC_DEFINE_UNQUOTED([SPLT_SONAME], "$SONAME", [library SONAME]) 79 80################################################################# 81# Enable libtool, check for libltdl and define @LIBLTDL@ and @INCLTDL@ 82################################################################# 83 84ifdef([LT_CONFIG_LTDL_DIR], 85 [ LT_CONFIG_LTDL_DIR([libltdl]) ], 86 []) 87 88ifdef([LT_INIT], 89 [ LT_INIT([win32-dll]) ], 90 [ AC_PROG_LIBTOOL ]) 91 92AC_WITH_LTDL 93 94################################################################# 95# Check for the type of the host 96################################################################# 97 98AM_CONDITIONAL(WIN32,false) 99AC_MSG_CHECKING(the host) 100case $host in 101 *linux*) 102 HOST="Linux-based system" 103 ;; 104 *openbsd*) 105 HOST="OpenBSD" 106 LIBS="$LIBS -lm" 107 ;; 108 *netbsd*) 109 HOST="NetBSD" 110 ;; 111 *freebsd*) 112 HOST="FreeBSD" 113 ;; 114 *mingw*) 115 HOST="Mingw" 116 AM_CONDITIONAL(WIN32, true) 117 ;; 118 *solaris*) 119 HOST="Solaris" 120 ;; 121 *) 122 HOST="Other" 123 ;; 124esac 125AC_MSG_RESULT($HOST) 126 127################################################################# 128# Check for some debugging, warnings and optimise options 129################################################################# 130 131AC_ARG_ENABLE(c-debug, [AC_HELP_STRING([--enable-c-debug],[ Enable debugging symbols. ]) ], 132 [enable_c_debug=$enableval],[enable_c_debug="no"]) 133if test "x$enable_c_debug" = xyes;then 134 CFLAGS="$CFLAGS -g -Wall" 135fi 136 137AC_ARG_ENABLE(optimise, [AC_HELP_STRING([--disable-optimise],[ Disable O3 optimise. ]) ], 138 [enable_optimise=$enableval],[enable_optimise="yes"]) 139if test "x$enable_optimise" = xyes;then 140 CFLAGS="$CFLAGS -O3" 141fi 142 143AC_ARG_ENABLE(extra-warnings, [AC_HELP_STRING([--enable-extra-warnings],[ Enable extra warnings. ]) ], 144 [enable_extra_warnings=$enableval],[enable_extra_warnings="no"]) 145if test "x$enable_extra_warnings" = xyes;then 146 CFLAGS="$CFLAGS -Wall -Wextra -Wswitch-enum -Wswitch-default -Wfloat-equal -Wbad-function-cast -Wcast-qual -Wunreachable-code" 147fi 148 149################################################################# 150# Check for some functions 151################################################################# 152 153AC_FUNC_FSEEKO 154AC_CHECK_FUNCS(fseeko, [ CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" ], 155 [ AC_MSG_WARN([fseeko() function is missing: FILE > 2 GB SUPPORT DISABLED!]) ]) 156 157################################################# 158# Check for libraries 159################################################# 160 161#check for -lm 162AC_CHECK_LIB(m, pow, [ haslm="yes" ] , [ AC_MSG_ERROR([libm not found !]) ] ) 163 164#check for -ltld 165AC_CHECK_LIB(ltdl, lt_dlopen, [ hasltdl="yes" ], [ AC_MSG_ERROR([libltdl not found - check libtool installation !]) ] ) 166 167################################################################# 168# helper for windows compilation 169################################################################# 170 171AM_CONDITIONAL(IS_ON_WINDOWS, false) 172 173AC_ARG_ENABLE(win, [AC_HELP_STRING([--enable-win],[ Enable if compiling on windows with mingw. ]) ], 174 [enable_win=$enableval],[enable_win="no"]) 175 176if test "x$enable_win" = xyes;then 177 AM_CONDITIONAL(IS_ON_WINDOWS, true) 178fi 179 180################################################################# 181# Check mp3 plugin libraries 182################################################################# 183 184#check for --disable-mp3 & mad library 185AM_CONDITIONAL(MP3_PLUGIN,false) 186mp3="no" 187AC_ARG_ENABLE(mp3, [AC_HELP_STRING([--disable-mp3],[ Disable mp3 plugin. ]) ], 188 [enable_mp3_plugin=$enableval],[enable_mp3_plugin="yes"]) 189 190if test "x$enable_mp3_plugin" = xyes;then 191 MAD_CHECK([ AM_CONDITIONAL(MP3_PLUGIN,true) mp3="yes" ], 192 [ AC_MSG_WARN([libmad not found ! Will build without mp3 support.]) ]) 193fi 194 195#check for --disable-id3tag & id3tag library 196AM_CONDITIONAL(ID3TAG,false) 197id3="no"; 198AC_ARG_ENABLE(id3tag, [AC_HELP_STRING([--disable-id3tag],[ Disable id3tag support for the mp3 plugin. ]) ], 199 [enable_id3tag=$enableval],[enable_id3tag="yes"]) 200 201if test "x$enable_id3tag" = xyes;then 202 ID3_CHECK([ AM_CONDITIONAL(ID3TAG,true) id3="yes"; ], 203 [ AC_MSG_WARN([libid3tag not found ! Will build without id3 support.]) ]) 204fi 205 206 207################################################################# 208# Check ogg plugin libraries 209################################################################# 210 211#check for --disable-ogg & ogg libraries 212AM_CONDITIONAL(OGG_PLUGIN,false) 213ogg="no" 214AC_ARG_ENABLE(ogg, [AC_HELP_STRING([--disable-ogg],[ Disable Ogg Vorbis plugin. ]) ], 215 [enable_ogg_plugin=$enableval],[enable_ogg_plugin="yes"]) 216 217if test "x$enable_ogg_plugin" = xyes;then 218 XIPH_PATH_OGG(,AC_MSG_WARN([Ogg not found! Download the latest version of libogg at http://www.xiph.org.])) 219 XIPH_PATH_VORBIS(AM_CONDITIONAL(OGG_PLUGIN,true) ogg="yes", 220 AC_MSG_WARN(Vorbis not found! Will build without ogg/vorbis support.)) 221fi 222 223 224################################################################# 225# Check flac plugin libraries 226################################################################# 227 228#check for --disable-flac & flac libraries 229AM_CONDITIONAL(FLAC_PLUGIN,false) 230flac="no" 231AC_ARG_ENABLE(flac, [AC_HELP_STRING([--disable-flac],[ Disable flac plugin. ]) ], 232 [enable_flac_plugin=$enableval],[enable_flac_plugin="yes"]) 233 234if test "x$enable_flac_plugin" = xyes;then 235 PKG_PROG_PKG_CONFIG 236 PKG_CHECK_MODULES([FLAC], [flac >= 1.2.1], 237 [AM_CONDITIONAL(FLAC_PLUGIN, true) flac="yes" ], 238 [AC_MSG_WARN([libFLAC is not found. Will build without flac support.])]) 239fi 240 241################################################################# 242# Check for cutter 243################################################################# 244 245AM_CONDITIONAL(HAS_CUTTER, false) 246 247AC_ARG_ENABLE(cutter, [AC_HELP_STRING([--disable-cutter],[ Disable Cutter unit testing. ]) ], 248 [enable_cutter=$enableval],[enable_cutter="yes"]) 249 250if test "x$enable_cutter" = xyes;then 251 252AC_CHECK_CUTTER 253 254cutter_command="no" 255AC_CHECK_FILE([$CUTTER], [cutter_command="yes"]) 256 257if test "x$CUTTER" != x;then 258 if test "x$cutter_command" = xyes;then 259 AM_CONDITIONAL(HAS_CUTTER, true) 260 fi 261fi 262 263fi 264 265################################################################# 266# Check for pcre - perl compatible regular expressions 267################################################################# 268 269AM_CONDITIONAL(PCRE, false) 270pcre="no" 271AC_ARG_ENABLE(pcre, AC_HELP_STRING([--disable-pcre], [Disable pcre support to set tags from input filename. ]), 272 [enable_pcre=$enableval],[enable_pcre="yes"]) 273 274if test "x$enable_pcre" = xyes;then 275 PKG_PROG_PKG_CONFIG 276 PKG_CHECK_MODULES([PCRE], [libpcre >= 1.0], 277 [AM_CONDITIONAL(PCRE, true) pcre="yes" ], 278 [AC_MSG_ERROR([libpcre is not installed. It is used for setting tags from input filename. 279 280 Install it or configure with "--disable-pcre".])]) 281fi 282 283################################################# 284# Documentation of the code 285# (but only if doxygen is installed) 286################################################# 287 288doxygen_doc="no" 289with_graphviz="no" 290AC_ARG_ENABLE(doxygen_doc, [AC_HELP_STRING([--disable-doxygen_doc],[ Disable doxygen code documentation. ]) ], 291 [enable_doxygen_doc=$enableval],[enable_doxygen_doc="yes"]) 292 293AM_CONDITIONAL(HAVE_DOXYGEN, false) 294AM_CONDITIONAL(HAVE_GRAPHVIZ, false) 295if test "x$enable_doxygen_doc" = xyes;then 296 AC_PATH_PROG([DOXYGEN],[doxygen]) 297 AC_ARG_VAR(DOXYGEN, 298 [Location of the 'doxygen' program; if found we can generate documentation for the C code]) 299 300 if test "x$DOXYGEN" != "x"; then 301 AM_CONDITIONAL(HAVE_DOXYGEN, true) 302 doxygen_doc="yes" 303 304 AC_PATH_PROG([GRAPHVIZ],[dot]) 305 AC_ARG_VAR(GRAPHVIZ, 306 [Location of the 'dot' program from the graphviz suite; if found we can generate caller graphs for the documentation of the C code]) 307 if test "x$GRAPHVIZ" = "x"; then 308 AC_MSG_WARN([*** dot from the graphviz package not found, inheritance diagrams will not be generated in code documentation]) 309 else 310 AM_CONDITIONAL(HAVE_GRAPHVIZ, true) 311 with_graphviz="yes" 312 fi 313 314 fi 315fi 316 317################################################# 318# Print the configuration to the screen 319################################################# 320 321echo 322echo "---------------------------------------------------------" 323echo "Configuration for libmp3splt version "libmp3splt_version" :" 324echo 325echo " install path: $prefix" 326echo 327echo " Plugins :" 328echo 329echo " libmad (mp3 format) $mp3" 330echo " libogg, libvorbis (ogg/vorbis format) $ogg" 331echo " libFLAC (flac format) $flac" 332echo 333echo " Other :" 334echo 335echo " pcre (for setting tags from the input filename) $pcre" 336 337if test "x$mp3" = "xyes"; then 338 echo " libid3tag (for handling id3 tags) $id3" 339 if test "x$id3" = "xno" && test "x$with_id3" = "xyes"; then 340 echo 341 echo " install libid3tag from http://sourceforge.net/projects/id3/" 342 echo " to have this feature supported" 343 fi 344 echo 345fi 346 347echo " doxygen documentation $doxygen_doc" 348echo " with graphviz $with_graphviz" 349echo "---------------------------------------------------------" 350echo 351 352################################################# 353# Generate Makefile 354################################################# 355 356AC_CONFIG_FILES([Makefile 357libmp3splt.pc 358src/Makefile 359po/Makefile.in 360plugins/Makefile 361test/Makefile 362m4/Makefile 363doc/Makefile 364doc/Doxyfile_all 365doc/Doxyfile_api 366doc/examples/Makefile 367include/libmp3splt/version.h]) 368 369AC_OUTPUT 370 371