blob: 979bec6bda89f4de0857f869d75855c542a5a292 [file] [log] [blame]
Gavin McDonald0b75e1a2010-10-28 02:12:01 +00001dnl @synopsis AX_THRIFT_GEN(SHORT_LANGUAGE, LONG_LANGUAGE, DEFAULT)
2dnl @synopsis AX_THRIFT_LIB(SHORT_LANGUAGE, LONG_LANGUAGE, DEFAULT)
3dnl
4dnl Allow a particular language generator to be disabled.
5dnl Allow a particular language library to be disabled.
6dnl
7dnl These macros have poor error handling and are poorly documented.
8dnl They are intended only for internal use by the Thrift compiler.
9dnl
10dnl @version 2008-02-20
11dnl @license AllPermissive
12dnl
13dnl Copyright (C) 2009 David Reiss
14dnl Copying and distribution of this file, with or without modification,
15dnl are permitted in any medium without royalty provided the copyright
16dnl notice and this notice are preserved.
17
18AC_DEFUN([AX_THRIFT_GEN],
19 [
20 AC_ARG_ENABLE([gen-$1],
21 AC_HELP_STRING([--enable-gen-$1], [enable the $2 compiler @<:@default=$3@:>@]),
22 [ax_thrift_gen_$1="$enableval"],
23 [ax_thrift_gen_$1=$3]
24 )
25 dnl I'd like to run the AM_CONDITIONAL here, but automake likes
26 dnl all AM_CONDITIONALs to be nice and explicit in configure.ac.
27 dnl AM_CONDITIONAL([THRIFT_GEN_$1], [test "$ax_thrift_gen_$1" = "yes"])
28 ])
29
30AC_DEFUN([AX_THRIFT_LIB],
31 [
32 AC_ARG_WITH($1,
33 AC_HELP_STRING([--with-$1], [build the $2 library @<:@default=$3@:>@]),
34 [with_$1="$withval"],
35 [with_$1=$3]
36 )
37 dnl What we do here is going to vary from library to library,
38 dnl so we can't really generalize (yet!).
39 ])