gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/8] Use the native autoconf support for cross-compilation


From: Ladislav Michl
Subject: [PATCH 1/8] Use the native autoconf support for cross-compilation
Date: Mon, 3 Dec 2018 10:36:12 +0100
User-agent: Mutt/1.10.1 (2018-07-13)

From: Fabrizio Gennari <address@hidden>

Remove homebrew --enable-win option and use the standard autoconf way
to cross-compile, that is using option --host.
---
 ChangeLog    |  3 ++
 configure.ac | 77 ++++++++++++++++++++--------------------------------
 2 files changed, 33 insertions(+), 47 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b2016d7f..d09275ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -114,6 +114,9 @@
  * pcsc driver updates
     o drop support for model=pcsc that was deprecated in libgnokii
       0.6.28 and renamed as model=APDU              (Daniele Forsi)
+ * build updates
+    o use the native Autoconf support for cross-compilation, that
+      is passing --host= to the configure script
 
 0.6.31
 ======
diff --git a/configure.ac b/configure.ac
index e6cefb54..379c7412 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,31 +81,23 @@ AC_SUBST(GETTEXT_PACKAGE)
 AM_GLIB_GNU_GETTEXT
 AM_ICONV
 
-dnl -----------------------------
-dnl Checks for FreeBSD Build
-dnl -----------------------------
-AC_MSG_CHECKING(if building on FreeBSD)
 
-if test `uname -s` = "FreeBSD" ; then
-       AC_MSG_RESULT(yes)
+case x"$host_os" in
+ xfreebsd)
        CPPFLAGS="$CFLAGS -I/usr/local/include"
        LDFLAGS="$LDFLAGS -L/usr/local/lib"
-else
-       AC_MSG_RESULT(no)
-fi
-
-dnl -----------------------------
-dnl Checks for NetBSD Build
-dnl -----------------------------
-AC_MSG_CHECKING(if building on NetBSD)
-
-if test `uname -s` = "NetBSD" ; then
-        AC_MSG_RESULT(yes)
+       ;;
+ xnetbsd*)
         CPPFLAGS="$CFLAGS -I/usr/pkg/include/"
         LDFLAGS="$LDFLAGS -L/usr/pkg/lib/"
-else
-        AC_MSG_RESULT(no)
-fi
+        ;;
+ xcygwin32|xcygwin|xmingw32|xmingw32msvc)
+  WIN32=1
+  ;;
+ xdarwin*)
+  FOR_MAC=1
+  ;;
+esac
 
 dnl ======================== Libtool versioning
 AC_LIBTOOL_WIN32_DLL
@@ -522,8 +514,9 @@ AC_ARG_ENABLE(bluetooth,
                             ),,
               [enable_bluetooth=yes])
 
+case "$host_os" in
+linux*)
 dnl ======================== Checks for Linux Bluetooth support
-if test `uname -s` = "Linux" ; then
        if test "$enable_bluetooth" = "yes" -a "$USE_BLUETOOTH" = "no"; then
                AC_MSG_NOTICE([checking for the Linux Bluetooth support])
                AC_CACHE_CHECK(for the struct sockaddr_rc in 
<bluetooth/rfcomm.h>, ac_cv_have_sockaddr_rc,
@@ -541,10 +534,9 @@ if test `uname -s` = "Linux" ; then
                        AC_SUBST(BLUETOOTH_LIBS)
                fi
        fi
-fi
-
+       ;;
+darwin*)
 dnl ======================== Checks for MacOSX Bluetooth support
-if test `uname -s` = "Darwin" ; then
        if test "$enable_bluetooth" = "yes" -a "$USE_BLUETOOTH" = "no"; then
                AC_LANG_PUSH([Objective C])
                AC_CHECK_HEADERS(IOBluetooth/objc/IOBluetoothRFCOMMChannel.h)
@@ -569,11 +561,10 @@ if test `uname -s` = "Darwin" ; then
                        AC_SUBST(BLUETOOTH_LIBS)
                fi
        fi
-fi
-AM_CONDITIONAL([FOR_MAC], [test x$ac_cv_have_iobluetooth = xyes])
+       ;;
 
 dnl ======================== Checks for FreeBSD/netgraph Bluetooth support
-if test `uname -s` = "FreeBSD" ; then
+freebsd)
        if test "$enable_bluetooth" = "yes" -a "$USE_BLUETOOTH" = "no"; then
                AC_MSG_NOTICE([checking for the FreeBSD/netgraph Bluetooth 
support])
                AC_CACHE_CHECK(for the struct sockaddr_rfcomm from 
<bluetooth.h>, ac_cv_have_sockaddr_rfcomm,
@@ -596,10 +587,10 @@ if test `uname -s` = "FreeBSD" ; then
                        fi
                fi
        fi
-fi
+       ;;
 
 dnl ======================== Checks for NetBSD/netbt Bluetooth support
-if test `uname -s` = "NetBSD" ; then
+netbsd*)
        if test "$enable_bluetooth" = "yes" -a "$USE_BLUETOOTH" = "no"; then
                AC_MSG_NOTICE([checking for the NetBSD/netbt Bluetooth support])
                AC_CACHE_CHECK(for the struct sockaddr_bt from <bluetooth.h>, 
ac_cv_have_sockaddr_bt,
@@ -623,7 +614,8 @@ if test `uname -s` = "NetBSD" ; then
                        fi
                fi
        fi
-fi
+       ;;
+esac
 
 dnl ======================== Checks for X base support
 
@@ -797,26 +789,17 @@ if test "$enable_libpcsclite" = "yes"; then
        fi
 fi
 
-AC_ARG_ENABLE(win,
-   [  --enable-win            if you want Windows support ],
-   [ if test x$enable_win32 = xyes; then
-       AC_DEFINE(WIN32, 1, [Whether compiling on Windows])
-       WIN32=1
-       if test x$cross_compiling = xyes; then
-               AC_DEFINE(WIN32_CROSS, 1, [Define if you cross compile 
Windows.])
-               WIN32_CROSS=1
-               win32="cross"
-       else
-               win32="yes"
+if test x"$host_os" = "xcygwin32" -o x"$host_os" = "xcygwin" -o x"$host_os" = 
"xmingw32" -o x"$host_os" = "xmingw32msvc"; then
+       AC_CHECK_HEADER(af_irda.h, [AC_DEFINE(HAVE_IRDA, 1, [Whether IrDA is 
available]) USE_IRDA="yes" LIBS="$LIBS -lwinmm"],, [#include <windows.h>])
+       AC_CHECK_HEADER(ws2bth.h, [AC_DEFINE(HAVE_BLUETOOTH, 1, [Whether 
Bluetooth is available]) USE_BLUETOOTH="yes"],, [#include <windows.h>])
+       if test x"$USE_IRDA" = "xyes" -o x"$USE_BLUETOOTH" = "xyes"; then
+         LIBS="$LIBS -lws2_32"
        fi
-       AC_CHECK_HEADER(af_irda.h, [AC_DEFINE(HAVE_IRDA, 1, [Whether IrDA is 
available]) USE_IRDA="yes"])
-     else
-       win32="no"
-     fi ],
-   [ win32="no"]
-)
+       WIN32=1
+fi
 
 AM_CONDITIONAL(WIN32, test "x$WIN32" = "x1")
+AM_CONDITIONAL([FOR_MAC], [test "x$FOR_MAC" = "x1"])
 
 AC_ARG_ENABLE(unix98test,
    [  --enable-unix98test     if you want to disable UNIX98 test and assume to
-- 
2.20.0.rc1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]