Merge branch 'master'
[prop.git] / Configure
blob459772145b51156c016881ca1e7965eeb5559cc0
1 #!/bin/sh
3 export PATH
4 PATH="/bin:/usr/bin:/usr/local/bin"
6 CC=$1
8 if [ "none$CC" = "none" ]; then
9 echo "No compiler specified, assuming g++";
10 CC="g++";
13 case `uname -s` in
14 HP-UX) ARCH=hpux
16 Linux) ARCH=linux
18 SunOS)
19 case `uname -r` in
20 4.1.*) ARCH=sunos ;;
21 5.*.*) ARCH=solaris ;;
22 esac
24 *) ARCH=default ;;
25 esac
27 case $CC in
28 g++) LDOPTS="-lg++";
29 COPTS="-O6";
31 CC*) LDOPTS="";
32 COPTS="-O6";
34 *) LDOPTS="";
35 COPTS="-O6";
37 esac
39 echo "Using the $CC compiler"
41 echo "$CC -S configure-dir/testbool.C -o /dev/null 2> /dev/null"
42 $CC -S configure-dir/testbool.C -o /dev/null 2> /dev/null
43 if [ $? = 0 ]; then
44 echo "Good, your $CC compiler has the type bool.";
45 bool=yes;
46 else
47 echo "Seems like you don't have the type bool.";
48 echo "I'll define it as int.";
49 bool=no;
52 $CC -S configure-dir/testexplicit.C -o /dev/null 2> /dev/null
53 if [ $? = 0 ]; then
54 echo "Good, your $CC compiler has the keyword explicit.";
55 explicit=yes;
56 else
57 echo "Seems like you don't have the keyword explicit.";
58 echo "I'll define it as the empty string.";
59 explicit=no;
62 $CC configure-dir/testgetrusage.C -o configure-dir/testgetrusage 2> /dev/null
63 if [ $? = 0 ]; then
64 echo "Good, getrusage() is working"
65 getrusage=yes;
66 rm configure-dir/testgetrusage
67 else
68 echo "Seems like getrusage is not working"
69 echo "I'll comment out all usage of getrusage()"
70 getrusage=no;
73 $CC configure-dir/testtimes.C -o configure-dir/testtimes 2> /dev/null
74 if [ $? = 0 ]; then
75 echo "Good, times() is working"
76 times=yes;
77 rm configure-dir/testtimes
78 else
79 echo "Seems like times is not working"
80 echo "I'll comment out all usage of times()"
81 times=no;
84 >include/AD/config/config.h
85 echo "#ifndef prop_library_configuration_h" >>include/AD/config/config.h
86 echo "#define prop_library_configuration_h" >>include/AD/config/config.h
87 if [ $bool = yes ]; then
88 echo "#define PROP_BOOL_IS_DEFINED" >>include/AD/config/config.h;
90 if [ $explicit = yes ]; then
91 echo "#define PROP_EXPLICIT_IS_DEFINED" >>include/AD/config/config.h;
93 if [ $getrusage = yes ]; then
94 echo "#define PROP_HAS_GETRUSAGE" >>include/AD/config/config.h;
96 if [ $times = yes ]; then
97 echo "#define PROP_HAS_TIMES" >>include/AD/config/config.h;
99 echo "#endif" >>include/AD/config/config.h
100 echo "include/AD/config/config.h created"
102 echo "Using the $ARCH configuration"