File: configure.in

package info (click to toggle)
cyclades-serial-client 0.92
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, jessie, jessie-kfreebsd, lenny, sarge, squeeze, wheezy
  • size: 668 kB
  • ctags: 833
  • sloc: ansic: 9,508; sh: 2,739; makefile: 112
file content (114 lines) | stat: -rw-r--r-- 2,938 bytes parent folder | download | duplicates (2)
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(cyclades-serial-client)
AC_CONFIG_HEADER(inc/conf.h)
AC_SUBST(version)
version="0.92"
AC_SUBST(date)
date=`date`

AC_SUBST(stripping)
AC_ARG_ENABLE(stripping,
      [  --disable-stripping  disables stripping of installed binaries],
      STRIPPING=$strippingval, STRIPPING=no)
if [[ ! "$STRIPPING" = "no" ]]; then
  stripping=""
else
  stripping="-s"
fi
echo $DEB_BUILD_OPTIONS | grep -q nostrip
if [[ "$?" = "0" ]]; then
  stripping=""
fi

AC_SUBST(debug)
AC_ARG_ENABLE(debug,
      [  --with-debug  enables debug code generation for binaries],
      debug=-g, debug="")
echo $DEB_BUILD_OPTIONS | grep -q debug
if [[ "$?" = "0" ]]; then
  debug=-g
fi

dnl Checks for programs.
AC_LANG_CPLUSPLUS
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T

AC_SUBST(daemon)
AC_TRY_COMPILE(#include <unistd.h>
  , daemon(0, 0); , daemon="yes")
if [[ -n "$daemon" ]]; then
  daemon="#define HAVE_DAEMON"
fi

AC_SUBST(LIBC)
LIBC=l`ldd /bin/ls | grep libc | head -1 | cut -f2 -dl | cut -f1 "-d "`

AC_SUBST(OFLAGS)
AC_SUBST(CCFLAGS)
AC_SUBST(DEV_OBJ)
AC_SUBST(SOLFLAGS)
AC_SUBST(SOCFLAGS)

if [[ `uname` = "Linux" ]]; then
  OFLAGS="-DUSE_TERMIO -DUSE_TERMIOS -DUSE_POSIX_NONBLOCK"
  CCFLAGS="-O2 -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic"
  SOCFLAGS="-shared -fpic"
  SOLFLAGS="-shared -init libcsc_init -fini libcsc_fini -fpic -ldl"
  DEV_OBJ=linux-dev.o
else
  if [[ `uname` = "AIX" ]]; then
#AIX - never tested
    OFLAGS="-DUSE_TERMIO -DUSE_TERMIOS -DUSE_POSIX_NONBLOCK"
    CCFLAGS=-O2
    DEV_OBJ=aix-dev.o
  else
    if [[ `uname` = "SCO" ]]; then
      DEV_OBJ=sco-dev.o
      OFLAGS="-DUSE_POSIX_NONBLOCK"
      CCFLAGS=-O -b elf
      LIBS=-lsocket
    else
      if [[ `uname` = "Unixware" ]]; then
        DEV_OBJ=unixware-dev.o
        OFLAGS="-DUSE_TERMIO -DUSE_TERMIOS -DUSE_POSIX_NONBLOCK"
        LIBS="-lsocket -lnsl"
      else
        if [[ `uname` = "SunOS" ]]; then
          DEV_OBJ=solaris-dev.o
          OFLAGS="-DUSE_TERMIO -DUSE_TERMIOS -DUSE_POSIX_NONBLOCK"
          LIBS="-lsocket -lnsl"
          SOLFLAGS="$stripping -r -zinitarray=libcsc_init -zfiniarray=libcsc_fini -lc"
          if [[ "$CC" = "gcc" ]]; then
            CCFLAGS="-O2 -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic"
            SOCFLAGS="-shared -fpic"
          else
            CCFLAGS="-O"
            SOCFLAGS="-Kpic"
          fi
        else
#HPUX - never tested
          OFLAGS="-DHPUX -DUSE_POSIX_NONBLOCK"
          CCFLAGS="+DAportable -Ae"
          DEV_OBJ=hpux-dev.o
        fi
      fi
    fi
  fi
fi

AC_SUBST(UNIX98)
AC_SUBST(LIBS)
if [[ -e /dev/pts ]]; then
  if [[ `uname` != "SunOS" ]]; then
    UNIX98="#define UNIX98"
    LIBS="$LIBS -lutil"
  fi
fi

AC_OUTPUT(Makefile libcsc/Makefile inc/misc.h cyclades-serial-client.spec sun/pkginfo)