6 |
|
# |
7 |
|
|
8 |
|
# Change these to change the package name and version |
9 |
< |
AC_INIT(ihost, 1.5, dev@i-scream.org.uk) |
10 |
< |
AM_INIT_AUTOMAKE(ihost, 1.5) |
9 |
> |
AC_INIT(ihost, 1.5.4, dev@i-scream.org.uk) |
10 |
> |
AM_INIT_AUTOMAKE(ihost, 1.5.4) |
11 |
|
|
12 |
|
# Revision number (automatically updated) |
13 |
|
AC_REVISION($Revision$) |
28 |
|
[ --with-libstatgrab-prefix=PATH libstatgrab is in PATH], |
29 |
|
[ |
30 |
|
if test -d "$withval/lib"; then |
31 |
< |
LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
31 |
> |
LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
32 |
|
fi |
33 |
|
if test -d "$withval/include"; then |
34 |
|
CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
36 |
|
] |
37 |
|
) |
38 |
|
|
39 |
+ |
# User specified libukcprog prefix |
40 |
+ |
AC_ARG_WITH([libukcprog-prefix], |
41 |
+ |
[ --with-libukcprog-prefix=PATH libukcprog is in PATH], |
42 |
+ |
[ |
43 |
+ |
if test -d "$withval/lib"; then |
44 |
+ |
LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
45 |
+ |
fi |
46 |
+ |
if test -d "$withval/include"; then |
47 |
+ |
CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
48 |
+ |
fi |
49 |
+ |
] |
50 |
+ |
) |
51 |
+ |
|
52 |
|
# Checks for header files |
53 |
|
AC_HEADER_STDC |
54 |
|
AC_CHECK_HEADERS(statgrab.h,,[AC_MSG_ERROR([need statgrab.h])]) |
55 |
+ |
AC_CHECK_HEADERS(ukcprog.h,,[AC_MSG_ERROR([need ukcprog.h])]) |
56 |
|
|
57 |
|
# Checks for typedefs, structures, and compiler characteristics |
58 |
|
AC_C_CONST |
61 |
|
AC_FUNC_MALLOC |
62 |
|
AC_FUNC_REALLOC |
63 |
|
AC_FUNC_FORK |
64 |
< |
AC_CHECK_LIB(statgrab, get_general_stats,,[AC_MSG_ERROR([need libstatgrab])]) |
64 |
> |
AC_CHECK_FUNCS(strlcat) |
65 |
|
|
66 |
|
# Figure out details about the host - we need the OS |
67 |
|
AC_CANONICAL_HOST |
75 |
|
case $host_os in |
76 |
|
solaris2.*) |
77 |
|
AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) |
78 |
< |
LDFLAGS="$LDFLAGS -lnsl -lsocket -lkstat" |
78 |
> |
LIBS="$LIBS -lnsl -lsocket -lkstat -Wl,-Bstatic -lstatgrab -lukcprog -Wl,-Bdynamic" |
79 |
|
;; |
80 |
|
freebsd4.*) |
81 |
|
AC_DEFINE(FREEBSD, , [Building on FreeBSD 4.x]) |
82 |
< |
LDFLAGS="$LDFLAGS -lkvm" |
82 |
> |
LIBS="$LIBS -lkvm -lstatgrab -lukcprog -static" |
83 |
|
# FreeBSD needs ihost to be setgid kmem |
84 |
|
AM_CONDITIONAL(SETGIDKMEM, true) |
85 |
|
;; |
86 |
|
linux-gnu) |
87 |
|
AC_DEFINE(LINUX, , [Building on GNU/Linux]) |
88 |
+ |
LIBS="$LIBS -lstatgrab -lukcprog -static" |
89 |
|
;; |
90 |
|
*) |
91 |
|
AC_MSG_ERROR([Cannot build on unknown OS: $host_os]) |
92 |
|
;; |
93 |
|
esac |
94 |
|
|
95 |
+ |
# Library checks that need to be done after the OS specific stuff |
96 |
+ |
AC_CHECK_LIB(statgrab, get_general_stats,[:],[AC_MSG_ERROR([need libstatgrab])]) |
97 |
+ |
AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])],[$LIBUKCPROGLIBS]) |
98 |
+ |
|
99 |
|
# Check for the --with-pid-file option |
100 |
|
AC_ARG_WITH([pid-file], [ --with-pid-file=FILE location of PID file (default: /var/tmp/.ihost.pid)], [pidfile=$withval], [pidfile=[/var/tmp/.ihost.pid]]) |
101 |
|
AC_DEFINE_UNQUOTED([PID_FILE], ["$pidfile"], [Location of PID file]) |
109 |
|
AC_DEFINE_UNQUOTED([LOG_FILE], ["$logfile"], [Location of log file]) |
110 |
|
|
111 |
|
# And finish by changing these files |
112 |
< |
AC_CONFIG_FILES([Makefile libukcprog/Makefile]) |
112 |
> |
AC_CONFIG_FILES([Makefile]) |
113 |
|
|
114 |
|
AC_OUTPUT |