source: web/old/remctl-2.14/configure.ac @ f6f3e91

web
Last change on this file since f6f3e91 was f6f3e91, checked in by Jessica B. Hamrick <jhamrick@…>, 15 years ago

Preserve directory hierarchy (not sure what happened to it)

  • Property mode set to 100644
File size: 4.9 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2dnl
3dnl Written by Russ Allbery <rra@stanford.edu>
4dnl Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008
5dnl     Board of Trustees, Leland Stanford Jr. University
6dnl
7dnl See LICENSE for licensing terms.
8
9AC_PREREQ([2.63])
10AC_INIT([remctl], [2.14], [rra@stanford.edu])
11AC_CONFIG_AUX_DIR([build-aux])
12AC_CONFIG_LIBOBJ_DIR([portable])
13AC_CONFIG_MACRO_DIR([m4])
14AM_INIT_AUTOMAKE([1.10])
15AM_MAINTAINER_MODE
16
17AC_PROG_CC
18AC_USE_SYSTEM_EXTENSIONS
19AM_PROG_CC_C_O
20AC_PROG_INSTALL
21AC_PROG_LIBTOOL
22
23AC_SEARCH_LIBS([gethostbyname], [nsl])
24AC_SEARCH_LIBS([socket], [socket], ,
25    [AC_CHECK_LIB([nsl], [socket], [LIBS="-lnsl -lsocket $LIBS"], ,
26        [-lsocket])])
27RRA_LIB_GSSAPI
28AC_HEADER_STDBOOL
29AC_CHECK_HEADERS([sys/bitypes.h sys/filio.h sys/select.h sys/uio.h syslog.h])
30AC_CHECK_DECLS([snprintf, vsnprintf])
31AC_CHECK_DECLS([inet_aton, inet_ntoa], , ,
32    [#include <sys/types.h>
33     #include <netinet/in.h>
34     #include <arpa/inet.h>])
35RRA_C_C99_VAMACROS
36RRA_C_GNU_VAMACROS
37AC_CHECK_MEMBERS([struct sockaddr.sa_len], , ,
38    [#include <sys/types.h>
39     #include <sys/socket.h>])
40AC_CHECK_TYPES([long long])
41AC_CHECK_TYPE([sig_atomic_t], ,
42    [AC_DEFINE([sig_atomic_t], [int],
43        [Define to int if <signal.h> does not define.])],
44    [#include <sys/types.h>
45     #include <signal.h>])
46AC_CHECK_TYPE([socklen_t], ,
47    [AC_DEFINE([socklen_t], [int],
48        [Define to int if <sys/socket.h> does not define.])],
49    [#include <sys/types.h>
50     #include <sys/socket.h>])
51AC_CHECK_TYPES([struct sockaddr_in6],
52    [AC_DEFINE([HAVE_INET6], [1],
53        [Define to 1 if IPv6 library interfaces are available.])], ,
54    [#include <sys/types.h>
55     #include <netinet/in.h>])
56AC_CHECK_TYPES([struct sockaddr_storage],
57    [AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , ,
58        [#include <sys/types.h>
59         #include <sys/socket.h>])], ,
60    [#include <sys/types.h>
61     #include <sys/socket.h>])
62RRA_MACRO_IN6_ARE_ADDR_EQUAL
63RRA_MACRO_SA_LEN
64RRA_FUNC_INET_NTOA
65RRA_FUNC_SNPRINTF
66AC_CHECK_FUNCS([getaddrinfo],
67    [RRA_FUNC_GETADDRINFO_ADDRCONFIG],
68    [AC_LIBOBJ([getaddrinfo])])
69AC_CHECK_FUNCS([setrlimit setsid])
70AC_REPLACE_FUNCS([asprintf daemon getnameinfo getopt inet_aton inet_ntop \
71                  setenv strlcat strlcpy])
72AC_TYPE_SIGNAL
73
74dnl Additional GSS-API portability checks.
75RRA_LIB_GSSAPI_SWITCH
76AC_CHECK_HEADERS([gssapi.h])
77AC_CHECK_DECL([GSS_C_NT_USER_NAME],
78    [AC_DEFINE([HAVE_GSS_RFC_OIDS], 1,
79       [Define to 1 if the GSS-API library uses RFC-compliant OIDs.])], ,
80[[
81#if defined(HAVE_GSSAPI_H)
82# include <gssapi.h>
83#else
84# include <gssapi/gssapi.h>
85#endif
86]])
87AC_CHECK_DECLS([GSS_KRB5_MECHANISM], ,
88    [AC_CHECK_DECLS([gss_mech_krb5], ,
89        [AC_LIBOBJ([gssapi-mech])],
90        [#include <gssapi/gssapi_krb5.h>])],
91[[
92#if defined(HAVE_GSSAPI_H)
93# include <gssapi.h>
94#else
95# include <gssapi/gssapi.h>
96#endif
97]])
98RRA_LIB_GSSAPI_RESTORE
99
100dnl If and only if we're on a GNU system, use mapfile to do symbol versioning
101dnl of the libremctl library.  libtool doesn't know how to do this itself.
102dnl This is supported on Solaris as well but we need to know if we're
103dnl the GNU linker or the Solaris linker.
104case "$host" in
105*-gnu*)
106    VERSION_LDFLAGS='-Wl,--version-script=${srcdir}/client/mapfile'
107    ;;
108*)
109    VERSION_LDFLAGS=""
110    ;;
111esac
112AC_SUBST([VERSION_LDFLAGS])
113
114dnl Check for the CMU GPUT library.
115RRA_LIB_GPUT
116
117dnl Whether to build the Perl bindings.  Put this late so that it shows up
118dnl near the bottom of the --help output.
119build_perl=
120AC_ARG_ENABLE([perl],
121    [AC_HELP_STRING([--enable-perl], [Build Perl libremctl bindings])],
122    [AS_IF([test x"$enableval" = xyes], [build_perl=yes])])
123AM_CONDITIONAL([BUILD_PERL], [test x"$build_perl" = xyes])
124
125dnl Whether to build the PHP bindings.  The dance required to be able to run
126dnl phpize before AC_OUTPUT sucks like a sucking thing.
127build_php=
128AC_ARG_ENABLE([php],
129    [AC_HELP_STRING([--enable-php], [Build remctl PECL extension for PHP])],
130    [AS_IF([test x"$enableval" = xyes],
131        [build_php=yes
132         AC_ARG_VAR([PHPIZE], [Path to phpize])
133         AC_PATH_PROG([PHPIZE], [phpize])])])
134AM_CONDITIONAL([BUILD_PHP], [test x"$build_php" = xyes])
135
136dnl Whether to build the Python bindings.
137build_python=
138AC_ARG_ENABLE([python],
139    [AC_HELP_STRING([--enable-python], [Build Python libremctl bindings])],
140    [AS_IF([test x"$enableval" = xyes], [build_python=yes])])
141AM_CONDITIONAL([BUILD_PYTHON], [test x"$build_python" = xyes])
142
143AC_CONFIG_FILES([Makefile java/build.xml java/local.properties])
144AS_IF([test x"$build_perl" = xyes],
145    [AC_CONFIG_FILES([perl/Makefile.PL perl/Remctl.pm])
146     AC_CONFIG_FILES([perl/t/api.t], [chmod +x perl/t/api.t])])
147AS_IF([test x"$build_php" = xyes],
148    [AC_CONFIG_FILES([php/config.m4 php/php_remctl.h])])
149AS_IF([test x"$build_python" = xyes],
150    [AC_CONFIG_FILES([python/remctl.py python/setup.py])
151     AC_CONFIG_FILES([python/test_remctl.py])])
152AC_CONFIG_HEADER([config.h])
153AC_CONFIG_COMMANDS([docs], [test -d docs || mkdir docs])
154AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.