summaryrefslogtreecommitdiff
path: root/archivers/arj/patches/patch-gnu_configure.in
blob: 5b3e8a7676c68982e485123b83ebc4dd15b1f0e1 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
$NetBSD: patch-gnu_configure.in,v 1.1 2015/04/12 15:45:00 tnn Exp $

--- gnu/configure.in.orig	2005-06-21 18:27:20.000000000 +0000
+++ gnu/configure.in
@@ -12,13 +12,23 @@ dnl Installation script (let it be, temp
 AC_PROG_INSTALL([e:/os2apps/autoconf/install-sh])
 
 dnl Configuration parameters
-AC_CONFIG_HEADER([../c_defs.h:config.h.in])
+AC_CONFIG_HEADER([c_defs.h:config.h.in])
 
 dnl Checks for the canonical system name
 AC_CANONICAL_HOST
 
 dnl Checks for programs.
 AC_PROG_CC
+AC_DEFUN(AC_PROG_LD_GNU,
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+  ac_cv_prog_gnu_ld=yes
+else
+  ac_cv_prog_gnu_ld=no
+fi])
+])
+AC_PROG_LD_GNU
 
 dnl Checks for header files.
 AC_HEADER_STDC
@@ -35,7 +45,8 @@ AC_FUNC_MEMCMP
 AC_FUNC_SETVBUF_REVERSED
 AC_TYPE_SIGNAL
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([getcwd min max mkdir mkdtemp rmdir fcloseall strcasecmp setpriority strdup strerror strstr strupr strlwr strtol strtoul])
+AC_CHECK_FUNCS([getcwd lchown min max mkdir mkdtemp rmdir fcloseall strcasecmp setpriority strdup strerror strstr strupr strlwr strtol strtoul])
+AC_SEARCH_LIBS([dlsym], [dl])
 
 dnl Platform-specific tuning
 PROG_EXT=
@@ -45,22 +56,27 @@ REQUIRES_DEF=
 OS_ID="UNIX"
 OS_DEF="-D_UNIX"
 DLL_CFLAGS="-fPIC"
+LD_STRIP="-s "
 
 case $host_os in
 linux*)
 	AC_DEFINE(ELF_EXECUTABLES, 1, [Define if executables use ELF format])
         DYN_LIBS="-ldl"
-        LD_STRIP="gnu/stripgcc.lnk"
+        LD_STRIP="-s gnu/stripgcc.lnk"
 	;;
 k*bsd*)
 	AC_DEFINE(ELF_EXECUTABLES)
 	DYN_LIBS="-ldl"
-	LD_STRIP="gnu/stripgcc.lnk"
+	LD_STRIP="-s gnu/stripgcc.lnk"
 	;;
 *bsd*)
 	AC_DEFINE(ELF_EXECUTABLES)
         DLL_FLAGS="-shared -export-dynamic"
-        LD_STRIP="gnu/stripgcc.lnk"
+        LD_STRIP="-s gnu/stripgcc.lnk"
+	;;
+darwin*)
+	DLL_FLAGS="-bundle"
+	LD_STRIP=""
 	;;
 interix3*)
 	# not ELF
@@ -71,14 +87,16 @@ interix3*)
 	AC_DEFINE(ELF_EXECUTABLES)
         DLL_FLAGS="-shared -fPIC"
         DLL_CFLAGS="-shared -fPIC"
-        LD_STRIP="gnu/stripgcc.lnk"
+        LD_STRIP="-s gnu/stripgcc.lnk"
 	;;
 *solaris*)
 	AC_DEFINE(ELF_EXECUTABLES)
         CFLAGS="-DSUNOS -D_UNIX"
         DLL_FLAGS="-shared -fPIC"
         DLL_CFLAGS="-shared -fPIC"
-        LD_STRIP="gnu/stripgcc.lnk"
+	if test X"$ac_cv_prog_gnu_ld" = X"yes"; then
+        LD_STRIP="-s gnu/stripgcc.lnk"
+	fi
 	;;
 os2*)
 	PROG_EXT=".exe"
@@ -125,7 +143,7 @@ dnl Initial setup
 
 test -z "$CONFIG_SHELL" && CONFIG_SHELL=/bin/sh
 AC_SUBST(CONFIG_SHELL)
-
+AC_OUTPUT(makefile.gnu:makefile.in)
 AC_MSG_CHECKING([if dynamic C library may be used])
 AC_ARG_ENABLE(libc,
 [  --disable-libc          Disable linking with dynamic C library],