13
13
# values found in <values1>, <values2>, ... respectively. <values1>,
14
14
# <values2>, ... contain a list of possible values for each corresponding
15
15
# tag and all combinations are tested. When AC_TRY_COMPILE(include, code)
16
- # is successfull for a given substitution, the macro stops and defines the
16
+ # is successful for a given substitution, the macro stops and defines the
17
17
# following macros: FUNCTION_TAG1, FUNCTION_TAG2, ... using AC_DEFINE()
18
18
# with values set to the current values of <TAG1>, <TAG2>, ... If no
19
- # combination is successfull the configure script is aborted with a
19
+ # combination is successful the configure script is aborted with a
20
20
# message.
21
21
#
22
22
# Intended purpose is to find which combination of argument types is
26
26
#
27
27
# Generic usage pattern:
28
28
#
29
- # 1) add a call in configure.in
29
+ # 1) add a call in configure.ac
30
30
#
31
31
# AX_PROTOTYPE(...)
32
32
#
33
33
# 2) call autoheader to see which symbols are not covered
34
34
#
35
- # 3) add the lines in acconfig .h
35
+ # 3) add the lines in config .h
36
36
#
37
37
# /* Type of Nth argument of function */
38
38
# #undef FUNCTION_ARGN
41
41
#
42
42
# Complete example:
43
43
#
44
- # 1) configure.in
44
+ # 1) configure.ac
45
45
#
46
46
# AX_PROTOTYPE(getpeername,
47
47
# [
59
59
#
60
60
# 2) call autoheader
61
61
#
62
- # autoheader: Symbol `GETPEERNAME_ARG2' is not covered by ./acconfig .h
63
- # autoheader: Symbol `GETPEERNAME_ARG3' is not covered by ./acconfig .h
62
+ # autoheader: Symbol `GETPEERNAME_ARG2' is not covered by ./config .h
63
+ # autoheader: Symbol `GETPEERNAME_ARG3' is not covered by ./config .h
64
64
#
65
- # 3) acconfig .h
65
+ # 3) config .h
66
66
#
67
67
# /* Type of second argument of getpeername */
68
68
# #undef GETPEERNAME_ARG2
114
114
# modified version of the Autoconf Macro, you may extend this special
115
115
# exception to the GPL to apply to your modified version as well.
116
116
117
- # serial 6
117
+ # serial 11
118
118
119
119
AU_ALIAS ( [ AC_PROTOTYPE] , [ AX_PROTOTYPE ] )
120
120
AC_DEFUN ( [ AX_PROTOTYPE ] ,[
@@ -148,7 +148,7 @@ AC_DEFUN([AX_PROTOTYPE_REVERSE],[ifelse($#,0,,$#,1,[[$1]],[AX_PROTOTYPE_REVERSE(
148
148
dnl
149
149
dnl AX_PROTOTYPE_SUBST(string, tag)
150
150
dnl
151
- dnl Substitute all occurence of <tag> in <string> with <tag>_VAL.
151
+ dnl Substitute all occurrence of <tag> in <string> with <tag>_VAL.
152
152
dnl Assumes that tag_VAL is a macro containing the value associated to tag.
153
153
dnl
154
154
AC_DEFUN ( [ AX_PROTOTYPE_SUBST] ,[ ifelse ( $2 ,,[ $1 ] ,[ AX_PROTOTYPE_SUBST(patsubst([ $1 ] ,[ $2 ] ,[ $2 [ ] _VAL] ),builtin ( [ shift] ,builtin ( [ shift] ,$@ ) ) )] ) ] )
@@ -168,9 +168,9 @@ dnl Assumes that function is a macro containing the name of the function in uppe
168
168
dnl and that tag_VAL is a macro containing the value associated to tag.
169
169
dnl
170
170
AC_DEFUN ( [ AX_PROTOTYPE_DEFINES] ,[ ifelse ( $1 ,,[ ] ,
171
- [ AC_DEFINE ( function [ ] _$1 , $1 _VAL , [ ] )
172
- AC_SUBST ( function [ ] _$1 , "$1 _VAL" )
173
- AX_PROTOTYPE_DEFINES(builtin ( [ shift] ,$@ ) )] ) ] )
171
+ [ AC_DEFINE ( function [ ] _$1 , $1 _VAL )
172
+ AC_SUBST ( function [ ] _$1 , "$1 _VAL" )
173
+ AX_PROTOTYPE_DEFINES(builtin ( [ shift] ,$@ ) )] ) ] )
174
174
175
175
dnl
176
176
dnl AX_PROTOTYPE_STATUS(tags)
@@ -217,13 +217,23 @@ dnl
217
217
dnl Activate fatal warnings if possible, gives better guess
218
218
dnl
219
219
ac_save_CPPFLAGS="$CPPFLAGS"
220
- if test "$GCC" = "yes" ; then CPPFLAGS="$CPPFLAGS -Werror" ; fi
221
- AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [ $2 ] ] , [ [ $1 ] ] ) ] ,[
220
+ dnl ifelse ( AC_LANG ,CPLUSPLUS ,if test "$GXX" = "yes" ; then CPPFLAGS="$CPPFLAGS - Werror" ; fi )
221
+ dnl ifelse ( AC_LANG ,C ,if test "$GCC" = "yes" ; then CPPFLAGS="$CPPFLAGS - Werror" ; fi )
222
+ dnl
223
+ dnl Disable the 'unused-variable' warning in case e.g. -Wall was enabled,
224
+ dnl otherwise the test may always fail.
225
+ dnl
226
+ if (test "x$GCC" = "xyes" || test "x$GXX" = "xyes" ); then
227
+ CPPFLAGS="$CPPFLAGS -Werror -Wno-unused-variable" ;
228
+ fi
229
+
230
+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ $2 ] , [ $1 ] ) ] ,
231
+ [
222
232
CPPFLAGS="$ac_save_CPPFLAGS"
223
233
AC_MSG_RESULT ( ok )
224
234
AX_PROTOTYPE_DEFINES(tags)
225
235
break;
226
- ] ,[
236
+ ] , [
227
237
CPPFLAGS="$ac_save_CPPFLAGS"
228
238
AC_MSG_RESULT ( not ok )
229
239
] )
0 commit comments