1 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2 # 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
3 # Free Software Foundation, Inc.
5 # This file is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; see the file COPYING3. If not see
17 # <http://www.gnu.org/licenses/>.
19 ##############################################################################
20 ### WARNING: this file contains embedded tabs. Do not run untabify on this file.
21 # Process this file with autoconf to produce a configure script, like so:
22 # aclocal && autoconf && autoheader && automake
25 AC_INIT(gccpy-runtime, 0.1, http://gcc.gnu.org, libgpython,
26 https://github.com/redbrain/gccpy)
27 AC_CONFIG_SRCDIR(Makefile.am)
28 AC_CONFIG_HEADER(config.h)
31 AC_SUBST(libtool_VERSION)
34 target_alias=${target_alias-$host_alias}
37 AM_INIT_AUTOMAKE([1.9.3 no-define foreign no-dist -Wall -Wno-portability])
38 AH_TEMPLATE(PACKAGE, [Name of package])
39 AH_TEMPLATE(VERSION, [Version number of package])
41 m4_rename([_AC_ARG_VAR_PRECIOUS],[glibgpython_PRECIOUS])
42 m4_define([_AC_ARG_VAR_PRECIOUS],[])
44 m4_rename_force([glibgpython_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
51 AC_CHECK_TOOL(OBJCOPY, objcopy, missing-objcopy)
55 AC_SUBST(enable_shared)
56 AC_SUBST(enable_static)
58 CC_FOR_BUILD=${CC_FOR_BUILD:-gcc}
59 AC_SUBST(CC_FOR_BUILD)
63 WARN_FLAGS='-Wall -Wextra -Wwrite-strings -Wcast-qual'
66 dnl FIXME: This should be controlled by --enable-maintainer-mode.
70 # See if the user wants to configure without libffi. Some
71 # architectures don't support it. FIXME: We should set a default
74 AS_HELP_STRING([--without-libffi],
77 [with_libffi=${with_libffi_default-yes}])
81 if test "$with_libffi" != no; then
82 AC_DEFINE(USE_LIBFFI, 1, [Define if we're to use libffi.])
83 LIBFFI=../libffi/libffi_convenience.la
84 LIBFFIINCS='-I$(top_srcdir)/../libffi/include -I../libffi/include'
89 dnl Test for the -lm library.
91 AC_CHECK_LIB([m], [sqrt], MATH_LIBS=-lm)
94 dnl Test whether the compiler supports the -pthread option.
95 AC_CACHE_CHECK([whether -pthread is supported],
96 [libgpython_cv_lib_pthread],
98 CFLAGS="$CFLAGS -pthread"
99 AC_COMPILE_IFELSE([[int i;]],
100 [libgpython_cv_lib_pthread=yes],
101 [libgpython_cv_lib_pthread=no])
102 CFLAGS=$CFLAGS_hold])
104 if test "$libgpython_cv_lib_pthread" = yes; then
105 PTHREAD_CFLAGS=-pthread
107 AC_SUBST(PTHREAD_CFLAGS)
109 dnl Test for the -lpthread library.
111 AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS=-lpthread)
112 AC_SUBST(PTHREAD_LIBS)
116 GCC_CHECK_UNWIND_GETIPINFO
121 # Checks for header files.
124 AC_CHECK_HEADERS([stdlib.h string.h stdarg.h unistd.h \
125 stdint.h stdio.h getopt.h \
126 assert.h sys/types.h signal.h \
127 fcntl.h pthread.h sys/wait.h])
129 # Checks for typedefs, structures, and compiler characteristics.
133 AC_CHECK_FUNCS([popen fopen fclose sprintf fprintf strdup \
134 strlen strcpy strcmp getopt_long \
135 memcpy calloc system sysconf atoi \
136 getpid execl fork wait exit atof \
137 vfprintf memcmp getc fgets pipe \
140 # Checks for library functions.
145 AC_CONFIG_FILES(Makefile)