Codebase list gerbv / debian/1.0.1-2 configure.in
debian/1.0.1-2

Tree @debian/1.0.1-2 (Download .tar.gz)

configure.in @debian/1.0.1-2raw · history · blame

dnl configuration script for gerbv
dnl
dnl  gEDA - GNU Electronic Design Automation
dnl  This file is part of gerbv.
dnl
dnl    Copyright (C) 2000-2001 Stefan Petersen (spe@stacken.kth.se)
dnl
dnl  $Id: configure.in,v 1.39.2.3 2005/02/22 20:58:36 spetm Exp $
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 USA


AC_INIT(src/gerbv.c)

dnl variables
PACKAGE=gerbv
VERSION=1.0.1
PKG_CONFIG=pkg-config

dnl --enable-exportpng
AC_ARG_ENABLE(exportpng,
    [  --disable-exportpng     Disable PNG export.],
    [
        if test $enableval = "yes"; then
		exportpng=yes
	  	AC_DEFINE(EXPORT_PNG,,[Support for export of PNG's])
	fi
    ],
    [
	exportpng=yes
  	AC_DEFINE(EXPORT_PNG,,[Support for export of PNG's])
    ])

dnl --with-maxfiles : sets maximum number of simultaneous loaded files
AC_ARG_WITH(maxfiles,
    [  --with-maxfiles         Maximum number of simultaneous loaded files (default 20).],
	AC_DEFINE_UNQUOTED(MAX_FILES, $withval,[Maximum number of simultaneous loaded files]),
	AC_DEFINE(MAX_FILES, 20, [Maximum number of simultaneous loaded files])
)

dnl --enable-unit-mm : Set default unit for coordinates in status bar to mm
AC_ARG_ENABLE(unit-mm,
    [  --enable-unit-mm        Set default unit for coordinates in status bar to mm],
    [
        if test $enableval = "yes"; then
		default_unit="mm"
	fi
    ])
if test "$default_unit" = "mm"; then
	AC_DEFINE(GERBV_DEFAULT_UNIT, GERBV_MMS, [Default unit to display in statusbar])
else
	AC_DEFINE(GERBV_DEFAULT_UNIT, GERBV_MILS, [Default unit to display in statusbar])
fi

dnl --enable-gtk2 : Configure to run GTK+ 2.0
AC_ARG_ENABLE(gtk2,
    [  --enable-gtk2           Configures gerbv to use GTK+ 2.0],
    [
        if test $enableval = "yes"; then
		use_gtk2="yes"
	fi
    ])



dnl Initialize automake stuff (?)
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)

dnl Create a configuration header 
AM_CONFIG_HEADER(config.h)

dnl Build time sanity check... (?)
AM_SANITY_CHECK

dnl Initialize maintainer mode (?)
AM_MAINTAINER_MODE

dnl Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_INSTALL

if test "x$use_gtk2" = "xyes" ; then
	PKG_CHECK_MODULES(GTK, gtk+-2.0, , AC_MSG_ERROR([*** GTK+-2.0 not installed - please install first ***]))
dnl	GTK_LIBS="`$PKG_CONFIG --libs gtk+-2.0`"
dnl	GTK_CFLAGS="`$PKG_CONFIG --cflags gtk+-2.0`"
	AC_DEFINE([USE_GTK2],[1],[We will compile for GTK+ 2.0])
else

	dnl Change default location of gtk-config
	AC_ARG_WITH(gtk-config, [  --with-gtk-config=path  Change where gtk-config is located], [opt_gtkconfig=$withval])

	if eval "test x$opt_gtkconfig != x" ; then

	        if test ! -r "$opt_gtkconfig"; then

        	        AC_MSG_ERROR(Cannot find $opt_gtkconfig -- be sure that this pathname is correct)

	        else
	                GTK_CONFIG=$opt_gtkconfig
	        fi
	else
	        AM_PATH_GTK(1.2.3,,AC_MSG_ERROR([*** GTK+ >= 1.2.3 not installed - please install first ***]))
	fi


	if test $GTK_CONFIG = "no"; then
        	AC_MSG_ERROR(Cannot find gtk-config -- be sure that gtk >= 0.99.7 is installed)
fi

	GTK_LIBS="`$GTK_CONFIG --libs`"
	GTK_CFLAGS="`$GTK_CONFIG --cflags`"

	dnl GDK-PixBuf stuff
	if test "$exportpng" = "yes" ; then
		AM_PATH_GDK_PIXBUF
	fi
fi

if test "$exportpng" = "yes" ; then
	PNG_CFLAGS="`libpng-config --cflags`"
	PNG_LIBS="`libpng-config --libs`"
else
	GDK_PIXBUF_CFLAGS=
	GDK_PIXBUF_LIBS=
	PNG_CFLAGS=
	PNG_LIBS=
fi

dnl Why in ... has auto* stopped fixing this ???
if eval "test x$prefix = xNONE"; then
    prefix="$ac_default_prefix"
fi

dnl This is because I can unquote only once. Should be $datadir/gerbv/scheme
if test -z "$opt_backend_dir"; then
    if eval "test $datadir = '${prefix}/share'"; then
       opt_backend_dir="$prefix/share/gerbv/scheme"
    else
       opt_backend_dir="$datadir/gerbv/scheme"
    fi
fi

AC_DEFINE_UNQUOTED([BACKEND_DIR], "$opt_backend_dir",[Backend dir])
BACKEND_DIR="$opt_backend_dir"

AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Program version])

AC_CHECK_HEADERS(unistd.h getopt.h string.h sys/mman.h sys/types.h sys/stat.h stdlib.h)

AC_CHECK_FUNCS(getopt_long)

AC_SUBST(CC)
AC_SUBST(VERSION)

AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_CONFIG)
AC_SUBST(GTK_LIBS)

AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)
AC_SUBST(PNG_CFLAGS)
AC_SUBST(PNG_LIBS)

AC_SUBST(BACKEND_DIR)

AC_DEFINE([STANDALONE], [0],[Scheme interpreter not used standalone])
AC_DEFINE([USE_DL],[1],[Dynamic linking in Scheme interpreter])
AC_DEFINE([SUN_DL],[1],[DL Sun method])
AC_DEFINE([USE_MATH],[1],[Math in Scheme interpreter])
AC_DEFINE([USE_ASCII_NAMES],[1],[ASCII names in Scheme interpreter])
AC_DEFINE([USE_COLON_HOOKS],[1],[Colon Hooks in Scheme interpreter])
AC_DEFINE([USE_STRING_HOOKS],[1],[String Hooks in Scheme interpreter])
AC_DEFINE([USE_INTERFACE],[1],[Use extension interface of Scheme interpreter])


AC_OUTPUT(	Makefile \
		src/Makefile \
		man/Makefile \
		man/gerbv.1 \
		doc/PNG-print/Makefile \
		doc/eagle/Makefile \
		doc/Makefile \
		example/eaglecad1/Makefile \
		example/nollezappare/Makefile \
		example/numpres/Makefile \
		example/jj/Makefile \
		example/dan/Makefile \
		example/ekf2/Makefile \
		example/am-test/Makefile \
		example/cslk/Makefile \
		example/orcad/Makefile \
		example/Mentor-BoardStation/Makefile \
		example/Makefile )