Skip to content

Commit

Permalink
configure: Move COMPAT_LIBS check to configure
Browse files Browse the repository at this point in the history
It's project specific, not everyone needs those libs.
  • Loading branch information
tihirvon committed Aug 25, 2006
1 parent 127e716 commit 4bd4936
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
24 changes: 24 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,29 @@ check_cflags()
return 0
}

check_compat()
{
COMPAT_LIBS=
case `uname -s` in
SunOS)
# connect() etc.
try_link -lsocket && COMPAT_LIBS="$COMPAT_LIBS -lsocket"

# gethostbyname()
try_link -lnsl && COMPAT_LIBS="$COMPAT_LIBS -lnsl"

# nanosleep()
if try_link -lrt
then
COMPAT_LIBS="$COMPAT_LIBS -lrt"
elif try_link -lposix4
then
COMPAT_LIBS="$COMPAT_LIBS -lposix4"
fi
esac
makefile_vars COMPAT_LIBS
}

check_ncurses()
{
if check_library NCURSES "" -lncursesw
Expand Down Expand Up @@ -178,6 +201,7 @@ check check_cc
check check_cflags
check check_cc_depgen
check check_endianness
check check_compat
check check_dl
check check_pthread
check check_ncurses
Expand Down
21 changes: 1 addition & 20 deletions scripts/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ cc_cxx_common()

common_cf=
common_lf=
COMPAT_LIBS=

case `uname -s` in
*BSD)
Expand Down Expand Up @@ -158,27 +157,9 @@ cc_cxx_common()
SunOS)
common_cf="$common_cf -D__EXTENSIONS__ -I/usr/local/include"
common_lf="$common_lf -R/usr/local/lib -L/usr/local/lib"

# this is ugly but can be removed after Solaris is either
# dead or fixed

# connect() etc.
try_link -lsocket && COMPAT_LIBS="$COMPAT_LIBS -lsocket"

# gethostbyname()
try_link -lnsl && COMPAT_LIBS="$COMPAT_LIBS -lnsl"

# nanosleep()
if try_link -lrt
then
COMPAT_LIBS="$COMPAT_LIBS -lrt"
elif try_link -lposix4
then
COMPAT_LIBS="$COMPAT_LIBS -lposix4"
fi
;;
esac
makefile_vars SOFLAGS LDSOFLAGS LDDLFLAGS COMPAT_LIBS
makefile_vars SOFLAGS LDSOFLAGS LDDLFLAGS
}

# CC, LD, CFLAGS, LDFLAGS, SOFLAGS, LDSOFLAGS, LDDLFLAGS
Expand Down

0 comments on commit 4bd4936

Please sign in to comment.