dnl --------------------------------------------------------------------------- dnl Process this file with autoconf to produce a configure script. dnl $Id$ dnl --------------------------------------------------------------------------- AC_INIT(src/gview.c) GVIEW_VERSION=0.1.15 dnl --------------------------------------------------------------------------- dnl for automake: dnl --------------------------------------------------------------------------- AUTOMAKE_OPTIONS= VERSION=$GVIEW_VERSION PACKAGE=gview dnl --------------------------------------------------------------------------- dnl Initialize automake now dnl --------------------------------------------------------------------------- AM_INIT_AUTOMAKE($PACKAGE, $VERSION) AC_SUBST(GVIEW_VERSION) dnl --------------------------------------------------------------------------- dnl checks for needed compilers dnl --------------------------------------------------------------------------- dnl CFLAGS="" dnl if test x${CFLAGS+set} = xset ; then dnl : dnl else dnl CFLAGS="-O2 -g" dnl fi AC_PROG_CC dnl AC_PROG_CXX dnl AC_PROG_RANLIB dnl --------------------------------------------------------------------------- dnl clean compiles dnl --------------------------------------------------------------------------- compiler_warnings=yes AC_ARG_ENABLE( warnings, [ --disable-warnings turn OFF gcc compiler warnings (not recommended)], [if test $enableval = no; then compiler_warnings=no fi] ) if test x$compiler_warnings = xyes; then CFLAGS="$CFLAGS -Wall" fi dnl --------------------------------------------------------------------------- dnl Generated Previews - slow dnl --------------------------------------------------------------------------- generated_preview=no AC_ARG_ENABLE( preview, [ --enable-preview Use generated previews (slow on most systems)], [if test $enableval = yes; then generated_preview=yes fi] ) if test x$generated_preview = xyes; then AC_DEFINE(USE_GEN_PREVIEW) fi dnl --------------------------------------------------------------------------- dnl now some other stuff dnl AC_CANONICAL_HOST ... needs config.guess dnl --------------------------------------------------------------------------- AM_CONFIG_HEADER(config.h) AM_SANITY_CHECK dnl --------------------------------------------------------------------------- dnl Internationalization dnl --------------------------------------------------------------------------- ALL_LINGUAS="fr ko ja" AM_GNU_GETTEXT dnl --------------------------------------------------------------------------- dnl check for GTK dnl --------------------------------------------------------------------------- AM_PATH_GTK(1.1.9,, AC_MSG_ERROR(Cannot find GTK+: Is gtk-config in executable path?)) dnl --------------------------------------------------------------------------- dnl check for IMLIB dnl --------------------------------------------------------------------------- AM_PATH_GDK_IMLIB(1.4.0, [LIBS="$LIBS $GDK_IMLIB_LIBS" CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"], AC_MSG_ERROR(Cannot find Gdk-Imlib: Is imlib-config in executable path?)) dnl --------------------------------------------------------------------------- dnl checks for correctly defined types dnl --------------------------------------------------------------------------- AC_TYPE_SIZE_T dnl --------------------------------------------------------------------------- dnl checks for header files & functions dnl --------------------------------------------------------------------------- AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(string.h unistd.h) AC_CHECK_LIB(sgc, sg_registry_init, [LIBS="$LIBS -lsgc" AC_DEFINE(HAVE_SGC)],,$LIBS) dnl --------------------------------------------------------------------------- dnl Checks for library functions dnl --------------------------------------------------------------------------- AC_FUNC_STRFTIME AC_CHECK_FUNCS(strstr) dnl --------------------------------------------------------------------------- dnl Check for IPC support dnl --------------------------------------------------------------------------- AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes) AC_CHECK_HEADER(sys/msg.h, AC_DEFINE(HAVE_MSG_H), no_sys_msg=yes) if test "x$no_sys_ipc" != "xyes" && test "x$no_sys_msg" != "xyes" ; then AC_DEFINE(HAVE_MSG) fi if test "$ac_cv_header_sys_msg_h" = yes; then AC_MSG_CHECKING(whether IPC messages work) AC_TRY_RUN([ #include #include #include #include int main() { int id, res; struct msgbuf buff; id = msgget(IPC_PRIVATE, IPC_CREAT); if (id == -1) exit(2); buff.mtype=2; res = msgsnd(id, &buff, 1, 0); if (res == -1) exit(1); res = msgctl(id, IPC_RMID, NULL); if (res == -1) exit(1); else exit(0); } ], AC_DEFINE(HAVE_WORKING_MSG) AC_MSG_RESULT(yes), AC_MSG_RESULT(no), AC_MSG_RESULT(no)) fi dnl --------------------------------------------------------------------------- dnl Check for curl and sets variable dnl --------------------------------------------------------------------------- AC_PATH_PROG(CURL, curl) if test x$CURL != x; then AC_DEFINE_UNQUOTED(CURL_EXEC, "$CURL") fi dnl --------------------------------------------------------------------------- dnl Check for wget and sets variable dnl --------------------------------------------------------------------------- AC_PATH_PROG(WGET, wget) if test x$WGET != x; then AC_DEFINE_UNQUOTED(WGET_EXEC, "$WGET") fi dnl --------------------------------------------------------------------------- dnl Checks if got both curl and wget and chooses curl as primary. dnl --------------------------------------------------------------------------- if test x$CURL != x && test x$WGET != x; then AC_DEFINE(HAVE_CURL) AC_DEFINE(HAVE_NET) else if test x$CURL != x; then AC_DEFINE(HAVE_CURL) AC_DEFINE(HAVE_NET) fi if test x$WGET != x; then AC_DEFINE(HAVE_WGET) AC_DEFINE(HAVE_NET) fi fi dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- dnl Makefiles to create: dnl --------------------------------------------------------------------------- AC_OUTPUT([ intl/Makefile po/Makefile.in src/Makefile src/icons/Makefile Makefile ],[ sed -e "/POTFILES = /r po/POTFILES" po/Makefile.in > po/Makefile ])