Browse Source

Automate the search for -lpthread library

git-svn-id: https://klish.googlecode.com/svn/trunk@583 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 12 years ago
parent
commit
8b1a588fda
5 changed files with 15 additions and 77 deletions
  1. 0 14
      Makefile.in
  2. 0 14
      bin/module.am
  3. 0 3
      config.h.in
  4. 7 26
      configure
  5. 8 20
      configure.ac

+ 0 - 14
Makefile.in

@@ -581,8 +581,6 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
-PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
-PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 RT_CFLAGS = @RT_CFLAGS@
 RT_LIBS = @RT_LIBS@
@@ -710,10 +708,8 @@ bin_clish_LDADD = \
 	libtinyrl.la \
 	libtinyxml.la \
 	liblub.la \
-	@PTHREAD_LIBS@ \
 	@BFD_LIBS@
 
-#	@LUBHEAP_LIBS@
 bin_konfd_SOURCES = bin/konfd.c
 bin_konfd_LDADD = \
 	libkonf.la \
@@ -2986,17 +2982,7 @@ uninstall-am: uninstall-binPROGRAMS uninstall-libLIBRARIES \
 @TCL_TRUE@		libtinyxml.la \
 @TCL_TRUE@		liblub.la \
 @TCL_TRUE@		@TCL_LIBS@ \
-@TCL_TRUE@		@PTHREAD_LIBS@ \
 @TCL_TRUE@		@BFD_LIBS@
-#		@LUBHEAP_LIBS@
-
-@LUBHEAP_TRUE@	bin_PROGRAMS += bin/lubheap
-@LUBHEAP_TRUE@	bin_lubheap_SOURCES = bin/lubheap.c
-@LUBHEAP_TRUE@	bin_lubheap_LDADD = \
-@LUBHEAP_TRUE@		liblub.la \
-@LUBHEAP_TRUE@		@LUBHEAP_LIBS@ \
-@LUBHEAP_TRUE@		@PTHREAD_LIBS@ \
-@LUBHEAP_TRUE@		@BFD_LIBS@
 
 #EXTRA_DIST  +=                                  	\
 #                xml-examples/clock.xml 	\

+ 0 - 14
bin/module.am

@@ -11,9 +11,7 @@ bin_clish_LDADD = \
 	libtinyrl.la \
 	libtinyxml.la \
 	liblub.la \
-	@PTHREAD_LIBS@ \
 	@BFD_LIBS@
-#	@LUBHEAP_LIBS@
 
 bin_konfd_SOURCES = bin/konfd.c
 bin_konfd_LDADD = \
@@ -42,17 +40,5 @@ if TCL
 		libtinyxml.la \
 		liblub.la \
 		@TCL_LIBS@ \
-		@PTHREAD_LIBS@ \
-		@BFD_LIBS@
-#		@LUBHEAP_LIBS@
-endif
-
-if LUBHEAP
-	bin_PROGRAMS += bin/lubheap
-	bin_lubheap_SOURCES = bin/lubheap.c
-	bin_lubheap_LDADD = \
-		liblub.la \
-		@LUBHEAP_LIBS@ \
-		@PTHREAD_LIBS@ \
 		@BFD_LIBS@
 endif

+ 0 - 3
config.h.in

@@ -27,9 +27,6 @@
 /* Have native langauage support library */
 #undef HAVE_LIBINTL
 
-/* Have POSIX threads library */
-#undef HAVE_LIBPTHREAD
-
 /* Have POSIX real time library */
 #undef HAVE_LIBRT
 

+ 7 - 26
configure

@@ -627,8 +627,6 @@ TCL_LIBS
 TCL_CFLAGS
 RT_CFLAGS
 RT_LIBS
-PTHREAD_CFLAGS
-PTHREAD_LIBS
 TINYXML_CXXFLAGS
 TINYXML_LIBS
 TINYRL_CFLAGS
