-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
114 lines (97 loc) · 3.42 KB
/
configure.ac
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
dnl Configuring gauche-cv
dnl process this file with autoconf to generate 'configure'.
dnl
AC_PREREQ(2.54)
AC_INIT(gauche-cv, 0.1, [email protected])
dnl If you want to use the system name (OS, architecture, etc) in the
dnl configure, uncomment the following line. In such a case, you need
dnl to copy config.guess and config.sub from automake distribution.
AC_CANONICAL_SYSTEM
dnl Replace @LOCAL_PATHS@ by --with-local option.
AC_ARG_WITH(local,
AC_HELP_STRING([--with-local=PATH:PATH...],
[For each PATH, add PATH/include to the include search
paths and PATH/lib to the library search paths. Useful if you have some
libraries installed in non-standard places. ]),
[
case $with_local in
yes|no|"") ;; #no effect
*) LOCAL_PATHS=$with_local ;;
esac
])
AC_SUBST(LOCAL_PATHS)
dnl Set up gauche related commands. The commands are set by scanning
dnl PATH. You can override them by "GOSH=/my/gosh ./configure" etc.
dnl These variables may contain spaces in the pathnames (especially on
dnl Windows); Makefile.ins and other files that refer to those variables
dnl have to quote them properly.
AC_PATH_PROG([GOSH], gosh)
AC_PATH_PROG([GAUCHE_CONFIG], gauche-config)
AC_PATH_PROG([GAUCHE_PACKAGE], gauche-package)
AC_PATH_PROG([GAUCHE_INSTALL], gauche-install)
AC_PATH_PROG([GAUCHE_CESCONV], gauche-cesconv)
dnl Usually these parameters are set by AC_PROG_CC, but we'd rather use
dnl the same one as Gauche has been compiled with.
SOEXT=`"$GAUCHE_CONFIG" --so-suffix`
OBJEXT=`"$GAUCHE_CONFIG" --object-suffix`
EXEEXT=`"$GAUCHE_CONFIG" --executable-suffix`
AC_SUBST(SOEXT)
AC_SUBST(OBJEXT)
AC_SUBST(EXEEXT)
ac_default_prefix=`"$GAUCHE_CONFIG" --prefix`
GAUCHE_PKGINCDIR=`"$GAUCHE_CONFIG" --pkgincdir`
GAUCHE_PKGLIBDIR=`"$GAUCHE_CONFIG" --pkglibdir`
GAUCHE_PKGARCHDIR=`"$GAUCHE_CONFIG" --pkgarchdir`
AC_SUBST(GAUCHE_PKGINCDIR)
AC_SUBST(GAUCHE_PKGLIBDIR)
AC_SUBST(GAUCHE_PKGARCHDIR)
dnl Check for headers.
dnl Add your macro calls to check required headers, if you have any.
dnl Check for other programs.
dnl Add your macro calls to check existence of programs, if you have any.
PKG_PROG_PKG_CONFIG()
dnl Check for libraries
dnl Add your macro calls to check required libraries, if you have any.
PKG_CHECK_MODULES([OPENCV],[opencv])
case `pkg-config --modversion opencv` in
2.2.*)
OPENCV_VERSION=OPENCV2_2
;;
2.3.0)
OPENCV_VERSION=OPENCV2_3
;;
2.3.1)
OPENCV_VERSION=OPENCV2_3_1
;;
*)
AC_MSG_ERROR([The version of the OpenCV does not support])
;;
esac
AC_SUBST(OPENCV_VERSION)
AC_SUBST(OPENCV_CFLAGS)
AC_SUBST(OPENCV_LIBS)
CORE_LIBS=""
PWD="pwd"
case "$target" in
*mingw*)
CORE_LIBS="-lgauche_cv_core"
PWD="pwd -W"
;;
esac
AC_SUBST(CORE_LIBS)
AC_SUBST(STUBDIR, "`$PWD`/src")
SCRIPTDIR="`$PWD`/script"
AC_SUBST(COREDIR, "-L$STUBDIR")
AC_SUBST(SCRIPTDIR)
AC_SUBST(GENSTUB, "$SCRIPTDIR/genstub.scm")
AC_SUBST(GENDOC, "$SCRIPTDIR/gendoc.scm")
AC_SUBST(OUTDIR, "`$PWD`/out")
dnl Creating gpd (gauche package description) file
GAUCHE_PACKAGE_CONFIGURE_ARGS="`echo ""$ac_configure_args"" | sed 's/[\\""\`\$]/\\\&/g'`"
AC_MSG_NOTICE([creating ${PACKAGE_NAME}.gpd])
"$GAUCHE_PACKAGE" make-gpd "$PACKAGE_NAME" \
-version "$PACKAGE_VERSION" \
-configure "./configure $GAUCHE_PACKAGE_CONFIGURE_ARGS"
dnl Output
echo $PACKAGE_VERSION > VERSION
AC_OUTPUT(Makefile src/Makefile src/highgui/Makefile src/imgproc/Makefile src/objdetect/Makefile src/calib3d/Makefile src/features2d/Makefile lib/Makefile lib/cv/Makefile)