Commit dcffc924 authored by Luca Barbato's avatar Luca Barbato Committed by Jean-Baptiste Kempf

build: support YASM targets

The files must be .asm
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 18e124ec
...@@ -73,6 +73,7 @@ AM_PROG_AS ...@@ -73,6 +73,7 @@ AM_PROG_AS
AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files]) 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(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
AC_CHECK_PROGS(YASM, yasm)
dnl Check for compiler properties dnl Check for compiler properties
AC_C_CONST AC_C_CONST
...@@ -96,6 +97,18 @@ dnl ...@@ -96,6 +97,18 @@ dnl
dnl Check the operating system dnl Check the operating system
dnl dnl
HAVE_WIN64="0" HAVE_WIN64="0"
YASMFLAGS=""
case "${host}" in
i?86*)
YASMFLAGS="-f elf32"
;;
x86_64*)
YASMFLAGS="-f elf64"
;;
esac
case "${host_os}" in case "${host_os}" in
"") "")
SYS=unknown SYS=unknown
...@@ -131,6 +144,7 @@ case "${host_os}" in ...@@ -131,6 +144,7 @@ case "${host_os}" in
case "${host}" in case "${host}" in
i?86*) i?86*)
ARCH_flag="-arch i386" ARCH_flag="-arch i386"
YASMFLAGS="-f macho32"
;; ;;
ppc64*) ppc64*)
ARCH_flag="-arch ppc64" ARCH_flag="-arch ppc64"
...@@ -140,6 +154,7 @@ case "${host_os}" in ...@@ -140,6 +154,7 @@ case "${host_os}" in
;; ;;
x86_64*) x86_64*)
ARCH_flag="-arch x86_64" ARCH_flag="-arch x86_64"
YASMFLAGS="-f macho64"
;; ;;
arm*) arm*)
ac_cv_c_bigendian="no" ac_cv_c_bigendian="no"
...@@ -237,10 +252,12 @@ case "${host_os}" in ...@@ -237,10 +252,12 @@ case "${host_os}" in
HAVE_WIN64="1" HAVE_WIN64="1"
WINDOWS_ARCH="x64" WINDOWS_ARCH="x64"
PROGRAMFILES="PROGRAMFILES64" PROGRAMFILES="PROGRAMFILES64"
YASMFLAGS="-f win64"
;; ;;
*) *)
WINDOWS_ARCH="x86" WINDOWS_ARCH="x86"
PROGRAMFILES="PROGRAMFILES" PROGRAMFILES="PROGRAMFILES"
YASMFLAGS="-f win32"
;; ;;
esac esac
AC_SUBST(WINDOWS_ARCH) AC_SUBST(WINDOWS_ARCH)
...@@ -275,6 +292,8 @@ AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32") ...@@ -275,6 +292,8 @@ AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1")
AM_CONDITIONAL(HAVE_SYMBIAN, test "${SYS}" = "symbian") AM_CONDITIONAL(HAVE_SYMBIAN, test "${SYS}" = "symbian")
AC_SUBST(YASMFLAGS)
dnl dnl
dnl Sadly autoconf does not think about testing foo.exe when ask to test dnl Sadly autoconf does not think about testing foo.exe when ask to test
dnl for program foo on win32 dnl for program foo on win32
......
...@@ -12,36 +12,24 @@ AC_DEFUN([DOLT], [ ...@@ -12,36 +12,24 @@ AC_DEFUN([DOLT], [
AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_CANONICAL_HOST])
# dolt, a replacement for libtool # dolt, a replacement for libtool
# Josh Triplett <josh@freedesktop.org> # Josh Triplett <josh@freedesktop.org>
AC_PATH_PROG(DOLT_BASH, bash) AC_PATH_PROG([DOLT_BASH], [bash])
AC_MSG_CHECKING([if dolt supports this host]) AC_MSG_CHECKING([if dolt supports this host])
dolt_supported=yes dolt_supported=yes
if test x$DOLT_BASH = x; then AS_IF([test x$DOLT_BASH = x], [dolt_supported=no])
dolt_supported=no AS_IF([test x$GCC != xyes], [dolt_supported=no])
fi
if test x$GCC != xyes; then AS_CASE([$host],
dolt_supported=no [*-*-linux*|*-*-freebsd*], [pic_options='-fPIC'],
fi [*-apple-darwin*], [pic_options='-fno-common'],
case $host in [*mingw*|*nacl*], [pic_options='']
*-*-linux* \ [*], [dolt_supported=no]
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*) )
pic_options='-fPIC' AS_IF([test x$dolt_supported = xno], [
;;
*-apple-darwin*)
pic_options='-fno-common'
;;
*mingw*|*nacl*)
pic_options=''
;;
*)
dolt_supported=no
;;
esac
if test x$dolt_supported = xno ; then
AC_MSG_RESULT([no, falling back to libtool]) AC_MSG_RESULT([no, falling back to libtool])
LTCOMPILE='$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)' 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)' LTCXXCOMPILE='$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
m4_pattern_allow([AM_V_lt]) m4_pattern_allow([AM_V_lt])
else ], [
AC_MSG_RESULT([yes, replacing libtool]) AC_MSG_RESULT([yes, replacing libtool])
dnl Start writing out doltcompile. dnl Start writing out doltcompile.
...@@ -85,7 +73,13 @@ pic_object="$libobjdir/$objbase.o" ...@@ -85,7 +73,13 @@ pic_object="$libobjdir/$objbase.o"
args@<:@$objarg@:>@="$pic_object" args@<:@$objarg@:>@="$pic_object"
__DOLTCOMPILE__EOF__ __DOLTCOMPILE__EOF__
cat <<__DOLTCOMPILE__EOF__ >>doltcompile 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__ __DOLTCOMPILE__EOF__
fi fi
...@@ -161,6 +155,7 @@ for arg in "$[]@"; do ...@@ -161,6 +155,7 @@ for arg in "$[]@"; do
case "$arg" in case "$arg" in
--mode=compile) modeok=true ;; --mode=compile) modeok=true ;;
--tag=CC|--tag=CXX) tagok=true ;; --tag=CC|--tag=CXX) tagok=true ;;
--tag=ASM|--tag=YASM) tagok=true; passthrough=true;;
--silent|--quiet) ;; --silent|--quiet) ;;
*) args@<:@${#args[@]}@:>@="$arg" ;; *) args@<:@${#args[@]}@:>@="$arg" ;;
esac esac
...@@ -175,7 +170,10 @@ __DOLTLIBTOOL__EOF__ ...@@ -175,7 +170,10 @@ __DOLTLIBTOOL__EOF__
dnl Done writing out doltlibtool; substitute it for libtool. dnl Done writing out doltlibtool; substitute it for libtool.
chmod +x doltlibtool chmod +x doltlibtool
LIBTOOL='$(top_builddir)/doltlibtool' LIBTOOL='$(top_builddir)/doltlibtool'
fi
DOLT_CLEANFILES="doltlibtool doltcompile"
AC_SUBST(DOLT_CLEANFILES)
])
AC_SUBST(LTCOMPILE) AC_SUBST(LTCOMPILE)
AC_SUBST(LTCXXCOMPILE) AC_SUBST(LTCXXCOMPILE)
# end dolt # end dolt
......
...@@ -35,3 +35,8 @@ AM_LDFLAGS = \ ...@@ -35,3 +35,8 @@ AM_LDFLAGS = \
if HAVE_WIN32 if HAVE_WIN32
AM_LDFLAGS += $(top_builddir)/modules/module.rc.lo AM_LDFLAGS += $(top_builddir)/modules/module.rc.lo
endif endif
SUFFIXES = .asm
.asm.lo:
$(LIBTOOL) --mode=compile --tag=ASM $(YASM) $(YASMFLAGS) $< -o $@
...@@ -12,7 +12,7 @@ guidir = $(pluginsdir)/gui ...@@ -12,7 +12,7 @@ guidir = $(pluginsdir)/gui
# For each ressource (icon, png, ...) # For each ressource (icon, png, ...)
# - Add it to DEPS_res # - 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_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS)
libqt4_plugin_la_LIBADD = $(QT_LIBS) libqt4_plugin_la_LIBADD = $(QT_LIBS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment