diff --git a/Makefile.am b/Makefile.am index 820077a0..c00344a7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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. @@ -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 \ @@ -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 diff --git a/configure.ac b/configure.ac index 3f115b0a..dc333289 100644 --- a/configure.ac +++ b/configure.ac @@ -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