Permalink
Browse files

Added libevent, libm and libpthread checks to configure.ac.

  • Loading branch information...
1 parent 1f76de5 commit 211340e0ae931f74228cd44283b64e1587dc1596 Nick committed Feb 1, 2010
Showing with 753 additions and 886 deletions.
  1. +0 −67 Makefile
  2. +2 −0 Makefile.am
  3. +1 −0 Makefile.in
  4. +220 −0 autom4te.cache/output.0
  5. +220 −0 autom4te.cache/output.1
  6. +18 −15 autom4te.cache/traces.0
  7. +56 −44 autom4te.cache/traces.1
  8. +0 −217 barbershop.c
  9. +0 −69 barbershop.h
  10. +0 −136 bst.c
  11. +0 −40 bst.h
  12. +0 −52 client.c
  13. +9 −0 config.h.in
  14. +220 −0 configure
  15. +6 −0 configure.ac
  16. +0 −157 scores.c
  17. +0 −43 scores.h
  18. +0 −1 src/Makefile.am
  19. +1 −2 src/Makefile.in
  20. +0 −43 stats.h
View
@@ -1,67 +0,0 @@
-# Barbershop Makefile
-# Copyright (C) 2010 Nick Gerakines <nick at gerakines dot net>
-# This file is released under the MIT license.
-
-CC=gcc
-uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
-OPTIMIZATION?=-O2
-ifeq ($(uname_S),SunOS)
- CFLAGS?= -std=c99 -pedantic $(OPTIMIZATION) -Wall -W -D__EXTENSIONS__ -D_XPG6
- CCLINK?= -ldl -lnsl -lsocket -lm -lpthread
-else
- CFLAGS?= $(OPTIMIZATION) -Wall $(ARCH) $(PROF)
- CCLINK?= -lm -pthread -levent
-endif
-CCOPT= $(CFLAGS) $(CCLINK) $(ARCH) $(PROF)
-DEBUG?= -g -rdynamic -ggdb
-
-OBJ = barbershop.o bst.o scores.o
-CLIOBJ = client.o
-
-PRGNAME = barbershop
-CLIPRGNAME = client
-
-all: barbershop
-
-# Deps (use make dep to generate this)
-client.o: client.c
-barbershop.o: barbershop.c stats.h
-bst.o: bst.c bst.h stats.h
-scores.o: scores.c scores.h stats.h
-benchmark.o: benchmark.c
-
-barbershop: $(OBJ)
- $(CC) -o $(PRGNAME) $(CCOPT) $(DEBUG) $(OBJ)
-
-client: $(CLIOBJ)
- $(CC) -o $(CLIPRGNAME) $(CCOPT) $(DEBUG) $(CLIOBJ)
-
-.c.o:
- $(CC) -c $(CFLAGS) $(DEBUG) $(COMPILE_TIME) $<
-
-clean:
- rm -rf $(PRGNAME) $(BENCHPRGNAME) $(CLIPRGNAME) *.o *.gcda *.gcno *.gcov
-
-dep:
- $(CC) -MM *.c
-
-staticsymbols:
- tclsh utils/build-static-symbols.tcl > staticsymbols.h
-
-log:
- git log '--pretty=format:%ad %s' --date=short > Changelog
-
-32bit:
- make ARCH="-arch i386"
-
-gprof:
- make PROF="-pg"
-
-gcov:
- make PROF="-fprofile-arcs -ftest-coverage"
-
-noopt:
- make OPTIMIZATION=""
-
-32bitgprof:
- make PROF="-pg" ARCH="-arch i386"
View
@@ -1,3 +1,5 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = src . tests
+
+EXTRA_DIST = bootstrap.sh
View
@@ -182,6 +182,7 @@ target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = src . tests
+EXTRA_DIST = bootstrap.sh
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
View
@@ -10793,6 +10793,149 @@ CC="$lt_save_CC"
# Checks for libraries.
+
+{ echo "$as_me:$LINENO: checking for cos in -lm" >&5
+echo $ECHO_N "checking for cos in -lm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_m_cos+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cos ();
+int
+main ()
+{
+return cos ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_m_cos=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_m_cos=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_cos" >&5
+echo "${ECHO_T}$ac_cv_lib_m_cos" >&6; }
+if test $ac_cv_lib_m_cos = yes; then
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
+echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_pthread_pthread_create=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_pthread_pthread_create=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; }
+if test $ac_cv_lib_pthread_pthread_create = yes; then
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBPTHREAD 1
+_ACEOF
+
+ LIBS="-lpthread $LIBS"
+
+fi
+
+
# This macro is defined in check.m4 and tests if check.h and
# libcheck.a are installed in your system. It sets CHECK_CFLAGS and
# CHECK_LIBS accordingly.
@@ -11014,6 +11157,83 @@ echo "$as_me: error: check not found" >&2;}
fi
+LIBEVENT_URL=http://www.monkey.org/~provos/libevent/
+
+{ echo "$as_me:$LINENO: checking for event_set in -levent" >&5
+echo $ECHO_N "checking for event_set in -levent... $ECHO_C" >&6; }
+if test "${ac_cv_lib_event_event_set+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-levent $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char event_set ();
+int
+main ()
+{
+return event_set ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_event_event_set=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_event_event_set=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_event_event_set" >&5
+echo "${ECHO_T}$ac_cv_lib_event_event_set" >&6; }
+if test $ac_cv_lib_event_event_set = yes; then
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBEVENT 1
+_ACEOF
+
+ LIBS="-levent $LIBS"
+
+else
+ { { echo "$as_me:$LINENO: error: libevent is required. You can get it from $LIBEVENT_URL" >&5
+echo "$as_me: error: libevent is required. You can get it from $LIBEVENT_URL" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
# Checks for header files.
{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
Oops, something went wrong.

0 comments on commit 211340e

Please sign in to comment.