File: configure.in

package info (click to toggle)
plptools 0.10-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,136 kB
  • ctags: 5,437
  • sloc: cpp: 15,641; ansic: 8,381; sh: 8,268; perl: 1,340; makefile: 555; yacc: 318
file content (318 lines) | stat: -rw-r--r-- 8,408 bytes parent folder | download
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
AC_REVISION($Revision: 1.35 $)dnl revision of this configure.in script

AC_CONFIG_AUX_DIR(conf)
AC_INIT(Makefile.am)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(include/config.h)
AM_INIT_AUTOMAKE(plptools, 0.10)
AM_PROG_LIBTOOL
PLP_SET_LIBVERSION

dnl Enable Maintainer stuff
AM_MAINTAINER_MODE

dnl checks for programs
AC_AIX
AC_PROG_MAKE_SET
AC_PROG_CXX
PLP_CHECK_COMPILERS
AC_PROG_AWK
AC_PATH_PROG(SED,sed)

dnl NLS support
ALL_LINGUAS="de"
AM_GNU_GETTEXT
dnl Additional glibc-intl checks
PLP_CHECK_INTL

dnl This is stupid for two resaons:
dnl
dnl 1. It doesn't save and restore CFLAGS if it's _not_ Sun's cc
dnl    (these have been set already in AC_CHECK_COMPILERS
dnl 2. It assumes cc installed at a fixed path which may not be true
dnl    pkgadd -r can install anywhere.
dnl
dnl A correct version should check by using cc's _behavior_, not path
dnl and save and restore CFLAGS, if it's not Sun's cc.
dnl
dnl -> Commented out for now because i have gcc on Solaris, no Sun cc.
dnl If somebody complains, (s)he should send me some cc output and i
dnl can add a correct check to AC_CHECK_COMPILERS (where it belongs).
dnl Apart from that, Sun's compiler is crap anyway: It doesn't compile
dnl valid c++ code correctly.
dnl
dnl   -Fritz
dnl
dnl test "$GCC" = yes && CFLAGS="-O2 -Wall"
dnl AC_PATH_PROG(CC_PATH, $CC)
dnl test "$CC_PATH" = /opt/SUNWspro/bin/cc && CFLAGS="-xO2 -v"

dnl checking for aix
AC_MSG_CHECKING(for AIX)
if test "`uname -s 2>/dev/null`" = AIX ; then
  AC_MSG_RESULT(yes)
  AC_CHECK_LIB(bsd, hostname)
  EXTRA_OBJS=mount_aix.o
else
  AC_MSG_RESULT(no)
fi
AC_SUBST(EXTRA_OBJS)

dnl checks for libraries

dnl readline and history for plpftp
ac_enable_readline=yes
AM_CONDITIONAL(HAVE_LIBREADLINE, false)
AM_CONDITIONAL(ADD_LIBCURSES, false)
AC_ARG_ENABLE(readline,
	[  --disable-readline      disable libreadline support [no]],
	if test "$enableval" = "no" ; then
		AC_MSG_RESULT([support for libreadline disabled])
		ac_enable_readline=no
	fi
)
if test "x$ac_enable_readline" = "xyes" ; then
	PLP_CHECK_READLINE
fi

ac_enable_history=yes
AM_CONDITIONAL(HAVE_LIBHISTORY, false)
AC_ARG_ENABLE(history,
	[  --disable-history       disable libhistory support [no]],
	if test "$enableval" = "no" ; then
		AC_MSG_RESULT([support for libhistory disabled])
		ac_enable_history=no
	fi
)
if test "x$ac_enable_history" = "xyes" ; then
	AC_CHECK_LIB(history, add_history,
	[
		AC_DEFINE_UNQUOTED(HAVE_LIBHISTORY)
		have_libhistory=true
	])
	AM_CONDITIONAL(HAVE_LIBHISTORY, test x$have_libhistory = xtrue)
fi

dnl these three are for solaris
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname)
ac_save_LDFLAGS=$LDFLAGS; LDFLAGS="-L/usr/ucblib -R/usr/ucblib $LDFLAGS"
AC_CHECK_LIB(rpcsoc, svcudp_create,,LDFLAGS=$ac_save_LDFLAGS)

