summaryrefslogtreecommitdiff
path: root/beecrypt/acinclude.m4
blob: deda40d8f9163322c9ca0dedc6df23556be0a429 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
dnl  BeeCrypt specific autoconf macros

dnl  Copyright 2003 Bob Deblier <bob.deblier@pandora.be>
dnl
dnl  This file is part of the BeeCrypt crypto library
dnl  
dnl
dnl  LGPL


dnl  BEECRYPT_INT_TYPES
AC_DEFUN(BEECRYPT_INT_TYPES,[
  AC_TYPE_SIZE_T
  bc_typedef_size_t=
  if test $ac_cv_type_size_t != yes; then
    bc_typedef_size_t="typedef unsigned size_t;"
  fi
  AC_SUBST(TYPEDEF_SIZE_T,$bc_typedef_size_t)
  if test $ac_cv_header_inttypes_h = yes; then
    AC_SUBST(INCLUDE_INTTYPES_H,["#include <inttypes.h>"])
  else
    AC_SUBST(INCLUDE_INTTYPES_H,[ ])
  fi
  if test $ac_cv_header_stdint_h = yes; then
    AC_SUBST(INCLUDE_STDINT_H,["#include <stdint.h>"])
  else
    AC_SUBST(INCLUDE_STDINT_H,[ ])
  fi
  AH_TEMPLATE([HAVE_INT64_T])
  AH_TEMPLATE([HAVE_UINT64_T])
  bc_typedef_int8_t=
  AC_CHECK_TYPE([int8_t],,[
    AC_CHECK_SIZEOF([signed char])
    if test $ac_cv_sizeof_signed_char -eq 1; then
      bc_typedef_int8_t="typedef signed char int8_t;"
    fi
    ])
  AC_SUBST(TYPEDEF_INT8_T,$bc_typedef_int8_t)
  bc_typedef_int16_t=
  AC_CHECK_TYPE([int16_t],,[
    AC_CHECK_SIZEOF([short])
    if test $ac_cv_sizeof_short -eq 2; then
      bc_typedef_int16_t="typedef short int16_t;"
    fi
    ])
  AC_SUBST(TYPEDEF_INT16_T,$bc_typedef_int16_t)
  bc_typedef_int32_t=
  AC_CHECK_TYPE([int32_t],,[
    AC_CHECK_SIZEOF([int])
    if test $ac_cv_sizeof_int -eq 4; then
      bc_typedef_int32_t="typedef int int32_t;"
    fi
    ])
  AC_SUBST(TYPEDEF_INT32_T,$bc_typedef_int32_t)
  bc_typedef_int64_t=
  AC_CHECK_TYPE([int64_t],[
    AC_DEFINE([HAVE_INT64_T],1)
    ],[
    AC_CHECK_SIZEOF([long])
    if test $ac_cv_sizeof_long -eq 8; then
      bc_typedef_int64_t="typedef long int64_t;"
    else
      AC_CHECK_SIZEOF([long long])
      if test $ac_cv_sizeof_long_long -eq 8; then
        AC_DEFINE([HAVE_INT64_T],1)
        bc_typedef_int64_t="typedef long long int64_t;"
      fi
    fi
    ])
  AC_SUBST(TYPEDEF_INT64_T,$bc_typedef_int64_t)
  bc_typedef_uint8_t=
  AC_CHECK_TYPE([uint8_t],,[
    AC_CHECK_SIZEOF([unsigned char])
    if test $ac_cv_sizeof_unsigned_char -eq 1; then
      bc_typedef_uint8_t="typedef unsigned char uint8_t;"
    fi
    ])
  AC_SUBST(TYPEDEF_UINT8_T,$bc_typedef_uint8_t)
  bc_typedef_uint16_t=
  AC_CHECK_TYPE([uint16_t],,[
    AC_CHECK_SIZEOF([unsigned short])
    if test $ac_cv_sizeof_unsigned_short -eq 2; then
      bc_typedef_uint16_t="typedef unsigned short uint16_t;"
    fi
    ])
  AC_SUBST(TYPEDEF_UINT16_T,$bc_typedef_uint16_t)
  bc_typedef_uint32_t=
  AC_CHECK_TYPE([uint32_t],,[
    AC_CHECK_SIZEOF([unsigned int])
    if test $ac_cv_sizeof_unsigned_int -eq 4; then
      bc_typedef_uint32_t="typedef unsigned int uint32_t;"
    fi
    ])
  AC_SUBST(TYPEDEF_UINT32_T,$bc_typedef_uint32_t)
  bc_typedef_uint64_t=
  AC_CHECK_TYPE([uint64_t],[
    AC_DEFINE([HAVE_UINT64_T],1)
    ],[
    AC_CHECK_SIZEOF([unsigned long])
    if test $ac_cv_sizeof_unsigned_long -eq 8; then
      bc_typedef_uint64_t="typedef unsigned long uint64_t;"
    else
      AC_CHECK_SIZEOF([unsigned long long])
      if test $ac_cv_sizeof_unsigned_long_long -eq 8; then
        AC_DEFINE([HAVE_UINT64_T],1)
        bc_typedef_uint64_t="typedef unsigned long long uint64_t;"
      fi
    fi
    ])
  AC_SUBST(TYPEDEF_UINT64_T,$bc_typedef_uint64_t)
  ])


