diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:30:32 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:30:32 -0800 |
commit | 8b23a6c7e1aee255004dd19098d4c2462b61b849 (patch) | |
tree | 7a4d682ba51f0ff0364c5ca2509f515bdaf96de9 /android/config | |
parent | f721e3ac031f892af46f255a47d7f54a91317b30 (diff) | |
download | external_qemu-8b23a6c7e1aee255004dd19098d4c2462b61b849.zip external_qemu-8b23a6c7e1aee255004dd19098d4c2462b61b849.tar.gz external_qemu-8b23a6c7e1aee255004dd19098d4c2462b61b849.tar.bz2 |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'android/config')
-rw-r--r-- | android/config/Linux/config-host.h | 10 | ||||
-rw-r--r-- | android/config/check-alsa.c | 107 | ||||
-rw-r--r-- | android/config/check-esd.c | 67 | ||||
-rw-r--r-- | android/config/config.h | 14 | ||||
-rw-r--r-- | android/config/darwin-ppc/config-host.h | 13 | ||||
-rw-r--r-- | android/config/darwin-x86/config-host.h | 13 | ||||
-rw-r--r-- | android/config/linux-x86/config-host.h | 10 | ||||
-rw-r--r-- | android/config/windows/config-host.h | 10 |
8 files changed, 244 insertions, 0 deletions
diff --git a/android/config/Linux/config-host.h b/android/config/Linux/config-host.h new file mode 100644 index 0000000..90defbd --- /dev/null +++ b/android/config/Linux/config-host.h @@ -0,0 +1,10 @@ +/* Automatically generated by configure - do not modify */ +#define CONFIG_QEMU_SHAREDIR "/usr/local/share/qemu" +#define HOST_I386 1 +#define HOST_LONG_BITS 32 +#define HAVE_BYTESWAP_H 1 +#define CONFIG_GDBSTUB 1 +#define CONFIG_SLIRP 1 +#define QEMU_VERSION "0.8.2" +#define CONFIG_SKINS 1 +#define CONFIG_UNAME_RELEASE "" diff --git a/android/config/check-alsa.c b/android/config/check-alsa.c new file mode 100644 index 0000000..4ab2945 --- /dev/null +++ b/android/config/check-alsa.c @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include <dlfcn.h> +#include <stdio.h> +#include <alsa/asoundlib.h> + +#define D(...) fprintf(stderr,__VA_ARGS__) +#define STRINGIFY(x) _STRINGIFY(x) +#define _STRINGIFY(x) #x + +#define DYN_SYMBOLS \ + DYN_FUNCTION(size_t,snd_pcm_sw_params_sizeof,(void)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_current,(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)) \ + DYN_FUNCTION(int,snd_pcm_sw_params_set_start_threshold,(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)) \ + DYN_FUNCTION(int,snd_pcm_sw_params,(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)) \ + DYN_FUNCTION(int,snd_pcm_sw_params_current,(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)) \ + DYN_FUNCTION(size_t,snd_pcm_hw_params_sizeof,(void)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_any,(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_set_access,(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_set_format,(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_set_rate_near,(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_set_channels_near,(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_set_buffer_time_near,(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)) \ + DYN_FUNCTION(int,snd_pcm_hw_params,(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_get_buffer_size,(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)) \ + DYN_FUNCTION(int,snd_pcm_prepare,(snd_pcm_t *pcm)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_get_period_size,(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_get_period_size_min,(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_set_period_size,(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_get_buffer_size_min,(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_set_buffer_size,(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val)) \ + DYN_FUNCTION(int,snd_pcm_hw_params_set_period_time_near,(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)) \ + DYN_FUNCTION(snd_pcm_sframes_t,snd_pcm_avail_update,(snd_pcm_t *pcm)) \ + DYN_FUNCTION(int,snd_pcm_drop,(snd_pcm_t *pcm)) \ + DYN_FUNCTION(snd_pcm_sframes_t,snd_pcm_writei,(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size)) \ + DYN_FUNCTION(snd_pcm_sframes_t,snd_pcm_readi,(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size)) \ + DYN_FUNCTION(snd_pcm_state_t,snd_pcm_state,(snd_pcm_t *pcm)) \ + DYN_FUNCTION(const char*,snd_strerror,(int errnum)) \ + DYN_FUNCTION(int,snd_pcm_open,(snd_pcm_t **pcm, const char *name,snd_pcm_stream_t stream, int mode)) \ + DYN_FUNCTION(int,snd_pcm_close,(snd_pcm_t *pcm)) \ + + + +/* define pointers to library functions we're going to use */ +#define DYN_FUNCTION(ret,name,sig) \ + static ret (*func_ ## name)sig; + +DYN_SYMBOLS + +#undef DYN_FUNCTION + +#define func_snd_pcm_hw_params_alloca(ptr) \ + do { assert(ptr); *ptr = (snd_pcm_hw_params_t *) alloca(func_snd_pcm_hw_params_sizeof()); memset(*ptr, 0, func_snd_pcm_hw_params_sizeof()); } while (0) + +#define func_snd_pcm_sw_params_alloca(ptr) \ + do { assert(ptr); *ptr = (snd_pcm_sw_params_t *) alloca(func_snd_pcm_sw_params_sizeof()); memset(*ptr, 0, func_snd_pcm_sw_params_sizeof()); } while (0) + +static void* alsa_lib; + +int main(void) +{ + int result = 1; + + alsa_lib = dlopen( "libasound.so", RTLD_NOW ); + if (alsa_lib == NULL) + alsa_lib = dlopen( "libasound.so.2", RTLD_NOW ); + + if (alsa_lib == NULL) { + D("could not find libasound on this system\n"); + return 1; + } + +#undef DYN_FUNCTION +#define DYN_FUNCTION(ret,name,sig) \ + do { \ + (func_ ##name) = dlsym( alsa_lib, STRINGIFY(name) ); \ + if ((func_##name) == NULL) { \ + D("could not find %s in libasound\n", STRINGIFY(name)); \ + goto Fail; \ + } \ + } while (0); + + DYN_SYMBOLS + + result = 0; + goto Exit; + +Fail: + D("failed to open library\n"); + +Exit: + dlclose(alsa_lib); + return result; +} diff --git a/android/config/check-esd.c b/android/config/check-esd.c new file mode 100644 index 0000000..a8eb11b --- /dev/null +++ b/android/config/check-esd.c @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* this file is used to test that we can use libesd with lazy dynamic linking */ + +#include <esd.h> +#include <dlfcn.h> +#include <stdio.h> + +#define D(...) fprintf(stderr,__VA_ARGS__) +#define STRINGIFY(x) _STRINGIFY(x) +#define _STRINGIFY(x) #x + +#define ESD_SYMBOLS \ + ESD_FUNCTION(int,esd_play_stream,(esd_format_t,int,const char*,const char*)) \ + ESD_FUNCTION(int,esd_record_stream,(esd_format_t,int,const char*,const char*)) \ + ESD_FUNCTION(int,esd_open_sound,( const char *host )) \ + ESD_FUNCTION(int,esd_close,(int)) \ + +/* define pointers to library functions we're going to use */ +#define ESD_FUNCTION(ret,name,sig) \ + static ret (*func_ ## name)sig; + +ESD_SYMBOLS + +#undef ESD_FUNCTION +static void* esd_lib; + +int main( void ) +{ + int fd; + + esd_lib = dlopen( "libesd.so", RTLD_NOW ); + if (esd_lib == NULL) + esd_lib = dlopen( "libesd.so.0", RTLD_NOW ); + + if (esd_lib == NULL) { + D("could not find libesd on this system"); + return 1; + } + +#undef ESD_FUNCTION +#define ESD_FUNCTION(ret,name,sig) \ + do { \ + (func_ ##name) = dlsym( esd_lib, STRINGIFY(name) ); \ + if ((func_##name) == NULL) { \ + D("could not find %s in libesd\n", STRINGIFY(name)); \ + return 1; \ + } \ + } while (0); + + ESD_SYMBOLS + + return 0; +} diff --git a/android/config/config.h b/android/config/config.h new file mode 100644 index 0000000..be83607 --- /dev/null +++ b/android/config/config.h @@ -0,0 +1,14 @@ +/* Automatically generated by configure - do not modify */ +#include "config-host.h" +#define CONFIG_QEMU_PREFIX "/usr/gnemul/qemu-arm" +#define TARGET_ARCH "arm" +#define TARGET_ARM 1 +#define CONFIG_TRACE 1 +#define CONFIG_NAND 1 +#define CONFIG_SHAPER 1 +#define CONFIG_SOFTMMU 1 +#define CONFIG_SOFTFLOAT 1 +#define CONFIG_SDL 1 +#ifndef _WIN32 +#define CONFIG_NAND_LIMITS 1 +#endif diff --git a/android/config/darwin-ppc/config-host.h b/android/config/darwin-ppc/config-host.h new file mode 100644 index 0000000..cbd43d1 --- /dev/null +++ b/android/config/darwin-ppc/config-host.h @@ -0,0 +1,13 @@ +/* Automatically generated by configure - do not modify */ +#define CONFIG_QEMU_SHAREDIR "/usr/local/share/qemu" +#define HOST_PPC 1 +#define HOST_LONG_BITS 32 +#define CONFIG_DARWIN 1 +#define CONFIG_GDBSTUB 1 +#define CONFIG_SLIRP 1 +#define QEMU_VERSION "0.8.2" +#define O_LARGEFILE 0 +#define MAP_ANONYMOUS MAP_ANON +#define _BSD 1 +#define CONFIG_SKINS 1 +#define CONFIG_UNAME_RELEASE "" diff --git a/android/config/darwin-x86/config-host.h b/android/config/darwin-x86/config-host.h new file mode 100644 index 0000000..aaf0195 --- /dev/null +++ b/android/config/darwin-x86/config-host.h @@ -0,0 +1,13 @@ +/* Automatically generated by configure - do not modify */ +#define CONFIG_QEMU_SHAREDIR "/usr/local/share/qemu" +#define HOST_I386 1 +#define HOST_LONG_BITS 32 +#define CONFIG_DARWIN 1 +#define CONFIG_GDBSTUB 1 +#define CONFIG_SLIRP 1 +#define QEMU_VERSION "0.8.2" +#define O_LARGEFILE 0 +#define MAP_ANONYMOUS MAP_ANON +#define _BSD 1 +#define CONFIG_SKINS 1 +#define CONFIG_UNAME_RELEASE "" diff --git a/android/config/linux-x86/config-host.h b/android/config/linux-x86/config-host.h new file mode 100644 index 0000000..90defbd --- /dev/null +++ b/android/config/linux-x86/config-host.h @@ -0,0 +1,10 @@ +/* Automatically generated by configure - do not modify */ +#define CONFIG_QEMU_SHAREDIR "/usr/local/share/qemu" +#define HOST_I386 1 +#define HOST_LONG_BITS 32 +#define HAVE_BYTESWAP_H 1 +#define CONFIG_GDBSTUB 1 +#define CONFIG_SLIRP 1 +#define QEMU_VERSION "0.8.2" +#define CONFIG_SKINS 1 +#define CONFIG_UNAME_RELEASE "" diff --git a/android/config/windows/config-host.h b/android/config/windows/config-host.h new file mode 100644 index 0000000..8f9e0d9 --- /dev/null +++ b/android/config/windows/config-host.h @@ -0,0 +1,10 @@ +/* Automatically generated by configure - do not modify */ +#define CONFIG_QEMU_SHAREDIR "/usr/local/share/qemu" +#define HOST_I386 1 +#define HOST_LONG_BITS 32 +#define CONFIG_WIN32 1 +#define CONFIG_GDBSTUB 1 +#define CONFIG_SLIRP 1 +#define QEMU_VERSION "0.8.2" +#define CONFIG_SKINS 1 +#define CONFIG_UNAME_RELEASE "" |