# Process this file with autoconf to produce a configure script. AC_INIT(miniChinput, 0.1.9, bozhang@usc.edu) AC_CONFIG_SRCDIR([src/XIM.h]) AC_CONFIG_HEADER([config.h]) PRGDIR="/lib/Chinput" IMDIR="/lib/Chinput/im" MANDIR="/share/man" DOCDIR="/share/doc" GBLOCALE="zh_CN.GB2312" # Check for OS case "X`uname -s`" in XLinux) os_type="LINUX" ;; XFreeBSD) os_type="FREEBSD" ;; *) AC_MSG_ERROR([Your system is not supported yet.]) ;; esac # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_RANLIB # Checks for header files. AC_PATH_X AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([fcntl.h langinfo.h limits.h locale.h malloc.h stdlib.h string.h sys/param.h]) # Checks for libraries. LDFLAGS="$LDFLAGS -L$x_libraries" AC_CHECK_LIB(X11,XOpenDisplay,,AC_MSG_ERROR(Cannot find X11 libs)) CHINPUT_CFLAGS="-I$x_includes" CHINPUT_LIBS="-L$x_libraries" # Check Xft related headers and libs. tmpar=`find /usr/include /usr/X11R6/include -name Xft.h | sed 's?/X11/Xft/Xft.h??'` TMP_XFT2=`echo "$tmpar"|grep Xft2` TMP_XFT=`echo "$tmpar"|grep -v Xft2` tmpar=`find /usr/include /usr/X11R6/include -name freetype.h | sed 's?/freetype/freetype.h??'` TMP_FREE2=`echo "$tmpar"|grep freetype2` TMP_FREE=`echo "$tmpar"|grep -v freetype2` if test "x$TMP_XFT2" != "x" -a "x$TMP_FREE2" != "x"; then CPPFLAGS="-I$TMP_XFT2 -I$TMP_FREE2 $CPPFLAGS" AC_CHECK_HEADER(X11/Xft/Xft.h,,AC_MSG_ERROR(Something worng about the Xft header file.)) XFT_FREE_H="yes" else if test "x$TMP_XFT" != "x" -a "x$TMP_FREE2" != "x"; then CPPFLAGS="-I$TMP_XFT -I$TMP_FREE2 $CPPFLAGS" AC_CHECK_HEADER(X11/Xft/Xft.h,,AC_MSG_ERROR(Something worng about the Xft header file.)) XFT_FREE_H="yes" else if test "x$TMP_XFT" != "x" -a "x$TMP_FREE" != "x"; then CPPFLAGS="-I$TMP_XFT -I$TMP_FREE $CPPFLAGS" AC_CHECK_HEADER(X11/Xft/Xft.h,,AC_MSG_ERROR(Something worng about the Xft header file.)) XFT_FREE_H="yes" fi fi fi if test "$XFT_FREE_H" = "yes"; then AC_CHECK_LIB(fontconfig,FcConfigCreate,,FontC="no") if test "$FontC" != "no"; then AC_CHECK_LIB(Xft,XftFontOpen,,[Xft="no"]) if test "$Xft" = "no"; then AC_CHECK_LIB(Xft2,XftFontOpen,,Xft="no") fi if test "$Xft" != "no"; then GBLOCALE="zh_CN.GB18030" fi fi fi AC_CHECK_LIB(Imlib, Imlib_init) if test "$os_type" = "LINUX"; then AC_CHECK_LIB(dl, dlopen,,AC_MSG_ERROR(Cannot find dl libs)) else AC_CHECK_LIB(c, dlopen,,AC_MSG_ERROR(Cannot find dl libs)) fi # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_MODE_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_CHECK_MEMBERS([struct stat.st_rdev]) AC_HEADER_TIME AC_TYPE_UID_T # Checks for library functions. AC_FUNC_CHOWN AC_FUNC_ERROR_AT_LINE AC_FUNC_FORK AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_TYPE_SIGNAL AC_FUNC_STAT AC_FUNC_VPRINTF AC_CHECK_FUNCS([alarm atexit bzero dup2 gethostbyaddr gethostbyname gethostname gettimeofday inet_ntoa isascii memmove memset mkdir nl_langinfo setlocale socket strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol uname]) AC_SUBST(PRGDIR) AC_SUBST(DOCDIR) AC_SUBST(IMDIR) AC_SUBST(MANDIR) AC_SUBST(DOCDIR) AC_SUBST(CHINPUT_CFLAGS) AC_SUBST(CHINPUT_LIBS) AC_SUBST(GBLOCALE) AC_CONFIG_FILES([Makefile doc/Makefile doc/man/chinput.1 resource/Chinput.ad resource/Makefile src/Makefile src/config.h src/tips.h src/server/Makefile src/client/Makefile ImmModules/Makefile ImmModules/cce/Makefile ImmModules/cce/inputs/Makefile ImmModules/turbo/Makefile ImmModules/turbo/config.h]) AC_OUTPUT