dnl Autoconfigure input file for npadmin dnl Ben Woodard dnl dnl Largely stolen from the one that comes with fetchmail by dnl Eric S. Raymond dnl dnl Process this file with autoconf to produce a configure script. AC_INIT(ber.C) dnl Initialize the automake stuff AM_INIT_AUTOMAKE(npadmin, 0.8.7) AM_CONFIG_HEADER(config.h) dnl We want these before the checks, so the checks can modify their values. AC_SUBST(LDFLAGS) AC_LANG_CPLUSPLUS() dnl Checks for programs. AC_PROG_INSTALL AC_PROG_CC AC_PROG_CXX AC_MSG_CHECKING(whether compiler handles exceptions) AC_TRY_COMPILE([],[try{}catch(int e){}],AC_MSG_RESULT(yes), [AC_MSG_RESULT(no) AC_MSG_CHECKING(whether compiler needs -fhandle-exceptions) CXXFLAGS="-fhandle-exceptions -g" __needs_excepthand_flag="-fhandle-exceptions" AC_TRY_COMPILE([],[try{}catch(int e){}],AC_MSG_RESULT(yes), [AC_MSG_RESULT(no) AC_MSG_ERROR(C++ compiler must support exception handling.)]) ]) AC_SUBST(__needs_excepthand_flag) dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(arpa/inet.h assert.h errno.h fcntl.h limits.h netdb.h \ netinet/in.h stdarg.h stdio.h stdlib.h string.h sys/socket.h \ sys/stat.h sys/time.h sys/types.h unistd.h pthread.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_HEADER_TIME dnl Checks for library functions. AC_FUNC_MEMCMP AC_CHECK_FUNCS(select strdup strstr strtol getopt_long) AC_REPLACE_FUNCS(snprintf) # Under sysV68, socket and friends are provided by the C library. # -linet does not provide socket, but causes multiple definition # errors at link-time. It is thus better to only use the C library. # So don't add -linet to the link list unless it's necessary AC_CHECK_FUNC(socket, AC_MSG_RESULT(using libc's socket), AC_CHECK_LIB(socket,socket) AC_CHECK_LIB(inet,socket)) # The condition in this test copes with the presence of inet_addr in libc6. AC_CHECK_FUNC(inet_addr, AC_MSG_RESULT(using libc's inet_addr), AC_CHECK_LIB(nsl,inet_addr)) AC_CHECK_FUNC(getopt_long, AC_MSG_RESULT(using libc's getopt_long), AC_CHECK_LIB(iberty, getopt_long)) AC_CHECK_LIB(pthread, pthread_join) AC_OUTPUT(Makefile npadmin.spec)