Browse Source

add some buildsystem artefacts

William Pitcock 4 years ago
parent
commit
dc0cbc71e9
2 changed files with 102 additions and 0 deletions
  1. 87
    0
      autogen.sh
  2. 15
    0
      configure.ac

+ 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

+ 15
- 0
configure.ac View File

@@ -0,0 +1,15 @@
1
+AC_PREREQ([2.68])
2
+AC_INIT([lighttoy], [0], [http://github.com/kaniini/lighttoy/issues])
3
+AC_CONFIG_SRCDIR([main.c])
4
+AC_CONFIG_HEADERS([libbulb/config.h])
5
+AM_INIT_AUTOMAKE([foreign dist-xz subdir-objects])
6
+LT_INIT
7
+
8
+AC_SYS_LARGEFILE
9
+
10
+AC_PROG_CPP
11
+AC_PROG_CC
12
+AC_PROG_INSTALL
13
+AC_PROG_LN_S
14
+
15
+AC_OUTPUT