2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 topsrcdir
= @top_srcdir@
13 include $(MOD_DEPTH
)/config
/autoconf.mk
15 include $(topsrcdir
)/config
/config.mk
24 ifeq (,$(filter-out WINNT
,$(OS_ARCH
)))
30 PROGS
= $(addprefix $(OBJDIR
)/, $(CSRCS
:.c
=$(PROG_SUFFIX
)))
34 INCLUDES
= -I
$(dist_includedir
)
38 # Setting the variables LDOPTS and LIBPR. We first initialize
39 # them to the default values, then adjust them for some platforms.
40 LDOPTS
= -L
$(dist_libdir
)
41 LIBPR
= -lnspr
$(NSPR_VERSION
)
42 LIBPLC
= -lplc
$(NSPR_VERSION
)
44 ifeq ($(OS_ARCH
), WINNT
)
45 LDOPTS
= -NOLOGO
-DEBUG
-INCREMENTAL
:NO
46 LIBPR
= $(dist_libdir
)/libnspr
$(NSPR_VERSION
).
$(LIB_SUFFIX
)
47 LIBPLC
= $(dist_libdir
)/libplc
$(NSPR_VERSION
).
$(LIB_SUFFIX
)
50 ifneq ($(OS_ARCH
), WINNT
)
54 ifeq ($(OS_ARCH
), HP-UX
)
55 LDOPTS
+= -Wl
,+s
,+b
,$(PWD
)/$(dist_libdir
)
60 LDOPTS
+= -blibpath
:$(PWD
)/$(dist_libdir
):/usr
/lib
:/lib
61 LIBPR
= -lnspr
$(NSPR_VERSION
)_shr
62 LIBPLC
= -lplc
$(NSPR_VERSION
)_shr
66 ifeq ($(OS_ARCH
), SunOS
)
68 LDOPTS
+= -Xlinker
-R
-Xlinker
$(PWD
)/$(dist_libdir
)
70 LDOPTS
+= -R
$(PWD
)/$(dist_libdir
)
73 # SunOS 5.5 needs to link with -lpthread, even though we already
74 # linked with this system library when we built libnspr.so.
75 ifeq ($(OS_RELEASE
), 5.5)
77 EXTRA_LIBS
= -lpthread
82 ifeq ($(OS_ARCH
), SCOOS
)
83 # SCO Unix needs to link against -lsocket again even though we
84 # already linked with these system libraries when we built libnspr.so.
86 # This hardcodes in the executable programs the directory to find
87 # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
88 # option for ld on other platforms.
89 export LD_RUN_PATH
= $(PWD
)/$(dist_libdir
)
92 #####################################################
96 #####################################################
98 include $(topsrcdir
)/config
/rules.mk
101 ifeq ($(OS_ARCH
),AIX
)
102 ifneq ($(OS_RELEASE
),4.2)
103 ifneq ($(USE_PTHREADS
), 1)
109 ifeq ($(AIX_PRE_4_2
),1)
111 # AIX releases prior to 4.2 need a special two-step linking hack
112 # in order to both override the system select() and be able to
113 # get at the original system select().
115 # We use a pattern rule in ns/nspr20/config/rules.mk to generate
116 # the .$(OBJ_SUFFIX) file from the .c source file, then do the
117 # two-step linking hack below.
119 $(OBJDIR
)/%: $(OBJDIR
)/%.
$(OBJ_SUFFIX
)
122 $(CC
) $(AIX_LINK_OPTS
) -o
$(AIX_TMP
) $< $(dist_libdir
)/libnspr
$(NSPR_VERSION
).a
123 $(CC
) -o
$@
$(AIX_TMP
) $(AIX_WRAP
)
128 # All platforms that are not AIX pre-4.2.
130 $(OBJDIR
)/%$(PROG_SUFFIX
): $(OBJDIR
)/%.
$(OBJ_SUFFIX
)
132 ifeq ($(OS_ARCH
), WINNT
)
133 link
$(LDOPTS
) $< $(LIBPR
) $(LIBPLC
) ws2_32.lib
-out
:$@
135 $(CC
) $(XCFLAGS
) $< $(LDOPTS
) $(LIBPR
) $(LIBPLC
) $(EXTRA_LIBS
) -o
$@