File: configure.in

package info (click to toggle)
ssbd 0.10-10
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 784 kB
  • ctags: 250
  • sloc: sh: 3,538; ansic: 1,817; makefile: 116; perl: 24
file content (135 lines) | stat: -rw-r--r-- 4,419 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
AC_INIT(src/main.c)
AM_INIT_AUTOMAKE(ssbd,0.10)
AM_CONFIG_HEADER(config.h)

dnl Determine default prefix
test x$prefix = "xNONE" && prefix="$ac_default_prefix"


dnl Locate required external software
AC_PROG_CC
AC_PROG_INSTALL

dnl Check for system header files
AC_HEADER_STDC
dnl AC_CHECK_HEADERS(errno.h ctype.h dirent.h fcntl.h libgen.h locale.h math.h nl_types.h process.h pty.h signal.h stdarg.h stdio.h time.h unistd.h sys/ioctl.h sys/param.h sys/select.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/wait.h)
AC_CHECK_HEADERS(fcntl.h time.h sys/time.h sys/wait.h)
AC_HEADER_TIME

AC_CHECK_LIB(m, log, LIBM="-lm")
LDFLAGS="$LDFLAGS $LIBM"

dnl AM_PATH_GLIB_GC(1.2.0,,ssbd_HAVE_GLIB_GC=no)                                                                 
dnl if test x"$ssbd_HAVE_GLIB_GC" = x"no"; then
dnl AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR([*** GLIB >= 1.2.0 not installed - please install first ***]))                                                                 
dnl fi
dnl 


# check for glib
AC_ARG_ENABLE(glib1, [  --disable-glib1          Do not compile with glib1.x], ,enable_glib1=yes )
AC_ARG_ENABLE(glib2, [  --disable-glib2          Do not compile with glib2.x], ,enable_glib2=yes )

if test x"$enable_glib2" = x"yes"; then
    PKG_CHECK_MODULES(GLIB, glib-2.0 > 2.0.0, ssbd_HAVE_GLIB2=yes, ssbd_HAVE_GLIB2=no)
else
    echo "glib 2.x disabled"    
    ssbd_HAVE_GLIB2=disabled
fi    
    
if test x"$ssbd_HAVE_GLIB2" = x"yes"; then
    AC_DEFINE(HAVE_GLIB2)
    ssbd_HAVE_GLIB1="untested"
else    
    if test x"$enable_glib1" = x"yes"; then
        AM_PATH_GLIB(1.2.0, ssbd_HAVE_GLIB1=yes, ssbd_HAVE_GLIB1=no)
        if test x"$ssbd_HAVE_GLIB1" = x"yes"; then
            AC_DEFINE(HAVE_GLIB1)
        else
            AC_MSG_ERROR([*** GLIB >= 1.2.0 not installed - please install first ***])
        fi
    else
        echo "glib 1.x disabled"    
        AC_MSG_ERROR([*** GLIB >= 1.2.0 not installed - please install first ***])
    fi    
fi    
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LDFLAGS $GLIB_LIBS"
echo "CFLAGS='$GLIB_CFLAGS' LDFLAGS='$GLIB_LIBS'"

libsndfile_LIBS=$LIBS
libsndfile_CFLAGS=$CFLAGS
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.2, ac_cv_sndfile=1, ac_cv_sndfile=0)        
                                                                                   
AC_DEFINE_UNQUOTED([HAVE_SNDFILE],${ac_cv_sndfile},                                   
             [Set to 1 if you have libsndfile.])                                   
                                                                                   
AC_SUBST(SNDFILE_CFLAGS)                                                              
AC_SUBST(SNDFILE_LIBS)                                                                
  
dnl set
dnl echo $ac_cv_sndfile
if test ! x$ac_cv_sndfile = x1 ; then
    LIBS=$libsndfile_LIBS
    echo "***************************"
    echo libsndfile not found
    echo program need it to compile
    echo "***************************"
    exit 1    
fi    

CFLAGS=$libsndfile_CFLAGS
LIBS=$libsndfile_LIBS

CFLAGS="$CFLAGS $SNDFILE_CFLAGS"
LIBS="$LIBS $SNDFILE_LIBS"
echo "CFLAGS='$CFLAGS'"
echo "LIBS='$LIBS'"

AC_CHECK_PROG(HAVE_RPM, rpm, "yes", "no")

HAVE_RPM_PACKAGING=no
if test x$HAVE_RPM = xyes ; then
  AC_MSG_CHECKING(for rpm build directories)
  RPM_SOURCESDIR=`rpm --showrc | grep "^sourcedir" | \
    sed -e 's/.*: //' 2> /dev/null`
  if test x$RPM_SPECDIR = x ; then
    # Red Hat  : /usr/src/redhat
    # Mandrake : /usr/src/RPM
    # SuSE     : /usr/src/packages
    # Debian   : /usr/src/rpm
    for TEST_DIR in /usr/src/redhat /usr/src/RPM /usr/src/packages /usr/src/rpm ; do
      if test -d $TEST_DIR/SPECS -a -d $TEST_DIR/SOURCES -a \
              -d $TEST_DIR/RPMS -a -d $TEST_DIR/SRPMS -a \
              -d $TEST_DIR/BUILD ; then
        RPM_SOURCESDIR=$TEST_DIR/SOURCES
      fi
    done
  fi
  if test x$RPM_SOURCESDIR = x ; then
    AC_MSG_RESULT(not found)
    RPM_SOURCESDIR=""
  else
    AC_MSG_RESULT($RPM_SOURCESDIR)
    HAVE_RPM_PACKAGING=yes
  fi

  if test -f /etc/mandrake-release ; then 
      RPM_RELEASE="mdk"
  else    
      RPM_RELEASE=""
  fi      
  
fi
AC_SUBST(HAVE_RPM_PACKAGING)
AC_SUBST(RPM_SOURCESDIR)
AC_SUBST(RPM_RELEASE)


dnl ebuild for Gentoo
rm -f "pkg/$PACKAGE-*.ebuild"
cp "pkg/$PACKAGE.ebuild" "pkg/$PACKAGE-$VERSION.ebuild"
    
LDFLAGS="$LDFLAGS $LIBS"
AC_OUTPUT(Makefile doc/Makefile src/Makefile pkg/ssbd.spec)