dnl Process this file with autoconf to produce a configure script. dnl You may need the --localdir option to get the included .m4's dnl dnl Maketool - GTK-based front end for gmake dnl Copyright (c) 1999-2003 Greg Banks dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl dnl $Id: configure.in,v 1.68 2003/11/16 05:17:30 gnb Exp $ dnl AC_INIT(main.c) AC_CONFIG_HEADER(config.h) PACKAGE=maketool VERSION=0.8.4 AC_CANONICAL_HOST dnl Checks for programs. AC_PROG_INSTALL AC_PROG_AWK AC_PROG_CC AC_ISC_POSIX AC_CHECK_PROGS(RPMBUILD,rpmbuild rpm) dnl Get name of GNU make AC_ARG_WITH(gmake, [ --with-gmake=CMD Set the GNU make command (may include full pathname and flags)], [case "$withval" in no) AC_MSG_ERROR(Maketool requires gmake) ;; yes) AC_MSG_ERROR(Please specify a gmake command or let configure figure it out) ;; *) GMAKE="$withval" ;; esac]) if test -z "$GMAKE"; then AC_CHECK_PROGS(GMAKE, gmake make, make) fi dnl Add filters for MWOS cross-compiler. This dnl defaults to off 'cos it's fairly unusual. AC_MSG_CHECKING([whether MWOS cross-compiler support is requested]) AC_ARG_ENABLE(mwos, [ --enable-mwos Enable filters for MWOS cross-compiler], ENABLE_FILTER_MWOS=$enableval,ENABLE_FILTER_MWOS=no) AC_MSG_RESULT($ENABLE_FILTER_MWOS) if test "$ENABLE_FILTER_MWOS" = "yes"; then AC_DEFINE(ENABLE_FILTER_MWOS,1,[ * Whether to define filters to detect errors & warnings * generated by MWOS cross-compiler. ]) fi dnl Test for printer configuration. dnl File /etc/printcap (in BSD-derived systems) PRINTCAP=/etc/printcap AC_MSG_CHECKING(for presence of $PRINTCAP) if test -f $PRINTCAP ; then AC_DEFINE(HAVE_ETC_PRINTCAP,1,[ * Whether to look in the file /etc/printcap for * a list of printers (BSD-derived systems). ]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi dnl Program lpstat (SysV-derived systems) AC_PATH_PROG(LPSTAT_COMMAND, lpstat) if test "$LPSTAT_COMMAND" ; then AC_DEFINE_UNQUOTED(LPSTAT_COMMAND, "$LPSTAT_COMMAND", [Full pathname to the lpstat program if it exists.]) AC_DEFINE(HAVE_LPSTAT,1,[ * Whether to run the command lpstat -c for * a list of printers (SysV-derived systems) ]) fi dnl Stuff for gettext ALL_LINGUAS="ja cs" AM_GNU_GETTEXT dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(malloc.h sys/ioctl.h sys/time.h unistd.h memory.h signal.h sys/filio.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_PID_T dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_TYPE_SIGNAL AC_FUNC_WAIT3 AC_CHECK_FUNCS(putenv regcomp strchr unsetenv killpg) AC_SIGNAL_SEMANTICS dnl =============================== dnl Maketool has specific support for some OS-specific dnl make programs and makefile systems. Check to see dnl whether to enable any of them. AC_MSG_CHECKING(which OS-specific source to enable) OS_MAKEPROG_SOURCE= OS_MAKESYS_SOURCE= case "$host_os" in solaris*) OS_MAKEPROG_SOURCE="sunmake.c" AC_DEFINE(HAVE_SUN_MAKE,1,[Support for the Sun make program.]) AC_DEFINE(ENABLE_FILTER_SUN,1,[ * Whether to define filters to detect errors & warnings * generated by the Solaris compilers ]) ;; hpux*) AC_DEFINE(ENABLE_FILTER_HPUX,1,[ * Whether to define filters to detect errors & warnings * generated by the HP-UX compilers. ]) ;; irix*) OS_MAKESYS_SOURCE="irix-makesys.c" AC_DEFINE(HAVE_IRIX_SMAKE,1,[Support for the IRIX smake make program.]) AC_DEFINE(HAVE_MAKESYS_IRIX,1,[Support for the IRIX internal makefile system.]) AC_DEFINE(ENABLE_FILTER_MIPSPRO,1,[ * Whether to define filters to detect errors & warnings * generated by the MIPSpro compilers (on IRIX). ]) ;; esac ALL_OS_SOURCE= ALL_OS_SOURCE="$ALL_OS_SOURCE sunmake.c" ALL_OS_SOURCE="$ALL_OS_SOURCE irix-makesys.c" AC_SUBST(OS_MAKEPROG_SOURCE) AC_SUBST(OS_MAKESYS_SOURCE) AC_SUBST(ALL_OS_SOURCE) AC_MSG_RESULT($OS_MAKEPROG_SOURCE $OS_MAKESYS_SOURCE) dnl =============================== dnl Test for system make programs which need to be wrapped to dnl provide gmake-style directory enter/leave messages. AC_MSG_CHECKING(for non-GNU make programs) _TD=/tmp/ac-maketool-$$ /bin/rm -rf $_TD mkdir $_TD NON_GNU_MAKES= for dir in /bin /sbin /usr/bin /usr/sbin /usr/ccs/bin ; do for exe in make pmake smake ; do test -x $dir/$exe || continue (cd $_TD ; $dir/$exe --version 2>&1) | grep 'GNU Make' > /dev/null \ || NON_GNU_MAKES="$NON_GNU_MAKES $dir/$exe" done done /bin/rm -rf $_TD AC_SUBST(NON_GNU_MAKES) AC_MSG_RESULT($NON_GNU_MAKES) dnl =============================== dnl Use the latest version of gtk which actually is complete and works. dnl Should result in: gtk 1.2 on RedHat 7.3, gtk 2 on RedHat 8 & greater. PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.0.3, [gtk2=yes],[gtk2=no]) if test $gtk2 = yes ; then # Need GTK_ENABLE_BROKEN to get GtkText at least until this # code is ported to GtkTextView. GTK_CFLAGS="$GTK_CFLAGS -DGTK_ENABLE_BROKEN" GTK2=1 GTK_LIBSRC="gtk2" else # fall back to gtk 1.2 AC_MSG_WARN([GNOME version 2 libraries not found, falling back to 1.2]) AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(maketool requires the GTK+ library)) GTK2=0 GTK_LIBSRC="gtk1.2" fi if test x"$GTK_LIBSRC" != x ; then GTK_CFLAGS="-I\${top_srcdir}/lib/\${GTK_LIBSRC} $GTK_CFLAGS" GTK_LIBS="\${top_srcdir}/lib/\${GTK_LIBSRC}/gtk/gtkctree.o $GTK_LIBS" fi AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) AC_SUBST(GTK_LIBSRC) AC_DEFINE_UNQUOTED(GTK2,$GTK2,[ * defined to 1 if version 2 of the GTK toolkit is used ]) dnl =============================== dnl A bunch of warning options for gcc. Note that we add dnl warning flags *after* using $CC to test for most features, dnl to avoid spurious failures due to a pedantic compiler. AC_GCC_ADD_CFLAGS([-Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arithmetic -Wsign-compare -pedantic]) dnl Remove -Werror if present. It makes life difficult when compiling dnl real source, but is useful when testing autoconf feature probing. AC_GCC_REMOVE_CFLAGS([-Werror]) dnl =============================== AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [The i18n package. Used to find .mo files at runtime.]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of maketool.]) AC_DEFINE_UNQUOTED(GMAKE, "$GMAKE",[ * Executable name for GNU make. Can be a full pathname * or a basename to be looked up in \$PATH at runtime. * May contain flags, e.g. /some/dir/make -x -y -z * * BTW if anyone tries to use maketool with the ClearCase * make in GNU-make emulation mode, I'd be interested to * hear how you fared - Greg. ]) AC_SUBST(ALL_LINGUAS) AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_OUTPUT( Makefile maketool.spec version.m4 intl/Makefile po/Makefile.in makesys/Makefile icons/Makefile lib/Makefile lib/gtk1.2/Makefile lib/gtk1.2/gtk/Makefile lib/gtk2/Makefile lib/gtk2/gtk/Makefile doc/Makefile doc/help/Makefile doc/help/common/help.mk doc/help/common/Makefile)