Package list libsdl2-mixer / 4b580e0
New upstream version 2.0.5~20211214.gffd0589+dfsg Simon McVittie 6 months ago
173 changed file(s) with 23367 addition(s) and 66009 deletion(s). Raw diff Collapse all Expand all
00 # Save the local path
11 SDL_MIXER_LOCAL_PATH := $(call my-dir)
22
3 # Enable this if you want to support loading WAV music
4 SUPPORT_WAV ?= true
35
46 # Enable this if you want to support loading FLAC music with libFLAC
57 SUPPORT_FLAC ?= true
6 FLAC_LIBRARY_PATH := external/flac-1.3.2
8 FLAC_LIBRARY_PATH := external/flac-1.3.3
79
810 # Enable this if you want to support loading OGG Vorbis music via Tremor
911 SUPPORT_OGG ?= true
1214
1315 # Enable this if you want to support loading MP3 music via MPG123
1416 SUPPORT_MP3_MPG123 ?= true
15 MPG123_LIBRARY_PATH := external/mpg123-1.25.6
17 MPG123_LIBRARY_PATH := external/mpg123-1.25.13
1618
1719 # Enable this if you want to support loading MOD music via modplug
1820 SUPPORT_MOD_MODPLUG ?= true
2022
2123 # Enable this if you want to support TiMidity
2224 SUPPORT_MID_TIMIDITY ?= true
23 TIMIDITY_LIBRARY_PATH := timidity
25 TIMIDITY_LIBRARY_PATH := src/codecs/timidity
2426
2527
2628 # Build the library
5759
5860 LOCAL_MODULE := SDL2_mixer
5961
60 LOCAL_SRC_FILES := $(notdir $(filter-out %/playmus.c %/playwave.c, $(wildcard $(LOCAL_PATH)/*.c))) \
62 LOCAL_C_INCLUDES := \
63 $(LOCAL_PATH)/include \
64 $(LOCAL_PATH)/src/ \
65 $(LOCAL_PATH)/src/codecs \
66
67
68 LOCAL_SRC_FILES := \
69 $(subst $(LOCAL_PATH)/,, \
70 $(wildcard $(LOCAL_PATH)/src/*.c) \
71 $(wildcard $(LOCAL_PATH)/src/codecs/*.c) \
72 )
6173
6274 LOCAL_CFLAGS :=
6375 LOCAL_LDLIBS :=
6476 LOCAL_STATIC_LIBRARIES :=
6577 LOCAL_SHARED_LIBRARIES := SDL2
78
79 ifeq ($(SUPPORT_WAV),true)
80 LOCAL_CFLAGS += -DMUSIC_WAV
81 endif
6682
6783 ifeq ($(SUPPORT_FLAC),true)
6884 LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/include
97113 LOCAL_STATIC_LIBRARIES += timidity
98114 endif
99115
100 LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)
116 LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/include
101117
102118 include $(BUILD_SHARED_LIBRARY)
119
120 ###########################
121 #
122 # SDL2_mixer static library
123 #
124 ###########################
125
126 LOCAL_MODULE := SDL2_mixer_static
127
128 LOCAL_MODULE_FILENAME := libSDL2_mixer
129
130 LOCAL_LDLIBS :=
131 LOCAL_EXPORT_LDLIBS :=
132
133 include $(BUILD_STATIC_LIBRARY)
134
0 2.0.5:
1 Ozkan Sezer - Sun Feb 07 03:10:10 2021
2 * fixed distorted MIDI playback with FluidSynth if the sample rate
3 is out of library's limits
4 Ozkan Sezer - Fri Feb 05 14:33:50 2021
5 * Added Mix_ModMusicJumpToOrder for mod music formats
6 Ozkan Sezer - Sun Jan 31 10:03:10 2021
7 * Added libxmp support for mod music playback, partially based on
8 work by Vitaly Novichkov
9 Ozkan Sezer - Sun Jan 31 00:33:00 2021
10 * Fixed mikmod player reader issue with umx files
11 * Enabled module internal loops in modplug player
12 Ozkan Sezer - Thu Jan 28 17:02:25 2021
13 * Respect original mp3 file offset
14 Sam Lantinga - Wed Jan 20 10:17:10 2021
15 * Fixed a used-after-free issue in fluidsynth player
16 michaeljosephmaltese - Tue Nov 24 22:07:14 2020
17 * Support setting soundfont via SDL_SOUNDFONTS in OSX native midi
18 David Gow - Fri Oct 23 23:01:00 2020
19 * Fixed mp3 file detection.
20 Ozkan Sezer - Sat Jun 27 00:50:04 2020
21 * Fixed divide by zero crash in voc_get_block().
22 Matthias Gatto - Tue Dec 17 21:55:00 2019
23 * Add Mix_MusicDuration() to return music duration in seconds.
24 Vitaly Novichkov - Tue Dec 17 15:50:02 2019
25 * Fixed music_mpg123 seek bug when sample rate of the file and
26 the stream don't match
27 Ozkan Sezer - Tue Dec 17 14:56:04 2019
28 * Timidity improvements. New Mix_SetTimidityCfg() public api.
29 Ozkan Sezer - Sun Dec 08 10:20:40 2019
30 * Improved mp3 tag detection/skipping
31 Ozkan Sezer - Thu Dec 05 01:41:50 2019
32 * Updated external libraries with multiple bug/security fixes
33 Vitaly Novichkov - Wed Dec 04 18:50:02 2019
34 * Extended support for WAV files
35 Vitaly Novichkov - Tue Nov 26 15:55:50 2019
36 * Added looping support for Opus files
37 Vitaly Novichkov - Tue, 26 Nov 2019 15:02:51
38 * Allow rmid files be opened by native midi
39 Vitaly Novichkov - Tue Nov 26 14:37:25 2019
40 * Fixed possible crash in win32 native midi
41 Vitaly Novichkov - Mon Nov 18 17:10:20 2019
42 * Prevent clipping due to volume settings in modplug music
43 Michael Day - Mon Nov 18 07:43:52 2019
44 * Fixed FLAC initial stutter
45 Michael Day - Sat Nov 16 22:11:29 PST 2019
46 * Added looping support for FLAC files
47 Michael Day - Fri Nov 01 10:38:35 2019
48 * Improved OGG looping support
49 Sam Lantinga - Fri Oct 04 18:00:42 2019
50 * Fixed loading Opus audio as audio chunks
51 Sylvain Becker - Wed Aug 21 09:30:22 2019
52 * Fixed Mix_FadeOutChannel() never setting fade_volume_reset
53 Ioan Chera - Sat Mar 30 14:07:03 2019
54 * Fixed memory leak in macOS native midi code
55
056 2.0.4:
157 Ozkan Sezer - Wed, 10 Oct 2018 14:56:10
258 * Removed smpeg support for mp3 music, now that it's replaced by libmpg123
0 cmake_minimum_required(VERSION 3.1.0)
1 project(SDL2_mixer C)
2
3 # FIXME: CMAKE SUPPORT IN SDL2_mixer IS VERY INCOMPLETE YET !!!
4 #
5 # FIXME: make it able build against system codec libraries, too.
6 # FIXME: handle library versioning.
7 # FIXME: test accross different target platforms.
8 #
9 # FIXME: missing CMakeLists.txt for MPG123
10 set(SUPPORT_MP3_MPG123 OFF CACHE BOOL "" FORCE)
11
12 option(SUPPORT_WAV "Support loading WAVE music" ON)
13 option(SUPPORT_FLAC "Support loading FLAC music with libFLAC" OFF)
14 option(SUPPORT_OGG "Support loading OGG Vorbis music via Tremor" OFF)
15 option(SUPPORT_MP3_MPG123 "Support loading MP3 music via MPG123" OFF)
16 option(SUPPORT_MOD_MODPLUG "Support loading MOD music via modplug" OFF)
17 option(SUPPORT_MID_TIMIDITY "Support loading MIDI music via TiMidity" OFF)
18
19 option(BUILD_SHARED_LIBS "Enable shared library" ON)
20
21 if (NOT ANDROID AND NOT (TARGET SDL2 OR TARGET SDL2-static))
22 find_package(SDL2 REQUIRED)
23
24 if(NOT TARGET SDL2::SDL2)
25 # SDL < 2.0.12
26 add_library(SDL2::SDL2 INTERFACE IMPORTED)
27 set_target_properties(SDL2::SDL2 PROPERTIES
28 INTERFACE_INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIRS} ${SDL2_INCLUDE_DIR}
29 INTERFACE_LINK_LIBRARIES ${SDL2_LIBRARIES} ${SDL2_LIBRARY}
30 )
31 endif()
32 endif()
33
34 include_directories(include src src/codecs)
35
36 add_library(SDL2_mixer)
37 add_library(SDL2::mixer ALIAS SDL2_mixer)
38
39 target_sources(SDL2_mixer PRIVATE
40 src/effect_position.c src/effects_internal.c src/effect_stereoreverse.c
41 src/mixer.c src/music.c src/utils.c
42 src/codecs/load_aiff.c src/codecs/load_voc.c
43 src/codecs/music_cmd.c
44 src/codecs/music_wav.c src/codecs/music_flac.c
45 src/codecs/music_mad.c src/codecs/music_mpg123.c
46 src/codecs/music_ogg.c src/codecs/music_opus.c
47 src/codecs/music_mikmod.c src/codecs/music_modplug.c
48 src/codecs/music_xmp.c
49 src/codecs/music_fluidsynth.c src/codecs/music_timidity.c
50 src/codecs/music_nativemidi.c)
51
52 if (SUPPORT_WAV)
53 target_compile_definitions(SDL2_mixer PRIVATE -DMUSIC_WAV)
54 endif()
55
56 if (SUPPORT_FLAC)
57 target_compile_definitions(SDL2_mixer PRIVATE -DMUSIC_FLAC)
58 add_subdirectory(external/flac-1.3.3)
59 target_include_directories(SDL2_mixer PRIVATE external/flac-1.3.3/include)
60 target_link_libraries(SDL2_mixer PRIVATE FLAC)
61 endif()
62
63 if (SUPPORT_OGG)
64 target_compile_definitions(SDL2_mixer PRIVATE -DMUSIC_OGG -DOGG_USE_TREMOR -DOGG_HEADER=<ivorbisfile.h>)
65 add_subdirectory(external/libogg-1.3.2)
66 add_subdirectory(external/libvorbisidec-1.2.1)
67 target_include_directories(SDL2_mixer PRIVATE external/libvorbisidec-1.2.1)
68 target_link_libraries(SDL2_mixer PRIVATE vorbisidec ogg)
69 endif()
70
71 if (SUPPORT_MP3_MPG123)
72 target_compile_definitions(SDL2_mixer PRIVATE -DMUSIC_MP3_MPG123)
73 add_subdirectory(external/mpg123-1.25.13)
74 target_link_libraries(SDL2_mixer PRIVATE mpg123)
75 endif()
76
77 if (SUPPORT_MOD_MODPLUG)
78 target_compile_definitions(SDL2_mixer PRIVATE -DMUSIC_MOD_MODPLUG -DMODPLUG_HEADER=<modplug.h>)
79 add_subdirectory(external/libmodplug-0.8.9.0)
80 target_include_directories(SDL2_mixer PRIVATE external/libmodplug-0.8.9.0/src)
81 target_link_libraries(SDL2_mixer PRIVATE modplug)
82 endif()
83
84 if (SUPPORT_MID_TIMIDITY)
85 target_compile_definitions(SDL2_mixer PRIVATE -DMUSIC_MID_TIMIDITY)
86 add_subdirectory(src/codecs/timidity)
87 target_link_libraries(SDL2_mixer PRIVATE timidity)
88 endif()
89
90 if(WIN32 AND BUILD_SHARED_LIBS)
91 target_compile_definitions(SDL2_mixer PRIVATE -DDLL_EXPORT)
92 endif()
93
94 target_include_directories(SDL2_mixer PUBLIC include)
95 target_link_libraries(SDL2_mixer PRIVATE SDL2::SDL2)
+0
-20
COPYING.txt less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
0 Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
1
2 This software is provided 'as-is', without any express or implied
3 warranty. In no event will the authors be held liable for any damages
4 arising from the use of this software.
5
6 Permission is granted to anyone to use this software for any purpose,
7 including commercial applications, and to alter it and redistribute it
8 freely, subject to the following restrictions:
9
10 1. The origin of this software must not be misrepresented; you must not
11 claim that you wrote the original software. If you use this software
12 in a product, an acknowledgment in the product documentation would be
13 appreciated but is not required.
14 2. Altered source versions must be plainly marked as such, and must not be
15 misrepresented as being the original software.
16 3. This notice may not be removed or altered from any source distribution.
2727 INSTALL = @INSTALL@
2828 AR = @AR@
2929 RANLIB = @RANLIB@
30 WINDRES = @WINDRES@
30 RC = @RC@
3131 SDL_CFLAGS = @SDL_CFLAGS@
3232 SDL_LIBS = @SDL_LIBS@
3333
3737 PLAYWAVE_OBJECTS = @PLAYWAVE_OBJECTS@
3838 PLAYMUS_OBJECTS = @PLAYMUS_OBJECTS@
3939
40 DIST = *.txt Android.mk Makefile.in SDL2_mixer.pc.in SDL2_mixer.spec.in SDL_mixer.h VisualC VisualC-WinRT Xcode Xcode-iOS acinclude aclocal.m4 autogen.sh build-scripts configure configure.in debian effect_position.c effect_stereoreverse.c effects_internal.c effects_internal.h external gcc-fat.sh load_aiff.c load_aiff.h load_voc.c load_voc.h mixer.c mixer.h music.c music.h music_cmd.c music_cmd.h music_flac.c music_flac.h music_fluidsynth.c music_fluidsynth.h music_mad.c music_mad.h music_mikmod.c music_mikmod.h music_modplug.c music_modplug.h music_mpg123.c music_mpg123.h music_nativemidi.c music_nativemidi.h music_ogg.c music_ogg.h music_opus.c music_opus.h music_timidity.c music_timidity.h music_wav.c music_wav.h native_midi playmus.c playwave.c timidity version.rc
40 SRC_DIST = *.txt Android.mk Makefile.in Makefile.os2 SDL2_mixer.pc.in SDL2_mixer.spec.in include/SDL_mixer.h VisualC VisualC-WinRT Xcode Xcode-iOS acinclude autogen.sh build-scripts configure configure.ac debian external gcc-fat.sh src/utils.c src/utils.h src/effect_position.c src/effect_stereoreverse.c src/effects_internal.c src/effects_internal.h src/codecs/load_aiff.c src/codecs/load_aiff.h src/codecs/load_voc.c src/codecs/load_voc.h src/codecs/mp3utils.c src/codecs/mp3utils.h src/mixer.c src/mixer.h src/music.c src/music.h src/codecs/music_cmd.c src/codecs/music_cmd.h src/codecs/music_flac.c src/codecs/music_flac.h src/codecs/music_fluidsynth.c src/codecs/music_fluidsynth.h src/codecs/music_mad.c src/codecs/music_mad.h src/codecs/music_mikmod.c src/codecs/music_mikmod.h src/codecs/music_modplug.c src/codecs/music_modplug.h src/codecs/music_xmp.c src/codecs/music_xmp.h src/codecs/music_mpg123.c src/codecs/music_mpg123.h src/codecs/music_nativemidi.c src/codecs/music_nativemidi.h src/codecs/music_ogg.c src/codecs/music_ogg.h src/codecs/music_opus.c src/codecs/music_opus.h src/codecs/music_timidity.c src/codecs/music_timidity.h src/codecs/music_wav.c src/codecs/music_wav.h src/codecs/native_midi playmus.c playwave.c src/codecs/timidity version.rc
41 GEN_DIST = SDL2_mixer.spec
4142
4243 LT_AGE = @LT_AGE@
4344 LT_CURRENT = @LT_CURRENT@
4445 LT_RELEASE = @LT_RELEASE@
4546 LT_REVISION = @LT_REVISION@
46 LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
47 LT_EXTRA = @LT_EXTRA@
48 LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) $(LT_EXTRA)
4749
48 all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/playwave$(EXE) $(objects)/playmus$(EXE)
50 all: $(srcdir)/configure Makefile $(objects)/$(TARGET) $(objects)/playwave$(EXE) $(objects)/playmus$(EXE)
4951
50 $(srcdir)/configure: $(srcdir)/configure.in
51 @echo "Warning, configure.in is out of date"
52 #(cd $(srcdir) && sh autogen.sh && sh configure)
53 @sleep 3
52 $(srcdir)/configure: $(srcdir)/configure.ac
53 @echo "Warning, configure is out of date, please re-run autogen.sh"
5454
5555 Makefile: $(srcdir)/Makefile.in
5656 $(SHELL) config.status $@
5757
58 $(objects):
59 $(SHELL) $(auxdir)/mkinstalldirs $@
58 $(objects)/.created:
59 $(SHELL) $(auxdir)/mkinstalldirs $(objects)
60 touch $@
6061
6162 .PHONY: all install install-hdrs install-lib install-bin uninstall uninstall-hdrs uninstall-lib uninstall-bin clean distclean dist
6263
7273 install: all install-hdrs install-lib #install-bin
7374 install-hdrs:
7475 $(SHELL) $(auxdir)/mkinstalldirs $(includedir)/SDL2
75 for src in $(srcdir)/SDL_mixer.h; do \
76 for src in $(srcdir)/include/SDL_mixer.h; do \
7677 file=`echo $$src | sed -e 's|^.*/||'`; \
7778 $(INSTALL) -m 644 $$src $(includedir)/SDL2/$$file; \
7879 done
8889
8990 uninstall: uninstall-hdrs uninstall-lib uninstall-bin
9091 uninstall-hdrs:
91 for src in $(srcdir)/SDL_mixer.h; do \
92 for src in $(srcdir)/include/SDL_mixer.h; do \
9293 file=`echo $$src | sed -e 's|^.*/||'`; \
9394 rm -f $(includedir)/SDL2/$$file; \
9495 done
120121
121122 dist $(distfile):
122123 $(SHELL) $(auxdir)/mkinstalldirs $(distdir)
123 (cd $(srcdir); tar cf - $(DIST)) | (cd $(distdir); tar xf -)
124 (cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
125 tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
124126 rm -rf `find $(distdir) -name .svn`
125127 rm -f `find $(distdir) -name '.#*'`
126128 tar cvf - $(distdir) | gzip --best >$(distfile)
0 # Open Watcom makefile to build SDL2mix.dll for OS/2
1 # wmake -f Makefile.os2
2 #
3 # Remember to edit DEPS_INC and DEPS_LIB below to meet
4 # your own environment!.
5
6 LIBNAME = SDL2mix
7 VERSION = 2.0.4
8
9 TITLENAME = $(LIBNAME) $(VERSION)
10
11 # change DEPS_INC in order to point to the dependency headers.
12 DEPS_INC=-IC:\SDL2DEV\h\SDL2 -IC:\SDL2DEV\h
13 # change DEPS_LIB in order to point to the dependency libraries.
14 DEPS_LIB=C:\SDL2DEV\lib
15
16 # wav music support
17 USE_WAV=yes
18 # ogg/vorbis music support
19 USE_OGG=yes
20 # use integer-only Tremor (libvorbisidec) instead of libvorbis?
21 USE_TREMOR=no
22 # flac music support
23 USE_FLAC=yes
24 # opus music support
25 USE_OPUS=yes
26 # mp3 music support (using libmad)
27 USE_LIBMAD=no
28 # mp3 music support (using mpg123)
29 USE_MPG123=yes
30 # midi music support (using timidity)
31 USE_TIMIDITY=yes
32 # midi music support (using fluidsynth)
33 USE_FLUIDSYNTH=no
34 # tracker music support (using libmikmod)
35 USE_MIKMOD=no
36 # tracker music support (using libxmp)
37 USE_XMP=yes
38 # tracker music support (using libmodplug)
39 USE_MODPLUG=no
40
41 LIBFILE = $(LIBNAME).lib
42 DLLFILE = $(LIBNAME).dll
43 LNKFILE = $(LIBNAME).lnk
44 TIMILIB = timidity.lib
45
46 SRCS = utils.c effect_position.c effects_internal.c effect_stereoreverse.c mixer.c music.c
47 # codec sources:
48 SRCS+= load_aiff.c load_voc.c music_wav.c &
49 mp3utils.c music_mad.c music_mpg123.c &
50 music_ogg.c music_opus.c music_flac.c &
51 music_xmp.c music_mikmod.c music_modplug.c &
52 music_fluidsynth.c music_timidity.c
53 # timidity sources:
54 TIMISRCS = common.c instrum.c mix.c output.c playmidi.c readmidi.c resample.c tables.c timidity.c
55
56 OBJS = $(SRCS:.c=.obj)
57 TIMIOBJS = $(TIMISRCS:.c=.obj)
58
59 LIBS = SDL2.lib
60
61 CFLAGS_BASE = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei -j
62 # warnings:
63 CFLAGS_BASE+= -wx
64 # include paths:
65 CFLAGS_BASE+= -Iinclude -Isrc -I"src/codecs" -I"src/codecs/timidity" $(DEPS_INC)
66 CFLAGS_BASE+= -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
67 CFLAGS = $(CFLAGS_BASE)
68 # to build a dll:
69 CFLAGS+= -bd
70 # for DECLSPEC:
71 CFLAGS+= -DBUILD_SDL
72
73 !ifeq USE_TIMIDITY yes
74 CFLAGS+= -DMUSIC_MID_TIMIDITY
75 LIBS+= $(TIMILIB)
76 !endif
77 !ifeq USE_FLUIDSYNTH yes
78 CFLAGS+= -DMUSIC_MID_FLUIDSYNTH
79 LIBS+= fluidsyn.lib
80 !endif
81
82 !ifeq USE_WAV yes
83 CFLAGS+= -DMUSIC_WAV
84 !endif
85
86 !ifeq USE_TREMOR yes
87 VORBIS_LIBS=vorbisidec.lib
88 !else
89 VORBIS_LIBS=vorbisfile.lib vorbis.lib
90 !endif
91 !ifeq USE_OGG yes
92 CFLAGS+= -DMUSIC_OGG
93 !ifeq USE_TREMOR yes
94 CFLAGS+= -DOGG_USE_TREMOR
95 !endif
96 LIBS+= $(VORBIS_LIBS)
97 LIBS+= ogg.lib
98 !endif
99
100 !ifeq USE_FLAC yes
101 CFLAGS+= -DMUSIC_FLAC
102 LIBS+= FLAC.lib
103 !endif
104
105 !ifeq USE_OPUS yes
106 CFLAGS+= -DMUSIC_OPUS
107 LIBS+= opusfile.lib opus.lib
108 !ifneq USE_OGG yes
109 LIBS+= ogg.lib
110 !endif
111 !endif
112
113 !ifeq USE_LIBMAD yes
114 CFLAGS+= -DMUSIC_MP3_MAD
115 LIBS+= mad.lib
116 !endif
117 !ifeq USE_MPG123 yes
118 CFLAGS+= -DMUSIC_MP3_MPG123
119 LIBS+= mpg123.lib
120 !endif
121
122 !ifeq USE_XMP yes
123 CFLAGS+= -DMUSIC_MOD_XMP
124 LIBS+= libxmp.lib
125 !endif
126 !ifeq USE_MIKMOD yes
127 CFLAGS+= -DMUSIC_MOD_MIKMOD
128 LIBS+= mikmod.lib
129 !endif
130 !ifeq USE_MODPLUG yes
131 CFLAGS+= -DMUSIC_MOD_MODPLUG
132 LIBS+= modplug.lib
133 !endif
134
135 all: $(DLLFILE) playwave.exe playmus.exe
136
137 $(LIBFILE): $(DLLFILE)
138 @echo * Create library: $@...
139 wlib -b -n -q -c -pa -s -t -zld -ii -io $@ $(DLLFILE)
140
141 $(DLLFILE): $(OBJS) $(TIMILIB) $(LNKFILE)
142 @echo * Link: $@
143 wlink @$(LNKFILE)
144
145 $(LNKFILE):
146 @%create $@
147 @%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
148 @%append $@ NAME $(LIBNAME)
149 @for %i in ($(OBJS)) do @%append $@ FILE %i
150 @%append $@ OPTION QUIET
151 @%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@Simple DirectMedia Layer Mixer'
152 @%append $@ LIBPATH $(DEPS_LIB)
153 @for %i in ($(LIBS)) do @%append $@ LIB %i
154 @%append $@ OPTION MAP=$*
155 @%append $@ OPTION ELIMINATE
156 @%append $@ OPTION MANYAUTODATA
157 @%append $@ OPTION OSNAME='OS/2 and eComStation'
158 @%append $@ OPTION SHOWDEAD
159
160 .c: ./src;./src/codecs;
161
162 .c.obj:
163 wcc386 $(CFLAGS) -fo=$^@ $<
164
165 playmus.obj: playmus.c
166 wcc386 $(CFLAGS_BASE) -fo=$^@ $<
167
168 playwave.obj: playwave.c
169 wcc386 $(CFLAGS_BASE) -fo=$^@ $<
170
171 playmus.exe: $(LIBFILE) playmus.obj
172 wlink SYS os2v2 OP q LIBPATH $(DEPS_LIB) LIBR {$(LIBFILE) SDL2.lib} F {playmus.obj} N playmus.exe
173
174 playwave.exe: $(LIBFILE) playwave.obj
175 wlink SYS os2v2 OP q LIBPATH $(DEPS_LIB) LIBR {$(LIBFILE) SDL2.lib} F {playwave.obj} N playwave.exe
176
177 .c: ./src/codecs/timidity;
178 timidity.lib: $(TIMIOBJS)
179 wlib -b -n -q -c -pa -s -t -zld -ii -io $@ $(TIMIOBJS)
180
181 clean: .SYMBOLIC
182 @echo * Clean: $(TITLENAME)
183 @if exist *.obj rm *.obj
184 @if exist *.err rm *.err
185 @if exist $(TIMILIB) rm $(TIMILIB)
186 @if exist $(LNKFILE) rm $(LNKFILE)
187 distclean: .SYMBOLIC clean
188 @if exist $(DLLFILE) rm $(DLLFILE)
189 @if exist $(LIBFILE) rm $(LIBFILE)
190 @if exist *.map rm *.map
191 @if exist *.exe rm *.exe
4949 and SDL_mixer directories to your "Header Search Paths" setting, then add the
5050 libSDL2.a and libSDL2_mixer.a to your "Link Binary with Libraries" setting.
5151
52 This library is under the zlib license, see the file "COPYING.txt" for details.
52 This library is under the zlib license, see the file "LICENSE.txt" for details.
5353
0 %define name SDL2_mixer
1 %define version 2.0.4
2 %define release 1
3
4 Summary: Simple DirectMedia Layer - Sample Mixer Library
5 Name: %{name}
6 Version: %{version}
7 Release: %{release}
8 Source0: %{name}-%{version}.tar.gz
9 License: LGPL
10 Group: System Environment/Libraries
11 BuildRoot: /var/tmp/%{name}-buildroot
12 Prefix: %{_prefix}
13
14 %description
15 Due to popular demand, here is a simple multi-channel audio mixer.
16 It supports 4 channels of 16 bit stereo audio, plus a single channel
17 of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis,
18 Tremor, libmpg123 and libmad MP3 libraries.
19
20 %package devel
21 Summary: Libraries, includes and more to develop SDL applications.
22 Group: Development/Libraries
23 Requires: %{name}
24
25 %description devel
26 Due to popular demand, here is a simple multi-channel audio mixer.
27 It supports 4 channels of 16 bit stereo audio, plus a single channel
28 of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis,
29 Tremor, libmpg123 and libmad MP3 libraries.
30
31 %prep
32 %setup
33
34 %build
35 CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
36 make
37
38 %install
39 rm -rf $RPM_BUILD_ROOT
40 make install prefix=$RPM_BUILD_ROOT/%{prefix}
41
42 %clean
43 rm -rf $RPM_BUILD_ROOT
44
45 %files
46 %defattr(-,root,root)
47 %doc README.txt CHANGES.txt LICENSE.txt
48 %{prefix}/lib/lib*.so.*
49
50 %files devel
51 %defattr(-,root,root)
52 %{prefix}/lib/lib*.a
53 %{prefix}/lib/lib*.la
54 %{prefix}/lib/lib*.so
55 %{prefix}/include/*/
56 %{prefix}/lib/pkgconfig/*.pc
57
58 %changelog
59 * Wed Jan 19 2000 Sam Lantinga
60 - converted to get package information from configure
61 * Sun Jan 16 2000 Hakan Tandogan <hakan@iconsult.com>
62 - initial spec file
63
2929 Tremor, libmpg123 and libmad MP3 libraries.
3030
3131 %prep
32 %setup
32 %setup
3333
3434 %build
3535 CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
4444
4545 %files
4646 %defattr(-,root,root)
47 %doc README.txt CHANGES.txt COPYING.txt
47 %doc README.txt CHANGES.txt LICENSE.txt
4848 %{prefix}/lib/lib*.so.*
4949
5050 %files devel
5656 %{prefix}/lib/pkgconfig/*.pc
5757
5858 %changelog
59 * Wed Jan 19 2000 Sam Lantinga
59 * Wed Jan 19 2000 Sam Lantinga
6060 - converted to get package information from configure
6161 * Sun Jan 16 2000 Hakan Tandogan <hakan@iconsult.com>
6262 - initial spec file
+0
-651
SDL_mixer.h less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 #ifndef SDL_MIXER_H_
22 #define SDL_MIXER_H_
23
24 #include "SDL_stdinc.h"
25 #include "SDL_rwops.h"
26 #include "SDL_audio.h"
27 #include "SDL_endian.h"
28 #include "SDL_version.h"
29 #include "begin_code.h"
30
31 /* Set up for C function definitions, even when using C++ */
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
37 */
38 #define SDL_MIXER_MAJOR_VERSION 2
39 #define SDL_MIXER_MINOR_VERSION 0
40 #define SDL_MIXER_PATCHLEVEL 4
41
42 /* This macro can be used to fill a version structure with the compile-time
43 * version of the SDL_mixer library.
44 */
45 #define SDL_MIXER_VERSION(X) \
46 { \
47 (X)->major = SDL_MIXER_MAJOR_VERSION; \
48 (X)->minor = SDL_MIXER_MINOR_VERSION; \
49 (X)->patch = SDL_MIXER_PATCHLEVEL; \
50 }
51
52 /* Backwards compatibility */
53 #define MIX_MAJOR_VERSION SDL_MIXER_MAJOR_VERSION
54 #define MIX_MINOR_VERSION SDL_MIXER_MINOR_VERSION
55 #define MIX_PATCHLEVEL SDL_MIXER_PATCHLEVEL
56 #define MIX_VERSION(X) SDL_MIXER_VERSION(X)
57
58 /**
59 * This is the version number macro for the current SDL_mixer version.
60 */
61 #define SDL_MIXER_COMPILEDVERSION \
62 SDL_VERSIONNUM(SDL_MIXER_MAJOR_VERSION, SDL_MIXER_MINOR_VERSION, SDL_MIXER_PATCHLEVEL)
63
64 /**
65 * This macro will evaluate to true if compiled with SDL_mixer at least X.Y.Z.
66 */
67 #define SDL_MIXER_VERSION_ATLEAST(X, Y, Z) \
68 (SDL_MIXER_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
69
70 /* This function gets the version of the dynamically linked SDL_mixer library.
71 it should NOT be used to fill a version structure, instead you should
72 use the SDL_MIXER_VERSION() macro.
73 */
74 extern DECLSPEC const SDL_version * SDLCALL Mix_Linked_Version(void);
75
76 typedef enum
77 {
78 MIX_INIT_FLAC = 0x00000001,
79 MIX_INIT_MOD = 0x00000002,
80 MIX_INIT_MP3 = 0x00000008,
81 MIX_INIT_OGG = 0x00000010,
82 MIX_INIT_MID = 0x00000020,
83 MIX_INIT_OPUS = 0x00000040
84 } MIX_InitFlags;
85
86 /* Loads dynamic libraries and prepares them for use. Flags should be
87 one or more flags from MIX_InitFlags OR'd together.
88 It returns the flags successfully initialized, or 0 on failure.
89 */
90 extern DECLSPEC int SDLCALL Mix_Init(int flags);
91
92 /* Unloads libraries loaded with Mix_Init */
93 extern DECLSPEC void SDLCALL Mix_Quit(void);
94
95
96 /* The default mixer has 8 simultaneous mixing channels */
97 #ifndef MIX_CHANNELS
98 #define MIX_CHANNELS 8
99 #endif
100
101 /* Good default values for a PC soundcard */
102 #define MIX_DEFAULT_FREQUENCY 22050
103 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
104 #define MIX_DEFAULT_FORMAT AUDIO_S16LSB
105 #else
106 #define MIX_DEFAULT_FORMAT AUDIO_S16MSB
107 #endif
108 #define MIX_DEFAULT_CHANNELS 2
109 #define MIX_MAX_VOLUME SDL_MIX_MAXVOLUME /* Volume of a chunk */
110
111 /* The internal format for an audio chunk */
112 typedef struct Mix_Chunk {
113 int allocated;
114 Uint8 *abuf;
115 Uint32 alen;
116 Uint8 volume; /* Per-sample volume, 0-128 */
117 } Mix_Chunk;
118
119 /* The different fading types supported */
120 typedef enum {
121 MIX_NO_FADING,
122 MIX_FADING_OUT,
123 MIX_FADING_IN
124 } Mix_Fading;
125
126 /* These are types of music files (not libraries used to load them) */
127 typedef enum {
128 MUS_NONE,
129 MUS_CMD,
130 MUS_WAV,
131 MUS_MOD,
132 MUS_MID,
133 MUS_OGG,
134 MUS_MP3,
135 MUS_MP3_MAD_UNUSED,
136 MUS_FLAC,
137 MUS_MODPLUG_UNUSED,
138 MUS_OPUS
139 } Mix_MusicType;
140
141 /* The internal format for a music chunk interpreted via mikmod */
142 typedef struct _Mix_Music Mix_Music;
143
144 /* Open the mixer with a certain audio format */
145 extern DECLSPEC int SDLCALL Mix_OpenAudio(int frequency, Uint16 format, int channels, int chunksize);
146
147 /* Open the mixer with specific device and certain audio format */
148 extern DECLSPEC int SDLCALL Mix_OpenAudioDevice(int frequency, Uint16 format, int channels, int chunksize, const char* device, int allowed_changes);
149
150 /* Dynamically change the number of channels managed by the mixer.
151 If decreasing the number of channels, the upper channels are
152 stopped.
153 This function returns the new number of allocated channels.
154 */
155 extern DECLSPEC int SDLCALL Mix_AllocateChannels(int numchans);
156
157 /* Find out what the actual audio device parameters are.
158 This function returns 1 if the audio has been opened, 0 otherwise.
159 */
160 extern DECLSPEC int SDLCALL Mix_QuerySpec(int *frequency,Uint16 *format,int *channels);
161
162 /* Load a wave file or a music (.mod .s3m .it .xm) file */
163 extern DECLSPEC Mix_Chunk * SDLCALL Mix_LoadWAV_RW(SDL_RWops *src, int freesrc);
164 #define Mix_LoadWAV(file) Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1)
165 extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS(const char *file);
166
167 /* Load a music file from an SDL_RWop object (Ogg and MikMod specific currently)
168 Matt Campbell (matt@campbellhome.dhs.org) April 2000 */
169 extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS_RW(SDL_RWops *src, int freesrc);
170
171 /* Load a music file from an SDL_RWop object assuming a specific format */
172 extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUSType_RW(SDL_RWops *src, Mix_MusicType type, int freesrc);
173
174 /* Load a wave file of the mixer format from a memory buffer */
175 extern DECLSPEC Mix_Chunk * SDLCALL Mix_QuickLoad_WAV(Uint8 *mem);
176
177 /* Load raw audio data of the mixer format from a memory buffer */
178 extern DECLSPEC Mix_Chunk * SDLCALL Mix_QuickLoad_RAW(Uint8 *mem, Uint32 len);
179
180 /* Free an audio chunk previously loaded */
181 extern DECLSPEC void SDLCALL Mix_FreeChunk(Mix_Chunk *chunk);
182 extern DECLSPEC void SDLCALL Mix_FreeMusic(Mix_Music *music);
183
184 /* Get a list of chunk/music decoders that this build of SDL_mixer provides.
185 This list can change between builds AND runs of the program, if external
186 libraries that add functionality become available.
187 You must successfully call Mix_OpenAudio() before calling these functions.
188 This API is only available in SDL_mixer 1.2.9 and later.
189
190 // usage...
191 int i;
192 const int total = Mix_GetNumChunkDecoders();
193 for (i = 0; i < total; i++)
194 printf("Supported chunk decoder: [%s]\n", Mix_GetChunkDecoder(i));
195
196 Appearing in this list doesn't promise your specific audio file will
197 decode...but it's handy to know if you have, say, a functioning Timidity
198 install.
199
200 These return values are static, read-only data; do not modify or free it.
201 The pointers remain valid until you call Mix_CloseAudio().
202 */
203 extern DECLSPEC int SDLCALL Mix_GetNumChunkDecoders(void);
204 extern DECLSPEC const char * SDLCALL Mix_GetChunkDecoder(int index);
205 extern DECLSPEC SDL_bool SDLCALL Mix_HasChunkDecoder(const char *name);
206 extern DECLSPEC int SDLCALL Mix_GetNumMusicDecoders(void);
207 extern DECLSPEC const char * SDLCALL Mix_GetMusicDecoder(int index);
208 extern DECLSPEC SDL_bool SDLCALL Mix_HasMusicDecoder(const char *name);
209
210 /* Find out the music format of a mixer music, or the currently playing
211 music, if 'music' is NULL.
212 */
213 extern DECLSPEC Mix_MusicType SDLCALL Mix_GetMusicType(const Mix_Music *music);
214
215 /* Set a function that is called after all mixing is performed.
216 This can be used to provide real-time visual display of the audio stream
217 or add a custom mixer filter for the stream data.
218 */
219 extern DECLSPEC void SDLCALL Mix_SetPostMix(void (SDLCALL *mix_func)(void *udata, Uint8 *stream, int len), void *arg);
220
221 /* Add your own music player or additional mixer function.
222 If 'mix_func' is NULL, the default music player is re-enabled.
223 */
224 extern DECLSPEC void SDLCALL Mix_HookMusic(void (SDLCALL *mix_func)(void *udata, Uint8 *stream, int len), void *arg);
225
226 /* Add your own callback for when the music has finished playing or when it is
227 * stopped from a call to Mix_HaltMusic.
228 */
229 extern DECLSPEC void SDLCALL Mix_HookMusicFinished(void (SDLCALL *music_finished)(void));
230
231 /* Get a pointer to the user data for the current music hook */
232 extern DECLSPEC void * SDLCALL Mix_GetMusicHookData(void);
233
234 /*
235 * Add your own callback when a channel has finished playing. NULL
236 * to disable callback. The callback may be called from the mixer's audio
237 * callback or it could be called as a result of Mix_HaltChannel(), etc.
238 * do not call SDL_LockAudio() from this callback; you will either be
239 * inside the audio callback, or SDL_mixer will explicitly lock the audio
240 * before calling your callback.
241 */
242 extern DECLSPEC void SDLCALL Mix_ChannelFinished(void (SDLCALL *channel_finished)(int channel));
243
244
245 /* Special Effects API by ryan c. gordon. (icculus@icculus.org) */
246
247 #define MIX_CHANNEL_POST -2
248
249 /* This is the format of a special effect callback:
250 *
251 * myeffect(int chan, void *stream, int len, void *udata);
252 *
253 * (chan) is the channel number that your effect is affecting. (stream) is
254 * the buffer of data to work upon. (len) is the size of (stream), and
255 * (udata) is a user-defined bit of data, which you pass as the last arg of
256 * Mix_RegisterEffect(), and is passed back unmolested to your callback.
257 * Your effect changes the contents of (stream) based on whatever parameters
258 * are significant, or just leaves it be, if you prefer. You can do whatever
259 * you like to the buffer, though, and it will continue in its changed state
260 * down the mixing pipeline, through any other effect functions, then finally
261 * to be mixed with the rest of the channels and music for the final output
262 * stream.
263 *
264 * DO NOT EVER call SDL_LockAudio() from your callback function!
265 */
266 typedef void (SDLCALL *Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata);
267
268 /*
269 * This is a callback that signifies that a channel has finished all its
270 * loops and has completed playback. This gets called if the buffer
271 * plays out normally, or if you call Mix_HaltChannel(), implicitly stop
272 * a channel via Mix_AllocateChannels(), or unregister a callback while
273 * it's still playing.
274 *
275 * DO NOT EVER call SDL_LockAudio() from your callback function!
276 */
277 typedef void (SDLCALL *Mix_EffectDone_t)(int chan, void *udata);
278
279
280 /* Register a special effect function. At mixing time, the channel data is
281 * copied into a buffer and passed through each registered effect function.
282 * After it passes through all the functions, it is mixed into the final
283 * output stream. The copy to buffer is performed once, then each effect
284 * function performs on the output of the previous effect. Understand that
285 * this extra copy to a buffer is not performed if there are no effects
286 * registered for a given chunk, which saves CPU cycles, and any given
287 * effect will be extra cycles, too, so it is crucial that your code run
288 * fast. Also note that the data that your function is given is in the
289 * format of the sound device, and not the format you gave to Mix_OpenAudio(),
290 * although they may in reality be the same. This is an unfortunate but
291 * necessary speed concern. Use Mix_QuerySpec() to determine if you can
292 * handle the data before you register your effect, and take appropriate
293 * actions.
294 * You may also specify a callback (Mix_EffectDone_t) that is called when
295 * the channel finishes playing. This gives you a more fine-grained control
296 * than Mix_ChannelFinished(), in case you need to free effect-specific
297 * resources, etc. If you don't need this, you can specify NULL.
298 * You may set the callbacks before or after calling Mix_PlayChannel().
299 * Things like Mix_SetPanning() are just internal special effect functions,
300 * so if you are using that, you've already incurred the overhead of a copy
301 * to a separate buffer, and that these effects will be in the queue with
302 * any functions you've registered. The list of registered effects for a
303 * channel is reset when a chunk finishes playing, so you need to explicitly
304 * set them with each call to Mix_PlayChannel*().
305 * You may also register a special effect function that is to be run after
306 * final mixing occurs. The rules for these callbacks are identical to those
307 * in Mix_RegisterEffect, but they are run after all the channels and the
308 * music have been mixed into a single stream, whereas channel-specific
309 * effects run on a given channel before any other mixing occurs. These
310 * global effect callbacks are call "posteffects". Posteffects only have
311 * their Mix_EffectDone_t function called when they are unregistered (since
312 * the main output stream is never "done" in the same sense as a channel).
313 * You must unregister them manually when you've had enough. Your callback
314 * will be told that the channel being mixed is (MIX_CHANNEL_POST) if the
315 * processing is considered a posteffect.
316 *
317 * After all these effects have finished processing, the callback registered
318 * through Mix_SetPostMix() runs, and then the stream goes to the audio
319 * device.
320 *
321 * DO NOT EVER call SDL_LockAudio() from your callback function!
322 *
323 * returns zero if error (no such channel), nonzero if added.
324 * Error messages can be retrieved from Mix_GetError().
325 */
326 extern DECLSPEC int SDLCALL Mix_RegisterEffect(int chan, Mix_EffectFunc_t f, Mix_EffectDone_t d, void *arg);
327
328
329 /* You may not need to call this explicitly, unless you need to stop an
330 * effect from processing in the middle of a chunk's playback.
331 * Posteffects are never implicitly unregistered as they are for channels,
332 * but they may be explicitly unregistered through this function by
333 * specifying MIX_CHANNEL_POST for a channel.
334 * returns zero if error (no such channel or effect), nonzero if removed.
335 * Error messages can be retrieved from Mix_GetError().
336 */
337 extern DECLSPEC int SDLCALL Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f);
338
339
340 /* You may not need to call this explicitly, unless you need to stop all
341 * effects from processing in the middle of a chunk's playback. Note that
342 * this will also shut off some internal effect processing, since
343 * Mix_SetPanning() and others may use this API under the hood. This is
344 * called internally when a channel completes playback.
345 * Posteffects are never implicitly unregistered as they are for channels,
346 * but they may be explicitly unregistered through this function by
347 * specifying MIX_CHANNEL_POST for a channel.
348 * returns zero if error (no such channel), nonzero if all effects removed.
349 * Error messages can be retrieved from Mix_GetError().
350 */
351 extern DECLSPEC int SDLCALL Mix_UnregisterAllEffects(int channel);
352
353
354 #define MIX_EFFECTSMAXSPEED "MIX_EFFECTSMAXSPEED"
355
356 /*
357 * These are the internally-defined mixing effects. They use the same API that
358 * effects defined in the application use, but are provided here as a
359 * convenience. Some effects can reduce their quality or use more memory in
360 * the name of speed; to enable this, make sure the environment variable
361 * MIX_EFFECTSMAXSPEED (see above) is defined before you call
362 * Mix_OpenAudio().
363 */
364
365
366 /* Set the panning of a channel. The left and right channels are specified
367 * as integers between 0 and 255, quietest to loudest, respectively.
368 *
369 * Technically, this is just individual volume control for a sample with
370 * two (stereo) channels, so it can be used for more than just panning.
371 * If you want real panning, call it like this:
372 *
373 * Mix_SetPanning(channel, left, 255 - left);
374 *
375 * ...which isn't so hard.
376 *
377 * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
378 * the panning will be done to the final mixed stream before passing it on
379 * to the audio device.
380 *
381 * This uses the Mix_RegisterEffect() API internally, and returns without
382 * registering the effect function if the audio device is not configured
383 * for stereo output. Setting both (left) and (right) to 255 causes this
384 * effect to be unregistered, since that is the data's normal state.
385 *
386 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
387 * nonzero if panning effect enabled. Note that an audio device in mono
388 * mode is a no-op, but this call will return successful in that case.
389 * Error messages can be retrieved from Mix_GetError().
390 */
391 extern DECLSPEC int SDLCALL Mix_SetPanning(int channel, Uint8 left, Uint8 right);
392
393
394 /* Set the position of a channel. (angle) is an integer from 0 to 360, that
395 * specifies the location of the sound in relation to the listener. (angle)
396 * will be reduced as neccesary (540 becomes 180 degrees, -100 becomes 260).
397 * Angle 0 is due north, and rotates clockwise as the value increases.
398 * For efficiency, the precision of this effect may be limited (angles 1
399 * through 7 might all produce the same effect, 8 through 15 are equal, etc).
400 * (distance) is an integer between 0 and 255 that specifies the space
401 * between the sound and the listener. The larger the number, the further
402 * away the sound is. Using 255 does not guarantee that the channel will be
403 * culled from the mixing process or be completely silent. For efficiency,
404 * the precision of this effect may be limited (distance 0 through 5 might
405 * all produce the same effect, 6 through 10 are equal, etc). Setting (angle)
406 * and (distance) to 0 unregisters this effect, since the data would be
407 * unchanged.
408 *
409 * If you need more precise positional audio, consider using OpenAL for
410 * spatialized effects instead of SDL_mixer. This is only meant to be a
411 * basic effect for simple "3D" games.
412 *
413 * If the audio device is configured for mono output, then you won't get
414 * any effectiveness from the angle; however, distance attenuation on the
415 * channel will still occur. While this effect will function with stereo
416 * voices, it makes more sense to use voices with only one channel of sound,
417 * so when they are mixed through this effect, the positioning will sound
418 * correct. You can convert them to mono through SDL before giving them to
419 * the mixer in the first place if you like.
420 *
421 * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
422 * the positioning will be done to the final mixed stream before passing it
423 * on to the audio device.
424 *
425 * This is a convenience wrapper over Mix_SetDistance() and Mix_SetPanning().
426 *
427 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
428 * nonzero if position effect is enabled.
429 * Error messages can be retrieved from Mix_GetError().
430 */
431 extern DECLSPEC int SDLCALL Mix_SetPosition(int channel, Sint16 angle, Uint8 distance);
432
433
434 /* Set the "distance" of a channel. (distance) is an integer from 0 to 255
435 * that specifies the location of the sound in relation to the listener.
436 * Distance 0 is overlapping the listener, and 255 is as far away as possible
437 * A distance of 255 does not guarantee silence; in such a case, you might
438 * want to try changing the chunk's volume, or just cull the sample from the
439 * mixing process with Mix_HaltChannel().
440 * For efficiency, the precision of this effect may be limited (distances 1
441 * through 7 might all produce the same effect, 8 through 15 are equal, etc).
442 * (distance) is an integer between 0 and 255 that specifies the space
443 * between the sound and the listener. The larger the number, the further
444 * away the sound is.
445 * Setting (distance) to 0 unregisters this effect, since the data would be
446 * unchanged.
447 * If you need more precise positional audio, consider using OpenAL for
448 * spatialized effects instead of SDL_mixer. This is only meant to be a
449 * basic effect for simple "3D" games.
450 *
451 * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
452 * the distance attenuation will be done to the final mixed stream before
453 * passing it on to the audio device.
454 *
455 * This uses the Mix_RegisterEffect() API internally.
456 *
457 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
458 * nonzero if position effect is enabled.
459 * Error messages can be retrieved from Mix_GetError().
460 */
461 extern DECLSPEC int SDLCALL Mix_SetDistance(int channel, Uint8 distance);
462
463
464 /*
465 * !!! FIXME : Haven't implemented, since the effect goes past the
466 * end of the sound buffer. Will have to think about this.
467 * --ryan.
468 */
469 #if 0
470 /* Causes an echo effect to be mixed into a sound. (echo) is the amount
471 * of echo to mix. 0 is no echo, 255 is infinite (and probably not
472 * what you want).
473 *
474 * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
475 * the reverbing will be done to the final mixed stream before passing it on
476 * to the audio device.
477 *
478 * This uses the Mix_RegisterEffect() API internally. If you specify an echo
479 * of zero, the effect is unregistered, as the data is already in that state.
480 *
481 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
482 * nonzero if reversing effect is enabled.
483 * Error messages can be retrieved from Mix_GetError().
484 */
485 extern no_parse_DECLSPEC int SDLCALL Mix_SetReverb(int channel, Uint8 echo);
486 #endif
487
488 /* Causes a channel to reverse its stereo. This is handy if the user has his
489 * speakers hooked up backwards, or you would like to have a minor bit of
490 * psychedelia in your sound code. :) Calling this function with (flip)
491 * set to non-zero reverses the chunks's usual channels. If (flip) is zero,
492 * the effect is unregistered.
493 *
494 * This uses the Mix_RegisterEffect() API internally, and thus is probably
495 * more CPU intensive than having the user just plug in his speakers
496 * correctly. Mix_SetReverseStereo() returns without registering the effect
497 * function if the audio device is not configured for stereo output.
498 *
499 * If you specify MIX_CHANNEL_POST for (channel), then this the effect is used
500 * on the final mixed stream before sending it on to the audio device (a
501 * posteffect).
502 *
503 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
504 * nonzero if reversing effect is enabled. Note that an audio device in mono
505 * mode is a no-op, but this call will return successful in that case.
506 * Error messages can be retrieved from Mix_GetError().
507 */
508 extern DECLSPEC int SDLCALL Mix_SetReverseStereo(int channel, int flip);
509
510 /* end of effects API. --ryan. */
511
512
513 /* Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate
514 them dynamically to the next sample if requested with a -1 value below.
515 Returns the number of reserved channels.
516 */
517 extern DECLSPEC int SDLCALL Mix_ReserveChannels(int num);
518
519 /* Channel grouping functions */
520
521 /* Attach a tag to a channel. A tag can be assigned to several mixer
522 channels, to form groups of channels.
523 If 'tag' is -1, the tag is removed (actually -1 is the tag used to
524 represent the group of all the channels).
525 Returns true if everything was OK.
526 */
527 extern DECLSPEC int SDLCALL Mix_GroupChannel(int which, int tag);
528 /* Assign several consecutive channels to a group */
529 extern DECLSPEC int SDLCALL Mix_GroupChannels(int from, int to, int tag);
530 /* Finds the first available channel in a group of channels,
531 returning -1 if none are available.
532 */
533 extern DECLSPEC int SDLCALL Mix_GroupAvailable(int tag);
534 /* Returns the number of channels in a group. This is also a subtle
535 way to get the total number of channels when 'tag' is -1
536 */
537 extern DECLSPEC int SDLCALL Mix_GroupCount(int tag);
538 /* Finds the "oldest" sample playing in a group of channels */
539 extern DECLSPEC int SDLCALL Mix_GroupOldest(int tag);
540 /* Finds the "most recent" (i.e. last) sample playing in a group of channels */
541 extern DECLSPEC int SDLCALL Mix_GroupNewer(int tag);
542
543 /* Play an audio chunk on a specific channel.
544 If the specified channel is -1, play on the first free channel.
545 If 'loops' is greater than zero, loop the sound that many times.
546 If 'loops' is -1, loop inifinitely (~65000 times).
547 Returns which channel was used to play the sound.
548 */
549 #define Mix_PlayChannel(channel,chunk,loops) Mix_PlayChannelTimed(channel,chunk,loops,-1)
550 /* The same as above, but the sound is played at most 'ticks' milliseconds */
551 extern DECLSPEC int SDLCALL Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ticks);
552 extern DECLSPEC int SDLCALL Mix_PlayMusic(Mix_Music *music, int loops);
553
554 /* Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions */
555 extern DECLSPEC int SDLCALL Mix_FadeInMusic(Mix_Music *music, int loops, int ms);
556 extern DECLSPEC int SDLCALL Mix_FadeInMusicPos(Mix_Music *music, int loops, int ms, double position);
557 #define Mix_FadeInChannel(channel,chunk,loops,ms) Mix_FadeInChannelTimed(channel,chunk,loops,ms,-1)
558 extern DECLSPEC int SDLCALL Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks);
559
560 /* Set the volume in the range of 0-128 of a specific channel or chunk.
561 If the specified channel is -1, set volume for all channels.
562 Returns the original volume.
563 If the specified volume is -1, just return the current volume.
564 */
565 extern DECLSPEC int SDLCALL Mix_Volume(int channel, int volume);
566 extern DECLSPEC int SDLCALL Mix_VolumeChunk(Mix_Chunk *chunk, int volume);
567 extern DECLSPEC int SDLCALL Mix_VolumeMusic(int volume);
568
569 /* Halt playing of a particular channel */
570 extern DECLSPEC int SDLCALL Mix_HaltChannel(int channel);
571 extern DECLSPEC int SDLCALL Mix_HaltGroup(int tag);
572 extern DECLSPEC int SDLCALL Mix_HaltMusic(void);
573
574 /* Change the expiration delay for a particular channel.
575 The sample will stop playing after the 'ticks' milliseconds have elapsed,
576 or remove the expiration if 'ticks' is -1
577 */
578 extern DECLSPEC int SDLCALL Mix_ExpireChannel(int channel, int ticks);
579
580 /* Halt a channel, fading it out progressively till it's silent
581 The ms parameter indicates the number of milliseconds the fading
582 will take.
583 */
584 extern DECLSPEC int SDLCALL Mix_FadeOutChannel(int which, int ms);
585 extern DECLSPEC int SDLCALL Mix_FadeOutGroup(int tag, int ms);
586 extern DECLSPEC int SDLCALL Mix_FadeOutMusic(int ms);
587
588 /* Query the fading status of a channel */
589 extern DECLSPEC Mix_Fading SDLCALL Mix_FadingMusic(void);
590 extern DECLSPEC Mix_Fading SDLCALL Mix_FadingChannel(int which);
591
592 /* Pause/Resume a particular channel */
593 extern DECLSPEC void SDLCALL Mix_Pause(int channel);
594 extern DECLSPEC void SDLCALL Mix_Resume(int channel);
595 extern DECLSPEC int SDLCALL Mix_Paused(int channel);
596
597 /* Pause/Resume the music stream */
598 extern DECLSPEC void SDLCALL Mix_PauseMusic(void);
599 extern DECLSPEC void SDLCALL Mix_ResumeMusic(void);
600 extern DECLSPEC void SDLCALL Mix_RewindMusic(void);
601 extern DECLSPEC int SDLCALL Mix_PausedMusic(void);
602
603 /* Set the current position in the music stream.
604 This returns 0 if successful, or -1 if it failed or isn't implemented.
605 This function is only implemented for MOD music formats (set pattern
606 order number) and for OGG, FLAC, MP3_MAD, MP3_MPG and MODPLUG music
607 (set position in seconds), at the moment.
608 */
609 extern DECLSPEC int SDLCALL Mix_SetMusicPosition(double position);
610
611 /* Check the status of a specific channel.
612 If the specified channel is -1, check all channels.
613 */
614 extern DECLSPEC int SDLCALL Mix_Playing(int channel);
615 extern DECLSPEC int SDLCALL Mix_PlayingMusic(void);
616
617 /* Stop music and set external music playback command */
618 extern DECLSPEC int SDLCALL Mix_SetMusicCMD(const char *command);
619
620 /* Synchro value is set by MikMod from modules while playing */
621 extern DECLSPEC int SDLCALL Mix_SetSynchroValue(int value);
622 extern DECLSPEC int SDLCALL Mix_GetSynchroValue(void);
623
624 /* Set/Get/Iterate SoundFonts paths to use by supported MIDI backends */
625 extern DECLSPEC int SDLCALL Mix_SetSoundFonts(const char *paths);
626 extern DECLSPEC const char* SDLCALL Mix_GetSoundFonts(void);
627 extern DECLSPEC int SDLCALL Mix_EachSoundFont(int (SDLCALL *function)(const char*, void*), void *data);
628
629 /* Get the Mix_Chunk currently associated with a mixer channel
630 Returns NULL if it's an invalid channel, or there's no chunk associated.
631 */
632 extern DECLSPEC Mix_Chunk * SDLCALL Mix_GetChunk(int channel);
633
634 /* Close the mixer, halting all playing audio */
635 extern DECLSPEC void SDLCALL Mix_CloseAudio(void);
636
637 /* We'll use SDL for reporting errors */
638 #define Mix_SetError SDL_SetError
639 #define Mix_GetError SDL_GetError
640 #define Mix_ClearError SDL_ClearError
641
642 /* Ends C function definitions when using C++ */
643 #ifdef __cplusplus
644 }
645 #endif
646 #include "close_code.h"
647
648 #endif /* SDL_MIXER_H_ */
649
650 /* vi: set ts=4 sw=4 expandtab: */
+0
-7373
acinclude/libtool.m4 less more
0 ##############################################################################
1 # Based on libtool-2.2.6a
2 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
3 #
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
5 # 2006, 2007, 2008 Free Software Foundation, Inc.
6 # Written by Gordon Matzigkeit, 1996
7 #
8 # This file is free software; the Free Software Foundation gives
9 # unlimited permission to copy and/or distribute it, with or without
10 # modifications, as long as this notice is preserved.
11
12 m4_define([_LT_COPYING], [dnl
13 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
14 # 2006, 2007, 2008 Free Software Foundation, Inc.
15 # Written by Gordon Matzigkeit, 1996
16 #
17 # This file is part of GNU Libtool.
18 #
19 # GNU Libtool is free software; you can redistribute it and/or
20 # modify it under the terms of the GNU General Public License as
21 # published by the Free Software Foundation; either version 2 of
22 # the License, or (at your option) any later version.
23 #
24 # As a special exception to the GNU General Public License,
25 # if you distribute this file as part of a program or library that
26 # is built using GNU Libtool, you may include this file under the
27 # same distribution terms that you use for the rest of that program.
28 #
29 # GNU Libtool is distributed in the hope that it will be useful,
30 # but WITHOUT ANY WARRANTY; without even the implied warranty of
31 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 # GNU General Public License for more details.
33 #
34 # You should have received a copy of the GNU General Public License
35 # along with GNU Libtool; see the file COPYING. If not, a copy
36 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
37 # obtained by writing to the Free Software Foundation, Inc.,
38 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
39 ])
40
41 # serial 56 LT_INIT
42
43
44 # LT_PREREQ(VERSION)
45 # ------------------
46 # Complain and exit if this libtool version is less that VERSION.
47 m4_defun([LT_PREREQ],
48 [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
49 [m4_default([$3],
50 [m4_fatal([Libtool version $1 or higher is required],
51 63)])],
52 [$2])])
53
54
55 # _LT_CHECK_BUILDDIR
56 # ------------------
57 # Complain if the absolute build directory name contains unusual characters
58 m4_defun([_LT_CHECK_BUILDDIR],
59 [case `pwd` in
60 *\ * | *\ *)
61 AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
62 esac
63 ])
64
65
66 # LT_INIT([OPTIONS])
67 # ------------------
68 AC_DEFUN([LT_INIT],
69 [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
70 AC_BEFORE([$0], [LT_LANG])dnl
71 AC_BEFORE([$0], [LT_OUTPUT])dnl
72 AC_BEFORE([$0], [LTDL_INIT])dnl
73 m4_require([_LT_CHECK_BUILDDIR])dnl
74
75 dnl Autoconf doesn't catch unexpanded LT_ macros by default:
76 m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
77 m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
78 dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
79 dnl unless we require an AC_DEFUNed macro:
80 AC_REQUIRE([LTOPTIONS_VERSION])dnl
81 AC_REQUIRE([LTSUGAR_VERSION])dnl
82 AC_REQUIRE([LTVERSION_VERSION])dnl
83 AC_REQUIRE([LTOBSOLETE_VERSION])dnl
84 m4_require([_LT_PROG_LTMAIN])dnl
85
86 dnl Parse OPTIONS
87 _LT_SET_OPTIONS([$0], [$1])
88
89 # This can be used to rebuild libtool when needed
90 LIBTOOL_DEPS="$ltmain"
91
92 # Always use our own libtool.
93 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
94 AC_SUBST(LIBTOOL)dnl
95
96 _LT_SETUP
97
98 # Only expand once:
99 m4_define([LT_INIT])
100 ])# LT_INIT
101
102 # Old names:
103 AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
104 AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
105 dnl aclocal-1.4 backwards compatibility:
106 dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
107 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
108
109
110 # _LT_CC_BASENAME(CC)
111 # -------------------
112 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
113 m4_defun([_LT_CC_BASENAME],
114 [for cc_temp in $1""; do
115 case $cc_temp in
116 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
117 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
118 \-*) ;;
119 *) break;;
120 esac
121 done
122 cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
123 ])
124
125
126 # _LT_FILEUTILS_DEFAULTS
127 # ----------------------
128 # It is okay to use these file commands and assume they have been set
129 # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
130 m4_defun([_LT_FILEUTILS_DEFAULTS],
131 [: ${CP="cp -f"}
132 : ${MV="mv -f"}
133 : ${RM="rm -f"}
134 ])# _LT_FILEUTILS_DEFAULTS
135
136
137 # _LT_SETUP
138 # ---------
139 m4_defun([_LT_SETUP],
140 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
141 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
142 _LT_DECL([], [host_alias], [0], [The host system])dnl
143 _LT_DECL([], [host], [0])dnl
144 _LT_DECL([], [host_os], [0])dnl
145 dnl
146 _LT_DECL([], [build_alias], [0], [The build system])dnl
147 _LT_DECL([], [build], [0])dnl
148 _LT_DECL([], [build_os], [0])dnl
149 dnl
150 AC_REQUIRE([AC_PROG_CC])dnl
151 AC_REQUIRE([LT_PATH_LD])dnl
152 AC_REQUIRE([LT_PATH_NM])dnl
153 dnl
154 AC_REQUIRE([AC_PROG_LN_S])dnl
155 test -z "$LN_S" && LN_S="ln -s"
156 _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
157 dnl
158 AC_REQUIRE([LT_CMD_MAX_LEN])dnl
159 _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
160 _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
161 dnl
162 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
163 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
164 m4_require([_LT_CMD_RELOAD])dnl
165 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
166 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
167 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
168
169 _LT_CONFIG_LIBTOOL_INIT([
170 # See if we are running on zsh, and set the options which allow our
171 # commands through without removal of \ escapes INIT.
172 if test -n "\${ZSH_VERSION+set}" ; then
173 setopt NO_GLOB_SUBST
174 fi
175 ])
176 if test -n "${ZSH_VERSION+set}" ; then
177 setopt NO_GLOB_SUBST
178 fi
179
180 _LT_CHECK_OBJDIR
181
182 m4_require([_LT_TAG_COMPILER])dnl
183 _LT_PROG_ECHO_BACKSLASH
184
185 case $host_os in
186 aix3*)
187 # AIX sometimes has problems with the GCC collect2 program. For some
188 # reason, if we set the COLLECT_NAMES environment variable, the problems
189 # vanish in a puff of smoke.
190 if test "X${COLLECT_NAMES+set}" != Xset; then
191 COLLECT_NAMES=
192 export COLLECT_NAMES
193 fi
194 ;;
195 esac
196
197 # Sed substitution that helps us do robust quoting. It backslashifies
198 # metacharacters that are still active within double-quoted strings.
199 sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
200
201 # Same as above, but do not quote variable references.
202 double_quote_subst='s/\([["`\\]]\)/\\\1/g'
203
204 # Sed substitution to delay expansion of an escaped shell variable in a
205 # double_quote_subst'ed string.
206 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
207
208 # Sed substitution to delay expansion of an escaped single quote.
209 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
210
211 # Sed substitution to avoid accidental globbing in evaled expressions
212 no_glob_subst='s/\*/\\\*/g'
213
214 # Global variables:
215 ofile=libtool
216 can_build_shared=yes
217
218 # All known linkers require a `.a' archive for static linking (except MSVC,
219 # which needs '.lib').
220 libext=a
221
222 with_gnu_ld="$lt_cv_prog_gnu_ld"
223
224 old_CC="$CC"
225 old_CFLAGS="$CFLAGS"
226
227 # Set sane defaults for various variables
228 test -z "$CC" && CC=cc
229 test -z "$LTCC" && LTCC=$CC
230 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
231 test -z "$LD" && LD=ld
232 test -z "$ac_objext" && ac_objext=o
233
234 _LT_CC_BASENAME([$compiler])
235
236 # Only perform the check for file, if the check method requires it
237 test -z "$MAGIC_CMD" && MAGIC_CMD=file
238 case $deplibs_check_method in
239 file_magic*)
240 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
241 _LT_PATH_MAGIC
242 fi
243 ;;
244 esac
245
246 # Use C for the default configuration in the libtool script
247 LT_SUPPORTED_TAG([CC])
248 _LT_LANG_C_CONFIG
249 _LT_LANG_DEFAULT_CONFIG
250 _LT_CONFIG_COMMANDS
251 ])# _LT_SETUP
252
253
254 # _LT_PROG_LTMAIN
255 # ---------------
256 # Note that this code is called both from `configure', and `config.status'
257 # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
258 # `config.status' has no value for ac_aux_dir unless we are using Automake,
259 # so we pass a copy along to make sure it has a sensible value anyway.
260 m4_defun([_LT_PROG_LTMAIN],
261 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
262 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
263 ltmain="$ac_aux_dir/ltmain.sh"
264 ])# _LT_PROG_LTMAIN
265
266
267 ## ------------------------------------- ##
268 ## Accumulate code for creating libtool. ##
269 ## ------------------------------------- ##
270
271 # So that we can recreate a full libtool script including additional
272 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
273 # in macros and then make a single call at the end using the `libtool'
274 # label.
275
276
277 # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
278 # ----------------------------------------
279 # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
280 m4_define([_LT_CONFIG_LIBTOOL_INIT],
281 [m4_ifval([$1],
282 [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
283 [$1
284 ])])])
285
286 # Initialize.
287 m4_define([_LT_OUTPUT_LIBTOOL_INIT])
288
289
290 # _LT_CONFIG_LIBTOOL([COMMANDS])
291 # ------------------------------
292 # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
293 m4_define([_LT_CONFIG_LIBTOOL],
294 [m4_ifval([$1],
295 [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
296 [$1
297 ])])])
298
299 # Initialize.
300 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
301
302
303 # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
304 # -----------------------------------------------------
305 m4_defun([_LT_CONFIG_SAVE_COMMANDS],
306 [_LT_CONFIG_LIBTOOL([$1])
307 _LT_CONFIG_LIBTOOL_INIT([$2])
308 ])
309
310
311 # _LT_FORMAT_COMMENT([COMMENT])
312 # -----------------------------
313 # Add leading comment marks to the start of each line, and a trailing
314 # full-stop to the whole comment if one is not present already.
315 m4_define([_LT_FORMAT_COMMENT],
316 [m4_ifval([$1], [
317 m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
318 [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
319 )])
320
321
322
323 ## ------------------------ ##
324 ## FIXME: Eliminate VARNAME ##
325 ## ------------------------ ##
326
327
328 # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
329 # -------------------------------------------------------------------
330 # CONFIGNAME is the name given to the value in the libtool script.
331 # VARNAME is the (base) name used in the configure script.
332 # VALUE may be 0, 1 or 2 for a computed quote escaped value based on
333 # VARNAME. Any other value will be used directly.
334 m4_define([_LT_DECL],
335 [lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
336 [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
337 [m4_ifval([$1], [$1], [$2])])
338 lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
339 m4_ifval([$4],
340 [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
341 lt_dict_add_subkey([lt_decl_dict], [$2],
342 [tagged?], [m4_ifval([$5], [yes], [no])])])
343 ])
344
345
346 # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
347 # --------------------------------------------------------
348 m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
349
350
351 # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
352 # ------------------------------------------------
353 m4_define([lt_decl_tag_varnames],
354 [_lt_decl_filter([tagged?], [yes], $@)])
355
356
357 # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
358 # ---------------------------------------------------------
359 m4_define([_lt_decl_filter],
360 [m4_case([$#],
361 [0], [m4_fatal([$0: too few arguments: $#])],
362 [1], [m4_fatal([$0: too few arguments: $#: $1])],
363 [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
364 [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
365 [lt_dict_filter([lt_decl_dict], $@)])[]dnl
366 ])
367
368
369 # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
370 # --------------------------------------------------
371 m4_define([lt_decl_quote_varnames],
372 [_lt_decl_filter([value], [1], $@)])
373
374
375 # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
376 # ---------------------------------------------------
377 m4_define([lt_decl_dquote_varnames],
378 [_lt_decl_filter([value], [2], $@)])
379
380
381 # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
382 # ---------------------------------------------------
383 m4_define([lt_decl_varnames_tagged],
384 [m4_assert([$# <= 2])dnl
385 _$0(m4_quote(m4_default([$1], [[, ]])),
386 m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
387 m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
388 m4_define([_lt_decl_varnames_tagged],
389 [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
390
391
392 # lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
393 # ------------------------------------------------
394 m4_define([lt_decl_all_varnames],
395 [_$0(m4_quote(m4_default([$1], [[, ]])),
396 m4_if([$2], [],
397 m4_quote(lt_decl_varnames),
398 m4_quote(m4_shift($@))))[]dnl
399 ])
400 m4_define([_lt_decl_all_varnames],
401 [lt_join($@, lt_decl_varnames_tagged([$1],
402 lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
403 ])
404
405
406 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
407 # ------------------------------------
408 # Quote a variable value, and forward it to `config.status' so that its
409 # declaration there will have the same value as in `configure'. VARNAME
410 # must have a single quote delimited value for this to work.
411 m4_define([_LT_CONFIG_STATUS_DECLARE],
412 [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
413
414
415 # _LT_CONFIG_STATUS_DECLARATIONS
416 # ------------------------------
417 # We delimit libtool config variables with single quotes, so when
418 # we write them to config.status, we have to be sure to quote all
419 # embedded single quotes properly. In configure, this macro expands
420 # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
421 #
422 # <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
423 m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
424 [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
425 [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
426
427
428 # _LT_LIBTOOL_TAGS
429 # ----------------
430 # Output comment and list of tags supported by the script
431 m4_defun([_LT_LIBTOOL_TAGS],
432 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
433 available_tags="_LT_TAGS"dnl
434 ])
435
436
437 # _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
438 # -----------------------------------
439 # Extract the dictionary values for VARNAME (optionally with TAG) and
440 # expand to a commented shell variable setting:
441 #
442 # # Some comment about what VAR is for.
443 # visible_name=$lt_internal_name
444 m4_define([_LT_LIBTOOL_DECLARE],
445 [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
446 [description])))[]dnl
447 m4_pushdef([_libtool_name],
448 m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
449 m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
450 [0], [_libtool_name=[$]$1],
451 [1], [_libtool_name=$lt_[]$1],
452 [2], [_libtool_name=$lt_[]$1],
453 [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
454 m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
455 ])
456
457
458 # _LT_LIBTOOL_CONFIG_VARS
459 # -----------------------
460 # Produce commented declarations of non-tagged libtool config variables
461 # suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
462 # script. Tagged libtool config variables (even for the LIBTOOL CONFIG
463 # section) are produced by _LT_LIBTOOL_TAG_VARS.
464 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
465 [m4_foreach([_lt_var],
466 m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
467 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
468
469
470 # _LT_LIBTOOL_TAG_VARS(TAG)
471 # -------------------------
472 m4_define([_LT_LIBTOOL_TAG_VARS],
473 [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
474 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
475
476
477 # _LT_TAGVAR(VARNAME, [TAGNAME])
478 # ------------------------------
479 m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
480
481
482 # _LT_CONFIG_COMMANDS
483 # -------------------
484 # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
485 # variables for single and double quote escaping we saved from calls
486 # to _LT_DECL, we can put quote escaped variables declarations
487 # into `config.status', and then the shell code to quote escape them in
488 # for loops in `config.status'. Finally, any additional code accumulated
489 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
490 m4_defun([_LT_CONFIG_COMMANDS],
491 [AC_PROVIDE_IFELSE([LT_OUTPUT],
492 dnl If the libtool generation code has been placed in $CONFIG_LT,
493 dnl instead of duplicating it all over again into config.status,
494 dnl then we will have config.status run $CONFIG_LT later, so it
495 dnl needs to know what name is stored there:
496 [AC_CONFIG_COMMANDS([libtool],
497 [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
498 dnl If the libtool generation code is destined for config.status,
499 dnl expand the accumulated commands and init code now:
500 [AC_CONFIG_COMMANDS([libtool],
501 [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
502 ])#_LT_CONFIG_COMMANDS
503
504
505 # Initialize.
506 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
507 [
508
509 # The HP-UX ksh and POSIX shell print the target directory to stdout
510 # if CDPATH is set.
511 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
512
513 sed_quote_subst='$sed_quote_subst'
514 double_quote_subst='$double_quote_subst'
515 delay_variable_subst='$delay_variable_subst'
516 _LT_CONFIG_STATUS_DECLARATIONS
517 LTCC='$LTCC'
518 LTCFLAGS='$LTCFLAGS'
519 compiler='$compiler_DEFAULT'
520
521 # Quote evaled strings.
522 for var in lt_decl_all_varnames([[ \
523 ]], lt_decl_quote_varnames); do
524 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
525 *[[\\\\\\\`\\"\\\$]]*)
526 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
527 ;;
528 *)
529 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
530 ;;
531 esac
532 done
533
534 # Double-quote double-evaled strings.
535 for var in lt_decl_all_varnames([[ \
536 ]], lt_decl_dquote_varnames); do
537 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
538 *[[\\\\\\\`\\"\\\$]]*)
539 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
540 ;;
541 *)
542 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
543 ;;
544 esac
545 done
546
547 # Fix-up fallback echo if it was mangled by the above quoting rules.
548 case \$lt_ECHO in
549 *'\\\[$]0 --fallback-echo"')dnl "
550 lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
551 ;;
552 esac
553
554 _LT_OUTPUT_LIBTOOL_INIT
555 ])
556
557
558 # LT_OUTPUT
559 # ---------
560 # This macro allows early generation of the libtool script (before
561 # AC_OUTPUT is called), incase it is used in configure for compilation
562 # tests.
563 AC_DEFUN([LT_OUTPUT],
564 [: ${CONFIG_LT=./config.lt}
565 AC_MSG_NOTICE([creating $CONFIG_LT])
566 cat >"$CONFIG_LT" <<_LTEOF
567 #! $SHELL
568 # Generated by $as_me.
569 # Run this file to recreate a libtool stub with the current configuration.
570
571 lt_cl_silent=false
572 SHELL=\${CONFIG_SHELL-$SHELL}
573 _LTEOF
574
575 cat >>"$CONFIG_LT" <<\_LTEOF
576 AS_SHELL_SANITIZE
577 _AS_PREPARE
578
579 exec AS_MESSAGE_FD>&1
580 exec AS_MESSAGE_LOG_FD>>config.log
581 {
582 echo
583 AS_BOX([Running $as_me.])
584 } >&AS_MESSAGE_LOG_FD
585
586 lt_cl_help="\
587 \`$as_me' creates a local libtool stub from the current configuration,
588 for use in further configure time tests before the real libtool is
589 generated.
590
591 Usage: $[0] [[OPTIONS]]
592
593 -h, --help print this help, then exit
594 -V, --version print version number, then exit
595 -q, --quiet do not print progress messages
596 -d, --debug don't remove temporary files
597
598 Report bugs to <bug-libtool@gnu.org>."
599
600 lt_cl_version="\
601 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
602 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
603 configured by $[0], generated by m4_PACKAGE_STRING.
604
605 Copyright (C) 2008 Free Software Foundation, Inc.
606 This config.lt script is free software; the Free Software Foundation
607 gives unlimited permision to copy, distribute and modify it."
608
609 while test $[#] != 0
610 do
611 case $[1] in
612 --version | --v* | -V )
613 echo "$lt_cl_version"; exit 0 ;;
614 --help | --h* | -h )
615 echo "$lt_cl_help"; exit 0 ;;
616 --debug | --d* | -d )
617 debug=: ;;
618 --quiet | --q* | --silent | --s* | -q )
619 lt_cl_silent=: ;;
620
621 -*) AC_MSG_ERROR([unrecognized option: $[1]
622 Try \`$[0] --help' for more information.]) ;;
623
624 *) AC_MSG_ERROR([unrecognized argument: $[1]
625 Try \`$[0] --help' for more information.]) ;;
626 esac
627 shift
628 done
629
630 if $lt_cl_silent; then
631 exec AS_MESSAGE_FD>/dev/null
632 fi
633 _LTEOF
634
635 cat >>"$CONFIG_LT" <<_LTEOF
636 _LT_OUTPUT_LIBTOOL_COMMANDS_INIT
637 _LTEOF
638
639 cat >>"$CONFIG_LT" <<\_LTEOF
640 AC_MSG_NOTICE([creating $ofile])
641 _LT_OUTPUT_LIBTOOL_COMMANDS
642 AS_EXIT(0)
643 _LTEOF
644 chmod +x "$CONFIG_LT"
645
646 # configure is writing to config.log, but config.lt does its own redirection,
647 # appending to config.log, which fails on DOS, as config.log is still kept
648 # open by configure. Here we exec the FD to /dev/null, effectively closing
649 # config.log, so it can be properly (re)opened and appended to by config.lt.
650 if test "$no_create" != yes; then
651 lt_cl_success=:
652 test "$silent" = yes &&
653 lt_config_lt_args="$lt_config_lt_args --quiet"
654 exec AS_MESSAGE_LOG_FD>/dev/null
655 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
656 exec AS_MESSAGE_LOG_FD>>config.log
657 $lt_cl_success || AS_EXIT(1)
658 fi
659 ])# LT_OUTPUT
660
661
662 # _LT_CONFIG(TAG)
663 # ---------------
664 # If TAG is the built-in tag, create an initial libtool script with a
665 # default configuration from the untagged config vars. Otherwise add code
666 # to config.status for appending the configuration named by TAG from the
667 # matching tagged config vars.
668 m4_defun([_LT_CONFIG],
669 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
670 _LT_CONFIG_SAVE_COMMANDS([
671 m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
672 m4_if(_LT_TAG, [C], [
673 # See if we are running on zsh, and set the options which allow our
674 # commands through without removal of \ escapes.
675 if test -n "${ZSH_VERSION+set}" ; then
676 setopt NO_GLOB_SUBST
677 fi
678
679 cfgfile="${ofile}T"
680 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
681 $RM "$cfgfile"
682
683 cat <<_LT_EOF >> "$cfgfile"
684 #! $SHELL
685
686 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
687 # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
688 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
689 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
690 #
691 _LT_COPYING
692 _LT_LIBTOOL_TAGS
693
694 # ### BEGIN LIBTOOL CONFIG
695 _LT_LIBTOOL_CONFIG_VARS
696 _LT_LIBTOOL_TAG_VARS
697 # ### END LIBTOOL CONFIG
698
699 _LT_EOF
700
701 case $host_os in
702 aix3*)
703 cat <<\_LT_EOF >> "$cfgfile"
704 # AIX sometimes has problems with the GCC collect2 program. For some
705 # reason, if we set the COLLECT_NAMES environment variable, the problems
706 # vanish in a puff of smoke.
707 if test "X${COLLECT_NAMES+set}" != Xset; then
708 COLLECT_NAMES=
709 export COLLECT_NAMES
710 fi
711 _LT_EOF
712 ;;
713 esac
714
715 _LT_PROG_LTMAIN
716
717 # We use sed instead of cat because bash on DJGPP gets confused if
718 # if finds mixed CR/LF and LF-only lines. Since sed operates in
719 # text mode, it properly converts lines to CR/LF. This bash problem
720 # is reportedly fixed, but why not run on old versions too?
721 sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
722 || (rm -f "$cfgfile"; exit 1)
723
724 _LT_PROG_XSI_SHELLFNS
725
726 sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
727 || (rm -f "$cfgfile"; exit 1)
728
729 mv -f "$cfgfile" "$ofile" ||
730 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
731 chmod +x "$ofile"
732 ],
733 [cat <<_LT_EOF >> "$ofile"
734
735 dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
736 dnl in a comment (ie after a #).
737 # ### BEGIN LIBTOOL TAG CONFIG: $1
738 _LT_LIBTOOL_TAG_VARS(_LT_TAG)
739 # ### END LIBTOOL TAG CONFIG: $1
740 _LT_EOF
741 ])dnl /m4_if
742 ],
743 [m4_if([$1], [], [
744 PACKAGE='$PACKAGE'
745 VERSION='$VERSION'
746 TIMESTAMP='$TIMESTAMP'
747 RM='$RM'
748 ofile='$ofile'], [])
749 ])dnl /_LT_CONFIG_SAVE_COMMANDS
750 ])# _LT_CONFIG
751
752
753 # LT_SUPPORTED_TAG(TAG)
754 # ---------------------
755 # Trace this macro to discover what tags are supported by the libtool
756 # --tag option, using:
757 # autoconf --trace 'LT_SUPPORTED_TAG:$1'
758 AC_DEFUN([LT_SUPPORTED_TAG], [])
759
760
761 # C support is built-in for now
762 m4_define([_LT_LANG_C_enabled], [])
763 m4_define([_LT_TAGS], [])
764
765
766 # LT_LANG(LANG)
767 # -------------
768 # Enable libtool support for the given language if not already enabled.
769 AC_DEFUN([LT_LANG],
770 [AC_BEFORE([$0], [LT_OUTPUT])dnl
771 m4_case([$1],
772 [C], [_LT_LANG(C)],
773 [C++], [_LT_LANG(CXX)],
774 [Java], [_LT_LANG(GCJ)],
775 [Fortran 77], [_LT_LANG(F77)],
776 [Fortran], [_LT_LANG(FC)],
777 [Windows Resource], [_LT_LANG(RC)],
778 [m4_ifdef([_LT_LANG_]$1[_CONFIG],
779 [_LT_LANG($1)],
780 [m4_fatal([$0: unsupported language: "$1"])])])dnl
781 ])# LT_LANG
782
783
784 # _LT_LANG(LANGNAME)
785 # ------------------
786 m4_defun([_LT_LANG],
787 [m4_ifdef([_LT_LANG_]$1[_enabled], [],
788 [LT_SUPPORTED_TAG([$1])dnl
789 m4_append([_LT_TAGS], [$1 ])dnl
790 m4_define([_LT_LANG_]$1[_enabled], [])dnl
791 _LT_LANG_$1_CONFIG($1)])dnl
792 ])# _LT_LANG
793
794
795 # _LT_LANG_DEFAULT_CONFIG
796 # -----------------------
797 m4_defun([_LT_LANG_DEFAULT_CONFIG],
798 [AC_PROVIDE_IFELSE([AC_PROG_CXX],
799 [LT_LANG(CXX)],
800 [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
801
802 AC_PROVIDE_IFELSE([AC_PROG_F77],
803 [LT_LANG(F77)],
804 [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
805
806 AC_PROVIDE_IFELSE([AC_PROG_FC],
807 [LT_LANG(FC)],
808 [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
809
810 dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
811 dnl pulling things in needlessly.
812 AC_PROVIDE_IFELSE([AC_PROG_GCJ],
813 [LT_LANG(GCJ)],
814 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
815 [LT_LANG(GCJ)],
816 [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
817 [LT_LANG(GCJ)],
818 [m4_ifdef([AC_PROG_GCJ],
819 [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
820 m4_ifdef([A][M_PROG_GCJ],
821 [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
822 m4_ifdef([LT_PROG_GCJ],
823 [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
824
825 AC_PROVIDE_IFELSE([LT_PROG_RC],
826 [LT_LANG(RC)],
827 [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
828 ])# _LT_LANG_DEFAULT_CONFIG
829
830 # Obsolete macros:
831 AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
832 AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
833 AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
834 AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
835 dnl aclocal-1.4 backwards compatibility:
836 dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
837 dnl AC_DEFUN([AC_LIBTOOL_F77], [])
838 dnl AC_DEFUN([AC_LIBTOOL_FC], [])
839 dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
840
841
842 # _LT_TAG_COMPILER
843 # ----------------
844 m4_defun([_LT_TAG_COMPILER],
845 [AC_REQUIRE([AC_PROG_CC])dnl
846
847 _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
848 _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
849 _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
850 _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
851
852 # If no C compiler was specified, use CC.
853 LTCC=${LTCC-"$CC"}
854
855 # If no C compiler flags were specified, use CFLAGS.
856 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
857
858 # Allow CC to be a program name with arguments.
859 compiler=$CC
860 ])# _LT_TAG_COMPILER
861
862
863 # _LT_COMPILER_BOILERPLATE
864 # ------------------------
865 # Check for compiler boilerplate output or warnings with
866 # the simple compiler test code.
867 m4_defun([_LT_COMPILER_BOILERPLATE],
868 [m4_require([_LT_DECL_SED])dnl
869 ac_outfile=conftest.$ac_objext
870 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
871 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
872 _lt_compiler_boilerplate=`cat conftest.err`
873 $RM conftest*
874 ])# _LT_COMPILER_BOILERPLATE
875
876
877 # _LT_LINKER_BOILERPLATE
878 # ----------------------
879 # Check for linker boilerplate output or warnings with
880 # the simple link test code.
881 m4_defun([_LT_LINKER_BOILERPLATE],
882 [m4_require([_LT_DECL_SED])dnl
883 ac_outfile=conftest.$ac_objext
884 echo "$lt_simple_link_test_code" >conftest.$ac_ext
885 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
886 _lt_linker_boilerplate=`cat conftest.err`
887 $RM -r conftest*
888 ])# _LT_LINKER_BOILERPLATE
889
890 # _LT_REQUIRED_DARWIN_CHECKS
891 # -------------------------
892 m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
893 case $host_os in
894 rhapsody* | darwin*)
895 AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
896 AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
897 AC_CHECK_TOOL([LIPO], [lipo], [:])
898 AC_CHECK_TOOL([OTOOL], [otool], [:])
899 AC_CHECK_TOOL([OTOOL64], [otool64], [:])
900 _LT_DECL([], [DSYMUTIL], [1],
901 [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
902 _LT_DECL([], [NMEDIT], [1],
903 [Tool to change global to local symbols on Mac OS X])
904 _LT_DECL([], [LIPO], [1],
905 [Tool to manipulate fat objects and archives on Mac OS X])
906 _LT_DECL([], [OTOOL], [1],
907 [ldd/readelf like tool for Mach-O binaries on Mac OS X])
908 _LT_DECL([], [OTOOL64], [1],
909 [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
910
911 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
912 [lt_cv_apple_cc_single_mod=no
913 if test -z "${LT_MULTI_MODULE}"; then
914 # By default we will add the -single_module flag. You can override
915 # by either setting the environment variable LT_MULTI_MODULE
916 # non-empty at configure time, or by adding -multi_module to the
917 # link flags.
918 rm -rf libconftest.dylib*
919 echo "int foo(void){return 1;}" > conftest.c
920 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
921 -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
922 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
923 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
924 _lt_result=$?
925 if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
926 lt_cv_apple_cc_single_mod=yes
927 else
928 cat conftest.err >&AS_MESSAGE_LOG_FD
929 fi
930 rm -rf libconftest.dylib*
931 rm -f conftest.*
932 fi])
933 AC_CACHE_CHECK([for -exported_symbols_list linker flag],
934 [lt_cv_ld_exported_symbols_list],
935 [lt_cv_ld_exported_symbols_list=no
936 save_LDFLAGS=$LDFLAGS
937 echo "_main" > conftest.sym
938 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
939 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
940 [lt_cv_ld_exported_symbols_list=yes],
941 [lt_cv_ld_exported_symbols_list=no])
942 LDFLAGS="$save_LDFLAGS"
943 ])
944 case $host_os in
945 rhapsody* | darwin1.[[012]])
946 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
947 darwin1.*)
948 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
949 darwin*) # darwin 5.x on
950 # if running on 10.5 or later, the deployment target defaults
951 # to the OS version, if on x86, and 10.4, the deployment
952 # target defaults to 10.4. Don't you love it?
953 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
954 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
955 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
956 10.[[012]]*)
957 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
958 10.*)
959 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
960 esac
961 ;;
962 esac
963 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
964 _lt_dar_single_mod='$single_module'
965 fi
966 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
967 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
968 else
969 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
970 fi
971 if test "$DSYMUTIL" != ":"; then
972 _lt_dsymutil='~$DSYMUTIL $lib || :'
973 else
974 _lt_dsymutil=
975 fi
976 ;;
977 esac
978 ])
979
980
981 # _LT_DARWIN_LINKER_FEATURES
982 # --------------------------
983 # Checks for linker and compiler features on darwin
984 m4_defun([_LT_DARWIN_LINKER_FEATURES],
985 [
986 m4_require([_LT_REQUIRED_DARWIN_CHECKS])
987 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
988 _LT_TAGVAR(hardcode_direct, $1)=no
989 _LT_TAGVAR(hardcode_automatic, $1)=yes
990 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
991 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
992 _LT_TAGVAR(link_all_deplibs, $1)=yes
993 _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
994 case $cc_basename in
995 ifort*) _lt_dar_can_shared=yes ;;
996 *) _lt_dar_can_shared=$GCC ;;
997 esac
998 if test "$_lt_dar_can_shared" = "yes"; then
999 output_verbose_link_cmd=echo
1000 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
1001 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1002 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
1003 _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
1004 m4_if([$1], [CXX],
1005 [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1006 _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
1007 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
1008 fi
1009 ],[])
1010 else
1011 _LT_TAGVAR(ld_shlibs, $1)=no
1012 fi
1013 ])
1014
1015 # _LT_SYS_MODULE_PATH_AIX
1016 # -----------------------
1017 # Links a minimal program and checks the executable
1018 # for the system default hardcoded library path. In most cases,
1019 # this is /usr/lib:/lib, but when the MPI compilers are used
1020 # the location of the communication and MPI libs are included too.
1021 # If we don't find anything, use the default library path according
1022 # to the aix ld manual.
1023 m4_defun([_LT_SYS_MODULE_PATH_AIX],
1024 [m4_require([_LT_DECL_SED])dnl
1025 AC_LINK_IFELSE(AC_LANG_PROGRAM,[
1026 lt_aix_libpath_sed='
1027 /Import File Strings/,/^$/ {
1028 /^0/ {
1029 s/^0 *\(.*\)$/\1/
1030 p
1031 }
1032 }'
1033 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1034 # Check for a 64-bit object if we didn't find anything.
1035 if test -z "$aix_libpath"; then
1036 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1037 fi],[])
1038 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1039 ])# _LT_SYS_MODULE_PATH_AIX
1040
1041
1042 # _LT_SHELL_INIT(ARG)
1043 # -------------------
1044 m4_define([_LT_SHELL_INIT],
1045 [ifdef([AC_DIVERSION_NOTICE],
1046 [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1047 [AC_DIVERT_PUSH(NOTICE)])
1048 $1
1049 AC_DIVERT_POP
1050 ])# _LT_SHELL_INIT
1051
1052
1053 # _LT_PROG_ECHO_BACKSLASH
1054 # -----------------------
1055 # Add some code to the start of the generated configure script which
1056 # will find an echo command which doesn't interpret backslashes.
1057 m4_defun([_LT_PROG_ECHO_BACKSLASH],
1058 [_LT_SHELL_INIT([
1059 # Check that we are running under the correct shell.
1060 SHELL=${CONFIG_SHELL-/bin/sh}
1061
1062 case X$lt_ECHO in
1063 X*--fallback-echo)
1064 # Remove one level of quotation (which was required for Make).
1065 ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1066 ;;
1067 esac
1068
1069 ECHO=${lt_ECHO-echo}
1070 if test "X[$]1" = X--no-reexec; then
1071 # Discard the --no-reexec flag, and continue.
1072 shift
1073 elif test "X[$]1" = X--fallback-echo; then
1074 # Avoid inline document here, it may be left over
1075 :
1076 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
1077 # Yippee, $ECHO works!
1078 :
1079 else
1080 # Restart under the correct shell.
1081 exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1082 fi
1083
1084 if test "X[$]1" = X--fallback-echo; then
1085 # used as fallback echo
1086 shift
1087 cat <<_LT_EOF
1088 [$]*
1089 _LT_EOF
1090 exit 0
1091 fi
1092
1093 # The HP-UX ksh and POSIX shell print the target directory to stdout
1094 # if CDPATH is set.
1095 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1096
1097 if test -z "$lt_ECHO"; then
1098 if test "X${echo_test_string+set}" != Xset; then
1099 # find a string as large as possible, as long as the shell can cope with it
1100 for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1101 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1102 if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
1103 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
1104 then
1105 break
1106 fi
1107 done
1108 fi
1109
1110 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1111 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1112 test "X$echo_testing_string" = "X$echo_test_string"; then
1113 :
1114 else
1115 # The Solaris, AIX, and Digital Unix default echo programs unquote
1116 # backslashes. This makes it impossible to quote backslashes using
1117 # echo "$something" | sed 's/\\/\\\\/g'
1118 #
1119 # So, first we look for a working echo in the user's PATH.
1120
1121 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1122 for dir in $PATH /usr/ucb; do
1123 IFS="$lt_save_ifs"
1124 if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1125 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1126 echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1127 test "X$echo_testing_string" = "X$echo_test_string"; then
1128 ECHO="$dir/echo"
1129 break
1130 fi
1131 done
1132 IFS="$lt_save_ifs"
1133
1134 if test "X$ECHO" = Xecho; then
1135 # We didn't find a better echo, so look for alternatives.
1136 if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
1137 echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
1138 test "X$echo_testing_string" = "X$echo_test_string"; then
1139 # This shell has a builtin print -r that does the trick.
1140 ECHO='print -r'
1141 elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
1142 test "X$CONFIG_SHELL" != X/bin/ksh; then
1143 # If we have ksh, try running configure again with it.
1144 ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1145 export ORIGINAL_CONFIG_SHELL
1146 CONFIG_SHELL=/bin/ksh
1147 export CONFIG_SHELL
1148 exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1149 else
1150 # Try using printf.
1151 ECHO='printf %s\n'
1152 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1153 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1154 test "X$echo_testing_string" = "X$echo_test_string"; then
1155 # Cool, printf works
1156 :
1157 elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1158 test "X$echo_testing_string" = 'X\t' &&
1159 echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1160 test "X$echo_testing_string" = "X$echo_test_string"; then
1161 CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1162 export CONFIG_SHELL
1163 SHELL="$CONFIG_SHELL"
1164 export SHELL
1165 ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1166 elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1167 test "X$echo_testing_string" = 'X\t' &&
1168 echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1169 test "X$echo_testing_string" = "X$echo_test_string"; then
1170 ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1171 else
1172 # maybe with a smaller string...
1173 prev=:
1174
1175 for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1176 if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
1177 then
1178 break
1179 fi
1180 prev="$cmd"
1181 done
1182
1183 if test "$prev" != 'sed 50q "[$]0"'; then
1184 echo_test_string=`eval $prev`
1185 export echo_test_string
1186 exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1187 else
1188 # Oops. We lost completely, so just stick with echo.
1189 ECHO=echo
1190 fi
1191 fi
1192 fi
1193 fi
1194 fi
1195 fi
1196
1197 # Copy echo and quote the copy suitably for passing to libtool from
1198 # the Makefile, instead of quoting the original, which is used later.
1199 lt_ECHO=$ECHO
1200 if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1201 lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1202 fi
1203
1204 AC_SUBST(lt_ECHO)
1205 ])
1206 _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1207 _LT_DECL([], [ECHO], [1],
1208 [An echo program that does not interpret backslashes])
1209 ])# _LT_PROG_ECHO_BACKSLASH
1210
1211
1212 # _LT_ENABLE_LOCK
1213 # ---------------
1214 m4_defun([_LT_ENABLE_LOCK],
1215 [AC_ARG_ENABLE([libtool-lock],
1216 [AS_HELP_STRING([--disable-libtool-lock],
1217 [avoid locking (might break parallel builds)])])
1218 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1219
1220 # Some flags need to be propagated to the compiler or linker for good
1221 # libtool support.
1222 case $host in
1223 ia64-*-hpux*)
1224 # Find out which ABI we are using.
1225 echo 'int i;' > conftest.$ac_ext
1226 if AC_TRY_EVAL(ac_compile); then
1227 case `/usr/bin/file conftest.$ac_objext` in
1228 *ELF-32*)
1229 HPUX_IA64_MODE="32"
1230 ;;
1231 *ELF-64*)
1232 HPUX_IA64_MODE="64"
1233 ;;
1234 esac
1235 fi
1236 rm -rf conftest*
1237 ;;
1238 *-*-irix6*)
1239 # Find out which ABI we are using.
1240 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1241 if AC_TRY_EVAL(ac_compile); then
1242 if test "$lt_cv_prog_gnu_ld" = yes; then
1243 case `/usr/bin/file conftest.$ac_objext` in
1244 *32-bit*)
1245 LD="${LD-ld} -melf32bsmip"
1246 ;;
1247 *N32*)
1248 LD="${LD-ld} -melf32bmipn32"
1249 ;;
1250 *64-bit*)
1251 LD="${LD-ld} -melf64bmip"
1252 ;;
1253 esac
1254 else
1255 case `/usr/bin/file conftest.$ac_objext` in
1256 *32-bit*)
1257 LD="${LD-ld} -32"
1258 ;;
1259 *N32*)
1260 LD="${LD-ld} -n32"
1261 ;;
1262 *64-bit*)
1263 LD="${LD-ld} -64"
1264 ;;
1265 esac
1266 fi
1267 fi
1268 rm -rf conftest*
1269 ;;
1270
1271 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1272 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1273 # Find out which ABI we are using.
1274 echo 'int i;' > conftest.$ac_ext
1275 if AC_TRY_EVAL(ac_compile); then
1276 case `/usr/bin/file conftest.o` in
1277 *32-bit*)
1278 case $host in
1279 x86_64-*kfreebsd*-gnu)
1280 LD="${LD-ld} -m elf_i386_fbsd"
1281 ;;
1282 x86_64-*linux*)
1283 LD="${LD-ld} -m elf_i386"
1284 ;;
1285 ppc64-*linux*|powerpc64-*linux*)
1286 LD="${LD-ld} -m elf32ppclinux"
1287 ;;
1288 s390x-*linux*)
1289 LD="${LD-ld} -m elf_s390"
1290 ;;
1291 sparc64-*linux*)
1292 LD="${LD-ld} -m elf32_sparc"
1293 ;;
1294 esac
1295 ;;
1296 *64-bit*)
1297 case $host in
1298 x86_64-*kfreebsd*-gnu)
1299 LD="${LD-ld} -m elf_x86_64_fbsd"
1300 ;;
1301 x86_64-*linux*)
1302 LD="${LD-ld} -m elf_x86_64"
1303 ;;
1304 powerpc64le-*linux*)
1305 LD="${LD-ld} -m elf64lppc"
1306 ;;
1307 powerpc64-*linux*)
1308 LD="${LD-ld} -m elf64ppc"
1309 ;;
1310 s390*-*linux*|s390*-*tpf*)
1311 LD="${LD-ld} -m elf64_s390"
1312 ;;
1313 sparc*-*linux*)
1314 LD="${LD-ld} -m elf64_sparc"
1315 ;;
1316 esac
1317 ;;
1318 esac
1319 fi
1320 rm -rf conftest*
1321 ;;
1322
1323 *-*-sco3.2v5*)
1324 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1325 SAVE_CFLAGS="$CFLAGS"
1326 CFLAGS="$CFLAGS -belf"
1327 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1328 [AC_LANG_PUSH(C)
1329 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1330 AC_LANG_POP])
1331 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1332 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1333 CFLAGS="$SAVE_CFLAGS"
1334 fi
1335 ;;
1336 sparc*-*solaris*)
1337 # Find out which ABI we are using.
1338 echo 'int i;' > conftest.$ac_ext
1339 if AC_TRY_EVAL(ac_compile); then
1340 case `/usr/bin/file conftest.o` in
1341 *64-bit*)
1342 case $lt_cv_prog_gnu_ld in
1343 yes*) LD="${LD-ld} -m elf64_sparc" ;;
1344 *)
1345 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1346 LD="${LD-ld} -64"
1347 fi
1348 ;;
1349 esac
1350 ;;
1351 esac
1352 fi
1353 rm -rf conftest*
1354 ;;
1355 esac
1356
1357 need_locks="$enable_libtool_lock"
1358 ])# _LT_ENABLE_LOCK
1359
1360
1361 # _LT_CMD_OLD_ARCHIVE
1362 # -------------------
1363 m4_defun([_LT_CMD_OLD_ARCHIVE],
1364 [AC_CHECK_TOOL(AR, ar, false)
1365 test -z "$AR" && AR=ar
1366 test -z "$AR_FLAGS" && AR_FLAGS=cru
1367 _LT_DECL([], [AR], [1], [The archiver])
1368 _LT_DECL([], [AR_FLAGS], [1])
1369
1370 AC_CHECK_TOOL(STRIP, strip, :)
1371 test -z "$STRIP" && STRIP=:
1372 _LT_DECL([], [STRIP], [1], [A symbol stripping program])
1373
1374 AC_CHECK_TOOL(RANLIB, ranlib, :)
1375 test -z "$RANLIB" && RANLIB=:
1376 _LT_DECL([], [RANLIB], [1],
1377 [Commands used to install an old-style archive])
1378
1379 # Determine commands to create old-style static archives.
1380 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1381 old_postinstall_cmds='chmod 644 $oldlib'
1382 old_postuninstall_cmds=
1383
1384 if test -n "$RANLIB"; then
1385 case $host_os in
1386 openbsd*)
1387 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1388 ;;
1389 *)
1390 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1391 ;;
1392 esac
1393 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1394 fi
1395 _LT_DECL([], [old_postinstall_cmds], [2])
1396 _LT_DECL([], [old_postuninstall_cmds], [2])
1397 _LT_TAGDECL([], [old_archive_cmds], [2],
1398 [Commands used to build an old-style archive])
1399 ])# _LT_CMD_OLD_ARCHIVE
1400
1401
1402 # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1403 # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1404 # ----------------------------------------------------------------
1405 # Check whether the given compiler option works
1406 AC_DEFUN([_LT_COMPILER_OPTION],
1407 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1408 m4_require([_LT_DECL_SED])dnl
1409 AC_CACHE_CHECK([$1], [$2],
1410 [$2=no
1411 m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1412 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1413 lt_compiler_flag="$3"
1414 # Insert the option either (1) after the last *FLAGS variable, or
1415 # (2) before a word containing "conftest.", or (3) at the end.
1416 # Note that $ac_compile itself does not contain backslashes and begins
1417 # with a dollar sign (not a hyphen), so the echo should work correctly.
1418 # The option is referenced via a variable to avoid confusing sed.
1419 lt_compile=`echo "$ac_compile" | $SED \
1420 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1421 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1422 -e 's:$: $lt_compiler_flag:'`
1423 (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1424 (eval "$lt_compile" 2>conftest.err)
1425 ac_status=$?
1426 cat conftest.err >&AS_MESSAGE_LOG_FD
1427 echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1428 if (exit $ac_status) && test -s "$ac_outfile"; then
1429 # The compiler can only warn and ignore the option if not recognized
1430 # So say no if there are warnings other than the usual output.
1431 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
1432 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1433 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1434 $2=yes
1435 fi
1436 fi
1437 $RM conftest*
1438 ])
1439
1440 if test x"[$]$2" = xyes; then
1441 m4_if([$5], , :, [$5])
1442 else
1443 m4_if([$6], , :, [$6])
1444 fi
1445 ])# _LT_COMPILER_OPTION
1446
1447 # Old name:
1448 AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1449 dnl aclocal-1.4 backwards compatibility:
1450 dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1451
1452
1453 # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1454 # [ACTION-SUCCESS], [ACTION-FAILURE])
1455 # ----------------------------------------------------
1456 # Check whether the given linker option works
1457 AC_DEFUN([_LT_LINKER_OPTION],
1458 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1459 m4_require([_LT_DECL_SED])dnl
1460 AC_CACHE_CHECK([$1], [$2],
1461 [$2=no
1462 save_LDFLAGS="$LDFLAGS"
1463 LDFLAGS="$LDFLAGS $3"
1464 echo "$lt_simple_link_test_code" > conftest.$ac_ext
1465 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1466 # The linker can only warn and ignore the option if not recognized
1467 # So say no if there are warnings
1468 if test -s conftest.err; then
1469 # Append any errors to the config.log.
1470 cat conftest.err 1>&AS_MESSAGE_LOG_FD
1471 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
1472 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1473 if diff conftest.exp conftest.er2 >/dev/null; then
1474 $2=yes
1475 fi
1476 else
1477 $2=yes
1478 fi
1479 fi
1480 $RM -r conftest*
1481 LDFLAGS="$save_LDFLAGS"
1482 ])
1483
1484 if test x"[$]$2" = xyes; then
1485 m4_if([$4], , :, [$4])
1486 else
1487 m4_if([$5], , :, [$5])
1488 fi
1489 ])# _LT_LINKER_OPTION
1490
1491 # Old name:
1492 AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1493 dnl aclocal-1.4 backwards compatibility:
1494 dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1495
1496
1497 # LT_CMD_MAX_LEN
1498 #---------------
1499 AC_DEFUN([LT_CMD_MAX_LEN],
1500 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1501 # find the maximum length of command line arguments
1502 AC_MSG_CHECKING([the maximum length of command line arguments])
1503 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1504 i=0
1505 teststring="ABCD"
1506
1507 case $build_os in
1508 msdosdjgpp*)
1509 # On DJGPP, this test can blow up pretty badly due to problems in libc
1510 # (any single argument exceeding 2000 bytes causes a buffer overrun
1511 # during glob expansion). Even if it were fixed, the result of this
1512 # check would be larger than it should be.
1513 lt_cv_sys_max_cmd_len=12288; # 12K is about right
1514 ;;
1515
1516 gnu*)
1517 # Under GNU Hurd, this test is not required because there is
1518 # no limit to the length of command line arguments.
1519 # Libtool will interpret -1 as no limit whatsoever
1520 lt_cv_sys_max_cmd_len=-1;
1521 ;;
1522
1523 cygwin* | mingw* | cegcc*)
1524 # On Win9x/ME, this test blows up -- it succeeds, but takes
1525 # about 5 minutes as the teststring grows exponentially.
1526 # Worse, since 9x/ME are not pre-emptively multitasking,
1527 # you end up with a "frozen" computer, even though with patience
1528 # the test eventually succeeds (with a max line length of 256k).
1529 # Instead, let's just punt: use the minimum linelength reported by
1530 # all of the supported platforms: 8192 (on NT/2K/XP).
1531 lt_cv_sys_max_cmd_len=8192;
1532 ;;
1533
1534 beos*)
1535 # On BeOS, this test takes a really really long time.
1536 # So we just punt and use a minimum line length of 8192.
1537 lt_cv_sys_max_cmd_len=8192;
1538 ;;
1539
1540 amigaos*)
1541 # On AmigaOS with pdksh, this test takes hours, literally.
1542 # So we just punt and use a minimum line length of 8192.
1543 lt_cv_sys_max_cmd_len=8192;
1544 ;;
1545
1546 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1547 # This has been around since 386BSD, at least. Likely further.
1548 if test -x /sbin/sysctl; then
1549 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1550 elif test -x /usr/sbin/sysctl; then
1551 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1552 else
1553 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
1554 fi
1555 # And add a safety zone
1556 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1557 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1558 ;;
1559
1560 interix*)
1561 # We know the value 262144 and hardcode it with a safety zone (like BSD)
1562 lt_cv_sys_max_cmd_len=196608
1563 ;;
1564
1565 osf*)
1566 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1567 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1568 # nice to cause kernel panics so lets avoid the loop below.
1569 # First set a reasonable default.
1570 lt_cv_sys_max_cmd_len=16384
1571 #
1572 if test -x /sbin/sysconfig; then
1573 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1574 *1*) lt_cv_sys_max_cmd_len=-1 ;;
1575 esac
1576 fi
1577 ;;
1578 sco3.2v5*)
1579 lt_cv_sys_max_cmd_len=102400
1580 ;;
1581 sysv5* | sco5v6* | sysv4.2uw2*)
1582 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1583 if test -n "$kargmax"; then
1584 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
1585 else
1586 lt_cv_sys_max_cmd_len=32768
1587 fi
1588 ;;
1589 *)
1590 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1591 if test -n "$lt_cv_sys_max_cmd_len"; then
1592 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1593 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1594 else
1595 # Make teststring a little bigger before we do anything with it.
1596 # a 1K string should be a reasonable start.
1597 for i in 1 2 3 4 5 6 7 8 ; do
1598 teststring=$teststring$teststring
1599 done
1600 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1601 # If test is not a shell built-in, we'll probably end up computing a
1602 # maximum length that is only half of the actual maximum length, but
1603 # we can't tell.
1604 while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
1605 = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
1606 test $i != 17 # 1/2 MB should be enough
1607 do
1608 i=`expr $i + 1`
1609 teststring=$teststring$teststring
1610 done
1611 # Only check the string length outside the loop.
1612 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1613 teststring=
1614 # Add a significant safety factor because C++ compilers can tack on
1615 # massive amounts of additional arguments before passing them to the
1616 # linker. It appears as though 1/2 is a usable value.
1617 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1618 fi
1619 ;;
1620 esac
1621 ])
1622 if test -n $lt_cv_sys_max_cmd_len ; then
1623 AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1624 else
1625 AC_MSG_RESULT(none)
1626 fi
1627 max_cmd_len=$lt_cv_sys_max_cmd_len
1628 _LT_DECL([], [max_cmd_len], [0],
1629 [What is the maximum length of a command?])
1630 ])# LT_CMD_MAX_LEN
1631
1632 # Old name:
1633 AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1634 dnl aclocal-1.4 backwards compatibility:
1635 dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1636
1637
1638 # _LT_HEADER_DLFCN
1639 # ----------------
1640 m4_defun([_LT_HEADER_DLFCN],
1641 [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1642 ])# _LT_HEADER_DLFCN
1643
1644
1645 # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1646 # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1647 # ----------------------------------------------------------------
1648 m4_defun([_LT_TRY_DLOPEN_SELF],
1649 [m4_require([_LT_HEADER_DLFCN])dnl
1650 if test "$cross_compiling" = yes; then :
1651 [$4]
1652 else
1653 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1654 lt_status=$lt_dlunknown
1655 cat > conftest.$ac_ext <<_LT_EOF
1656 [#line __oline__ "configure"
1657 #include "confdefs.h"
1658
1659 #if HAVE_DLFCN_H
1660 #include <dlfcn.h>
1661 #endif
1662
1663 #include <stdio.h>
1664
1665 #ifdef RTLD_GLOBAL
1666 # define LT_DLGLOBAL RTLD_GLOBAL
1667 #else
1668 # ifdef DL_GLOBAL
1669 # define LT_DLGLOBAL DL_GLOBAL
1670 # else
1671 # define LT_DLGLOBAL 0
1672 # endif
1673 #endif
1674
1675 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1676 find out it does not work in some platform. */
1677 #ifndef LT_DLLAZY_OR_NOW
1678 # ifdef RTLD_LAZY
1679 # define LT_DLLAZY_OR_NOW RTLD_LAZY
1680 # else
1681 # ifdef DL_LAZY
1682 # define LT_DLLAZY_OR_NOW DL_LAZY
1683 # else
1684 # ifdef RTLD_NOW
1685 # define LT_DLLAZY_OR_NOW RTLD_NOW
1686 # else
1687 # ifdef DL_NOW
1688 # define LT_DLLAZY_OR_NOW DL_NOW
1689 # else
1690 # define LT_DLLAZY_OR_NOW 0
1691 # endif
1692 # endif
1693 # endif
1694 # endif
1695 #endif
1696
1697 void fnord() { int i=42;}
1698 int main ()
1699 {
1700 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1701 int status = $lt_dlunknown;
1702
1703 if (self)
1704 {
1705 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
1706 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1707 /* dlclose (self); */
1708 }
1709 else
1710 puts (dlerror ());
1711
1712 return status;
1713 }]
1714 _LT_EOF
1715 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1716 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1717 lt_status=$?
1718 case x$lt_status in
1719 x$lt_dlno_uscore) $1 ;;
1720 x$lt_dlneed_uscore) $2 ;;
1721 x$lt_dlunknown|x*) $3 ;;
1722 esac
1723 else :
1724 # compilation failed
1725 $3
1726 fi
1727 fi
1728 rm -fr conftest*
1729 ])# _LT_TRY_DLOPEN_SELF
1730
1731
1732 # LT_SYS_DLOPEN_SELF
1733 # ------------------
1734 AC_DEFUN([LT_SYS_DLOPEN_SELF],
1735 [m4_require([_LT_HEADER_DLFCN])dnl
1736 if test "x$enable_dlopen" != xyes; then
1737 enable_dlopen=unknown
1738 enable_dlopen_self=unknown
1739 enable_dlopen_self_static=unknown
1740 else
1741 lt_cv_dlopen=no
1742 lt_cv_dlopen_libs=
1743
1744 case $host_os in
1745 beos*)
1746 lt_cv_dlopen="load_add_on"
1747 lt_cv_dlopen_libs=
1748 lt_cv_dlopen_self=yes
1749 ;;
1750
1751 mingw* | pw32* | cegcc*)
1752 lt_cv_dlopen="LoadLibrary"
1753 lt_cv_dlopen_libs=
1754 ;;
1755
1756 cygwin*)
1757 lt_cv_dlopen="dlopen"
1758 lt_cv_dlopen_libs=
1759 ;;
1760
1761 darwin*)
1762 # if libdl is installed we need to link against it
1763 AC_CHECK_LIB([dl], [dlopen],
1764 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1765 lt_cv_dlopen="dyld"
1766 lt_cv_dlopen_libs=
1767 lt_cv_dlopen_self=yes
1768 ])
1769 ;;
1770
1771 *)
1772 AC_CHECK_FUNC([shl_load],
1773 [lt_cv_dlopen="shl_load"],
1774 [AC_CHECK_LIB([dld], [shl_load],
1775 [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1776 [AC_CHECK_FUNC([dlopen],
1777 [lt_cv_dlopen="dlopen"],
1778 [AC_CHECK_LIB([dl], [dlopen],
1779 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1780 [AC_CHECK_LIB([svld], [dlopen],
1781 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1782 [AC_CHECK_LIB([dld], [dld_link],
1783 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1784 ])
1785 ])
1786 ])
1787 ])
1788 ])
1789 ;;
1790 esac
1791
1792 if test "x$lt_cv_dlopen" != xno; then
1793 enable_dlopen=yes
1794 else
1795 enable_dlopen=no
1796 fi
1797
1798 case $lt_cv_dlopen in
1799 dlopen)
1800 save_CPPFLAGS="$CPPFLAGS"
1801 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1802
1803 save_LDFLAGS="$LDFLAGS"
1804 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1805
1806 save_LIBS="$LIBS"
1807 LIBS="$lt_cv_dlopen_libs $LIBS"
1808
1809 AC_CACHE_CHECK([whether a program can dlopen itself],
1810 lt_cv_dlopen_self, [dnl
1811 _LT_TRY_DLOPEN_SELF(
1812 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1813 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1814 ])
1815
1816 if test "x$lt_cv_dlopen_self" = xyes; then
1817 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1818 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1819 lt_cv_dlopen_self_static, [dnl
1820 _LT_TRY_DLOPEN_SELF(
1821 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1822 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
1823 ])
1824 fi
1825
1826 CPPFLAGS="$save_CPPFLAGS"
1827 LDFLAGS="$save_LDFLAGS"
1828 LIBS="$save_LIBS"
1829 ;;
1830 esac
1831
1832 case $lt_cv_dlopen_self in
1833 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1834 *) enable_dlopen_self=unknown ;;
1835 esac
1836
1837 case $lt_cv_dlopen_self_static in
1838 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1839 *) enable_dlopen_self_static=unknown ;;
1840 esac
1841 fi
1842 _LT_DECL([dlopen_support], [enable_dlopen], [0],
1843 [Whether dlopen is supported])
1844 _LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1845 [Whether dlopen of programs is supported])
1846 _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1847 [Whether dlopen of statically linked programs is supported])
1848 ])# LT_SYS_DLOPEN_SELF
1849
1850 # Old name:
1851 AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1852 dnl aclocal-1.4 backwards compatibility:
1853 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1854
1855
1856 # _LT_COMPILER_C_O([TAGNAME])
1857 # ---------------------------
1858 # Check to see if options -c and -o are simultaneously supported by compiler.
1859 # This macro does not hard code the compiler like AC_PROG_CC_C_O.
1860 m4_defun([_LT_COMPILER_C_O],
1861 [m4_require([_LT_DECL_SED])dnl
1862 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1863 m4_require([_LT_TAG_COMPILER])dnl
1864 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1865 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1866 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1867 $RM -r conftest 2>/dev/null
1868 mkdir conftest
1869 cd conftest
1870 mkdir out
1871 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1872
1873 lt_compiler_flag="-o out/conftest2.$ac_objext"
1874 # Insert the option either (1) after the last *FLAGS variable, or
1875 # (2) before a word containing "conftest.", or (3) at the end.
1876 # Note that $ac_compile itself does not contain backslashes and begins
1877 # with a dollar sign (not a hyphen), so the echo should work correctly.
1878 lt_compile=`echo "$ac_compile" | $SED \
1879 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1880 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1881 -e 's:$: $lt_compiler_flag:'`
1882 (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1883 (eval "$lt_compile" 2>out/conftest.err)
1884 ac_status=$?
1885 cat out/conftest.err >&AS_MESSAGE_LOG_FD
1886 echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1887 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1888 then
1889 # The compiler can only warn and ignore the option if not recognized
1890 # So say no if there are warnings
1891 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1892 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1893 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1894 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1895 fi
1896 fi
1897 chmod u+w . 2>&AS_MESSAGE_LOG_FD
1898 $RM conftest*
1899 # SGI C++ compiler will create directory out/ii_files/ for
1900 # template instantiation
1901 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
1902 $RM out/* && rmdir out
1903 cd ..
1904 $RM -r conftest
1905 $RM conftest*
1906 ])
1907 _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
1908 [Does compiler simultaneously support -c and -o options?])
1909 ])# _LT_COMPILER_C_O
1910
1911
1912 # _LT_COMPILER_FILE_LOCKS([TAGNAME])
1913 # ----------------------------------
1914 # Check to see if we can do hard links to lock some files if needed
1915 m4_defun([_LT_COMPILER_FILE_LOCKS],
1916 [m4_require([_LT_ENABLE_LOCK])dnl
1917 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1918 _LT_COMPILER_C_O([$1])
1919
1920 hard_links="nottested"
1921 if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1922 # do not overwrite the value of need_locks provided by the user
1923 AC_MSG_CHECKING([if we can lock with hard links])
1924 hard_links=yes
1925 $RM conftest*
1926 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1927 touch conftest.a
1928 ln conftest.a conftest.b 2>&5 || hard_links=no
1929 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1930 AC_MSG_RESULT([$hard_links])
1931 if test "$hard_links" = no; then
1932 AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1933 need_locks=warn
1934 fi
1935 else
1936 need_locks=no
1937 fi
1938 _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
1939 ])# _LT_COMPILER_FILE_LOCKS
1940
1941
1942 # _LT_CHECK_OBJDIR
1943 # ----------------
1944 m4_defun([_LT_CHECK_OBJDIR],
1945 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1946 [rm -f .libs 2>/dev/null
1947 mkdir .libs 2>/dev/null
1948 if test -d .libs; then
1949 lt_cv_objdir=.libs
1950 else
1951 # MS-DOS does not allow filenames that begin with a dot.
1952 lt_cv_objdir=_libs
1953 fi
1954 rmdir .libs 2>/dev/null])
1955 objdir=$lt_cv_objdir
1956 _LT_DECL([], [objdir], [0],
1957 [The name of the directory that contains temporary libtool files])dnl
1958 m4_pattern_allow([LT_OBJDIR])dnl
1959 AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
1960 [Define to the sub-directory in which libtool stores uninstalled libraries.])
1961 ])# _LT_CHECK_OBJDIR
1962
1963
1964 # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
1965 # --------------------------------------
1966 # Check hardcoding attributes.
1967 m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
1968 [AC_MSG_CHECKING([how to hardcode library paths into programs])
1969 _LT_TAGVAR(hardcode_action, $1)=
1970 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
1971 test -n "$_LT_TAGVAR(runpath_var, $1)" ||
1972 test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1973
1974 # We can hardcode non-existent directories.
1975 if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
1976 # If the only mechanism to avoid hardcoding is shlibpath_var, we
1977 # have to relink, otherwise we might link with an installed library
1978 # when we should be linking with a yet-to-be-installed one
1979 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1980 test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
1981 # Linking always hardcodes the temporary library directory.
1982 _LT_TAGVAR(hardcode_action, $1)=relink
1983 else
1984 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1985 _LT_TAGVAR(hardcode_action, $1)=immediate
1986 fi
1987 else
1988 # We cannot hardcode anything, or else we can only hardcode existing
1989 # directories.
1990 _LT_TAGVAR(hardcode_action, $1)=unsupported
1991 fi
1992 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
1993
1994 if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
1995 test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
1996 # Fast installation is not supported
1997 enable_fast_install=no
1998 elif test "$shlibpath_overrides_runpath" = yes ||
1999 test "$enable_shared" = no; then
2000 # Fast installation is not necessary
2001 enable_fast_install=needless
2002 fi
2003 _LT_TAGDECL([], [hardcode_action], [0],
2004 [How to hardcode a shared library path into an executable])
2005 ])# _LT_LINKER_HARDCODE_LIBPATH
2006
2007
2008 # _LT_CMD_STRIPLIB
2009 # ----------------
2010 m4_defun([_LT_CMD_STRIPLIB],
2011 [m4_require([_LT_DECL_EGREP])
2012 striplib=
2013 old_striplib=
2014 AC_MSG_CHECKING([whether stripping libraries is possible])
2015 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2016 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2017 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2018 AC_MSG_RESULT([yes])
2019 else
2020 # FIXME - insert some real tests, host_os isn't really good enough
2021 case $host_os in
2022 darwin*)
2023 if test -n "$STRIP" ; then
2024 striplib="$STRIP -x"
2025 old_striplib="$STRIP -S"
2026 AC_MSG_RESULT([yes])
2027 else
2028 AC_MSG_RESULT([no])
2029 fi
2030 ;;
2031 *)
2032 AC_MSG_RESULT([no])
2033 ;;
2034 esac
2035 fi
2036 _LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2037 _LT_DECL([], [striplib], [1])
2038 ])# _LT_CMD_STRIPLIB
2039
2040
2041 # _LT_SYS_DYNAMIC_LINKER([TAG])
2042 # -----------------------------
2043 # PORTME Fill in your ld.so characteristics
2044 m4_defun([_LT_SYS_DYNAMIC_LINKER],
2045 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2046 m4_require([_LT_DECL_EGREP])dnl
2047 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2048 m4_require([_LT_DECL_OBJDUMP])dnl
2049 m4_require([_LT_DECL_SED])dnl
2050 AC_MSG_CHECKING([dynamic linker characteristics])
2051 m4_if([$1],
2052 [], [
2053 if test "$GCC" = yes; then
2054 case $host_os in
2055 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2056 *) lt_awk_arg="/^libraries:/" ;;
2057 esac
2058 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2059 if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
2060 # if the path contains ";" then we assume it to be the separator
2061 # otherwise default to the standard path separator (i.e. ":") - it is
2062 # assumed that no part of a normal pathname contains ";" but that should
2063 # okay in the real world where ";" in dirpaths is itself problematic.
2064 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
2065 else
2066 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2067 fi
2068 # Ok, now we have the path, separated by spaces, we can step through it
2069 # and add multilib dir if necessary.
2070 lt_tmp_lt_search_path_spec=
2071 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2072 for lt_sys_path in $lt_search_path_spec; do
2073 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2074 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2075 else
2076 test -d "$lt_sys_path" && \
2077 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2078 fi
2079 done
2080 lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
2081 BEGIN {RS=" "; FS="/|\n";} {
2082 lt_foo="";
2083 lt_count=0;
2084 for (lt_i = NF; lt_i > 0; lt_i--) {
2085 if ($lt_i != "" && $lt_i != ".") {
2086 if ($lt_i == "..") {
2087 lt_count++;
2088 } else {
2089 if (lt_count == 0) {
2090 lt_foo="/" $lt_i lt_foo;
2091 } else {
2092 lt_count--;
2093 }
2094 }
2095 }
2096 }
2097 if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2098 if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2099 }'`
2100 sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
2101 else
2102 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2103 fi])
2104 library_names_spec=
2105 libname_spec='lib$name'
2106 soname_spec=
2107 shrext_cmds=".so"
2108 postinstall_cmds=
2109 postuninstall_cmds=
2110 finish_cmds=
2111 finish_eval=
2112 shlibpath_var=
2113 shlibpath_overrides_runpath=unknown
2114 version_type=none
2115 dynamic_linker="$host_os ld.so"
2116 sys_lib_dlsearch_path_spec="/lib /usr/lib"
2117 need_lib_prefix=unknown
2118 hardcode_into_libs=no
2119
2120 # when you set need_version to no, make sure it does not cause -set_version
2121 # flags to be left without arguments
2122 need_version=unknown
2123
2124 case $host_os in
2125 aix3*)
2126 version_type=linux
2127 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2128 shlibpath_var=LIBPATH
2129
2130 # AIX 3 has no versioning support, so we append a major version to the name.
2131 soname_spec='${libname}${release}${shared_ext}$major'
2132 ;;
2133
2134 aix[[4-9]]*)
2135 version_type=linux
2136 need_lib_prefix=no
2137 need_version=no
2138 hardcode_into_libs=yes
2139 if test "$host_cpu" = ia64; then
2140 # AIX 5 supports IA64
2141 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2142 shlibpath_var=LD_LIBRARY_PATH
2143 else
2144 # With GCC up to 2.95.x, collect2 would create an import file
2145 # for dependence libraries. The import file would start with
2146 # the line `#! .'. This would cause the generated library to
2147 # depend on `.', always an invalid library. This was fixed in
2148 # development snapshots of GCC prior to 3.0.
2149 case $host_os in
2150 aix4 | aix4.[[01]] | aix4.[[01]].*)
2151 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2152 echo ' yes '
2153 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2154 :
2155 else
2156 can_build_shared=no
2157 fi
2158 ;;
2159 esac
2160 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2161 # soname into executable. Probably we can add versioning support to
2162 # collect2, so additional links can be useful in future.
2163 if test "$aix_use_runtimelinking" = yes; then
2164 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2165 # instead of lib<name>.a to let people know that these are not
2166 # typical AIX shared libraries.
2167 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2168 else
2169 # We preserve .a as extension for shared libraries through AIX4.2
2170 # and later when we are not doing run time linking.
2171 library_names_spec='${libname}${release}.a $libname.a'
2172 soname_spec='${libname}${release}${shared_ext}$major'
2173 fi
2174 shlibpath_var=LIBPATH
2175 fi
2176 ;;
2177
2178 amigaos*)
2179 case $host_cpu in
2180 powerpc)
2181 # Since July 2007 AmigaOS4 officially supports .so libraries.
2182 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2183 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2184 ;;
2185 m68k)
2186 library_names_spec='$libname.ixlibrary $libname.a'
2187 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2188 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2189 ;;
2190 esac
2191 ;;
2192
2193 beos*)
2194 library_names_spec='${libname}${shared_ext}'
2195 dynamic_linker="$host_os ld.so"
2196 shlibpath_var=LIBRARY_PATH
2197 ;;
2198
2199 bsdi[[45]]*)
2200 version_type=linux
2201 need_version=no
2202 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2203 soname_spec='${libname}${release}${shared_ext}$major'
2204 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2205 shlibpath_var=LD_LIBRARY_PATH
2206 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2207 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2208 # the default ld.so.conf also contains /usr/contrib/lib and
2209 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2210 # libtool to hard-code these into programs
2211 ;;
2212
2213 cygwin* | mingw* | pw32* | cegcc*)
2214 version_type=windows
2215 shrext_cmds=".dll"
2216 need_version=no
2217 need_lib_prefix=no
2218
2219 case $GCC,$host_os in
2220 yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
2221 library_names_spec='$libname.dll.a'
2222 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2223 postinstall_cmds='base_file=`basename \${file}`~
2224 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2225 dldir=$destdir/`dirname \$dlpath`~
2226 test -d \$dldir || mkdir -p \$dldir~
2227 $install_prog $dir/$dlname \$dldir/$dlname~
2228 chmod a+x \$dldir/$dlname~
2229 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2230 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2231 fi'
2232 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2233 dlpath=$dir/\$dldll~
2234 $RM \$dlpath'
2235 shlibpath_overrides_runpath=yes
2236
2237 case $host_os in
2238 cygwin*)
2239 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2240 #soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2241 soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}'
2242 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
2243 ;;
2244 mingw* | cegcc*)
2245 # MinGW DLLs use traditional 'lib' prefix
2246 #soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2247 soname_spec='`echo ${libname} | $SED -e 's/^lib//'`${shared_ext}'
2248 sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2249 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2250 # It is most probably a Windows format PATH printed by
2251 # mingw gcc, but we are running on Cygwin. Gcc prints its search
2252 # path with ; separators, and with drive letters. We can handle the
2253 # drive letters (cygwin fileutils understands them), so leave them,
2254 # especially as we might pass files found there to a mingw objdump,
2255 # which wouldn't understand a cygwinified path. Ahh.
2256 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2257 else
2258