dnl checks for mount table - if desired
ac_enable_mnttab=yes
AC_ARG_ENABLE(mnttab,
       [  --disable-mnttab        disable mnttab writing [no]],
       if test "$enableval" = "no" ; then
               AC_MSG_RESULT([support for mnttab disabled])
               ac_enable_mnttab=no
       fi
)
if test "x$ac_enable_mnttab" = "xyes" ; then
       AC_MSG_CHECKING(for mount table)
       PLP_FIND_FILE(/etc/mnttab /etc/mtab, MTAB)
       AC_MSG_RESULT($MTAB)
       test "$MTAB" = "NO" && AC_DEFINE_UNQUOTED(DONT_UPDATE_MTAB)
       AC_DEFINE_UNQUOTED(MTAB_PATH,"$MTAB")
       case "$target_alias" in
               *linux*)
                       AC_DEFINE_UNQUOTED(MTAB_TMP,"${MTAB}~")
                       ;;
               *)
                       AC_DEFINE_UNQUOTED(MTAB_TMP,"${MTAB}.plpnfsd")
                       ;;
       esac
else
       AC_DEFINE_UNQUOTED(DONT_UPDATE_MTAB)
fi

dnl Check, if bot time.h and sys/time.h may be included
AC_HEADER_TIME

dnl Check, if compiler knows about bool
AC_CHECK_BOOL

dnl Type of sighandlers
AC_TYPE_SIGNAL

dnl checks for header files
AC_CHECK_HEADERS(sys/time.h sys/ioctl.h sys/errno.h sys/ttold.h stdlib.h)

PLP_HELP_MSG([Debugging (developer only!):])
LIBCCMALLOC=
AC_ARG_WITH(ccmalloc,
    [  --with-ccmalloc=DIR     link against ccmalloc leak-checking lib],
    [
      search_dirs="/usr/lib /lib /usr/local/lib"
      case "${withval}" in
      	yes)
		ccmalloc_dirs=${search_dirs}
		;;
	no)
		ccmalloc_dirs=
		;;
	*)
		ccmalloc_dirs="${withval} ${search_dirs}"
		;;
      esac
      AC_MSG_CHECKING(for libccmalloc)
      save_LIBS="$LIBS"
      ccmalloc_found=NO
      for d in ${ccmalloc_dirs} ; do
      	LIBS="-L$d -lccmalloc -ldl"
      	AC_TRY_LINK_FUNC(ccmalloc_report,ccmalloc_found=$d ; break)
      done
      LIBS="$save_LIBS"
      if test "${ccmalloc_found}" = "NO" ; then
      	AC_MSG_RESULT(not found)
      else
      	AC_MSG_RESULT(found)
	LIBCCMALLOC="-L$ccmalloc_found -lccmalloc -ldl"
      fi
    ]
)
AC_SUBST(LIBCCMALLOC)


dnl special options for customization

PLP_HELP_MSG([Options for overriding builtin defaults:])

AC_ARG_WITH(serial,
    [  --with-serial=DEV       override default serial line],
    [  DDEV="$withval"
      AC_MSG_RESULT(Overriding serial line: $DDEV)
    ],
    [ AC_MSG_CHECKING(for default serial line)
      PLP_FIND_CDEV(/dev/psion /dev/tty0p0 /dev/tty00 /dev/ttyS0 /dev/term/a /dev/ttyfa /dev/ttya /dev/tty0 /dev/ttyf1 /dev/cuaa1, DDEV)
      AC_MSG_RESULT($DDEV)
      test "$DDEV" = "NO" && AC_MSG_ERROR(NO serial lines. Use --with-serial.)
    ]
)
AC_DEFINE_UNQUOTED(DDEV,"$DDEV")
AC_SUBST(DDEV)

AC_ARG_WITH(speed,
    [  --with-speed=SPEED      override default serial speed [115200]],
    [ DSPEED="$withval"
      AC_MSG_RESULT(Overriding serial speed: $DSPEED) ],
    [ DSPEED=115200
      AC_MSG_RESULT(Using default serial speed: $DSPEED)
    ]
)
AC_DEFINE_UNQUOTED(DSPEED,$DSPEED)
AC_SUBST(DSPEED)

AC_ARG_WITH(port,
    [  --with-port=PORT        override default port [7501]],
    [ DPORT="$withval"
      AC_MSG_RESULT(Overriding port: $DPORT) ],
    [ DPORT=7501
      AC_MSG_RESULT(Using default port: $DPORT)
    ]
)
AC_DEFINE_UNQUOTED(DPORT,$DPORT)
AC_SUBST(DPORT)

AC_ARG_WITH(drive,
    [  --with-drive=DRIVE      override default Psion drive [AUTO]],
    [ DDRIVE="$withval"
      AC_MSG_RESULT(Overriding drive: $DDRIVE) ],
    [ DDRIVE='AUTO'
      AC_MSG_RESULT(Using default Psion drive: $DDRIVE)
    ]
)
AC_DEFINE_UNQUOTED(DDRIVE,"$DDRIVE")

AC_ARG_WITH(basedir,
    [  --with-basedir=DIR      override default Psion directory [\\\\]],
    [ DBASEDIR="$withval"
      AC_MSG_RESULT(Overriding directory: $DBASEDIR) ],
    [ DBASEDIR='\\'
      AC_MSG_RESULT(Using default Psion directory: $DBASEDIR)
    ]
)
AC_DEFINE_UNQUOTED(DBASEDIR,"$DBASEDIR")

AC_ARG_WITH(mountdir,
    [  --with-mountdir=DIR     override default mount point [/mnt/psion]],
    [ DMOUNTPOINT="$withval"
      AC_MSG_RESULT(Overriding mount point: $DMOUNTPOINT) ],
    [ DMOUNTPOINT="/mnt/psion"
      AC_MSG_RESULT(Using default mount point: $DMOUNTPOINT)
    ]
)
AC_DEFINE_UNQUOTED(DMOUNTPOINT,"$DMOUNTPOINT")
AC_SUBST(DMOUNTPOINT)

dnl KDE stuff
PLP_HELP_MSG([Options for activating sub packages:])
ac_enable_kde=no
AM_CONDITIONAL(BUILD_KDE, false)
AC_ARG_ENABLE(kde,
	[  --enable-kde            build KDE2 stuff [no]],
	if test "$enableval" = "yes" ; then
		AC_MSG_RESULT([Will build KDE2 stuff])
		ac_enable_kde=yes
	fi
)
PLP_HELP_MSG([Options, only needed when building KDE2 stuff:])
if test "x$ac_enable_kde" = "xyes" ; then
	if test "${prefix}" != "NONE" ; then
		kde_prefix=${prefix}
	else
		kde_prefix=$ac_default_prefix
	fi
	if test "${exec_prefix}" != "NONE" ; then
		kde_exec_prefix=${exec_prefix}
	else
		kde_exec_prefix=${kde_prefix}
	fi
	AC_ARG_WITH(kdedir,
	[  --with-kdedir=DIR       specify KDE directory [\${prefix}]],
	[
		kde_prefix=${withval}
		kde_exec_prefix=${withval}
	]
	)
	AC_MSG_RESULT(KDE stuff will be installed below $kde_prefix)
	AC_SUBST(kde_prefix)
	AC_SUBST(kde_exec_prefix)
	AC_PATH_KDE
	AC_CHECK_KDEMAXPATHLEN
	KDE_CHECK_FINAL
	AM_KDE_WITH_NLS
	AM_CONDITIONAL(BUILD_KDE, true)
fi

AC_OUTPUT(
	Makefile
	intl/Makefile
	po/Makefile.in
	po/Makefile
	lib/Makefile
	ncpd/Makefile
	plpftp/Makefile
	plpnfsd/Makefile
	kde2/Makefile
	kde2/kioslave/Makefile
	kde2/plugins/Makefile
	kde2/kpsion/Makefile
	kde2/klipsi/Makefile
	kde2/po/Makefile
	kde2/po/de/Makefile
	kde2/mime/Makefile
	kde2/mime/icons/Makefile
	kde2/doc/Makefile
	kde2/doc/en/Makefile
	kde2/doc/de/Makefile
	plpbackup/Makefile
	doc/Makefile
	doc/api/Makefile
	include/config.h
	etc/psion
	etc/plptools.spec
	doc/ncpd.man
	doc/plpnfsd.man
	doc/plpftp.man
)