Annotation of dgamelaunch-openbsd/configure.ac, Revision 1.2
1.1 rubenllo 1: dnl Use autoconf 2.53
2: dnl (Things tend to break across versions, they're neither upwards nor
3: dnl downward compatible. Blame GNU.)
4:
5: AC_INIT(dgamelaunch, [1.5.1])
6: AC_PREREQ(2.53)
7:
8: AC_CONFIG_HEADER(config.h)
9:
10: AC_PROG_CC(cc gcc)
11: AC_STDC_HEADERS
12:
13: AC_PROG_LEX
14: if test -z "$LEX"; then
15: AC_MSG_ERROR([lex or flex not found.])
16: fi
17:
18: LEXLIBS="$LEXLIB"
19:
20: AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR([need pthreads])])
21:
22: AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc)
23: if test -z "$YACC"; then
24: AC_MSG_ERROR([bison or yacc not found.])
25: fi
26:
27: case "$(uname -s)" in
1.2 ! rubenllo 28: OpenBSD)
! 29: LIBS="-lutil $LIBS"
! 30: AC_DEFINE(NOSTREAMS, 1, [Don't use SVR4 streams support in ttyrec.])
! 31: ;;
1.1 rubenllo 32: Linux | *BSD)
33: MY_LIBS="$MY_LIBS -lutil -lcrypt"
34: AC_DEFINE(NOSTREAMS, 1, [Don't use SVR4 streams support in ttyrec.])
35: ;;
36: esac
37:
38: AC_MSG_CHECKING([for Solaris cc])
39: case "`$CC -V 2>&1`" in
40: *Sun*WorkShop* | *Forte*Developer*)
41: AC_MSG_RESULT(yes)
42: suncc=yes
43: ;;
44: *)
45: AC_MSG_RESULT(no)
46: ;;
47: esac
48:
49: AC_PATH_PROG(MKDEP, mkdep)
50: AC_PATH_PROG(MAKEDEPEND, makedepend)
51:
52: AC_MSG_CHECKING([how to generate dependency info])
53:
54: if test "$ac_cv_c_compiler_gnu" = yes; then
55: CFLAGS="$CFLAGS -Wall -Wno-unused"
56: MKDEP="$CC -MM"
57: MKDEP_DIRECT="> .depend"
58: AC_MSG_RESULT(gcc)
59: elif test "$suncc" = yes; then
60: MKDEP="$CC -xM"
61: # -xM is noisy
62: MKDEP_DIRECT="> .depend 2>/dev/null"
63: AC_MSG_RESULT([Solaris cc])
64: elif test -n "$MKDEP"; then
65: AC_MSG_RESULT(mkdep)
66: elif test -n "$MAKEDEPEND"; then
67: MKDEP=":> .depend; $MAKEDEPEND -f.depend"
68: MKDEP_DIRECT=">/dev/null 2>&1" # noisy prick of a program
69: AC_MSG_RESULT(makedepend)
70: else
71: MKDEP=:
72: AC_MSG_RESULT([nothing!])
73: fi
74:
75: AC_SUBST(MKDEP)
76: AC_SUBST(MKDEP_DIRECT)
77:
78: AC_SEARCH_LIBS(use_default_colors, [ncursesw],
79: [
80: AC_MSG_RESULT([Using ncursesw and color.])
81: AC_DEFINE(USE_NCURSES_COLOR,1,[Use ncursesw and color])
82: ],
83: [
84: AC_MSG_RESULT([Not using ncursesw, not using color.])
85: ])
86:
87: AC_PROG_INSTALL
88: AC_SEARCH_LIBS(initscr, [ncursesw cursesw], [], [
89: AC_MSG_ERROR([Cannot find cursesw or ncursesw devel libs.])
90: ])
91:
92:
93:
94: AC_ARG_ENABLE(debugfile,
95: [AC_HELP_STRING([--enable-debugfile], [Enable debugging output to a file.])],
96: [], [])
97:
98: if test "$enable_debugfile" = yes; then
99: AC_MSG_RESULT([Enabling debugging output to a file.])
100: AC_DEFINE(USE_DEBUGFILE,1,[Output debugging into to a file in chroot.])
101: fi
102:
103:
104: AC_ARG_ENABLE(sqlite,
105: [AC_HELP_STRING([--enable-sqlite], [Use SQLite for the database instead of flat text file.])],
106: [], [])
107:
108: AC_ARG_WITH(sqlite-db,
109: [AC_HELP_STRING([--with-sqlite-db=PATH], [Define the path and filename of the SQLite database.])],
110: [dgl_sqlite_db=$withval; enable_sqlite=yes], [dgl_sqlite_db="/dgldir/dgamelaunch.db"])
111:
112: if test "$enable_sqlite" = yes; then
1.2 ! rubenllo 113: AC_CHECK_HEADERS([sqlite3.h],
! 114: [mypj_found_sqlite3_headers=yes; break;])
! 115: AS_IF([test "x$mypj_found_sqlite3_headers" != "xyes"],
! 116: [AC_MSG_ERROR([Unable to find sqlite3 headers])])
1.1 rubenllo 117: AC_MSG_RESULT([Using SQLite for the database, located at $dgl_sqlite_db])
118: AC_DEFINE(USE_SQLITE3,1,[Use SQLite for the database instead of flat text file.])
119: MY_LIBS="$MY_LIBS -lsqlite3"
120: AC_DEFINE_UNQUOTED(USE_SQLITE_DB, "$dgl_sqlite_db", [Path and filename of the SQLite database.])
121: fi
122:
123:
124:
125:
126: dgl_rlimit_core_default=157286400
127: AC_ARG_WITH(rlimit-core,
128: [AC_HELP_STRING([--with-rlimit-core=SIZE], [Enable and set the core dump maximum size.])],
129: [dgl_rlimit_core=$withval; enable_rlimit=yes], [dgl_rlimit_core=$dgl_rlimit_core_default])
130:
131: if test "$enable_rlimit" = yes; then
132: if test "$dgl_rlimit_core" = yes; then
133: dgl_rlimit_core=$dgl_rlimit_core_default
134: fi
135: AC_CHECK_HEADERS([sys/resource.h], [], [AC_MSG_ERROR([sys/resource.h not found.])], [])
136: AC_MSG_RESULT([Enabled and set maximum core dump size to $dgl_rlimit_core])
137: AC_DEFINE(USE_RLIMIT,1,[Use getrlimit/setrlimit])
138: AC_DEFINE_UNQUOTED(USE_RLIMIT_CORE, $dgl_rlimit_core, [Maximum core dump size])
139: enable_rlimit=no
140: fi
141:
142: dgl_rlimit_as_default=104857600
143: AC_ARG_WITH(rlimit-as,
144: [AC_HELP_STRING([--with-rlimit-as=SIZE], [Enable and set the maximum memory usage.])],
145: [dgl_rlimit_as=$withval; enable_rlimit=yes], [dgl_rlimit_as=$dgl_rlimit_as_default])
146:
147: if test "$enable_rlimit" = yes; then
148: if test "$dgl_rlimit_as" = yes; then
149: dgl_rlimit_as=$dgl_rlimit_as_default
150: fi
151: AC_CHECK_HEADERS([sys/resource.h], [], [AC_MSG_ERROR([sys/resource.h not found.])], [])
152: AC_MSG_RESULT([Enabled and set maximum memory usage limit to $dgl_rlimit_as])
153: AC_DEFINE(USE_RLIMIT,1,[Use getrlimit/setrlimit])
154: AC_DEFINE_UNQUOTED(USE_RLIMIT_AS, $dgl_rlimit_as, [Maximum mem usage])
155: enable_rlimit=no
156: fi
157:
158:
159: AC_ARG_ENABLE(shmem,
160: [AC_HELP_STRING([--enable-shmem], [Use a shared memory block to show number of watchers.])],
161: [enable_shmem=yes], [])
162:
163: if test "$enable_shmem" = yes; then
164: AC_CHECK_HEADERS([semaphore.h], [], [AC_MSG_ERROR([semaphore.h not found.])], [])
165: AC_CHECK_HEADERS([sys/ipc.h], [], [AC_MSG_ERROR([sys/ipc.h not found.])], [])
166: AC_CHECK_HEADERS([sys/shm.h], [], [AC_MSG_ERROR([sys/shm.h not found.])], [])
167: AC_MSG_RESULT([Enabled showing number of watchers.])
168: AC_DEFINE(USE_SHMEM,1,[Use shared memory block])
1.2 ! rubenllo 169: AS_IF([ test "$(uname -s)" != "OpenBSD"],
! 170: [MY_LIBS="$MY_LIBS -lrt"])
1.1 rubenllo 171: # or -pthread?
172: fi
173:
174:
175: AC_ARG_WITH(config-file,
176: [AC_HELP_STRING([--with-config-file=PATH], [Define the path to the default configuration file.])],
177: [configfile=$withval], [configfile="/etc/dgamelaunch.conf"])
178:
179: AC_DEFINE_UNQUOTED(DEFCONFIG, "$configfile", [Path to the default config file.])
180:
181: AC_CHECK_HEADERS([sys/pstat.h])
182: AC_CHECK_FUNCS([openpty setenv setproctitle pstat kqueue])
183:
184: if test "$ac_cv_func_setproctitle" = no; then
185: SETPROCTITLE_C=setproctitle.c
186: if test "$ac_cv_func_pstat" = yes; then
187: AC_DEFINE(SPT_TYPE,SPT_PSTAT,[Type of setproctitle emulation to use.])
188: else
189: AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
190: fi
191: else
192: SETPROCTITLE_C=""
193: fi
194:
195:
196: LIBS="$LIBS $MY_LIBS"
197:
198: AC_SUBST(SETPROCTITLE_C)
199: AC_SUBST(LEXLIBS)
200:
201: AC_CONFIG_FILES(Makefile)
202: AC_OUTPUT
CVSweb