dnl Process this file with autoconf to produce a configure script. AC_INIT(configure.in) AC_PREREQ(2.52) AM_INIT_AUTOMAKE(ogle_gui, 0.9.2) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE dnl Check that ogle is installed in the prefix, this is needed if test "x${exec_prefix}" = "xNONE"; then if test "x${prefix}" = "xNONE"; then ogle_pkglibdir=${ac_default_prefix}/lib/ogle else ogle_pkglibdir=${prefix}/lib/ogle fi else ogle_pkglibdir=${exec_prefix}/lib/ogle fi AC_MSG_CHECKING(for ogle helper dir) if test ! -x ${ogle_pkglibdir}/ogle_ctrl; then AC_MSG_RESULT(no) AC_MSG_ERROR([* You must install ogle and ogle_gui in the same prefix]) fi AC_MSG_RESULT(yes) AC_PROG_CC AC_ISC_POSIX AM_PROG_CC_STDC AC_HEADER_STDC AC_CHECK_HEADERS(sys/param.h) AM_PROG_LIBTOOL dnl Add the languages which your application supports here. ALL_LINGUAS="da de fr nl pt sv" AM_GNU_GETTEXT([use-libtool]) AC_ARG_ENABLE(gtk2, AC_HELP_STRING([--enable-gtk2], [use gtk2 for the GUI, instead of gtk1]), dnl actions for gtk2 [ PKG_CHECK_MODULES(GTK, gtk+-2.0) PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.4.19) PKG_CHECK_MODULES(LIBGLADE, libglade-2.0) ], dnl actions for gtk1 [ AM_PATH_GTK(,,[AC_MSG_ERROR([You must have gtk+ development files])]) AM_PATH_LIBGLADE(,[AC_MSG_ERROR([You must have libglade development files])]) dnl Hack to get the path to the libglade so-file LIBGLADE_PREFIX=`$LIBGLADE_CONFIG --prefix` AC_DEFINE_UNQUOTED(LIBGLADE_LIBDIR, "${LIBGLADE_PREFIX}/lib", [Prefix for libglade]) dnl this should be something different for some bsd (libglade.so.4 i dnl think), but I don't know how to check for it properly case "$host_os" in hpux*) AC_DEFINE_UNQUOTED(LIBGLADE_LIB, "libglade.sl.0", [Name of the libglade lib (for dlopen)]) ;; *) AC_DEFINE_UNQUOTED(LIBGLADE_LIB, "libglade.so.0", [Name of the libglade lib (for dlopen)]) ;; esac AM_PATH_XML2(2.4.19, AC_DEFINE(HAVE_XML, 1, [libxml found]), [ AC_MSG_ERROR([Install libxml2(-dev) and/or specify it's location]) ]) ]) dvd_path="" AC_ARG_WITH(dvdcontrol, AC_HELP_STRING([--with-dvdcontrol=DIR], [Specify the install prefix to libdvdcontrol ]), if test x$withval = xno; then [AC_MSG_ERROR([* You must use libdvdcontrol, it's a part of Ogle])] fi if test x$withval != xyes; then dvd_path=$withval fi) if test -z "$dvd_path"; then dnl We have nothing better to go on, guess that it's installed in prefix if test "x$prefix" != xNONE; then dvd_path=$prefix else dvd_path=$ac_default_prefix fi fi AC_CHECK_LIB(dvdcontrol, DVDRequestInput, [ DVDLIBS="-L$dvd_path/lib/ogle -rpath $dvd_path/lib/ogle -ldvdcontrol" DVD_INCLUDEDIR=-I$dvd_path/include ], [ AC_MSG_ERROR([ * Need "libdvdcontrol.so", it's part of Ogle(-devel). * Install it and/or specify the location for it using --with-dvdcontrol=DIR. * For example ... --with-dvdcontrol=/usr/local ] ) ], -L$dvd_path/lib/ogle -lmsgevents) AC_SUBST(DVDLIBS) AC_ARG_WITH(dvd-includes, AC_HELP_STRING([--with-dvd-includes=DIR], [Specify location of DVD headers ]), DVD_INCLUDEDIR=-I$with_dvd_includes) dnl if test x"$DVD_INCLUDEDIR" = x"-I/usr/local/include"; then dnl DVD_INCLUDEDIR="" dnl fi if test x"$DVD_INCLUDEDIR" = x"-I/usr/include"; then DVD_INCLUDEDIR="" fi saved_CPPFLAGS=$CPPFLAGS dnl -w added to shutup GCC3.1's cpp warning about -I/usr/local CPPFLAGS="-w $CPPFLAGS $DVD_INCLUDEDIR" AC_CHECK_HEADER(ogle/dvd.h, , [ AC_MSG_ERROR([ * Need "ogle/dvd.h", it's part of Ogle(-devel). * Install it and/or specify the location for it using --with-dvd-includes=DIR. * For example ... --with-dvd-includes=/usr/local/include ] ) ] ) CPPFLAGS=$saved_CPPFLAGS AC_SUBST(DVD_INCLUDEDIR) dnl check for pthreads AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread", [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads", [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r", [AC_CHECK_FUNC(pthread_create)] )] )] ) AC_SUBST(PTHREAD_LIB) dnl Architecture specific stuff dnl AC_CANONICAL_HOST case "$host_os" in solaris*) AC_DEFINE(SOLARIS, 1, [This is a Solaris system]) ;; linux*) AC_DEFINE(LINUX, 1, [This is a Linux system]) ;; hpux*) AC_DEFINE(HPUX, 1, [This is a HPUX system]) ;; *) ;; esac dnl --------------------------------------------------------- dnl end config file dnl --------------------------------------------------------- dnl enable warnings CFLAGS="$CFLAGS -Wall" AC_OUTPUT([ Makefile pixmaps/Makefile src/Makefile intl/Makefile po/Makefile.in ])