dnl Process this file with autoconf to produce Hspell's configure script. dnl "wolig.dat" is any file in the source directory, used to check we're in dnl the right directory. AC_INIT(wolig.dat) dnl this alows us to use $(MAKE) in the makefile, even if our make program dnl doesn't support this variable. This requires putting @SET_MAKE@ in the dnl Makefile.in AC_PROG_MAKE_SET AC_PROG_CC dnl AC_PROG_INSTALL dnl Hspell uses the "inline" keyword, always as "static inline". Some old C dnl compilers (such as the one on Solaris 8!) still don't have inline, so we dnl should just replace it by nothing (or use things like __inline__, if that's dnl available). AC_C_INLINE AC_C_CONST dnl TODO: remove -g from CFLAGS and add -s to LDFLAGS AC_PATH_PROG([PERL], [perl]) dnl Check for libraries. AC_CHECK_LIB([z],[gzread], [AC_CHECK_HEADER([zlib.h],[AC_DEFINE(HAVE_ZLIB) LIBS="-lz $LIBS"], [AC_MSG_RESULT([No Zlib header, defaulting to using pipes])])], [AC_MSG_RESULT([No Zlib library, defaulting to using pipes])]) dnl Allow the builder to enable or disable certain features of Hspell, dnl and/or build or not build certain things. dnl Make sure that after running configure with different features enabled, dnl "make clean" is done! AC_MSG_NOTICE([Checking features selected by user (see configure --help)...]) dnl Our TARGETS variable chooses what to compile. Some things are dnl optionally compiled depending on --enable-* paramters to configure. TARGETS="hebrew.wgz.sizes hspell" AC_SUBST(TARGETS) dnl "fatverb" optional feature: (--enable-fatverb) dnl Determines whether or not to build about 150,000 additional rare verb dnl forms (known as objective kinuyim). AC_ARG_ENABLE([fatverb], AC_HELP_STRING([--enable-fatverb],[Allow "objective kinuyim" on all forms of verbs. Because this adds as many as 130,000 correct but rarely-used (in modern texts) inflections, a compile-time option is present for enabling or disabling these forms. The default in this version is not to enable them.]), [ac_opt_fatverb=$enable_fatverb], [ac_opt_fatverb=no]) if test x$ac_opt_fatverb = xyes then AC_MSG_NOTICE([Feature fatverb enabled (adding objective kinuyim to verbs).]) SEDCMD='s/\+//' else AC_MSG_NOTICE([Feature fatverb disabled (no objective kinuyim to verbs).]) SEDCMD='/\+/d' fi AC_SUBST(SEDCMD) dnl "aspell" optional feature: (--enable-aspell) dnl Builds data files - he_affix.dat and he.cwl - needed by Aspell to do dnl spell-checking of Hebrew. AC_ARG_ENABLE([aspell], AC_HELP_STRING([--enable-aspell],[Build data files - he_affix.dat and he.cwl - suitable for use as Aspell 0.6 dictionary for Hebrew.]), [ac_opt_aspell=$enable_aspell], [ac_opt_aspell=no]) if test x$ac_opt_aspell = xyes then AC_MSG_NOTICE([Feature aspell enabled (building he_affix.dat, he.cwl).]) TARGETS="$TARGETS aspell" else AC_MSG_NOTICE([Feature aspell disabled (not building aspell files).]) fi dnl "linginfo" optional feature: (--enable-linginfo) dnl Include a full morphological analyzer in "hspell -l". Note that this dnl slows down the build and makes the installation about 4 times larger, dnl but it doesn't slow Hspell if "-l" isn't used. AC_ARG_ENABLE([linginfo], AC_HELP_STRING([--enable-linginfo],[Include a full morphological analyzer in "hspell -l", explaining how each correct word could be derived. This slows down the build and makes installation about 4 times larger, but doesn't slow Hspell if "-l" isn't used.]), [ac_opt_linginfo=$enable_linginfo], [ac_opt_linginfo=no]) EXTRAOBJECTS= if test x$ac_opt_linginfo = xyes then AC_MSG_NOTICE([Feature linginfo enabled (morphological analyzer).]) AC_DEFINE(USE_LINGINFO) EXTRAOBJECTS="linginfo.o" # note that linginfo_data should be done first, because it currently builds # some of the normal things (like hebrew.wgz) in a different way (using # pack-desc, not pmerge). This is ugly, and should be fixed. TARGETS="linginfo_data $TARGETS" else AC_MSG_NOTICE([Feature linginfo disabled (no morphological analyzer).]) fi AC_SUBST(EXTRAOBJECTS) dnl "test" optional feature: (--enable-test) dnl Compile a testing binary. Currently the only thing that this does is dnl to set the default dictionary directory to the current directory, dnl instead of the normal $SHARE/hebrew.wgz location. AC_ARG_ENABLE([test], AC_HELP_STRING([--enable-test],[Compile testing binary, that uses a dictionary in the current directory instead of the installed one. Not recommended for anyone but Hspell developers.]), [ac_opt_test=$enable_test], [ac_opt_test=no]) if test x$ac_opt_test = xyes then AC_MSG_NOTICE([Feature test enabled (USES DICTIONARY IN CURRENT DIRECTORY!!!).]) DICTBASE='./hebrew.wgz' else DICTBASE='$(SHARE)/hebrew.wgz' fi AC_SUBST(DICTBASE) AC_OUTPUT(Makefile)