This repository has been archived by the owner on Apr 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
127 lines (99 loc) · 3.5 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Source of configuration for EJDB Java Binding
#================================================================
# Generic Settings
#================================================================
test -n "$CFLAGS" && MYCFLAGS="$CFLAGS $MYCFLAGS"
test -n "$CPPFLAGS" && MYCPPFLAGS="$CPPFLAGS $MYCPPFLAGS"
test -n "$LDFLAGS" && MYLDFLAGS="$LDFLAGS $MYLDFLAGS"
AC_INIT(jejdb, 1.0.4)
MYLIBVER=1
MYLIBREV=0
AC_PREFIX_DEFAULT(/usr)
# Targets
MYLIBRARYFILES=""
# Building flags
MYCFLAGS="$MYCFLAGS -std=c99 -Wall -fPIC -fsigned-char -O2"
MYCPPFLAGS="-I. -I\$(INCLUDEDIR)"
MYCPPFLAGS="$MYCPPFLAGS -D_UNICODE -DNDEBUG -D_GNU_SOURCE=1 -D_REENTRANT -D__EXTENSIONS__"
MYLDFLAGS="-L. -L\$(LIBDIR) -Wl,-rpath,\$(DESTDIR)/\$(LIBDIR)"
# Messages
printf '#================================================================\n'
printf '# Configuring EJDB Java Binding version %s.\n' "$PACKAGE_VERSION"
printf '#================================================================\n'
#================================================================
# Checking Commands and Libraries
#================================================================
# C compiler
AC_PROG_CC
# Checks for libraries.
AC_CHECK_LIB([c], main)
AC_CHECK_LIB([ejdb], main)
AC_CHECK_HEADERS([ejdb/ejdb.h ejdb/ejdb_private.h], true, AC_MSG_ERROR([ejdb/ejdb.h is required]))
AC_CHECK_PROG(has_ant, [ant], true)
if test -z $has_ant
then
AC_MSG_ERROR([Apache ant build tool is required])
fi
#================================================================
# Options
#================================================================
# Internal variables
enables=""
# Disable shared object
AC_ARG_ENABLE(shared,
AC_HELP_STRING([--disable-shared], [avoid to build shared libraries]))
if test "$enable_shared" = "no"
then
enables="$enables (no-shared)"
else
case `uname -s | tr '[A-Z]' '[a-z]'` in
darwin*)
MYLIBRARYFILES="$MYLIBRARYFILES libjejdb.$MYLIBVER.$MYLIBREV.0.dylib"
MYLIBRARYFILES="$MYLIBRARYFILES libjejdb.$MYLIBVER.dylib"
MYLIBRARYFILES="$MYLIBRARYFILES libjejdb.dylib"
MYLDLIBPATHENV="DYLD_LIBRARY_PATH"
;;
mingw*)
MYLIBRARYFILES="$MYLIBRARYFILES jejdbdll.dll libjejdbdll.a jejdbdll.def jejdbdll.lib jejdbdll.exp"
;;
*)
MYLIBRARYFILES="$MYLIBRARYFILES libjejdb.so.$MYLIBVER.$MYLIBREV.0"
MYLIBRARYFILES="$MYLIBRARYFILES libjejdb.so.$MYLIBVER"
MYLIBRARYFILES="$MYLIBRARYFILES libjejdb.so"
;;
esac
fi
AC_ARG_WITH(jdk,
AC_HELP_STRING([--with-jdk=DIR], [use the specified JDK home]))
if test -n "$with_jdk"
then
JDK_HOME="$with_jdk"
fi
if test -z "$JDK_HOME"
then
AC_MSG_ERROR([Please specify valid JDK path with --with-jdk option or set JDK_HOME env])
else
MYCPPFLAGS="$MYCPPFLAGS -I$JDK_HOME/include -I$JDK_HOME/include/`uname -s | tr '[A-Z]' '[a-z]'`"
enables="$enables (jdk=$JDK_HOME)"
fi
#================================================================
# Generic Settings
#================================================================
# Export variables
AC_SUBST(MYLIBVER)
AC_SUBST(MYLIBREV)
AC_SUBST(MYFORMATVER)
AC_SUBST(MYLIBRARYFILES)
AC_SUBST(MYCFLAGS)
AC_SUBST(MYCPPFLAGS)
AC_SUBST(MYLDFLAGS)
AC_SUBST(PACKAGE_NAME)
AC_SUBST(PACKAGE_VERSION)
# Targets
AC_OUTPUT(Makefile)
AC_OUTPUT(build.properties)
# Messages
printf '#================================================================\n'
printf '# Ready to make ejdb-java version %s%s.\n' "$PACKAGE_VERSION" "$enables"
printf '#================================================================\n'
# END OF FILE