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 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/s_basic.c)
dnl Initialize automake stuff
PACKAGE=gEDA
# new way of doing version
VERSION=19991011
echo Configuring libgeda version $VERSION
dnl --disable-strokes : turn off stroke support
AC_ARG_ENABLE(strokes,
[ --disable-strokes Disable stroke support (don't use LibStroke at all)],
[
no_strokes=yes
])
dnl --disable-gdgeda : turn off libgdgeda support
AC_ARG_ENABLE(gdgeda,
[ --disable-gdgeda Disable libgdgeda support (don't use libgdgeda at all)],
[
no_gdgeda=yes
])
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])
dnl Change default location for rc files
AC_ARG_WITH(rcdir, [ --with-rcdir=path Change where the system-*rc files are installed], [opt_rcdir=$withval])
dnl Initialize automake stuff
dnl AM_INIT_AUTOMAKE($PACKAGE, $GEDA_VER_MAJOR.$GEDA_VER_MINOR.$GEDA_VER_MICRO, no-define)
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 libtool
AM_PROG_LIBTOOL
dnl Check to see if we are building in the cygnus win32 environment
AC_CYGWIN
dnl Initialize maintainer mode
AM_MAINTAINER_MODE
dnl Checks for programs.
AC_PROG_CC
dnl AC_PROG_LEX
dnl AC_DECL_YYTEXT
AC_PROG_MAKE_SET
dnl Check for guile-config; use it to set
dnl GUILE_INCLUDE and GUILE_LIB.
dnl Issue: Is it OK to include "-L" in GUILE_LIB?
AC_PATH_PROG(GUILE_CONFIG_PROG, guile-config)
if test ! -n "$GUILE_CONFIG_PROG" ; then
AC_MSG_ERROR(Cannot find guile-config -- Install GUILE 1.3 and run ./configure again)
fi
guile_incdir=`$GUILE_CONFIG_PROG info includedir`
guile_libdir=`$GUILE_CONFIG_PROG info libdir`
guile_libs=`$GUILE_CONFIG_PROG link`
GUILE_INCLUDE="-I${guile_incdir}"
GUILE_LIB="-L${guile_libdir} ${guile_libs}"
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
dnl Checks for header files.
AC_PATH_X
AC_PATH_XTRA
CFLAGS="$X_CFLAGS $CFLAGS"
LDFLAGS="$X_LDFLAGS $X_LIBS $LDFLAGS"
X_EXTRA_LIBS="$X_EXTRA_LIBS -lX11 -lm"
dnl Checks for X libraries.
AC_CHECK_LIB(X11, XOpenDisplay, X_LIBS="-lX11", X_LIBS=no, $X_EXTRA_LIBS)
AC_CHECK_LIB(Xext, XShmAttach, X_LIBS="-lXext $X_LIBS", X_EXT=no, $X_EXTRA_LIBS)
dnl AC_CHECK_LIB(Xext, XShmAttach, X_LIBS="-lXext $X_LIBS", XEXT=no, $X_EXTRA_LIBS)
if test "$CYGWIN"x = x; then
if test "$X_LIBS" = no; then
AC_MSG_ERROR(Cannot find -lX11 library)
fi
else
echo X11 not required for CYGWIN port
fi
dnl Checking for rint in math library
AC_CHECK_LIB(m, rint, AC_DEFINE(HAS_RINT), no_RINT="yes")
dnl Checking for dynamic lib
AC_CHECK_LIB(dl, dlopen, DL_LIB="-ldl", DL_LIB="")
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
GTKCONFIG=$opt_gtkconfig
fi
else
AC_PATH_PROG(GTKCONFIG, gtk-config, no, ${PATH})
fi
if test $GTKCONFIG = "no"; then
AC_MSG_ERROR(Cannot find gtk-config -- be sure that gtk >= 0.99.7 is installed)
fi
LDEXTRA=
CFEXTRA=
GTK=
GDK=
GLIB=
X_LDFLAGS=`$GTKCONFIG --libs`
X_CFLAGS=`$GTKCONFIG --cflags`
gtkversion=`$GTKCONFIG --version | cut -d. -f1,2`
AC_DEFINE_UNQUOTED(GTKVERSION, "$gtkversion")
dnl set a #define for a new version of gtk
dnl and step the prototype.h files
if eval "test $gtkversion = '1.2'" ; then
AC_DEFINE(GTK_DEVEL)
echo Found GTK+ 1.2.x
dnl no longer needed since prototype is in include
dnl ( cd src; rm -f prototype.h ; ln -f -s prototype1.2.h prototype.h )
else
echo Found GTK+ 1.0.x
AC_MSG_ERROR(GTK+ 1.0.x is no longer supported by gEDA, please upgrade to 1.2.x)
fi
dnl old way of doing this, see if new way works
dnl CFLAGS="$CFLAGS $CFEXTRA `$GTKCONFIG --cflags`"
CFLAGS="`$GTKCONFIG --cflags` $CFLAGS $CFEXTRA"
LDFLAGS="$LDEXTRA `$GTKCONFIG --libs` -lgtk -lgdk -lglib $LDFLAGS -lm"
AC_MSG_CHECKING([for the rest of gtk])
AC_TRY_COMPILE(
[#include <gtk/gtk.h>],
[GtkArgSetFunc arg_set_func;],
gtk_found=yes,
gtk_found=no)
AC_MSG_RESULT($gtk_found)
if test $gtk_found = no; then
AC_MSG_ERROR(Cannot include/link gtk/gdk/glib--check CFLAGS/LDFLAGS)
fi
AC_CHECK_LIB(stroke, stroke_init, STROKE_LIB="-lstroke", STROKE_LIB=no)
if test $STROKE_LIB = no; then
STROKE_LIB=""
else
if test "$no_strokes" = "yes"; then
echo found libstroke, but disabling strokes
STROKE_LIB=""
else
AC_DEFINE(HAS_LIBSTROKE)
fi
fi
# search for libgdgeda-config
AC_PATH_PROG(LIBGDGEDACONFIG, libgdgeda-config, no, ${PATH})
if test $LIBGDGEDACONFIG = "no"; then
libgdgeda_ldflags=""
libgdgeda_cflags=""
else
libgdgeda_ldflags=`$LIBGDGEDACONFIG --libs`
libgdgeda_cflags=`$LIBGDGEDACONFIG --cflags`
GD_EXTRA="$libgdgeda_cflags $libgdgeda_ldflags -lm"
X_CFLAGS="$libgdgeda_cflags `$GTKCONFIG --cflags`"
fi
AC_CHECK_LIB(gdgeda, gdImageColorAllocate, GDGEDA_LIB="-lgdgeda", GDGEDA_LIB=no, $GD_EXTRA)
if test $GDGEDA_LIB = no; then
GDGEDA_LIB=""
else
if test "$no_gdgeda" = "yes"; then
echo found libgdgeda, but disabling gdgeda
GDGEDA_LIB=""
libgdgeda_ldflags=""
libgdgeda_cflags=""
else
AC_CHECK_LIB(z, uncompress, Z_LIB="-lz", Z_LIB=no)
if test $Z_LIB = no; then
AC_MSG_ERROR(Cannot find libz (zlib), be sure to install zlib; it is required for libgdgeda)
fi
PNG_EXTRA="-lz -lm"
AC_CHECK_LIB(png, png_read_init, PNG_LIB="-lpng", PNG_LIB=no, $PNG_EXTRA)
if test $PNG_LIB = no; then
AC_MSG_ERROR(Cannot find libpng, be sure to install png; it is required for libgdgeda)
fi
AC_DEFINE(HAS_LIBZ)
AC_DEFINE(HAS_LIBPNG)
AC_DEFINE(HAS_LIBGDGEDA)
fi
fi
LDFLAGS="$saved_ldflags $LDEXTRA"
CFLAGS="$saved_cflags $CFEXTRA"
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_DIRENT
AC_CHECK_HEADERS(fcntl.h unistd.h strings.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(getcwd strstr vsnprintf snprintf)
AC_MSG_CHECKING([for optarg in unistd.h])
AC_TRY_COMPILE(
[#include <unistd.h>],
[ char *string = optarg; int i = optind; ],
optarg_found=yes,
optarg_found=no)
AC_MSG_RESULT($optarg_found)
if test $optarg_found = yes; then
AC_DEFINE(OPTARG_IN_UNISTD)
fi
#
# Defs for libary symbol files
#
# Expand the prefix variable
# I don't like the way this is done currently
if eval "test x$prefix = xNONE"; then
dprefix=$ac_default_prefix
else
dprefix=$prefix
fi
gedatopdir=$dprefix/share/$PACKAGE
expandgedadatadir=`echo $gedatopdir`
# this has to be expanded ( no ${prefix} ) --
AC_DEFINE_UNQUOTED(GEDADATADIR, "$gedatopdir")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
HOME=`echo $HOME`
AC_SUBST(HOME)
AC_SUBST(VERSION)
AC_SUBST(GTKVERSION)
AC_SUBST(GTK_DEVEL)
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LDFLAGS)
AC_SUBST(X_LIBS)
AC_SUBST(STROKE_LIB)
AC_SUBST(GD_LIB)
AC_SUBST(GUILE_LIB)
AC_SUBST(GUILE_INCLUDE)
AC_SUBST(DL_LIB)
AC_SUBST(GTK)
AC_SUBST(GDK)
AC_SUBST(GLIB)
AC_OUTPUT([
Makefile
libgeda-config
include/Makefile
src/Makefile ], [chmod +x libgeda-config])
|