dnl  BEECRYPT_CPU_BITS
AC_DEFUN(BEECRYPT_CPU_BITS,[
  AC_CHECK_SIZEOF([unsigned long])
  if test $ac_cv_sizeof_unsigned_long -eq 8; then
    AC_SUBST(MP_WBITS,64U)
  elif test $ac_cv_sizeof_unsigned_long -eq 4; then
    AC_SUBST(MP_WBITS,32U)
  else
    AC_MSG_ERROR([Illegal CPU word size])
  fi
  ])


dnl  BEECRYPT_WORKING_AIO
AC_DEFUN(BEECRYPT_WORKING_AIO,[
  AC_CHECK_HEADERS(aio.h)
  if test "$ac_cv_header_aio_h" = yes; then
    AC_SEARCH_LIBS([aio_read],[c rt aio posix4],[
      AC_CACHE_CHECK([whether aio works],bc_cv_working_aio,[
        cat > conftest.aio << EOF
The quick brown fox jumps over the lazy dog.
EOF
        AC_RUN_IFELSE([AC_LANG_SOURCE([[
#if HAVE_ERRNO_H
# include <errno.h>
#endif
#if HAVE_FCNTL_H
# include <fcntl.h>
#endif
#if HAVE_STRING_H
# include <string.h>
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <stdio.h>
#include <aio.h>

main()
{
        struct aiocb    a;
  const struct aiocb*   a_list = &a;
        struct timespec a_timeout;

  char buffer[32];

  int i, rc, fd = open("conftest.aio", O_RDONLY);

  if (fd < 0)
    exit(1);

  memset(&a, 0, sizeof(struct aiocb));

  a.aio_fildes = fd;
  a.aio_offset = 0;
  a.aio_reqprio = 0;
  a.aio_buf = buffer;
  a.aio_nbytes = sizeof(buffer);
  a.aio_sigevent.sigev_notify = SIGEV_NONE;

  a_timeout.tv_sec = 1;
  a_timeout.tv_nsec = 0;

  if (aio_read(&a) < 0)
  {
    perror("aio_read");
    exit(1);
  }
  if (aio_suspend(&a_list, 1, &a_timeout) < 0)
  {
    #if HAVE_ERRNO_H
    /* some linux systems don't await timeout and return instantly */
    if (errno == EAGAIN)
    {
      nanosleep(&a_timeout, (struct timespec*) 0);

      if (aio_suspend(&a_list, 1, &a_timeout) < 0)
      {
        perror("aio_suspend");
        exit(1);
      }
    }
    else
    {
      perror("aio_suspend");
      exit(1);
    }
    #else
    exit(1);
    #endif
  }
  if (aio_error(&a) < 0)
    exit(1);

  if (aio_return(&a) < 0)
    exit(1);

  exit(0);
}
          ]])],[bc_cv_working_aio=yes],[bc_cv_working_aio=no],[
            case $target_os in
              linux* | solaris*)
                bc_cv_working_aio=yes ;;
             *)
                bc_cv_working_aio=no ;;
            esac
          ])
        ],[
        bc_cv_working_aio=no
        ])
      ])
    rm -fr conftest.aio
  fi
  ])


