Merged gcc support from the HP-UX Mozilla Patching Kit version 3.00
authorwtc
Wed, 27 May 1998 23:13:47 +0000
changeset 129 bcd7b2691deadf53e01aa1c03c53d02e12037663
parent 128 e71233074fe399a5bb89b11ae1e40e00458c50a9
child 130 f20748cdf4e41810939e62ea13490cd52ec4f91a
push idunknown
push userunknown
push dateunknown
Merged gcc support from the HP-UX Mozilla Patching Kit version 3.00 (http://hpux.csc.liv.ac.uk/hppd/mozilla/), maintained by Richard K Lloyd <hpux@csc.liv.ac.uk>.
config/HP-UX.mk
--- a/config/HP-UX.mk
+++ b/config/HP-UX.mk
@@ -18,23 +18,31 @@
 #
 # Config stuff for HP-UX
 #
 
 include $(MOD_DEPTH)/config/UNIX.mk
 
 DLL_SUFFIX	= sl
 
+ifdef NS_USE_GCC
+CC			= gcc
+CCC			= g++
+OS_CFLAGS		=
+else
 CC			= cc -Ae
 CCC			= CC
+OS_CFLAGS		= +ESlit
+endif
+
 RANLIB			= echo
 
 CPU_ARCH		= hppa
 
-OS_CFLAGS		= +ESlit $(DSO_CFLAGS) -DHPUX -D$(CPU_ARCH) -D_HPUX_SOURCE
+OS_CFLAGS		+= $(DSO_CFLAGS) -DHPUX -D$(CPU_ARCH) -D_HPUX_SOURCE
 
 #
 # The header netdb.h on HP-UX 9 does not declare h_errno.
 # On 10.10 and 10.20, netdb.h declares h_errno only if
 # _XOPEN_SOURCE_EXTENDED is defined.  So we need to declare
 # h_errno ourselves.
 #
 ifeq ($(basename $(OS_RELEASE)),A.09)
@@ -82,25 +90,31 @@ OS_CFLAGS		+= -DHPUX10 -DHPUX10_20
 DEFAULT_IMPL_STRATEGY = _PTH
 endif
 
 #
 # On 10.30 and 11.00, we use the new ANSI C++ compiler aCC.
 #
 
 ifeq ($(OS_RELEASE),B.10.30)
+ifndef NS_USE_GCC
 CCC			= /opt/aCC/bin/aCC
-OS_CFLAGS		+= +DAportable +DS1.1 -DHPUX10 -DHPUX10_30
+OS_CFLAGS		+= +DAportable +DS1.1
+endif
+OS_CFLAGS		+= -DHPUX10 -DHPUX10_30
 DEFAULT_IMPL_STRATEGY = _PTH
 endif
 
 # 11.00 is similar to 10.30.
 ifeq ($(OS_RELEASE),B.11.00)
+ifndef NS_USE_GCC
 CCC			= /opt/aCC/bin/aCC
-OS_CFLAGS		+= +DAportable +DS1.1 -DHPUX10 -DHPUX11
+OS_CFLAGS		+= +DAportable +DS1.1
+endif
+OS_CFLAGS		+= -DHPUX10 -DHPUX11
 DEFAULT_IMPL_STRATEGY = _PTH
 endif
 
 ifeq ($(DEFAULT_IMPL_STRATEGY),_CLASSIC)
 CLASSIC_NSPR = 1
 endif
 
 ifeq ($(DEFAULT_IMPL_STRATEGY),_PTH)
@@ -144,12 +158,18 @@ endif
 ifdef PTHREADS_USER
 OS_CFLAGS		+= -D_POSIX_C_SOURCE=199506L
 endif
 
 MKSHLIB			= $(LD) $(DSO_LDOPTS)
 
 DSO_LDOPTS		= -b
 DSO_LDFLAGS		=
-# +Z generates position independent code for use in shared libraries.
+
+# -fPIC or +Z generates position independent code for use in shared
+# libraries.
+ifdef NS_USE_GCC
+DSO_CFLAGS		= -fPIC
+else
 DSO_CFLAGS		= +Z
+endif
 
 HAVE_PURIFY		= 1