add basic configure script
[suif.git] / Makefile.defs.in
bloba43d3973d7b246b1996c6eace430a7c0f90b9443
1 # set by configure
2 MACHINE = @MACHINE@
3 SUIFPATH = @SUIFPATH@
4 COMPILER_NAME = @COMPILER_NAME@
5 CC_OVERRIDE = @CC_OVERRIDE@
6 CXX_OVERRIDE = @CXX_OVERRIDE@
7 LD_LIBRARY_PATH = @LD_LIBRARY_PATH@
9 # GNU make no longer exports variables by default
10 export
12 unexport VERDATAFILE TMP_VERDATAFILE AUXILIARY_HEADERS TMP_YSRCS TMP_DSRCS
13 unexport TMP_HEADERS TMP_CSRCS TMP_SRCS TMP_INFOSRCS TMP_MANPAGES
14 unexport TMP_MANPAGES TMP_OTHERSRCS
15 unexport EXTRA_PURE EXTRA_YFLAGS EXTRA_CFLAGS EXTRA_CXXFLAGS
16 unexport LIBNAME_SET LIBNAME_SET_A LIBNAME_SET_B
17 unexport BASE_CFLAGS BASE_CXXFLAGS
19 # macro to initialize standard SUIF libraries
20 ifneq (,$(findstring -lsty,$(LIBS)))
21 START_STY =     start_sty.o
22 else
23 ifneq (,$(findstring -lsuif1,$(LIBS)))
24 START_STY =     start_sty.o
25 else
26 ifneq (,$(findstring -lmsuif,$(LIBS)))
27 START_STY =     start_sty.o
28 endif
29 endif
30 endif
32 ifdef AUTOINITLIB
33 REGISTER_LIB =  register_lib.o
34 endif
36 ifdef CC_OVERRIDE
37 CC =            $(CC_OVERRIDE)
38 endif
39 ifdef CXX_OVERRIDE
40 CXX =           $(CXX_OVERRIDE)
41 endif
43 ifeq (gcc,$(COMPILER_NAME))
45 #   Note:  We have turned off the ``unused'' warnings from g++ because
46 #       when this warning is enabled, it generates warning messages
47 #       for any function declared ``inline'' that is not used.  That
48 #       causes warnings for most cases of ``inline'' functions
49 #       declared in header files though there is nothing at all wrong
50 #       with such code.  Other warnings are not used because system
51 #       header files often trigger them or because code that we think
52 #       is valid and commonly used in SUIF triggers them.  For
53 #       example, comparing an unsigned to see if it is less than
54 #       zero.  We have lots of code that does this because we want the
55 #       same code to work whether certain typedef'ed types are signed
56 #       or unsigned integers.
58 DEFAULT_SYSTEM_SPECIFIC_CFLAGS =        -g -fPIC -Wall
59 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS =      -g -fPIC -pedantic -Wchar-subscripts -Wcomment -Wformat -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wreorder -Wpointer-arith -DINLINE_ALL_TEMPLATES $(USE_SUIF_STRIPPED_HEADERS)
60 ifndef CC_OVERRIDE
61 CC =            gcc
62 endif
63 ifndef CXX_OVERRIDE
64 CXX =           g++
65 endif
66 DEPSFLAG =      -M
67 else
68 ifeq (gcc-repo,$(COMPILER_NAME))
69 DEFAULT_SYSTEM_SPECIFIC_CFLAGS =        -g -Wall
70 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS =      -g -pedantic -Wchar-subscripts -Wcomment -Wformat -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wreorder -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -DINLINE_ALL_TEMPLATES -frepo -DGCC_REPO_BUG_WORK_AROUND $(USE_SUIF_STRIPPED_HEADERS) -DANTIQUE_CPP
71 ifndef CC_OVERRIDE
72 CC =            gcc
73 endif
74 ifndef CXX_OVERRIDE
75 CXX =           g++
76 endif
77 DEPSFLAG =      -M
78 else
79 ifeq (egcs,$(COMPILER_NAME))
80 DEFAULT_SYSTEM_SPECIFIC_CFLAGS =        -g -Wall
81 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS =      -g -pedantic -Wchar-subscripts -Wcomment -Wformat -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wreorder -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -DINLINE_ALL_TEMPLATES -frepo -fno-exceptions -DGCC_REPO_BUG_WORK_AROUND $(USE_SUIF_STRIPPED_HEADERS)
82 ifndef CC_OVERRIDE
83 CC =            gcc
84 endif
85 ifndef CXX_OVERRIDE
86 CXX =           g++
87 endif
88 DEPSFLAG =      -M
89 else
90 ifeq (sgi_c++,$(COMPILER_NAME))
92 #   Note:
93 #       Warning 3247: ``unrecognized #pragma''
94 #           -- We use #pragmas for gcc that the Irix 5.3 C++ compiler
95 #              doesn't understand, but it should just silently ignore
96 #              them.
97 #       Warning 3672: ``Mangling of signed character does not match
98 #                     cfront name mangling.''
99 #           -- We don't care about C front.
100 #       Warning 3270: ``pointless comparison of unsigned integer with
101 #                     zero'' 
102 #           -- We use symbolic types that might be signed or unsigned,
103 #              so we really want to compare with zero even if the type
104 #              happens to be unsigned right now.
106 ifeq (mips-sgi-irix5.3,$(MACHINE))
107 SUIF_SGI_WARNINGS_OFF = 803,728,3247,3317,3672,3270
108 else
109 SUIF_SGI_WARNINGS_OFF = 803,728,3247,3317,3270,1155
110 endif
111 DEFAULT_SYSTEM_SPECIFIC_CFLAGS =   -fullwarn -woff $(SUIF_SGI_WARNINGS_OFF) -g
112 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS = -fullwarn -woff $(SUIF_SGI_WARNINGS_OFF) -g -DNOBOOL -DNO_CONST_CAST -DINLINE_ALL_TEMPLATES
113 ifndef CC_OVERRIDE
114 CC =            cc
115 endif
116 ifndef CXX_OVERRIDE
117 CXX =           CC
118 endif
119 DEPSFLAG =      -M
120 else
121 ifeq (sun_procompiler,$(COMPILER_NAME))
122 DEFAULT_SYSTEM_SPECIFIC_CFLAGS =        -g -KPIC
123 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS =      -g -KPIC -DNOBOOL -DNO_CONST_CAST -DINLINE_ALL_TEMPLATES $(USE_SUIF_STRIPPED_HEADERS) -DANTIQUE_CPP
124 ifndef CC_OVERRIDE
125 CC =            cc
126 endif
127 ifndef CXX_OVERRIDE
128 CXX =           CC +w
129 endif
130 DEPSFLAG =      -xM1
131 else
132 DEFAULT_SYSTEM_SPECIFIC_CFLAGS =        -g
133 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS =      -g
134 ifndef CC_OVERRIDE
135 CC =            cc
136 endif
137 ifndef CXX_OVERRIDE
138 CXX =           CC
139 endif
140 DEPSFLAG =      -M
141 endif
142 endif
143 endif
144 endif
145 endif
147 ifeq (,$(SYSTEM_SPECIFIC_CFLAGS))
148 SYSTEM_SPECIFIC_CFLAGS = $(DEFAULT_SYSTEM_SPECIFIC_CFLAGS)
149 endif
150 ifeq (,$(SYSTEM_SPECIFIC_CXXFLAGS))
151 SYSTEM_SPECIFIC_CXXFLAGS = $(DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS)
152 endif
154 # The USER_CFLAGS and USER_CXXFLAGS variables are reserved for
155 # _users_.  They should never be defined in any Makefile.  The
156 # EXTRA_CFLAGS and EXTRA_CXXFLAGS variables are available for local
157 # Makefiles.
159 # standard definitions (SUIFHOME and MACHINE are read from the environment)
160 MACHDIR =       $(SUIFHOME)/$(MACHINE)
161 ifndef INCLDIR
162 INCLDIR =       $(MACHDIR)/include
163 endif
164 ifndef SUIF_VERSION_1
165 INCLDIRFLAG =   $(LOCALINCLDIRS) -I$(INCLDIR) $(GLOBALINCLDIRS)
166 else
167 INCLDIRFLAG =   $(LOCALINCLDIRS) -I$(INCLDIR)/suif1_wrapper -I$(INCLDIR) $(GLOBALINCLDIRS)
168 endif
169 ifndef SRCDIR
170 SRCDIR =        $(SUIFHOME)/src
171 endif
172 ifndef MANDIR
173 MANDIR =        $(SUIFHOME)/$(MACHINE)/man
174 endif
175 ifndef INFODIR
176 INFODIR =       $(SUIFHOME)/info
177 endif
178 ifndef HTMLDIR
179 HTMLDIR =       $(SUIFHOME)/html
180 endif
181 ifndef DOCDIR
182 DOCDIR =        $(SUIFHOME)/docs
183 endif
184 ifndef LIBDIR
185 LIBDIR =        $(MACHDIR)/lib
186 endif
187 ifndef SODIR
188 SODIR =         $(MACHDIR)/solib
189 endif
190 ifndef AUTOINITDIR
191 AUTOINITDIR =   $(MACHDIR)/auto_init_libs
192 endif
193 ifndef VERDATADIR
194 VERDATADIR =    $(MACHDIR)/verdata
195 endif
196 ifndef NIGHTLYREADYDIR
197 NIGHTLYREADYDIR = $(SUIFHOME)/nightly_ready
198 endif
199 ifndef TCLDIR
200 TCLDIR =        $(SUIFHOME)/tcl
201 endif
202 ifndef STATIC_LIBS_ONLY
203 LIBDIRFLAG =    $(LOCALLIBDIRS) -L$(SODIR) -L$(LIBDIR) $(GLOBALLIBDIRS)
204 else
205 LIBDIRFLAG =    $(LOCALLIBDIRS) -L$(LIBDIR) $(GLOBALLIBDIRS)
206 endif
207 BINDIR =        $(MACHDIR)/bin
208 ifndef SCRIPTDIR
209 SCRIPTDIR =     $(SUIFHOME)/scripts
210 endif
211 SHELL =         /bin/sh
212 YACC =          bison
213 ifeq (,$(SHARLIT))
214 SHARLIT =       sharlit
215 endif
216 YFLAGS =        -y $(EXTRA_YFLAGS)
217 BASE_CFLAGS =   $(SYSTEM_SPECIFIC_CFLAGS) $(USER_CFLAGS)
218 BASE_CXXFLAGS = $(SYSTEM_SPECIFIC_CXXFLAGS) $(USER_CXXFLAGS)
219 CFLAGS =        $(BASE_CFLAGS) $(INCLDIRFLAG) $(EXTRA_CFLAGS)
220 CXXFLAGS =      $(BASE_CXXFLAGS) $(INCLDIRFLAG) $(EXTRA_CXXFLAGS)
221 CO =            co
222 COFLAGS =       -q
223 ifeq (,$(LD_LIBRARY_PATH))
224 DOT_LD_LIBRARY_PATH = .
225 else
226 DOT_LD_LIBRARY_PATH = .:$(LD_LIBRARY_PATH)
227 endif
228 ifndef LOGFILE
229 LOGFILE =       install.log
230 endif
231 ifndef NIGHTLY_STATUS
232 NIGHTLY_STATUS =
233 endif
235 # The variable NEED_RANLIB should be defined if and only if the ``ar''
236 # command on a system does not accept the ``-s'' option and ``ranlib''
237 # must be used instead.  The only system we commonly use for which
238 # this is the case is SunOS version 4, so NEED_RANLIB is automatically
239 # turned on for that system.  If this is found to be need on another
240 # system, NEED_RANLIB can be set as an environment variable.
241 ifneq (,$(findstring sparc-sun-sunos4,$(MACHINE)))
242 NEED_RANLIB =   yes
243 endif
247 # BEGIN SHARED LIBRARY STUFF
250 # SHARED LIBRARY SUPPORT
252 # This code is meant to automatically determine whether shared
253 # libraries can be used on a given system.  If they can be used, they
254 # will be; otherwise, the old staticly linked library system will be
255 # used.
257 # ADDING SUPPORT FOR SHARED LIBRARIES ON NEW SYSTEMS
259 # Take a look at the if-block that defines SHARED_LIB_GEN and
260 # DEFAULT_LIB_SHARED conditionally based on the MACHINE variable.  You
261 # should be able to add support for a new system by doing nothing more
262 # than adding a new if-clause for the new machine.
264 # OVERRIDING THE DEFAULTS
266 # It is possible for the user to override the automatic choices about
267 # shared versus static libraries without modifying makefiles.  Two
268 # variables are provided for this purpose, INSTALL_SHARED_LIB and
269 # INSTALL_STATIC_LIB.  If neither is defined, this makefile will
270 # automatically define one to be ``true'' and the other ``false''
271 # based on which kind of library is to be installed by default.  The
272 # user may override these settings either in the environment or on the
273 # gmake command line.  If both are set to ``true'', both kinds of
274 # libraries will be built and installed at the same time.
276 # If SHARED_LIB_GEN isn't automatically defined, or is not defined as
277 # you like for a given system, it too may be overridden by the user.
279 ifndef STATIC_LIBNAME
280 STATIC_LIBNAME =        lib$(TARGET).a
281 endif
283 ifndef SHARED_LIBNAME
284 SHARED_LIBNAME =        lib$(TARGET).so
285 endif
287 ifneq (,$(findstring mips-sgi-irix,$(MACHINE)))
288 ifndef SHARED_LIB_GEN
289 ifeq (sgi_c++,$(COMPILER_NAME))
290 SHARED_LIB_GEN =        CC $(CXXFLAGS) -shared -o
291 else
292 SHARED_LIB_GEN =        $(CXX) $(CXXFLAGS) -shared -o
293 endif
294 endif
295 DEFAULT_LIB_SHARED =    defined
296 endif
297 ifneq (,$(findstring solaris2,$(MACHINE)))
298 ifndef SHARED_LIB_GEN
299 ifeq (sun_procompiler,$(COMPILER_NAME))
300 SHARED_LIB_GEN =        CC $(CXXFLAGS) -g -G -xs -o
301 else
302 SHARED_LIB_GEN =        $(CXX) $(CXXFLAGS) -G -o
303 endif
304 endif
305 DEFAULT_LIB_SHARED =    defined
306 endif
307 ifneq (,$(findstring alpha-dec-osf,$(MACHINE)))
308 ifndef SHARED_LIB_GEN
309 SHARED_LIB_GEN =        $(CXX) $(CXXFLAGS) -shared -o
310 endif
311 DEFAULT_LIB_SHARED =    defined
312 endif
313 ifneq (,$(findstring linux,$(MACHINE)))
314 ifndef SHARED_LIB_GEN
315 SHARED_LIB_GEN =        $(CXX) $(CXXFLAGS) -shared -o
316 endif
317 DEFAULT_LIB_SHARED =    defined
318 endif
320 ifdef DEFAULT_LIB_SHARED
321 ifndef INSTALL_SHARED_LIB
322 INSTALL_SHARED_LIB =    true
323 endif
324 ifndef INSTALL_STATIC_LIB
325 INSTALL_STATIC_LIB =    false
326 endif
327 else
328 ifndef INSTALL_SHARED_LIB
329 INSTALL_SHARED_LIB =    false
330 endif
331 ifndef INSTALL_STATIC_LIB
332 INSTALL_STATIC_LIB =    true
333 endif
334 endif
336 ifeq ($(INSTALL_SHARED_LIB),true)
337 LIBNAME_SET_A = $(SHARED_LIBNAME)
338 endif
339 ifeq ($(INSTALL_STATIC_LIB),true)
340 LIBNAME_SET_B = $(STATIC_LIBNAME)
341 endif
342 LIBNAME_SET = $(LIBNAME_SET_A) $(LIBNAME_SET_B)
345 # END SHARED LIBRARY STUFF
349 # The LIB_CLOSURE_GEN macro defines how to generate closure for a
350 # library, if this is necessary.  It is necessary with g++'s
351 # ``-frepo'' flag.  The LIB_CLOSURE_GEN command is used before either
352 # a static or shared library is generated.
354 ifeq (gcc-repo,$(COMPILER_NAME))
355 LIB_CLOSURE_GEN =       $(CXX) $(CXXFLAGS) -o
356 endif
358 ifeq (egcs,$(COMPILER_NAME))
359 LIB_CLOSURE_GEN =       $(CXX) $(CXXFLAGS) -o
360 endif
362 ifeq (,$(PUREHOME))
363 PUREHOME =      /usr/local/pure
364 endif
365 PURE =          $(PUREHOME)/purify
366 ifneq (,$(PURE_COLLECTOR))
367 PURE_FLAGS =    -collector=$(PURE_COLLECTOR)
368 endif
369 GNU_MAKE =      $(MAKE_COMMAND)
371 ifndef PACKAGE_NAME
372 PACKAGE_NAME =  $(TARGET)
373 endif
374 ifndef TARGET_EXECUTABLES
375 TARGET_EXECUTABLES =    $(TARGET)
376 endif
377 ifndef SUPER_PACKAGES_PATH
378 PACKAGE_FULL_NAME = $(PACKAGE_NAME)
379 else
380 PACKAGE_FULL_NAME = $(SUPER_PACKAGES_PATH)/$(PACKAGE_NAME)
381 endif