X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=configure.ac;h=fa40460e7d7eb95470dc28ac2faf2fb42f4d3eb9;hb=67b55d10b8570d76dc579ab0ba5657d4645cbd19;hp=3a13ff7bf0bf2e0c02d90af028e4a972813e0ccc;hpb=5ec2f93bce2ec8d98b9c92e02dfb8a17fc9bb5df;p=libserialport.git diff --git a/configure.ac b/configure.ac index 3a13ff7..fa40460 100644 --- a/configure.ac +++ b/configure.ac @@ -29,7 +29,7 @@ m4_define([sp_package_version], [sp_package_version_major.sp_package_version_min AC_INIT([libserialport], [sp_package_version], [martin-libserialport@earth.li], [libserialport], [http://sigrok.org/wiki/Libserialport]) -AC_CONFIG_HEADERS([config.h libserialport.h]) +AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([autostuff]) AC_CONFIG_AUX_DIR([autostuff]) @@ -50,6 +50,19 @@ AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S +## SP_PROG_VERSION(program, sh-var) +## Obtain the version of and store it in . +AC_DEFUN([SP_PROG_VERSION], +[dnl +m4_assert([$# >= 2])[]dnl +sp_prog_ver=`$1 --version 2>&AS_MESSAGE_LOG_FD | sed 1q 2>&AS_MESSAGE_LOG_FD` +AS_CASE([[$]?:$sp_prog_ver], + [[0:*[0-9].[0-9]*]], [$2=$sp_prog_ver], + [$2=unknown])[]dnl +]) + +SP_PROG_VERSION([$CC], [sp_cc_version]) + # Initialize libtool. LT_INIT @@ -82,6 +95,9 @@ AM_CONDITIONAL([FREEBSD], [test -z "${host_os##freebsd*}"]) AM_COND_IF([WIN32], [SP_LIBS='-lsetupapi'], [SP_LIBS=]) AC_SUBST([SP_LIBS]) +AM_COND_IF([FREEBSD], [SP_PKGLIBS='libusb-2.0'], [SP_PKGLIBS=]) +AC_SUBST([SP_PKGLIBS]) + AM_COND_IF([MACOSX], [AC_CHECK_HEADER([IOKit/IOKitLib.h], [], [AC_MSG_ERROR([IOKit/IOKitLib.h not found])])]) @@ -110,6 +126,13 @@ AC_CHECK_DECLS([BOTHER],,, [[#include ]]) # Check for serial_struct. AC_CHECK_TYPES([struct serial_struct],,, [[#include ]]) +# Check for realpath(). +AC_CHECK_FUNC([realpath], [AC_DEFINE(HAVE_REALPATH, 1, [realpath is available.])], []) + +# Check for clock_gettime(). +AC_CHECK_FUNC([clock_gettime], + [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [clock_gettime is available.])], []) + AC_CACHE_CHECK([for visibility control], [sp_cv_visibility_control], [ sp_saved_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Werror" @@ -143,5 +166,12 @@ libserialport configuration summary: - Prefix.......................... $prefix - Building on..................... $build - Building for.................... $host + - Building shared / static........ $enable_shared / $enable_static + +Compile configuration: + - C compiler...................... $CC + - C compiler version.............. $sp_cc_version + - C compiler flags................ $CFLAGS + - Linker flags.................... $LDFLAGS _EOF