Hamlib/configure.in

161 wiersze
3.7 KiB
Plaintext

dnl Process this file with autoconf to produce a configure script.
AC_INIT(include/hamlib/rig.h)
AC_CANONICAL_SYSTEM
# version code:
V_MAJOR=1
V_MINOR=1.1
AM_INIT_AUTOMAKE(hamlib, ${V_MAJOR}.${V_MINOR})
AM_CONFIG_HEADER(include/config.h)
AC_PREREQ(2.10)dnl dnl Minimum Autoconf version required.
AC_ARG_PROGRAM
dnl directory for docs (html)
AC_SUBST(hamlibdocdir)
hamlibdocdir=$datadir/doc/hamlib
dnl Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_LN_S
AC_ISC_POSIX
AC_PROG_CC
AC_AIX
AC_MINIX
AM_PROG_CC_STDC
AC_PROG_GCC_TRADITIONAL
INCLUDES="${INCLUDES} -I\$(top_srcdir)/include -I\$(top_srcdir)/src"
CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE -DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR}"
if test "${ac_cv_prog_gcc}" = "yes"; then
CFLAGS="${CFLAGS} -Wall"
fi
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h sys/ioccom.h linux/ppdev.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
dnl Checks for libraries.
dnl AC_CHECK_LIB(intl,gettext)
dnl AC_CHECK_LIB(nsl,gethostbyaddr)
dnl AC_CHECK_LIB(socket,socket)
AC_CHECK_LIB(syslog,syslog) # OS/2 needs this
dnl Replace `main' with a function in -lc:
AC_CHECK_LIB(c, main)
dnl Replace `main' with a function in -lm:
AC_CHECK_LIB(m, main)
dnl Checks for library functions.
AC_CHECK_FUNCS(atexit snprintf usleep select strerror)
dnl initialize libtool
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
if test "${enable_dynamic}" != "no"; then
AC_CHECK_HEADERS(dlfcn.h,
[AC_CHECK_LIB(dl,dlopen)
AC_CHECK_FUNCS(dlopen, , enable_dynamic=no)],
[enable_dynamic=no])
fi
dnl Check if libgd-dev is installed, so we can enable rigmatrix
AC_ARG_ENABLE(rigmatrix,
[ --enable-rigmatrix Generate rigmatrix tool (requires libgd)],
[case "${enableval}" in
yes) wantrigmatrix=true ;;
no) wantrigmatrix=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-rigmatrix) ;;
esac],[wantrigmatrix=false])
AM_CONDITIONAL(WANTRIGMATRIX, test x$wantrigmatrix = xtrue)
if test "x${wantrigmatrix}" != "xfalse"; then
AC_CHECK_HEADERS(gd.h,
[AC_CHECK_LIB(gd,gdImageCreate)
AC_CHECK_FUNCS(gdImageCreate, , enable_rigmatrix=no)],
[enable_rigmatrix=no])
AC_CHECK_LIB(gd,png_write_data)
AC_CHECK_LIB(z,uncompress)
if test "${ac_cv_header_gd_h}" = "no"; then
echo "disabling rigmatrix generation"
RIGMATRIX=
else
echo "enabling rigmatrix generation"
RIGMATRIX=rigmatrix
fi
else
echo "disabling rigmatrix generation"
RIGMATRIX=
fi
AC_SUBST(RIGMATRIX)
dnl Check if linradio-toolkit includes are there, so we can enable WiNRADiO
AC_CHECK_HEADERS(linradio/radio_ioctl.h linradio/wrapi.h)
if test "${ac_cv_header_linradio_radio_ioctl_h}" = "no" -o \
"${ac_cv_header_linradio_wrapi_h}" = "no"; then
echo "disabling WiNRADiO receiver support"
WINRADIO=
WINRADIOLNK=
WINRADIODEPS=
else
echo "enabling WiNRADiO receiver support"
WINRADIO=winradio
WINRADIOLNK="\"-dlopen\" ../winradio/libhamlib-winradio.la"
WINRADIODEPS="../winradio/libhamlib-winradio.la"
fi
AC_SUBST(WINRADIO)
AC_SUBST(WINRADIOLNK)
AC_SUBST(WINRADIODEPS)
AC_SUBST(INCLUDES)
if test "${ac_cv_header_sys_socket_h}" = "no"; then
echo "disabling NET port"
NET=
else
echo "enabling NET port"
NET=net
fi
AC_SUBST(NET)
if test "${enable_shared}" = "no"; then
enable_preload=yes
fi
if test "${enable_dynamic}" = "no" || test "${enable_preload}" = "yes"; then
echo "preloading backends into DLL"
DLL_PRELOAD="\$(PRELOADABLE_BACKENDS)"
else
DLL_PRELOAD=""
fi
AC_SUBST(V_MAJOR)
AC_SUBST(V_MINOR)
AC_SUBST(DLL_PRELOAD)
AC_OUTPUT([Makefile
include/Makefile
include/hamlib/Makefile
yaesu/Makefile
icom/Makefile
aor/Makefile
kenwood/Makefile
winradio/Makefile
src/Makefile
tests/Makefile
doc/Makefile])