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 |
| 10 | dnl @author David Reiss <dreiss@facebook.com> |
| 11 | dnl @version 2008-02-20 |
| 12 | dnl @license AllPermissive |
| 13 | |
| 14 | AC_DEFUN([AX_THRIFT_GEN], |
| 15 | [ |
| 16 | AC_ARG_ENABLE([gen-$1], |
David Reiss | b3483d0 | 2008-03-02 07:00:15 +0000 | [diff] [blame] | 17 | AC_HELP_STRING([--enable-gen-$1], [enable the $2 compiler @<:@default=$3@:>@]), |
David Reiss | add584d | 2008-02-27 01:55:30 +0000 | [diff] [blame] | 18 | [ax_thrift_gen_$1="$enableval"], |
| 19 | [ax_thrift_gen_$1=$3] |
| 20 | ) |
| 21 | dnl I'd like to run the AM_CONDITIONAL here, but automake likes |
| 22 | dnl all AM_CONDITIONALs to be nice and explicit in configure.ac. |
| 23 | dnl AM_CONDITIONAL([THRIFT_GEN_$1], [test "$ax_thrift_gen_$1" = "yes"]) |
| 24 | ]) |
David Reiss | be5ee7c | 2008-03-02 07:00:19 +0000 | [diff] [blame] | 25 | |
| 26 | AC_DEFUN([AX_THRIFT_LIB], |
| 27 | [ |
| 28 | AC_ARG_WITH($1, |
| 29 | AC_HELP_STRING([--with-$1], [build the $2 library @<:@default=$3@:>@]), |
| 30 | [with_$1="$withval"], |
| 31 | [with_$1=$3] |
| 32 | ) |
| 33 | dnl What we do here is going to vary from library to library, |
| 34 | dnl so we can't really generalize (yet!). |
| 35 | ]) |