~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/erl_interface/configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#                                               -*- Autoconf -*-
2
2
# %CopyrightBegin%
3
 
4
 
# Copyright Ericsson AB 2000-2009. All Rights Reserved.
5
 
 
3
#
 
4
# Copyright Ericsson AB 2000-2010. All Rights Reserved.
 
5
#
6
6
# The contents of this file are subject to the Erlang Public License,
7
7
# Version 1.1, (the "License"); you may not use this file except in
8
8
# compliance with the License. You should have received a copy of the
9
9
# Erlang Public License along with this software. If not, it can be
10
10
# retrieved online at http://www.erlang.org/.
11
 
 
11
#
12
12
# Software distributed under the License is distributed on an "AS IS"
13
13
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
# the License for the specific language governing rights and limitations
15
15
# under the License.
16
 
 
16
#
17
17
# %CopyrightEnd%
18
18
#
19
19
# Process this file with autoconf to produce a configure script.
65
65
TARGET=$host
66
66
AC_SUBST(TARGET)
67
67
 
68
 
AC_CONFIG_HEADER([src/$host/config.h:src/auxdir/config.h.in])
 
68
AC_CONFIG_HEADER([src/$host/config.h:config.h.in])
69
69
 
70
70
dnl ----------------------------------------------------------------------
71
71
dnl Optional features
72
72
dnl ----------------------------------------------------------------------
73
73
 
74
 
AC_ARG_WITH(xcomp-conf,
75
 
[  --with-xcompconf=PATH     path to cross compilation configuration])
76
 
if test "x$with_xcompconf" != "xno" -a "x$with_xcompconf" != "x" ; then
77
 
    . $with_xcompconf
78
 
