Skip to content

Commit 2b6d74a

Browse files
committed
introduced autotools build system
1 parent 67c4f17 commit 2b6d74a

File tree

7 files changed

+152
-41
lines changed

7 files changed

+152
-41
lines changed

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Makefile
2+
config.h
3+
config.log
4+
config.status
5+
depcomp
6+
install-sh
7+
missing
8+
configure
9+
aclocal.m4
10+
Makefile.in
11+
.deps
12+
*~
13+
*.o
14+
*.cache
15+
v4l2grab
16+
stamp-h1

Makefile.am

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip foreign
2+
bin_PROGRAMS = v4l2grab
3+
v4l2grab_SOURCES = v4l2grab.c yuv.c

autogen.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
#echo "Creating AUTHORS file from git ..."
3+
#git log --format='%aN <%aE>' | awk '{arr[$0]++} END{for (i in arr){print arr[i], i;}}' | sort -rn | cut -d\ -f2- > AUTHORS
4+
echo "Regenerating autotools files"
5+
autoreconf --install --force --symlink || exit 1

config.h.in

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/* config.h.in. Generated from configure.in by autoheader. */
2+
3+
/* Define to 1 if you have the <fcntl.h> header file. */
4+
#undef HAVE_FCNTL_H
5+
6+
/* Define to 1 if you have the `getpagesize' function. */
7+
#undef HAVE_GETPAGESIZE
8+
9+
/* Define to 1 if you have the <inttypes.h> header file. */
10+
#undef HAVE_INTTYPES_H
11+
12+
/* Define to 1 if you have the `jpeg' library (-ljpeg). */
13+
#undef HAVE_LIBJPEG
14+
15+
/* Define to 1 if you have the `v4l2' library (-lv4l2). */
16+
#undef HAVE_LIBV4L2
17+
18+
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
19+
to 0 otherwise. */
20+
#undef HAVE_MALLOC
21+
22+
/* Define to 1 if you have the <malloc.h> header file. */
23+
#undef HAVE_MALLOC_H
24+
25+
/* Define to 1 if you have the <memory.h> header file. */
26+
#undef HAVE_MEMORY_H
27+
28+
/* Define to 1 if you have the `select' function. */
29+
#undef HAVE_SELECT
30+
31+
/* Define to 1 if you have the <stdint.h> header file. */
32+
#undef HAVE_STDINT_H
33+
34+
/* Define to 1 if you have the <stdlib.h> header file. */
35+
#undef HAVE_STDLIB_H
36+
37+
/* Define to 1 if you have the `strerror' function. */
38+
#undef HAVE_STRERROR
39+
40+
/* Define to 1 if you have the <strings.h> header file. */
41+
#undef HAVE_STRINGS_H
42+
43+
/* Define to 1 if you have the <string.h> header file. */
44+
#undef HAVE_STRING_H
45+
46+
/* Define to 1 if you have the <sys/ioctl.h> header file. */
47+
#undef HAVE_SYS_IOCTL_H
48+
49+
/* Define to 1 if you have the <sys/stat.h> header file. */
50+
#undef HAVE_SYS_STAT_H
51+
52+
/* Define to 1 if you have the <sys/time.h> header file. */
53+
#undef HAVE_SYS_TIME_H
54+
55+
/* Define to 1 if you have the <sys/types.h> header file. */
56+
#undef HAVE_SYS_TYPES_H
57+
58+
/* Define to 1 if you have the <unistd.h> header file. */
59+
#undef HAVE_UNISTD_H
60+
61+
/* Name of package */
62+
#undef PACKAGE
63+
64+
/* Define to the address where bug reports for this package should be sent. */
65+
#undef PACKAGE_BUGREPORT
66+
67+
/* Define to the full name of this package. */
68+
#undef PACKAGE_NAME
69+
70+
/* Define to the full name and version of this package. */
71+
#undef PACKAGE_STRING
72+
73+
/* Define to the one symbol short name of this package. */
74+
#undef PACKAGE_TARNAME
75+
76+
/* Define to the home page for this package. */
77+
#undef PACKAGE_URL
78+
79+
/* Define to the version of this package. */
80+
#undef PACKAGE_VERSION
81+
82+
/* Define to 1 if you have the ANSI C header files. */
83+
#undef STDC_HEADERS
84+
85+
/* Version number of package */
86+
#undef VERSION
87+
88+
/* Define to rpl_malloc if the replacement function should be used. */
89+
#undef malloc
90+
91+
/* Define to `unsigned int' if <sys/types.h> does not define. */
92+
#undef size_t

configure.in

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -*- Autoconf -*-
2+
# Process this file with autoconf to produce a configure script.
3+
4+
AC_INIT([v4l2grab], [m4_esyscmd_s([git describe --always --tag --dirty])], [[email protected]])
5+
6+
# prepare for automake
7+
AM_INIT_AUTOMAKE
8+
9+
AC_CONFIG_SRCDIR([yuv.h])
10+
AC_CONFIG_HEADERS([config.h])
11+
AC_CONFIG_FILES([Makefile])
12+
13+
# Checks for programs.
14+
AC_PROG_CC
15+
16+
# Checks for libraries.
17+
AC_CHECK_LIB([jpeg], [jpeg_start_compress])
18+
AC_CHECK_LIB([v4l2], [v4l2_open])
19+
20+
# Checks for header files.
21+
AC_CHECK_HEADERS([fcntl.h malloc.h stdlib.h string.h sys/ioctl.h sys/time.h unistd.h])
22+
23+
# Checks for typedefs, structures, and compiler characteristics.
24+
AC_TYPE_SIZE_T
25+
26+
# Checks for library functions.
27+
AC_FUNC_MALLOC
28+
AC_CHECK_FUNCS([getpagesize select strerror])
29+
30+
AC_OUTPUT

makefile

-37
This file was deleted.

v4l2grab.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@
4747
#include <linux/videodev2.h>
4848
#include <jpeglib.h>
4949
#include <libv4l2.h>
50+
51+
#include "config.h"
5052
#include "yuv.h"
5153

5254
#define CLEAR(x) memset (&(x), 0, sizeof (x))
5355

54-
#ifndef __GITVERSION
55-
#define __GITVERSION "unknown"
56+
#ifndef VERSION
57+
#define VERSION "unknown"
5658
#endif
5759

5860
#if defined(IO_MMAP) || defined(IO_USERPTR)
@@ -767,7 +769,7 @@ static void usage(FILE* fp, int argc, char** argv)
767769
"-u | --userptr Use application allocated buffers\n"
768770
"-W | --width Set image width\n"
769771
"-H | --height Set image height\n"
770-
"-v | --version Print version"
772+
"-v | --version Print version\n"
771773
"",
772774
argv[0]);
773775
}
@@ -861,7 +863,7 @@ int main(int argc, char **argv)
861863
break;
862864

863865
case 'v':
864-
printf("Version: %s\n", __GITVERSION);
866+
printf("Version: %s\n", VERSION);
865867
exit(EXIT_SUCCESS);
866868
break;
867869

0 commit comments

Comments
 (0)