]> git.ipfire.org Git - thirdparty/gcc.git/blame - gotools/configure.ac
Use REST API for bug titles in mklog.
[thirdparty/gcc.git] / gotools / configure.ac
CommitLineData
bf1de3f0 1# Configure script for gotools.
48eae472 2# Copyright (C) 2015-2016 Free Software Foundation, Inc.
bf1de3f0
ILT
3#
4# This file is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12# General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; see the file COPYING3. If not see
16# <http://www.gnu.org/licenses/>.
17
18AC_INIT(package-unused, version-unused,, gotools)
bf1de3f0
ILT
19AC_CONFIG_SRCDIR(Makefile.am)
20
bf1de3f0
ILT
21# Determine the noncanonical names used for directories.
22ACX_NONCANONICAL_BUILD
23ACX_NONCANONICAL_HOST
24ACX_NONCANONICAL_TARGET
25
26dnl Autoconf 2.5x and later will set a default program prefix if
27dnl --target was used, even if it was the same as --host. Disable
28dnl that behavior. This must be done before AC_CANONICAL_SYSTEM
29dnl to take effect.
30test "$host_noncanonical" = "$target_noncanonical" &&
31 test "$program_prefix$program_suffix$program_transform_name" = \
32 NONENONEs,x,x, &&
33 program_transform_name=s,y,y,
34
35AC_CANONICAL_SYSTEM
36AC_ARG_PROGRAM
37
38AM_INIT_AUTOMAKE([1.9.3 no-define foreign no-dist -Wall -Wno-portability])
39AM_MAINTAINER_MODE
40
41AC_PROG_INSTALL
42
43AC_PROG_CC
44AC_PROG_GO
45
1913c1bf
ILT
46# These should be defined by the top-level configure.
47# Copy them into Makefile.
48AC_SUBST(GOC_FOR_TARGET)
49AC_SUBST(GCC_FOR_TARGET)
50
e2fea931 51AM_CONDITIONAL(NATIVE, test "$host_alias" = "$target_alias")
bf1de3f0 52
85d7b5d5
ILT
53dnl Test for -lsocket and -lnsl. Copied from libjava/configure.ac.
54AC_CACHE_CHECK([for socket libraries], gotools_cv_lib_sockets,
55 [gotools_cv_lib_sockets=
56 gotools_check_both=no
57 AC_CHECK_FUNC(connect, gotools_check_socket=no, gotools_check_socket=yes)
58 if test "$gotools_check_socket" = "yes"; then
59 unset ac_cv_func_connect
60 AC_CHECK_LIB(socket, main, gotools_cv_lib_sockets="-lsocket",
61 gotools_check_both=yes)
62 fi
63 if test "$gotools_check_both" = "yes"; then
64 gotools_old_libs=$LIBS
65 LIBS="$LIBS -lsocket -lnsl"
66 unset ac_cv_func_accept
67 AC_CHECK_FUNC(accept,
68 [gotools_check_nsl=no
69 gotools_cv_lib_sockets="-lsocket -lnsl"])
70 unset ac_cv_func_accept
71 LIBS=$gotools_old_libs
72 fi
73 unset ac_cv_func_gethostbyname
74 gotools_old_libs="$LIBS"
75 AC_CHECK_FUNC(gethostbyname, ,
76 [AC_CHECK_LIB(nsl, main,
77 [gotools_cv_lib_sockets="$gotools_cv_lib_sockets -lnsl"])])
78 unset ac_cv_func_gethostbyname
79 LIBS=$gotools_old_libs
80])
81NET_LIBS="$gotools_cv_lib_sockets"
82AC_SUBST(NET_LIBS)
83
5bd8d5c1
RO
84dnl Test if -lrt is required for sched_yield and/or nanosleep.
85AC_SEARCH_LIBS([sched_yield], [rt])
86AC_SEARCH_LIBS([nanosleep], [rt])
87
bf1de3f0
ILT
88AC_CONFIG_FILES(Makefile)
89
90AC_OUTPUT