CLEANFILES += Trampoline.t.lo
Trampoline.t.lo: Trampoline.t.cpp Trampoline.hpp Baton.hpp Standard.hpp
- $(LTCXXCOMPILE) -c -o $@ $< -fno-stack-protector -fno-exceptions -O0
+ $(LTCXXCOMPILE) $(CY_ARCH) -c -o $@ $< -fno-stack-protector -O0
CLEANFILES += libTrampoline.t.la
libTrampoline.t.la: Trampoline.t.lo
- $(CXXLINK) -rpath $(libdir) $^
+ $(CXXLINK) $(CY_ARCH) -rpath $(libdir) $^
CLEANFILES += Trampoline.t.hpp
Trampoline.t.hpp: libTrampoline.t.la trampoline.sh
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+CY_ARCH = @CY_ARCH@
CY_ATTACH_GROUP = @CY_ATTACH_GROUP@
CY_EXECUTE = @CY_EXECUTE@
CY_FILTERS = @CY_FILTERS@
@CY_CONSOLE_TRUE@@CY_MACH_TRUE@Mach/Inject.$(OBJEXT): Trampoline.t.hpp
@CY_CONSOLE_TRUE@@CY_MACH_TRUE@Trampoline.t.lo: Trampoline.t.cpp Trampoline.hpp Baton.hpp Standard.hpp
-@CY_CONSOLE_TRUE@@CY_MACH_TRUE@ $(LTCXXCOMPILE) -c -o $@ $< -fno-stack-protector -fno-exceptions -O0
+@CY_CONSOLE_TRUE@@CY_MACH_TRUE@ $(LTCXXCOMPILE) $(CY_ARCH) -c -o $@ $< -fno-stack-protector -O0
@CY_CONSOLE_TRUE@@CY_MACH_TRUE@libTrampoline.t.la: Trampoline.t.lo
-@CY_CONSOLE_TRUE@@CY_MACH_TRUE@ $(CXXLINK) -rpath $(libdir) $^
+@CY_CONSOLE_TRUE@@CY_MACH_TRUE@ $(CXXLINK) $(CY_ARCH) -rpath $(libdir) $^
@CY_CONSOLE_TRUE@@CY_MACH_TRUE@Trampoline.t.hpp: libTrampoline.t.la trampoline.sh
@CY_CONSOLE_TRUE@@CY_MACH_TRUE@ $(srcdir)/trampoline.sh $@ .libs/libTrampoline.t.dylib Trampoline $(SED) $(LIPO) $(NM) $(OTOOL)
@CY_CONSOLE_TRUE@@CY_MACH_TRUE@ ! grep '## symbol stub for:' $@
WEBKIT_LIBS
WEBKIT_CFLAGS
CY_EXECUTE
+CY_ARCH
CY_FILTERS
GNUTAR
GPERF
-am_cv_CC_dependencies_compiler_type=none
-am_cv_CXX_dependencies_compiler_type=none
-am_cv_OBJCXX_dependencies_compiler_type=none
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+for cy_arch in ppc ppc64 i386 x86_64 armv6; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -arch $cy_arch" >&5
+$as_echo_n "checking for -arch $cy_arch... " >&6; }
+
+ cy_save=$CXXFLAGS
+
+ for element in "-arch $cy_arch"; do
+ haveit=
+ for x in $CXXFLAGS; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CXXFLAGS="${CXXFLAGS}${CXXFLAGS:+ }$element"
+ fi
+ done
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ cy_good=1
+else
+ cy_good=0
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ CXXFLAGS=$cy_save
+ if test "x$cy_good" = x1; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+ for element in "-arch $cy_arch"; do
+ haveit=
+ for x in $CY_ARCH; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CY_ARCH="${CY_ARCH}${CY_ARCH:+ }$element"
+ fi
+ done
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+done
+
+
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_CC
AC_PROG_CXX
AC_PROG_OBJCXX
AC_SUBST(]$1[)
])
+dnl -arch * {{{
+for cy_arch in ppc ppc64 i386 x86_64 armv6; do
+ AC_MSG_CHECKING([for -arch $cy_arch])
+ CY_TRY([CXXFLAGS], ["-arch $cy_arch"], [
+ AC_TRY_LINK([], [], [CY_SUCCESS], [CY_FAILURE])
+ ], [
+ AC_MSG_RESULT([yes])
+ AC_LIB_APPENDTOVAR([CY_ARCH], ["-arch $cy_arch"])
+ ], [AC_MSG_RESULT([no])])
+done
+AC_SUBST([CY_ARCH])
+dnl }}}
+
dnl --enable-javascript {{{
AC_DEFUN([CY_CHECK_JAVASCRIPTCORE], [
CY_LT_LIB([LTJAVASCRIPTCORE], [AC_CHECK_FRAMEWORK([JavaScriptCore], [
clean:
rm -rf cycript .libs
-build-mac:
- $(MAKE) -C build.mac
-
-build-ios:
- $(MAKE) -C build.ios
-
-build-sim:
- $(MAKE) -C build.sim
-
# make stubbornly refuses to believe that these @'s are bugs
# http://osdir.com/ml/help-make-gnu/2012-04/msg00008.html
-build.mac/.libs/cycript: build-mac
+define build_mac
+.PHONY: build-mac-$(1)
+build-mac-$(1):
+ $(MAKE) -C build.mac-$(1)
+build.mac-$(1)/.libs/cycript: build-mac-$(1)
@
-build.mac/.libs/libcycript.dylib: build-mac
+build.mac-$(1)/.libs/libcycript.dylib: build-mac-$(1)
@
-build.mac/.libs/libcycript-any.dylib: build-mac
+build.mac-$(1)/.libs/libcycript-any.dylib: build-mac-$(1)
@
+endef
-build.ios/.libs/cycript: build-ios
+$(foreach arch,i386 x86_64,$(eval $(call build_mac,$(arch))))
+
+define build_ios
+.PHONY: build-ios-$(1)
+build-ios-$(1):
+ $(MAKE) -C build.ios-$(1)
+build.ios-$(1)/.libs/cycript: build-ios-$(1)
@
-build.ios/.libs/libcycript.dylib: build-ios
+build.ios-$(1)/.libs/libcycript.dylib: build-ios-$(1)
@
-build.ios/.libs/libcycript-any.dylib: build-ios
+build.ios-$(1)/.libs/libcycript-any.dylib: build-ios-$(1)
@
-build.ios/.libs/libcycript.a: build-ios
+build.ios-$(1)/.libs/libcycript.a: build-ios-$(1)
@
+endef
+
+$(foreach arch,armv6 armv7,$(eval $(call build_ios,$(arch))))
-build.sim/.libs/libcycript.dylib: build-sim
+define build_sim
+.PHONY: build-sim-$(1)
+build-sim-$(1):
+ $(MAKE) -C build.sim-$(1)
+build.sim-$(1)/.libs/libcycript.dylib: build-sim-$(1)
@
-build.sim/.libs/libcycript.a: build-sim
+build.sim-$(1)/.libs/libcycript.a: build-sim-$(1)
@
+endef
+
+$(foreach arch,i386,$(eval $(call build_sim,$(arch))))
-.libs/%: build.mac/.libs/% build.ios/.libs/%
+.libs/%: build.mac-i386/.libs/% build.mac-x86_64/.libs/% build.ios-armv6/.libs/%
@mkdir -p .libs
lipo -create -output $@ $^
-.libs/%-ios.a: build.ios/.libs/%.a build.sim/.libs/%.a
+.libs/%-ios.a: build.ios-armv6/.libs/%.a build.ios-armv7/.libs/%.a build.sim/.libs/%.a
@mkdir -p .libs
lipo -create -output $@ $^
@mkdir -p .libs
ln -sf libcycript.dylib $@
-.libs/libcycript-sim.dylib: build.sim/.libs/libcycript.dylib
+.libs/libcycript-sim.dylib: build.sim-i386/.libs/libcycript.dylib
@mkdir -p .libs
cp -af $< $@
@mkdir -p .libs
ld -r -arch $$(lipo -detailed_info $< | sed -e '/^Non-fat file: / ! d; s/.*: //') -o $@ -all_load $< libffi.a
-.libs/libcycript.o: .libs/libcycript-ios.o .libs/libcycript-sim.o
+.libs/libcycript.o: .libs/libcycript-ios-armv6.o .libs/libcycript-ios-armv7.o .libs/libcycript-sim-i386.o
lipo -create -output $@ $^
cycript: cycript.in
cp -af $< $@
chmod 755 $@
-.PHONY: all clean build-mac build-ios build-sim
+.PHONY: all clean
cd ..
}
-configure mac "${mac}" "-arch i386 -arch x86_64 -mmacosx-version-min=10.6" CPPFLAGS="-I../readline" LDFLAGS="-L../readline"
+for arch in i386 x86_64; do
+ configure "mac-${arch}" "${mac}" "-arch ${arch} -mmacosx-version-min=10.6" CPPFLAGS="-I../readline" LDFLAGS="-L../readline"
+done
function build() {
local dir=$1
configure "${dir}" "${sdk}" "${flg}" "$@" --enable-static --with-pic #CPPFLAGS="-idirafter ${mac}/usr/include"
}
-build sim iphonesimulator "-arch i386 -mios-simulator-version-min=2.0" OBJCXXFLAGS="-fobjc-abi-version=2 -fobjc-legacy-dispatch" CPPFLAGS="-I../libffi.i386/include" LDFLAGS="-L.." --disable-console
-build ios iphoneos5.1 "-arch armv6 -miphoneos-version-min=2.0" --host=arm-apple-darwin10 CPPFLAGS="-I../libffi.armv6/include -I../sysroot.ios/usr/include -I../sysroot.ios/usr/include/apr-1" LTLIBAPR="../sysroot.ios/usr/lib/libapr-1.dylib" LDFLAGS="-L.. -L../sysroot.ios/usr/lib"
+for arch in i386; do
+ build "sim-${arch}" iphonesimulator "-arch ${arch} -mios-simulator-version-min=2.0" OBJCXXFLAGS="-fobjc-abi-version=2 -fobjc-legacy-dispatch" CPPFLAGS="-I../libffi.${arch}/include" LDFLAGS="-L.." --disable-console
+done
+
+for arch in armv6 armv7; do
+ build "ios-${arch}" iphoneos5.1 "-arch ${arch} -miphoneos-version-min=2.0" --host=arm-apple-darwin10 CPPFLAGS="-I../libffi.${arch}/include -I../sysroot.ios/usr/include -I../sysroot.ios/usr/include/apr-1" LTLIBAPR="../sysroot.ios/usr/lib/libapr-1.dylib" LDFLAGS="-L.. -L../sysroot.ios/usr/lib"
+done