improve clGetExtensionFunctionAddress{,ForPlatform}
[ocl-icd] / bootstrap
1 #!/bin/sh
2 # vim:ts=4:sw=4
3 # Calls autotools to build configure script and Makefile.in.
4 # Generated automatically using bootstrapper 0.2.1
5 # http://bootstrapper.sourceforge.net/
6 #
7 # Copyright (C) 2002 Anthony Ventimiglia
8 #
9 # This bootstrap script is free software; you can redistribute
10 # it and/or modify it under the terms of the GNU General Public
11 # License as published by the Free Software Foundation; either
12 # version 2 of the License, or (at your option) any later version.
13 #
14 #
15 # Calls proper programs to create configure script and Makefile.in files.
16 # if run with the --clean option, bootstrap removes files it generates. To
17 # clean all autogenerated files (eg: for cvs imports) first run
18 # make distclean, then bootstrap --clean
19 # see bootstrapper(1) for more infor
20
21 set -e
22
23 if test x"$1" = x"--help"; then
24         echo "$0: automatic bootstrapping utility for GNU Autotools"
25         echo "          cleans up old autogenerated files and runs autoconf,"
26         echo "          automake and aclocal on local directory"
27         echo
28         echo "          --clean         clean up auto-generated files without"
29         echo "                                  creating new scripts"
30         echo
31         exit 0
32 fi
33
34 export ACLOCAL="aclocal"
35 export AUTOCONF="autoconf"
36 export AUTOHEADER="autoheader"
37 export AUTOMAKE="automake"
38 CONFIG_AUX_DIR="build-aux"
39 #LIBTOOLIZE="/usr/bin/libtoolize --force"
40 #LIBTOOLIZE_FILES="config.sub ltmain.sh config.guess"
41 #LIBTOOLIZE="libtoolize --copy"
42 #LIBTOOLIZE="glibtoolize --copy"
43 CLEAN_BASE_DIRS="autom4te.cache"
44 CLEAN_BASE_FILES="configure"
45 CLEAN_BASE_FILES="$CLEAN_BASE_FILES config.h.in config.h.in~"
46 CLEAN_BASE_FILES="$CLEAN_BASE_FILES aclocal.m4 acinclude/libtool.m4 acinclude/ltoptions.m4"
47 CLEAN_BASE_FILES="$CLEAN_BASE_FILES acinclude/ltversion.m4 acinclude/lt~obsolete.m4  acinclude/ltsugar.m4"
48 CLEAN_AUX_FILES="config.guess compile depcomp mkinstalldirs libtool ltmain.sh missing config.sub install-sh mdate-sh texinfo.tex"
49
50 RM="rm -v"
51 SUBDIRS="$(sed -e '/Makefile/s,[[:space:]]*\([^[:space:]]*\)/\?Makefile,./\1,p;d' configure.ac)"
52
53 if libtoolize --version >/dev/null 2>&1; then
54         export LIBTOOLIZE="libtoolize --force"
55 else
56         # for non GNU OS
57         export LIBTOOLIZE="glibtoolize --force"
58 fi
59
60 # These are files created by configure, so we'll always clean them
61 for i in $ALWAYS_CLEAN; do
62         test -f $i && \
63         $RM $i
64 done
65
66 if test x"$1" = x"--clean"; then
67         #
68         #Clean Files left by previous bootstrap run
69         #
70         if test -n "$CONFIG_AUX_DIR";
71                 then CONFIG_AUX_DIR="$CONFIG_AUX_DIR/"
72         fi
73         # Clean directories in base directory
74         for cf in $CLEAN_BASE_DIRS; do
75                 if test -d $cf ; then
76                         $RM -r $cf
77                 else
78                         echo "Skipping non existing directory '$cf'"
79                 fi
80         done
81         #Clean Automake generated Makefile.in files
82         for i in $SUBDIRS; do
83                 test -f $i/Makefile.in && \
84                 $RM $i/Makefile.in
85         done
86         # Clean files in base directory
87         for cf in $CLEAN_BASE_FILES; do
88                 if test -f $cf ; then
89                         $RM $cf
90                 else
91                         echo "Skipping non existing file '$cf'"
92                 fi
93         done
94         # Clean files in aux directory
95         for cf in $CLEAN_AUX_FILES; do
96                 cf="$CONFIG_AUX_DIR$cf"
97                 if test -f $cf ; then
98                         $RM $cf
99                 else
100                         echo "Skipping non existing file '$cf'"
101                 fi
102         done
103
104 else
105         set -x
106         autoreconf -vi -Wall "$@"
107         set +x
108 fi
109
110