# Process this file with autoconf to produce a configure script. # # Copyright (c) 1999-2004, Kenneth W. Sodemann (stuffle@mac.com) # # $Id: configure.ac,v 1.71 2005/05/15 19:08:38 stuffle Exp $ # # This program 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. # # This program 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.54) AC_INIT(PRepS, 2.0.4, [stuffle@mac.com]) AC_CONFIG_SRCDIR(src/prepsmain.c) AM_INIT_AUTOMAKE(preps, 2.0.4) AM_CONFIG_HEADER(config.h) # # Disable the use of any deprecated constructs. # Remember to comment this out for now before release. Ideally, this # would all be handled via a switch # AC_ARG_ENABLE(deprecated, AC_HELP_STRING([--disable-deprecated], [Disallow the use of deprecated constructs]), [ac_deprecated="$enableval"], [ac_deprecated=NULL]) if test "x${ac_deprecated}" = "xno"; then AC_DEFINE_UNQUOTED(G_DISABLE_DEPRECATED, 1, [Disable the use of deprecated glib constructs.]) AC_DEFINE_UNQUOTED(GDK_DISABLE_DEPRECATED, 1, [Disable the use of deprecated GDK constructs.]) AC_DEFINE_UNQUOTED(GTK_DISABLE_DEPRECATED, 1, [Disable the use of deprecated GTK constructs.]) AC_DEFINE_UNQUOTED(GNOME_DISABLE_DEPRECATED, 1, [Disable the use of deprecated Gnome constructs.]) fi # # Define some extra arguments... # AC_ARG_WITH(pgconfdir, AC_HELP_STRING([--with-pgconfdir], [Use pg_config installed in pgconfdir]), [ac_pgconf_dir=$withval], [ac_pgconf_dir=NULL]) AC_ARG_WITH(dvipsdir, AC_HELP_STRING([--with-dvipsdir=dvipsdir], [use dvips installed in dvipsdir]), [ac_dvips_dir=$withval], [ac_dvips_dir="/usr/bin /usr/local/bin"]) AC_ARG_WITH(texdir, AC_HELP_STRING([--with-texdir=texdir], [use tex installed in texdir]), [ac_tex_dir=$withval], [ac_tex_dir="/usr/bin /usr/local/bin"]) # # Define the target schema version that this version of PRepS is # designed for. # AC_DEFINE_UNQUOTED(TARGET_SCHEMA, 5, [Define the target schema version for the PRepS build.]) AM_MAINTAINER_MODE # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_AWK AC_PROG_YACC AC_PROG_LIBTOOL AC_PATH_PROG(GCONFTOOL, gconftool-2) # # If we have GTK+ v2.4, we can use some new constructs. Otherwise, # we need to use some older constructs. This should be considered # a sliding thing. That is, when the next version of GTK is out, if # it is v2.6, we will suppoort v24 with the old and v26 with the new. # # Right now: # Old: v2.2 (v2.0 _might_ work, but I don't really care) # New: v2.4 # AM_PATH_GTK_2_0(2.4.0, gtk_version24=yes, gtk_version24=no) if test "x${gtk_version24}" = "xyes"; then AC_DEFINE_UNQUOTED(USE_NEW_GTK, 1, [Use the constructs introduced with the latest gtk]) fi # Check for libraries... pkg_modules="libgnomeui-2.0 gconf-2.0" PKG_CHECK_MODULES(PACKAGE, $pkg_modules) AC_SUBST(PACKAGE_CFLAGS) AC_SUBST(PACKAGE_LIBS) AM_GCONF_SOURCE_2 # Checks for header files. AC_FUNC_ALLOCA AC_HEADER_STDC AM_PROG_CC_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([argz.h fcntl.h inttypes.h langinfo.h libintl.h limits.h locale.h malloc.h stddef.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/param.h syslog.h unistd.h statbuf.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T # Checks for library functions. AC_FUNC_FORK AC_FUNC_MALLOC AC_FUNC_MMAP AC_FUNC_STAT AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify dcgettext getcwd getwd mempcpy munmap nl_langinfo setlocale stpcpy strcasecmp strchr strcspn strdup strstr strtoul strpbrk strrchr]) # Some gettextstuff.... GETTEXT_PACKAGE=PRepS AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext package]) ALL_LINGUAS="" AM_GNU_GETTEXT([external]) if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale", [Define this package's locale directory.]) else AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale", [Define this package's locale directory]) fi # # Check the PostgreSQL setup. # AC_MSG_NOTICE([Checking the PostgreSQL Setup]) if test x$ac_pgconf_dir != xNULL ; then AC_PATH_PROG(PG_CONFIG, pg_config, no, [$ac_pgconf_dir]) else AC_PATH_PROG(PG_CONFIG, pg_config, no) fi if test x$PG_CONFIG != xno ; then pg_incl_dir=`$PG_CONFIG --includedir` pgsql_libdir=`$PG_CONFIG --libdir` PG_CFLAGS="-I$pg_incl_dir" PG_LIBS="-L$pgsql_libdir -lpq" else AC_MSG_ERROR(pg_config not found. May need to use --with-pgconfdir.) fi AC_SUBST(PG_CFLAGS) AC_SUBST(PG_LIBS) # Check for tex and dvips AC_MSG_NOTICE([Determining if printing via TeX should be supported]) AC_MSG_CHECKING([for TeX]) AC_FIND_FILE(tex, $ac_tex_dir, tex_dir) if test -x $tex_dir/tex; then AC_MSG_RESULT(yes) AC_MSG_CHECKING([for dvips]) AC_FIND_FILE(dvips, $ac_dvips_dir, dvips_dir) if test -x $dvips_dir/dvips; then AC_DEFINE(PRINTING_SUPPORTED, 1, [Define if printing is supported.]) AC_DEFINE_UNQUOTED(TEX_PATH, "$tex_dir/tex", [Define where the tex program is.]) AC_DEFINE_UNQUOTED(DVIPS_PATH, "$dvips_dir/dvips", [Define where the dvips program is.]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_MSG_WARN([Printing will not be supported.]) fi else AC_MSG_RESULT(no) AC_MSG_WARN([Printing will not be supported.]) fi # 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 fi # Tell the program where the data will be installed test "x$prefix" = xNONE && prefix=$ac_default_prefix preps_datadir=$(echo $datadir | sed "s%\${prefix}%$prefix%") AC_DEFINE_UNQUOTED(DATA_DIR, "$preps_datadir/preps", [Define where the Pixmaps will be stored.]) AC_DEFINE_UNQUOTED(NUM_BUFFER_LEN, 15, [Define the buffer size for conversions from gint to char string.]) echo $gtk_binary_version AC_CONFIG_FILES([Makefile m4/Makefile po/Makefile.in src/Makefile data/Makefile pixmaps/Makefile help/Makefile help/C/Makefile]) AC_OUTPUT