Browse Source

Autotools enhancement

Now libtoolize copy missing files
Adds m4 macro directory for aclocal
etc.
Yann Weber 5 years ago
parent
commit
d19acb74ec
4 changed files with 31 additions and 4 deletions
  1. 9
    1
      Makefile.am
  2. 1
    1
      autogen.sh
  3. 17
    1
      configure.ac
  4. 4
    1
      docs/Makefile.in

+ 9
- 1
Makefile.am View File

@@ -1,4 +1,5 @@
1
-SUBDIRS = src tests
1
+ACLOCAL_AMFLAGS= -I m4
2
+SUBDIRS =
2 3
 
3 4
 if HAVE_DOXYGEN
4 5
 SUBDIRS += docs
@@ -7,3 +8,10 @@ docs:
7 8
 	-cd docs; rm doxyfile.stamp; make doxyfile.stamp
8 9
 .PHONY: docs
9 10
 endif
11
+
12
+SUBDIRS += src
13
+
14
+if CHECK
15
+SUBDIRS += tests
16
+endif
17
+

+ 1
- 1
autogen.sh View File

@@ -6,7 +6,7 @@ rm -fR configure aclocal.m4 autom4te.cache src/Makefile.in tests/Makefile.in Mak
6 6
 
7 7
 [ "$1" = "clean" ] && exit 0
8 8
 
9
-libtoolize
9
+libtoolize -i
10 10
 aclocal
11 11
 autoconf
12 12
 automake -a -c

+ 17
- 1
configure.ac View File

@@ -5,10 +5,19 @@ AC_PREREQ([2.69])
5 5
 AC_INIT([PyFCGI], [0.0.1], [yann.weber@member.fsf.org])
6 6
 AC_CONFIG_SRCDIR([src/main.c])
7 7
 AC_CONFIG_HEADERS([include/config.h])
8
+AC_CONFIG_MACRO_DIRS([m4])
8 9
 
9 10
 
10 11
 AC_ARG_ENABLE([debug],
11 12
 	AS_HELP_STRING([--enable-debug], [Enable debug, disabling -Werror, etc.]))
13
+AC_ARG_ENABLE([check],
14
+	AS_HELP_STRING([--disable-debug], [Disable unit test support]),
15
+	[case "${enableval}" in
16
+		yes) check=true;;
17
+		no) check=false;;
18
+		*) AC_MSG_ERROR([bad value ${enableval} for --disable-check]);;
19
+	esac],[check=true])
20
+AM_CONDITIONAL([CHECK], [test x$check = xtrue])
12 21
 
13 22
 AC_USE_SYSTEM_EXTENSIONS
14 23
 AC_GNU_SOURCE
@@ -62,7 +71,14 @@ AC_C_INLINE
62 71
 AC_CHECK_LIB([fcgi], [FCGI_Accept])
63 72
 AC_CHECK_LIB([rt], [timer_create])
64 73
 AC_CHECK_LIB([pthread], [sem_open shm_open])
65
-PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
74
+if test "x$check" = "xtrue"
75
+then
76
+	PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [],
77
+		AC_MSG_FAILURE([Unabe to locate (check unit test c framework).
78
+You can run ./configure --disable-check if you do not need unit tests.
79
+]))
80
+	AS_IF([test x"${enable_debug}" = x"yes"], [CK_FORK=no], [])
81
+fi
66 82
 
67 83
 # Checks for header files.
68 84
 AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h syslog.h unistd.h sem.h time.h])

+ 4
- 1
docs/Makefile.in View File

@@ -90,7 +90,10 @@ host_triplet = @host@
90 90
 @HAVE_DOXYGEN_TRUE@am__append_1 = $(top_srcdir)/docs/man/man1/pyfcgi.1
91 91
 subdir = docs
92 92
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
93
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
93
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
94
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
95
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
96
+	$(top_srcdir)/configure.ac
94 97
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
95 98
 	$(ACLOCAL_M4)
96 99
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)

Loading…
Cancel
Save