simplify per compiler rules and variables
[feisty_meow.git] / scripts / clam / cpp / variables.def
1 ###############################################################################
2
3 # CLAM System default variable definitions for C++ compilation.
4
5 ###############################################################################
6
7 ifneq "$(BUILD_PARAMETER_FILE)" ""
8   # define our version of the build parameter file.  this should be set
9   # beforehand so we override the default parameter file for clam.
10   export PARAMETER_FILE = $(BUILD_PARAMETER_FILE)
11 endif
12 ifeq "$(PARAMETER_FILE)" ""
13   # last ditch attempt to get one that will work.
14   export PARAMETER_FILE = $(PRODUCTION_STORE)/feisty_meow_config.ini
15 endif
16
17 ###############################################################################
18
19 # Pull in the base support for CLAM.
20 include variables.def
21
22 ###############################################################################
23
24 #export CLAM_BINARIES = $(CLAM_SCRIPTS)/../bin
25
26 ###############################################################################
27
28 ## # CLAM_BASE_CPU is a flag that distinguishes the type of processor, if necessary.
29 ## export CLAM_BASE_CPU
30 ## #CLAM_BASE_CPU := m68k = motorola 68000 series | m68340 = motorola 68340
31 ## #    | x86 = intel x86 | ppc = power pc | arm = ARM core
32 ## 
33 ## # set the CPU to a default if it has not been set previously.
34 ## ifeq "$(CLAM_BASE_CPU)" ""
35 ##   CLAM_BASE_CPU := $(shell machine 2>/dev/null || arch 2>/dev/null || uname -m 2>/dev/null || echo i686)
36 ## endif
37
38 ## # CLAM_COMPILER is a flag that specifies the compiler that will be used to build
39 ## # code.  It is mainly used within CLAM itself for determining the proper
40 ## # compiler flags.
41 ## export CLAM_COMPILER
42 ## #CLAM_COMPILER := GNU_LINUX | GNU_ARM_LINUX | GNU_DARWIN | GNU_WINDOWS 
43 ## 
44 ## # choose a default compiler if none was specified.
45 ## ifeq "$(CLAM_COMPILER)" ""
46 ##   ifeq "$(OPERATING_SYSTEM)" "UNIX"
47 ##     ifeq "$(CLAM_OS_SUBCLASS)" "darwin"
48 ##       CLAM_COMPILER := GNU_DARWIN
49 ##     else
50 ##       CLAM_COMPILER := GNU_LINUX
51 ##     endif
52 ##   endif
53 ##   ifeq "$(OPERATING_SYSTEM)" "WIN32"
54 ##     CLAM_COMPILER := GNU_WINDOWS
55 ##   endif
56 ##   ifeq "$(CLAM_COMPILER)" ""
57 ##     # if we get into this case, we have no idea how to set the default
58 ##     # compiler.  you may need to change the above logic for guessing it
59 ##     # anyhow.  but we will go with our favorite default.
60 ##     CLAM_COMPILER := GNU_LINUX
61 ##   endif
62 ## endif
63
64 # CLAM_COMPILER_VERSION specifies the version of a particular compiler, if this is
65 # needed to distinguish how the code is built.
66 export CLAM_COMPILER_VERSION
67
68 ###############################################################################
69
70 # "TYPE" is the kind of product being generated by this project.  this is
71 # used to decide where to put the final products of compilation.  this is a
72 # variable in the user makefile.
73 # Valid Types:
74 #     TYPE = library        (outputs are static or dynamic libraries)
75 #     TYPE = application    (outputs are main-line executables)
76 #     TYPE = test           (outputs are test programs)
77 #     TYPE = hierarchy      (there are no outputs; just invokes other makes)
78 export TYPE
79
80 ###############################################################################
81
82 # "DEFINITIONS" is a list of compiler flags that define the value of c macros.
83 # These usually have the format of -D<flag>, but in this variable, only the
84 # <flag> itself should be listed because the compiler option -D is added
85 # automatically.
86 DEFINITIONS += CLAM_BUILT
87   # simple definition that tells the code that clam is building it.
88
89 ifneq "$(BOOT_STRAPPING)" ""
90   # the software is being built from the ground up, including the binaries
91   # we use for building (like value_tagger and others).
92   DEFINITIONS += BOOT_STRAPPING
93 endif
94
95 # "UNDEFINITIONS" is a list of macros to undefine.
96 #UNDEFINITIONS =
97
98 # GLOBAL_PRODUCT_NAME is an important variable for tagging the entire code base
99 # with some branding.  It is provided as a macro definition to all source
100 # files.  The initial value for the macro should come from the build init
101 # file, but if it does not, we pick a default.
102 ifeq "$(product_name)" ""
103   GLOBAL_PRODUCT_NAME := \\\"HOOPLE\\\"
104 else
105   GLOBAL_PRODUCT_NAME := \\\"$(product_name)\\\"
106 endif
107
108 # *_PRODUCT_VERSION records parts of our version numbers for the code to see.
109 DEFINITIONS += MAJOR_PRODUCT_VERSION=$(major) MINOR_PRODUCT_VERSION=$(minor)
110
111 # TEST_MAKEFILE tells the preconditions to check that the files specified
112 # in the makefile are actually present.
113 export TEST_MAKEFILE =
114
115 ###############################################################################
116
117 # pseudo-boolean variable section.  if these have any value at all, then they
118 # are treated as being true.  note that these are flags that should generally
119 # be passed on the command line to a make.  if they are intended to be used
120 # from inside a makefile, then they must appear before this file is included.
121
122 # "REBUILD" causes a rebuild of all source files if it is true.
123 export REBUILD
124
125 # "DEBUG" is used to specify a debugging build.  the default is for this to
126 # be false, which causes a release build.
127 export DEBUG
128
129 # Add in a macro definition if debugging is turned on.  This allows us to
130 # easily eliminate code from release builds.
131 ifneq "$(DEBUG)" ""
132   DEFINITIONS += __DEBUGGING__
133 endif
134
135 # "CONSOLE_MODE" causes the program to be generated as a console application.
136 # this is relevant in systems where programs are otherwise built with graphical
137 # user interfaces.  these are always built statically.
138 #CONSOLE_MODE =
139
140 # "OPTIMIZE" creates optimized code.
141 export OPTIMIZE
142
143 # "NO_COMPILE" just runs through the targets without compiling.
144 export NO_COMPILE
145
146 # "BUILD_LIST_FILE" is the set of files that need to be recompiled for
147 # visual c++.
148 export BUILD_LIST_FILE = $(CLAM_TMP)/clam_rebuild.$(PROJECT)
149
150 # "BUILD_WHACK_FILE" is the set of object files that should be removed if
151 # a build failure occurs.
152 export BUILD_WHACK_FILE = $(CLAM_TMP)/clam_whack.$(PROJECT)
153
154 # we are adding the build list to the flag files so we know it gets cleaned up.
155 FLAG_FILES += $(BUILD_LIST_FILE) $(BUILD_WHACK_FILE)
156
157 ###############################################################################
158
159 # This section implements the HOOPLE directory scheme.  If your scheme differs,
160 # then you will want to modify these appropriately.
161
162 # "THIRD_PARTY_DIR" is the root of our support libraries.
163 export THIRD_PARTY_DIR
164 ifeq "$(THIRD_PARTY_DIR)" ""
165   export THIRD_PARTY_DIR := "$(PRODUCTION_STORE)/3rdparty"
166 endif
167
168 # "OUTPUT_ROOT" is the root of all output directories for objects and other
169 # products being built.
170 export OUTPUT_ROOT = $(CLAM_TMP)/objects
171
172 # "PLATFORM_ADD_IN" is an option discriminator for the intended execution
173 # platform.  it should end in an underscore if it is provided.
174 #PLATFORM_ADD_IN = linux_ | w32_
175
176 # "CPU_BUILD_DIR" distinguishes object directories by including the CPU
177 # name and the type of build.
178 ifneq "$(DEBUG)" ""
179   CPU_BUILD_DIR = $(CLAM_BASE_CPU)_$(PLATFORM_ADD_IN)dbg
180 else
181   CPU_BUILD_DIR = $(CLAM_BASE_CPU)_$(PLATFORM_ADD_IN)rel
182 endif
183
184 # "BASE_OUTPUT_PATH" is the parent directory of objects for this type of
185 # CPU and this type of build.
186 export BASE_OUTPUT_PATH = $(OUTPUT_ROOT)/$(CPU_BUILD_DIR)
187
188 # special case when doing arm-linux builds
189 ifeq "$(CLAM_COMPILER)" "GNU_ARM_LINUX"
190   export TARGETS_STORE = $(FEISTY_MEOW_APEX)/$(CPU_BUILD_DIR)
191   # special output directory for firmware does not include CPU name because
192   #  the repository already include the CPU name
193   BASE_OUTPUT_PATH = $(OUTPUT_ROOT)
194 endif
195
196 # "OUTPUT_PATH" is the directory to generate all compiled products into.
197 export OUTPUT_PATH = $(BASE_OUTPUT_PATH)/$(PROJECT)
198
199 # "OBJECT_DIR" is where object files will be stored during compilation for the
200 # target type being produced.
201 export OBJECT_DIR = $(OUTPUT_PATH)
202
203 # These specify where files are to be created or located for our local build.
204 export EXECUTABLE_DIR = $(TARGETS_STORE)
205 export DYNAMIC_LIBRARY_DIR = $(TARGETS_STORE)
206 export STATIC_LIBRARY_DIR = $(TARGETS_STORE)
207
208 # "HEADER_SEARCH_PATH" is where the class interface files are to be found.
209 # the generated store folder is added to access the build version file.
210 # the binaries are added to access the system_helper.h file.
211 HEADER_SEARCH_PATH = $(FEISTY_MEOW_GENERATED_STORE)/versions $(FEISTY_MEOW_BINARIES)
212
213 ## # "FEISTY_MEOW_CPP_HEADERS" are locations where the HOOPLE headers can be found.
214 ## ifeq "$(FEISTY_MEOW_CPP_HEADERS)" ""
215 ## #seems like some of this is redundant with earlier 3rdparty exploring.
216 ##   LOCUS_LIBRARY_HEADERS = $(shell bash -c '\
217 ##     if [ -d "$(FEISTY_MEOW_APEX)/nucleus" ]; then \
218 ##       echo "$(FEISTY_MEOW_APEX)/nucleus" "$(FEISTY_MEOW_APEX)/octopi" "$(FEISTY_MEOW_APEX)/graphiq" ; \
219 ##     else \
220 ##       echo ""; \
221 ##     fi | tr "\\\\" / | sed -e "s/\([a-zA-Z]\):\/\([^ ]*\)/\/cygdrive\/\1\/\2/g" ')
222 ##     # above assumes cygwin support for windows!  was assuming msys support.
223 ##   FEISTY_MEOW_CPP_HEADERS := $(shell $(FIND) $(LOCUS_LIBRARY_HEADERS) -mindepth 1 -maxdepth 1 -type d )
224 ## endif
225
226 # "LOCAL_HEADERS" are overrides that go first in the header search path.
227 LOCAL_HEADERS = $(THIRD_PARTY_DIR)
228
229 # "CODEBASE_HEADERS" is a list that can be changed for a particular codebase.
230 # it is guaranteed that clam will not interfere with this list, whereas
231 # the LOCAL_HEADERS can be modified by clam.
232 #CODEBASE_HEADERS =
233
234 # "LOCAL_LIBRARIES" are overrides that go first in the library search path.
235 #LOCAL_LIBRARIES =
236
237 # "LIBRARY_SEARCH_PATH" is where the library files are to be found.
238 #LIBRARY_SEARCH_PATH =
239
240 # "HOOPLE_LIBRARIES" is where our local libraries are located.
241 HOOPLE_LIBRARIES =
242
243 # "EXTRA_COPIES" is a list of files that need to be among the files copied
244 # to a project output folder.
245 export EXTRA_COPIES
246
247 # "EXTRA_VERSIONS" is a list of version files to synchronize with the main
248 # library version for this build.  if a file called "version.ini" exists in
249 # the project directory, then it will automatically be upgraded, so the
250 # extra version files are mainly useful when you have a project with multiple
251 # programs in it and you want them to have independent version files (as you
252 # should perhaps want).
253 export EXTRA_VERSIONS
254
255 # "DEPS_FILE" is where the auto-dependency information is stored.
256 export DEPS_FILE = $(OUTPUT_PATH)/$(PROJECT).deps
257
258 # "NO_DEPS" is an exclusion flag.  if it is defined, then no auto-dependency
259 # files will be generated.  this is useful if you are missing makedep or trying
260 # to compile it...
261 #NO_DEPS = t
262
263 # "OMIT_VERSIONS" is another exclusion flag.  this one turns off the creation
264 # of version resource files and eliminates any references that would include
265 # such files.  this is needed when rebuilding version_stamper.
266 #OMIT_VERSIONS = t
267
268 # add the cleanup values we already know.
269 CLEANUPS += $(OUTPUT_PATH) $(DEPS_FILE)
270
271 SUPPLEMENTAL_CLEANUP_TARGETS = cpp_add_to_cleanups_variable
272
273 # "GENDEPS" is a flag that causes dependencies to be generated into
274 # statically built applications.
275 export GENDEPS
276
277 ###############################################################################
278
279 # "SEARCH_DIRS" is a list of directories that should be searched for both C++
280 # header files and for C++ code libraries.  The items placed in SEARCH_DIRS
281 # are fed into both the LIBRARY_SEARCH_PATH and the HEADER_SEARCH_PATH.
282 #SEARCH_DIRS =
283
284 # "DEPENDENCY_DEFINITIONS" is a list of extra definitions that only get passed
285 # to the makedep tool.  this can vary for each compiler.
286 #DEPENDENCY_DEFINITIONS =
287
288 # "DEPENDENCY_ADDITIONS" is a set of parameters passed directly to makedep.
289 #DEPENDENCY_ADDITIONS =
290
291 # "DEBUG_FLAGS" these flags are used for generating specialized versions of
292 # object files, such as ones that include debugging code or that add code for
293 # profiling.
294 # Possible values are -g for adding GDB debugging code and -pg for adding
295 # gprof profiling code.
296 #DEBUG_FLAGS = -g
297 #DEBUG_FLAGS = -pg
298 #DEBUG_FLAGS =
299
300 # "COMPILER_FLAGS" are the flags for the pre-processor and compiler.
301 #COMPILER_FLAGS =
302
303 # "STRICT_WARNINGS" turns on all warnings and forces them to be considered
304 # as errors when encountered.
305 #STRICT_WARNINGS = 
306
307 # "LIBRARIAN_FLAGS" are flags that need to be passed to the library tool
308 # that creates static code libraries.
309 #LIBRARIAN_FLAGS =
310
311 # "SOURCE" is the list of files that are turned into objects.
312 #SOURCE=
313
314 # "OBJECTS" are the files to be created by compilation and added to any
315 # libraries or executables that are made.
316 #OBJECTS =
317
318 # "EXTRA_OBJECTS" are files that are created elsewhere but need to be bound
319 # into the target.
320 #EXTRA_OBJECTS =
321
322 # "LIBS_USED" are system or compiler code libraries that the targets to be
323 # created depend upon.
324 LIBS_USED =
325
326 # "LOCAL_LIBS_USED" is very similar to the LIBS_USED, but these libraries
327 # actually cause executables and object files to be recompiled when the
328 # libraries specified have changed.  To accomplish this, these libraries MUST
329 # be located in the STATIC_LIBRARY_DIR rather than at some arbitrary place
330 # on the LIBRARY_SEARCH_PATH.
331 #LOCAL_LIBS_USED=
332
333 # Load flags tell the linker and loader how to deal with the files and where
334 # to locate library components.  The prefix goes before object files are
335 # listed, and the suffix after.  The prefix should have things like the
336 # directories to be searched for code libraries (although they should be added
337 # to LIBRARY_SEARCH_PATH) and the loading mode for functions (static/dynamic).
338 # In the suffix, actual library loading statements (like -lmath) can be
339 # included (although they should be listed in a different form in LIBS_USED).
340 # Remember that the unix loader looks for functions in libraries in a bizarre
341 # way: ld searches for a function only when it has already been asked for it.
342 # This means that it does not remember what functions it has already been
343 # provided with in the libraries and object files, and it will fail if those
344 # functions are only asked for after they have already been encountered.
345 #LOAD_FLAG_PREFIX =
346 #LOAD_FLAG_SUFFIX =
347
348 # The prefix used on library names, mostly for unix.
349 export LIB_PREFIX
350 # The standard suffix for static or import libraries on this operating system.
351 export LIB_ENDING
352
353 # The dynamic library ending differs between platforms.
354 export DYNLIB_ENDING
355
356 # Flag for specifying the library name to create.
357 #CREATE_LIBRARY_FLAG =
358
359 # Flag for specifying a library to include in linking.
360 LIBRARY_NAME_FLAG = -l
361
362 # Flag for specifying the name of an object file to include in a library or exe.
363 OBJECT_NAME_FLAG = -o
364
365 # Flag for specifying a directory to add to the search path for libs.
366 LIBRARY_PATH_FLAG = -L
367
368 # Flag for specifying the name of an output from the linker.
369 #LINKER_OUTPUT_FLAG =
370
371 # Flag for separating linker options from compilation options for a combined
372 # compiler / linker.
373 #LINKER_OPTION_SEPARATOR =
374
375 # Flag that passes special options when building executable programs.  It is
376 # passed just before the LOAD_FLAG_PREFIX.
377 #EXE_FLAGS = 
378
379 # The name of the compiler tool.
380 #CC =
381
382 # The name of the library creator tool.
383 #LIBRARY_TOOL =
384
385 ifeq "$(OPERATING_SYSTEM)" "WIN32"
386   # the root name of the version file.  This is currently irrelevant on
387   # non-windoze platforms.
388   #CLAM_VERSION_RC_ROOT = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/rc_name.sh)
389   #hmmm: also currently irrelevant since we are only doing static builds.
390 endif
391
392 ifneq "$(CONSOLE_MODE)" ""
393   # this definition can be used to signal different behavior when the app is
394   # being built for console mode.  that generally implies that it should send
395   # debugging info to standard out and avoid doing much with graphics.
396   DEFINITIONS += CONSOLE_MODE
397 endif
398
399 ###############################################################################
400
401 # Operating system dependent flags.
402 # (not so OS dependent with move to only gnu compilation...)
403
404 LIB_ENDING = .a
405 DYNLIB_ENDING = .so
406
407 ###############################################################################
408
409 # Compiler Dependent Flags
410 #
411 ## # "CLAM_COMPILER_ROOT_DIR" is the top-level for the C++ compiler location.
412 ## export CLAM_COMPILER_ROOT_DIR
413 # "COMPILER_HEADER_DIR" is where the compiler headers are.
414 export COMPILER_HEADER_DIR
415 # "COMPILER_LIBRARY_DIR" is where archived libraries are.
416 # "CC" is the name of the C++ compiler to be used.
417
418 # These flags may be useful across multiple compilers.
419 #
420 # SSL brings in the OpenSSL libraries.
421 USE_SSL=
422
423 # CURL provides access to the curl library.
424 USE_CURL=
425
426 # Enables wxwidget library support.
427 USE_WXWIDGETS=
428
429 ifneq "$(OMIT_VERSIONS)" ""
430   DEFINITIONS += NO_VERSION
431 endif
432
433 ############################################################################
434 # compiler specific section below.
435 ############################################################################
436
437 ifeq "$(CLAM_COMPILER)" "GNU_LINUX"
438   # Unix GNU compiler...
439   CC = g++
440 #  CLAM_COMPILER_ROOT_DIR = /
441   PLATFORM_ADD_IN = linux_
442 ##  ARCHITECTURE = $(shell machine 2>/dev/null || arch 2>/dev/null || echo i686)
443
444 ##  export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) )
445
446   DEFINITIONS += _FILE_OFFSET_BITS=64 
447
448   DEPENDENCY_DEFINITIONS += NO_VERSION
449   DEPENDENCY_ADDITIONS = -X/usr/include -X/usr/include/c++/$(CLAM_COMPILER_VERSION) -X/usr/include/c++/$(CLAM_COMPILER_VERSION)/tr1 -X/usr/local/include -X/usr/include/linux -X/usr/include/wx-2.8 -X/usr/lib/gcc/i586-suse-linux/$(CLAM_COMPILER_VERSION)/include -X/usr/lib/gcc/i486-linux-gnu/$(CLAM_COMPILER_VERSION)/include -X/usr/lib/gcc/i686-linux-gnu/$(CLAM_COMPILER_VERSION)/include -X/usr/lib/gcc/x86_64-linux-gnu/$(COMPILER_VERION)/include -X/usr/include/x86_64-linux-gnu -X/usr/include/i386-linux-gnu
450
451   # "USE_XWIN" specifies that this project needs X window system support.
452   #USE_XWIN =
453
454   ifeq "x86_64" "$(CLAM_BASE_CPU)"
455     COMPILER_LIBRARY_DIR = /lib64 /usr/lib64 /usr/local/lib64
456   else
457     COMPILER_LIBRARY_DIR = /lib /usr/lib /usr/local/lib
458   endif
459   DEFINITIONS += __LINUX__ linux __linux__ UNIX unix __UNIX__ __USE_GNU 
460   # X Window System not enabled by default.
461   #DEFINITIONS += __XWINDOWS__ 
462
463   LIBRARY_TOOL = ar
464   LIB_PREFIX = lib
465   LOAD_FLAG_PREFIX += -Xlinker -O3 
466     # -Xlinker --print-map : shows what went in and why.
467     # -Xlinker -O3 : linker optimization
468
469   CREATE_LIBRARY_FLAG += -r 
470     # space on end is significant.
471   LINKER_OUTPUT_FLAG = -o 
472   LINK_TOOL = g++
473   # compiler flags for gcc:
474   # -finline-functions: inline functions as needed.
475   # -fPIC: generate position independent code.
476   # -fpic: generate position independent code, but less portable.
477   # -frepo: automatic template instantiation at link time, no implicit ones.
478   # -ffunction-sections: put each function in own section, improving linking.
479   # -fdata-sections: put data in own section, improving linking.
480   # -shared-libgcc: use the shared library version of compiler libraries.
481   # -fno-exceptions: do not support exception handling and stack unwinding.
482
483   COMPILER_FLAGS += -shared-libgcc -fPIC  
484
485   ifeq "$(DEBUG)" ""
486 #    COMPILER_FLAGS += -finline-functions 
487   endif
488   ifneq "$(STRICT_WARNINGS)" ""
489     COMPILER_FLAGS += -Wall -Werror -Wextra -Wno-long-long
490   endif
491
492   ifeq "$(CONSOLE_MODE)" ""
493     LIBS_USED += dl 
494      # dl=dynamic library.
495   endif
496
497   LIBS_USED += pthread rt 
498      # pthread=thread libraries.
499      # rt=real time libraries for shared memory.
500
501   ifneq "$(DEBUG)" ""
502     # add in debugging flags.
503     COMPILER_FLAGS += -g3 -O0
504
505 ##LOAD_FLAG_PREFIX += -lefence
506 #electric fence
507
508 ###COMPILER_FLAGS += -pg
509 ###LOAD_FLAG_PREFIX += -pg
510 ####trying out profiling: does not work so well yet.  generates gmon.out files
511 ####  in pretty random places.  the parameters to the linker do not even
512 ####  mention this flag, and the compiler flags do not seem to provide an
513 ####  option for where the file goes.  so, it is on hold.
514
515   endif
516
517 endif
518
519 ############################################################################
520
521 ifeq "$(CLAM_COMPILER)" "GNU_ARM_LINUX"
522   # ARM-linux GNU compiler...
523
524 ##  CLAM_COMPILER_ROOT_DIR = /usr/local/arm-linux
525 #hmmm: the above is the one we may need to integrate into build_variables.sh
526
527   CC = $(CLAM_COMPILER_ROOT_DIR)/bin/g++
528   PLATFORM_ADD_IN = linux_
529
530 ##  export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) )
531
532   SNAPGEAR_ROOT_DIR = $(HOME)/snapgear
533
534   DEPENDENCY_DEFINITIONS += NO_VERSION
535
536   COMPILER_HEADER_DIR = $(SNAPGEAR_ROOT_DIR)/linux-2.4.x/include
537 #  COMPILER_HEADER_DIR += $(SNAPGEAR_ROOT_DIR)/include 
538   COMPILER_HEADER_DIR += $(CLAM_COMPILER_ROOT_DIR)/include $(CLAM_COMPILER_ROOT_DIR)/lib 
539   COMPILER_HEADER_DIR += /usr/local/lib/gcc-lib/arm-linux/3.3.2/include
540   
541   COMPILER_LIBRARY_DIR = $(SNAPGEAR_ROOT_DIR)/lib $(CLAM_COMPILER_ROOT_DIR)/lib/be
542
543   DEFINITIONS += linux __linux__ unix UNIX __UNIX__ __LINUX__ 
544
545   COMPILER_FLAGS += -mbig-endian -finline-functions -ffunction-sections -fPIC -nostdinc -nostdinc++ 
546   ifneq "$(STRICT_WARNINGS)" ""
547     COMPILER_FLAGS += -Wall -Werror
548   endif
549
550   LIBRARY_TOOL = $(CLAM_COMPILER_ROOT_DIR)/bin/ar
551   LIB_PREFIX = lib
552   CREATE_LIBRARY_FLAG += -r 
553     # space on end is significant.
554   
555   LINK_TOOL = $(CLAM_COMPILER_ROOT_DIR)/bin/g++
556   LINKER_OUTPUT_FLAG = -o
557   EXE_FLAGS = -mbig-endian
558   LOAD_FLAG_PREFIX += -v -mbig-endian
559
560   LIBS_USED += pthread dl
561
562   ifneq "$(DEBUG)" ""
563     COMPILER_FLAGS += -g3 -O0
564   endif
565
566 endif
567
568 ############################################################################
569
570 ifeq "$(CLAM_COMPILER)" "GNU_WINDOWS"
571   # GNU compiler for MS Windoze...
572   CC = g++
573 ##  CLAM_COMPILER_ROOT_DIR = /
574
575 ##  ARCHITECTURE = $(shell machine 2>/dev/null || arch 2>/dev/null || echo i686)
576 ##hmmm: below fixes nothing!  argh!
577 ##  ARCHITECTURE = i386
578
579 ##  export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) )
580
581 #  RC := $(CLAM_COMPILER_ROOT_DIR)/bin/windres
582   PLATFORM_ADD_IN = w32_
583
584   COMPILER_HEADER_DIR = $(CLAM_COMPILER_ROOT_DIR)/include $(CLAM_COMPILER_ROOT_DIR)/include/c++/3.4.2 
585 #$(CLAM_COMPILER_ROOT_DIR)/lib/gcc/mingw32/3.4.2/include 
586 ###$(CLAM_COMPILER_ROOT_DIR)/usr/include/mingw $(CLAM_COMPILER_ROOT_DIR)/usr/include $(CLAM_COMPILER_ROOT_DIR)/usr/include/w32api $(CLAM_COMPILER_ROOT_DIR)/usr/include/extras
587
588   COMPILER_LIBRARY_DIR = $(CLAM_COMPILER_ROOT_DIR)/lib
589   DEFINITIONS += __GNU_WINDOWS__ _Windows _WINDOWS WIN32 __WIN32__ __FLAT__ VC_EXTRALEAN WIN32_LEAN_AND_MEAN ATL_NO_LEAN_AND_MEAN _WIN32 
590 ###NOOOOOO   __USE_W32_SOCKETS
591 #__cplusplus 
592 #__USE_GNU 
593
594   LIBRARY_TOOL = ar
595   LIBRARY_PATH_FLAG = -L 
596   LIB_PREFIX = lib
597   LIB_ENDING = .a
598 #  LOAD_FLAG_PREFIX += -lpthread
599   LOAD_FLAG_PREFIX += -mwindows
600   CREATE_LIBRARY_FLAG += -r 
601     # space on end is significant.
602   LINKER_OUTPUT_FLAG = -o
603   LINK_TOOL = g++
604   MIDL = midl -Oicf $(MIDL_DEFS) $(HEADER_SEARCH_PATH:%=-I% ) $(DEFINITIONS:%=-D% )
605   MIDL_DEFS = -no_robust
606   # some lovely definitions used by some of the mfc and other ms code.
607   DEPENDENCY_DEFINITIONS += __cplusplus __MINGW32__ _WIN32 _CHAR_UNSIGNED M_I86 _M_I86 _M_IX86=500 _WIN32_WINNT=0x501 __RPC_WIN32__ __RPCNDR_H_VERSION__ __RPCPROXY_H_VERSION__ TARGET_IS_NT40_OR_LATER PGM_SETCHILD _MFC_VER=0x0600
608
609 endif
610
611 ############################################################################
612
613 ifeq "$(CLAM_COMPILER)" "GNU_DARWIN"
614   # Darwin kernel GNU compiler...  really more general macos (MacOS) here these days.
615   CC = g++
616 ##  CLAM_COMPILER_ROOT_DIR = /
617   PLATFORM_ADD_IN = darwin
618 ##  ARCHITECTURE = $(shell machine 2>/dev/null || arch 2>/dev/null || echo i686)
619
620 ##  export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) )
621
622   DEFINITIONS += _FILE_OFFSET_BITS=64 
623
624   DEPENDENCY_DEFINITIONS += NO_VERSION
625 #  DEPENDENCY_ADDITIONS = -X/usr/include -X/usr/include/c++/$(CLAM_COMPILER_VERSION) -X/usr/include/c++/$(CLAM_COMPILER_VERSION)/tr1 -X/usr/local/include -X/usr/include/linux -X/usr/include/wx-2.8 -X/usr/lib/gcc/i586-suse-linux/$(CLAM_COMPILER_VERSION)/include -X/usr/lib/gcc/i486-linux-gnu/$(CLAM_COMPILER_VERSION)/include
626   DEPENDENCY_ADDITIONS = -X/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
627
628   COMPILER_HEADER_DIR := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
629 #/usr/local/include /usr/include 
630 #old /System/Library/Frameworks/Foundation.framework/Versions/C/Headers
631 #/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
632 #/Library/Developer/CommandLineTools/usr/include
633
634   # "USE_XWIN" specifies that this project needs X window system support.
635   #USE_XWIN =
636
637   ifeq "x86_64" "$(CLAM_BASE_CPU)"
638     COMPILER_LIBRARY_DIR = /lib64 /usr/lib64 /usr/local/lib64
639   else
640     COMPILER_LIBRARY_DIR = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
641 #/usr/lib /usr/local/lib
642   endif
643
644 #  DEFINITIONS += __LINUX__ linux __linux__ UNIX unix __UNIX__ __USE_GNU 
645   DEFINITIONS += UNIX unix __UNIX__ __USE_GNU 
646   # X Window System not enabled by default.
647   #DEFINITIONS += __XWINDOWS__ 
648
649   LIBRARY_TOOL = ar
650   LIB_PREFIX = lib
651 #  LOAD_FLAG_PREFIX += -Xlinker 
652 #mac has no o3???
653 #-O3 
654   # special flags for getting rid of warnings on fd_set.
655   LOAD_FLAG_PREFIX=-Wl,-U,___darwin_check_fd_set_overflow
656
657 # -Xlinker --print-map : shows what went in and why.
658 # -Xlinker -O3 : linker optimization
659   CREATE_LIBRARY_FLAG += -r 
660     # space on end is significant.
661   LINKER_OUTPUT_FLAG = -o 
662   LINK_TOOL = g++
663 #  COMPILER_FLAGS += -shared-libgcc -fPIC  
664 #old: -Wl,-export-dynamic
665 #  ifeq "$(DEBUG)" ""
666 #    COMPILER_FLAGS += -finline-functions 
667 #  endif
668 #  ifneq "$(STRICT_WARNINGS)" ""
669 #    COMPILER_FLAGS += -Wall -Werror -Wextra -pedantic-errors -Wno-long-long
670 #  endif
671 #  LIBS_USED += dl pthread rt 
672 #mac no like these libs
673      # dl=dynamic library.
674      # pthread=thread libraries.
675      # rt=real time libraries for shared memory.
676
677   # mac specific flags
678   COMPILER_FLAGS += -Wno-nullability-completeness
679 #trying this one again, which had been turned off.
680   COMPILER_FLAGS += -fgnu-runtime
681
682   ifneq "$(DEBUG)" ""
683     # add in debugging flags.
684 #    COMPILER_FLAGS += -g3 -O0
685   endif
686 endif
687
688 ############################################################################
689
690 # these activities are done after the compiler specific stuff.
691
692 # add a definition for programs to be able to differentiate the versions.
693 DEFINITIONS += CLAM_COMPILER_VERSION=$(CLAM_COMPILER_VERSION)
694
695 # set a variable that scripts can use to get most of the definitions.
696 export VARIABLE_DEFINITION_SET := $(DEFINITIONS)
697
698 ###############################################################################
699