dnl  BEECRYPT_CFLAGS_REM
AC_DEFUN(BEECRYPT_CFLAGS_REM,[
  if test "$CFLAGS" != ""; then
    CFLAGS_save=""
    for flag in $CFLAGS
    do
      if test "$flag" != "$1"; then
        CFLAGS_save="$CFLAGS_save $flag"
      fi
    done
    CFLAGS="$CFLAGS_save"
  fi
  ])


dnl  BEECRYPT_GNU_CC
AC_DEFUN(BEECRYPT_GNU_CC,[
  AC_REQUIRE([AC_PROG_CC])
  case $bc_target_arch in
  ia64)
    case $target_os in
    # HP/UX on Itanium needs to be told that a long is 64-bit!
    hpux*)
      CFLAGS="$CFLAGS -mlp64"
      ;;
    esac
    ;;
  # PowerPC needs a signed char
  powerpc)
    CFLAGS="$CFLAGS -fsigned-char"
    ;;
  powerpc64)
    CFLAGS="$CFLAGS -fsigned-char"
    case $target_os in
    aix*)
      CC="$CC -maix64"
      LDFLAGS="$LDFLAGS -b64"
      ;;
    esac
    ;;
  esac
  # Certain platforms needs special flags for multi-threaded code
  if test "$ac_enable_threads" = yes; then
    case $target_os in
    freebsd*)
      CFLAGS="$CFLAGS -pthread"
      CPPFLAGS="$CPPFLAGS -pthread"
      LDFLAGS="$LDFLAGS -pthread"
      ;;
    esac
  fi
  if test "$ac_enable_debug" = yes; then
    BEECRYPT_CFLAGS_REM([-O2])
    CFLAGS="$CFLAGS -Wall -pedantic"
  else
    # Generic optimizations, including cpu tuning
    BEECRYPT_CFLAGS_REM([-g])
    BEECRYPT_CFLAGS_REM([-O2])
    CFLAGS="$CFLAGS -O3 -fomit-frame-pointer"
    case $bc_target_cpu in
    athlon*)
      CFLAGS="$CFLAGS -mcpu=pentiumpro";
      ;;
    i586)
      CFLAGS="$CFLAGS -mcpu=pentium"
      ;;
    i686)
      CFLAGS="$CFLAGS -mcpu=pentiumpro"
      ;;
    ia64)
      # no -mcpu=... option on ia64
      ;;
    pentium*)
      CFLAGS="$CFLAGS -mcpu=$bc_target_arch"
      ;;
    esac
    # Architecture-specific optimizations
    case $bc_target_arch in
    athlon*)
      CFLAGS="$CFLAGS -march=$bc_target_arch"
      ;;
    i586)
      CFLAGS="$CFLAGS -march=pentium"
      ;;
    i686)
      CFLAGS="$CFLAGS -march=pentiumpro"
      ;;
    pentium*)
      CFLAGS="$CFLAGS -march=$bc_target_arch"
      ;;
    powerpc)
      CFLAGS="$CFLAGS -mcpu=powerpc"
      ;;
    powerpc64)
      CFLAGS="$CFLAGS -mcpu=powerpc64"
      ;;
    sparcv8)
      CFLAGS="$CFLAGS -mv8"
      ;;
    sparcv8plus)
      CFLAGS="$CFLAGS -mv8plus"
      ;;
    esac
  fi
  ])


dnl  BEECRYPT_COMPAQ_CC
AC_DEFUN(BEECRYPT_COMPAQ_CC,[
  AC_REQUIRE([AC_PROG_CC])
  AC_REQUIRE([AC_PROG_CPP])
  AC_CACHE_CHECK([whether we are using Compaq's C compiler],bc_cv_prog_COMPAQ_CC,[
    AC_EGREP_CPP(yes,[
      #ifdef __DECC
        yes;
      #endif
      ],bc_cv_prog_COMPAQ_CC=yes,bc_cv_prog_COMPAQ_CC=no)
    ])
  if test "$bc_cv_prog_COMPAQ_CC" = yes; then
    if test "$ac_enable_threads" = yes; then
      CFLAGS="$CFLAGS -pthread"
      CPPFLAGS="$CPPFLAGS -pthread"
    fi
    if test "$ac_enable_debug" != yes; then
      BEECRYPT_CFLAGS_REM([-g])
      CFLAGS="$CFLAGS -fast"
    fi
  fi
  ])


