sync with SAMBA_2_2
[kai/samba.git] / packaging / Caldera / OpenServer / Configure
1 #!/bin/ksh
2 #
3 # invoke with -n as the first argument to get this script to tell
4 # you what it would do without doing anything
5 #
6
7 V=
8 [ "$1" = "-n" ] && V=echo
9
10 CC="gcc -I/usr/local/include -L/usr/local/lib"
11 CFLAGS="-O3 -I/usr/local/include -L/usr/local/lib"
12 CXX="g++"
13 CXXFLAGS="-O3 -I/usr/local/include/stl -I/usr/local/include -L/usr/local/lib"
14 RANLIB=true
15 MAKE=/usr/local/bin/make
16 PREFIX=/usr/local/samba
17 if [ "$V" = "echo" ]
18 then
19     echo "exporting the following shell variables:"
20     echo "CC=$CC"
21     echo "CXX=$CXX"
22     echo "RANLIB=$RANLIB"
23     echo "MAKE=$MAKE"
24     echo "CFLAGS=$CFLAGS"
25     echo "CXXFLAGS=$CXXFLAGS"
26     echo "PREFIX=$PREFIX"
27 else
28     export CC CXX RANLIB MAKE CFLAGS CXXFLAGS PREFIX
29 fi
30
31 cd ../../../source
32 [ -f mout-config ] && {
33     if [ "$V" = "echo" ]
34     then
35         echo "mv mout-config mout-config$$"
36     else
37         mv mout-config mout-config$$
38     fi
39 }
40 if [ "$V" = "echo" ]
41 then
42     echo "./configure \
43         --prefix=${PREFIX} \
44         --with-profile \
45         --with-syslog \
46         --with-utmp \
47         --with-vfs \
48         --with-msdfs \
49         --with-netatalk \
50         --with-sambabook=${PREFIX}/swat/using_samba \
51         2>&1 | tee mout-config"
52 else
53     ./configure \
54         --prefix=${PREFIX} \
55         --with-profile \
56         --with-syslog \
57         --with-utmp \
58         --with-vfs \
59         --with-msdfs \
60         --with-netatalk \
61         --with-sambabook=${PREFIX}/swat/using_samba \
62         2>&1 | tee mout-config
63 fi
64
65 cat >> include/config.h <<EOF
66 #ifdef HAVE_LONGLONG
67 #undef HAVE_LONGLONG
68 #endif
69 EOF
70
71 sed -e "s/nobody/nouser/" include/local.h > /tmp/nouser$$
72 cp /tmp/nouser$$ include/local.h
73 rm -f /tmp/nouser$$