@@ -767,7 +765,6 @@ with_sysroot
 enable_libtool_lock
 enable_dependency_tracking
 enable_debug
-with_pthread
 with_rt
 with_tcl
 enable_lubheap
@@ -1426,8 +1423,6 @@ Optional Packages:
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-sysroot=DIR Search for dependent libraries within DIR
                         (or the compiler's sysroot if not specified).
-  --with-pthread=DIR      Use POSIX threads library distribution in DIR
-
   --with-rt=DIR           Use POSIX real time library distribution in DIR
   --with-tcl=DIR          Use TCL library distribution in DIR
 
@@ -16391,12 +16386,10 @@ fi
 ################################
 # Check for the PTHREAD library
 ################################
-
-# Check whether --with-pthread was given.
-if test "${with_pthread+set}" = set; then :
-  withval=$with_pthread;
-fi
-
+#C_ARG_WITH(pthread,
+#           [AS_HELP_STRING([--with-pthread=DIR],
+#                           [Use POSIX threads library distribution in DIR])
+#           ])
 
 for ac_header in pthread.h
 do :
@@ -16405,7 +16398,7 @@ if test "x$ac_cv_header_pthread_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_PTHREAD_H 1
 _ACEOF
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5
 $as_echo_n "checking for library containing pthread_create... " >&6; }
 if ${ac_cv_search_pthread_create+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -16459,16 +16452,8 @@ ac_res=$ac_cv_search_pthread_create
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
-$as_echo "#define HAVE_LIBPTHREAD /**/" >>confdefs.h
-
-                                if test "x$with_pthread" = "x"; then
-                                    PTHREAD_LIBS="-lpthread"
-                                else
-                                    PTHREAD_CFLAGS="-I$with_pthread/include"
-                                    PTHREAD_LIBS="-L$with_pthread/lib -lpthread"
-                                fi
-
-
+else
+   as_fn_error $? "Cannot find the POSIX threads library" "$LINENO" 5
 
 fi
 
@@ -16478,10 +16463,6 @@ fi
 done
 
 
-if test "x$PTHREAD_LIBS" = "x"; then
-    as_fn_error $? "Cannot find the POSIX threads library" "$LINENO" 5
-fi
-
 ################################
 # Check for the RT library
 ################################

+ 8 - 20
configure.ac

@@ -103,28 +103,16 @@ AC_SUBST(TINYXML_CXXFLAGS)
 ################################
 # Check for the PTHREAD library
 ################################
-AC_ARG_WITH(pthread,
-            [AS_HELP_STRING([--with-pthread=DIR],
-                            [Use POSIX threads library distribution in DIR])
-            ])
+#C_ARG_WITH(pthread,
+#           [AS_HELP_STRING([--with-pthread=DIR],
+#                           [Use POSIX threads library distribution in DIR])
+#           ])
 
 AC_CHECK_HEADERS(pthread.h,
-                 [AC_SEARCH_LIBS([pthread_create], [pthread],
-                              [AC_DEFINE([HAVE_LIBPTHREAD], [], [Have POSIX threads library])
-                                if test "x$with_pthread" = "x"; then
-                                    PTHREAD_LIBS="-lpthread"
-                                else
-                                    PTHREAD_CFLAGS="-I$with_pthread/include"
-                                    PTHREAD_LIBS="-L$with_pthread/lib -lpthread"
-                                fi
-                                AC_SUBST(PTHREAD_LIBS)
-                                AC_SUBST(PTHREAD_CFLAGS)
-                              ])
-                 ])
-
-if test "x$PTHREAD_LIBS" = "x"; then
-    AC_MSG_ERROR([Cannot find the POSIX threads library])
-fi
+	[ AC_SEARCH_LIBS([pthread_create], [pthread], [],
+		[ AC_MSG_ERROR([Cannot find the POSIX threads library])
+	])
+])
 
 ################################
 # Check for the RT library