File: configure.in

package info (click to toggle)
hspell 1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,556 kB
  • sloc: ansic: 2,808; perl: 1,989; makefile: 209; sh: 109; awk: 15
file content (144 lines) | stat: -rw-r--r-- 5,396 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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 Our hash-table code borrowed from TCL stores pointer values, but we want
dnl to store there ints. So we need a type uintptr_t which is an integer
dnl exactly the same size as a pointer. If we don't already have this type
dnl (it is standard in ANSI C's stdint.h), autoconf will try to figure it
dnl out.
AC_TYPE_INTPTR_T

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 libhspell.a"
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 "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 "shared" optional feature: (--enable-shared)
dnl Build a shared library version of libhspell (in addition to the static
dnl library), and compile the hspell executable to use this shared library.
dnl Note that currently, this will only work properly on Linux and gcc (we
dnl do not correctly build shared libraries on different systems).

AC_ARG_ENABLE([shared],
	AC_HELP_STRING([--enable-shared],[Build a shared-library version of
          libhspell, in addition to the static library. Build the hspell
          executable using this shared library.]),
	[ac_opt_shared=$enable_shared], [ac_opt_shared=no])

if test x$ac_opt_shared = xyes
then
	AC_MSG_NOTICE([Shared library building enabled.])
	HSPELL_LIB="libhspell.so.0"
else
	AC_MSG_NOTICE([Shared library building disabled.])
	HSPELL_LIB="libhspell.a"
fi
AC_SUBST(HSPELL_LIB)

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)