File: configure.in

package info (click to toggle)
plotutils 2.4.1-11
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 11,676 kB
  • ctags: 6,967
  • sloc: ansic: 76,305; sh: 15,172; cpp: 12,403; yacc: 2,604; makefile: 888; lex: 144
file content (91 lines) | stat: -rw-r--r-- 3,132 bytes parent folder | download | duplicates (3)
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
dnl Configure template for GNU libxmi.
dnl This is hugely cut down from the template for the GNU plotutils package.
dnl Copyright (C) 1989-2000 Free Software Foundation, Inc.
dnl Process this file with autoconf to produce a configure script.

AC_INIT(xmi.h)
AM_INIT_AUTOMAKE(libxmi, 1.2)
AM_CONFIG_HEADER(config.h)

dnl Did installer set the CFLAGS and CXXFLAGS environ variables before
dnl running configure?  Our default CFLAGS and CXXFLAGS differ from
dnl autoconf's, but we won't override installer-specified values.
if test "x$CFLAGS" = "x"; then
  CFLAGS_NOT_SET_BY_INSTALLER="yes"
else
  CFLAGS_NOT_SET_BY_INSTALLER="no"
fi

dnl We now use libtool to make and installed a shared library.  This should
dnl invoke the tests AC_PROG_CC, AC_OBJEXT, AC_PROG_INSTALL, and
dnl AC_PROG_MAKE_SET, or equivalents, so we don't perform them explicitly.
dnl Note: this can apparently alter CFLAGS, on a few platforms, e.g., on
dnl SCO OpenServer 5 (i.e. *-*-sco3.2v5*), "-belf" is added.
AM_PROG_LIBTOOL

dnl Determine extension (e.g. ".exe") on executables, if any.
AC_EXEEXT

dnl Compiler characteristics and typedefs.
AC_MSG_CHECKING(for void)
AC_TRY_COMPILE(, [void *foo = 0;], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_VOID)], [AC_MSG_RESULT(no)])
AC_C_CONST
AC_TYPE_SIZE_T

dnl Checks for header files: ANSI C, POSIX, and nonstandard Unix headers.
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h limits.h float.h)
AC_CHECK_HEADERS(malloc.h strings.h values.h)
AC_CHECK_HEADERS(sys/stdtypes.h)

dnl Other library functions.
AC_CHECK_FUNCS(memmove)

dnl This may do some good.
LIBS="$LIBS -lm"

dnl Override default autoconf value "-g -O2" or "-g" for CFLAGS, set by
dnl AC_PROG_CC.  Provided, that is, installer didn't set CFLAGS via an
dnl environment variable before running configure.  We don't use "-g" when
dnl compiling libxmi, since a debugging version of libxmi would be large.

dnl Note: on a very few platforms where libtool adds a command-line option
dnl to CFLAGS (see above; this includes SCO OpenServer 5, where "-belf" is
dnl added), this way of doing things will not work, i.e., the installer
dnl will need to add by hand the option that libtool would have added.
dnl E.g., on SCO OpenServer5 the installer may need to set the environment
dnl variable CFLAGS to "-O -belf" or "-O2 -belf".

if test "x$CFLAGS_NOT_SET_BY_INSTALLER" = "xyes"; then
if test "x$GCC" = "xyes"; then
  CFLAGS="-O2"
else
  CFLAGS="-O"
fi
fi

dnl Check for gcc strength-reduce bug (taken from WINE config).  Could do
dnl the same for g++, but we'll assume anyone doing any C++ compiling has
dnl installed a modern compiler.
if test "x${GCC}" = "xyes"; then
  AC_CACHE_CHECK("for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
                 AC_TRY_RUN([
int main()
{
  static int Array[[3]];
  unsigned int B = 3;
  int i;
  for (i=0; i < B; i++)
    Array[[i]] = i - 3;
  exit (Array[[1]] != -2);
}],
    ac_cv_c_gcc_strength_bug="no",
    ac_cv_c_gcc_strength_bug="yes",
    ac_cv_c_gcc_strength_bug="yes") )
  if test "$ac_cv_c_gcc_strength_bug" = "yes"
  then
    CFLAGS="$CFLAGS -fno-strength-reduce"
  fi
fi

AC_OUTPUT(Makefile info/Makefile)