dnl  BEECRYPT_HPUX_CC
AC_DEFUN(BEECRYPT_HPUX_CC,[
  if test "$ac_enable_debug" != yes; then
    BEECRYPT_CFLAGS_REM([-g])
    CFLAGS="$CFLAGS -fast"
  fi
  ])


dnl  BEECRYPT_IBM_CC
AC_DEFUN(BEECRYPT_IBM_CC,[
  AC_REQUIRE([AC_PROG_CC])
  AC_REQUIRE([AC_PROG_CPP])
  AC_CACHE_CHECK([whether we are using IBM C],bc_cv_prog_IBM_CC,[
    AC_EGREP_CPP(yes,[
      #ifdef __IBMC__
        yes;
      #endif
      ],bc_cv_prog_IBM_CC=yes,bc_cv_prog_IBM_CC=no)
    ])
  if test "$bc_cv_prog_IBM_CC" = yes; then
    case $bc_target_arch in
    powerpc)
      CC="$CC -q32 -qarch=ppc"
      ;;
    powerpc64)
      CC="$CC -q64 -qarch=ppc64"
      ;;
    esac
    if test "$ac_enable_debug" != yes; then
      BEECRYPT_CFLAGS_REM([-g])
      if test "$ac_with_arch" = yes; then
        CFLAGS="$CFLAGS -O5"
      else
        CFLAGS="$CFLAGS -O3"
      fi
    fi
    # Version 5.0 doesn't have this, but 6.0 does
    AC_CHECK_FUNC([__rotatel4])
  fi
  ])


dnl  BEECRYPT_INTEL_CC
AC_DEFUN(BEECRYPT_INTEL_CC,[
  AC_REQUIRE([AC_PROG_CC])
  AC_REQUIRE([AC_PROG_CPP])
  AC_CACHE_CHECK([whether we are using Intel C++],bc_cv_prog_INTEL_CC,[
    AC_EGREP_CPP(yes,[
      #ifdef __INTEL_COMPILER
        yes;
      #endif
      ],bc_cv_prog_INTEL_CC=yes,bc_cv_prog_INTEL_CC=no)
    ])
  if test "$bc_cv_prog_INTEL_CC" = yes; then
    if test "$ac_enable_debug" != yes; then
      BEECRYPT_CFLAGS_REM([-g])
      CFLAGS="$CFLAGS -O3"
      case $bc_target_cpu in
      i586 | pentium | pentium-mmx)
        CFLAGS="$CFLAGS -mcpu=pentium"
        ;;
      i686 | pentiumpro | pentium[[23]])
        CFLAGS="$CFLAGS -mcpu=pentiumpro"
        ;;
      pentium4)
        CFLAGS="$CFLAGS -mcpu=pentium4"
        ;;
      esac
      case $bc_target_arch in
      i586 | pentium | pentium-mmx)
        CFLAGS="$CFLAGS -tpp5"
        ;;
      i686 | pentiumpro)
        CFLAGS="$CFLAGS -tpp6 -march=pentiumpro"
        ;;
      pentium2)
        CFLAGS="$CFLAGS -tpp6 -march=pentiumii"
        ;;
      pentium3)
        CFLAGS="$CFLAGS -tpp6 -march=pentiumiii"
        ;;
      pentium4)
        CFLAGS="$CFLAGS -tpp7 -march=pentium4"
        ;;
      esac
    fi
    AC_CHECK_FUNC([_rotl])
    AC_CHECK_FUNC([_rotr])
  fi
  ])


