Browse Source

add build infrastructure

William Pitcock 2 years ago
parent
commit
18f40b9717
4 changed files with 132 additions and 0 deletions
  1. 16
    0
      .gitignore
  2. 2
    0
      Makefile.am
  3. 87
    0
      autogen.sh
  4. 27
    0
      configure.ac

+ 16
- 0
.gitignore View File

@@ -0,0 +1,16 @@
1
+Makefile
2
+*.in
3
+*.o
4
+*.lo
5
+*.la
6
+config.h
7
+config.log
8
+config.status
9
+configure
10
+libtool
11
+stamp-h1
12
+aclocal.m4
13
+autom4te.cache
14
+.libs
15
+.deps
16
+libnv.pc

+ 2
- 0
Makefile.am View File

@@ -0,0 +1,2 @@
1
+sbin_PROGRAMS = svc-supervise
2
+svc_supervise_SOURCES = src/supervise/supervise.c

+ 87
- 0
autogen.sh View File

@@ -0,0 +1,87 @@
1
+#! /bin/sh
2
+
3
+TOP_DIR=$(dirname $0)
4
+LAST_DIR=$PWD
5
+
6
+if test ! -f $TOP_DIR/configure.ac ; then
7
+   echo "You must execute this script from the top level directory."
8
+   exit 1
9
+fi
10
+
11
+AUTOCONF=${AUTOCONF:-autoconf}
12
+ACLOCAL=${ACLOCAL:-aclocal}
13
+AUTOHEADER=${AUTOHEADER:-autoheader}
14
+AUTOMAKE=${AUTOMAKE:-automake}
15
+LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
16
+
17
+dump_help_screen ()
18
+{
19
+   echo "Usage: $0 [options]"
20
+   echo 
21
+   echo "options:"
22
+   echo "  -n           skip CVS changelog creation"
23
+   echo "  -h,--help    show this help screen"
24
+   echo
25
+   exit 0
26
+}
27
+
28
+parse_options ()
29
+{
30
+   while test "$1" != "" ; do
31
+      case $1 in
32
+         -h|--help)
33
+            dump_help_screen
34
+            ;;
35
+         -n)
36
+            SKIP_CVS_CHANGELOG=yes
37
+            ;;
38
+         *)
39
+            echo Invalid argument - $1
40
+            dump_help_screen
41
+            ;;
42
+      esac
43
+      shift
44
+   done
45
+}
46
+
47
+run_or_die ()
48
+{
49
+   COMMAND=$1
50
+   
51
+   # check for empty commands
52
+   if test -z "$COMMAND" ; then
53
+      echo "*warning* no command specified"
54
+      return 1
55
+   fi
56
+   
57
+   shift;
58
+
59
+   OPTIONS="$@"
60
+   
61
+   # print a message
62
+   echo -n "*info* running $COMMAND"
63
+   if test -n "$OPTIONS" ; then
64
+      echo " ($OPTIONS)"
65
+   else
66
+      echo
67
+   fi
68
+
69
+   # run or die
70
+   $COMMAND $OPTIONS ; RESULT=$?
71
+   if test $RESULT -ne 0 ; then
72
+      echo "*error* $COMMAND failed. (exit code = $RESULT)"
73
+      exit 1
74
+   fi
75
+   
76
+   return 0
77
+}
78
+
79
+parse_options "$@"
80
+
81
+cd $TOP_DIR
82
+
83
+run_or_die $ACLOCAL
84
+run_or_die $AUTOHEADER
85
+run_or_die $AUTOCONF
86
+run_or_die $LIBTOOLIZE --install
87
+run_or_die $AUTOMAKE --add-missing

+ 27
- 0
configure.ac View File

@@ -0,0 +1,27 @@
1
+AC_PREREQ([2.69])
2
+AC_INIT([svc], [0.0.0], [http://github.com/kaniini/libnv-portable])
3
+AC_CONFIG_SRCDIR([src/supervise/supervise.c])
4
+AC_CONFIG_HEADERS([config.h])
5
+
6
+AC_PROG_CC
7
+AC_USE_SYSTEM_EXTENSIONS
8
+AC_C_BIGENDIAN
9
+
10
+AM_INIT_AUTOMAKE([foreign dist-xz subdir-objects])
11
+AM_SILENT_RULES([yes])
12
+LT_INIT
13
+
14
+AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/param.h sys/socket.h unistd.h endian.h sys/endian.h])
15
+
16
+AC_CHECK_HEADER_STDBOOL
17
+AC_TYPE_INT64_T
18
+AC_TYPE_SIZE_T
19
+AC_TYPE_SSIZE_T
20
+AC_TYPE_UINT16_T
21
+AC_TYPE_UINT64_T
22
+AC_TYPE_UINT8_T
23
+
24
+AC_FUNC_STRNLEN
25
+AC_CHECK_FUNCS([bzero select strcasecmp])
26
+AC_CONFIG_FILES([Makefile])
27
+AC_OUTPUT