Skip to content

Commit ad2ca5f

Browse files
committed
build: prefer our set-up to the usual one.
* build-aux/m4/urbi-libtool.m4: New. * build-aux/m4/urbi-win32.m4: New. * configure.ac: Use them. * .gitignore: Adjust.
1 parent 7a4ba38 commit ad2ca5f

File tree

4 files changed

+80
-4
lines changed

4 files changed

+80
-4
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ build-aux/depcomp
77
build-aux/install-sh
88
build-aux/missing
99
build-aux/ltmain.sh
10-
build-aux/m4
10+
build-aux/m4/libtool.m4
11+
build-aux/m4/lt*.m4
1112
config.hin
1213
config.hin~
1314
configure

build-aux/m4/urbi-libtool.m4

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# -*- autoconf -*-
2+
# urbi-libtool.m4: This file is part of build-aux.
3+
# Copyright (C) 2008, 2009, Gostai S.A.S.
4+
#
5+
# This software is provided "as is" without warranty of any kind,
6+
# either expressed or implied, including but not limited to the
7+
# implied warranties of fitness for a particular purpose.
8+
#
9+
# See the LICENSE file for more information.
10+
# For comments, bug reports and feedback: http://www.urbiforge.com
11+
#
12+
13+
# Don't call before the creation of libtool. There is no means to
14+
# control the order in which AC_CONFIG_COMMANDS are run, so just call
15+
# this macro after the invocation to LT_INIT.
16+
AC_DEFUN([URBI_LIBTOOL],
17+
[# If you need to create a library, use libtool.
18+
AC_REQUIRE([URBI_WIN32])dnl
19+
LT_PREREQ([2.2.6])
20+
LT_INIT([pic-only shared disable-static dlopen win32-dll])
21+
AC_SUBST([LIBTOOL_DEPS])
22+
23+
if $windows; then
24+
# It is perfectly possible to link with static libraries when building dlls.
25+
# Also for some reason archive_cmds ends up empty for C++ tag.
26+
# It wants to use cygpath, but we are using wine, and anyway our
27+
# path are correct.
28+
AC_CONFIG_COMMANDS([libtool-quirk],
29+
[sed -i -r \
30+
-e 's/^archive_cmds=""/#&/' \
31+
-e 's/^(deplibs_check_method)=.*/#&\n\1=pass_all/' \
32+
-e 's/^fix_srcfile_path="..*"/#&/' \
33+
libtool])
34+
fi
35+
36+
case $host_alias in
37+
(*mingw*)
38+
# Let the compiler handle the standard libraries itself
39+
AC_CONFIG_COMMANDS([mingw-hacks],
40+
[sed -i -r \
41+
-e 's/^predep_objects=/#&/' \
42+
-e 's/^postdeps=/#&/' \
43+
-e 's/-nostdlib//g' \
44+
libtool])
45+
;;
46+
esac
47+
])

build-aux/m4/urbi-win32.m4

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -*- autoconf -*-
2+
# urbi-win32.m4: This file is part of build-aux.
3+
# Copyright (C) 2006-2008, 2011, Gostai S.A.S.
4+
#
5+
# This software is provided "as is" without warranty of any kind,
6+
# either expressed or implied, including but not limited to the
7+
# implied warranties of fitness for a particular purpose.
8+
#
9+
# See the LICENSE file for more information.
10+
# For comments, bug reports and feedback: http://www.urbiforge.com
11+
#
12+
13+
# URBI_WIN32
14+
# ----------
15+
# Look for windows. Define the automake conditional WIN32 as well
16+
# as $windows.
17+
AC_DEFUN([URBI_WIN32],
18+
[AC_CHECK_HEADERS([windows.h], [windows=true], [windows=false])
19+
AM_CONDITIONAL([WIN32], [$windows])
20+
21+
case $host_alias in
22+
(*mingw*)
23+
# Remove windows-style paths from dependencies files
24+
AC_CONFIG_COMMANDS([mingw-fix-path],
25+
[sed -i "\/mv.*Pl\?o$/{;h;s/$/ \\&\\&\\\\/;p;g;s,.*\.Tpo \(.*\), sed -i s/c:\\\\\\\\\\\\\\\\/\\\\\\\\\\\\\\\\/g \1,;};" \
26+
Makefile
27+
])
28+
;;
29+
esac
30+
])

configure.ac

+1-3
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,7 @@ AC_DEFINE([DONT_USE_B_MODE],[1],[Don't open files in binary mode.])],
270270
AC_MSG_RESULT(Assuming that it does.))
271271

272272
# Configure libtool.
273-
LT_PREREQ([2.2.6])
274-
LT_INIT([win32-dll])
275-
AC_SUBST([LIBTOOL_DEPS])
273+
URBI_LIBTOOL
276274

277275
# The name of the library to build (not including the "lib" prefix).
278276
# Defaults to "jpeg", but can be changed to another name to avoid

0 commit comments

Comments
 (0)