Skip to content

Commit

Permalink
Adjust autoconf files for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
utelle committed Oct 4, 2023
1 parent 9f21b64 commit 7aa12a6
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ AM_CFLAGS += -std=c99 -DSQLITE_THREADSAFE=1 -DSQLITE_DQS=0 -DSQLITE_MAX_ATTACHED

AM_LDFLAGS = -pthread -ldl -lm

if HOST_OSX
AM_LDFLAGS += -framework Security
endif

LDADD = lib@WXSQLITE3_LIBNAME@.la $(WX_LIBS)

# Define the directory where the library headers are installed.
Expand Down Expand Up @@ -71,6 +75,10 @@ samples_minimal_SOURCES = \

samples_minimal_LDFLAGS = -no-install

if HOST_OSX
samples_minimal_LDFLAGS += -framework Security
endif

samples_treeview_treeview_SOURCES = \
samples/treeview/foldertree.cpp \
samples/treeview/projectlist.cpp \
Expand All @@ -84,3 +92,7 @@ samples_treeview_treeview_SOURCES = \
samples_treeview_treeview_LDADD = $(WX_LIBS_TREEVIEW_SAMPLE) $(LDADD)

samples_treeview_treeview_LDFLAGS = -no-install

if HOST_OSX
samples_treeview_treeview_LDFLAGS += -framework Security
endif
26 changes: 26 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,31 @@ AS_CASE([$host_cpu],
AM_CONDITIONAL([HOST_X86], [test x$hostX86 = xtrue])
AM_CONDITIONAL([HOST_ARM], [test x$hostARM = xtrue])

dnl Detect the target system

build_linux=no
build_windows=no
build_mac=no

case "${host_os}" in
linux*)
build_linux=yes
;;
cygwin*|mingw*)
build_windows=yes
;;
darwin*)
build_mac=yes
;;
*)
AC_MSG_ERROR(["OS $host_os is not supported"])
;;
esac

dnl Pass the conditionals to automake
AM_CONDITIONAL([HOST_LINUX], [test "$build_linux" = "yes"])
AM_CONDITIONAL([HOST_WINDOWS], [test "$build_windows" = "yes"])
AM_CONDITIONAL([HOST_OSX], [test "$build_mac" = "yes"])

AC_CONFIG_FILES([Makefile wxsqlite3.pc])
AC_OUTPUT

0 comments on commit 7aa12a6

Please sign in to comment.