Browse Source

Deleted lib dir + autoconf enhancement

Yann Weber 5 years ago
parent
commit
fa88c2fc9a
5 changed files with 25 additions and 18 deletions
  1. 1
    1
      Makefile.am
  2. 11
    7
      configure.ac
  3. 0
    4
      lib/Makefile.am
  4. 13
    6
      src/Makefile.am
  5. 0
    0
      src/python_pyfcgi.c

+ 1
- 1
Makefile.am View File

@@ -1 +1 @@
1
-SUBDIRS = src tests lib
1
+SUBDIRS = src tests

+ 11
- 7
configure.ac View File

@@ -16,14 +16,18 @@ AC_GNU_SOURCE
16 16
 # Checks for programs.
17 17
 AC_PROG_CC
18 18
 AC_PROG_RANLIB
19
-AC_CHECK_PROG(PYTHON_CONFIG, [python3-config], [yes])
20
-if test x"${PYTHON_CONFIG}" == x"yes"; then
21
-	PYTHON_CFLAGS=`python3-config --includes`
22
-	PYTHON_LDFLAGS=`python3-config --libs`
19
+
20
+AC_ARG_VAR(PYTHON_CONFIG_PATH, [python3-config path])
21
+AC_PATH_PROG(PYTHON_CONFIG_PATH, [python3-config], [no])
22
+echo "PYTHON CONFIG == ${PYTHON_CONFIG_PATH}"
23
+if test x"${PYTHON_CONFIG_PATH}" != x"no"; then
24
+	AC_SUBST([PYTHON_CONFIG_PATH])
25
+	PYTHON_CFLAGS=`${PYTHON_CONFIG_PATH} --includes`
26
+	PYTHON_LDFLAGS=`${PYTHON_CONFIG_PATH} --libs`
23 27
 	AC_SUBST([PYTHON_CFLAGS])
24 28
 	AC_SUBST([PYTHON_LDFLAGS])
25
-	PYTHON_SO_CFLAGS=`python3-config --cflags`
26
-	PYTHON_SO_LDFLAGS=`python3-config --cflags`
29
+	PYTHON_SO_CFLAGS=`${PYTHON_CONFIG_PATH} --cflags`
30
+	PYTHON_SO_LDFLAGS=`${PYTHON_CONFIG_PATH} --cflags`
27 31
 	AC_SUBST([PYTHON_SO_CFLAGS])
28 32
 	AC_SUBST([PYTHON_SO_LDFLAGS])
29 33
 else
@@ -66,5 +70,5 @@ AM_INIT_AUTOMAKE
66 70
 AC_CONFIG_FILES([Makefile
67 71
                  src/Makefile
68 72
 		 tests/Makefile
69
-		 lib/Makefile])
73
+])
70 74
 AC_OUTPUT

+ 0
- 4
lib/Makefile.am View File

@@ -1,4 +0,0 @@
1
-lib_LTLIBRARIES = libpyfcgi.la
2
-libpyfcgi_la_SOURCES = pyfcgi.c
3
-libpyfcgi_la_CFLAGS = $(PYTHON_SO_CFLAGS)
4
-libpyfcgi_la_LDFLAGS = $(PYTHON_SO_LDFLAGS)

+ 13
- 6
src/Makefile.am View File

@@ -1,11 +1,18 @@
1
+# pyfcgi fcgi executable
1 2
 bin_PROGRAMS = pyfcgi
2
-noinst_LIBRARIES = libpyfcgi.a
3
-
4
-libpyfcgi_a_SOURCES = logger.c pyworker.c responder.c conf.c pyutils.c
5
-libpyfcgi_a_CFLAGS = $(PYTHON_CFLAGS)
6
-
7
-
8 3
 pyfcgi_SOURCES = main.c $(libpyfcgi_a_SOURCES)
9 4
 pyfcgi_CFLAGS = $(PYTHON_CFLAGS) $(AM_CFLAGS)
10 5
 pyfcgi_LDADD = $(PYTHON_LDFLAGS)
11 6
 
7
+# libpyfcgi python module
8
+lib_LTLIBRARIES = libpyfcgi.la
9
+libpyfcgi_la_SOURCES = python_pyfcgi.c
10
+libpyfcgi_la_CFLAGS = $(PYTHON_SO_CFLAGS)
11
+libpyfcgi_la_LDFLAGS = $(PYTHON_SO_LDFLAGS)
12
+
13
+# static librarie for check
14
+noinst_LIBRARIES = libpyfcgi.a
15
+libpyfcgi_a_SOURCES = logger.c pyworker.c responder.c conf.c pyutils.c python_pyfcgi.c
16
+libpyfcgi_a_CFLAGS = $(PYTHON_CFLAGS)
17
+
18
+

lib/pyfcgi.c → src/python_pyfcgi.c View File


Loading…
Cancel
Save