diff --git a/configure.ac b/configure.ac index 4a8099c2ca..59352b8994 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,7 @@ AM_PROG_AS AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files]) AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :) +AC_CHECK_PROGS(YASM, yasm) dnl Check for compiler properties AC_C_CONST @@ -96,6 +97,18 @@ dnl dnl Check the operating system dnl HAVE_WIN64="0" + +YASMFLAGS="" +case "${host}" in + i?86*) + YASMFLAGS="-f elf32" + ;; + x86_64*) + YASMFLAGS="-f elf64" + ;; +esac + + case "${host_os}" in "") SYS=unknown @@ -131,6 +144,7 @@ case "${host_os}" in case "${host}" in i?86*) ARCH_flag="-arch i386" + YASMFLAGS="-f macho32" ;; ppc64*) ARCH_flag="-arch ppc64" @@ -140,6 +154,7 @@ case "${host_os}" in ;; x86_64*) ARCH_flag="-arch x86_64" + YASMFLAGS="-f macho64" ;; arm*) ac_cv_c_bigendian="no" @@ -237,10 +252,12 @@ case "${host_os}" in HAVE_WIN64="1" WINDOWS_ARCH="x64" PROGRAMFILES="PROGRAMFILES64" + YASMFLAGS="-f win64" ;; *) WINDOWS_ARCH="x86" PROGRAMFILES="PROGRAMFILES" + YASMFLAGS="-f win32" ;; esac AC_SUBST(WINDOWS_ARCH) @@ -275,6 +292,8 @@ AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32") AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") AM_CONDITIONAL(HAVE_SYMBIAN, test "${SYS}" = "symbian") +AC_SUBST(YASMFLAGS) + dnl dnl Sadly autoconf does not think about testing foo.exe when ask to test dnl for program foo on win32 diff --git a/m4/dolt.m4 b/m4/dolt.m4 index d14bbe781b..ff28bef516 100644 --- a/m4/dolt.m4 +++ b/m4/dolt.m4 @@ -12,36 +12,24 @@ AC_DEFUN([DOLT], [ AC_REQUIRE([AC_CANONICAL_HOST]) # dolt, a replacement for libtool # Josh Triplett -AC_PATH_PROG(DOLT_BASH, bash) +AC_PATH_PROG([DOLT_BASH], [bash]) AC_MSG_CHECKING([if dolt supports this host]) dolt_supported=yes -if test x$DOLT_BASH = x; then - dolt_supported=no -fi -if test x$GCC != xyes; then - dolt_supported=no -fi -case $host in -*-*-linux* \ -|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*) - pic_options='-fPIC' - ;; -*-apple-darwin*) - pic_options='-fno-common' - ;; -*mingw*|*nacl*) - pic_options='' - ;; -*) - dolt_supported=no - ;; -esac -if test x$dolt_supported = xno ; then +AS_IF([test x$DOLT_BASH = x], [dolt_supported=no]) +AS_IF([test x$GCC != xyes], [dolt_supported=no]) + +AS_CASE([$host], + [*-*-linux*|*-*-freebsd*], [pic_options='-fPIC'], + [*-apple-darwin*], [pic_options='-fno-common'], + [*mingw*|*nacl*], [pic_options=''] + [*], [dolt_supported=no] +) +AS_IF([test x$dolt_supported = xno], [ AC_MSG_RESULT([no, falling back to libtool]) LTCOMPILE='$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)' LTCXXCOMPILE='$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)' m4_pattern_allow([AM_V_lt]) -else +], [ AC_MSG_RESULT([yes, replacing libtool]) dnl Start writing out doltcompile. @@ -85,7 +73,13 @@ pic_object="$libobjdir/$objbase.o" args@<:@$objarg@:>@="$pic_object" __DOLTCOMPILE__EOF__ cat <<__DOLTCOMPILE__EOF__ >>doltcompile -"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$? + pic_options="$pic_options" + if test x\$passthrough = xtrue; then + pic_options="" + fi +__DOLTCOMPILE__EOF__ + cat <<'__DOLTCOMPILE__EOF__' >>doltcompile +${args@<:@@@:>@} $pic_options -DPIC || exit $? __DOLTCOMPILE__EOF__ fi @@ -161,6 +155,7 @@ for arg in "$[]@"; do case "$arg" in --mode=compile) modeok=true ;; --tag=CC|--tag=CXX) tagok=true ;; + --tag=ASM|--tag=YASM) tagok=true; passthrough=true;; --silent|--quiet) ;; *) args@<:@${#args[@]}@:>@="$arg" ;; esac @@ -175,7 +170,10 @@ __DOLTLIBTOOL__EOF__ dnl Done writing out doltlibtool; substitute it for libtool. chmod +x doltlibtool LIBTOOL='$(top_builddir)/doltlibtool' -fi + +DOLT_CLEANFILES="doltlibtool doltcompile" +AC_SUBST(DOLT_CLEANFILES) +]) AC_SUBST(LTCOMPILE) AC_SUBST(LTCXXCOMPILE) # end dolt diff --git a/modules/common.am b/modules/common.am index 94fb399bd0..9f78fb9a39 100644 --- a/modules/common.am +++ b/modules/common.am @@ -35,3 +35,8 @@ AM_LDFLAGS = \ if HAVE_WIN32 AM_LDFLAGS += $(top_builddir)/modules/module.rc.lo endif + +SUFFIXES = .asm + +.asm.lo: + $(LIBTOOL) --mode=compile --tag=ASM $(YASM) $(YASMFLAGS) $< -o $@ diff --git a/modules/gui/qt4/Makefile.am b/modules/gui/qt4/Makefile.am index f0b8095ec0..82f55fbcb4 100644 --- a/modules/gui/qt4/Makefile.am +++ b/modules/gui/qt4/Makefile.am @@ -12,7 +12,7 @@ guidir = $(pluginsdir)/gui # For each ressource (icon, png, ...) # - Add it to DEPS_res -SUFFIXES = .ui .h .hpp .moc.cpp +SUFFIXES += .ui .h .hpp .moc.cpp libqt4_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) libqt4_plugin_la_LIBADD = $(QT_LIBS)