Home | History | Annotate | Download | only in config
      1 ## -*-makefile-*-
      2 ## Copyright (C) 2016 and later: Unicode, Inc. and others.
      3 ## License & terms of use: http://www.unicode.org/copyright.html
      4 ## HP/UX-specific setup using aCC
      5 ## Copyright (c) 1999-2012, International Business Machines Corporation and
      6 ## others. All Rights Reserved.
      7 
      8 ## Commands to generate dependency files
      9 GEN_DEPS.c=	:
     10 GEN_DEPS.cc= 	:
     11 
     12 ## Flags for position independent code
     13 SHAREDLIBCFLAGS = +Z
     14 SHAREDLIBCXXFLAGS = +Z
     15 
     16 ## Additional flags when building libraries with threads
     17 ## We use this instead of -mt, which isn't available in all versions of aCC
     18 ## Our tools won't compile with -D_POSIX_C_SOURCE=199506L
     19 THREADSCPPFLAGS = -D_REENTRANT -D_THREAD_SAFE
     20 
     21 # Use Extended ANSI mode, which is useful for 64-bit numbers
     22 # +W ignores some warnings
     23 #    740 Unsafe cast between pointers/references to incomplete classes...
     24 #    749 This operation is non-portable and potentially unsafe.
     25 #        (Ironically the solution to fix this warning is non-portable)
     26 #    823 Redundant preprocessing concatenation operation results in two valid
     27 #        preprocessing tokens. This comes from INT64_C in <inttypes.h>
     28 #   4232 conversion to a more strictly aligned type may cause misaligned access.
     29 CFLAGS += -Ae +Olit=all
     30 CXXFLAGS += -AA -Wc,-ansi_for_scope,on +W740 +W749 +W823 +W4232
     31 
     32 ifeq ($(UCLN_NO_AUTO_CLEANUP),0)
     33 # set up init point.
     34 UCLN_FINI =  ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME)
     35 CPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI)
     36 LDFLAGS_FINI = -Wl,+fini,$(UCLN_FINI)
     37 
     38 CPPFLAGSICUUC += $(CPPFLAGS_FINI)
     39 LDFLAGSICUUC += $(LDFLAGS_FINI)
     40 CPPFLAGSICUIO += $(CPPFLAGS_FINI)
     41 LDFLAGSICUIO += $(LDFLAGS_FINI)
     42 CPPFLAGSICUI18N += $(CPPFLAGS_FINI)
     43 LDFLAGSICUI18N += $(LDFLAGS_FINI)
     44 CPPFLAGSCTESTFW += $(CPPFLAGS_FINI)
     45 LDFLAGSCTESTFW += $(LDFLAGS_FINI)
     46 
     47 # ICUUC, ICUIO, ICUI18N, CTESTFW
     48 endif
     49 
     50 # -Bhidden_def Hides all symbols defined in the module.
     51 #LIBCFLAGS = -Bhidden_def
     52 #LIBCXXFLAGS = -Bhidden_def
     53 
     54 ## Commands to compile
     55 COMPILE.c=	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c
     56 COMPILE.cc=	$(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c
     57 
     58 ## Common 'default' path to ensure the sanity of users.  Search the current
     59 ## directory, at least.
     60 LD_DEFAULTPATH= -Wl,+b,'$$'ORIGIN/
     61 
     62 # Use SHLIB_PATH and LD_LIBRARY_PATH to locate shared libraries
     63 LDFLAGS += -Wl,+s $(LD_DEFAULTPATH)
     64 
     65 ## Commands to link
     66 ## For aCC, use the C++ linker so that __shlinit gets defined
     67 LINK.c=		$(CXX) $(CXXFLAGS) $(LDFLAGS)
     68 LINK.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS)
     69 
     70 ## Shared library options
     71 ## HPUX PA-risc does not recognize -Bprotected_def aC++ option.
     72 ## Use linker option -Wl,-B,symbolic instead.
     73 ifeq ($(shell uname -m),ia64)
     74 LD_SOOPTIONS= -Bprotected_def
     75 else
     76 LD_SOOPTIONS= -Wl,-B,symbolic
     77 endif
     78 
     79 ## Commands to make a shared library
     80 #SHLIB.c=	$(LD) $(LDFLAGS) -b
     81 SHLIB.c=	$(CXX) $(CXXFLAGS) $(LDFLAGS) -b $(LD_SOOPTIONS)
     82 SHLIB.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS) -b $(LD_SOOPTIONS)
     83 
     84 ## Compiler switch to embed a runtime search path
     85 LD_RPATH=	-Wl,+b,
     86 LD_RPATH_PRE= 	
     87 
     88 ## Environment variable to set a runtime search path
     89 LDLIBRARYPATH_ENVVAR = SHLIB_PATH
     90 
     91 ## Compiler switch to embed a library name
     92 LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET))
     93 
     94 ## The type of assembly needed when pkgdata is used for generating shared libraries.
     95 # Commented out for now because the hp1 test machine runs out of memory.
     96 #GENCCODE_ASSEMBLY=-a aCC-parisc
     97 
     98 ## Shared object suffix
     99 SO=		sl
    100 ## Non-shared intermediate object suffix
    101 STATIC_O = o
    102 
    103 ## Compilation rules
    104 %.$(STATIC_O): $(srcdir)/%.c
    105 	$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
    106 %.o: $(srcdir)/%.c
    107 	$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
    108 
    109 %.$(STATIC_O): $(srcdir)/%.cpp
    110 	$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
    111 %.o: $(srcdir)/%.cpp
    112 	$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
    113 
    114 
    115 ## Dependency rules
    116 %.d : $(srcdir)/%.c
    117 	@echo "generating dependency information for $<"
    118 	@$(GEN_DEPS.c) $< > $@
    119 
    120 %.d : $(srcdir)/%.cpp
    121 	@echo "generating dependency information for $<"
    122 	@$(GEN_DEPS.cc) $< > $@
    123 
    124 ## Versioned libraries rules
    125 
    126 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
    127 	$(RM) $@ && ln -s ${<F} $@
    128 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
    129 	$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
    130 
    131 ## Install libraries as executable
    132 INSTALL-L=$(INSTALL_PROGRAM)
    133 
    134 ## Remove shared library 's'
    135 STATIC_PREFIX_WHEN_USED = 
    136 STATIC_PREFIX = 
    137 
    138 ## End HP/UX-specific setup
    139