File configure.ac of Package arachne

#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

#Copyright (C) 2007, 2008 Hayden Walles
#
#This file is part of Arachne.
#
#Arachne is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
# Arachne is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

AC_PREREQ(2.59)
#Add a bug report address to the end of this next line.
AC_INIT([Arachne], [1.1.0]) 
AM_INIT_AUTOMAKE

AC_CONFIG_SRCDIR([arachne.c])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile])

AC_CONFIG_SUBDIRS([seamstress])


#User
AC_CANONICAL_BUILD 
AC_CANONICAL_HOST

#This determines if the output will be running under windows and sets some things appropriately.
case $host in
  *-*-mingw32* | *-*-cygwin* | *-*-windows*)
  withgtk=false
  withwin=true
    ;;
  *)
  withwin=false
  withgtk=true
    ;;
esac

#This should probably be altered to reflect being under windows (or not)
AC_ARG_WITH(gtk,
     [  --without-gtk    Don't use GTK+ as the graphical user interface.],
     [case "${withval}" in
       yes) withgtk=true ;;
       no)  withgtk=false ;;
       *) AC_MSG_ERROR(bad value ${withval} for --with-gtk) ;;
     esac],[])

AC_ARG_WITH(windows,
     [  --without-windows    Don't use Windows as the graphical user interface.],
     [case "${withval}" in
      #We've already 'tested' for the presence of windows, we can't enable it if it isn't here.
       no)  withwin=false ;;
       *) AC_MSG_ERROR(bad value ${withval} for --with-windows) ;;
     esac],[])

# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL


# Checks for libraries.
AC_CHECK_LIB([tiff], [TIFFOpen],[],[AC_MSG_ERROR([cannot build without libtiff.])])
#There are two attempts at this, because in principle libjpeg can export it's function names in two different forms.
AC_CHECK_LIB([jpeg], [jpeg_start_decompress],[],[AC_CHECK_LIB([jpeg], [jStrtCompress],[],[AC_MSG_ERROR([cannot build without libjpeg.])]) ]) 

if test "$withgtk" = true; then
   AC_MSG_NOTICE([checking if GTK+ is available.])
   AM_PATH_GTK_2_0([2.6.0], [],[withgtk=false])
   AM_PATH_GDK_PIXBUF([0.22.0],[],[withgtk=false])
fi

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

# Checks for library functions.

AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([strchr strdup strrchr strtol])

#Tidy up.


AM_CONDITIONAL([USE_GRAPHICS], [test x$withgtk = xtrue -o x$withwin = xtrue ])
AM_CONDITIONAL([USE_WINDOWS], [test x$withwin = xtrue])

if test x$withgtk = xtrue ; then
   usegtk=1
else	
   usegtk=0
fi		

if test x$withwin = xtrue ; then
   usewin=1
else	
   usewin=0
fi

AC_DEFINE_UNQUOTED(USE_GTK,$usegtk,[Define to 1 if you're using GTK+])
AC_DEFINE_UNQUOTED(USE_WINDOWS,$usewin,[Define to 1 if you're using Windows])


AC_OUTPUT



if test "$withgtk" != true -a "$withwin" != true ; then
   AC_WARN([without GTK+ or Windows only the command line tools will be built.])
fi
openSUSE Build Service is sponsored by