From: Jay Freeman (saurik) Date: Sun, 23 Jun 2013 08:33:16 +0000 (-0700) Subject: Automatically fatten build, detect iOS simulator. X-Git-Tag: v0.9.500%b1~46 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/bfde1b7684ee8188d85de78bfeeef95b973587fd Automatically fatten build, detect iOS simulator. --- diff --git a/Makefile.am b/Makefile.am index 29221b1..1945785 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,9 +29,15 @@ ACLOCAL_AMFLAGS = -I m4 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 @@ -91,6 +97,25 @@ Trampoline.t.hpp: libTrampoline.t.la trampoline.sh ! 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) diff --git a/configure.ac b/configure.ac index 85a68e4..d5d72f6 100644 --- a/configure.ac +++ b/configure.ac @@ -29,8 +29,14 @@ AC_CONFIG_HEADERS([config.h]) 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 @@ -143,6 +149,15 @@ for cy_arch in ppc ppc64 i386 x86_64 armv6; do 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