AM_CPPFLAGS = -Werror -fno-common -I$(srcdir)/include -DYYDEBUG=1
AM_CPPFLAGS += -include $(srcdir)/config.h -include $(srcdir)/unconfig.h
+AM_CXXFLAGS = $(CY_ARCH)
+AM_OBJCXXFLAGS = $(CY_ARCH)
+AM_LDFLAGS = $(CY_ARCH)
+
+CY_LDFLAGS = -no-undefined -avoid-version -export-dynamic
+
lib_LTLIBRARIES = libcycript.la
libcycript_la_SOURCES = Highlight.cpp Network.cpp Output.cpp Parser.cpp Replace.cpp
-libcycript_la_LDFLAGS = -no-undefined -avoid-version -export-dynamic
+libcycript_la_LDFLAGS = $(AM_LDFLAGS) $(CY_LDFLAGS)
libcycript_la_LIBADD = $(LTLIBFFI) $(LTLIBICONV) -ldl
libcycript_la_SOURCES += Cycript.tab.cc
! grep '## symbol stub for:' $@
endif
+libcycript_sim_la_SHORTNAME = sim
+if CY_IOS_SIMULATOR
+lib_LTLIBRARIES += libcycript-sim.la
+libcycript_sim_la_SOURCES = $(libcycript_la_SOURCES)
+libcycript_sim_la_CPPFLAGS = $(AM_CPPFLAGS)
+
+CY_SIM_FLAGS = -arch i386 -isysroot $(CY_IOS_SIMULATOR)
+libcycript_sim_la_CXXFLAGS = $(CY_SIM_FLAGS)
+libcycript_sim_la_OBJCXXFLAGS = $(CY_SIM_FLAGS)
+libcycript_sim_la_LDFLAGS = $(CY_SIM_FLAGS) $(CY_LDFLAGS)
+
+libcycript_sim_la_LIBADD = $(LTLIBICONV) -ldl
+
+libcycript_sim_la_CPPFLAGS += -idirafter /usr/include
+libcycript_sim_la_LDFLAGS += -Wl,/usr/lib/libffi.dylib
+
+libcycript_sim_la_OBJCXXFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch
+endif
+
CLEANFILES += Cycript.yy
Cycript.yy: Cycript.yy.in
$(srcdir)/Filter.sh <$< >$@ $(filters)
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_MAINTAINER_MODE([disable])
+dnl XXX: do this only on Mac OS X
+am_cv_CC_dependencies_compiler_type=none
+am_cv_CXX_dependencies_compiler_type=none
+am_cv_OBJCXX_dependencies_compiler_type=none
+
AC_PROG_CXX
AC_PROG_OBJCXX
+
AM_PROG_AR
AC_PROG_INSTALL
done
AC_SUBST([CY_ARCH])
dnl }}}
+dnl iOS SDK {{{
+AC_PATH_PROG([XCODEBUILD], [xcodebuild])
+
+AS_IF([test "x$XCODEBUILD" != x], [
+ AC_SUBST([CY_IOS_SIMULATOR], [`xcodebuild -sdk iphonesimulator -version Path`])
+])
+
+AM_CONDITIONAL([CY_IOS_SIMULATOR], [test "x$CY_IOS_SIMULATOR" != x])
+dnl }}}
AC_DEFUN([CY_LT_LIB], [
cy_save=$LIBS