Revision: 17884
http://sourceforge.net/p/edk2/code/17884
Author: hwu1225
Date: 2015-07-08 07:44:22 +0000 (Wed, 08 Jul 2015)
Log Message:
-----------
BaseTools: Fix build on FreeBSD and allow use of non-gcc system compiler
On FreeBSD, uuid.h is in /usr/include, not /usr/include/uuid.
Fix some errors when building using clang caused by self-assignment: the
preferred way to 'use' a variable is '(void)x;', not 'x = x;'.
Where the system provides $(CC) etc. by default, don't override it to be gcc.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bruce Cran <[email protected]>
Reviewed-by: Yingke Liu <[email protected]>
Modified Paths:
--------------
branches/UDK2014.SP1/BaseTools/Source/C/GenFv/GenFvInternalLib.c
branches/UDK2014.SP1/BaseTools/Source/C/LzmaCompress/LzmaCompress.c
branches/UDK2014.SP1/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
branches/UDK2014.SP1/BaseTools/Source/C/Makefiles/header.makefile
branches/UDK2014.SP1/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
Modified: branches/UDK2014.SP1/BaseTools/Source/C/GenFv/GenFvInternalLib.c
===================================================================
--- branches/UDK2014.SP1/BaseTools/Source/C/GenFv/GenFvInternalLib.c
2015-07-08 07:11:35 UTC (rev 17883)
+++ branches/UDK2014.SP1/BaseTools/Source/C/GenFv/GenFvInternalLib.c
2015-07-08 07:44:22 UTC (rev 17884)
@@ -16,8 +16,13 @@
//
// Include files
//
+
+#if defined(__FreeBSD__)
+#include <uuid.h>
+#elif defined(__GNUC__)
+#include <uuid/uuid.h>
+#endif
#ifdef __GNUC__
-#include <uuid/uuid.h>
#include <sys/stat.h>
#endif
#include <string.h>
Modified: branches/UDK2014.SP1/BaseTools/Source/C/LzmaCompress/LzmaCompress.c
===================================================================
--- branches/UDK2014.SP1/BaseTools/Source/C/LzmaCompress/LzmaCompress.c
2015-07-08 07:11:35 UTC (rev 17883)
+++ branches/UDK2014.SP1/BaseTools/Source/C/LzmaCompress/LzmaCompress.c
2015-07-08 07:44:22 UTC (rev 17884)
@@ -43,8 +43,8 @@
const char *kCantAllocateMessage = "Can not allocate memory";
const char *kDataErrorMessage = "Data error";
-static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
-static void SzFree(void *p, void *address) { p = p; MyFree(address); }
+static void *SzAlloc(void *p, size_t size) { (void)p; return MyAlloc(size); }
+static void SzFree(void *p, void *address) { (void)p; MyFree(address); }
static ISzAlloc g_Alloc = { SzAlloc, SzFree };
static Bool mQuietMode = False;
Modified: branches/UDK2014.SP1/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
===================================================================
--- branches/UDK2014.SP1/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
2015-07-08 07:11:35 UTC (rev 17883)
+++ branches/UDK2014.SP1/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
2015-07-08 07:44:22 UTC (rev 17884)
@@ -2112,7 +2112,7 @@
if (p->mtMode)
MatchFinderMt_ReleaseStream(&p->matchFinderMt);
#else
- pp = pp;
+ (void)pp;
#endif
}
Modified: branches/UDK2014.SP1/BaseTools/Source/C/Makefiles/header.makefile
===================================================================
--- branches/UDK2014.SP1/BaseTools/Source/C/Makefiles/header.makefile
2015-07-08 07:11:35 UTC (rev 17883)
+++ branches/UDK2014.SP1/BaseTools/Source/C/Makefiles/header.makefile
2015-07-08 07:44:22 UTC (rev 17884)
@@ -21,11 +21,11 @@
LINUX:=$(findstring Linux, $(shell uname -s))
DARWIN:=$(findstring Darwin, $(shell uname -s))
-CC = gcc
-CXX = g++
-AS = gcc
-AR = ar
-LD = ld
+CC ?= gcc
+CXX ?= g++
+AS ?= gcc
+AR ?= ar
+LD ?= ld
LINKER ?= $(CC)
ifeq ($(ARCH), IA32)
ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/
Modified:
branches/UDK2014.SP1/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
===================================================================
--- branches/UDK2014.SP1/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
2015-07-08 07:11:35 UTC (rev 17883)
+++ branches/UDK2014.SP1/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
2015-07-08 07:44:22 UTC (rev 17884)
@@ -164,7 +164,7 @@
#
# UNIX (default)
#
-CC=gcc
+CC?=gcc
COPT=-O
ANTLR=${BIN_DIR}/antlr
DLG=${BIN_DIR}/dlg
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits