1 # 2 # CDDL HEADER START 3 # 4 # The contents of this file are subject to the terms of the 5 # Common Development and Distribution License (the "License"). 6 # You may not use this file except in compliance with the License. 7 # 8 # You can obtain a copy of the license at sunpinyin/OPENSOLARIS.LICENSE 9 # or http://www.opensolaris.org/os/licensing. 10 # See the License for the specific language governing permissions 11 # and limitations under the License. 12 # 13 # When distributing Covered Code, include this CDDL HEADER in each 14 # file and include the License file at sunpinyin/OPENSOLARIS.LICENSE. 15 # If applicable, add the following below this CDDL HEADER, with the 16 # fields enclosed by brackets "[]" replaced with your own identifying 17 # information: Portions Copyright [yyyy] [name of copyright owner] 18 # 19 # CDDL HEADER END 20 # 21 # Copyright 2007 Sun Microsystems, Inc. All rights reserved. 22 # Use is subject to license terms. 23 # 24 # Process this file with autoconf to produce a configure script. 25 AC_INIT(sunpinyin_data, 1.0) 26 AC_CANONICAL_SYSTEM() 27 AM_INIT_AUTOMAKE 28 AC_CONFIG_SRCDIR(src/slm/slm.cpp) 29 AM_CONFIG_HEADER(config.h) 30 AM_CONDITIONAL(DEBUG, test "$enable_debug" = yes) 31 32 dnl AC_C_BIGENDIAN defines WORDS_BIGENDIAN if it is true by default 33 AC_C_BIGENDIAN 34 35 case "${host_os}" in 36 *linux*) my_host_os=linux;; 37 *solaris*) my_host_os=solaris;; 38 *darwin*) my_host_os=mac;; 39 *beos*|*haiku*) my_host_os=beos;; 40 esac 41 42 AC_LINK_FILES(src/config/${my_host_os}.h, src/host_os.h) 43 44 RAW_DATA_DIR="raw" 45 AC_SUBST(RAW_DATA_DIR) 46 47 SWAP_DATA_DIR="swap" 48 AC_SUBST(SWAP_DATA_DIR) 49 50 RESULT_DATA_DIR="data" 51 AC_SUBST(RESULT_DATA_DIR) 52 53 SOURCE_DIR="src" 54 AC_SUBST(SOURCE_DIR) 55 56 SLM_SRC_DIR="src/slm" 57 AC_SUBST(SLM_SRC_DIR) 58 59 LEXICON_SRC_DIR="src/lexicon" 60 AC_SUBST(LEXICON_SRC_DIR) 61 62 # Checks for programs. 63 AC_PROG_CC 64 AC_PROG_CPP 65 AC_PROG_CXX 66 AC_PROG_INSTALL 67 AC_PROG_LIBTOOL 68 69 # Checks for libraries. 70 71 # Checks for header files. 72 AC_PATH_X 73 AC_HEADER_STDC 74 AC_CHECK_HEADERS(limit.h assert.h getopt.h fcntl.h locale.h stdlib.h string.h unistd.h wchar.h sys/mman.h) 75 76 # Checks for typedefs, structures, and compiler characteristics. 77 AC_C_CONST 78 AC_C_INLINE 79 AC_TYPE_SIZE_T 80 81 # Checks for library functions. 82 AC_FUNC_MMAP 83 AC_CHECK_FUNCS(getopt_long get_opt memset setlocale strdup strlen strcpy log2 exp2) 84 85 have_iconv=no 86 AC_MSG_CHECKING(for iconv) 87 for iconv_lib in none iconv ; do 88 save_LIBS="$LIBS" 89 if test "$iconv_lib" != "none" ; then 90 LIBS="$LIBS -l$iconv_lib" 91 fi 92 AC_TRY_LINK( 93 [#include <iconv.h>], 94 [iconv_t ic = iconv_open("UTF-16", "UTF-8")], 95 have_iconv=yes, 96 have_iconv=no) 97 LIBS="$save_LIBS" 98 if test $have_iconv = yes; then 99 AC_DEFINE(HAVE_ICONV_H, 1, [Define if you have the 'iconv.h'.]) 100 if test "$iconv_lib" != "none" ; then 101 LIBS="$LIBS -l$iconv_lib" 102 fi 103 break 104 fi 105 done 106 AC_MSG_RESULT($have_iconv) 107 if test "x$have_iconv" = "xno" ; then 108 AC_MSG_WARN([*** iconv library not found, "pytrie_gen" can't work properly.]) 109 fi 110 111 #AC_CONFIG_FILES() 112 AC_OUTPUT(Makefile build/Makefile doc/Makefile) 113