dnl  BEECRYPT_SUN_FORTE_CC
AC_DEFUN(BEECRYPT_SUN_FORTE_CC,[
  AC_REQUIRE([AC_PROG_CC])
  AC_REQUIRE([AC_PROG_CPP])
  AC_CACHE_CHECK([whether we are using Sun Forte C],bc_cv_prog_SUN_FORTE_CC,[
    AC_EGREP_CPP(yes,[
      #ifdef __SUNPRO_C
        yes;
      #endif
      ],bc_cv_prog_SUN_FORTE_CC=yes,bc_cv_prog_SUN_FORTE_CC=no)
    ])
  if test "$bc_cv_prog_SUN_FORTE_CC" = yes; then
    if test "$ac_enable_threads" = yes; then
      CFLAGS="$CFLAGS -mt"
    fi
    if test "$ac_enable_debug" != yes; then
      BEECRYPT_CFLAGS_REM([-g])
      CFLAGS="$CFLAGS -fast"
      case $bc_target_arch in
      sparc)
        CFLAGS="$CFLAGS -xtarget=generic -xarch=generic"
        ;;
      sparcv8)
        CFLAGS="$CFLAGS -xtarget=generic -xarch=v8"
        ;;
      sparcv8plus*)
        CFLAGS="$CFLAGS -xtarget=generic -xarch=v8plus"
        ;;
      sparcv9*)
        CFLAGS="$CFLAGS -xtarget=generic64 -xarch=v9"
        ;;
      esac
    fi
  fi
  ])


dnl  BEECRYPT_ASM_DEFS
AC_DEFUN(BEECRYPT_ASM_DEFS,[
  AC_SUBST(ASM_OS,$target_os)
  AC_SUBST(ASM_CPU,$bc_target_cpu)
  AC_SUBST(ASM_ARCH,$bc_target_arch)
  AC_SUBST(ASM_BIGENDIAN,$ac_cv_c_bigendian)
  ])


dnl  BEECRYPT_ASM_TEXTSEG
AC_DEFUN(BEECRYPT_ASM_TEXTSEG,[
  AC_CACHE_CHECK([how to switch to text segment],
    bc_cv_asm_textseg,[
      case $target_os in
      aix*)
        bc_cv_asm_textseg=[".csect .text[PR]"] ;;
      hpux*)
        if test "$bc_target_arch" = ia64; then
          bc_cv_asm_textseg=[".section .text"]
        else
          bc_cv_asm_textseg=".code"
        fi
        ;;
      *)
        bc_cv_asm_textseg=".text" ;;
      esac
    ])
  AC_SUBST(ASM_TEXTSEG,$bc_cv_asm_textseg)
  ])


dnl  BEECRYPT_ASM_GLOBL
AC_DEFUN(BEECRYPT_ASM_GLOBL,[
  AC_CACHE_CHECK([how to declare a global symbol],
    bc_cv_asm_globl,[
      case $target_os in
      hpux*) bc_cv_asm_globl=".export" ;;
      *)     bc_cv_asm_globl=".globl" ;;
      esac
    ])
  AC_SUBST(ASM_GLOBL,$bc_cv_asm_globl)
  ])


dnl  BEECRYPT_ASM_GSYM_PREFIX
AC_DEFUN(BEECRYPT_ASM_GSYM_PREFIX,[
  AC_CACHE_CHECK([if global symbols need leading underscore],
    bc_cv_asm_gsym_prefix,[
      case $target_os in
      cygwin* | darwin*) bc_cv_asm_gsym_prefix="_" ;;
      *)                 bc_cv_asm_gsym_prefix="" ;;
      esac
    ])
  AC_SUBST(ASM_GSYM_PREFIX,$bc_cv_asm_gsym_prefix)
  ])


dnl  BEECRYPT_ASM_LSYM_PREFIX
AC_DEFUN(BEECRYPT_ASM_LSYM_PREFIX,[
  AC_CACHE_CHECK([how to declare a local symbol],
    bc_cv_asm_lsym_prefix,[
      case $target_os in
      aix* | darwin*) bc_cv_asm_lsym_prefix="L" ;;
      hpux* | osf*)   bc_cv_asm_lsym_prefix="$" ;;
      linux*)
        case $target_cpu in
        alpha*)       bc_cv_asm_lsym_prefix="$" ;;
        *)            bc_cv_asm_lsym_prefix=".L" ;;
        esac
        ;;
      *)              bc_cv_asm_lsym_prefix=".L" ;;
      esac
    ])
  AC_SUBST(ASM_LSYM_PREFIX,$bc_cv_asm_lsym_prefix)
  ])


