1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
|
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
# xgsch2pcb - a GUI for gsch2pcb
# Copyright (C) 2006 University of Cambridge
#
# 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.59)
AC_INIT([geda-xgsch2pcb], [0.1.3], BUG-REPORT-ADDRESS)
AM_INIT_AUTOMAKE([foreign])
PYTHON_WANTVERSION=2.4
PYTHON_WANTMODULES="commands gettext os os.path re shutil stat subprocess dbus dbus.glib dbus.service"
GTK_WANTVERSION=2.8
# Checks for programs.
AC_PROG_INSTALL
AM_PATH_PYTHON($PYTHON_WANTVERSION)
IT_PROG_INTLTOOL(0.35.0)
AC_DEFUN([AC_PYTHON_MODULE],[
AC_MSG_CHECKING([for python module $1])
$PYTHON -c "import $1" > /dev/null 2>&1
if test $? -eq 0; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
if test -n "$2"; then
AC_MSG_ERROR([python module $1 is required])
fi
fi
])
############################################################################
# Update desktop database utility start
#
AC_ARG_ENABLE(update-desktop-database,
AC_HELP_STRING([--disable-update-desktop-database],
[do not update desktop file database after installation]),,
enable_update_desktop_database=yes)
AM_CONDITIONAL(ENABLE_UPDATE_DESKTOP_DATABASE,
test x$enable_update_desktop_database = xyes)
if test x$enable_update_desktop_database = xyes ; then
AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, [update-desktop-database], no)
if test $UPDATE_DESKTOP_DATABASE = no; then
AC_MSG_ERROR([Cannot find update-desktop-database, make sure it is installed and in your PATH, or configure with --disable-update-desktop-database])
fi
fi
#
# Update desktop database utility end
############################################################################
# Set USE_NLS
AM_NLS
# Find GMSGFMT
AC_PATH_PROG(GMSGFMT, msgfmt)
# Set package name for translations
GETTEXT_PACKAGE=$PACKAGE
AC_SUBST(GETTEXT_PACKAGE)
##########################################################################
# Command line flags start
#
# Change default location for rc files
AC_ARG_WITH(templatesdir, [ --with-templatesdir=path Change where the template projects are found], [templatesdir=$withval],[templatesdir=$datarootdir/$PACKAGE/templates])
AC_SUBST(templatesdir)
# Change default location for XDG files (.desktop and icons)
AC_ARG_WITH(xdgdatadir, [ --with-xdgdatadir=path Change where the .desktop file and theme icons are installed [[DATADIR]]], [opt_xdgdatadir=$withval])
if test x$opt_xdgdatadir = x; then
# path was not specified with --with-xdgdatadir
XDGDATADIR='${datadir}'
else
# path WAS specified with --with-xdgdatadir
XDGDATADIR="$opt_xdgdatadir"
fi
AC_SUBST(XDGDATADIR)
#
# Command line flags end
##########################################################################
##########################################################################
# Look for PyGTK
#
AC_PYTHON_MODULE(pygtk, t)
AC_MSG_CHECKING(for pygtk 2.0)
cat > conftest.py <<[EOF
import pygtk
pygtk.require("2.0")
EOF]
if $PYTHON conftest.py > /dev/null 2>&1; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([pygtk 2.0 is required])
fi
for module in gobject gtk gtk.gdk; do
AC_PYTHON_MODULE($module, t)
done
AC_MSG_CHECKING(for gtk+ >= $GTK_WANTVERSION)
cat > conftest.py <<[EOF
import sys
try:
import gtk
ver = gtk.gtk_version
sys.stdout.write(".".join(map(str, ver)))
if len(sys.argv) > 1:
wantver = sys.argv[1].split(".")
wantver = map(int, wantver)
for i in range(len(wantver)):
if i > len(ver):
break
if wantver[i] > ver[i]:
sys.exit(1)
except:
sys.exit(1)
sys.exit(0)
EOF]
GTK_VERSION=`$PYTHON conftest.py $GTK_WANTVERSION 2> /dev/null`
haveversion=$?
AC_MSG_RESULT($GTK_VERSION)
if test $haveversion -ne 0; then
AC_MSG_ERROR([GTK+ >= $GTK_WANTVERSION is required])
fi
#
#
##########################################################################
##########################################################################
# Look for other Python modules
#
for module in $PYTHON_WANTMODULES; do
AC_PYTHON_MODULE($module, t)
done
#
#
##########################################################################
# Checks for system services
AC_SYS_INTERPRETER
if test $interpval == 'no'; then
AC_MSG_ERROR([Your system must support the shell bang syntax]);
fi
AC_CONFIG_FILES([Makefile
data/Makefile
po/Makefile.in
po/Makefile])
AC_OUTPUT
|