Skip to content

Commit

Permalink
Merge pull request #81 from master131/master
Browse files Browse the repository at this point in the history
Automake fixes for Windows
  • Loading branch information
windytan authored Feb 20, 2022
2 parents 39ab233 + 984833a commit d0c1b2d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
21 changes: 20 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,29 @@ AC_CHECK_LIB([sndfile], [main],
[AC_MSG_FAILURE(
[Could not find libsndfile])])

WIN_CF=
LIBC=

AC_MSG_CHECKING([whether compiling for Windows])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#if !defined(_WIN32) && !defined(_WIN64)
#error not compiling for Windows
#endif
]])],
# Windows
[AC_MSG_RESULT([yes]); AC_SUBST([WIN_CF], ["-D_USE_MATH_DEFINES=1"])],
# Unix
[AC_MSG_RESULT([no]); AC_SUBST([LIBC], ["-lc"])])

CPP_STD=c++14
AC_CANONICAL_HOST
case "${host_os}" in
darwin*)
darwin*|msys*|mingw*)
AC_SUBST([ICONV], ["-liconv"])
;;
cygwin*)
AC_SUBST([ICONV], ["-liconv"])
AC_SUBST([CPP_STD], ["gnu++14"])
;;
esac

Expand Down
6 changes: 3 additions & 3 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bin_PROGRAMS = redsea
redsea_CPPFLAGS = -std=c++14 -Wall -Wextra -Wstrict-overflow -Wshadow -Wdouble-promotion -Wundef -Wpointer-arith -Wcast-align -Wcast-qual -Wuninitialized -pedantic \
$(MACPORTS_CF) $(RFLAGS)
redsea_LDADD = $(MACPORTS_LD) -lc $(LIQUID) $(ICONV) $(SNDFILE)
redsea_CPPFLAGS = -std=$(CPP_STD) -Wall -Wextra -Wstrict-overflow -Wshadow -Wdouble-promotion -Wundef -Wpointer-arith -Wcast-align -Wcast-qual -Wuninitialized -pedantic \
$(MACPORTS_CF) $(RFLAGS) $(WIN_CF)
redsea_LDADD = $(MACPORTS_LD) $(LIBC) $(LIQUID) $(ICONV) $(SNDFILE)
redsea_SOURCES = redsea.cc common.cc input.cc subcarrier.cc block_sync.cc groups.cc \
tables.cc rdsstring.cc tmc/tmc.cc tmc/locationdb.cc util.cc \
channel.cc options.cc liquid_wrappers.cc jsoncpp.cpp

0 comments on commit d0c1b2d

Please sign in to comment.