From 9f8b7230b969fde154cf06de3ee36fe14636371b Mon Sep 17 00:00:00 2001 From: giraffedata Date: Wed, 30 Oct 2013 18:57:38 +0000 Subject: Use SSE stuff with Clang as for GCC git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2027 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- common.mk | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'common.mk') diff --git a/common.mk b/common.mk index 4077f2ea..c096bd6e 100644 --- a/common.mk +++ b/common.mk @@ -43,13 +43,11 @@ # MERGEBINARIES: list of the programs that, in a merge build, are invoked # via the merged Netpbm program # CC: C compiler command -# CPPFLAGS: C preprocessor options -# CFLAGS: C compiler general options +# CFLAGS_CONFIG: C compiler options from config.mk. # CFLAGS_TARGET: C compiler options for a particular target # LD: linker command # LINKERISCOMPILER: 'Y' if the linker invoked by LD is actually a compiler # front end, so takes linker options in a different format -# LDFLAGS: linker options # LIBS or LOADLIBES: names of libraries to be added to all links # COMP_INCLUDES: Compiler option string to establish the search path for # component-specific include files when compiling things or computing @@ -64,6 +62,10 @@ # is intended to be set on a make command line (e.g. 'make CADD=-g') # for options that apply just to a particular build. +# In addition, there is CFLAGS, which is extra C compilation options and is +# expected to be set via the make command line for a particular build. +# Likewise, LDFLAGS for link-edit options. + # In addition, there is CFLAGS_PERSONAL, which is extra C # compilation options and is expected to be set via environment variable # for options that are particular to the person doing the build and not @@ -235,7 +237,19 @@ config: # -UNDEBUG (in any of various ways) to override this. # CFLAGS_ALL = \ - -DNDEBUG $(CPPFLAGS) $(CFLAGS) $(CFLAGS_TARGET) $(CFLAGS_PERSONAL) $(CADD) + -DNDEBUG $(CPPFLAGS) $(CFLAGS_CONFIG) $(CFLAGS_TARGET) $(CFLAGS_PERSONAL) $(CFLAGS) $(CADD) + +ifeq ($(WANT_SSE),Y) + # The only two compilers we've seen that have the SSE capabilities that + # WANT_SSE requests are GCC and Clang, and they both have these options and + # require them in order for to compile. On some systems + # (x86_64, in our experience), these options are default, but on more + # traditional systems, they are not. Note: __SSE2__ macro tells whether + # -msse2 is in effect. + CFLAGS_SSE = -msse -msse2 +else + CFLAGS_SSE = +endif $(OBJECTS): %.o: %.c importinc ############################################################################# -- cgit 1.4.1