# Process this file with autoconf to produce a configure script. # # Copyright (c) 2000-2005, Kenneth W. Sodemann (stuffle@mac.com) # # $Id: configure.ac,v 1.35 2005/01/30 02:11:26 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( PRepSTools, 2.0.2, [stuffle@mac.com] ) AC_CONFIG_SRCDIR([preps/sendmsg.c]) AM_INIT_AUTOMAKE(prepstools, 2.0.2) AM_CONFIG_HEADER(config.h) # # Disable the use of any deprecated constructs. # 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 the target schema version that this version of PRepS is # designed for. # TARGET_SCHEMA=5 AC_DEFINE_UNQUOTED(TARGET_SCHEMA, $TARGET_SCHEMA, [Define the target schema version for the PRepS build.]) AC_SUBST(TARGET_SCHEMA) # # Define the extra options that we will offer... # AC_ARG_WITH(pgconfdir, [ --with-pgconfdir=pgconfdir Use pg_config installed in pgconfdir ], [ ac_pgconf_dir=$withval ], ac_pgconf_dir=NULL ) AC_ARG_WITH(sendmail, [ --with-sendmail=program use program instead of sendmail ], [ ac_sendmail=$withval ], ac_sendmail="sendmail" ) AC_ARG_WITH(sendmaildir, [ --with-sendmaildir=dir use sendmail installed in dir ], [ ac_sendmail_dir=$withval ], ac_sendmail_dir="/usr/sbin /sbin /usr/local/sbin" ) 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 # # 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 # Checks for libraries. pkg_modules="libgnomeui-2.0" PKG_CHECK_MODULES(PACKAGE, $pkg_modules) AC_SUBST(PACKAGE_CFLAGS) AC_SUBST(PACKAGE_LIBS) # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([statbuf.h stdlib.h string.h syslog.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T # Checks for library functions. AC_FUNC_FORK AC_FUNC_MALLOC AC_CHECK_FUNCS([strdup]) # Some gettextstuff.... GETTEXT_PACKAGE=PRepSTools 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 if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(PREPS_LIB_PATH, "${ac_default_prefix}/lib/libpreps.so", [Define the path to the libpreps library.]) else AC_DEFINE_UNQUOTED(PREPS_LIB_PATH, "${prefix}/lib/libpreps.so", [Define the path to the libpreps library.]) 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` pg_serv_incl_dir=`$PG_CONFIG --includedir-server` pgsql_libdir=`$PG_CONFIG --libdir` plpgsql_dir=`$PG_CONFIG --pkglibdir` PG_CFLAGS="-I$pg_incl_dir -I$pg_serv_incl_dir" PG_LIBS="-L$pgsql_libdir -lpq" AC_DEFINE_UNQUOTED(PLPGSQL_LIB_PATH, "${plpgsql_dir}/plpgsql.so", [Define the path to the PL/pgSQL library.]) pgheader_file="$pg_serv_incl_dir/postgres.h" AC_CHECK_FILE($pgheader_file, pgheaderfound=yes, pqheaderfound=no) if test "x$pqheaderfound" == xno; then AC_MSG_ERROR([postgres.h not found. Check PostgreSQL installation, make sure make install-all-headers was performed.]) fi else AC_MSG_ERROR(pg_config not found. May need to use --with-pgconfdir.) fi AC_SUBST(PG_CFLAGS) AC_SUBST(PG_LIBS) AC_MSG_CHECKING([for sendmail]) AC_FIND_FILE($ac_sendmail, $ac_sendmail_dir, sendmail_dir) if test -x $sendmail_dir/$ac_sendmail; then AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$sendmail_dir/$ac_sendmail", [Define where the sendmail program is.]) AC_MSG_RESULT([using $sendmail_dir/$ac_sendmail]) else AC_MSG_RESULT(no) AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "/sbin/sendmail", [Define where the sendmail program is.]) AC_MSG_WARN([sendmail program not found, notification feature may not work]) 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 AC_DEFINE_UNQUOTED(NUM_BUFFER_LEN, 15, [Define the buffer size for conversions from gint to char string.]) # Tell the library where the data files will be installed # but we need to be sure $prefix is defined first test "x$prefix" = xNONE && prefix=$ac_default_prefix preps_datadir=$(echo $datadir | sed "s%\${prefix}%$prefix%") AC_DEFINE_UNQUOTED(DATA_DIR, "$preps_datadir/prepstools", [Define where the support files will be stored.]) AC_CONFIG_FILES([Makefile po/Makefile.in m4/Makefile preps/Makefile data/Makefile]) AC_OUTPUT