From 4bcdec146bcc4e580af7edb4101316cedae795fd Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Fri, 10 Jun 2011 10:36:49 -0700 Subject: [PATCH] All makefiles: Remove optimize flags and unneeded defines. Optimizations like -O2 are seen to cause issues with some compilers. Remove unneeded defines like DEBUG, _CONSOLE, etc. Add _GNU_SOURCE to the Linux makefiles. --- generate/linux/Makefile.acpibin | 27 ++++++++++++++++++--------- generate/linux/Makefile.acpiexec | 29 +++++++++++++++++++---------- generate/linux/Makefile.acpihelp | 27 ++++++++++++++++++--------- generate/linux/Makefile.acpinames | 27 ++++++++++++++++++--------- generate/linux/Makefile.acpisrc | 27 ++++++++++++++++++--------- generate/linux/Makefile.acpixtract | 27 ++++++++++++++++++--------- generate/linux/Makefile.iasl | 29 +++++++++++++++++++---------- generate/unix/Makefile | 12 ++++++------ generate/unix/Makefile.config | 21 ++++++++++++--------- 9 files changed, 146 insertions(+), 80 deletions(-) diff --git a/generate/linux/Makefile.acpibin b/generate/linux/Makefile.acpibin index a3d259f07..d1aa7d387 100644 --- a/generate/linux/Makefile.acpibin +++ b/generate/linux/Makefile.acpibin @@ -1,27 +1,38 @@ # # acpibin - Binary ACPI table utility -# - # # NOTE: This makefile is intended to be used in the Linux environment, # with the Linux directory structure. It will not work directly # on the native ACPICA source tree. # + +# +# Configuration +# Notes: +# gcc should be version 4 or greater, otherwise some of the options +# used will not be recognized. +# Global optimization flags (such as -O2, -Os) are not used, since +# they cause issues on some compilers. +# The _GNU_SOURCE symbol is required for many hosts. +# PROG = acpibin -ACPI_COMPONENTS = +HOST = _LINUX +NOMAN = YES +COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? + +ACPICA_COMPONENTS = ACPICA_SRC = ../.. ACPICA_COMMON = $(ACPICA_SRC)/common -ACPICA_CORE = $(ACPICA_SRC)$(ACPI_COMPONENTS) +ACPICA_CORE = $(ACPICA_SRC)$(ACPICA_COMPONENTS) ACPICA_TOOLS = $(ACPICA_SRC)/tools ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers INSTALLDIR = /usr/bin INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR) -NOMAN = YES CFLAGS+= \ - -O2 \ - -D_LINUX -DNDEBUG -D_CONSOLE \ + -D$(HOST) \ + -D_GNU_SOURCE \ -DACPI_BIN_APP \ -I$(ACPICA_SRC)/include @@ -40,8 +51,6 @@ CWARNINGFLAGS = \ -Wpointer-arith \ -Wundef -COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? - OBJS = \ abcompare.o \ abmain.o \ diff --git a/generate/linux/Makefile.acpiexec b/generate/linux/Makefile.acpiexec index 5339c1c00..897a1928f 100644 --- a/generate/linux/Makefile.acpiexec +++ b/generate/linux/Makefile.acpiexec @@ -2,28 +2,40 @@ # acpiexec: ACPI execution simulator. Runs ACPICA code in user # space. Loads ACPI tables, displays the namespace, and allows # execution of control methods. -# - # # NOTE: This makefile is intended to be used in the Linux environment, # with the Linux directory structure. It will not work directly # on the native ACPICA source tree. # + +# +# Configuration +# Notes: +# gcc should be version 4 or greater, otherwise some of the options +# used will not be recognized. +# Global optimization flags (such as -O2, -Os) are not used, since +# they cause issues on some compilers. +# The _GNU_SOURCE symbol is required for many hosts. +# PROG = acpiexec -ACPI_COMPONENTS = +HOST = _LINUX +NOMAN = YES +COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? +LDFLAGS += -lpthread -lrt + +ACPICA_COMPONENTS = ACPICA_SRC = ../.. ACPICA_COMMON = $(ACPICA_SRC)/common -ACPICA_CORE = $(ACPICA_SRC)$(ACPI_COMPONENTS) +ACPICA_CORE = $(ACPICA_SRC)$(ACPICA_COMPONENTS) ACPICA_TOOLS = $(ACPICA_SRC)/tools ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers INSTALLDIR = /usr/bin INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR) -NOMAN = YES CFLAGS+= \ - -O2 \ - -D_LINUX -DNDEBUG -D_CONSOLE \ + -D$(HOST) \ + -D_GNU_SOURCE \ -DACPI_EXEC_APP \ -I$(ACPICA_SRC)/include @@ -42,9 +54,6 @@ CWARNINGFLAGS = \ -Wpointer-arith \ -Wundef -COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? -LDFLAGS += -lpthread -lrt - OBJS = \ aeexec.o \ aehandlers.o \ diff --git a/generate/linux/Makefile.acpihelp b/generate/linux/Makefile.acpihelp index 1d82fdb2b..d540445c9 100644 --- a/generate/linux/Makefile.acpihelp +++ b/generate/linux/Makefile.acpihelp @@ -1,28 +1,39 @@ # # acpihelp - ACPI Help utility. Displays ASL operator syntax and # information about ACPI predefined names. -# - # # NOTE: This makefile is intended to be used in the Linux environment, # with the Linux directory structure. It will not work directly # on the native ACPICA source tree. # + +# +# Configuration +# Notes: +# gcc should be version 4 or greater, otherwise some of the options +# used will not be recognized. +# Global optimization flags (such as -O2, -Os) are not used, since +# they cause issues on some compilers. +# The _GNU_SOURCE symbol is required for many hosts. +# PROG = acpihelp -ACPI_COMPONENTS = +HOST = _LINUX +NOMAN = YES +COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? + +ACPICA_COMPONENTS = ACPICA_SRC = ../.. ACPICA_COMMON = $(ACPICA_SRC)/common -ACPICA_CORE = $(ACPICA_SRC)$(ACPI_COMPONENTS) +ACPICA_CORE = $(ACPICA_SRC)$(ACPICA_COMPONENTS) ACPICA_TOOLS = $(ACPICA_SRC)/tools ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers INSTALLDIR = /usr/bin INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR) -NOMAN = YES CFLAGS+= \ - -O2 \ - -D_LINUX -DNDEBUG -D_CONSOLE \ + -D$(HOST) \ + -D_GNU_SOURCE \ -DACPI_HELP_APP \ -I$(ACPICA_SRC)/include @@ -41,8 +52,6 @@ CWARNINGFLAGS = \ -Wpointer-arith \ -Wundef -COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? - OBJS = \ ahmain.o \ getopt.o diff --git a/generate/linux/Makefile.acpinames b/generate/linux/Makefile.acpinames index cf05a381b..d88d6c5ef 100644 --- a/generate/linux/Makefile.acpinames +++ b/generate/linux/Makefile.acpinames @@ -2,28 +2,39 @@ # acpinames - Load ACPI table and dump namespace. This is a subset # of the AcpiExec functionality, it is intended to demonstrate # the configurability of ACPICA. -# - # # NOTE: This makefile is intended to be used in the Linux environment, # with the Linux directory structure. It will not work directly # on the native ACPICA source tree. # + +# +# Configuration +# Notes: +# gcc should be version 4 or greater, otherwise some of the options +# used will not be recognized. +# Global optimization flags (such as -O2, -Os) are not used, since +# they cause issues on some compilers. +# The _GNU_SOURCE symbol is required for many hosts. +# PROG = acpinames -ACPI_COMPONENTS = +HOST = _LINUX +NOMAN = YES +COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? + +ACPICA_COMPONENTS = ACPICA_SRC = ../.. ACPICA_COMMON = $(ACPICA_SRC)/common -ACPICA_CORE = $(ACPICA_SRC)$(ACPI_COMPONENTS) +ACPICA_CORE = $(ACPICA_SRC)$(ACPICA_COMPONENTS) ACPICA_TOOLS = $(ACPICA_SRC)/tools ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers INSTALLDIR = /usr/bin INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR) -NOMAN= YES CFLAGS+= \ - -O2 \ - -D_LINUX -DNDEBUG -D_CONSOLE \ + -D$(HOST) \ + -D_GNU_SOURCE \ -DACPI_NAMES_APP \ -I$(ACPICA_SRC)/include \ -I$(ACPICA_TOOLS)/acpinames @@ -43,8 +54,6 @@ CWARNINGFLAGS = \ -Wpointer-arith \ -Wundef -COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? - OBJS = \ anmain.o \ anstubs.o \ diff --git a/generate/linux/Makefile.acpisrc b/generate/linux/Makefile.acpisrc index eaa8c6eee..bd55d024d 100644 --- a/generate/linux/Makefile.acpisrc +++ b/generate/linux/Makefile.acpisrc @@ -1,27 +1,38 @@ # # acpisrc - ACPICA source code conversion utility -# - # # NOTE: This makefile is intended to be used in the Linux environment, # with the Linux directory structure. It will not work directly # on the native ACPICA source tree. # + +# +# Configuration +# Notes: +# gcc should be version 4 or greater, otherwise some of the options +# used will not be recognized. +# Global optimization flags (such as -O2, -Os) are not used, since +# they cause issues on some compilers. +# The _GNU_SOURCE symbol is required for many hosts. +# PROG = acpisrc -ACPI_COMPONENTS = +HOST = _LINUX +NOMAN = YES +COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? + +ACPICA_COMPONENTS = ACPICA_SRC = ../.. ACPICA_COMMON = $(ACPICA_SRC)/common -ACPICA_CORE = $(ACPICA_SRC)$(ACPI_COMPONENTS) +ACPICA_CORE = $(ACPICA_SRC)$(ACPICA_COMPONENTS) ACPICA_TOOLS = $(ACPICA_SRC)/tools ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers INSTALLDIR = /usr/bin INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR) -NOMAN = YES CFLAGS+= \ - -O2 \ - -D_LINUX -DNDEBUG -D_CONSOLE \ + -D$(HOST) \ + -D_GNU_SOURCE \ -DACPI_SRC_APP \ -I$(ACPICA_SRC)/include \ -I. @@ -41,8 +52,6 @@ CWARNINGFLAGS = \ -Wpointer-arith \ -Wundef -COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? - OBJS = \ ascase.o \ asconvrt.o \ diff --git a/generate/linux/Makefile.acpixtract b/generate/linux/Makefile.acpixtract index c1dffa831..8b7bcf9d6 100644 --- a/generate/linux/Makefile.acpixtract +++ b/generate/linux/Makefile.acpixtract @@ -1,27 +1,38 @@ # # acpixtract - extract binary ACPI tables from acpidump text output -# - # # NOTE: This makefile is intended to be used in the Linux environment, # with the Linux directory structure. It will not work directly # on the native ACPICA source tree. # + +# +# Configuration +# Notes: +# gcc should be version 4 or greater, otherwise some of the options +# used will not be recognized. +# Global optimization flags (such as -O2, -Os) are not used, since +# they cause issues on some compilers. +# The _GNU_SOURCE symbol is required for many hosts. +# PROG = acpixtract -ACPI_COMPONENTS = +HOST = _LINUX +NOMAN = YES +COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? + +ACPICA_COMPONENTS = ACPICA_SRC = ../.. ACPICA_COMMON = $(ACPICA_SRC)/common -ACPICA_CORE = $(ACPICA_SRC)$(ACPI_COMPONENTS) +ACPICA_CORE = $(ACPICA_SRC)$(ACPICA_COMPONENTS) ACPICA_TOOLS = $(ACPICA_SRC)/tools ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers INSTALLDIR = /usr/bin INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR) -NOMAN = YES CFLAGS+= \ - -O2 \ - -D_LINUX -DNDEBUG -D_CONSOLE \ + -D$(HOST) \ + -D_GNU_SOURCE \ -I$(ACPICA_SRC)/include CWARNINGFLAGS = \ @@ -39,8 +50,6 @@ CWARNINGFLAGS = \ -Wpointer-arith \ -Wundef -COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? - OBJS = \ acpixtract.o diff --git a/generate/linux/Makefile.iasl b/generate/linux/Makefile.iasl index de86a4218..1807635a2 100644 --- a/generate/linux/Makefile.iasl +++ b/generate/linux/Makefile.iasl @@ -1,28 +1,39 @@ # # iASL compiler/disassembler -# - # # NOTE: This makefile is intended to be used in the Linux environment, # with the Linux directory structure. It will not work directly # on the native ACPICA source tree. # + +# +# Configuration +# Notes: +# gcc should be version 4 or greater, otherwise some of the options +# used will not be recognized. +# Global optimization flags (such as -O2, -Os) are not used, since +# they cause issues on some compilers. +# The _GNU_SOURCE symbol is required for many hosts. +# PROG = iasl -ACPI_COMPONENTS = +HOST = _LINUX +NOMAN = YES +COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? + +ACPICA_COMPONENTS = ACPICA_SRC = .. -ASL_COMPILER = $(ACPICA_SRC)/compiler ACPICA_COMMON = $(ACPICA_SRC)/common -ACPICA_CORE = $(ACPICA_SRC)$(ACPI_COMPONENTS) +ACPICA_CORE = $(ACPICA_SRC)$(ACPICA_COMPONENTS) ACPICA_TOOLS = $(ACPICA_SRC)/tools ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers +ASL_COMPILER = $(ACPICA_SRC)/compiler INSTALLDIR = /usr/bin INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR) -NOMAN = YES CFLAGS+= \ - -O2 \ - -D_LINUX -DNDEBUG -D_CONSOLE \ + -D$(HOST) \ + -D_GNU_SOURCE \ -DACPI_ASL_COMPILER \ -I$(ACPICA_SRC)/include \ -I$(ASL_COMPILER) @@ -51,8 +62,6 @@ YFLAGS+= -v -d -y LEX= flex LFLAGS+= -i -s -COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? - OBJS = \ adfile.o \ adisasm.o \ diff --git a/generate/unix/Makefile b/generate/unix/Makefile index 6ab8541d7..e75523c26 100644 --- a/generate/unix/Makefile +++ b/generate/unix/Makefile @@ -13,25 +13,25 @@ include Makefile.config -all: ${DIRS} -${DIRS}: FORCE +all: ${PROGS} +${PROGS}: FORCE @cd $@; make; ls -al $@ clean: FORCE - @for d in ${DIRS}; do \ + @for d in ${PROGS}; do \ (cd $$d; \ if [ $$? -ne 0 ]; then \ - echo "Bad element of DIRS: <$$d>"; \ + echo "Bad element of PROGS: <$$d>"; \ else \ pwd; make clean; \ fi); \ done install: FORCE - @for d in ${DIRS}; do \ + @for d in ${PROGS}; do \ (cd $$d; \ if [ $$? -ne 0 ]; then \ - echo "Bad element of DIRS: <$$d>"; \ + echo "Bad element of PROGS: <$$d>"; \ else \ pwd; make install; \ fi); \ diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config index cf6b7a031..2eb5be23f 100644 --- a/generate/unix/Makefile.config +++ b/generate/unix/Makefile.config @@ -19,33 +19,36 @@ # # Configuration -# Note: gcc should be version 4 or greater, otherwise some of the -# options used won't be recognized (see below) +# Notes: +# gcc should be version 4 or greater, otherwise some of the options +# used will not be recognized. +# Global optimization flags (such as -O2, -Os) are not used, since +# they cause issues on some compilers. +# The _GNU_SOURCE symbol is required for many hosts. # +PROGS = acpibin acpiexec acpihelp acpinames acpisrc acpixtract iasl + HOST = _CYGWIN CC = gcc -ACPICA_SRC = ../../../source -DIRS = iasl acpiexec acpihelp acpinames acpisrc acpibin acpixtract -INSTALLDIR = /usr/bin +COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? # # Common defines # -ASL_COMPILER = $(ACPICA_SRC)/compiler +ACPICA_SRC = ../../../source ACPICA_COMMON = $(ACPICA_SRC)/common ACPICA_CORE = $(ACPICA_SRC)/components ACPICA_TOOLS = $(ACPICA_SRC)/tools ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers -COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? +ASL_COMPILER = $(ACPICA_SRC)/compiler COPYPROG = @mkdir -p ../bin; rm -f ../bin/$(PROG); cp --remove-destination $(PROG) ../bin +INSTALLDIR = /usr/bin INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR) - # # Common compiler flags. The warning flags in addition to -Wall are not # automatically included in -Wall. # CFLAGS += \ - -O2 \ -D$(HOST) \ -D_GNU_SOURCE \ -I$(ACPICA_SRC)/include