1 |
tdb |
1.1 |
# -*- Autoconf -*- |
2 |
|
|
# Process this file with autoconf to produce a configure script. |
3 |
|
|
# |
4 |
|
|
# configure.in for i-scream idar |
5 |
tdb |
1.6 |
# $Id: configure.in,v 1.5 2003/04/10 12:42:52 tdb Exp $ |
6 |
tdb |
1.1 |
# |
7 |
|
|
|
8 |
|
|
# Change these to change the package name and version |
9 |
tdb |
1.5 |
AC_INIT(idar, 1.2, dev@i-scream.org.uk) |
10 |
|
|
AM_INIT_AUTOMAKE(idar, 1.2) |
11 |
tdb |
1.1 |
|
12 |
|
|
# Revision number (automatically updated) |
13 |
tdb |
1.6 |
AC_REVISION($Revision: 1.5 $) |
14 |
tdb |
1.1 |
|
15 |
|
|
# Might work with older autoconfs... but tested on 2.57 |
16 |
|
|
AC_PREREQ(2.57) |
17 |
|
|
|
18 |
|
|
# The file we use to pass #define's to the source |
19 |
|
|
AM_CONFIG_HEADER(config.h) |
20 |
|
|
|
21 |
|
|
# Checks for programs |
22 |
|
|
AC_PROG_CC |
23 |
|
|
AC_PROG_INSTALL |
24 |
|
|
|
25 |
|
|
# User specified libukcprog prefix |
26 |
|
|
AC_ARG_WITH([libukcprog-prefix], |
27 |
|
|
[ --with-libukcprog-prefix=PATH libukcprog is in PATH], |
28 |
|
|
[ |
29 |
|
|
if test -d "$withval/lib"; then |
30 |
|
|
LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
31 |
|
|
fi |
32 |
|
|
if test -d "$withval/include"; then |
33 |
|
|
CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
34 |
|
|
fi |
35 |
|
|
] |
36 |
|
|
) |
37 |
|
|
|
38 |
tdb |
1.2 |
# User specified curses/ncurses prefix |
39 |
|
|
AC_ARG_WITH([curses-prefix], |
40 |
|
|
[ --with-curses-prefix=PATH curses (or ncurses) is in PATH], |
41 |
|
|
[ |
42 |
|
|
if test -d "$withval/lib"; then |
43 |
|
|
LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
44 |
|
|
fi |
45 |
|
|
if test -d "$withval/include"; then |
46 |
|
|
CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
47 |
|
|
fi |
48 |
|
|
] |
49 |
|
|
) |
50 |
|
|
|
51 |
tdb |
1.1 |
# Checks for header files |
52 |
|
|
AC_HEADER_STDC |
53 |
|
|
AC_CHECK_HEADERS(ukcprog.h,,[AC_MSG_ERROR([need ukcprog.h])]) |
54 |
|
|
|
55 |
|
|
# Checks for typedefs, structures, and compiler characteristics |
56 |
|
|
AC_C_CONST |
57 |
|
|
|
58 |
|
|
# Checks for library functions |
59 |
|
|
AC_FUNC_MALLOC |
60 |
|
|
AC_FUNC_REALLOC |
61 |
|
|
AC_FUNC_FORK |
62 |
tdb |
1.3 |
AC_CHECK_FUNCS(strlcpy) |
63 |
|
|
AC_CHECK_FUNCS(atoll) |
64 |
tdb |
1.1 |
|
65 |
tdb |
1.2 |
# Need curses or ncurses |
66 |
|
|
MP_WITH_CURSES |
67 |
|
|
|
68 |
|
|
# Need libxml2 |
69 |
|
|
AM_PATH_XML2 |
70 |
|
|
CFLAGS="$CFLAGS $XML_CFLAGS" |
71 |
|
|
LIBS="$LIBS $XML_LIBS" |
72 |
|
|
|
73 |
tdb |
1.1 |
# Figure out details about the host - we need the OS |
74 |
|
|
AC_CANONICAL_HOST |
75 |
|
|
|
76 |
|
|
# Set things up for different OS's |
77 |
|
|
# We define the name of the OS so the code can act accordingly |
78 |
|
|
# We also need to add the right LDFLAGS |
79 |
|
|
case $host_os in |
80 |
|
|
solaris2.*) |
81 |
tdb |
1.2 |
AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])],[-lnsl -lsocket]) |
82 |
tdb |
1.1 |
LIBS="$LIBS -lnsl -lsocket -Wl,-Bstatic -lukcprog -Wl,-Bdynamic" |
83 |
|
|
;; |
84 |
|
|
freebsd4.*) |
85 |
tdb |
1.2 |
AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])]) |
86 |
tdb |
1.1 |
LIBS="$LIBS -lukcprog -static" |
87 |
|
|
;; |
88 |
|
|
linux-gnu) |
89 |
tdb |
1.2 |
AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])]) |
90 |
tdb |
1.1 |
LIBS="$LIBS -lukcprog -static" |
91 |
|
|
;; |
92 |
|
|
*) |
93 |
|
|
AC_MSG_ERROR([Cannot build on unknown OS: $host_os]) |
94 |
|
|
;; |
95 |
|
|
esac |
96 |
tdb |
1.6 |
|
97 |
|
|
# Check for the --with-server-name option |
98 |
|
|
AC_ARG_WITH([server-name], [ --with-server-name=FILE default server name (default: localhost)], [servername=$withval], [servername=[localhost]]) |
99 |
|
|
AC_DEFINE_UNQUOTED([DEF_SERVER_NAME], ["$servername"], [Default Server Name]) |
100 |
|
|
|
101 |
|
|
# Check for the --with-server-port option |
102 |
|
|
AC_ARG_WITH([server-port], [ --with-server-port=FILE default server port (default: 4510)], [serverport=$withval], [serverport=[4510]]) |
103 |
|
|
AC_DEFINE_UNQUOTED([DEF_SERVER_PORT], [$serverport], [Default Server Port]) |
104 |
tdb |
1.1 |
|
105 |
|
|
# And finish by changing these files |
106 |
|
|
AC_CONFIG_FILES([Makefile]) |
107 |
|
|
|
108 |
|
|
AC_OUTPUT |