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
17 ifeq ($(OS_TARGET
), WIN16
)
18 OS_CFLAGS
= $(OS_EXE_CFLAGS
)
29 ifeq (,$(filter-out WINNT OS2
,$(OS_ARCH
)))
35 PROGS
= $(addprefix $(OBJDIR
)/, $(CSRCS
:.c
=$(PROG_SUFFIX
)))
39 INCLUDES
= -I
$(dist_includedir
)
43 # Setting the variables LDOPTS and LIBPR. We first initialize
44 # them to the default values, then adjust them for some platforms.
45 LDOPTS
= -L
$(dist_libdir
)
46 LIBPR
= -lnspr
$(NSPR_VERSION
)
47 LIBPLC
= -lplc
$(NSPR_VERSION
)
49 ifeq ($(OS_ARCH
), WINNT
)
50 ifeq ($(OS_TARGET
), WIN16
)
51 LIBPR
= $(dist_libdir
)/nspr
$(NSPR_VERSION
).lib
52 LIBPLC
= $(dist_libdir
)/plc
$(NSPR_VERSION
).lib
54 LDOPTS
= -NOLOGO
-DEBUG
-INCREMENTAL
:NO
55 LIBPR
= $(dist_libdir
)/libnspr
$(NSPR_VERSION
).
$(LIB_SUFFIX
)
56 LIBPLC
= $(dist_libdir
)/libplc
$(NSPR_VERSION
).
$(LIB_SUFFIX
)
61 LDOPTS
+= -Zomf
-Zlinker
/PM
:VIO
64 ifneq ($(OS_ARCH
), WINNT
)
68 ifeq ($(OS_ARCH
), HP-UX
)
69 LDOPTS
+= -Wl
,+s
,+b
,$(PWD
)/$(dist_libdir
)
74 LDOPTS
+= -blibpath
:$(PWD
)/$(dist_libdir
):/usr
/lib
:/lib
75 LIBPR
= -lnspr
$(NSPR_VERSION
)_shr
76 LIBPLC
= -lplc
$(NSPR_VERSION
)_shr
80 ifeq ($(OS_ARCH
), SunOS
)
82 LDOPTS
+= -Xlinker
-R
-Xlinker
$(PWD
)/$(dist_libdir
)
84 LDOPTS
+= -R
$(PWD
)/$(dist_libdir
)
87 # SunOS 5.5 needs to link with -lpthread, even though we already
88 # linked with this system library when we built libnspr.so.
89 ifeq ($(OS_RELEASE
), 5.5)
91 EXTRA_LIBS
= -lpthread
96 ifeq ($(OS_ARCH
), SCOOS
)
97 # SCO Unix needs to link against -lsocket again even though we
98 # already linked with these system libraries when we built libnspr.so.
100 # This hardcodes in the executable programs the directory to find
101 # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
102 # option for ld on other platforms.
103 export LD_RUN_PATH
= $(PWD
)/$(dist_libdir
)
106 #####################################################
110 #####################################################
112 include $(topsrcdir
)/config
/rules.mk
115 ifeq ($(OS_ARCH
),AIX
)
116 ifneq ($(OS_RELEASE
),4.2)
117 ifneq ($(USE_PTHREADS
), 1)
123 ifeq ($(AIX_PRE_4_2
),1)
125 # AIX releases prior to 4.2 need a special two-step linking hack
126 # in order to both override the system select() and be able to
127 # get at the original system select().
129 # We use a pattern rule in ns/nspr20/config/rules.mk to generate
130 # the .$(OBJ_SUFFIX) file from the .c source file, then do the
131 # two-step linking hack below.
133 $(OBJDIR
)/%: $(OBJDIR
)/%.
$(OBJ_SUFFIX
)
136 $(CC
) $(AIX_LINK_OPTS
) -o
$(AIX_TMP
) $< $(dist_libdir
)/libnspr
$(NSPR_VERSION
).a
137 $(CC
) -o
$@
$(AIX_TMP
) $(AIX_WRAP
)
142 # All platforms that are not AIX pre-4.2.
144 $(OBJDIR
)/%$(PROG_SUFFIX
): $(OBJDIR
)/%.
$(OBJ_SUFFIX
)
146 ifeq ($(OS_ARCH
), WINNT
)
147 ifeq ($(OS_TARGET
),WIN16
)
148 echo system windows
>w16link
149 echo option map
>>w16link
150 echo option stack
=10K
>>w16link
151 echo option heapsize
=32K
>>w16link
152 echo debug
$(DEBUGTYPE
) all >>w16link
153 echo name
$@
>>w16link
156 echo library
>>w16link
157 echo
$(LIBPR
), >>w16link
158 echo
$(LIBPLC
), >>w16link
159 echo winsock.lib
>>w16link
162 link
$(LDOPTS
) $< $(LIBPR
) $(LIBPLC
) ws2_32.lib
-out
:$@
165 ifeq ($(OS_ARCH
),OS2
)
166 $(LINK
) $(LDOPTS
) $< $(LIBPR
) $(LIBPLC
) $(OS_LIBS
) $(EXTRA_LIBS
) -o
$@
168 $(CC
) $(XCFLAGS
) $< $(LDOPTS
) $(LIBPR
) $(LIBPLC
) $(EXTRA_LIBS
) -o
$@