Skip to content

Commit

Permalink
bs: Look for gmodule-2.0 via PKG_CHECK_MODULES
Browse files Browse the repository at this point in the history
Look for gmodule-2.0 via PKG_CHECK_MODULES.

This removes the need for the AC_CHECK_LIB() check later.

Not sure why we need to explicitly link against gmodule-2.0
on macOS and not on Linux, but this certainly builds on both.

Fixes one of four from KJ7LNW#16
  • Loading branch information
ndim committed Dec 2, 2022
1 parent e5c17f6 commit 04153e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ AS_VAR_IF([xnc2c_gcr_links], [no], [dnl

# Checks for libraries.
m4_pattern_forbid([PKG_CHECK_MODULES])dnl
PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.18.0])
PKG_CHECK_MODULES([GMODULE], [gmodule-2.0])
PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.18.0])

# GCC has atan2 as a built-in so the autoconf test casts it incorrectly and triggers a warning.
# This causes -Werror to fail and then xnec2c does not link with -lm. Disable built-ins
Expand All @@ -149,7 +150,6 @@ CFLAGS="$CFLAGS_SAVE"
AC_FUNC_MALLOC
AC_FUNC_REALLOC

AC_CHECK_LIB([gmodule-2.0], [g_module_open])
AC_CHECK_LIB([pthread], [pthread_create])

# Provide special options for ATLAS
Expand Down
3 changes: 3 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ xnec2c_CPPFLAGS += -DPROGRAMNAME_LOCALEDIR="\"$(PROGRAMNAME_LOCALEDIR)\""
xnec2c_CPPFLAGS += -DPACKAGE_DATA_DIR="\"$(pkgdata)\""
xnec2c_CPPFLAGS += -DPACKAGE_LOCALE_DIR="\"$(prefix)/$(DATADIRNAME)/locale\""

xnec2c_CPPFLAGS += $(GMODULE_CFLAGS)
xnec2c_LDADD += $(GMODULE_LIBS)

xnec2c_CPPFLAGS += $(GTK_CFLAGS)
xnec2c_LDADD += $(GTK_LIBS)

Expand Down

0 comments on commit 04153e8

Please sign in to comment.