dnl  BEECRYPT_ASM_ALIGN
AC_DEFUN(BEECRYPT_ASM_ALIGN,[
  AC_CACHE_CHECK([how to align symbols],
    bc_cv_asm_align,[
      case $target_cpu in
      i[[3456]]86 | athlon*)
        bc_cv_asm_align=".align 4" ;;
      ia64)
        bc_cv_asm_align=".align 16" ;;
      powerpc*)
        bc_cv_asm_align=".align 2" ;;
      s390x)
        bc_cv_asm_align=".align 4" ;;
      sparc*)
        bc_cv_asm_align=".align 4" ;;
      esac
    ])
  AC_SUBST(ASM_ALIGN,$bc_cv_asm_align)
  ])


dnl  BEECRYPT_ASM_SOURCES
AC_DEFUN(BEECRYPT_ASM_SOURCES,[
  echo > mpopt.s
  echo > aesopt.s
  echo > blowfishopt.s
  echo > sha1opt.s
  if test "$ac_enable_debug" != yes; then
    case $bc_target_arch in
    arm)
      AC_CONFIG_COMMANDS([mpopt.arm],[
        m4 $srcdir/gas/mpopt.arm.m4 > mpopt.s
        ])
      ;;
    alpha*)
      AC_CONFIG_COMMANDS([mpopt.alpha],[
        m4 $srcdir/gas/mpopt.alpha.m4 > mpopt.s
        ])
      ;;
    athlon* | i[[3456]]86 | pentium*)
      AC_CONFIG_COMMANDS([aesopt.x86],[
        m4 $srcdir/gas/aesopt.x86.m4 > aesopt.s
        ])
      AC_CONFIG_COMMANDS([mpopt.x86],[
        m4 $srcdir/gas/mpopt.x86.m4 > mpopt.s
        ])
      AC_CONFIG_COMMANDS([sha1opt.x86],[
        m4 $srcdir/gas/sha1opt.x86.m4 > sha1opt.s
        ])
      ;;
    ia64)
      AC_CONFIG_COMMANDS([mpopt.ia64],[
        m4 $srcdir/gas/mpopt.ia64.m4 > mpopt.s
        ])
      ;;
    m68k)
      AC_CONFIG_COMMANDS([mpopt.m68k],[
        m4 $srcdir/gas/mpopt.m68k.m4 > mpopt.s
        ])
      ;;
    powerpc)
      AC_CONFIG_COMMANDS([mpopt.ppc],[
        m4 $srcdir/gas/mpopt.ppc.m4 > mpopt.s
        ])
      AC_CONFIG_COMMANDS([blowfishopt.ppc],[
        m4 $srcdir/gas/blowfishopt.ppc.m4 > blowfishopt.s
        ])
      ;;
    powerpc64)
      AC_CONFIG_COMMANDS([mpopt.ppc64],[
        m4 $srcdir/gas/mpopt.ppc64.m4 > mpopt.s
        ])
      ;;
    s390x)
      AC_CONFIG_COMMANDS([mpopt.s390x],[
        m4 $srcdir/gas/mpopt.s390x.m4 > mpopt.s
        ])
      ;;
    sparcv8)
      AC_CONFIG_COMMANDS([mpopt.sparcv8],[
        m4 $srcdir/gas/mpopt.sparcv8.m4 > mpopt.s
        ])
      ;;
    sparcv8plus)
      AC_CONFIG_COMMANDS([mpopt.sparcv8plus],[
        m4 $srcdir/gas/mpopt.sparcv8plus.m4 > mpopt.s
        ])
      ;;
    x86_64)
      AC_CONFIG_COMMANDS([mpopt.x86_64],[
        m4 $srcdir/gas/mpopt.x86_64.m4 > mpopt.s
        ])
      ;;
    esac
    if test "$ac_with_arch" = yes; then
      # Code is i586-specific!
      case $bc_target_arch in
      athlon* | i[[56]]86 | pentium*)
        AC_CONFIG_COMMANDS([blowfishopt.i586],[
          m4 $srcdir/gas/blowfishopt.i586.m4 > blowfishopt.s
          ])
        ;;
      esac
    fi
  fi
  ])