[Flac-dev] Re: detecting host machine in configure.in?

Matt Zimmerman mdz at debian.org
Wed May 23 20:29:10 PDT 2001


On Wed, May 23, 2001 at 03:18:16PM -0700, Josh Coalson wrote:

> but since I'm not too saavy with autoconf/automake I'll ask for a little bit
> more help.  I think the only non-functional part left is that automake
> doesn't support source files that are in subdirectories, relative to
> Makefile.am(?)  the layout in src/libFLAC/ is that all asm sources will go
> under a 'cputype' directory (e.g.  src/libFLAC/i386/ for x86 sources).
> having to put them all in src/libFLAC/ would be a mess later.  can you guys
> take a look and advise?

The easiest way to do it is to put a Makefile.am in each subdirectory and have
it build a convenience library.  Then in src/libFLAC/Makefile.am, just select
the right subdirectory.  I implemented this, but I can't seem to get CVS to
generate a complete diff for me without checking the added files into CVS.

I've attached a diff for configure.in and src/libFLAC/Makefile.am.  In
src/libFLAC/i386, you need to create Makefile.am (attached), and rename all of
the .nasm files to .s (that seems to be how automake wants assembly files to be
named).

Note that I use libtool to build the asm library, so that it can be linked into
both the shared and static libFLAC.  If the assembler is relocatable, this is
the right thing to do.  It looks to me like it is, but I'm not an assembly
expert.  If it isn't, we'll need to hack it so that the assembly stuff is
excluded from the shared library.

-- 
 - mdz
-------------- next part --------------
Index: configure.in
===================================================================
RCS file: /cvsroot/flac/flac/configure.in,v
retrieving revision 1.9
diff -u -r1.9 configure.in
--- configure.in	2001/05/23 22:08:27	1.9
+++ configure.in	2001/05/24 03:08:47
@@ -53,6 +53,7 @@
 AC_OUTPUT(	Makefile	\
 		src/Makefile	\
 		src/libFLAC/Makefile	\
+		src/libFLAC/i386/Makefile	\
 		src/flac/Makefile	\
 		src/metaflac/Makefile	\
 		src/plugin_xmms/Makefile	\
Index: src/libFLAC/Makefile.am
===================================================================
RCS file: /cvsroot/flac/flac/src/libFLAC/Makefile.am,v
retrieving revision 1.6
diff -u -r1.6 Makefile.am
--- src/libFLAC/Makefile.am	2001/05/23 20:58:29	1.6
+++ src/libFLAC/Makefile.am	2001/05/24 03:08:47
@@ -2,10 +2,6 @@
 # GNU makefile
 #
 
-SUFFIXES = .nasm
-.nasm.o:
-	$(NASM) -f elf -d ELF -i i386/ $< -o $@
-
 lib_LTLIBRARIES = libFLAC.la
 if DEBUG
 CFLAGS += @CFLAGS@ -DFLAC__PRECOMPUTE_PARTITION_SUMS -DFLAC__OVERFLOW_DETECT
@@ -15,40 +11,11 @@
 
 if FLaC__CPU_IA32 
 if FLaC__HAS_NASM
-libFLAC_la_SOURCES = \
-	bitbuffer.c \
-	bitmath.c \
-	crc.c \
-	cpu.c \
-	encoder.c \
-	encoder_framing.c \
-	file_decoder.c \
-	fixed.c \
-	format.c \
-	lpc.c \
-	md5.c \
-	seek_table.c \
-	stream_decoder.c \
-	i386/cpu_asm.nasm \
-	i386/fixed_asm.nasm \
-	i386/lpc_asm.nasm
-else
-libFLAC_la_SOURCES = \
-	bitbuffer.c \
-	bitmath.c \
-	crc.c \
-	cpu.c \
-	encoder.c \
-	encoder_framing.c \
-	file_decoder.c \
-	fixed.c \
-	format.c \
-	lpc.c \
-	md5.c \
-	seek_table.c \
-	stream_decoder.c
+SUBDIRS = i386 .
+libFLAC_la_LIBADD = i386/libFLAC-asm.la
 endif
-else
+endif
+
 libFLAC_la_SOURCES = \
 	bitbuffer.c \
 	bitmath.c \
@@ -63,4 +30,3 @@
 	md5.c \
 	seek_table.c \
 	stream_decoder.c
-endif
-------------- next part --------------
# Use nasm instead of gcc
%.lo: %.s
	$(NASM) -f elf -d ELF $< -o $@

noinst_LTLIBRARIES = libFLAC-asm.la
libFLAC_asm_la_SOURCES = cpu_asm.s \
			fixed_asm.s \
			lpc_asm.s


More information about the Flac-dev mailing list