]> sigrok.org Git - libserialport.git/blobdiff - configure.ac
doc: Additional notes on sp_last_error_{code,message}.
[libserialport.git] / configure.ac
index f01644b95c2f1a89c5e73e34a47f4fa1f689206d..e569ee07f2dd296d8b4aa147929e8055f31efe15 100644 (file)
@@ -23,8 +23,8 @@ AC_PREREQ([2.63])
 
 # libserialport package version number (NOT the same as shared lib version!).
 m4_define([sp_package_version_major], [0])
-m4_define([sp_package_version_minor], [2])
-m4_define([sp_package_version_micro], [0])
+m4_define([sp_package_version_minor], [1])
+m4_define([sp_package_version_micro], [1])
 m4_define([sp_package_version], [sp_package_version_major.sp_package_version_minor.sp_package_version_micro])
 
 AC_INIT([libserialport], [sp_package_version], [martin-libserialport@earth.li],
@@ -33,14 +33,15 @@ AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([autostuff])
 AC_CONFIG_AUX_DIR([autostuff])
 
+AH_TOP([#ifndef SP_CONFIG_H
+#define SP_CONFIG_H])
+AH_BOTTOM([#endif])
+
 # We require at least automake 1.11 (needed for 'silent rules').
 AM_INIT_AUTOMAKE([1.11 -Wall -Werror check-news])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 
-# Enable more compiler warnings.
-CFLAGS="$CFLAGS -std=c99 -Wall -Wextra -pedantic -Wmissing-prototypes"
-
 # Checks for programs.
 AC_PROG_CC
 AC_PROG_CPP
@@ -71,10 +72,6 @@ AC_SUBST(SP_LIB_LDFLAGS)
 
 # Checks for libraries.
 
-# This variable collects the pkg-config names of all detected libs.
-# It is then used to construct the "Requires.private:" field in the
-# libserialport.pc file.
-SP_PKGLIBS=""
 SP_LIBS=""
 
 case $host_os in
@@ -89,7 +86,6 @@ case $host_os in
        AM_CONDITIONAL([WIN32], false)
        AM_CONDITIONAL([MACOSX], true)
        AM_CONDITIONAL([FREEBSD], false)
-       LDFLAGS="$LDFLAGS -Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation"
        AC_CHECK_HEADER(IOKit/IOKitLib.h, [], [AC_MSG_ERROR([IOKit/IOKitLib.h not found])])
        ;;
 mingw* | cygwin*)
@@ -97,7 +93,7 @@ mingw* | cygwin*)
        AM_CONDITIONAL([WIN32], true)
        AM_CONDITIONAL([MACOSX], false)
        AM_CONDITIONAL([FREEBSD], false)
-       SP_LIBS="-lsetupapi -luuid"
+       SP_LIBS="-lsetupapi"
        ;;
 *freebsd*)
        AM_CONDITIONAL([LINUX], false)
@@ -114,7 +110,6 @@ mingw* | cygwin*)
        AC_DEFINE(NO_PORT_METADATA,,[Port metadata is unavailable])
 esac
 
-AC_SUBST(SP_PKGLIBS)
 AC_SUBST(SP_LIBS)
 
 # Define size_t if not defined as standard.
@@ -165,12 +160,12 @@ AC_DEFINE(SP_PRIV,,[Macro preceding private functions])
 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
                __attribute__((visibility("hidden"))) void foo(void) { }
        ]])],
-       [AC_DEFINE(SP_API , __attribute__((visibility("default"))))]
+       [AC_DEFINE(SP_API, __attribute__((visibility("default"))))]
        [AC_DEFINE(SP_PRIV, __attribute__((visibility("hidden"))))],
 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
                __declspec(dllexport) void foo(void) { }
        ]])],
-       [AC_DEFINE(SP_API , __declspec(dllexport))]
+       [AC_DEFINE(SP_API, __declspec(dllexport))]
        [AC_DEFINE(SP_PRIV,)],
        [AC_DEFINE(SP_API,)]
        [AC_DEFINE(SP_PRIV,)]))