pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 1 | # Autoconf input file |
| 2 | # $Id$ |
| 3 | |
| 4 | # AC - autoconf |
| 5 | # FB - facebook |
| 6 | |
David Reiss | 16f5cd1 | 2009-03-30 22:52:51 +0000 | [diff] [blame] | 7 | # |
| 8 | # Licensed to the Apache Software Foundation (ASF) under one |
| 9 | # or more contributor license agreements. See the NOTICE file |
| 10 | # distributed with this work for additional information |
| 11 | # regarding copyright ownership. The ASF licenses this file |
| 12 | # to you under the Apache License, Version 2.0 (the |
| 13 | # "License"); you may not use this file except in compliance |
| 14 | # with the License. You may obtain a copy of the License at |
| 15 | # |
| 16 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 17 | # |
| 18 | # Unless required by applicable law or agreed to in writing, |
| 19 | # software distributed under the License is distributed on an |
| 20 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 21 | # KIND, either express or implied. See the License for the |
| 22 | # specific language governing permissions and limitations |
| 23 | # under the License. |
| 24 | # |
| 25 | |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 26 | ######################################################################### |
| 27 | # DO NOT TOUCH EXCEPT TO CHANGE REV# IN AC_INIT |
| 28 | |
| 29 | AC_PREREQ(2.52) |
| 30 | AC_INIT([libfb303],[20080209]) |
| 31 | #AC_CONFIG_AUX_DIR([/usr/share/automake-1.9]) |
| 32 | # To install locally |
| 33 | FB_INITIALIZE([localinstall]) |
| 34 | AC_PREFIX_DEFAULT([/usr/local]) |
| 35 | |
| 36 | ############################################################################ |
| 37 | # User Configurable. Change With CAUTION! |
| 38 | # User can include custom makefile rules. Uncomment and update only <name> in PRODUCT_MK. |
| 39 | # Include where appropriate in any Makefile.am as @PRODUCT_MK@ |
| 40 | |
| 41 | #PRODUCT_MK="include ${EXTERNAL_PATH}/shared/build/<name>.mk" |
| 42 | |
| 43 | # Default path to external Facebook components and shared build toools I.e fb303 etc. |
| 44 | # To point to other locations set environment variable EXTERNAL_PATH. |
| 45 | # To change the current default you must change bootstrap.sh. |
| 46 | FB_WITH_EXTERNAL_PATH([`pwd`]) |
| 47 | |
David Reiss | 7c28b33 | 2008-09-20 00:14:01 +0000 | [diff] [blame] | 48 | AC_ARG_VAR([PY_PREFIX], [Prefix for installing Python modules. |
| 49 | (Normal --prefix is ignored for Python because |
| 50 | Python has different conventions.) |
| 51 | Default = "/usr"]) |
| 52 | AS_IF([test "x$PY_PREFIX" = x], [PY_PREFIX="/usr"]) |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 53 | |
| 54 | ########################################################################## |
| 55 | # User Configurable |
| 56 | |
| 57 | # Pre-defined macro to set opt build mode. Run with --disable-shared option to turn off optimization. |
| 58 | FB_ENABLE_DEFAULT_OPT_BUILD |
| 59 | |
| 60 | # Predefined macro to set static library mode. Run with --disable-static option to turn off static lib mode. |
| 61 | FB_ENABLE_DEFAULT_STATIC |
| 62 | |
| 63 | # Personalized feature generator. Creates defines/conditionals and --enable --disable command line options. |
| 64 | # FB_ENABLE_FEATURE([FEATURE], [feature]) OR FB_ENABLE_FEATURE([FEATURE], [feature], [\"<value>\"]) |
| 65 | |
| 66 | # Example: Macro supplies -DFACEBOOK at compile time and "if FACEBOOK endif" capabilities. |
| 67 | |
| 68 | # Personalized path generator Sets default paths. Provides --with-xx=DIR options. |
| 69 | # FB_WITH_PATH([<var>_home], [<var>path], [<default location>] |
| 70 | |
| 71 | # Example: sets $(thrift_home) variable with default path set to /usr/local. |
| 72 | FB_WITH_PATH([thrift_home], [thriftpath], [/usr/local]) |
David Reiss | 7c28b33 | 2008-09-20 00:14:01 +0000 | [diff] [blame] | 73 | |
Jake Farrell | 60723b8 | 2013-03-23 22:38:48 -0400 | [diff] [blame] | 74 | AX_THRIFT_LIB(cpp, [C++], yes) |
| 75 | have_cpp=no |
| 76 | if test "$with_cpp" = "yes"; then |
| 77 | # Require boost 1.40.0 or later |
| 78 | AX_BOOST_BASE([1.40.0]) |
| 79 | if test "x$succeeded" = "xyes"; then |
| 80 | have_cpp="yes" |
| 81 | fi |
| 82 | fi |
| 83 | AM_CONDITIONAL([WITH_CPP], [test "$have_cpp" = "yes"]) |
| 84 | |
| 85 | AX_THRIFT_LIB(java, [Java], yes) |
| 86 | if test "$with_java" = "yes"; then |
| 87 | AX_JAVAC_AND_JAVA |
| 88 | AC_PATH_PROG([ANT], [ant]) |
| 89 | AX_CHECK_ANT_VERSION($ANT, 1.7) |
| 90 | AC_SUBST(CLASSPATH) |
| 91 | AC_SUBST(ANT_FLAGS) |
| 92 | if test "x$JAVAC" != "x" && test "x$JAVAC" != "x" && test "x$ANT" != "x" ; then |
| 93 | have_java="yes" |
| 94 | fi |
| 95 | fi |
| 96 | AM_CONDITIONAL(WITH_JAVA, [test "$have_java" = "yes"]) |
| 97 | |
| 98 | AX_THRIFT_LIB(php, [PHP], yes) |
| 99 | if test "$with_php" = "yes"; then |
| 100 | AC_PATH_PROG([PHP], [php]) |
| 101 | if test "x$PHP" != "x" && test "x$PHP" != "x:" ; then |
| 102 | have_php="yes" |
| 103 | fi |
| 104 | fi |
| 105 | AM_CONDITIONAL(WITH_PHP, [test "$have_php" = "yes"]) |
| 106 | |
| 107 | AX_THRIFT_LIB(python, [Python], yes) |
| 108 | if test "$with_python" = "yes"; then |
| 109 | AM_PATH_PYTHON(2.4,, :) |
| 110 | if test "x$PYTHON" != "x" && test "x$PYTHON" != "x:" ; then |
| 111 | have_python="yes" |
| 112 | fi |
| 113 | fi |
| 114 | AM_CONDITIONAL(WITH_PYTHON, [test "$have_python" = "yes"]) |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 115 | |
| 116 | # Generates Makefile from Makefile.am. Modify when new subdirs are added. |
| 117 | # Change Makefile.am also to add subdirectly. |
| 118 | AC_CONFIG_FILES(Makefile cpp/Makefile py/Makefile) |
| 119 | |
Jake Farrell | f5bae90 | 2012-05-18 04:14:45 +0000 | [diff] [blame] | 120 | # Check for headers |
| 121 | AC_CHECK_HEADERS([inttypes.h]) |
| 122 | AC_CHECK_HEADERS([netinet/in.h]) |
| 123 | |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 124 | ############################################################################ |
| 125 | # DO NOT TOUCH. |
| 126 | |
| 127 | AC_SUBST(PRODUCT_MK) |
| 128 | AC_OUTPUT |
| 129 | |
| 130 | ############################################################################# |
| 131 | ######### FINISH ############################################################ |
| 132 | |
| 133 | echo "EXTERNAL_PATH $EXTERNAL_PATH" |
Jake Farrell | 60723b8 | 2013-03-23 22:38:48 -0400 | [diff] [blame] | 134 | echo |
| 135 | echo "Building C++ Library ......... : $have_cpp" |
| 136 | echo "Building Java Library ........ : $have_java" |
| 137 | echo "Building Python Library ...... : $have_python" |
| 138 | echo "Building PHP Library ......... : $have_php" |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 139 | |
| 140 | |
| 141 | # |
| 142 | # NOTES FOR USER |
| 143 | # Short cut to create conditional flags. |
| 144 | #enable_facebook="yes" |
| 145 | #AM_CONDITIONAL([FACEBOOK], [test "$enable_facebook" = yes]) |
| 146 | #enable_hdfs="yes" |
| 147 | #AM_CONDITIONAL([HDFS], [test "$enable_hdfs" = yes]) |
| 148 | |
| 149 | # Enable options with --enable and --disable configurable. |
| 150 | #AC_MSG_CHECKING([whether to enable FACEBOOK]) |
| 151 | #FACEBOOK="" |
| 152 | #AC_ARG_ENABLE([facebook], |
| 153 | # [ --enable-facebook Enable facebook.], |
| 154 | # [ |
| 155 | # ENABLE_FACEBOOK=$enableval |
| 156 | # ], |
| 157 | # [ |
| 158 | # ENABLE_FACEBOOK="no" |
| 159 | # ] |
| 160 | #) |
| 161 | #AM_CONDITIONAL([FACEBOOK], [test "$ENABLE_FACEBOOK" = yes]) |
| 162 | #AC_MSG_RESULT($ENABLE_FACEBOOK) |
| 163 | |