Skip to content

Commit

Permalink
libticonv: Fix build on macOS
Browse files Browse the repository at this point in the history
This now works fine for a system- or brew-provided libiconv.
  • Loading branch information
adriweb committed Jun 21, 2017
1 parent 933b4c6 commit 936c2b0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libticonv/trunk/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ case "$host" in
esac
CFLAGS="$CFLAGS $ARCH"

build_mac=''
case "${host_os}" in
darwin*)
build_mac='yes'
;;
esac

AM_CONDITIONAL(OS_MAC, test "$build_mac")

# Ensure MSVC-compatible struct packing convention is used when
# compiling for Win32 with gcc.
# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
Expand Down
4 changes: 4 additions & 0 deletions libticonv/trunk/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ if OS_WIN32
libticonv_la_LDFLAGS += -Wl,../build/mingw/ticonv-rc.o -Wl,--output-def,libticonv.def
EXTRA_DIST = libticonv.def
endif

if OS_MAC
libticonv_la_LIBADD += -liconv
endif
3 changes: 3 additions & 0 deletions libticonv/trunk/src/iconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#include <stdio.h>
#include <string.h>
#include <glib.h>
#if defined(__MACOSX__)
# define LIBICONV_PLUG
#endif
#include <iconv.h>
#include <errno.h>

Expand Down

0 comments on commit 936c2b0

Please sign in to comment.