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