about summary refs log tree commit diff
path: root/common.mk
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-10-30 18:57:38 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-10-30 18:57:38 +0000
commit9f8b7230b969fde154cf06de3ee36fe14636371b (patch)
treef1c74fed6644663218ea987c4bd4104100a13ec4 /common.mk
parent6229105f5ce31e34b08dc656a71a919f313a11d7 (diff)
downloadnetpbm-mirror-9f8b7230b969fde154cf06de3ee36fe14636371b.tar.gz
netpbm-mirror-9f8b7230b969fde154cf06de3ee36fe14636371b.tar.xz
netpbm-mirror-9f8b7230b969fde154cf06de3ee36fe14636371b.zip
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
Diffstat (limited to 'common.mk')
-rw-r--r--common.mk22
1 files changed, 18 insertions, 4 deletions
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 <emmintrin.h> 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
 #############################################################################