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
|
dnl Process this file with autoconf to produce a configure script.
dnl Change this to change the version of the package
AC_INIT([libinklevel],[0.9.7])
dnl change this to change the RPM epoch
RPM_EPOCH=1
dnl change this to change the ABI-version
ABI_VERSION=5:0:0
dnl no more configuration after this line
AC_CONFIG_SRCDIR([libinklevel.c])
## Determine hostname & OS
## AC_CANONICAL_HOST
AC_ARG_ENABLE(debug,
[ --enable-debug Enable debugging output (default=no)],
[ case "${enableval}" in
yes|"") enabled=yes;
AC_DEFINE(DEBUG, 1, [enable debugging output]) ;;
no) ;;
*) ;;
esac],
)
## Check for programs
## we want libtool to build our libs
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
LT_INIT
AC_CONFIG_MACRO_DIR([m4])
## Check if we have rpmbuild, so we can build rpm's
AC_PATH_PROG([RPMBUILD],rpmbuild)
AC_ARG_VAR(RPMBUILD, rpmbuild command)
if test -n "$RPMBUILD"; then
rpmtarget=$srcdir/rpmbuild
else
rpmtarget=$srcdir/norpm
fi
AC_SUBST_FILE(rpmtarget)
AC_SUBST(RPMBUILD)
AC_SUBST(BUILD)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
LT_INIT
AC_PROG_INSTALL
AC_C_CONST
AC_C_VOLATILE
AC_FUNC_SELECT_ARGTYPES
AC_HEADER_SYS_WAIT
AC_PROG_CC
AC_SUBST(MAKEINDEX)
if test "$MAKEDEPEND" != "no"; then
DEPEND_RECURSIVE="depend-recursive"
fi
AC_CANONICAL_HOST
case $host_os in
freebsd* )
CFLAGS="$CFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
;;
esac
## Check for optional header files
AC_CHECK_HEADERS([ifaddrs.h])
## Check for mandatory header files
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h \
sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h wchar.h ]
,,AC_MSG_ERROR([required header file missing]))
## determine libraries that need to get linked
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_SEARCH_LIBS([socket], [socket])
AC_SEARCH_LIBS([ftime], [compat])
## Check for availability of optional functions
AC_CHECK_FUNCS([getifaddrs])
## Check for availability of mandatory functions
AC_CHECK_FUNCS([alarm ftime gethostbyaddr gethostbyname gettimeofday inet_ntoa \
memset select socket strchr strdup strerror strncasecmp strstr \
gethostname]
,,AC_MSG_ERROR([required library function missing]))
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_HEADER_RESOLV
## check for required types
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
AC_DEFINE_UNQUOTED(LINUX,1,[Define value for Linux OS])
case $host in
*-*-linux*) AC_DEFINE_UNQUOTED(HOST_OS,LINUX,[Host OS])
## check for pkgconfig
PKG_PROG_PKG_CONFIG([0.26])
## check for libusb
PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0]);;
*-freebsd*) AC_DEFINE_UNQUOTED(HOST_OS,FREEBSD,[Host OS])
AC_CHECK_LIB([usb], libusb_init,,
AC_MSG_ERROR([Library not found]),);;
*-*-*) AC_MSG_ERROR([Host OS not (yet) supported]) ;;
esac
PKG_CHECK_MODULES([LIBXML2], [libxml-2.0])
## Variables to be exported
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(ABI_VERSION)
AC_SUBST(RPM_EPOCH)
AC_SUBST(HOST_OS)
## What files must be generated
AC_CONFIG_FILES([Makefile libinklevel.spec])
AC_OUTPUT
|