summaryrefslogtreecommitdiff
path: root/modules/dynamic_link/src/scripts/configure.ac
blob: 304b7e9647b0214acc44380e238644db42b5967b (plain)
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
#
# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
# Copyright (C) INRIA - 2006-2008 - Sylvestre Ledru
# Copyright (C) DIGITEO - 2009-2010 - Sylvestre Ledru
# 
# This file must be used under the terms of the CeCILL.
# This source file is licensed as described in the file COPYING, which
# you should have received as part of this distribution.  The terms
# are also available at    
# http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
#

##########
### Configure.ac is used to create the configure file which will be 
### used by the incremental link to detect compilers, flags, linker...
### Should be multiplateform
##########

# Initialise autoconf
AC_INIT([scilab],[0],[http://bugzilla.scilab.org/])
AC_CONFIG_MACRO_DIR([m4])

# Initialise automake (foreign is low strictness)
AM_INIT_AUTOMAKE([foreign]) 

AM_MAINTAINER_MODE

# Detect C compiler
AC_PROG_CC

# Detect C++ compiler
AC_PROG_CXX

# Detect Fortran Compiler (77 and 90)
AC_PROG_F77
AC_PROG_FC

# Initialise libtool
AC_PROG_LIBTOOL

# Specify which Makefile.in should be "adapted"
AC_CONFIG_FILES([Makefile])

# x86_64 needs -fPIC
case "$host" in
  x86_64-*-linux*)
    CFLAGS="$CFLAGS -fPIC"
	CXXFLAGS="$CXXFLAGS -fPIC"
	FFLAGS="$CXXFLAGS -fPIC"
	LDFLAGS="$LDFLAGS -fPIC"
	F77_LDFLAGS="$F77_LDFLAGS -fPIC"
	;;
esac

# Mac OS >= 10.6 need -arch xx
case "$host" in
     *-*-darwin*)
	 CFLAGS=" $CFLAGS -I/sw/include "
	 CPPFLAGS=" $CPPFLAGS -I/sw/include "
	 LDFLAGS=" $LDFLAGS -L/sw/lib/ "
     CC=" $CC -arch x86_64 "
     CXX=" $CXX -arch x86_64 "
esac

# Configure the Makefile
AC_OUTPUT


echo ""
echo "Options used to compile and link:"
echo "  CC               = $CC"
echo "  CFLAGS           = $CFLAGS"
echo "  CPP              = $CPP"
echo "  CPPFLAGS         = $CPPFLAGS"
echo "  PCFLAGS          = $PCFLAGS"
echo "  DEFS             = $DEFS"
echo "  LD               = $LD"
echo "  LDFLAGS          = $LDFLAGS"
echo "  LIBS             = $LIBS"
echo "  CXX              = $CXX"
echo "  CXXFLAGS         = $CXXFLAGS"
echo "  F77              = $F77"
echo "  FFLAGS           = $FFLAGS"
echo "  F77_LDFLAGS      = $F77_LDFLAGS"
echo ""