dnl Process this file with autoconf to produce a configure script. # Require autoconf 2.55 or higher AC_PREREQ(2.55) AC_INIT(configure.in) AM_INIT_AUTOMAKE(gtkpod, 1.0.0) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_CANONICAL_HOST AC_ISC_POSIX AC_PROG_CC AM_PROG_CC_STDC IT_PROG_INTLTOOL([0.33]) dnl Only use -Wall if we have gcc if test "x$GCC" = "xyes"; then if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then CFLAGS="$CFLAGS -Wall" fi # gcc < 4.0 does not know '-Wno-pointer-sign'. Try to find out # whether we can set this option or not. CFLAGS_orig=$CFLAGS CFLAGS="$CFLAGS -Wno-pointer-sign" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]])], [], [CFLAGS=$CFLAGS_orig]) fi GETTEXT_PACKAGE=gtkpod AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",["Gettext package name"]) dnl check if pkg-config exists -- if not print a meaningful error message AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) if test -z "$PKG_CONFIG"; then AC_MSG_FAILURE([*** pkg-config required (http://www.freedesktop.org/software/pkgconfig)]) else ac_cv_env_PKG_CONFIG_set=set fi dnl check for required libs that are managed with pkg-config PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8.0,, [AC_MSG_FAILURE([*** $GTK_PKG_ERRORS])]) PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.15.0,, [AC_MSG_FAILURE([*** $GLIB_PKG_ERRORS])]) PKG_CHECK_MODULES(GMODULE, gmodule-2.0,, [AC_MSG_FAILURE([*** $GMODULE_PKG_ERRORS])]) PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 0.14.0,, [AC_MSG_FAILURE([*** $GTHREAD_PKG_ERRORS])]) PKG_CHECK_MODULES(LIBGLADE, libglade-2.0 >= 2.4.0,, [AC_MSG_FAILURE([*** $LIBGLADE_PKG_ERRORS])]) PKG_CHECK_MODULES(LIBGPOD, libgpod-1.0 >= 0.7.0,, [AC_MSG_FAILURE([*** $LIBGPOD_PKG_ERRORS])]) CFLAGS="$CFLAGS $GTK_CFLAGS $GLIB_CFLAGS $GMODULE_CFLAGS $GTHREAD_CFLAGS $LIBGLADE_CFLAGS $LIBGPOD_CFLAGS" LIBS="$LIBS $GTK_LIBS $GLIB_LIBS $GMODULE_LIBS $GTHREAD_LIBS $LIBGLADE_LIBS $LIBGPOD_LIBS" dnl we need 'flex' AM_PROG_LEX case "$LEX" in flex|*/flex|lex|*/lex) ;; *) AC_MSG_FAILURE([*** flex or lex required]) ;; esac dnl Retrieve the path of mount and umount binaries AC_PATH_PROG(MOUNT, mount) AC_SUBST(MOUNT) AC_PATH_PROG(UMOUNT, umount) AC_SUBST(UMOUNT) dnl Add the languages which your application supports here. ALL_LINGUAS="ca de es fr he it ja ru ro sv zh_CN" AM_GLIB_GNU_GETTEXT dnl Check if we have to supply getopt_long dnl If getopt_long_only is not available, getopt.c and getopt1.c dnl (providing getopt_long*) will be included into the binary. AC_CHECK_FUNCS(getopt_long_only, , [AC_LIBOBJ(getopt)]) AC_CHECK_FUNCS(getopt_long_only, , [AC_LIBOBJ(getopt1)]) dnl Check if flock() is available (seems to be missing on some solaris versions) AC_CHECK_FUNCS(flock) dnl Check if statvfs() is available (otherwise we fall back on 'df' to determine dnl free space on the iPod AC_CHECK_FUNCS(statvfs) dnl Check for libid3tag AC_SEARCH_LIBS([id3_frame_field], ["id3tag" "id3tag -lz"],, AC_MSG_ERROR([*** id3tag >= 0.15 lib not found (0.14 will not work!)])) dnl Check for libcurl AC_ARG_WITH(curl, AC_HELP_STRING([--without-curl], [Disable coverart download support])) if test "x$with_curl" != "xno"; then PKG_CHECK_MODULES(CURL, [libcurl >= 7.10.0], have_curl=yes, have_curl=no) if test "x$with_curl" = "xyes" -a "x$have_curl" = "xno"; then AC_MSG_ERROR([curl support explicitly requested but curl couldn't be found]) fi fi AM_CONDITIONAL(HAVE_CURL, test "x$have_curl" = "xyes") if test "x$have_curl" = "xyes"; then AC_DEFINE(HAVE_CURL, 1, [Define if you have curl support]) have_curl="yes -- will build with coverart download support" CPPFLAGS="$CPPFLAGS $CURL_CFLAGS" CFLAGS="$CFLAGS $CURL_CFLAGS" LIBS="$LIBS $CURL_LIBS" else have_curl="*no -- will build without coverart download support" fi dnl Check for gio AC_ARG_WITH(gio, AC_HELP_STRING([--without-gio],[Disable autodetection support])) if test "x$with_gio" != "xno"; then PKG_CHECK_MODULES(GIO, [gio-2.0 >= 2.15.0], have_gio=yes, have_gio=no) if test "x$with_gio" = "xyes" -a "x$have_gio" = "xno"; then AC_MSG_ERROR([gio support explicitly requested but gio could not be found]) fi fi AM_CONDITIONAL(HAVE_GIO, test "x$have_gio" = "xyes") if test "x$have_gio" = "xyes"; then have_gio="yes -- will build with automount support" AC_DEFINE(HAVE_GIO, 1, [Define if you have gio support]) CPPFLAGS="$CPPFLAGS $GIO_CFLAGS" CFLAGS="$CFLAGS $GIO_CFLAGS" LIBS="$LIBS $GIO_LIBS" else have_gio="*no -- will build without iPod autodetection support" fi dnl Check for libvorbisfile and libvorbis AC_ARG_WITH(ogg, AC_HELP_STRING([--without-ogg], [Disable Ogg/Vorbis support])) if test "x$with_ogg" != "xno"; then AC_SEARCH_LIBS(ov_open, ["vorbisfile"], [AC_CHECK_HEADER(vorbis/vorbisfile.h, have_ogg=yes, have_ogg_header=no)], have_ogg=no) if test "x$have_ogg_header" = "xno"; then have_ogg="no" AC_MSG_WARN([vorbis/vorbisfile.h cannot be found or is unusable. Check your ogg/vorbis installation.]) fi if test "x$have_ogg" = "xyes"; then AC_SEARCH_LIBS(vorbis_comment_query, ["vorbis"], [AC_CHECK_HEADER(vorbis/codec.h, have_ogg=yes, have_ogg_header=no)], have_ogg=no) if test "x$have_ogg_header" = "xno"; then have_ogg="no" AC_MSG_WARN([vorbis/codec.h cannot be found or is unusable. Check your ogg/vorbis installation.]) fi fi if test "x$with_ogg" = "xyes" -a "x$have_ogg" = "xno"; then AC_MSG_ERROR([Ogg/Vorbis support explicitly requested but ogg/vorbis libs couldn't be found]) fi fi AM_CONDITIONAL(HAVE_LIBVORBISFILE, test "x$have_ogg" = "xyes") if test "x$have_ogg" = "xyes"; then have_ogg="yes -- will build with ogg support" AC_DEFINE(HAVE_LIBVORBISFILE, 1, [Define if you have the ogg/vorbis library]) else have_ogg="*no -- will build without ogg support" fi dnl Check for FLAC AC_ARG_WITH(flac, AC_HELP_STRING([--without-flac], [Disable FLAC support])) if test "x$with_flac" != "xno"; then AC_SEARCH_LIBS(FLAC__metadata_get_streaminfo, ["FLAC"], [AC_CHECK_HEADER(FLAC/metadata.h, have_flac=yes, have_flac_header=no)], have_flac=no) if test "x$have_flac_header" = "xno"; then have_flac="no" AC_MSG_WARN([FLAC/metadata.h cannot be found or is unusable. Check your FLACinstallation.]) fi if test "xwith_flac" = "xyes" -a "x$have_flac" = "xno"; then AC_MSG_ERROR([FLAC support explicitly requested but flac libs couldn't be found]) fi fi AM_CONDITIONAL(HAVE_FLAC, test "x$have_flac" = "xyes") if test "x$have_flac" = "xyes"; then have_flac="yes -- will build with FLAC support" AC_DEFINE(HAVE_FLAC, 1, [Define if you have the flac library]) else have_flac="*no -- will build without FLAC support" fi dnl Additional libs maybe needed when compiling under solaris AC_SEARCH_LIBS(bind, ["socket" "nsl" "socket -lnsl"]) dnl Check for Linux-specific headers (so we can compile Linux-specific dnl stuff only when compiling under Linux) AC_CHECK_HEADERS(linux/cdrom.h scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h) libgpod_version=`$PKG_CONFIG libgpod-1.0 --modversion` AC_DEFINE_UNQUOTED(LIBGPOD_VERSION, "${libgpod_version}", [Set this to the libgpod version]) AC_CHECK_HEADERS([mp4v2/platform.h]) AC_CHECK_HEADERS([mp4v2/itmf_tags.h], [], [], [#ifdef HAVE_MP4V2_PLATFORM_H # include #endif typedef void* MP4FileHandle; ]) AC_CHECK_HEADERS([endian.h]) AC_OUTPUT([ Makefile src/Makefile po/Makefile.in scripts/Makefile data/Makefile data/icons/Makefile data/icons/16x16/Makefile data/icons/22x22/Makefile data/icons/24x24/Makefile data/icons/32x32/Makefile data/icons/48x48/Makefile data/icons/64x64/Makefile data/icons/scalable/Makefile data/icons/hicolor/Makefile data/icons/hicolor/16x16/Makefile data/icons/hicolor/16x16/places/Makefile data/icons/hicolor/16x16/status/Makefile data/icons/hicolor/22x22/Makefile data/icons/hicolor/22x22/places/Makefile data/icons/hicolor/24x24/Makefile data/icons/hicolor/24x24/places/Makefile data/icons/hicolor/32x32/Makefile data/icons/hicolor/32x32/places/Makefile data/icons/hicolor/48x48/Makefile data/icons/hicolor/48x48/places/Makefile data/icons/hicolor/scalable/Makefile data/icons/hicolor/scalable/places/Makefile data/man/Makefile data/man/gtkpod.1 doc/Makefile doc/figures/Makefile ]) echo " Configuration for $PACKAGE $VERSION : -------------------------------- Host System Type .....: $host Install path .........: $prefix GTK2 version .........: `$PKG_CONFIG gtk+-2.0 --modversion` GLib2/GThread version : `$PKG_CONFIG gthread-2.0 --modversion` gio ..................: $have_gio libgpod version ......: $libgpod_version libcurl ..............: $have_curl vorbisfile ...........: $have_ogg FLAC .................: $have_flac Preprocessor .........: $CC $CPPFLAGS Compiler .............: $CC $CFLAGS Linker ...............: $CC $LDFLAGS $LIBS Now type 'make' to build $PACKAGE $VERSION, and then 'make install' for installation. "