root/branches/mcstas-1.x/aclocal.m4

Revision 2058, 2.6 KB (checked in by pkwi, 5 years ago)

From next release, McStas is GPL 2 only.

The debate on the internet about the future GPL 3 suggests that this license might have implications on the 'derived work', hence have implications on what and how our users use their McStas simulations.

Line 
1
2#   This file is part of the McStas neutron ray-trace simulation package
3#   Copyright (C) 1997-2004, All rights reserved
4#   Risoe National Laborartory, Roskilde, Denmark
5#   Institut Laue Langevin, Grenoble, France
6#
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; version 2 of the License.
10#
11#   This program is distributed in the hope that it will be useful,
12#   but WITHOUT ANY WARRANTY; without even the implied warranty of
13#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14#   GNU General Public License for more details.
15#
16#   You should have received a copy of the GNU General Public License
17#   along with this program; if not, write to the Free Software
18#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19#
20AC_DEFUN([CF_ANSI_CC_CHECK],
21[
22AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
23AC_CACHE_VAL(cf_cv_ansi_cc,[
24cf_cv_ansi_cc=no
25cf_save_CFLAGS="$CFLAGS"
26# Don't try gcc -ansi; that turns off useful extensions and
27# breaks some systems' header files.
28# AIX                   -qlanglvl=ansi
29# Ultrix and OSF/1      -std1
30# HP-UX                 -Aa -D_HPUX_SOURCE
31# SVR4                  -Xc
32# UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
33for cf_arg in "-DCC_HAS_PROTOS" "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
34do
35        CFLAGS="$cf_save_CFLAGS $cf_arg"
36        AC_TRY_COMPILE(
37[
38#ifndef CC_HAS_PROTOS
39#if !defined(__STDC__) || __STDC__ != 1
40choke me
41#endif
42#endif
43],[
44        int test (int i, double x);
45        struct s1 {int (*f) (int a);};
46        struct s2 {int (*f) (double a);};],
47        [cf_cv_ansi_cc="$cf_arg"; break])
48done
49CFLAGS="$cf_save_CFLAGS"
50])
51AC_MSG_RESULT($cf_cv_ansi_cc)
52
53if test "$cf_cv_ansi_cc" != "no"; then
54if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
55        CFLAGS="$CFLAGS $cf_cv_ansi_cc"
56else
57        AC_DEFINE(CC_HAS_PROTOS)
58fi
59fi
60])dnl
61
62
63AC_DEFUN([MC_ANSI_MATH_PROTO],
64[
65AC_MSG_CHECKING(for proper ANSI C math prototypes)
66AC_CACHE_VAL(mc_cv_ansi_math_proto,[
67# OSF/1 (Digital/Compaq Unix) cc needs -std1 for full ANSI C math prototypes
68AC_TRY_COMPILE(
69[
70#include <math.h>
71],[
72{ double a = sqrt(&a); }],
73[mc_save_CFLAGS="$CFLAGS"
74CFLAGS="$cf_save_CFLAGS -std1"
75AC_TRY_COMPILE(
76[
77#include <math.h>
78],[
79{ double a = sqrt(&a); }],
80[mc_cv_ansi_math_proto=no],[mc_cv_ansi_math_proto="-std1"])
81CFLAGS="$cf_save_CFLAGS"],[mc_cv_ansi_math_proto=yes])
82])
83AC_MSG_RESULT($mc_cv_ansi_math_proto)
84
85if test "$mc_cv_ansi_math_proto" != "yes"; then
86if test "$mc_cv_ansi_math_proto" != "no"; then
87        CFLAGS="$CFLAGS $mc_cv_ansi_math_proto"
88else
89        AC_MSG_WARN(C compiler seems not to do ANSI math prototypes)
90fi
91fi
92])dnl
Note: See TracBrowser for help on using the browser.