summaryrefslogtreecommitdiff
path: root/libgupc/configure.tgt
blob: 7934e75d69ef8d487a126566d13a828115ebc825 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# This is the target specific configuration file.  This is invoked by the
# autoconf generated configure script.  Putting it in a separate shell file
# lets us skip running autoconf when modifying target specific information.
#
# This file is adapted from the libgomp implementation.

# This file switches on the shell variable ${target}, and sets the
# following shell variables:
#  config_path		An ordered list of directories to search for
#			sources and headers.  This is relative to the
#			config subdirectory of the source tree.
#  XCFLAGS		Add extra compile flags to use.
#  XLDFLAGS		Add extra link flags to use.


# Set defaults
config_path="posix default"

case "${target}" in

  *-*-hpux*)
	case "${target}" in
	  *-*-hpux11*)
	     # HPUX v11.x requires -lrt to resolve sem_init in libgupc.la
	     XLDFLAGS="${XLDFLAGS} -lrt"
	     ;;
	esac
	case "${target}" in
	  hppa[12]*-*-hpux*)
	    # PA 32 HP-UX needs -frandom-seed for bootstrap compare.
	    XCFLAGS="${XCFLAGS} -frandom-seed=fixed-seed"
	    ;;
	esac
	;;

  *-*-mingw32*)
	config_path="mingw32 ${config_path}"
	;;

  *-*-darwin*)
	config_path="darwin bsd ${config_path}"
	;;

  mips-sgi-irix6*)
	# Need to link with -lpthread so libgupc.so is self-contained.
	XLDFLAGS="${XLDFLAGS} -lpthread"
	;;
  *)
	;;

esac
#
#  The logic above sets configuration directories that may
#  be currently unsupported.  Remove non-existent directories
#  from the 'config_path' variable.  It is assumed that higher
#  level logic will check for valid libgupc targets.
#
_config_path=
for cfg_dir in ${config_path}; do
  if test -d ${srcdir}/config/$cfg_dir; then
    _config_path="${_config_path} $cfg_dir"
  fi
done
config_path="${_config_path}"

upc_crtstuff=yes
upc_crtbegin_spec=\
"%{static:upc-crtbeginT%O%s; shared|pie:upc-crtbeginS%O%s; :upc-crtbegin%O%s}"
upc_crtend_spec=\
"%{static:upc-crtendT%O%s; shared|pie:upc-crtendS%O%s; :upc-crtend%O%s}"
upc_crtstuff_objs=\
"upc-crtbeginT.o upc-crtbeginS.o upc-crtbegin.o upc-crtendT.o upc-crtendS.o upc-crtend.o"
upc_crtstuff_mak=
for cfg_dir in ${config_path}; do
  cfg_mak=config/$cfg_dir/upc-crtstuff.mak
  if test -e ${srcdir}/${cfg_mak}; then
    upc_crtstuff_mak=${cfg_mak}
    break
  fi
done

# The following empty alternatives are kept as place holders
# that will be filled in with target-specific settings as needed.
case "${target}" in
  *-*-darwin*)
    ;;
  mips-sgi-irix6*)
    ;;
  *)
    ;;
esac

# For UPC, always add the math library
LIBS="-lm $LIBS"
if test "${upc_numa}" = "yes"; then
  LIBS="-lnuma $LIBS"
fi
if test "$upc_runtime_model" = "portals4"; then
  LIBS="-lpthread $LIBS"
  if test x"$portals4libs" != "x"; then
    LIBS="$portals4libs $LIBS"
  fi
fi
if test "x$enable_execinfo_lib" = "xyes"; then
  LIBS="-lexecinfo $LIBS"
fi
libgupc_spec="%{!fupc-pthreads*:-lgupc;:-lgupc_pt -lpthread}"
if test "$enable_upc_backtrace" = yes &&
   test -n "$export_dynamic_flag_spec"; then
  dynamic_spec=`echo "$export_dynamic_flag_spec" | sed -e 's/${wl}//'`
  libgupc_spec="$dynamic_spec ${libgupc_spec}"
fi
if test "$enable_upc_link_script" = yes; then
  libgupc_spec="-T gupc.ld%s ${libgupc_spec}"
fi
# Set up the set of libraries that we need to link against for libgupc.
# 
link_upc_spec="${libgupc_spec} $LIBS"