]> andersk Git - moira.git/blame - configure.in
Command line printer manipulation client, and build goo.
[moira.git] / configure.in
CommitLineData
ea0caf4a 1AC_INIT(patchlevel.h)
2
3dnl On Athena at least, many of the packages (krb, zephyr, hesiod, etc)
4dnl will all be in /usr/athena... this hack lets us not end up with 10
5dnl copies of -I/usr/athena/include -L/usr/athena/lib in our command lines
6AC_DEFUN(MR_EXTEND, [
7 case $$1 in
8 *$2*) ;;
9 *) $1=$2\ $$1 ;;
10 esac
11])
12
3595c6c0 13AC_CANONICAL_HOST
0bec79fd 14# SO_LDFLAGS setting below is a great big ick.
15# But it beats sucking in libtool for one small part of the source tree.
3595c6c0 16case $host_os in
17solaris*)
18 short_os=solaris
0bec79fd 19 SO_LDFLAGS="-G"
3595c6c0 20 ;;
21irix*)
22 short_os=irix
0bec79fd 23 SO_LDFLAGS="-shared"
3595c6c0 24 ;;
25linux*)
26 short_os=linux
0bec79fd 27 SO_LDFLAGS="-shared"
3595c6c0 28 ;;
29esac
0bec79fd 30AC_SUBST(SO_LDFLAGS)
3595c6c0 31
ea0caf4a 32dnl Define for both C and Pro*C
33AC_DEFUN(MR_DEFINE, [
34 AC_DEFINE($1)
35 MR_EXTEND(PRO_C_DEFS, DEFINE=$1)
36])
37
38dnl Add to include path for both C and Pro*C
39AC_DEFUN(MR_INCLUDE, [
40 MR_EXTEND(CPPFLAGS, -I$1)
41 MR_EXTEND(PRO_C_INCLUDES, INCLUDE=$1)
42])
43
44dnl Add to lib path
45AC_DEFUN(MR_LIBS, [MR_EXTEND(LIBPATH, -L$1)])
46
47AC_PROG_CC
48AC_PROG_INSTALL
49AC_PROG_RANLIB
a816420b 50AC_PROG_LIBTOOL
ea0caf4a 51AC_PROG_MAKE_SET
52
53if test "$athena" = true; then
54 enable_athena=yes
1944209a 55 prefix=/afs/.athena.mit.edu/system/moira
ea0caf4a 56 bindir=$prefix/arch/$ATHENA_SYS/bin
a816420b 57 libdir=$prefix/arch/$ATHENA_SYS/lib
ea0caf4a 58 sbindir=$bindir
618b3834 59 MR_INCLUDE(/usr/athena/include)
618b3834 60 MR_LIBS(/usr/athena/lib)
ea0caf4a 61fi
62
63# We currently just don't support changing this
64mrbindir=/moira/bin
65AC_SUBST(mrbindir)
66
67# Athena-local policy decisions
68AC_MSG_CHECKING(for Athena)
69AC_ARG_ENABLE(athena,
70 [ --enable-athena Enable Athena-specific policy decisions],
71 , [if test "$athena" = true; then
72 enableval=yes
73 else
74 enableval=no
75 fi])
76AC_MSG_RESULT($enableval)
77if test "$enableval" = yes; then
78 MR_DEFINE(ATHENA)
79fi
80
81# Networking libraries
82AC_CHECKING(network libraries...)
83AC_CHECK_FUNC(gethostbyname, :,
84 AC_CHECK_LIB(nsl, gethostbyname, ,
85 AC_CHECK_LIB(resolv, gethostbyname)))
86AC_CHECK_FUNC(socket, :,
87 AC_CHECK_LIB(socket, socket, ,
88 AC_CHECK_LIB(socket, socket,
89 LIBS="-lsocket -lnsl $LIBS", :,
90 -lnsl)))
91
7f7f279f 92# com_err (required, but can be built)
93AC_MSG_CHECKING(for com_err)
94AC_ARG_WITH(com_err,
95 [ --with-com_err=PREFIX Specify location of com_err],
96 [AC_MSG_RESULT($withval)
97 if test $withval = "no"; then
98 AC_MSG_ERROR(com_err is required for Moira)
99 fi
100 if test $withval != "yes"; then
101 MR_INCLUDE($withval/include)
102 MR_LIBS($withval/lib)
103 fi
104 COMPILE_ET=compile_et],
105 [AC_MSG_RESULT(util/et)
7f7f279f 106 MR_INCLUDE(`pwd`/util/et)
107 MR_LIBS(`pwd`/util/et)
108 COMPILE_ET=`pwd`/util/et/compile_et
00274452 109 AC_CONFIG_SUBDIRS(util/et)])
7f7f279f 110AC_SUBST(COM_ERR_SUBDIR)
111AC_SUBST(COMPILE_ET)
112
cb974713 113AC_CHECK_LIB(k5crypto, main, crypto="k5crypto",
114 [AC_CHECK_LIB(crypto, main, crypto="crypto")])
115
116# Kerberos (Kerberos 4 optional, Kerberos 5 required)
ea0caf4a 117AC_MSG_CHECKING(for Kerberos 4)
118AC_ARG_WITH(krb4,
119 [ --with-krb4=PREFIX Specify location of krb4],
120 [krb4="$withval"], [krb4=no])
121AC_MSG_RESULT($krb4)
cb974713 122if test "$krb4" != no; then
123 if test "$krb4" != yes; then
124 MR_INCLUDE($krb4/include)
125 if test -d "$krb4/include/kerberosIV"; then
126 MR_INCLUDE($krb4/include/kerberosIV)
127 fi
128 MR_LIBS($krb4/lib)
129 elif test -d /usr/include/kerberosIV; then
130 MR_INCLUDE(/usr/include/kerberosIV)
ea0caf4a 131 fi
cb974713 132 MR_DEFINE(HAVE_KRB4)
133 AC_CHECK_LIB(krb4, krb_rd_req,
134 [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -l${crypto} -lresolv"],
135 [AC_CHECK_LIB(krb, krb_rd_req,
136 [KRB4_LIBS="-lkrb -ldes"],
137 [AC_MSG_ERROR(Kerberos 4 libraries not found)],
138 $LIBPATH -ldes)],
139 $LIBPATH -ldes425 -lkrb5 -l${crypto} -lcom_err -lresolv)
ea0caf4a 140fi
ea0caf4a 141
7f7f279f 142AC_MSG_CHECKING(for Kerberos 5)
143AC_ARG_WITH(krb5,
cb974713 144 [ --with-krb5=PREFIX Specify location of krb5],
7f7f279f 145 [krb5="$withval"], [krb5=no])
146AC_MSG_RESULT($krb5)
147if test "$krb5" != no; then
148 REG_SVR_DEFS=-DKRB5
149 if test "$krb5" != yes; then
150 REG_SVR_INCLUDES=-I$krb5/include
151 REG_SVR_LIBS=-L$krb5/lib
cb974713 152 MR_INCLUDE($krb5/include)
153 MR_LIBS($krb5/lib)
7f7f279f 154 fi
cb974713 155 MR_DEFINE(HAVE_KRB5)
156 KRB5_LIBS="-lkrb5 -l${crypto} -lcom_err -lresolv"
157 REG_SVR_LIBS="$REG_SVR_LIBS -lkadm5clnt -lgssapi_krb5 -lgssrpc -lkrb5 -l${crypto} -lresolv"
7f7f279f 158else
159 REG_SVR_DEFS=-DKRB4
160 REG_SVR_LIBS=-lkadm
161fi
162AC_SUBST(REG_SVR_DEFS)
163AC_SUBST(REG_SVR_INCLUDES)
164AC_SUBST(REG_SVR_LIBS)
33567bea 165
ea0caf4a 166# Hesiod support
167AC_MSG_CHECKING(for Hesiod)
168AC_ARG_WITH(hesiod,
169 [ --with-hesiod=PREFIX Specify location of Hesiod],
170 [hesiod="$withval"], [hesiod=no])
171AC_MSG_RESULT($hesiod)
172if test "$hesiod" != no; then
173 if test "$hesiod" != yes; then
174 MR_INCLUDE($hesiod/include)
175 MR_LIBS($hesiod/lib)
176 fi
177 AC_CHECK_FUNC(res_send, :,
178 AC_CHECK_LIB(resolv, res_send))
179 AC_CHECK_LIB(hesiod, hes_resolve, :,
180 [AC_MSG_ERROR(Hesiod library not found)],
181 $LIBPATH $LIBS)
182 MR_DEFINE(HAVE_HESIOD)
183fi
184
185# Zephyr support
186AC_MSG_CHECKING(for Zephyr)
187AC_ARG_WITH(zephyr,
188 [ --with-zephyr=PREFIX Specify location of Zephyr],
189 [zephyr="$withval"], [zephyr=no])
190AC_MSG_RESULT($zephyr)
191if test "$zephyr" != no; then
192 if test "$zephyr" != yes; then
193 MR_INCLUDE($zephyr/include)
194 MR_LIBS($zephyr/lib)
195 fi
196 AC_CHECK_LIB(zephyr, ZInitialize, :,
197 [AC_MSG_ERROR(Zephyr library not found)],
cb974713 198 $LIBPATH $KRB4_LIBS $KRB5_LIBS -lcom_err)
ea0caf4a 199 MR_DEFINE(HAVE_ZEPHYR)
200fi
201
33567bea 202# RSAREF support (default: build util/rsaref if present)
203AC_MSG_CHECKING(for RSAREF)
204AC_ARG_WITH(rsaref,
205 [ --with-rsaref=PREFIX Specify location of RSAREF],
206 [rsaref="$withval"
207 RSAREF_CPPFLAGS="-I$rsaref/include"
208 RSAREF_LIBS="$rsaref/lib/rsaref.a"],
209 RSAREF_SUBDIRS=reg_svr
210 [if test -d $srcdir/util/rsaref; then
211 rsaref=$srcdir/util/rsaref
212 RSAREF_SUBDIRS="util/rsaref reg_svr"
213 RSAREF_OUTPUT_FILES="util/rsaref/Makefile"
214 # autoconf can't deal with creating util/rsaref if util doesn't exist
215 if test ! -d util; then
216 mkdir util
217 fi
46fa38eb 218 RSAREF_CPPFLAGS='-I$(SRCTOP)/util/rsaref'
33567bea 219 RSAREF_LIBS='$(BUILDTOP)/util/rsaref/rsaref.a'
3fb6166b 220 RSAREF_LIBDEP='$(BUILDTOP)/util/rsaref/rsaref.a'
33567bea 221 else
222 rsaref=no
223 fi])
224AC_MSG_RESULT($rsaref)
225if test "$rsaref" != no; then
226 MR_DEFINE(HAVE_RSAREF)
227fi
228AC_SUBST(RSAREF_CPPFLAGS)
229AC_SUBST(RSAREF_LIBS)
230AC_SUBST(RSAREF_SUBDIRS)
3fb6166b 231AC_SUBST(RSAREF_LIBDEP)
33567bea 232
ea0caf4a 233# Oracle (default: yes, if $ORACLE_HOME is set)
234AC_MSG_CHECKING(for Oracle)
235AC_ARG_WITH(oracle,
236 [ --with-oracle=PREFIX Specify location of Oracle (for server)],
237 [oracle="$withval"],
238 [if test -n "$ORACLE_HOME" -a -d "$ORACLE_HOME"; then
239 oracle=$ORACLE_HOME
240 else
241 oracle=no
242 fi])
243AC_MSG_RESULT($oracle)
244if test "$oracle" != no; then
cd357ef5 245 AC_MSG_CHECKING(Pro*C version)
246 ORACLE_HOME=$oracle release=`$ORACLE_HOME/bin/proc | awk '/Release/ {print $3;}'`
247 AC_MSG_RESULT($release)
248 case $release in
249 2.0.6.0.0)
250 SQL_LIBS="-L$oracle/lib -lsql $oracle/lib/osntab.o -lsqlnet -lora -lsqlnet -lnlsrtl -lcv6 -lcore -lnlsrtl -lcore -lm"
251 ;;
7e38e77c 252 2.2.4.0.0)
cd357ef5 253 SQL_LIBS="-L$oracle/lib -lclntsh -lxa -lsql -lsqlnet -lncr -lsqlnet -lclient -lcommon -lgeneric -lsqlnet -lncr -lsqlnet -lclient -lcommon -lgeneric -lepc -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 -lcore3 -lnlsrtl3 `cat $oracle/rdbms/lib/sysliblist` -lm -lthread"
254 ;;
00274452 255 8.1.7.4.0)
dc02aea5 256 SQL_LIBS="-L$oracle/lib -lclntsh `cat $oracle/lib/sysliblist` -R$oracle/lib -laio -lm -lthread"
7e38e77c 257 ;;
00274452 258 10.2.0.2.0)
259 SQL_LIBS="-L$oracle/lib32 -lclntsh `cat $oracle/lib32/ldflags` `cat $oracle/lib32/sysliblist` -R$oracle/lib32 -laio -lposix4 -lm -lthread"
260 ;;
261 *)
262 AC_MSG_ERROR(Unsupported Oracle release)
263 ;;
cd357ef5 264 esac
ea0caf4a 265 SVRSUBDIRS='$(SVRDIRS)'
ac1784ed 266 SERVER_OUTPUT_FILES="db/Makefile server/Makefile backup/Makefile dbck/Makefile dcm/Makefile gen/Makefile incremental/Makefile incremental/mailman/Makefile reg_svr/Makefile regtape/Makefile"
ea0caf4a 267 PRO_C=$oracle/bin/proc
268 PRO_C_OPTS=CODE=ANSI_C
00274452 269 PRO_C_DEFS="DEFINE=_PROC_ DEFINE=__sparc $PRO_C_DEFS"
ea0caf4a 270fi
271AC_SUBST(PRO_C)
272AC_SUBST(PRO_C_DEFS)
273AC_SUBST(PRO_C_INCLUDES)
274AC_SUBST(PRO_C_OPTS)
275AC_SUBST(SQL_LIBS)
276AC_SUBST(SVRSUBDIRS)
277
3595c6c0 278# Java support, for webmoira
279AC_MSG_CHECKING(for Java)
280AC_ARG_WITH(java,
281 [ --with-java=PREFIX Specify location of Java libs and headers],
282 [ java="$withval"],
283 [if test -n "$JAVA_HOME" -a -d "$JAVA_HOME"; then
284 java=$JAVA_HOME
285 else
286 java=no
287 fi])
288AC_MSG_RESULT($java)
289if test "$java" != no; then
290 if test "$java" != yes; then
291 JAVA_CPPFLAGS="-I$java/include -I$java/include/$short_os"
292 fi
293 MR_DEFINE(HAVE_JAVA)
294
295 WEBMOIRA_SUBDIRS="webmoira"
296 WEBMOIRA_OUTPUT_FILES="webmoira/Makefile"
297fi
298AC_SUBST(JAVA_CPPFLAGS)
a5a4b554 299AC_SUBST(WEBMOIRA_SUBDIRS)
3595c6c0 300
9b1f5e48 301# LDAP support
302AC_MSG_CHECKING(for LDAP)
303AC_ARG_WITH(ldap,
304 [ --with-ldap=PREFIX Specify location of LDAP libs (for server)],
305 [ ldap="$withval"],
306 [if test -n "$LDAP_HOME" -a -d "$LDAP_HOME"; then
307 ldap=$LDAP_HOME
308 else
309 ldap=no
310 fi])
311AC_MSG_RESULT($ldap)
312if test "$ldap" != no -a "$oracle" != no; then
313 if test "$ldap" != yes; then
314 LDAP_CPPFLAGS="-I$ldap/include"
315 LDAP_LIBS="-L$ldap/lib"
316 fi
317 MR_DEFINE(HAVE_LDAP)
318
87db79ab 319 WINAD_SUBDIRS="winad ldap"
320 WINAD_OUTPUT_FILES="incremental/winad/Makefile incremental/ldap/Makefile"
9b1f5e48 321fi
322AC_SUBST(LDAP_CPPFLAGS)
323AC_SUBST(LDAP_LIBS)
324AC_SUBST(WINAD_SUBDIRS)
325
ea0caf4a 326# AFS support
327AC_MSG_CHECKING(for AFS)
328AC_ARG_WITH(afs,
329 [ --with-afs=PREFIX Specify location of AFS libs (for server)],
330 [afs="$withval"], [afs=no])
331AC_MSG_RESULT($afs)
332if test "$afs" != no -a "$oracle" != no; then
333 if test "$afs" != yes; then
334 AFS_CPPFLAGS="-I$afs/include -I$afs/include/afs -I$afs/include/rx"
335 AFS_PRO_C_INCLUDES="INCLUDE=$afs/include INCLUDE=$afs/include/afs INCLUDE=$afs/include/rx"
336 AFS_LIBS="-L$afs/lib -L$afs/lib/afs"
337 AFS_DIR=$afs
338 fi
ea0caf4a 339 AC_CHECK_LIB(sys, pioctl, :,
340 [AC_MSG_ERROR(AFS libraries not found)],
00274452 341 $AFS_LIBS -lrx -llwp -lsys -lafsutil)
ea0caf4a 342 MR_DEFINE(HAVE_AFS)
9ed720ef 343
9b1f5e48 344 AFS_SUBDIRS="afs"
345 AFS_OUTPUT_FILES="incremental/afs/Makefile"
9ed720ef 346 if test -d $srcdir/afssync; then
9b1f5e48 347 AFS_SYNCDIR="afssync"
9ed720ef 348 AFS_OUTPUT_FILES="$AFS_OUTPUT_FILES afssync/Makefile"
349 fi
ea0caf4a 350fi
351AC_SUBST(AFS_CPPFLAGS)
352AC_SUBST(AFS_PRO_C_INCLUDES)
353AC_SUBST(AFS_LIBS)
ea0caf4a 354AC_SUBST(AFS_DIR)
9ed720ef 355AC_SUBST(AFS_SUBDIRS)
9b1f5e48 356AC_SUBST(AFS_SYNCDIR)
ea0caf4a 357
358# GNU readline
359AC_CHECKING(for GNU readline...)
360AC_ARG_WITH(readline,
361 [ --with-readline=PREFIX Specify location of GNU readline],
ee85084d 362 [readline="$withval"; AC_MSG_RESULT($withval)],
363 [AC_CHECK_LIB(readline, readline, [readline=yes],
364 [if test "$athena" = true; then
365 unset ac_cv_lib_readline_readline
366 AC_CHECK_LIB(readline, readline, [readline=/mit/gnu], :,
367 -L/mit/gnu/lib -ltermcap)
368 fi],
369 -ltermcap)])
ea0caf4a 370if test "$readline" != no; then
371 if test "$readline" != yes; then
c5c5a18d 372 READLINE_CPPFLAGS="-I$readline/include"
ee85084d 373 READLINE_LIBS="-L$readline/lib"
ea0caf4a 374 fi
ee85084d 375 READLINE_CPPFLAGS="$READLINE_CPPFLAGS -DHAVE_READLINE"
376 READLINE_LIBS="$READLINE_LIBS -lreadline -ltermcap"
ea0caf4a 377fi
378AC_SUBST(READLINE_CPPFLAGS)
379AC_SUBST(READLINE_LIBS)
380
381# Curses
382curses=curses
383AC_CHECKING(for curses)
384AC_CHECK_LIB(curses, main, :, AC_CHECK_LIB(ncurses, main, curses=ncurses))
385if test -n "$curses"; then
386 OLDLIBS=$LIBS
387 LIBS=-l$curses
388 AC_CHECKING(if curses needs termcap)
389 dnl we need to use AC_TRY_RUN because under NetBSD, the program will
390 dnl link with just -lcurses, but then fail with a runtime linker error
391 dnl because you didn't use -ltermcap
392 AC_TRY_RUN([#include <curses.h>
393 main(int argc, char **argv)
394 {
395 initscr();
396 endwin();
397 return 0;
398 }], [CURSES_LIBS="-l$curses"],
399 LIBS="-l$curses -ltermcap"
400 AC_TRY_RUN([#include <curses.h>
401 main(int argc, char **argv)
402 {
403 initscr();
404 endwin();
405 return 0;
406 }], [CURSES_LIBS="-l$curses -ltermcap"],
407 :, :),
408 :)
409 LIBS=$OLDLIBS
410fi
411if test -n "$CURSES_LIBS"; then
412 OLDLIBS=$LIBS
413 LIBS=$CURSES_LIBS
414 AC_TRY_LINK([#include <curses.h>],[WINDOW *w; getmaxx(w);],
415 :,
416 AC_TRY_COMPILE([#include <curses.h>],[WINDOW *w; w->_maxx;],
417 [CURSES_CPPFLAGS="-D'getmaxx(w)=w->_maxx'"],
418 [CURSES_CPPFLAGS="-D'getmaxx(w)=w->maxx'"]))
4753fa79 419 AC_TRY_LINK([#include <curses.h>],[newterm(NULL, NULL, NULL);],
420 [CURSES_CPPFLAGS="$CURSES_CPPFLAGS -DCURSES_HAS_NEWTERM"])
ea0caf4a 421 LIBS=$OLDLIBS
422 CURSES_CPPFLAGS="-DHAVE_CURSES $CURSES_CPPFLAGS"
423 CURSES_SUBDIRS='$(CURSES_SUBDIRS)'
424else
425 AC_MSG_WARN(Couldn't find -lcurses)
426fi
427AC_SUBST(CURSES_CPPFLAGS)
428AC_SUBST(CURSES_LIBS)
429AC_SUBST(CURSES_SUBDIRS)
430
431
83a0db38 432AC_CHECK_FUNCS(getusershell strlcpy strlcat uname strvis)
533bacb3 433
434AC_CHECK_FUNC(sigaction, AC_DEFINE(HAVE_POSIX_SIGNALS))
435
7674bbe4 436AC_CHECK_HEADERS(unistd.h getopt.h)
437
438AC_CHECK_HEADER(netinet/in.h, AC_DEFINE(HAVE_NETINET_IN_H), no_netinet_in=yes)
439
440if test "$no_netinet_in" != "yes"; then
441 AC_MSG_CHECKING(for in_addr_t defined in netinet/in.h)
442 AC_EGREP_HEADER(in_addr_t, netinet/in.h,
443 ac_cv_type_in_addr_t=yes, ac_cv_type_in_addr_t=no)
444 AC_MSG_RESULT($ac_cv_type_in_addr_t)
445fi
446
447if test "$ac_cv_type_in_addr_t" != "yes"; then
448 AC_DEFINE(in_addr_t, uint32_t)
449fi
ea0caf4a 450
25f58600 451MR_EXTEND(PRO_C_INCLUDES, INCLUDE='$(srcdir)')
ea0caf4a 452MR_INCLUDE('$(SRCTOP)/include')
25f58600 453MR_INCLUDE('$(SRCTOP)/lib')
ea0caf4a 454MR_INCLUDE('$(BUILDTOP)/lib')
455MR_INCLUDE('$(BUILDTOP)/db')
f4036eed 456MR_INCLUDE('$(srcdir)')
ea0caf4a 457LDFLAGS="$LDFLAGS -L\$(BUILDTOP)/lib $LIBPATH"
cb974713 458KLIBS="$KRB4_LIBS $KRB5_LIBS -lcom_err $LIBS"
7249c66a 459KLIBS="$LIBS"
460if test "$hesiod" != no; then
461 KLIBS="-lhesiod $KLIBS"
462fi
cb974713 463KLIBS="$KRB4_LIBS $KRB5_LIBS -lcom_err $KLIBS"
7249c66a 464if test "$zephyr" != no; then
465 KLIBS="-lzephyr $KLIBS"
466fi
a816420b 467MR_LIBDEP='$(BUILDTOP)/lib/libmoira.la'
3fb6166b 468AC_SUBST(MR_LIBDEP)
469
42bcd2e6 470LIBS="$MR_LIBDEP $KLIBS"
471AC_SUBST(KLIBS)
472
ea0caf4a 473AC_OUTPUT(Makefile lib/Makefile include/Makefile clients/Makefile \
ee85084d 474 clients/lib/Makefile clients/addusr/Makefile \
f62cd5c0 475 clients/blanche/Makefile clients/chfn/Makefile \
476 clients/chpobox/Makefile clients/chsh/Makefile \
f72fe084 477 clients/eunice/Makefile clients/mailmaint/Makefile \
478 clients/mitch/Makefile clients/moira/Makefile \
479 clients/mrcheck/Makefile clients/mrtest/Makefile \
480 clients/stanley/Makefile clients/stella/Makefile \
481 update/Makefile man/Makefile $WEBMOIRA_OUTPUT_FILES \
482 $SERVER_OUTPUT_FILES $WINAD_OUTPUT_FILES \
7cc696ad 483 $AFS_OUTPUT_FILES $RSAREF_OUTPUT_FILES)
This page took 0.146183 seconds and 5 git commands to generate.