2 # Process this file with autoconf to produce a configure script.
4 # xgsch2pcb - a GUI for gsch2pcb
5 # Copyright (C) 2006 University of Cambridge
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 AC_INIT([geda-xgsch2pcb], [0.1.3], BUG-REPORT-ADDRESS)
27 AM_INIT_AUTOMAKE([foreign])
30 PYTHON_WANTVERSION=2.4
31 PYTHON_WANTMODULES="commands gettext os os.path re shutil stat subprocess dbus dbus.glib dbus.service string"
35 # Checks for programs.
37 AM_PATH_PYTHON($PYTHON_WANTVERSION)
38 IT_PROG_INTLTOOL(0.35.0)
40 AC_DEFUN([AC_PYTHON_MODULE],[
41 AC_MSG_CHECKING([for python module $1])
42 $PYTHON -c "import $1" 2>&1 | grep -q 'ImportError'
43 if test $? -ne 0; then
48 AC_MSG_ERROR([python module $1 is required])
54 ############################################################################
55 # Update desktop database utility start
58 AC_ARG_ENABLE(update-desktop-database,
59 AC_HELP_STRING([--disable-update-desktop-database],
60 [do not update desktop file database after installation]),,
61 enable_update_desktop_database=yes)
63 AM_CONDITIONAL(ENABLE_UPDATE_DESKTOP_DATABASE,
64 test x$enable_update_desktop_database = xyes)
66 if test x$enable_update_desktop_database = xyes ; then
67 AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, [update-desktop-database], no)
68 if test $UPDATE_DESKTOP_DATABASE = no; then
69 AC_MSG_ERROR([Cannot find update-desktop-database, make sure it is installed and in your PATH, or configure with --disable-update-desktop-database])
74 # Update desktop database utility end
75 ############################################################################
81 AC_PATH_PROG(GMSGFMT, msgfmt)
83 # Set package name for translations
84 GETTEXT_PACKAGE=$PACKAGE
85 AC_SUBST(GETTEXT_PACKAGE)
87 ##########################################################################
88 # Command line flags start
91 # Change default location for rc files
92 AC_ARG_WITH(templatesdir, [ --with-templatesdir=path Change where the template projects are found], [templatesdir=$withval],[templatesdir=$datarootdir/$PACKAGE/templates])
94 AC_SUBST(templatesdir)
96 # Change default location for XDG files (.desktop and icons)
97 AC_ARG_WITH(xdgdatadir, [ --with-xdgdatadir=path Change where the .desktop file and theme icons are installed [[DATADIR]]], [opt_xdgdatadir=$withval])
99 if test x$opt_xdgdatadir = x; then
100 # path was not specified with --with-xdgdatadir
101 XDGDATADIR='${datadir}'
103 # path WAS specified with --with-xdgdatadir
104 XDGDATADIR="$opt_xdgdatadir"
109 # Command line flags end
110 ##########################################################################
112 ##########################################################################
116 AC_PYTHON_MODULE(pygtk, t)
118 AC_MSG_CHECKING(for pygtk 2.0)
119 cat > conftest.py <<[EOF
124 if $PYTHON conftest.py > /dev/null 2>&1; then
128 AC_MSG_ERROR([pygtk 2.0 is required])
131 for module in gobject gtk gtk.gdk; do
132 AC_PYTHON_MODULE($module, t)
135 AC_ARG_ENABLE([gtk-version-check],
136 AS_HELP_STRING([--disable-gtk-version-check], [Disable GTK+ version check, use it only for non-X environment]))
138 AS_IF([test "x$enable_gtk_version_check" != "xno"], [
140 AC_MSG_CHECKING(for gtk+ >= $GTK_WANTVERSION)
141 cat > conftest.py <<[EOF
145 ver = gtk.gtk_version
146 sys.stdout.write(".".join(map(str, ver)))
147 if len(sys.argv) > 1:
148 wantver = sys.argv[1].split(".")
149 wantver = map(int, wantver)
150 for i in range(len(wantver)):
153 if wantver[i] > ver[i]:
160 GTK_VERSION=`$PYTHON conftest.py $GTK_WANTVERSION 2> /dev/null`
162 AC_MSG_RESULT($GTK_VERSION)
163 if test $haveversion -ne 0; then
164 AC_MSG_ERROR([GTK+ >= $GTK_WANTVERSION is required])
171 ##########################################################################
174 ##########################################################################
175 # Look for other Python modules
178 for module in $PYTHON_WANTMODULES; do
179 AC_PYTHON_MODULE($module, t)
184 ##########################################################################
186 # Checks for system services
188 if test $interpval == 'no'; then
189 AC_MSG_ERROR([Your system must support the shell bang syntax]);
192 AC_CONFIG_FILES([Makefile