diff --git a/configure.ac b/configure.ac index 027275e6..6c9ff9ab 100644 --- a/configure.ac +++ b/configure.ac @@ -134,8 +134,6 @@ esac dnl Checks for libraries. -AC_SEARCH_LIBS(cos, m) - dnl Thread related checks AC_CHECK_HEADER(pthread.h) AC_CHECK_LIB(pthread, pthread_exit) @@ -166,10 +164,22 @@ fi AM_CONDITIONAL(HAVE_THREADS, test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes") +thread_LIBS="$LIBS" +LIBS="" +dnl search for network related libraries AC_SEARCH_LIBS(inet_addr, xnet) AC_SEARCH_LIBS(socket, socket) +network_LIBS="$LIBS" +LIBS="" + +dnl check for some default libraries +AC_SEARCH_LIBS(cos, m) + +base_LIBS="$LIBS" +LIBS="" + dnl check for glut location AC_CHECK_HEADER(GL/glut.h) if test "x$ac_cv_header_GL_glut_h" = "xyes"; then @@ -184,9 +194,6 @@ else fi fi -base_LIBS="$LIBS" -LIBS="" - dnl check for OpenGL related libraries case "${host}" in *-*-cygwin* | *-*-mingw32*) @@ -252,6 +259,8 @@ LIBS="$base_LIBS" AC_SUBST(base_LIBS) AC_SUBST(opengl_LIBS) +AC_SUBST(thread_LIBS) +AC_SUBST(network_LIBS) dnl Check for MS Windows environment AC_CHECK_HEADER(windows.h) diff --git a/simgear/io/Makefile.am b/simgear/io/Makefile.am index 60bf8015..2c869c0a 100644 --- a/simgear/io/Makefile.am +++ b/simgear/io/Makefile.am @@ -32,7 +32,8 @@ tcp_server_LDADD = \ $(top_builddir)/simgear/bucket/libsgbucket.a \ $(top_builddir)/simgear/misc/libsgmisc.a \ $(top_builddir)/simgear/xml/libsgxml.a \ - -lplibnet -lplibul -lz + -lplibnet -lplibul -lz \ + $(network_LIBS) tcp_client_SOURCES = tcp_client.cxx @@ -42,7 +43,8 @@ tcp_client_LDADD = \ $(top_builddir)/simgear/bucket/libsgbucket.a \ $(top_builddir)/simgear/misc/libsgmisc.a \ $(top_builddir)/simgear/xml/libsgxml.a \ - -lplibnet -lplibul -lz + -lplibnet -lplibul -lz \ + $(network_LIBS) socktest_SOURCES = socktest.cxx @@ -52,7 +54,8 @@ socktest_LDADD = \ $(top_builddir)/simgear/debug/libsgdebug.a \ $(top_builddir)/simgear/misc/libsgmisc.a \ $(top_builddir)/simgear/xml/libsgxml.a \ - -lplibnet -lplibul -lz + -lplibnet -lplibul -lz \ + $(network_LIBS) lowtest_SOURCES = lowtest.cxx