fi
79
 
 
80
74
# Use --disable-threads to force building single threaded libs even 
81
75
# if pthreads exists (for test purposes).
82
76
AC_ARG_ENABLE(threads,
95
89
AC_PROG_CPP
96
90
dnl AC_PROG_LIBTOOL
97
91
AC_PROG_RANLIB
98
 
if test "x$LD" = "x"; then
99
 
   AC_CHECK_TOOL([LD],[ld],[ld])
100
 
fi
 
92
AC_CHECK_PROG(LD, ld.sh)
 
93
AC_CHECK_TOOL(LD, ld, '$(CC)')
101
94
AC_SUBST(LD)
102
95
 
103
 
AC_CHECK_SIZEOF(short, $erl_xcomp_short)
104
 
AC_CHECK_SIZEOF(int, $erl_xcomp_int)
105
 
AC_CHECK_SIZEOF(long, $erl_xcomp_long)
106
 
AC_CHECK_SIZEOF(void *, $erl_xcomp_void_p)
107
 
AC_CHECK_SIZEOF(long long, $erl_xcomp_long_long)
 
96
AC_CHECK_SIZEOF(short)
 
97
AC_CHECK_SIZEOF(int)
 
98
AC_CHECK_SIZEOF(long)
 
99
AC_CHECK_SIZEOF(void *)
 
100
AC_CHECK_SIZEOF(long long)
108
101
 
109
102
if test $ac_cv_sizeof_void_p = 8; then
110
103
  CFLAGS="$CFLAGS -DEI_64BIT"
111
104
fi
112
105
 
113
 
AC_CHECK_PROG(AR, ar, ar, false)
114
 
if test "$ac_cv_prog_AR" = false; then
 
106
AC_CHECK_TOOL(AR, ar, false)
 
107
if test "$AR" = false; then
115
108
  AC_MSG_ERROR([No 'ar' command found in PATH])
116
109
fi
117
110
 
164
157
#include <sys/socket.h>], 
165
158
[socklen_t mylen;],
166
159
[AC_MSG_RESULT(yes) 
167
 
 AC_DEFINE(HAVE_SOCKLEN_T)],
 
160
 AC_DEFINE(HAVE_SOCKLEN_T, [], [Define if you have the `socklen_t' type])],
168
161
[AC_MSG_RESULT(no)])
169
162
 
170
163
# Checks for library functions.
209
202
        AC_CHECK_HEADER($dir/include/gmp.h, ac_cv_gmp=yes, ac_cv_gmp=no)
210
203
        if test $ac_cv_gmp = yes ; then
211
204
            CFLAGS="$CFLAGS -I$dir/include -L$dir/lib"
212
 
            AC_DEFINE(HAVE_GMP_H)
 
205
            AC_DEFINE(HAVE_GMP_H, [], [Define if you have "gmp.h"])
213
206
            break
214
207
        fi
215
208
    done
226
219
    fi
227
220
    AC_MSG_RESULT(yes)
228
221
    CFLAGS="$CFLAGS -I$with_gmp/include -L$with_gmp/lib"
229
 
    AC_DEFINE(HAVE_GMP_H)
 
222
    AC_DEFINE(HAVE_GMP_H, [], [Define if you have "gmp.h"])
230
223
    AC_CHECK_LIB(gmp, __gmpz_export)
231
224
    # FIXME return ERROR if no lib
232
225
fi
279
272
dnl
280
273
dnl Threads
281
274
dnl
282
 
found_threads=no
283
275
THR_LIBS=
284
276
THR_DEFS=
285
 
EI_THREADS="false"
286
277
AC_SUBST(THR_LIBS)
287
278
AC_SUBST(THR_DEFS)
288
279
AC_SUBST(EI_THREADS)
289
280
 
290
281
case "$threads_disabled" in
291
 
        no)
292
 
                AC_MSG_CHECKING([for native win32 threads])
293
 
                if test "X$host_os" = "Xwin32"; then
294
 
                    THR_DEFS="-DWIN32_THREADS"
295
 
                    found_threads=yes
296
 
                    EI_THREADS="true"   
297
 
                    AC_MSG_RESULT([yes])
298
 
                    AC_MSG_CHECKING([for __declspec(thread) usability])
299
 
                    if test "X$GCC" = "Xyes"; then
300
 
                        AC_MSG_RESULT([no])
301
 
                    else
302
 
                        THR_DEFS="$THR_DEFS -DUSE_DECLSPEC_THREAD"
303
 
                        AC_MSG_RESULT([yes])
304
 
                    fi  
305
 
                else
306
 
                    AC_MSG_RESULT(no)
307
 
 
308
 
                    dnl Check for POSIX threads
309
 
 
310
 
                    pthread_lib=""
311
 
                    AC_CHECK_LIB(pthread,
312
 
                                 pthread_create,
313
 
                                 [found_threads=yes
314
 
                                  EI_THREADS="true"
315
 
                                  THR_LIBS="-lpthread"
316
 
                                  THR_DEFS="-D_REENTRANT -D_THREAD_SAFE -DPOSIX_THREADS"
317
 
                                  pthread_lib=pthread])
318
 
 
319
 
                    # FreeBSD has pthreads in special c library, c_r
320
 
                    if test $found_threads = no; then
321
 
                        AC_CHECK_LIB(c_r,
322
 
                                     pthread_create,
323
 
                                     [found_threads=yes
324
 
                                      EI_THREADS="true"
325
 
                                      THR_LIBS="-lc_r"
326
 
                                      THR_DEFS="-D_REENTRANT -D_THREAD_SAFE -DPOSIX_THREADS"
327
 
                                      pthread_lib=c_r])
328
 
                    fi
329
 
 
330
 
                    if test "x$pthread_lib" != "x"; then
331
 
                        AC_CHECK_LIB($pthread_lib,pthread_atfork,AC_DEFINE(HAVE_PTHREAD_ATFORK))
332
 
                        AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H))
333
 
                        dnl Some Linuxes have <pthread/mit/pthread.h> instead of <pthread.h>
334
 
                        AC_CHECK_HEADER(pthread/mit/pthread.h, AC_DEFINE(HAVE_MIT_PTHREAD_H))
335
 
                        case $host_os in
336
 
                            solaris*)
337
 
                                THR_DEFS="$THR_DEFS -D_POSIX_PTHREAD_SEMANTICS";;
338
 
                            linux*)
339
 
                                dnl NPTL test stolen from $ERL_TOP/erts/aclocal.m4
340
 
                                AC_MSG_CHECKING(for Native POSIX Thread Library)
341
 
                                case `getconf GNU_LIBPTHREAD_VERSION 2>/dev/null` in
342
 
                                    nptl*) nptl=yes;;
343
 
                                    NPTL*) nptl=yes;;
344
 
                                    *)  nptl=no;;
345
 
                                esac
346
 
                                AC_MSG_RESULT($nptl)
347
 
                                if test $nptl = yes; then
348
 
                                    need_nptl_incldir=no
349
 
                                    AC_CHECK_HEADER(nptl/pthread.h, need_nptl_incldir=yes)
350
 
                                    if test $need_nptl_incldir = yes; then
351
 
                                        # Ahh...
352
 
                                        nptl_path="$C_INCLUDE_PATH:$CPATH:/usr/local/include:/usr/include"
353
 
                                        nptl_ws_path=
354
 
                                        save_ifs="$IFS"; IFS=":"
355
 
                                        for dir in $nptl_path; do
356
 
                                            if test "x$dir" != "x"; then
357
 
                                                nptl_ws_path="$nptl_ws_path $dir"
358
 
                                            fi
359
 
                                        done
360
 
                                        IFS=$save_ifs
361
 
                                        nptl_incldir=
362
 
                                        for dir in $nptl_ws_path; do
363
 
                                            AC_CHECK_HEADER($dir/nptl/pthread.h,
364
 
                                                            nptl_incldir=$dir/nptl)
365
 
                                            if test "x$nptl_incldir" != "x"; then
366
 
                                                THR_DEFS="$THR_DEFS -isystem $nptl_incldir"
367
 
                                                break
368
 
                                            fi
369
 
                                        done
370
 
                                        if test "x$nptl_incldir" = "x"; then
371
 
                                            AC_MSG_ERROR(Failed to locate nptl system include directory)
372
 
                                        fi
373
 
                                    fi
374
 
                                fi
375
 
 
376
 
                                ;;
377
 
                            *)
378
 
                                ;;
379
 
                        esac
380
 
                    fi
381
 
                fi
382
 
                ;;
383
 
        yes)
384
 
            # Threads disabled
385
 
            ;;
 
282
    no)
 
283
        LM_CHECK_THR_LIB
 
284
 
 
285
        case "$THR_LIB_NAME" in
 
286
            "")
 
287
                EI_THREADS="false"
 
288
                ;;
 
289
            win32_threads)
 
290
                EI_THREADS="true"       
 
291
                THR_DEFS="$THR_DEFS -D_WIN32_WINNT=0x0500 -DWINVER=0x0500"
 
292
                ;;
 
293
            pthread)    
 
294
                EI_THREADS="true"
 
295
                ;;
 
296
            *)
 
297
                EI_THREADS="true"
 
298
                AC_MSG_WARN([Unexpected thread library: $THR_LIB_NAME])
 
299
                ;;
 
300
        esac
 
301
        ;;
 
302
    yes)
 
303
        # Threads disabled
 
304
        EI_THREADS="false"
 
305
        ;;
386
306
esac
387
307
 
388
308
# ---------------------------------------------------------------------------
413
333
# FIXME We want to use libtool but until then....
414
334
# ---------------------------------------------------------------------------
415
335
 
416
 
AC_SUBST(DED_CFLAGS)
417
 
dnl AC_SUBST(DED_LD)
418
 
dnl AC_SUBST(DED_LDFLAGS)
 
336
AC_SUBST(LIB_CFLAGS)
419
337
 
420
338
if test "X$host" = "Xwin32"; then
421
 
  DED_CFLAGS="$CFLAGS"
 
339
  LIB_CFLAGS="$CFLAGS"
422
340
else
423
341
  case $host_os in
424
342
    darwin*)
427
345
  esac
428
346
 
429
347
  if test "x$GCC" = xyes; then
430
 
        DED_CFLAGS="$CFLAGS -fPIC"
 
348
        LIB_CFLAGS="$CFLAGS -fPIC"
431
349
  else
432
 
        DED_CFLAGS="$CFLAGS"
 
350
        LIB_CFLAGS="$CFLAGS"
433
351
  fi
434
352
fi
435
353