From da0adb20569cc06a55551a8af8e9eb375c4a85f7 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Mon, 18 Jun 2001 23:07:19 +0000 Subject: [PATCH] add object file format guessing from configure --- configure.in | 50 +++++++++++++++++++----------------- src/libFLAC/ia32/Makefile.am | 2 +- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/configure.in b/configure.in index eb8d0b9a..41b8bb59 100644 --- a/configure.in +++ b/configure.in @@ -39,6 +39,10 @@ esac AM_CONDITIONAL(FLaC__CPU_IA32, test x$cpu_ia32 = xtrue) AM_CONDITIONAL(FLaC__CPU_PPC, test x$cpu_ppc = xtrue) AM_CONDITIONAL(FLaC__CPU_SPARC, test x$cpu_sparc = xtrue) +case "$host" in + *) OBJ_FORMAT=elf ;; +esac +AC_SUBST(OBJ_FORMAT) if test x$cpu_ia32 = xtrue ; then AC_DEFINE(FLAC__ALIGN_MALLOC_DATA) @@ -51,12 +55,12 @@ AC_DEFINE(FLAC__NO_ASM) fi AC_ARG_ENABLE(debug, - [ --enable-debug Turn on debugging], - [case "${enableval}" in - yes) debug=true ;; - no) debug=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; - esac],[debug=false]) +[ --enable-debug Turn on debugging], +[case "${enableval}" in + yes) debug=true ;; + no) debug=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; +esac],[debug=false]) AM_CONDITIONAL(DEBUG, test x$debug = xtrue) AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - xmms support will not be built])) @@ -70,24 +74,24 @@ fi CFLAGS='-I./include -I $(top_srcdir)/include -Wall -W' if test x$debug = xtrue; then - CFLAGS="$CFLAGS -g -O0 -DDEBUG" +CFLAGS="$CFLAGS -g -O0 -DDEBUG" else - CFLAGS="$CFLAGS -O3 -DNDEBUG" - if test x$GCC = xyes; then - CFLAGS="$CFLAGS -fomit-frame-pointer -funroll-loops -ffast-math -finline-functions" - fi +CFLAGS="$CFLAGS -O3 -DNDEBUG" + if test x$GCC = xyes; then + CFLAGS="$CFLAGS -fomit-frame-pointer -funroll-loops -ffast-math -finline-functions" + fi fi AC_OUTPUT( Makefile \ - src/Makefile \ - src/libFLAC/Makefile \ - src/libFLAC/ia32/Makefile \ - src/flac/Makefile \ - src/metaflac/Makefile \ - src/plugin_xmms/Makefile \ - src/test_streams/Makefile \ - src/test_unit/Makefile \ - include/Makefile \ - include/FLAC/Makefile \ - test/Makefile \ - ) + src/Makefile \ + src/libFLAC/Makefile \ + src/libFLAC/ia32/Makefile \ + src/flac/Makefile \ + src/metaflac/Makefile \ + src/plugin_xmms/Makefile \ + src/test_streams/Makefile \ + src/test_unit/Makefile \ + include/Makefile \ + include/FLAC/Makefile \ + test/Makefile \ +) diff --git a/src/libFLAC/ia32/Makefile.am b/src/libFLAC/ia32/Makefile.am index cbbe49fd..cb683b7d 100644 --- a/src/libFLAC/ia32/Makefile.am +++ b/src/libFLAC/ia32/Makefile.am @@ -19,7 +19,7 @@ # nasm build rule: SUFFIXES = .nasm .lo .nasm.lo: - $(NASM) -f elf -d OBJ_FORMAT_elf $< -o $@ + $(NASM) -f $(OBJ_FORMAT) -d OBJ_FORMAT_$(OBJ_FORMAT) $< -o $@ noinst_LTLIBRARIES = libFLAC-asm.la libFLAC_asm_la_SOURCES = \