root/trunk/fm_server/acinclude.m4

Revision 206, 5.5 KB (checked in by ath, 4 years ago)

Move "fm_server".

Line 
1AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
2
3dnl @synopsis AC_C99_FUNC_LRINT
4dnl
5dnl Check whether C99's lrint function is available.
6dnl @version 1.3        Feb 12 2002
7dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
8dnl
9dnl Permission to use, copy, modify, distribute, and sell this file for any
10dnl purpose is hereby granted without fee, provided that the above copyright
11dnl and this permission notice appear in all copies.  No representations are
12dnl made about the suitability of this software for any purpose.  It is
13dnl provided "as is" without express or implied warranty.
14dnl
15AC_DEFUN([AC_C99_FUNC_LRINT],
16[AC_CACHE_CHECK(for lrint,
17  ac_cv_c99_lrint,
18[
19lrint_save_CFLAGS=$CFLAGS
20CFLAGS="-O2 -lm"
21AC_TRY_LINK([
22#define         _ISOC9X_SOURCE  1
23#define         _ISOC99_SOURCE  1
24#define         __USE_ISOC99    1
25#define         __USE_ISOC9X    1
26
27#include <math.h>
28], if (!lrint(3.14159)) lrint(2.7183);, ac_cv_c99_lrint=yes, ac_cv_c99_lrint=no)
29
30CFLAGS=$lrint_save_CFLAGS
31
32])
33
34if test "$ac_cv_c99_lrint" = yes; then
35  AC_DEFINE(HAVE_LRINT, 1,
36            [Define if you have C99's lrint function.])
37fi
38])# AC_C99_FUNC_LRINT
39dnl @synopsis AC_C99_FUNC_LRINTF
40dnl
41dnl Check whether C99's lrintf function is available.
42dnl @version 1.3        Feb 12 2002
43dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
44dnl
45dnl Permission to use, copy, modify, distribute, and sell this file for any
46dnl purpose is hereby granted without fee, provided that the above copyright
47dnl and this permission notice appear in all copies.  No representations are
48dnl made about the suitability of this software for any purpose.  It is
49dnl provided "as is" without express or implied warranty.
50dnl
51AC_DEFUN([AC_C99_FUNC_LRINTF],
52[AC_CACHE_CHECK(for lrintf,
53  ac_cv_c99_lrintf,
54[
55lrintf_save_CFLAGS=$CFLAGS
56CFLAGS="-O2 -lm"
57AC_TRY_LINK([
58#define         _ISOC9X_SOURCE  1
59#define         _ISOC99_SOURCE  1
60#define         __USE_ISOC99    1
61#define         __USE_ISOC9X    1
62
63#include <math.h>
64], if (!lrintf(3.14159)) lrintf(2.7183);, ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no)
65
66CFLAGS=$lrintf_save_CFLAGS
67
68])
69
70if test "$ac_cv_c99_lrintf" = yes; then
71  AC_DEFINE(HAVE_LRINTF, 1,
72            [Define if you have C99's lrintf function.])
73fi
74])# AC_C99_FUNC_LRINTF
75dnl @synopsis AC_C99_FUNC_LLRINT
76dnl
77dnl Check whether C99's llrint function is available.
78dnl @version 1.1        Sep 30 2002
79dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
80dnl
81dnl Permission to use, copy, modify, distribute, and sell this file for any
82dnl purpose is hereby granted without fee, provided that the above copyright
83dnl and this permission notice appear in all copies.  No representations are
84dnl made about the suitability of this software for any purpose.  It is
85dnl provided "as is" without express or implied warranty.
86dnl
87AC_DEFUN([AC_C99_FUNC_LLRINT],
88[AC_CACHE_CHECK(for llrint,
89  ac_cv_c99_llrint,
90[
91llrint_save_CFLAGS=$CFLAGS
92CFLAGS="-O2 -lm"
93AC_TRY_LINK([
94#define         _ISOC9X_SOURCE  1
95#define         _ISOC99_SOURCE  1
96#define         __USE_ISOC99    1
97#define         __USE_ISOC9X    1
98
99#include <math.h>
100#include <stdint.h>
101], int64_t      x ; x = llrint(3.14159) ;, ac_cv_c99_llrint=yes, ac_cv_c99_llrint=no)
102
103CFLAGS=$llrint_save_CFLAGS
104
105])
106
107if test "$ac_cv_c99_llrint" = yes; then
108  AC_DEFINE(HAVE_LLRINT, 1,
109            [Define if you have C99's llrint function.])
110fi
111])# AC_C99_FUNC_LLRINT
112
113
114
115dnl @synopsis AC_C_CLIP_MODE
116dnl
117dnl Determine the clipping mode when converting float to int.
118dnl @version 1.0        May 17 2003
119dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
120dnl
121dnl Permission to use, copy, modify, distribute, and sell this file for any
122dnl purpose is hereby granted without fee, provided that the above copyright
123dnl and this permission notice appear in all copies.  No representations are
124dnl made about the suitability of this software for any purpose.  It is
125dnl provided "as is" without express or implied warranty.
126
127
128
129dnl Find the clipping mode in the following way:
130dnl    1) If we are not cross compiling test it.
131dnl    2) IF we are cross compiling, assume that clipping isn't done correctly.
132
133AC_DEFUN([AC_C_CLIP_MODE],
134[AC_CACHE_CHECK(processor clipping capabilities,
135        ac_cv_c_clip_type,
136
137# Initialize to unknown
138ac_cv_c_clip_positive=unknown
139ac_cv_c_clip_negative=unknown
140
141if test $ac_cv_c_clip_positive = unknown ; then
142        AC_TRY_RUN(
143        [[
144        #define _ISOC9X_SOURCE  1
145        #define _ISOC99_SOURCE  1
146        #define __USE_ISOC99    1
147        #define __USE_ISOC9X    1
148        #include <math.h>
149        int main (void)
150        {       double  fval ;
151                int k, ival ;
152
153                fval = 1.0 * 0x7FFFFFFF ;
154                for (k = 0 ; k < 100 ; k++)
155                {       ival = (lrint (fval)) >> 24 ;
156                        if (ival != 127)
157                                return 1 ;
158               
159                        fval *= 1.2499999 ;
160                        } ;
161               
162                        return 0 ;
163                }
164                ]],
165                ac_cv_c_clip_positive=yes,
166                ac_cv_c_clip_positive=no,
167                ac_cv_c_clip_positive=unknown
168                )
169
170        AC_TRY_RUN(
171        [[
172        #define _ISOC9X_SOURCE  1
173        #define _ISOC99_SOURCE  1
174        #define __USE_ISOC99    1
175        #define __USE_ISOC9X    1
176        #include <math.h>
177        int main (void)
178        {       double  fval ;
179                int k, ival ;
180
181                fval = -8.0 * 0x10000000 ;
182                for (k = 0 ; k < 100 ; k++)
183                {       ival = (lrint (fval)) >> 24 ;
184                        if (ival != -128)
185                                return 1 ;
186               
187                        fval *= 1.2499999 ;
188                        } ;
189               
190                        return 0 ;
191                }
192                ]],
193                ac_cv_c_clip_negative=yes,
194                ac_cv_c_clip_negative=no,
195                ac_cv_c_clip_negative=unknown
196                )
197
198        fi
199
200if test $ac_cv_c_clip_positive = yes ; then
201        ac_cv_c_clip_positive=1
202else
203        ac_cv_c_clip_positive=0
204        fi
205
206if test $ac_cv_c_clip_negative = yes ; then
207        ac_cv_c_clip_negative=1
208else
209        ac_cv_c_clip_negative=0
210        fi
211
212[[
213case "$ac_cv_c_clip_positive$ac_cv_c_clip_negative" in
214        "00")
215                ac_cv_c_clip_type="none"
216                ;;
217        "10")
218                ac_cv_c_clip_type="positive"
219                ;;
220        "01")
221                ac_cv_c_clip_type="negative"
222                ;;
223        "11")
224                ac_cv_c_clip_type="both"
225                ;;
226        esac
227        ]]
228
229)
230]
231
232)# AC_C_CLIP_MODE
Note: See TracBrowser for help on using the browser.